Merge pull request #37120 from vorasmit/fix-dup-advance

fix: handle multiple references with same name
This commit is contained in:
ruthra kumar 2023-09-21 14:20:04 +05:30 committed by GitHub
commit f31a527505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1152,8 +1152,25 @@ class PaymentEntry(AccountsController):
)
make_reverse_gl_entries(gl_entries=gl_entries, partial_cancel=True)
else:
make_gl_entries(gl_entries)
return
# same reference added to payment entry
for gl_entry in gl_entries.copy():
if frappe.db.exists(
"GL Entry",
{
"account": gl_entry.account,
"voucher_type": gl_entry.voucher_type,
"voucher_no": gl_entry.voucher_no,
"voucher_detail_no": gl_entry.voucher_detail_no,
"debit": gl_entry.debit,
"credit": gl_entry.credit,
"is_cancelled": 0,
},
):
gl_entries.remove(gl_entry)
make_gl_entries(gl_entries)
def make_invoice_liability_entry(self, gl_entries, invoice):
args_dict = {