erpnext
erpnext copied to clipboard
fix: incorrectly applying TDS when Advance is in previous FY
If Advance with TDS deducted is in previous fiscal year, Invoices in current fiscal year still get TDS applied, if there multiple invoices. Fixing in this PR.
Replication:
- Purchase Order on FY2023 above cumulative threshold of TDS
- Make 50% advance with TDS deducted for PO. Note: this 50% should be above cumulative threshold.
- Make an Invoice against PO with 25% value and allocate Advance. => No TDS applied
- Make another Invoice against PO with 25% value and allocate advance => TDS is applied (wrong)
The combination of 2 invoices should breach the cumulative threshold.
ps: TCS/TDS related code are long overdue for a refactor.