Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: find first PCV to consider opening entries (backport #43913) #43918

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,16 @@ def get_closing_entries_for_closing_account(self):
return closing_entries

def is_first_period_closing_voucher(self):
return not frappe.db.exists(
first_pcv = frappe.db.get_value(
"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):
if self.get_gle_count_against_current_pcv() > 5000:
frappe.enqueue(
Expand Down
Loading