check FOC payment issue

This commit is contained in:
phyusin
2018-04-03 18:06:18 +06:30
parent d29b7a9d49
commit 8e07cd5f4e
3 changed files with 13 additions and 7 deletions

View File

@@ -431,13 +431,17 @@ class Origami::PaymentsController < BaseOrigamiController
if(Sale.exists?(sale_id))
saleObj = Sale.find(sale_id)
#calculate cash acmount
cash = saleObj.total_amount
if saleObj.discount_type == "member_discount"
saleObj.update_attributes(rounding_adjustment: 0)
saleObj.update_attributes(grand_total: 0, rounding_adjustment: 0, amount_received: 0, amount_changed: 0)
saleObj.compute_by_sale_items(sale_id, saleObj.sale_items,0,order_source)
end
saleObj.update_attributes(rounding_adjustment: 0)
saleObj.update_attributes(grand_total: 0, rounding_adjustment: 0, amount_received: 0, amount_changed: 0)
puts "FOC"
puts saleObj.to_json
sale_payment = SalePayment.new
sale_payment.process_payment(saleObj, current_user.name, cash, "foc" ,remark)
# For Cashier by Zone