diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.html b/erpnext/accounts/report/balance_sheet/balance_sheet.html index d4ae54d4f38..5774bb07a0b 100644 --- a/erpnext/accounts/report/balance_sheet/balance_sheet.html +++ b/erpnext/accounts/report/balance_sheet/balance_sheet.html @@ -1 +1,224 @@ -{% include "accounts/report/financial_statements.html" %} +{% + const report_columns = report + .get_columns_for_print() + .filter(col => !col.hidden); + + if (report_columns.length > 8) { + frappe.throw( + __("Too many columns. Export the report and print it using a spreadsheet application.") + ); + } +%} + + + +
+ +
+
+ {%= __(report.report_name) %} +
+
+ + {% if (subtitle && subtitle.trim()) { %} +
+ {{ subtitle }} +
+ {% } else { %} +
+
+
+ {%= __("Company") %}: {%= filters.company %} +
+
+ {%= __("Currency") %}: + {%= filters.presentation_currency || erpnext.get_currency(filters.company) %} +
+
+ +
+
+ {%= __("Period Based On") %}: + {%= filters.filter_based_on %} +
+ + {% if (filters.filter_based_on === "Fiscal Year") { %} +
+ {%= __("Start Year") %}: {%= filters.from_fiscal_year %} +
+
+ {%= __("End Year") %}: {%= filters.to_fiscal_year %} +
+ + {% } else if (filters.filter_based_on === "Date Range") { %} +
+ {%= __("Start Date") %}: + {%= frappe.datetime.str_to_user(filters.period_start_date) %} +
+
+ {%= __("End Date") %}: + {%= frappe.datetime.str_to_user(filters.period_end_date) %} +
+ {% } %} +
+
+ {% } %} + +
+ + + + {% for (let i = 0, l = report_columns.length; i < l; i++) { %} + {% + const col = report_columns[i]; + const align = i === 0 ? "text-left" : "text-right"; + %} + + {% } %} + + + + + {% for (let j = 0, k = data.length; j < k; j++) { %} + {% + const row = data[j]; + + let row_class = ""; + if (!(row.parent_account || row.parent_section)) { + row_class = "financial-statements-important"; + } + if (!(row.account_name || row.section)) { + row_class += " financial-statements-blank-row"; + } + %} + + + {% for (let i = 0, l = report_columns.length; i < l; i++) { %} + {% + const col = report_columns[i]; + const value = row[col.fieldname]; + const align = i === 0 ? "text-left" : "text-right"; + %} + + + {% } %} + + {% } %} + +
+ {%= col.label %} +
+ {% if (i === 0) { %} + + {%= String(row.account_name || row.section || "").replace(/^['"]|['"]$/g, "") %} + + {% } else if (!is_null(value)) { %} + {%= frappe.format(value, col, {}, row) %} + {% } %} +
+
+ +

+ {%= __("Printed on {0}", [ + frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) + ]) %} +

+ +
\ No newline at end of file diff --git a/erpnext/accounts/report/cash_flow/cash_flow.html b/erpnext/accounts/report/cash_flow/cash_flow.html index d4ae54d4f38..6b11aea5e54 100644 --- a/erpnext/accounts/report/cash_flow/cash_flow.html +++ b/erpnext/accounts/report/cash_flow/cash_flow.html @@ -1 +1,224 @@ -{% include "accounts/report/financial_statements.html" %} +{% + const report_columns = report + .get_columns_for_print() + .filter(col => !col.hidden); + + if (report_columns.length > 8) { + frappe.throw( + __("Too many columns. Export the report and print it using a spreadsheet application.") + ); + } +%} + + + +
+ +
+
+ {%= __(report.report_name) %} +
+
+ + {% if (subtitle && subtitle.trim()) { %} +
+ {{ subtitle }} +
+ {% } else { %} +
+
+
+ {%= __("Company") %}: {%= filters.company %} +
+
+ {%= __("Currency") %}: + {%= filters.presentation_currency || erpnext.get_currency(filters.company) %} +
+
+ +
+
+ {%= __("Period Based On") %}: + {%= filters.filter_based_on %} +
+ + {% if (filters.filter_based_on === "Fiscal Year") { %} +
+ {%= __("Start Year") %}: {%= filters.from_fiscal_year %} +
+
+ {%= __("End Year") %}: {%= filters.to_fiscal_year %} +
+ + {% } else if (filters.filter_based_on === "Date Range") { %} +
+ {%= __("Start Date") %}: + {%= frappe.datetime.str_to_user(filters.period_start_date) %} +
+
+ {%= __("End Date") %}: + {%= frappe.datetime.str_to_user(filters.period_end_date) %} +
+ {% } %} +
+
+ {% } %} + +
+ + + + {% for (let i = 0, l = report_columns.length; i < l; i++) { %} + {% + const col = report_columns[i]; + const align = i === 0 ? "text-left" : "text-right"; + %} + + {% } %} + + + + + {% for (let j = 0, k = data.length; j < k; j++) { %} + {% + const row = data[j]; + + let row_class = ""; + if (!(row.parent_account || row.parent_section)) { + row_class = "financial-statements-important"; + } + if (!(row.account_name || row.section)) { + row_class += " financial-statements-blank-row"; + } + %} + + + {% for (let i = 0, l = report_columns.length; i < l; i++) { %} + {% + const col = report_columns[i]; + const value = row[col.fieldname]; + const align = i === 0 ? "text-left" : "text-right"; + %} + + + {% } %} + + {% } %} + +
+ {%= col.label %} +
+ {% if (i === 0) { %} + + {%= String(row.account_name || row.section || "").replace(/^['"]|['"]$/g, "") %} + + {% } else if (!is_null(value)) { %} + {%= frappe.format(value, col, {}, row) %} + {% } %} +
+
+ +

+ {%= __("Printed on {0}", [ + frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) + ]) %} +

+ +
\ No newline at end of file diff --git a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.html b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.html index d4ae54d4f38..6b11aea5e54 100644 --- a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.html +++ b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.html @@ -1 +1,224 @@ -{% include "accounts/report/financial_statements.html" %} +{% + const report_columns = report + .get_columns_for_print() + .filter(col => !col.hidden); + + if (report_columns.length > 8) { + frappe.throw( + __("Too many columns. Export the report and print it using a spreadsheet application.") + ); + } +%} + + + +
+ +
+
+ {%= __(report.report_name) %} +
+
+ + {% if (subtitle && subtitle.trim()) { %} +
+ {{ subtitle }} +
+ {% } else { %} +
+
+
+ {%= __("Company") %}: {%= filters.company %} +
+
+ {%= __("Currency") %}: + {%= filters.presentation_currency || erpnext.get_currency(filters.company) %} +
+
+ +
+
+ {%= __("Period Based On") %}: + {%= filters.filter_based_on %} +
+ + {% if (filters.filter_based_on === "Fiscal Year") { %} +
+ {%= __("Start Year") %}: {%= filters.from_fiscal_year %} +
+
+ {%= __("End Year") %}: {%= filters.to_fiscal_year %} +
+ + {% } else if (filters.filter_based_on === "Date Range") { %} +
+ {%= __("Start Date") %}: + {%= frappe.datetime.str_to_user(filters.period_start_date) %} +
+
+ {%= __("End Date") %}: + {%= frappe.datetime.str_to_user(filters.period_end_date) %} +
+ {% } %} +
+
+ {% } %} + +
+ + + + {% for (let i = 0, l = report_columns.length; i < l; i++) { %} + {% + const col = report_columns[i]; + const align = i === 0 ? "text-left" : "text-right"; + %} + + {% } %} + + + + + {% for (let j = 0, k = data.length; j < k; j++) { %} + {% + const row = data[j]; + + let row_class = ""; + if (!(row.parent_account || row.parent_section)) { + row_class = "financial-statements-important"; + } + if (!(row.account_name || row.section)) { + row_class += " financial-statements-blank-row"; + } + %} + + + {% for (let i = 0, l = report_columns.length; i < l; i++) { %} + {% + const col = report_columns[i]; + const value = row[col.fieldname]; + const align = i === 0 ? "text-left" : "text-right"; + %} + + + {% } %} + + {% } %} + +
+ {%= col.label %} +
+ {% if (i === 0) { %} + + {%= String(row.account_name || row.section || "").replace(/^['"]|['"]$/g, "") %} + + {% } else if (!is_null(value)) { %} + {%= frappe.format(value, col, {}, row) %} + {% } %} +
+
+ +

+ {%= __("Printed on {0}", [ + frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) + ]) %} +

+ +
\ No newline at end of file diff --git a/erpnext/accounts/report/trial_balance/trial_balance.html b/erpnext/accounts/report/trial_balance/trial_balance.html index d4ae54d4f38..be3fa7a205b 100644 --- a/erpnext/accounts/report/trial_balance/trial_balance.html +++ b/erpnext/accounts/report/trial_balance/trial_balance.html @@ -1 +1,210 @@ -{% include "accounts/report/financial_statements.html" %} +{% + const report_columns = report + .get_columns_for_print() + .filter(col => !col.hidden); + + if (report_columns.length > 8) { + frappe.throw( + __("Too many columns. Export the report and print it using a spreadsheet application.") + ); + } +%} + + + +
+ +
+
+ {%= __(report.report_name) %} +
+
+ + {% if (subtitle && subtitle.trim()) { %} +
+ {{ subtitle }} +
+ {% } else { %} +
+
+
+ {%= __("Company") %}: {%= filters.company %} +
+
+ {%= __("Currency") %}: + {%= filters.presentation_currency || erpnext.get_currency(filters.company) %} +
+
+ +
+
+ {%= __("From Date") %}: + {%= frappe.datetime.str_to_user(filters.from_date) %} +
+
+ {%= __("To Date") %}: + {%= frappe.datetime.str_to_user(filters.to_date) %} +
+
+
+ {% } %} + +
+ + + + {% for (let i = 0, l = report_columns.length; i < l; i++) { %} + {% + const col = report_columns[i]; + const align = i === 0 ? "text-left" : "text-right"; + const styling = i === 0 ? "" : "width: 9em"; + %} + + {% } %} + + + + + {% for (let j = 0, k = data.length; j < k; j++) { %} + {% + const row = data[j]; + + let row_class = ""; + if (!(row.parent_account || row.parent_section)) { + row_class = "financial-statements-important"; + } + if (!(row.account_name || row.section)) { + row_class += " financial-statements-blank-row"; + } + %} + + + {% for (let i = 0, l = report_columns.length; i < l; i++) { %} + {% + const col = report_columns[i]; + const value = row[col.fieldname]; + const align = i === 0 ? "text-left" : "text-right"; + %} + + + {% } %} + + {% } %} + +
+ {%= col.label %} +
+ {% if (i === 0) { %} + + {%= String(row.account_name || row.section || "").replace(/^['"]|['"]$/g, "") %} + + {% } else if (!is_null(value)) { %} + {%= frappe.format(value, col, {}, row) %} + {% } %} +
+
+ +

+ {%= __("Printed on {0}", [ + frappe.datetime.str_to_user(frappe.datetime.get_datetime_as_string()) + ]) %} +

+ +
\ No newline at end of file