From aab6d0e028e6fc207e2d5731f987e06038f6b4a6 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Mon, 21 Jan 2019 15:01:40 +0530 Subject: [PATCH] fix(email_digest): Linkes annual income and annual expense to profit and loss statement --- .../report/account_balance/account_balance.js | 2 +- .../setup/doctype/email_digest/email_digest.py | 16 ++++++---------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/erpnext/accounts/report/account_balance/account_balance.js b/erpnext/accounts/report/account_balance/account_balance.js index e00d9cbfce..bb66951cdc 100644 --- a/erpnext/accounts/report/account_balance/account_balance.js +++ b/erpnext/accounts/report/account_balance/account_balance.js @@ -44,7 +44,7 @@ frappe.query_reports["Account Balance"] = { { "value": "Cost of Goods Sold", "label": __("Cost of Goods Sold") }, { "value": "Depreciation", "label": __("Depreciation") }, { "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 Valuation", "label": __("Expenses Included In Valuation") }, { "value": "Fixed Asset", "label": __("Fixed Asset") }, diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index a77794ec13..c5c91d1b45 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -332,19 +332,15 @@ class EmailDigest(Document): if fieldname == 'income': filters = { - "root_type": "Income", - "report_date": self.future_to_date, - "company": self.company + "currency": self.currency } - 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': filters = { - "root_type": "Expense", - "report_date": self.future_to_date, - "company": self.company + "currency": self.currency } - 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 { "label": label, @@ -416,8 +412,8 @@ class EmailDigest(Document): report_type="Report Builder", doctype="Sales Order", filters = { - "status": [['!=', "Closed"], ['!=', "Cancelled"], ['!=', "Completed"]], - "billing_status": [['!=', "Fully Billed"]], + "status": [['!=', "Closed"], ['!=', "Cancelled"]], + "per_billed": [['<', 100]], "transaction_date": [['<=', self.future_to_date]], "company": self.company }