refactor: import financial_statement in erpnext bundle

This commit is contained in:
ruthra kumar 2023-10-07 18:24:46 +05:30
parent aad77b133b
commit 40e7c43ce3
9 changed files with 491 additions and 507 deletions

View File

@ -1,25 +1,23 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt // License: GNU General Public License v3. See license.txt
frappe.require("assets/erpnext/js/financial_statements.js", function () { frappe.query_reports["Balance Sheet"] = $.extend(
frappe.query_reports["Balance Sheet"] = $.extend(
{}, {},
erpnext.financial_statements erpnext.financial_statements
); );
erpnext.utils.add_dimensions("Balance Sheet", 10); erpnext.utils.add_dimensions("Balance Sheet", 10);
frappe.query_reports["Balance Sheet"]["filters"].push({ frappe.query_reports["Balance Sheet"]["filters"].push({
fieldname: "accumulated_values", fieldname: "accumulated_values",
label: __("Accumulated Values"), label: __("Accumulated Values"),
fieldtype: "Check", fieldtype: "Check",
default: 1, default: 1,
}); });
frappe.query_reports["Balance Sheet"]["filters"].push({ frappe.query_reports["Balance Sheet"]["filters"].push({
fieldname: "include_default_book_entries", fieldname: "include_default_book_entries",
label: __("Include Default Book Entries"), label: __("Include Default Book Entries"),
fieldtype: "Check", fieldtype: "Check",
default: 1, default: 1,
});
}); });

View File

@ -1,24 +1,24 @@
// Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors // Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt // For license information, please see license.txt
frappe.require("assets/erpnext/js/financial_statements.js", function() { frappe.query_reports["Cash Flow"] = $.extend(
frappe.query_reports["Cash Flow"] = $.extend({}, {},
erpnext.financial_statements); erpnext.financial_statements
);
erpnext.utils.add_dimensions('Cash Flow', 10); erpnext.utils.add_dimensions('Cash Flow', 10);
// The last item in the array is the definition for Presentation Currency // The last item in the array is the definition for Presentation Currency
// filter. It won't be used in cash flow for now so we pop it. Please take // filter. It won't be used in cash flow for now so we pop it. Please take
// of this if you are working here. // of this if you are working here.
frappe.query_reports["Cash Flow"]["filters"].splice(8, 1); frappe.query_reports["Cash Flow"]["filters"].splice(8, 1);
frappe.query_reports["Cash Flow"]["filters"].push( frappe.query_reports["Cash Flow"]["filters"].push(
{ {
"fieldname": "include_default_book_entries", "fieldname": "include_default_book_entries",
"label": __("Include Default Book Entries"), "label": __("Include Default Book Entries"),
"fieldtype": "Check", "fieldtype": "Check",
"default": 1 "default": 1
} }
); );
});

View File

@ -2,8 +2,7 @@
// For license information, please see license.txt // For license information, please see license.txt
frappe.require("assets/erpnext/js/financial_statements.js", function() { frappe.query_reports["Consolidated Financial Statement"] = {
frappe.query_reports["Consolidated Financial Statement"] = {
"filters": [ "filters": [
{ {
"fieldname":"company", "fieldname":"company",
@ -149,5 +148,4 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
}); });
}); });
} }
} }
});

View File

@ -2,8 +2,7 @@
// For license information, please see license.txt // For license information, please see license.txt
frappe.require("assets/erpnext/js/financial_statements.js", function() { frappe.query_reports["Dimension-wise Accounts Balance Report"] = {
frappe.query_reports["Dimension-wise Accounts Balance Report"] = {
"filters": [ "filters": [
{ {
"fieldname": "company", "fieldname": "company",
@ -68,9 +67,8 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
"name_field": "account", "name_field": "account",
"parent_field": "parent_account", "parent_field": "parent_account",
"initial_depth": 3 "initial_depth": 3
} }
});
function get_accounting_dimension_options() { function get_accounting_dimension_options() {
let options =["Cost Center", "Project"]; let options =["Cost Center", "Project"];

View File

@ -2,20 +2,15 @@
// For license information, please see license.txt // For license information, please see license.txt
frappe.query_reports["Gross and Net Profit Report"] = { frappe.query_reports["Gross and Net Profit Report"] = $.extend(
"filters": [ {},
erpnext.financial_statements
);
] frappe.query_reports["Gross and Net Profit Report"]["filters"].push(
}
frappe.require("assets/erpnext/js/financial_statements.js", function() {
frappe.query_reports["Gross and Net Profit Report"] = $.extend({},
erpnext.financial_statements);
frappe.query_reports["Gross and Net Profit Report"]["filters"].push(
{ {
"fieldname": "accumulated_values", "fieldname": "accumulated_values",
"label": __("Accumulated Values"), "label": __("Accumulated Values"),
"fieldtype": "Check" "fieldtype": "Check"
} }
); );
});

View File

@ -1,18 +1,16 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt // License: GNU General Public License v3. See license.txt
frappe.require("assets/erpnext/js/financial_statements.js", function () { frappe.query_reports["Profit and Loss Statement"] = $.extend(
frappe.query_reports["Profit and Loss Statement"] = $.extend(
{}, {},
erpnext.financial_statements erpnext.financial_statements
); );
erpnext.utils.add_dimensions("Profit and Loss Statement", 10); erpnext.utils.add_dimensions("Profit and Loss Statement", 10);
frappe.query_reports["Profit and Loss Statement"]["filters"].push({ frappe.query_reports["Profit and Loss Statement"]["filters"].push({
fieldname: "accumulated_values", fieldname: "accumulated_values",
label: __("Accumulated Values"), label: __("Accumulated Values"),
fieldtype: "Check", fieldtype: "Check",
default: 1, default: 1,
});
}); });

View File

@ -1,8 +1,7 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors // Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt // For license information, please see license.txt
frappe.require("assets/erpnext/js/financial_statements.js", function() { frappe.query_reports["Profitability Analysis"] = {
frappe.query_reports["Profitability Analysis"] = {
"filters": [ "filters": [
{ {
"fieldname": "company", "fieldname": "company",
@ -124,10 +123,9 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
"name_field": "account", "name_field": "account",
"parent_field": "parent_account", "parent_field": "parent_account",
"initial_depth": 3 "initial_depth": 3
} }
erpnext.dimension_filters.forEach((dimension) => { erpnext.dimension_filters.forEach((dimension) => {
frappe.query_reports["Profitability Analysis"].filters[1].options.push(dimension["document_type"]); frappe.query_reports["Profitability Analysis"].filters[1].options.push(dimension["document_type"]);
});
}); });

View File

@ -1,8 +1,7 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors // Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt // License: GNU General Public License v3. See license.txt
frappe.require("assets/erpnext/js/financial_statements.js", function() { frappe.query_reports["Trial Balance"] = {
frappe.query_reports["Trial Balance"] = {
"filters": [ "filters": [
{ {
"fieldname": "company", "fieldname": "company",
@ -112,7 +111,6 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
"name_field": "account", "name_field": "account",
"parent_field": "parent_account", "parent_field": "parent_account",
"initial_depth": 3 "initial_depth": 3
} }
erpnext.utils.add_dimensions('Trial Balance', 6); erpnext.utils.add_dimensions('Trial Balance', 6);
});

View File

@ -30,5 +30,6 @@ import "./utils/landed_taxes_and_charges_common.js";
import "./utils/sales_common.js"; import "./utils/sales_common.js";
import "./controllers/buying.js"; import "./controllers/buying.js";
import "./utils/demo.js"; import "./utils/demo.js";
import "./financial_statements.js";
// import { sum } from 'frappe/public/utils/util.js' // import { sum } from 'frappe/public/utils/util.js'