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 !',