mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-20 15:32:14 +00:00
fix: find first PCV to consider opening entries
(cherry picked from commit 2201fc62a2)
This commit is contained in:
@@ -413,11 +413,16 @@ class PeriodClosingVoucher(AccountsController):
|
|||||||
return closing_entries
|
return closing_entries
|
||||||
|
|
||||||
def is_first_period_closing_voucher(self):
|
def is_first_period_closing_voucher(self):
|
||||||
return not frappe.db.exists(
|
first_pcv = frappe.db.get_value(
|
||||||
"Period Closing Voucher",
|
"Period Closing Voucher",
|
||||||
{"company": self.company, "docstatus": 1, "name": ("!=", self.name)},
|
{"company": self.company, "docstatus": 1},
|
||||||
|
"name",
|
||||||
|
order_by="period_end_date",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if not first_pcv or first_pcv == self.name:
|
||||||
|
return True
|
||||||
|
|
||||||
def cancel_gl_entries(self):
|
def cancel_gl_entries(self):
|
||||||
if self.get_gle_count_against_current_pcv() > 5000:
|
if self.get_gle_count_against_current_pcv() > 5000:
|
||||||
frappe.enqueue(
|
frappe.enqueue(
|
||||||
|
|||||||
Reference in New Issue
Block a user