refactor: change sequence for profit and loss statement

This commit is contained in:
Shivam Mishra 2020-07-08 15:53:35 +05:30
parent be5e129259
commit 840550e25f

View File

@ -59,13 +59,6 @@ def get_report_summary(period_list, periodicity, income, expense, net_profit_los
expense_label = _("Total Expense")
return [
{
"value": net_profit,
"indicator": "Green" if net_profit > 0 else "Red",
"label": profit_label,
"datatype": "Currency",
"currency": net_profit_loss.get("currency") if net_profit_loss else default_currency
},
{
"value": net_income,
"label": income_label,
@ -77,6 +70,13 @@ def get_report_summary(period_list, periodicity, income, expense, net_profit_los
"label": expense_label,
"datatype": "Currency",
"currency": expense[-1].get('currency') if expense else default_currency
},
{
"value": net_profit,
"indicator": "Green" if net_profit > 0 else "Red",
"label": profit_label,
"datatype": "Currency",
"currency": net_profit_loss.get("currency") if net_profit_loss else default_currency
}
]