fix: paid amount gets overwritten by get_outstanding_invoices (#20050)

This commit is contained in:
Saqib 2019-12-23 16:25:16 +05:30 committed by Nabin Hait
parent 06f9538e51
commit 9078607600

View File

@ -652,12 +652,14 @@ frappe.ui.form.on('Payment Entry', {
(frm.doc.payment_type=="Receive" && frm.doc.party_type=="Student")
) {
if(total_positive_outstanding > total_negative_outstanding)
if (!frm.doc.paid_amount)
frm.set_value("paid_amount",
total_positive_outstanding - total_negative_outstanding);
} else if (
total_negative_outstanding &&
total_positive_outstanding < total_negative_outstanding
) {
if (!frm.doc.received_amount)
frm.set_value("received_amount",
total_negative_outstanding - total_positive_outstanding);
}