mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-12 17:23:38 +00:00
fix(payment_reconciliation): retain journal entry accounts child table order
This commit is contained in:
@@ -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
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user