chore: Handle edge cases
This commit is contained in:
@@ -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):
|
def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers):
|
||||||
tcs_amount = 0
|
tcs_amount = 0
|
||||||
|
invoiced_amt = 0
|
||||||
|
advance_amt = 0
|
||||||
|
|
||||||
# sum of debit entries made from sales invoices
|
# sum of debit entries made from sales invoices
|
||||||
|
if vouchers:
|
||||||
invoiced_amt = (
|
invoiced_amt = (
|
||||||
frappe.db.get_value(
|
frappe.db.get_value(
|
||||||
"GL Entry",
|
"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'
|
# sum of credit entries made from PE / JV with unset 'against voucher'
|
||||||
|
if advance_amt:
|
||||||
advance_amt = (
|
advance_amt = (
|
||||||
frappe.db.get_value(
|
frappe.db.get_value(
|
||||||
"GL Entry",
|
"GL Entry",
|
||||||
|
|||||||
Reference in New Issue
Block a user