fix: update Period Closing Voucher per Company

Validate period closing voucher company-wise

(cherry picked from commit 74b274f555)
This commit is contained in:
hendrik
2022-06-10 16:22:53 +07:00
committed by Mergify
parent 395f86f42b
commit 5ebbe81543

View File

@@ -54,8 +54,8 @@ class PeriodClosingVoucher(AccountsController):
pce = frappe.db.sql( pce = frappe.db.sql(
"""select name from `tabPeriod Closing Voucher` """select name from `tabPeriod Closing Voucher`
where posting_date > %s and fiscal_year = %s and docstatus = 1""", where posting_date > %s and fiscal_year = %s and docstatus = 1 and company = %s""",
(self.posting_date, self.fiscal_year), (self.posting_date, self.fiscal_year, self.company),
) )
if pce and pce[0][0]: if pce and pce[0][0]:
frappe.throw( frappe.throw(