[Fix] TDS Payable Monthly report is not working (#15666)

This commit is contained in:
rohitwaghchaure 2018-10-15 11:09:17 +05:30 committed by Nabin Hait
parent 42510a411f
commit 0d2a4c6a59
2 changed files with 10 additions and 6 deletions

View File

@ -8,6 +8,7 @@ frappe.query_reports["TDS Payable Monthly"] = {
"fieldname":"company",
"label": __("Company"),
"fieldtype": "Link",
"options": "Company",
"default": frappe.defaults.get_default('company')
},
{

View File

@ -64,13 +64,16 @@ def get_result(filters):
total_amount_credited += k.credit
rate = [i.tax_withholding_rate for i in tds_doc.rates
if i.fiscal_year == gle_map[d][0].fiscal_year][0]
if i.fiscal_year == gle_map[d][0].fiscal_year]
if getdate(filters.from_date) <= gle_map[d][0].posting_date \
and getdate(filters.to_date) >= gle_map[d][0].posting_date:
out.append([supplier.pan, supplier.name, tds_doc.name,
supplier.supplier_type, rate, total_amount_credited, tds_deducted,
gle_map[d][0].posting_date, "Purchase Invoice", d])
if rate and len(rate) > 0:
rate = rate[0]
if getdate(filters.from_date) <= gle_map[d][0].posting_date \
and getdate(filters.to_date) >= gle_map[d][0].posting_date:
out.append([supplier.pan, supplier.name, tds_doc.name,
supplier.supplier_type, rate, total_amount_credited, tds_deducted,
gle_map[d][0].posting_date, "Purchase Invoice", d])
return out