merge with crm and room fixed
This commit is contained in:
@@ -115,7 +115,7 @@ class Crm::CustomersController < BaseCrmController
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
},
|
||||
:timeout => 100
|
||||
:timeout => 10
|
||||
)
|
||||
|
||||
rescue HTTParty::Error
|
||||
@@ -209,8 +209,6 @@ end
|
||||
},
|
||||
:timeout => 10
|
||||
)
|
||||
puts "hhhhhhhhh"
|
||||
puts response.to_json
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
|
||||
unique_code = "ReceiptBillPdf"
|
||||
customer= Customer.find(saleObj.customer_id)
|
||||
rebate_amount = Customer.get_membership_transactions(customer)
|
||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
#shop detail
|
||||
shop_details = Shop.find(1)
|
||||
# get member information
|
||||
@@ -133,7 +133,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
shop_details = Shop.find(1)
|
||||
# get member information
|
||||
member_info = Customer.get_member_account(customer)
|
||||
rebate_amount = Customer.get_membership_transactions(customer)
|
||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||
# get printer info
|
||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
@complete = Sale.all
|
||||
@orders = Order.all.order('date desc')
|
||||
@room = DiningFacility.find(params[:room_id])
|
||||
@sale_array = Array.new
|
||||
@room.bookings.each do |booking|
|
||||
if booking.sale_id.nil?
|
||||
@order_items = Array.new
|
||||
@@ -23,12 +24,16 @@ class Origami::RoomsController < BaseOrigamiController
|
||||
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status != "completed"
|
||||
@sale_array.push(sale)
|
||||
@status = 'sale'
|
||||
@obj = sale
|
||||
@customer = sale.customer
|
||||
end
|
||||
end
|
||||
end
|
||||
puts "hhhhhhhhhh"
|
||||
puts @status
|
||||
puts @obj.to_json
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ class Transactions::SalesController < ApplicationController
|
||||
end
|
||||
|
||||
@sale_receivables = SalePayment.where('sale_id = ?', @sale.id)
|
||||
@sale_audits = SaleAudit.where('sale_id = ?', @sale.id)
|
||||
|
||||
#get customer amount
|
||||
@customer = Customer.find(@sale.customer_id)
|
||||
|
||||
@@ -46,7 +46,7 @@ class Customer < ApplicationRecord
|
||||
|
||||
end
|
||||
|
||||
def self.get_membership_transactions(customer)
|
||||
def self.get_membership_transactions(customer,receipt_no = nil)
|
||||
membership = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
memberaction = MembershipAction.find_by_membership_type("get_member_transactions")
|
||||
merchant_uid = memberaction.merchant_account_id.to_s
|
||||
@@ -55,13 +55,17 @@ class Customer < ApplicationRecord
|
||||
# urltest =self.url_exist?(url)
|
||||
|
||||
begin
|
||||
response = HTTParty.get(url, :body => { membership_id: customer.membership_id,merchant_uid:merchant_uid,auth_token:auth_token}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
},
|
||||
:timeout => 10
|
||||
)
|
||||
response = HTTParty.get(url,
|
||||
:body => { membership_id: customer.membership_id,
|
||||
receipt_no:receipt_no,
|
||||
merchant_uid:merchant_uid,auth_token:auth_token
|
||||
}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
},
|
||||
:timeout => 10
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false , message: "Server Time out"}
|
||||
|
||||
|
||||
@@ -337,7 +337,7 @@ class SalePayment < ApplicationRecord
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
}, :timeout => 100)
|
||||
}, :timeout => 10)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false , message: "Server Time out"}
|
||||
|
||||
|
||||
@@ -269,20 +269,19 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
if rebate_amount["status"] == true
|
||||
stroke_horizontal_rule
|
||||
rebate = 0
|
||||
balance = 0
|
||||
redeem = 0
|
||||
rebate_amount["data"].each do |res|
|
||||
|
||||
#total redeem amount
|
||||
if res["receipt_no"]== sale_data.receipt_no && res["status"]== "Redeem"
|
||||
redeem = redeem + res["redeem"]
|
||||
|
||||
balance = balance + res["balance"]
|
||||
end
|
||||
|
||||
|
||||
|
||||
#end Total redem
|
||||
#total Rebate Earn
|
||||
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebateAccount" && res["status"]== "Rebate"
|
||||
|
||||
rebate = rebate + res["rebate"]
|
||||
# balance = balance + res["balance"]
|
||||
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
@@ -294,11 +293,9 @@ class ReceiptBillPdf < Prawn::Document
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# Total Rebate Amount if birthday
|
||||
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebateBonusAccount" && res["status"]== "Rebate"
|
||||
|
||||
rebate = rebate + res["rebate"]
|
||||
|
||||
# balance = balance + res["balance"]
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
@@ -307,21 +304,33 @@ class ReceiptBillPdf < Prawn::Document
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(res["balance"], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
|
||||
end
|
||||
|
||||
end
|
||||
#end Total rebate if birthday
|
||||
end
|
||||
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Redeem Amount", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(redeem, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Redeem Amount", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(redeem, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
|
||||
# old = balance + redeem
|
||||
|
||||
# move_down 5
|
||||
# y_position = cursor
|
||||
# bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
# text "Old Balance", :size => self.item_font_size,:align => :left
|
||||
# end
|
||||
# bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
# text "#{number_with_precision(old, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
# end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
if member_info["status"] == true && member_info["data"].present?
|
||||
balance = 0
|
||||
member_info["data"].each do |res|
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<div class="col-lg-4 col-md-4 col-sm-4">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4" style="min-height:600px; max-height:600px; overflow-x:scroll">
|
||||
|
||||
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-7 col-md-7 col-sm-7">
|
||||
|
||||
<div class="main-box-body clearfix">
|
||||
<div class="main-box-body clearfix" style="min-height:500px; max-height:500px; overflow-x:scroll">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-4 col-sm-4">
|
||||
<div class="col-lg-4 col-md-4 col-sm-4" style="min-height:600px; max-height:600px; overflow-x:scroll">
|
||||
<%= simple_form_for @crm_customer,:url => crm_customers_path, :method => :post do |f| %>
|
||||
|
||||
<span class="patch_method"></span>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<p>Date: <span id="receipt_date"> <%=@sale_data.receipt_date.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="card-text" style="min-height:500px; max-height:500px; overflow-x:scroll">
|
||||
<table class="table table-default" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<div class="tab-content" >
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane" id="Completed" role="tabpanel">
|
||||
<div class="tab-pane" id="Completed" role="tabpanel" style="max-height:670px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<div class="tab-pane active" id="tables" role="tabpanel" style="max-height:670px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
@@ -67,7 +67,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="tab-pane" id="rooms" role="tabpanel" style="max-height:670px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
@@ -88,7 +88,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="tab-pane" id="orders" role="tabpanel" style="max-height:670px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#Completed" role="tab">Completed</a>
|
||||
<a class="nav-link" data-toggle="tab" href="#completed" role="tab">Completed</a>
|
||||
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
@@ -21,10 +21,10 @@
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<div class="tab-content">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
|
||||
<div class="tab-pane" id="completed" role="tabpanel">
|
||||
<div class="tab-pane" id="completed" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
@@ -38,7 +38,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<div class="tab-pane active" id="tables" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
@@ -71,7 +71,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="tab-pane" id="rooms" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
@@ -98,7 +98,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="tab-pane" id="orders" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
|
||||
<% @orders.each do |order| %>
|
||||
@@ -150,7 +150,7 @@
|
||||
<%end%>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="card-text" style="min-height:500px; max-height:500px; overflow-x:scroll">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane " id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;min-height:500px; max-height:500px; overflow-x:scroll">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane active" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;min-height:500px; max-height:500px; overflow-x:scroll" >
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
@@ -95,7 +95,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="card-text" style="min-height:500px; max-height:500px; overflow-x:scroll" >
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;min-height:500px; max-height:500px; overflow-x:scroll" >
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>" data-name="<%= table.name %>">
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;min-height:500px; max-height:500px; overflow-x:scroll" >
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>" data-name="<%= room.name %>">
|
||||
@@ -95,7 +95,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="card-text" style="min-height:500px; max-height:500px; overflow-x:scroll" >
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<div class="tab-content">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane " id="completed" role="tabpanel">
|
||||
<div class="tab-pane " id="completed" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
@@ -34,7 +34,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane " id="tables" role="tabpanel">
|
||||
<div class="tab-pane " id="tables" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
@@ -60,7 +60,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="tab-pane" id="rooms" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
@@ -86,7 +86,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane active" id="orders" role="tabpanel">
|
||||
<div class="tab-pane active" id="orders" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||
@@ -140,7 +140,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="card-text" style="max-height:500px; overflow:auto">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<p>Date: <span id="receipt_date"> <%=@sale_data.receipt_date.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="card-text" style="min-height:500px; max-height:500px; overflow-x:scroll">
|
||||
<table class="table table-default" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="card-text" style="max-height:600px; overflow:auto">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<div class="tab-content" >
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane" id="completed" role="tabpanel">
|
||||
<div class="tab-pane" id="completed" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
@@ -34,7 +34,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane " id="tables" role="tabpanel">
|
||||
<div class="tab-pane " id="tables" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
@@ -65,20 +65,27 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane active" id="rooms" role="tabpanel">
|
||||
<div class="tab-pane active" id="rooms" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
<% if room.get_booking.nil? %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"> billed</span>
|
||||
<% else %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"> new</span>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% if room.get_booking.nil? %>
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"> billed</span>
|
||||
<div style="font-size:12px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="card rooms blue text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"> new</span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<div class="card rooms green text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
@@ -91,7 +98,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="tab-pane" id="orders" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||
@@ -114,7 +121,7 @@
|
||||
<div class="card-header">
|
||||
<% if @status == 'order' %>
|
||||
<div id="save_order_id" data-order="<%= @obj.order_id %>"><strong id="order-title">ORDER DETAILS </strong> | Table <%= @room.name rescue "" %></div>
|
||||
<% elsif @status_sale == 'sale' %>
|
||||
<% elsif @status == 'sale' %>
|
||||
<div><strong id="order-title">INVOICE DETAILS </strong> | Table <%= @room.name rescue "" %></div>
|
||||
<% end %>
|
||||
|
||||
@@ -141,7 +148,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="card-text" style="min-height:500px; max-height:500px; overflow-x:scroll">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -218,7 +225,7 @@
|
||||
</div>
|
||||
<br>
|
||||
<%
|
||||
if @status_sale == 'sale'
|
||||
if @status == 'sale'
|
||||
unless @order_items.nil?
|
||||
%>
|
||||
Pending New Order
|
||||
@@ -272,10 +279,10 @@
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<% if @dining.bookings.length >= 1 %>
|
||||
<% if @room.bookings.length >= 1 %>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
|
||||
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<% if @status == 'order' && @status != 'sale' %>
|
||||
<!-- <button type="button" class="btn btn-primary btn-block" >Add Order</button> -->
|
||||
<button type="button" class="btn btn-primary btn-block" disabled >Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" disabled >Discount</button>
|
||||
@@ -332,7 +339,7 @@ $(document).ready(function(){
|
||||
// })
|
||||
|
||||
$('.invoicedetails').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
var dining_id = "<%= @room.id %>";
|
||||
var sale_id = this.id;
|
||||
window.location.href = '/origami/table/'+ dining_id + "/table_invoice/"+sale_id;
|
||||
})
|
||||
@@ -431,7 +438,7 @@ $("#first_bill").on('click', function(){
|
||||
$('#pay').on('click',function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
var url = '/origami/sale/'+ sale_id + "/rounding_adj" ;
|
||||
alert(url)
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: '/origami/sale/'+ sale_id + "/rounding_adj",
|
||||
@@ -466,8 +473,8 @@ $('#back').on('click',function(){
|
||||
})
|
||||
|
||||
$('#add_invoice').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
var dining_id = "<%= @room.id %>"
|
||||
var sale_id = "<%= @obj.sale_id rescue "" %>"
|
||||
var ajax_url = "/origami/sale/append_order";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
@@ -549,8 +556,8 @@ $('#add_invoice').on('click',function(){
|
||||
}
|
||||
|
||||
$('#edit').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
var dining_id = "<%= @room.id %>"
|
||||
var sale_id = "<%= @obj.sale_id rescue "" %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit";
|
||||
});
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="card-text" style="min-height:500px; max-height:500px; overflow-x:scroll">
|
||||
<table class="table " id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<div class="tab-content">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
<div class="tab-pane active" id="completed" role="tabpanel">
|
||||
<div class="tab-pane active" id="completed" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
@@ -34,7 +34,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 1 - Table Orders -->
|
||||
<div class="tab-pane " id="tables" role="tabpanel">
|
||||
<div class="tab-pane " id="tables" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
@@ -60,7 +60,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 2 - Room Orders -->
|
||||
<div class="tab-pane" id="rooms" role="tabpanel">
|
||||
<div class="tab-pane" id="rooms" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
@@ -86,7 +86,7 @@
|
||||
</div>
|
||||
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="tab-pane" id="orders" role="tabpanel" style="max-height:600px; overflow:auto">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||
@@ -126,7 +126,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="card-text" style="max-height:400px; overflow:auto">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="card-text">
|
||||
<div class="card-text" style="max-height:600px; overflow:auto">
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#customer" role="tab">Customer Details</a>
|
||||
</li>
|
||||
<!-- <li class="nav-item">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#sale_audit" role="tab">Sale Audits</a>
|
||||
</li> -->
|
||||
</li>
|
||||
</ul>
|
||||
<!-- Nav tabs - End -->
|
||||
|
||||
@@ -205,15 +205,16 @@
|
||||
<td><%= @customer.address%></td>
|
||||
<td><%= @customer.date_of_birth %></td>
|
||||
</tr>
|
||||
<tr></tr>
|
||||
<tr>
|
||||
<th colspan="8">Membership Transactions</th>
|
||||
<th colspan="5">Membership Transactions</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Redeem</th>
|
||||
<th>Rebate</th>
|
||||
<th>Balance</th>
|
||||
<!-- <th>Account No</th> -->
|
||||
<th>From Account</th>
|
||||
<th>Status</th>
|
||||
<th>Receipt No</th>
|
||||
</tr>
|
||||
@@ -226,7 +227,7 @@
|
||||
<td><%= transaction["redeem"]%></td>
|
||||
<td><%= transaction["rebate"] %></td>
|
||||
<td><%= transaction["balance"] %></td>
|
||||
<!-- <td><%= transaction["account_no"] %></td> -->
|
||||
<td><%= transaction["account_status"] %></td>
|
||||
<td><%= transaction["status"] %></td>
|
||||
<td><%= transaction["receipt_no"] %></td>
|
||||
|
||||
@@ -244,15 +245,24 @@
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Status</th>
|
||||
<th>Action </th>
|
||||
<th>Action At</th>
|
||||
<th>Approved By</th>
|
||||
<th>Approved At</th>
|
||||
<th>Remark</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
|
||||
|
||||
<% @sale_audits.each do |audit| %>
|
||||
<tr>
|
||||
<td><%= audit.action%></td>
|
||||
<td><%= audit.action_at.strftime("%m-%d-%Y %H:%M %p")%></td>
|
||||
<td><%= audit.approved_by.to_datetime.strftime("%m-%d-%Y %H:%M %p")%></td>
|
||||
<td><%= audit.remark%></td>
|
||||
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user