Merge pull request #32635 from ruthra-kumar/fix_tax_or_charges_acc_updating_voucher_outstanding

fix: Integrity Error on PLE while submitting sales invoice
This commit is contained in:
ruthra kumar
2022-10-19 09:43:24 +05:30
committed by GitHub
2 changed files with 22 additions and 1 deletions

View File

@@ -1479,7 +1479,12 @@ def update_voucher_outstanding(voucher_type, voucher_no, account, party_type, pa
# on cancellation outstanding can be an empty list
voucher_outstanding = ple_query.get_voucher_outstandings(vouchers, common_filter=common_filter)
if voucher_type in ["Sales Invoice", "Purchase Invoice", "Fees"] and voucher_outstanding:
if (
voucher_type in ["Sales Invoice", "Purchase Invoice", "Fees"]
and party_type
and party
and voucher_outstanding
):
outstanding = voucher_outstanding[0]
ref_doc = frappe.get_doc(voucher_type, voucher_no)