From 74b274f555801356b1ef05577eb4cb2cfb79b8d3 Mon Sep 17 00:00:00 2001 From: hendrik Date: Fri, 10 Jun 2022 16:22:53 +0700 Subject: [PATCH] fix: update Period Closing Voucher per Company Validate period closing voucher company-wise --- .../doctype/period_closing_voucher/period_closing_voucher.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py index 53b1c64c460..5a86376199c 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py @@ -54,8 +54,8 @@ class PeriodClosingVoucher(AccountsController): pce = frappe.db.sql( """select name from `tabPeriod Closing Voucher` - where posting_date > %s and fiscal_year = %s and docstatus = 1""", - (self.posting_date, self.fiscal_year), + where posting_date > %s and fiscal_year = %s and docstatus = 1 and company = %s""", + (self.posting_date, self.fiscal_year, self.company), ) if pce and pce[0][0]: frappe.throw(