From 880602779375e759040b4b50c0291b65a205f82b Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Sun, 22 Apr 2018 16:38:52 +0630 Subject: [PATCH] update bugs for demo --- app/controllers/origami/waste_spoile_controller.rb | 3 ++- app/pdf/receipt_bill_pdf.rb | 5 +++-- app/views/origami/payments/show.html.erb | 14 ++++++++++++-- app/views/origami/table_invoices/show.html.erb | 2 +- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/app/controllers/origami/waste_spoile_controller.rb b/app/controllers/origami/waste_spoile_controller.rb index c94b33bb..2b2d9c33 100755 --- a/app/controllers/origami/waste_spoile_controller.rb +++ b/app/controllers/origami/waste_spoile_controller.rb @@ -92,7 +92,8 @@ class Origami::WasteSpoileController < BaseOrigamiController if customer.membership_id != nil && rebate member_info = Customer.get_member_account(customer) rebate_amount = Customer.get_membership_transactions(customer,sale.receipt_no) - current_balance = SaleAudit.paymal_search(sale_id) + # current_balance = SaleAudit.paymal_search(sale_id) + current_balance = 0 end # get printer info diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index a04cfcad..7ebe5997 100755 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -84,7 +84,7 @@ class ReceiptBillPdf < Prawn::Document #start for individual payment if !sale_data.equal_persons.nil? - individual_payment(sale_data, printer_settings.precision, delimiter) + individual_payment(sale_data,sale_data.equal_persons, printer_settings.precision, delimiter) end #end for individual payment @@ -487,7 +487,8 @@ class ReceiptBillPdf < Prawn::Document #individual payment per person def individual_payment(sale_data, survey, precision, delimiter) - per_person = sale_data.grand_total.to_f / survey.total_customer.to_i + # per_person = sale_data.grand_total.to_f / survey.total_customer.to_i + per_person = sale_data.grand_total.to_f / survey.to_i stroke_horizontal_rule move_down line_move y_position = cursor diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index 28b3f2ea..100b1425 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -523,14 +523,24 @@ var customer_name = "<%= @customer.name %>"; if ($("#server_mode").val() != "cloud") { // first bill not used in cloud payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment"); + console.log(payment_type) if (member_id && member_discount) { if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){ $("#credit_payment").hide(); } else{ $("#credit_payment").show(); } - - if(parseInt(jQuery.inArray("MPU", payment_type)) !=-1 || parseInt(jQuery.inArray("VISA", payment_type)) !=-1 || parseInt(jQuery.inArray("JCB", payment_type)) !=-1 || parseInt(jQuery.inArray("Master", payment_type)) !=-1 || parseInt(jQuery.inArray("UNIONPAY", payment_type)) !=-1 || parseInt(jQuery.inArray("Redeem", payment_type)) !=-1, parseInt(jQuery.inArray("PAYMAL", payment_type)) !=-1 || parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) !=-1 || parseInt(jQuery.inArray("Alipay", payment_type)) !=-1 || parseInt(jQuery.inArray("DINGA", payment_type)) !=-1){ +console.log(jQuery.inArray("Master", payment_type)) + if(parseInt(jQuery.inArray("MPU", payment_type)) != -1 || + parseInt(jQuery.inArray("VISA", payment_type)) != -1 || + parseInt(jQuery.inArray("JCB", payment_type)) != -1 || + parseInt(jQuery.inArray("Master", payment_type)) != -1 || + parseInt(jQuery.inArray("UNIONPAY", payment_type)) != -1 || + parseInt(jQuery.inArray("Redeem", payment_type)) != -1 || + parseInt(jQuery.inArray("PAYMAL", payment_type)) != -1 || + parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) != -1 || + parseInt(jQuery.inArray("Alipay", payment_type)) != -1 || + parseInt(jQuery.inArray("DINGA", payment_type)) != -1){ $("#card_payment").show(); } else{ $("#card_payment").hide(); diff --git a/app/views/origami/table_invoices/show.html.erb b/app/views/origami/table_invoices/show.html.erb index f6317dc3..fc19f909 100644 --- a/app/views/origami/table_invoices/show.html.erb +++ b/app/views/origami/table_invoices/show.html.erb @@ -361,7 +361,7 @@ $('#pay').on('click',function() { $('#back').on('click',function(){ var lookup_split_bill = '<%= @split_bill %>'; if(lookup_split_bill == '1'){ - window.location.href = '/origami/table/<%= @table.id %>/split_bills'; + window.location.href = '/origami/table/<%= @table.id %>/cashier/split_bills'; }else{ window.location.href = '/origami/table/<%= @table.id %>'; }