fix: Don't validate if no GL Entry exists
This commit is contained in:
parent
fa991b2dcf
commit
528ab503f2
@ -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},
|
||||
|
Loading…
x
Reference in New Issue
Block a user