fix: Do not allow backdated stock transactions in previous fiscal year (#21967) (#21980)

(cherry picked from commit 873542bc7f)

Co-authored-by: Deepesh Garg <42651287+deepeshgarg007@users.noreply.github.com>
This commit is contained in:
mergify[bot] 2020-05-27 20:50:28 +05:30 committed by GitHub
parent 01dda8a000
commit 8644a7f1fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -166,7 +166,7 @@ class TransactionBase(StatusUpdater):
last_transaction_time = frappe.db.sql(""" last_transaction_time = frappe.db.sql("""
select MAX(timestamp(posting_date, posting_time)) as posting_time select MAX(timestamp(posting_date, posting_time)) as posting_time
from `tabStock Ledger Entry` from `tabStock Ledger Entry`
where docstatus = 1 and fiscal_year = %s""", (fiscal_year))[0][0] where docstatus = 1""")[0][0]
cur_doc_posting_datetime = "%s %s" % (self.posting_date, self.get("posting_time") or "00:00:00") cur_doc_posting_datetime = "%s %s" % (self.posting_date, self.get("posting_time") or "00:00:00")