Skip to content

Commit

Permalink
fix: Incorrect TCS amount deducted in Sales Invoice
Browse files Browse the repository at this point in the history
(cherry picked from commit 08443c6)
  • Loading branch information
deepeshgarg007 authored and mergify[bot] committed Sep 30, 2022
1 parent 6a58d15 commit 32456bf
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -326,6 +326,9 @@ def get_advance_vouchers(
"party": ["in", parties],
}

if party_type == "Customer":
filters.update({"against_voucher": ["is", "not set"]})

if company:
filters["company"] = company
if from_date and to_date:
Expand Down Expand Up @@ -491,10 +494,13 @@ def get_tcs_amount(parties, inv, tax_details, vouchers, adv_vouchers):
cumulative_threshold = tax_details.get("cumulative_threshold", 0)

current_invoice_total = get_invoice_total_without_tcs(inv, tax_details)
print(invoiced_amt, advance_amt, credit_note_amt, current_invoice_total)
total_invoiced_amt = current_invoice_total + invoiced_amt + advance_amt - credit_note_amt

print(total_invoiced_amt, "######", "total_invoiced_amt")
if cumulative_threshold and total_invoiced_amt >= cumulative_threshold:
chargeable_amt = total_invoiced_amt - cumulative_threshold
print(chargeable_amt, "#########")
tcs_amount = chargeable_amt * tax_details.rate / 100 if chargeable_amt > 0 else 0

return tcs_amount
Expand Down

0 comments on commit 32456bf

Please sign in to comment.