update cloud for print and first bill
This commit is contained in:
@@ -20,50 +20,52 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
|
|
||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||||
puts ENV["SERVER_MODE"]
|
|
||||||
puts "DDDDDDDDDDDDDDDDD"
|
|
||||||
# Print for First Bill to Customer
|
|
||||||
unique_code = "ReceiptBillPdf"
|
|
||||||
#shop detail
|
|
||||||
shop_details = Shop::ShopDetail
|
|
||||||
# customer= Customer.where('customer_id=' +.customer_id)
|
|
||||||
customer = Customer.find(sale_data.customer_id)
|
|
||||||
|
|
||||||
# rounding adjustment
|
Rails.logger.debug ENV["SERVER_MODE"]
|
||||||
if shop_details.is_rounding_adj
|
|
||||||
a = sale_data.grand_total % 25 # Modulus
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
b = sale_data.grand_total / 25 # Division
|
# Print for First Bill to Customer
|
||||||
#not calculate rounding if modulus is 0 and division is even
|
unique_code = "ReceiptBillPdf"
|
||||||
#calculate rounding if modulus is zero or not zero and division are not even
|
#shop detail
|
||||||
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
shop_details = Shop::ShopDetail
|
||||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
# customer= Customer.where('customer_id=' +.customer_id)
|
||||||
rounding_adj = new_total-sale_data.grand_total
|
customer = Customer.find(sale_data.customer_id)
|
||||||
sale_data.update_attributes(grand_total: new_total,old_grand_total: sale_data.grand_total,rounding_adjustment:rounding_adj)
|
|
||||||
|
# rounding adjustment
|
||||||
|
if shop_details.is_rounding_adj
|
||||||
|
a = sale_data.grand_total % 25 # Modulus
|
||||||
|
b = sale_data.grand_total / 25 # Division
|
||||||
|
#not calculate rounding if modulus is 0 and division is even
|
||||||
|
#calculate rounding if modulus is zero or not zero and division are not even
|
||||||
|
if (a != 0.0 && b%2 != 0.0) || (a==0.0 && b%2 !=0)
|
||||||
|
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||||
|
rounding_adj = new_total-sale_data.grand_total
|
||||||
|
sale_data.update_attributes(grand_total: new_total,old_grand_total: sale_data.grand_total,rounding_adjustment:rounding_adj)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
#end rounding adjustment
|
||||||
|
|
||||||
|
# get member information
|
||||||
|
rebate = MembershipSetting.find_by_rebate(1)
|
||||||
|
if customer.membership_id != nil && rebate
|
||||||
|
member_info = Customer.get_member_account(customer)
|
||||||
|
# current_balance = SaleAudit.paymal_search(sale_id)
|
||||||
|
current_balance = 0
|
||||||
end
|
end
|
||||||
#end rounding adjustment
|
# get printer info
|
||||||
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|
||||||
# get member information
|
# find order id by sale id
|
||||||
rebate = MembershipSetting.find_by_rebate(1)
|
# sale_order = SaleOrder.find_by_sale_id(@sale_data.sale_id)
|
||||||
if customer.membership_id != nil && rebate
|
|
||||||
member_info = Customer.get_member_account(customer)
|
# Calculate price_by_accounts
|
||||||
# current_balance = SaleAudit.paymal_search(sale_id)
|
item_price_by_accounts = SaleItem.calculate_price_by_accounts(sale_items)
|
||||||
current_balance = 0
|
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale_items)
|
||||||
|
|
||||||
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
|
|
||||||
|
printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_details, "Frt",current_balance,nil)
|
||||||
end
|
end
|
||||||
# get printer info
|
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
|
||||||
|
|
||||||
# find order id by sale id
|
|
||||||
# sale_order = SaleOrder.find_by_sale_id(@sale_data.sale_id)
|
|
||||||
|
|
||||||
# Calculate price_by_accounts
|
|
||||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(sale_items)
|
|
||||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale_items)
|
|
||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
|
||||||
|
|
||||||
printer.print_receipt_bill(print_settings,cashier_terminal,sale_items,sale_data,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info, shop_details, "Frt",current_balance,nil)
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
@@ -108,40 +110,42 @@ puts "DDDDDDDDDDDDDDDDD"
|
|||||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||||
|
|
||||||
# For Print
|
# For Print
|
||||||
# unique_code = "ReceiptBillPdf"
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
# customer= Customer.find(saleObj.customer_id)
|
unique_code = "ReceiptBillPdf"
|
||||||
|
customer= Customer.find(saleObj.customer_id)
|
||||||
|
|
||||||
# get member information
|
# get member information
|
||||||
rebate = MembershipSetting.find_by_rebate(1)
|
rebate = MembershipSetting.find_by_rebate(1)
|
||||||
credit_data = SalePayment.find_by_sale_id_and_payment_method(sale_id,'creditnote')
|
credit_data = SalePayment.find_by_sale_id_and_payment_method(sale_id,'creditnote')
|
||||||
|
|
||||||
if customer.membership_id != nil && rebate && credit_data.nil?
|
if customer.membership_id != nil && rebate && credit_data.nil?
|
||||||
member_info = Customer.get_member_account(customer)
|
member_info = Customer.get_member_account(customer)
|
||||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||||
current_balance = SaleAudit.paymal_search(sale_id)
|
current_balance = SaleAudit.paymal_search(sale_id)
|
||||||
end
|
|
||||||
|
|
||||||
#for card sale data
|
|
||||||
card_data = Array.new
|
|
||||||
card_sale_trans_ref_no = Sale.getCardSaleTrans(sale_id)
|
|
||||||
if !card_sale_trans_ref_no.nil?
|
|
||||||
card_sale_trans_ref_no.each do |cash_sale_trans|
|
|
||||||
card_res_date = cash_sale_trans.res_date.strftime("%Y-%m-%d").to_s
|
|
||||||
card_res_time = cash_sale_trans.res_time.strftime("%H:%M").to_s
|
|
||||||
card_no = cash_sale_trans.pan.last(4)
|
|
||||||
card_no = card_no.rjust(19,"**** **** **** ")
|
|
||||||
card_data.push({'res_date' => card_res_date, 'res_time' => card_res_time, 'batch_no' => cash_sale_trans.batch_no, 'trace' => cash_sale_trans.trace, 'pan' => card_no, 'app' => cash_sale_trans.app, 'tid' => cash_sale_trans.terminal_id, 'app_code' => cash_sale_trans.app_code, 'ref_no' => cash_sale_trans.ref_no, 'mid' => cash_sale_trans.merchant_id})
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
#for card sale data
|
||||||
# get printer info
|
card_data = Array.new
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
card_sale_trans_ref_no = Sale.getCardSaleTrans(sale_id)
|
||||||
# Calculate Food and Beverage Total
|
if !card_sale_trans_ref_no.nil?
|
||||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
card_sale_trans_ref_no.each do |cash_sale_trans|
|
||||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
card_res_date = cash_sale_trans.res_date.strftime("%Y-%m-%d").to_s
|
||||||
|
card_res_time = cash_sale_trans.res_time.strftime("%H:%M").to_s
|
||||||
|
card_no = cash_sale_trans.pan.last(4)
|
||||||
|
card_no = card_no.rjust(19,"**** **** **** ")
|
||||||
|
card_data.push({'res_date' => card_res_date, 'res_time' => card_res_time, 'batch_no' => cash_sale_trans.batch_no, 'trace' => cash_sale_trans.trace, 'pan' => card_no, 'app' => cash_sale_trans.app, 'tid' => cash_sale_trans.terminal_id, 'app_code' => cash_sale_trans.app_code, 'ref_no' => cash_sale_trans.ref_no, 'mid' => cash_sale_trans.merchant_id})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# get printer info
|
||||||
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
# Calculate Food and Beverage Total
|
||||||
|
item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
||||||
|
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Paid",current_balance,card_data)
|
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Paid",current_balance,card_data)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -246,40 +250,42 @@ puts "DDDDDDDDDDDDDDDDD"
|
|||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||||
|
|
||||||
unique_code = "ReceiptBillPdf"
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
customer= Customer.find(saleObj.customer_id)
|
unique_code = "ReceiptBillPdf"
|
||||||
|
customer= Customer.find(saleObj.customer_id)
|
||||||
|
|
||||||
#shop detail
|
#shop detail
|
||||||
shop_details = Shop::ShopDetail
|
shop_details = Shop::ShopDetail
|
||||||
# get member information
|
# get member information
|
||||||
rebate = MembershipSetting.find_by_rebate(1)
|
rebate = MembershipSetting.find_by_rebate(1)
|
||||||
if customer.membership_id != nil && rebate
|
if customer.membership_id != nil && rebate
|
||||||
member_info = Customer.get_member_account(customer)
|
member_info = Customer.get_member_account(customer)
|
||||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||||
current_balance = SaleAudit.paymal_search(sale_id)
|
current_balance = SaleAudit.paymal_search(sale_id)
|
||||||
end
|
|
||||||
|
|
||||||
#for card sale data
|
|
||||||
card_data = Array.new
|
|
||||||
card_sale_trans_ref_no = Sale.getCardSaleTrans(sale_id)
|
|
||||||
if !card_sale_trans_ref_no.nil?
|
|
||||||
card_sale_trans_ref_no.each do |cash_sale_trans|
|
|
||||||
card_res_date = cash_sale_trans.res_date.strftime("%Y-%m-%d").to_s
|
|
||||||
card_res_time = cash_sale_trans.res_time.strftime("%H:%M").to_s
|
|
||||||
card_no = cash_sale_trans.pan.last(4)
|
|
||||||
card_no = card_no.rjust(19,"**** **** **** ")
|
|
||||||
card_data.push({'res_date' => card_res_date, 'res_time' => card_res_time, 'batch_no' => cash_sale_trans.batch_no, 'trace' => cash_sale_trans.trace, 'pan' => card_no, 'app' => cash_sale_trans.app, 'tid' => cash_sale_trans.terminal_id, 'app_code' => cash_sale_trans.app_code, 'ref_no' => cash_sale_trans.ref_no, 'mid' => cash_sale_trans.merchant_id})
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
# get printer info
|
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
|
||||||
|
|
||||||
# Calculate price_by_accounts
|
#for card sale data
|
||||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
card_data = Array.new
|
||||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
card_sale_trans_ref_no = Sale.getCardSaleTrans(sale_id)
|
||||||
|
if !card_sale_trans_ref_no.nil?
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
card_sale_trans_ref_no.each do |cash_sale_trans|
|
||||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Re-print",current_balance,card_data)
|
card_res_date = cash_sale_trans.res_date.strftime("%Y-%m-%d").to_s
|
||||||
|
card_res_time = cash_sale_trans.res_time.strftime("%H:%M").to_s
|
||||||
|
card_no = cash_sale_trans.pan.last(4)
|
||||||
|
card_no = card_no.rjust(19,"**** **** **** ")
|
||||||
|
card_data.push({'res_date' => card_res_date, 'res_time' => card_res_time, 'batch_no' => cash_sale_trans.batch_no, 'trace' => cash_sale_trans.trace, 'pan' => card_no, 'app' => cash_sale_trans.app, 'tid' => cash_sale_trans.terminal_id, 'app_code' => cash_sale_trans.app_code, 'ref_no' => cash_sale_trans.ref_no, 'mid' => cash_sale_trans.merchant_id})
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# get printer info
|
||||||
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
|
||||||
|
# Calculate price_by_accounts
|
||||||
|
item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
||||||
|
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||||
|
|
||||||
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
|
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "Re-print",current_balance,card_data)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def foc
|
def foc
|
||||||
@@ -316,22 +322,22 @@ puts "DDDDDDDDDDDDDDDDD"
|
|||||||
# Re-call Sale Data
|
# Re-call Sale Data
|
||||||
saleObj = Sale.find(sale_id)
|
saleObj = Sale.find(sale_id)
|
||||||
|
|
||||||
# unique_code = "ReceiptBillPdf"
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
# customer= Customer.find(saleObj.customer_id)
|
unique_code = "ReceiptBillPdf"
|
||||||
|
customer= Customer.find(saleObj.customer_id)
|
||||||
# #shop detail
|
|
||||||
# shop_details = Shop::ShopDetail
|
#shop detail
|
||||||
|
shop_details = Shop::ShopDetail
|
||||||
|
|
||||||
# # get printer info
|
# get printer info
|
||||||
# print_settings=PrintSetting.find_by_unique_code(unique_code)
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
# # Calculate Food and Beverage Total
|
# Calculate Food and Beverage Total
|
||||||
# item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
item_price_by_accounts = SaleItem.calculate_price_by_accounts(saleObj.sale_items)
|
||||||
# discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(saleObj.sale_items)
|
||||||
|
|
||||||
# printer = Printer::ReceiptPrinter.new(print_settings)
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
# printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "FOC")
|
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "FOC",nil,nil)
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
end
|
||||||
printer.print_receipt_bill(print_settings,cashier_terminal,saleObj.sale_items,saleObj,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "FOC",nil,nil)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -76,26 +76,27 @@ class Origami::VoidController < BaseOrigamiController
|
|||||||
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
cashier_zone = CashierTerminalByZone.find_by_zone_id(table.zone_id)
|
||||||
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id)
|
||||||
|
|
||||||
unique_code = "ReceiptBillPdf"
|
if ENV["SERVER_MODE"] != "cloud" #no print in cloud server
|
||||||
customer= Customer.find(sale.customer_id)
|
unique_code = "ReceiptBillPdf"
|
||||||
|
customer= Customer.find(sale.customer_id)
|
||||||
#shop detail
|
|
||||||
shop_details = Shop.find(1)
|
#shop detail
|
||||||
# get member information
|
shop_details = Shop.find(1)
|
||||||
rebate = MembershipSetting.find_by_rebate(1)
|
# get member information
|
||||||
if customer.membership_id != nil && rebate
|
rebate = MembershipSetting.find_by_rebate(1)
|
||||||
member_info = Customer.get_member_account(customer)
|
if customer.membership_id != nil && rebate
|
||||||
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
member_info = Customer.get_member_account(customer)
|
||||||
|
rebate_amount = Customer.get_membership_transactions(customer,saleObj.receipt_no)
|
||||||
|
end
|
||||||
|
# get printer info
|
||||||
|
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
||||||
|
# Calculate Food and Beverage Total
|
||||||
|
item_price_by_accounts = SaleItem.calculate_price_by_accounts(sale.sale_items)
|
||||||
|
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items)
|
||||||
|
|
||||||
|
printer = Printer::ReceiptPrinter.new(print_settings)
|
||||||
|
printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID",current_balance,nil)
|
||||||
end
|
end
|
||||||
# get printer info
|
|
||||||
print_settings=PrintSetting.find_by_unique_code(unique_code)
|
|
||||||
# Calculate Food and Beverage Total
|
|
||||||
item_price_by_accounts = SaleItem.calculate_price_by_accounts(sale.sale_items)
|
|
||||||
discount_price_by_accounts = SaleItem.get_discount_price_by_accounts(sale.sale_items)
|
|
||||||
|
|
||||||
printer = Printer::ReceiptPrinter.new(print_settings)
|
|
||||||
printer.print_receipt_bill(print_settings,cashier_terminal,sale.sale_items,sale,customer.name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details, "VOID",current_balance,nil)
|
|
||||||
|
|
||||||
|
|
||||||
#end print
|
#end print
|
||||||
|
|
||||||
|
|||||||
@@ -395,9 +395,10 @@
|
|||||||
|
|
||||||
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
|
<button type="button" id="commissions" class="btn btn-block bg-blue waves-effect">Commissions</button>
|
||||||
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
||||||
|
<!-- first bill not used in cloud -->
|
||||||
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
<% if ENV["SERVER_MODE"] != "cloud" %>
|
||||||
|
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
||||||
|
<% end %>
|
||||||
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect">Pay</button>
|
<button type="button" id="pay" class="btn btn-block bg-blue waves-effect">Pay</button>
|
||||||
<button type="button" id="void" class="btn btn-block bg-blue waves-effect" active="<%= can? :overall_void, :void %>"> Void</button>
|
<button type="button" id="void" class="btn btn-block bg-blue waves-effect" active="<%= can? :overall_void, :void %>"> Void</button>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -407,6 +408,7 @@
|
|||||||
<% else %>
|
<% else %>
|
||||||
<button type="button" id="check_in" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.check_in") %></button>
|
<button type="button" id="check_in" class="btn btn-block bg-blue waves-effect"><%= t("views.btn.check_in") %></button>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
|
||||||
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
|
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
|
||||||
<span class="hidden" id="membership_id"><%= @obj_sale.customer.membership_id rescue 0%></span>
|
<span class="hidden" id="membership_id"><%= @obj_sale.customer.membership_id rescue 0%></span>
|
||||||
<div class="modal fade" id="paymentModal" tabindex="-1" role="dialog">
|
<div class="modal fade" id="paymentModal" tabindex="-1" role="dialog">
|
||||||
@@ -446,12 +448,15 @@
|
|||||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log(checkReceiptNoInFirstBillData(receipt_no));
|
// console.log(checkReceiptNoInFirstBillData(receipt_no));
|
||||||
// if(checkReceiptNoInFirstBillData(receipt_no,"")){
|
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
|
||||||
// $("#pay").show();
|
if(checkReceiptNoInFirstBillData(receipt_no,"")){
|
||||||
// }else{
|
$("#pay").show();
|
||||||
// $("#pay").hide();
|
}else{
|
||||||
// }
|
$("#pay").hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
/* end check first bill or not*/
|
/* end check first bill or not*/
|
||||||
|
|
||||||
$('.invoicedetails').on('click', function () {
|
$('.invoicedetails').on('click', function () {
|
||||||
|
|||||||
@@ -26,20 +26,22 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
/* start check first bill or not*/
|
/* start check first bill or not*/
|
||||||
var receipt_no = "";
|
var receipt_no = "";
|
||||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
}
|
}
|
||||||
|
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
|
||||||
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
|
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
|
||||||
if(payment_type) {
|
if(payment_type) {
|
||||||
$(".others-payment").hide();
|
$(".others-payment").hide();
|
||||||
$(payment_type).each(function(i){
|
$(payment_type).each(function(i){
|
||||||
$("."+payment_type[i]).show();
|
$("."+payment_type[i]).show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* end check first bill or not*/
|
/* end check first bill or not*/
|
||||||
|
|
||||||
$('.others-payment').on('click',function(){
|
$('.others-payment').on('click',function(){
|
||||||
|
|||||||
@@ -298,7 +298,7 @@
|
|||||||
<button type="button" class="btn bg-red btn-block" id="void" active="<%= can? :overall_void, :void %>"> Void </button>
|
<button type="button" class="btn bg-red btn-block" id="void" active="<%= can? :overall_void, :void %>"> Void </button>
|
||||||
<!-- Waiter Buttons -->
|
<!-- Waiter Buttons -->
|
||||||
</div>
|
</div>
|
||||||
|
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -310,7 +310,8 @@
|
|||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment")
|
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
|
||||||
|
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment")
|
||||||
|
|
||||||
if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){
|
if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){
|
||||||
$("#credit_payment").hide();
|
$("#credit_payment").hide();
|
||||||
@@ -318,11 +319,12 @@
|
|||||||
$("#credit_payment").show();
|
$("#credit_payment").show();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(parseInt(jQuery.inArray("MPU", payment_type)) > 0 || parseInt(jQuery.inArray("VISA", payment_type)) > 0 || parseInt(jQuery.inArray("JCB", payment_type)) > 0 || parseInt(jQuery.inArray("Master", payment_type)) > 0 || parseInt(jQuery.inArray("UNIONPAY", payment_type)) > 0 || parseInt(jQuery.inArray("Redeem", payment_type)) > 0){
|
if(parseInt(jQuery.inArray("MPU", payment_type)) > 0 || parseInt(jQuery.inArray("VISA", payment_type)) > 0 || parseInt(jQuery.inArray("JCB", payment_type)) > 0 || parseInt(jQuery.inArray("Master", payment_type)) > 0 || parseInt(jQuery.inArray("UNIONPAY", payment_type)) > 0 || parseInt(jQuery.inArray("Redeem", payment_type)) > 0){
|
||||||
$("#card_payment").show();
|
$("#card_payment").show();
|
||||||
} else{
|
} else{
|
||||||
$("#card_payment").hide();
|
$("#card_payment").hide();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* end check first bill or not*/
|
/* end check first bill or not*/
|
||||||
|
|
||||||
var dining_id = "<%= @sale_data.bookings[0].dining_facility_id %>";
|
var dining_id = "<%= @sale_data.bookings[0].dining_facility_id %>";
|
||||||
|
|||||||
@@ -374,13 +374,14 @@
|
|||||||
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
<button type="button" id="in_duties" class="btn btn-block bg-blue waves-effect">In Duties</button>
|
||||||
<!-- <button type="button" class="btn bg-blue btn-block" id='move' disabled="">Move</button> -->
|
<!-- <button type="button" class="btn bg-blue btn-block" id='move' disabled="">Move</button> -->
|
||||||
<!-- <button type="button" id="request_bills" class="btn bg-blue btn-block" disabled> Req.Bill</button> -->
|
<!-- <button type="button" id="request_bills" class="btn bg-blue btn-block" disabled> Req.Bill</button> -->
|
||||||
|
<!-- first bill not used in cloud -->
|
||||||
<!-- <button type="button" id="first_bill" class="btn bg-blue btn-block">First Bill</button> -->
|
<% if ENV["SERVER_MODE"] != "cloud" %>
|
||||||
|
<button type="button" id="first_bill" class="btn btn-block bg-blue waves-effect">First Bill</button>
|
||||||
|
<% end %>
|
||||||
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
|
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
|
||||||
<button type="button" id="void" class="btn bg-blue btn-block" > Void </button>
|
<button type="button" id="void" class="btn bg-blue btn-block" > Void </button>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
|
||||||
|
|
||||||
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
|
<span class="hidden" id="member_discount"><%= @membership.discount%></span>
|
||||||
<span class="hidden" id="membership_id"><%= @obj_sale.customer.membership_id rescue 0%></span>
|
<span class="hidden" id="membership_id"><%= @obj_sale.customer.membership_id rescue 0%></span>
|
||||||
<div class="modal fade" id="paymentModal" tabindex="-1" role="dialog">
|
<div class="modal fade" id="paymentModal" tabindex="-1" role="dialog">
|
||||||
@@ -452,10 +453,12 @@ $(document).ready(function(){
|
|||||||
receipt_no = ($("#receipt_no").html()).trim();
|
receipt_no = ($("#receipt_no").html()).trim();
|
||||||
}
|
}
|
||||||
// console.log(checkReceiptNoInFirstBillData(receipt_no));
|
// console.log(checkReceiptNoInFirstBillData(receipt_no));
|
||||||
if(checkReceiptNoInFirstBillData(receipt_no,"")){
|
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
|
||||||
$("#pay").show();
|
if(checkReceiptNoInFirstBillData(receipt_no,"")){
|
||||||
}else{
|
$("#pay").show();
|
||||||
$("#pay").hide();
|
}else{
|
||||||
|
$("#pay").hide();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* end check first bill or not*/
|
/* end check first bill or not*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user