fix: process statement to_date override

(cherry picked from commit 378d15d388ae9cac7a5f897af83c99605403503a)
This commit is contained in:
Bhavesh Maheshwari 2022-03-25 11:27:19 +05:30 committed by mergify-bot
parent 41ec5cadf6
commit 72757994f8

View File

@ -34,8 +34,9 @@ class ProcessStatementOfAccounts(Document):
frappe.throw(_("Customers not selected."))
if self.enable_auto_email:
self.to_date = self.start_date
self.from_date = add_months(self.to_date, -1 * self.filter_duration)
if self.start_date and getdate(self.start_date) >= getdate(today()):
self.to_date = self.start_date
self.from_date = add_months(self.to_date, -1 * self.filter_duration)
def get_report_pdf(doc, consolidated=True):