diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index 4046d3d9..e649f4b4 100755 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -148,7 +148,6 @@ $(document).on('turbolinks:load', function() { function checkReceiptNoInFirstBillData(receipt_no) { var status = false; if((receipt_no!=undefined) && (receipt_no!="")){ - console.log(localStorage.length); if(localStorage.hasOwnProperty("receipt_lists")===true){ var arr_data = JSON.parse(localStorage.getItem("receipt_lists")); var json_data = arr_data.filter(function(e) { return e.receipt_no !== receipt_no }); diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 5ab270b3..8fb1b48e 100755 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -179,7 +179,7 @@ class SalePayment < ApplicationRecord self.outstanding_amount = self.sale.grand_total.to_f - self.received_amount.to_f self.payment_status = "paid" payment_method = self.save! - sale_update_payment_status(self.received_amount,true) + sale_update_payment_status(self.received_amount) return payment_status end diff --git a/app/views/origami/home/show.html.erb b/app/views/origami/home/show.html.erb index 68c43ad8..0fa545a3 100755 --- a/app/views/origami/home/show.html.erb +++ b/app/views/origami/home/show.html.erb @@ -594,6 +594,10 @@ url: ajax_url, success: function (result) { $( "#loading_wrapper" ).hide(); + receipt_no = ($("#receipt_no").html()).trim(); + if((receipt_no!=undefined) && (receipt_no!="")) + createReceiptNoInFirstBillData(receipt_no); + location.reload(); } }); diff --git a/app/views/origami/rooms/show.html.erb b/app/views/origami/rooms/show.html.erb index db9e5f39..229bb1c7 100755 --- a/app/views/origami/rooms/show.html.erb +++ b/app/views/origami/rooms/show.html.erb @@ -604,6 +604,10 @@ $(".choose_payment").on('click', function () { url: ajax_url, success: function (result) { $( "#loading_wrapper" ).hide(); + receipt_no = ($("#receipt_no").html()).trim(); + if((receipt_no!=undefined) && (receipt_no!="")) + createReceiptNoInFirstBillData(receipt_no); + location.reload(); } });