fixed duplicate other payment
This commit is contained in:
@@ -662,7 +662,7 @@ class SalePayment < ApplicationRecord
|
|||||||
is_credit = sale.sale_payments.any? { |x| x.payment_method == "creditnote" }
|
is_credit = sale.sale_payments.any? { |x| x.payment_method == "creditnote" }
|
||||||
is_foc = sale.sale_payments.any? { |x| x.payment_method == "foc" }
|
is_foc = sale.sale_payments.any? { |x| x.payment_method == "foc" }
|
||||||
|
|
||||||
if (sale.grand_total <= all_received_amount)
|
if sale.grand_total <= all_received_amount && sale.sale_status == "new"
|
||||||
sale.payment_status = "paid"
|
sale.payment_status = "paid"
|
||||||
if is_credit
|
if is_credit
|
||||||
sale.payment_status = "outstanding"
|
sale.payment_status = "outstanding"
|
||||||
|
|||||||
Reference in New Issue
Block a user