fix: Test case and code cleanup

This commit is contained in:
Deepesh Garg
2023-06-23 21:53:34 +05:30
parent da6bc1a13e
commit 1894dc8197
6 changed files with 11 additions and 101 deletions

View File

@@ -474,7 +474,9 @@ def reconcile_against_document(args, skip_ref_details_update_for_pe=False): # n
doc = frappe.get_doc(entry.voucher_type, entry.voucher_no)
gl_map = doc.build_gl_map()
create_payment_ledger_entry(gl_map, update_outstanding="No", cancel=0, adv_adj=1)
doc.make_advance_gl_entries(entry.against_voucher_type, entry.against_voucher)
if voucher_type == "Payment Entry":
doc.make_advance_gl_entries(entry.against_voucher_type, entry.against_voucher)
# Only update outstanding for newly linked vouchers
for entry in entries:
@@ -732,7 +734,7 @@ def remove_ref_doc_link_from_pe(ref_type, ref_no):
for pe in linked_pe:
try:
pe_doc = frappe.get_doc("Payment Entry", pe, cache=True)
pe_doc = frappe.get_doc("Payment Entry", pe)
pe_doc.set_amounts()
pe_doc.make_advance_gl_entries(against_voucher_type=ref_type, against_voucher=ref_no, cancel=1)
pe_doc.clear_unallocated_reference_document_rows()