chore: Handle edge cases

This commit is contained in:
Deepesh Garg
2022-09-20 23:50:16 +05:30
parent 21154c8bee
commit e2912caeae

View File

@@ -437,8 +437,11 @@ def get_tds_amount(ldc, parties, inv, tax_details, tax_deducted, vouchers):
def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers):
tcs_amount = 0
invoiced_amt = 0
advance_amt = 0
# sum of debit entries made from sales invoices
if vouchers:
invoiced_amt = (
frappe.db.get_value(
"GL Entry",
@@ -454,6 +457,7 @@ def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers):
)
# sum of credit entries made from PE / JV with unset 'against voucher'
if advance_amt:
advance_amt = (
frappe.db.get_value(
"GL Entry",