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
// 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.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",
label: __("Accumulated Values"),
fieldtype: "Check",
default: 1,
});
});
frappe.query_reports["Balance Sheet"]["filters"].push({
frappe.query_reports["Balance Sheet"]["filters"].push({
fieldname: "include_default_book_entries",
label: __("Include Default Book Entries"),
fieldtype: "Check",
default: 1,
});
});

View File

@ -1,24 +1,24 @@
// Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt
frappe.require("assets/erpnext/js/financial_statements.js", function() {
frappe.query_reports["Cash Flow"] = $.extend({},
erpnext.financial_statements);
frappe.query_reports["Cash Flow"] = $.extend(
{},
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
// filter. It won't be used in cash flow for now so we pop it. Please take
// of this if you are working here.
// 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
// 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",
"label": __("Include Default Book Entries"),
"fieldtype": "Check",
"default": 1
}
);
});
);

View File

@ -2,8 +2,7 @@
// 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": [
{
"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
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": [
{
"fieldname": "company",
@ -68,9 +67,8 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
"name_field": "account",
"parent_field": "parent_account",
"initial_depth": 3
}
}
});
function get_accounting_dimension_options() {
let options =["Cost Center", "Project"];

View File

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

View File

@ -1,18 +1,16 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// 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.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",
label: __("Accumulated Values"),
fieldtype: "Check",
default: 1,
});
});

View File

@ -1,8 +1,7 @@
// Copyright (c) 2016, Frappe Technologies Pvt. Ltd. and contributors
// 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": [
{
"fieldname": "company",
@ -124,10 +123,9 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
"name_field": "account",
"parent_field": "parent_account",
"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"]);
});
});

View File

@ -1,8 +1,7 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// 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": [
{
"fieldname": "company",
@ -112,7 +111,6 @@ frappe.require("assets/erpnext/js/financial_statements.js", function() {
"name_field": "account",
"parent_field": "parent_account",
"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 "./controllers/buying.js";
import "./utils/demo.js";
import "./financial_statements.js";
// import { sum } from 'frappe/public/utils/util.js'