fix(payment_reconciliation): retain journal entry accounts child table order

This commit is contained in:
diptanilsaha
2026-01-22 01:43:46 +05:30
parent d6bbe43fa0
commit 54acaa2aec

View File

@@ -663,6 +663,7 @@ def update_reference_in_journal_entry(d, journal_entry, do_not_save=False):
d["allocated_amount"] = d["allocated_amount"] * -1
d["unadjusted_amount"] = d["unadjusted_amount"] * -1
insert_position = -1
if flt(d["unadjusted_amount"]) - flt(d["allocated_amount"]) != 0:
# adjust the unreconciled balance
amount_in_account_currency = flt(d["unadjusted_amount"]) - flt(d["allocated_amount"])
@@ -674,9 +675,10 @@ def update_reference_in_journal_entry(d, journal_entry, do_not_save=False):
)
else:
journal_entry.remove(jv_detail)
insert_position += jv_detail.idx
# new row with references
new_row = journal_entry.append("accounts")
new_row = journal_entry.append("accounts", position=insert_position)
# Copy field values into new row
[