From bac1309f1fb0e6be864fba2bf019691313898945 Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 9 Jan 2018 16:56:34 +0630 Subject: [PATCH] remove frt bill --- app/assets/javascripts/origami.js | 2 +- .../origami/payments_controller.rb | 48 ------------------- app/views/origami/home/show.html.erb | 10 ++-- 3 files changed, 6 insertions(+), 54 deletions(-) diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index 33252efa..3afb23c1 100755 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -163,7 +163,7 @@ function checkReceiptNoInFirstBillData(receipt_no,payment) { } } if (payment) { - return json_data[0]["payment"]; + return status; //json_data[0]["payment"]; }else{ return status; } diff --git a/app/controllers/origami/payments_controller.rb b/app/controllers/origami/payments_controller.rb index ebc10789..9d86c8ff 100755 --- a/app/controllers/origami/payments_controller.rb +++ b/app/controllers/origami/payments_controller.rb @@ -22,7 +22,6 @@ class Origami::PaymentsController < BaseOrigamiController cashier_terminal = CashierTerminal.find(cashier_zone.cashier_terminal_id) # Print for First Bill to Customer -<<<<<<< HEAD # unique_code = "ReceiptBillPdf" # #shop detail # shop_details = Shop::ShopDetail @@ -46,48 +45,6 @@ class Origami::PaymentsController < BaseOrigamiController # 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") -======= - 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 - 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 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 - # 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) ->>>>>>> master end def create @@ -319,13 +276,8 @@ class Origami::PaymentsController < BaseOrigamiController # 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) -<<<<<<< HEAD # 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 = 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",nil) ->>>>>>> master end end diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index a19f6b46..03897e1b 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -447,11 +447,11 @@ receipt_no = ($("#receipt_no").html()).trim(); } // console.log(checkReceiptNoInFirstBillData(receipt_no)); - if(checkReceiptNoInFirstBillData(receipt_no,"")){ - $("#pay").show(); - }else{ - $("#pay").hide(); - } + // if(checkReceiptNoInFirstBillData(receipt_no,"")){ + // $("#pay").show(); + // }else{ + // $("#pay").hide(); + // } /* end check first bill or not*/ $('.invoicedetails').on('click', function () {