fix(email_digest): Linkes annual income and annual expense to profit and loss statement

This commit is contained in:
deepeshgarg007 2019-01-21 15:01:40 +05:30
parent 3c9dd73f91
commit aab6d0e028
2 changed files with 7 additions and 11 deletions

View File

@ -44,7 +44,7 @@ frappe.query_reports["Account Balance"] = {
{ "value": "Cost of Goods Sold", "label": __("Cost of Goods Sold") }, { "value": "Cost of Goods Sold", "label": __("Cost of Goods Sold") },
{ "value": "Depreciation", "label": __("Depreciation") }, { "value": "Depreciation", "label": __("Depreciation") },
{ "value": "Equity", "label": __("Equity") }, { "value": "Equity", "label": __("Equity") },
{ "value": "Expense Account", "label": __("MonExpense Accountthly") }, { "value": "Expense Account", "label": __("Expense Account") },
{ "value": "Expenses Included In Asset Valuation", "label": __("Expenses Included In Asset Valuation") }, { "value": "Expenses Included In Asset Valuation", "label": __("Expenses Included In Asset Valuation") },
{ "value": "Expenses Included In Valuation", "label": __("Expenses Included In Valuation") }, { "value": "Expenses Included In Valuation", "label": __("Expenses Included In Valuation") },
{ "value": "Fixed Asset", "label": __("Fixed Asset") }, { "value": "Fixed Asset", "label": __("Fixed Asset") },

View File

@ -332,19 +332,15 @@ class EmailDigest(Document):
if fieldname == 'income': if fieldname == 'income':
filters = { filters = {
"root_type": "Income", "currency": self.currency
"report_date": self.future_to_date,
"company": self.company
} }
label = get_link_to_report('Account Balance', label=self.meta.get_label(root_type + "_year_to_date"), filters=filters) label = get_link_to_report('Profit and Loss Statement', label=self.meta.get_label(root_type + "_year_to_date"), filters=filters)
elif fieldname == 'expenses_booked': elif fieldname == 'expenses_booked':
filters = { filters = {
"root_type": "Expense", "currency": self.currency
"report_date": self.future_to_date,
"company": self.company
} }
label = get_link_to_report('Account Balance', label=self.meta.get_label(root_type + "_year_to_date"), filters=filters) label = get_link_to_report('Profit and Loss Statement', label=self.meta.get_label(root_type + "_year_to_date"), filters=filters)
return { return {
"label": label, "label": label,
@ -416,8 +412,8 @@ class EmailDigest(Document):
report_type="Report Builder", report_type="Report Builder",
doctype="Sales Order", doctype="Sales Order",
filters = { filters = {
"status": [['!=', "Closed"], ['!=', "Cancelled"], ['!=', "Completed"]], "status": [['!=', "Closed"], ['!=', "Cancelled"]],
"billing_status": [['!=', "Fully Billed"]], "per_billed": [['<', 100]],
"transaction_date": [['<=', self.future_to_date]], "transaction_date": [['<=', self.future_to_date]],
"company": self.company "company": self.company
} }