From 4b3e454fb4ad37da3e82f9b0073db5e2b9ac1379 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 5 Feb 2024 14:10:42 +0530 Subject: [PATCH] feat: Period-wise closing entries for TB (#39712) (cherry picked from commit 6e6c818084ee3fbbb2d44a58acb5c78c9f5b61ac) # Conflicts: # erpnext/accounts/report/trial_balance/trial_balance.js --- .../report/trial_balance/trial_balance.js | 65 +++++++++++++++++++ .../report/trial_balance/trial_balance.py | 4 +- 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/trial_balance/trial_balance.js b/erpnext/accounts/report/trial_balance/trial_balance.js index 7337fd477e7..1a2a800640b 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.js +++ b/erpnext/accounts/report/trial_balance/trial_balance.js @@ -24,6 +24,7 @@ frappe.require("assets/erpnext/js/financial_statements.js", function () { if (!fiscal_year) { return; } +<<<<<<< HEAD frappe.model.with_doc("Fiscal Year", fiscal_year, function (r) { var fy = frappe.model.get_doc("Fiscal Year", fiscal_year); frappe.query_report.set_filter_value({ @@ -113,6 +114,70 @@ frappe.require("assets/erpnext/js/financial_statements.js", function () { parent_field: "parent_account", initial_depth: 3, }; +======= + } + } + }, + { + "fieldname": "project", + "label": __("Project"), + "fieldtype": "Link", + "options": "Project" + }, + { + "fieldname": "finance_book", + "label": __("Finance Book"), + "fieldtype": "Link", + "options": "Finance Book", + }, + { + "fieldname": "presentation_currency", + "label": __("Currency"), + "fieldtype": "Select", + "options": erpnext.get_presentation_currency_list() + }, + { + "fieldname": "with_period_closing_entry_for_opening", + "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", + "default": 1 + }, + { + "fieldname": "show_zero_values", + "label": __("Show zero values"), + "fieldtype": "Check" + }, + { + "fieldname": "show_unclosed_fy_pl_balances", + "label": __("Show unclosed fiscal year's P&L balances"), + "fieldtype": "Check" + }, + { + "fieldname": "include_default_book_entries", + "label": __("Include Default FB Entries"), + "fieldtype": "Check", + "default": 1 + }, + { + "fieldname": "show_net_values", + "label": __("Show net values in opening and closing columns"), + "fieldtype": "Check", + "default": 1 + } + ], + "formatter": erpnext.financial_statements.formatter, + "tree": true, + "name_field": "account", + "parent_field": "parent_account", + "initial_depth": 3 +} +>>>>>>> 6e6c818084 (feat: Period-wise closing entries for TB (#39712)) erpnext.utils.add_dimensions("Trial Balance", 6); }); diff --git a/erpnext/accounts/report/trial_balance/trial_balance.py b/erpnext/accounts/report/trial_balance/trial_balance.py index 4ae314bdff7..f0075332256 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.py +++ b/erpnext/accounts/report/trial_balance/trial_balance.py @@ -120,7 +120,7 @@ def get_data(filters): max_rgt, filters, 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, ) @@ -274,7 +274,7 @@ def get_opening_balance( ): 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": opening_balance = opening_balance.where(closing_balance.is_period_closing_voucher_entry == 0) else: