Merge pull request #28764 from deepeshgarg007/tds_report_fixes
fix: TDS Monthly payable report
diff --git a/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py b/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py
index a3a45d1..caee1a1 100644
--- a/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py
+++ b/erpnext/accounts/report/tds_payable_monthly/tds_payable_monthly.py
@@ -36,12 +36,16 @@
posting_date = entry.posting_date
voucher_type = entry.voucher_type
+ if not tax_withholding_category:
+ tax_withholding_category = supplier_map.get(supplier, {}).get('tax_withholding_category')
+ rate = tax_rate_map.get(tax_withholding_category)
+
if entry.account in tds_accounts:
tds_deducted += (entry.credit - entry.debit)
total_amount_credited += (entry.credit - entry.debit)
- if rate and tds_deducted:
+ if tds_deducted:
row = {
'pan' if frappe.db.has_column('Supplier', 'pan') else 'tax_id': supplier_map.get(supplier, {}).get('pan'),
'supplier': supplier_map.get(supplier, {}).get('name')
@@ -67,7 +71,7 @@
def get_supplier_pan_map():
supplier_map = frappe._dict()
- suppliers = frappe.db.get_all('Supplier', fields=['name', 'pan', 'supplier_type', 'supplier_name'])
+ suppliers = frappe.db.get_all('Supplier', fields=['name', 'pan', 'supplier_type', 'supplier_name', 'tax_withholding_category'])
for d in suppliers:
supplier_map[d.name] = d