fix: Multi invoice reconciliation
This commit is contained in:
@@ -1019,14 +1019,11 @@ class PaymentEntry(AccountsController):
|
|||||||
|
|
||||||
gl_entries.append(gle)
|
gl_entries.append(gle)
|
||||||
|
|
||||||
def make_advance_gl_entries(self, against_voucher_type=None, against_voucher=None, cancel=0):
|
def make_advance_gl_entries(self, cancel=0):
|
||||||
if self.book_advance_payments_in_separate_party_account:
|
if self.book_advance_payments_in_separate_party_account:
|
||||||
gl_entries = []
|
gl_entries = []
|
||||||
for d in self.get("references"):
|
for d in self.get("references"):
|
||||||
if d.reference_doctype in ("Sales Invoice", "Purchase Invoice"):
|
if d.reference_doctype in ("Sales Invoice", "Purchase Invoice"):
|
||||||
if not (against_voucher_type and against_voucher) or (
|
|
||||||
d.reference_doctype == against_voucher_type and d.reference_name == against_voucher
|
|
||||||
):
|
|
||||||
self.make_invoice_liability_entry(gl_entries, d)
|
self.make_invoice_liability_entry(gl_entries, d)
|
||||||
|
|
||||||
if cancel:
|
if cancel:
|
||||||
|
|||||||
@@ -476,7 +476,7 @@ def reconcile_against_document(args, skip_ref_details_update_for_pe=False): # n
|
|||||||
create_payment_ledger_entry(gl_map, update_outstanding="No", cancel=0, adv_adj=1)
|
create_payment_ledger_entry(gl_map, update_outstanding="No", cancel=0, adv_adj=1)
|
||||||
|
|
||||||
if voucher_type == "Payment Entry":
|
if voucher_type == "Payment Entry":
|
||||||
doc.make_advance_gl_entries(entry.against_voucher_type, entry.against_voucher)
|
doc.make_advance_gl_entries()
|
||||||
|
|
||||||
# Only update outstanding for newly linked vouchers
|
# Only update outstanding for newly linked vouchers
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
|
|||||||
Reference in New Issue
Block a user