mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-05 22:48:27 +00:00
Merge pull request #49820 from lauty95/translations
fix: financial ratios translation and pdf export error
This commit is contained in:
@@ -52,7 +52,7 @@ frappe.query_reports["Financial Ratios"] = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
formatter: function (value, row, column, data, default_formatter) {
|
formatter: function (value, row, column, data, default_formatter) {
|
||||||
let heading_ratios = ["Liquidity Ratios", "Solvency Ratios", "Turnover Ratios"];
|
let heading_ratios = [__("Liquidity Ratios"), __("Solvency Ratios"), __("Turnover Ratios")];
|
||||||
|
|
||||||
if (heading_ratios.includes(value)) {
|
if (heading_ratios.includes(value)) {
|
||||||
value = $(`<span>${value}</span>`);
|
value = $(`<span>${value}</span>`);
|
||||||
@@ -60,7 +60,7 @@ frappe.query_reports["Financial Ratios"] = {
|
|||||||
value = $value.wrap("<p></p>").parent().html();
|
value = $value.wrap("<p></p>").parent().html();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (heading_ratios.includes(row[1].content) && column.fieldtype == "Float") {
|
if (heading_ratios.includes(row[1]?.content) && column.fieldtype == "Float") {
|
||||||
column.fieldtype = "Data";
|
column.fieldtype = "Data";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -147,9 +147,9 @@ def get_gl_data(filters, period_list, years):
|
|||||||
|
|
||||||
def add_liquidity_ratios(data, years, current_asset, current_liability, quick_asset):
|
def add_liquidity_ratios(data, years, current_asset, current_liability, quick_asset):
|
||||||
precision = frappe.db.get_single_value("System Settings", "float_precision")
|
precision = frappe.db.get_single_value("System Settings", "float_precision")
|
||||||
data.append({"ratio": "Liquidity Ratios"})
|
data.append({"ratio": _("Liquidity Ratios")})
|
||||||
|
|
||||||
ratio_data = [["Current Ratio", current_asset], ["Quick Ratio", quick_asset]]
|
ratio_data = [[_("Current Ratio"), current_asset], [_("Quick Ratio"), quick_asset]]
|
||||||
|
|
||||||
for d in ratio_data:
|
for d in ratio_data:
|
||||||
row = {
|
row = {
|
||||||
@@ -165,13 +165,13 @@ def add_solvency_ratios(
|
|||||||
data, years, total_asset, total_liability, net_sales, cogs, total_income, total_expense
|
data, years, total_asset, total_liability, net_sales, cogs, total_income, total_expense
|
||||||
):
|
):
|
||||||
precision = frappe.db.get_single_value("System Settings", "float_precision")
|
precision = frappe.db.get_single_value("System Settings", "float_precision")
|
||||||
data.append({"ratio": "Solvency Ratios"})
|
data.append({"ratio": _("Solvency Ratios")})
|
||||||
|
|
||||||
debt_equity_ratio = {"ratio": "Debt Equity Ratio"}
|
debt_equity_ratio = {"ratio": _("Debt Equity Ratio")}
|
||||||
gross_profit_ratio = {"ratio": "Gross Profit Ratio"}
|
gross_profit_ratio = {"ratio": _("Gross Profit Ratio")}
|
||||||
net_profit_ratio = {"ratio": "Net Profit Ratio"}
|
net_profit_ratio = {"ratio": _("Net Profit Ratio")}
|
||||||
return_on_asset_ratio = {"ratio": "Return on Asset Ratio"}
|
return_on_asset_ratio = {"ratio": _("Return on Asset Ratio")}
|
||||||
return_on_equity_ratio = {"ratio": "Return on Equity Ratio"}
|
return_on_equity_ratio = {"ratio": _("Return on Equity Ratio")}
|
||||||
|
|
||||||
for year in years:
|
for year in years:
|
||||||
profit_after_tax = flt(total_income.get(year)) + flt(total_expense.get(year))
|
profit_after_tax = flt(total_income.get(year)) + flt(total_expense.get(year))
|
||||||
@@ -195,7 +195,7 @@ def add_solvency_ratios(
|
|||||||
|
|
||||||
def add_turnover_ratios(data, years, period_list, filters, total_asset, net_sales, cogs, direct_expense):
|
def add_turnover_ratios(data, years, period_list, filters, total_asset, net_sales, cogs, direct_expense):
|
||||||
precision = frappe.db.get_single_value("System Settings", "float_precision")
|
precision = frappe.db.get_single_value("System Settings", "float_precision")
|
||||||
data.append({"ratio": "Turnover Ratios"})
|
data.append({"ratio": _("Turnover Ratios")})
|
||||||
|
|
||||||
avg_data = {}
|
avg_data = {}
|
||||||
for d in ["Receivable", "Payable", "Stock"]:
|
for d in ["Receivable", "Payable", "Stock"]:
|
||||||
@@ -208,10 +208,10 @@ def add_turnover_ratios(data, years, period_list, filters, total_asset, net_sale
|
|||||||
)
|
)
|
||||||
|
|
||||||
ratio_data = [
|
ratio_data = [
|
||||||
["Fixed Asset Turnover Ratio", net_sales, total_asset],
|
[_("Fixed Asset Turnover Ratio"), net_sales, total_asset],
|
||||||
["Debtor Turnover Ratio", net_sales, avg_debtors],
|
[_("Debtor Turnover Ratio"), net_sales, avg_debtors],
|
||||||
["Creditor Turnover Ratio", direct_expense, avg_creditors],
|
[_("Creditor Turnover Ratio"), direct_expense, avg_creditors],
|
||||||
["Inventory Turnover Ratio", cogs, avg_stock],
|
[_("Inventory Turnover Ratio"), cogs, avg_stock],
|
||||||
]
|
]
|
||||||
for ratio in ratio_data:
|
for ratio in ratio_data:
|
||||||
row = {
|
row = {
|
||||||
|
|||||||
Reference in New Issue
Block a user