feat: Period-wise closing entries for TB (backport #39712) (#48386)

feat: Period-wise closing entries for TB

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
This commit is contained in:
Diptanil Saha
2025-07-03 22:47:28 +05:30
committed by GitHub
parent c54b65acc2
commit 711e06b537
2 changed files with 10 additions and 4 deletions

View File

@@ -79,8 +79,14 @@ frappe.require("assets/erpnext/js/financial_statements.js", function () {
options: erpnext.get_presentation_currency_list(), options: erpnext.get_presentation_currency_list(),
}, },
{ {
fieldname: "with_period_closing_entry", fieldname: "with_period_closing_entry_for_opening",
label: __("Period Closing Entry"), label: __("With Period Closing Entry For Opening Balances"),
fieldtype: "Check",
default: 1,
},
{
fieldname: "with_period_closing_entry_for_current_period",
label: __("Period Closing Entry For Current Period"),
fieldtype: "Check", fieldtype: "Check",
default: 1, default: 1,
}, },

View File

@@ -120,7 +120,7 @@ def get_data(filters):
max_rgt, max_rgt,
filters, filters,
gl_entries_by_account, gl_entries_by_account,
ignore_closing_entries=not flt(filters.with_period_closing_entry), ignore_closing_entries=not flt(filters.with_period_closing_entry_for_current_period),
ignore_opening_entries=True, ignore_opening_entries=True,
) )
@@ -274,7 +274,7 @@ def get_opening_balance(
): ):
opening_balance = opening_balance.where(closing_balance.posting_date >= filters.year_start_date) opening_balance = opening_balance.where(closing_balance.posting_date >= filters.year_start_date)
if not flt(filters.with_period_closing_entry): if not flt(filters.with_period_closing_entry_for_opening):
if doctype == "Account Closing Balance": if doctype == "Account Closing Balance":
opening_balance = opening_balance.where(closing_balance.is_period_closing_voucher_entry == 0) opening_balance = opening_balance.where(closing_balance.is_period_closing_voucher_entry == 0)
else: else: