Merge pull request #35886 from deepeshgarg007/ldc_breach_fix

fix: TDS amount calculation post LDC breach
This commit is contained in:
Deepesh Garg 2023-06-27 09:39:06 +05:30 committed by GitHub
commit 2d2f0f02d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -585,7 +585,9 @@ def get_tds_amount_from_ldc(ldc, parties, tax_details, posting_date, net_total):
"supplier": ("in", parties),
"apply_tds": 1,
"docstatus": 1,
"tax_withholding_category": ldc.tax_withholding_category,
"posting_date": ("between", (ldc.valid_from, ldc.valid_upto)),
"company": ldc.company,
},
"sum(tax_withholding_net_total)",
)
@ -615,7 +617,7 @@ def is_valid_certificate(
):
valid = False
available_amount = flt(certificate_limit) - flt(deducted_amount) - flt(current_amount)
available_amount = flt(certificate_limit) - flt(deducted_amount)
if (getdate(valid_from) <= getdate(posting_date) <= getdate(valid_upto)) and available_amount > 0:
valid = True