mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-02 18:14:50 +00:00
fix: Don't validate if no GL Entry exists
This commit is contained in:
@@ -99,6 +99,11 @@ class PeriodClosingVoucher(AccountsController):
|
||||
|
||||
previous_fiscal_year = get_fiscal_year(last_year_closing, company=self.company, boolean=True)
|
||||
|
||||
if previous_fiscal_year and not frappe.db.exists(
|
||||
"GL Entry", {"posting_date": ("<=", last_year_closing), "company": self.company}
|
||||
):
|
||||
return
|
||||
|
||||
if previous_fiscal_year and not frappe.db.exists(
|
||||
"Period Closing Voucher",
|
||||
{"posting_date": ("<=", last_year_closing), "docstatus": 1, "company": self.company},
|
||||
|
||||
Reference in New Issue
Block a user