From 20ae953af253a29a50fff55e1fdec7e852915d2b Mon Sep 17 00:00:00 2001 From: phyusin Date: Fri, 15 Dec 2017 11:50:05 +0630 Subject: [PATCH] cahnge foc process --- app/models/sale_payment.rb | 2 +- app/views/origami/payments/show.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/sale_payment.rb b/app/models/sale_payment.rb index 236606c6..56e18b25 100755 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -187,7 +187,7 @@ class SalePayment < ApplicationRecord payment_status = false # add to sale item with foc - sale_items = SaleItem.where("sale_id='#{ self.sale.sale_id }'") + sale_items = SaleItem.where("sale_id='#{ self.sale.sale_id }' and remark is null") sale_items.each do|item| SaleItem.update_existing_item(item.qty, item, self.sale.sale_id, "foc", item.unit_price, item.price) diff --git a/app/views/origami/payments/show.html.erb b/app/views/origami/payments/show.html.erb index b2ffe0c3..286f86f3 100755 --- a/app/views/origami/payments/show.html.erb +++ b/app/views/origami/payments/show.html.erb @@ -497,7 +497,7 @@ //$( "#loading_wrapper" ).hide(); - if (cash > 0) { + if (cash >= 0) { swal({ title: "Information!", text: 'Thank You !',