diff --git a/app/controllers/crm/customers_controller.rb b/app/controllers/crm/customers_controller.rb old mode 100755 new mode 100644 diff --git a/app/controllers/origami/customers_controller.rb b/app/controllers/origami/customers_controller.rb old mode 100755 new mode 100644 diff --git a/app/models/sale.rb b/app/models/sale.rb index 0e19e65f..a8ddf0ee 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -456,28 +456,27 @@ class Sale < ApplicationRecord sale_tax.save end else - sale_tax = SaleTax.new(:sale => sale) - sale_tax.tax_name = tax.name - sale_tax.tax_rate = tax.rate + sale_tax = SaleTax.new(:sale => sale) + sale_tax.tax_name = tax.name + sale_tax.tax_rate = tax.rate - # substract , to give after discount - total_tax = total_taxable - total_discount - #include or execulive - if tax.inclusive - rate = tax.rate - divided_value = (100 + rate)/rate - sale_tax.tax_payable_amount = total_tax / divided_value - else - sale_tax.tax_payable_amount = total_tax * tax.rate / 100 - total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount - end - #new taxable amount is standard rule for step by step - if shop.calc_tax_order - total_taxable = total_taxable + sale_tax.tax_payable_amount - end - - sale_tax.inclusive = tax.inclusive - sale_tax.save + # substract , to give after discount + total_tax = total_taxable - total_discount + #include or execulive + if tax.inclusive + rate = tax.rate + divided_value = (100 + rate)/rate + sale_tax.tax_payable_amount = total_tax / divided_value + else + sale_tax.tax_payable_amount = total_tax * tax.rate / 100 + total_tax_amount = total_tax_amount + sale_tax.tax_payable_amount + end + #new taxable amount is standard rule for step by step + if shop.calc_tax_order + total_taxable = total_taxable + sale_tax.tax_payable_amount + end + sale_tax.inclusive = tax.inclusive + sale_tax.save end end # end @@ -2682,7 +2681,7 @@ end end def self.all_receipts - query = Sale.select("sale_payments.created_at as receipt_close_time, + query = Sale.select("sales.*,sale_payments.created_at as receipt_close_time, case when (sale_audits.action='SALEPAYMENT') then sale_audits.remark else 0 end as remark, case when (sale_taxes.tax_name='Service Charges') then sale_taxes.tax_payable_amount else 0 end as service_charges, SUM(case when (sale_payments.payment_method='mpu') then sale_payments.payment_amount else 0 end) as mpu_amount, diff --git a/app/views/crm/customers/_card_read_form.html.erb b/app/views/crm/customers/_card_read_form.html.erb old mode 100755 new mode 100644 diff --git a/app/views/crm/customers/_crm_customer.json.jbuilder b/app/views/crm/customers/_crm_customer.json.jbuilder old mode 100755 new mode 100644 diff --git a/app/views/crm/customers/_form.html.erb b/app/views/crm/customers/_form.html.erb old mode 100755 new mode 100644 diff --git a/app/views/crm/customers/_new_form.html.erb b/app/views/crm/customers/_new_form.html.erb old mode 100755 new mode 100644 diff --git a/app/views/crm/customers/edit.html.erb b/app/views/crm/customers/edit.html.erb old mode 100755 new mode 100644 diff --git a/app/views/crm/customers/edit.json.jbuilder b/app/views/crm/customers/edit.json.jbuilder old mode 100755 new mode 100644 diff --git a/app/views/crm/customers/index.html.erb b/app/views/crm/customers/index.html.erb old mode 100755 new mode 100644 diff --git a/app/views/crm/customers/index.json.jbuilder b/app/views/crm/customers/index.json.jbuilder old mode 100755 new mode 100644 diff --git a/app/views/crm/customers/new.html.erb b/app/views/crm/customers/new.html.erb old mode 100755 new mode 100644 diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb old mode 100755 new mode 100644 diff --git a/app/views/crm/customers/show.json.jbuilder b/app/views/crm/customers/show.json.jbuilder old mode 100755 new mode 100644 diff --git a/app/views/origami/customers/index.html.erb b/app/views/origami/customers/index.html.erb old mode 100755 new mode 100644 diff --git a/app/views/origami/dinga/index.html.erb b/app/views/origami/dinga/index.html.erb index dba236e1..3e4a909f 100644 --- a/app/views/origami/dinga/index.html.erb +++ b/app/views/origami/dinga/index.html.erb @@ -113,6 +113,12 @@ +
+

Card Tap

+
+ +
+
@@ -256,6 +262,7 @@ getCardNo(); $("#sxModal").hide(); customer_mamber_card_no = $("#paypar_account_no").val(); + if(sale_id != 0 && customer_mamber_card_no != 0){ $.ajax({ type: "POST", @@ -429,7 +436,7 @@ }); } - $("#sxModal .btn_cancel").on('click',function(){ + $(".btn_cancel").on('click',function(){ $("#sxModal").hide(); }); diff --git a/app/views/origami/paymal/index.html.erb b/app/views/origami/paymal/index.html.erb index df5464dd..b6444384 100644 --- a/app/views/origami/paymal/index.html.erb +++ b/app/views/origami/paymal/index.html.erb @@ -108,6 +108,13 @@ + +
+

Card Tap

+
+ +
+
diff --git a/app/views/origami/sales/show.html.erb b/app/views/origami/sales/show.html.erb index 94cbce39..fe99ecf5 100755 --- a/app/views/origami/sales/show.html.erb +++ b/app/views/origami/sales/show.html.erb @@ -213,7 +213,6 @@
- <% if @sale.sale_status != 'void' && @sale.sale_status != 'waste' && @sale.sale_status != 'spoile' %> <% if current_login_employee.role == "cashier" %> Void @@ -224,6 +223,30 @@
+ +