fix: don't set default payment amount in case of invoice return (#35645)

This commit is contained in:
Anand Baburajan
2023-06-12 18:34:13 +05:30
committed by GitHub
parent 81ef2babe9
commit 79483cc90e

View File

@@ -805,11 +805,13 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
); );
} }
this.frm.doc.payments.find(pay => { if(!this.frm.doc.is_return){
if (pay.default) { this.frm.doc.payments.find(payment => {
pay.amount = total_amount_to_pay; if (payment.default) {
} payment.amount = total_amount_to_pay;
}); }
});
}
this.frm.refresh_fields(); this.frm.refresh_fields();
} }