fix: update Period Closing Voucher per Company
Validate period closing voucher company-wise
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 53b1c64..5a86376 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 @@
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(