mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-21 19:25:16 +00:00
fix: recalculate amount based on allocated amount
(cherry picked from commit 5a7a6a9bd5)
This commit is contained in:
@@ -385,6 +385,16 @@ frappe.ui.form.on("Payment Reconciliation Allocation", {
|
|||||||
// filter payment
|
// filter payment
|
||||||
let payment = frm.doc.payments.filter((x) => x.reference_name == row.reference_name);
|
let payment = frm.doc.payments.filter((x) => x.reference_name == row.reference_name);
|
||||||
|
|
||||||
|
let amount = payment[0].amount;
|
||||||
|
for (const d of frm.doc.allocation) {
|
||||||
|
if (row.reference_name == d.reference_name && amount) {
|
||||||
|
if (d.allocated_amount <= amount) {
|
||||||
|
d.amount = amount;
|
||||||
|
amount -= d.allocated_amount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
frm.call({
|
frm.call({
|
||||||
doc: frm.doc,
|
doc: frm.doc,
|
||||||
method: "calculate_difference_on_allocation_change",
|
method: "calculate_difference_on_allocation_change",
|
||||||
|
|||||||
Reference in New Issue
Block a user