Browse Source

[UPDT] 2 * Dashboard issue fixed

pull/175/head
Ajmal Cybro 4 years ago
parent
commit
7489c0c1d5
  1. 2
      base_accounting_kit/__manifest__.py
  2. 54
      base_accounting_kit/data/account_financial_report_data.xml
  3. 6
      base_accounting_kit/doc/changelog.md
  4. 211
      base_accounting_kit/static/src/js/account_dashboard.js

2
base_accounting_kit/__manifest__.py

@ -22,7 +22,7 @@
{ {
'name': 'Odoo 14 Full Accounting Kit', 'name': 'Odoo 14 Full Accounting Kit',
'version': '14.0.3.10.8', 'version': '14.0.3.11.9',
'category': 'Accounting', 'category': 'Accounting',
'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs', 'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs',
'summary': """ Asset and Budget Management, 'summary': """ Asset and Budget Management,

54
base_accounting_kit/data/account_financial_report_data.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<data noupdate="1"> <data>
<!-- Financial Reports --> <!-- Financial Reports -->
<record id="account_financial_report_profitandloss0" <record id="account_financial_report_profitandloss0"
model="account.financial.report"> model="account.financial.report">
@ -13,20 +13,66 @@
model="account.financial.report"> model="account.financial.report">
<field name="name">Income</field> <field name="name">Income</field>
<field name="sign" eval="'-1'"/> <field name="sign" eval="'-1'"/>
<field name="sequence">0</field> <field name="sequence">1</field>
<field name="parent_id" <field name="parent_id"
ref="account_financial_report_profitandloss0"/> ref="account_financial_report_profitandloss0"/>
<field name="display_detail">detail_with_hierarchy</field> <field name="display_detail">detail_with_hierarchy</field>
<field name="type">sum</field>
</record>
<record id="account_financial_report_other_income0"
model="account.financial.report">
<field name="name">Other Income</field>
<field name="sequence">10</field>
<field name="parent_id"
ref="account_financial_report_income0"/>
<field name="display_detail">detail_with_hierarchy</field>
<field name="type">account_type</field> <field name="type">account_type</field>
<field name="account_type_ids" <field name="account_type_ids"
eval="[(4,ref('account.data_account_type_other_income')), (4,ref('account.data_account_type_revenue'))]"/> eval="[(4,ref('account.data_account_type_other_income'))]"/>
</record>
<record id="financial_report_gross_profit"
model="account.financial.report">
<field name="name">Gross Profit</field>
<field name="parent_id"
ref="account_financial_report_income0"/>
<field name="display_detail">detail_with_hierarchy</field>
<field name="type">sum</field>
<field name="sequence">3</field>
</record>
<record id="financial_report_cost_of_revenue"
model="account.financial.report">
<field name="name">Cost of Revenue</field>
<field name="sequence">10</field>
<field name="parent_id"
ref="financial_report_gross_profit"/>
<field name="display_detail">detail_with_hierarchy</field>
<field name="type">account_type</field>
<field name="account_type_ids"
eval="[(4,ref('account.data_account_type_direct_costs'))]"/>
</record>
<record id="account_financial_report_operating_income0"
model="account.financial.report">
<field name="name">Operating Income</field>
<field name="sequence">1</field>
<field name="parent_id"
ref="financial_report_gross_profit"/>
<field name="display_detail">detail_with_hierarchy</field>
<field name="type">account_type</field>
<field name="account_type_ids"
eval="[(4,ref('account.data_account_type_revenue'))]"/>
</record> </record>
<record id="account_financial_report_expense0" <record id="account_financial_report_expense0"
model="account.financial.report"> model="account.financial.report">
<field name="name">Expense</field> <field name="name">Expense</field>
<field name="sign" eval="'-1'"/> <field name="sign" eval="'-1'"/>
<field name="sequence">1</field> <field name="sequence">2</field>
<field name="parent_id" <field name="parent_id"
ref="account_financial_report_profitandloss0"/> ref="account_financial_report_profitandloss0"/>
<field name="display_detail">detail_with_hierarchy</field> <field name="display_detail">detail_with_hierarchy</field>

6
base_accounting_kit/doc/changelog.md

@ -70,3 +70,9 @@
#### UPDT #### UPDT
- Report Configuration Sequence - Report Configuration Sequence
#### 28.05.2021
#### Version 14.0.3.11.9
#### UPDT
- 2 * Dashboard Issue
- Report Configuration Sequence

211
base_accounting_kit/static/src/js/account_dashboard.js

@ -86,9 +86,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move.line', res_model: 'account.move.line',
name: _t('Net Profit or Loss'), name: _t('Net Profit or Loss'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -103,9 +108,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move.line', res_model: 'account.move.line',
name: _t('Net Profit or Loss'), name: _t('Net Profit or Loss'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -120,9 +130,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move.line', res_model: 'account.move.line',
name: _t('Total Income'), name: _t('Total Income'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -137,9 +152,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move.line', res_model: 'account.move.line',
name: _t('Total Income'), name: _t('Total Income'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -154,9 +174,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move.line', res_model: 'account.move.line',
name: _t('Total Expenses'), name: _t('Total Expenses'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -171,9 +196,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move.line', res_model: 'account.move.line',
name: _t('Total Expenses'), name: _t('Total Expenses'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -188,9 +218,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move.line', res_model: 'account.move.line',
name: _t('Unreconciled'), name: _t('Unreconciled'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -205,9 +240,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move.line', res_model: 'account.move.line',
name: _t('Unreconciled'), name: _t('Unreconciled'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -225,9 +265,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move', res_model: 'account.move',
name: _t('Paid'), name: _t('Paid'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -245,9 +290,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move', res_model: 'account.move',
name: _t('Invoice'), name: _t('Invoice'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -265,9 +315,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move', res_model: 'account.move',
name: _t('Paid'), name: _t('Paid'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -285,9 +340,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move', res_model: 'account.move',
name: _t('Invoice'), name: _t('Invoice'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -305,9 +365,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move', res_model: 'account.move',
name: _t('Invoice'), name: _t('Invoice'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -325,9 +390,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move', res_model: 'account.move',
name: _t('Paid'), name: _t('Paid'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -345,9 +415,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move', res_model: 'account.move',
name: _t('Invoice'), name: _t('Invoice'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -365,9 +440,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.move', res_model: 'account.move',
name: _t('Paid'), name: _t('Paid'),
views: [[false, 'list'], [false, 'form']], views: [
[false, 'list'],
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
domain: [['id', 'in', result]], domain: [
['id', 'in', result]
],
}); });
}) })
}, },
@ -405,7 +485,6 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
model: "account.move", model: "account.move",
method: "get_top_10_customers_month", method: "get_top_10_customers_month",
args: [posted, f] args: [posted, f]
}) })
.then(function(result) { .then(function(result) {
$('#top_10_customers').hide(); $('#top_10_customers').hide();
@ -422,7 +501,9 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'res.partner', res_model: 'res.partner',
name: _t('Partner'), name: _t('Partner'),
views: [[false, 'form']], views: [
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
res_id: x.parent, res_id: x.parent,
}); });
@ -448,7 +529,7 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
}) })
.then(function(result) { .then(function(result) {
$('#net_profit_this_months').hide(); $('#net_profit_current_months').hide();
$('#net_profit_last_month').hide(); $('#net_profit_last_month').hide();
$('#net_profit_last_year').show(); $('#net_profit_last_year').show();
$('#net_profit_this_year').hide(); $('#net_profit_this_year').hide();
@ -526,7 +607,7 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
args: [posted], args: [posted],
}) })
.then(function(result) { .then(function(result) {
$('#net_profit_this_months').hide(); $('#net_profit_current_months').hide();
$('#net_profit_last_month').show(); $('#net_profit_last_month').show();
$('#net_profit_this_year').hide(); $('#net_profit_this_year').hide();
$('#net_profit_last_year').hide(); $('#net_profit_last_year').hide();
@ -608,7 +689,7 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
.then(function(result) { .then(function(result) {
$('#net_profit_this_months').hide(); $('#net_profit_current_months').hide();
$('#net_profit_last_month').hide(); $('#net_profit_last_month').hide();
$('#net_profit_last_year').hide(); $('#net_profit_last_year').hide();
$('#net_profit_this_year').show(); $('#net_profit_this_year').show();
@ -1371,6 +1452,8 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
}).then(function(result) { }).then(function(result) {
var due_count = 0; var due_count = 0;
var amount; var amount;
$('#top_10_customers_this_month').empty();
_.forEach(result, function(x) { _.forEach(result, function(x) {
$('#top_10_customers_this_month').show(); $('#top_10_customers_this_month').show();
due_count++; due_count++;
@ -1380,7 +1463,9 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'res.partner', res_model: 'res.partner',
name: _t('Partner'), name: _t('Partner'),
views: [[false, 'form']], views: [
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
res_id: x.parent, res_id: x.parent,
}); });
@ -1401,6 +1486,8 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
for (var k = 0; k < banks.length; k++) { for (var k = 0; k < banks.length; k++) {
amount = self.format_currency(currency, balance[k]); amount = self.format_currency(currency, balance[k]);
// $('#charts').append('<li><a ' + banks[k] + '" data-user-id="' + banks[k] + '">' + banks[k] + '</a>'+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + '<span>'+ balance[k] +'</span>' + '</li>' ); // $('#charts').append('<li><a ' + banks[k] + '" data-user-id="' + banks[k] + '">' + banks[k] + '</a>'+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + '<span>'+ balance[k] +'</span>' + '</li>' );
$('#current_bank_balance').empty()
$('#current_bank_balance').append('<li><div val="' + bnk_ids[k] + '"id="b_' + bnk_ids[k] + '">' + banks[k] + '</div><div>' + amount + '</div></li>'); $('#current_bank_balance').append('<li><div val="' + bnk_ids[k] + '"id="b_' + bnk_ids[k] + '">' + banks[k] + '</div><div>' + amount + '</div></li>');
// $('#current_bank_balance').append('<li>' + banks[k] +'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+ balance[k] + '</li>' ); // $('#current_bank_balance').append('<li>' + banks[k] +'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+ balance[k] + '</li>' );
$('#drop_charts_balance').append('<li>' + balance[k].toFixed(2) + '</li>'); $('#drop_charts_balance').append('<li>' + balance[k].toFixed(2) + '</li>');
@ -1408,7 +1495,9 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
self.do_action({ self.do_action({
res_model: 'account.account', res_model: 'account.account',
name: _t('Account'), name: _t('Account'),
views: [[false, 'form']], views: [
[false, 'form']
],
type: 'ir.actions.act_window', type: 'ir.actions.act_window',
res_id: parseInt(this.id.replace('b_', '')), res_id: parseInt(this.id.replace('b_', '')),
}); });
@ -1468,7 +1557,6 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
.then(function(result) { .then(function(result) {
var unreconciled_count = result[0].count; var unreconciled_count = result[0].count;
$('#unreconciled_items').append('<span>' + unreconciled_count + ' Item(s)</a></span> ') $('#unreconciled_items').append('<span>' + unreconciled_count + ' Item(s)</a></span> ')
}) })
rpc.query({ rpc.query({
@ -1478,6 +1566,8 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
}) })
.then(function(result) { .then(function(result) {
var unreconciled_counts_ = result[0].count; var unreconciled_counts_ = result[0].count;
$('#unreconciled_items_').empty()
$('#unreconciled_items_').append('<span>' + unreconciled_counts_ + ' Item(s)</span><div class="title">This month</div>') $('#unreconciled_items_').append('<span>' + unreconciled_counts_ + ' Item(s)</span><div class="title">This month</div>')
}) })
rpc.query({ rpc.query({
@ -1488,6 +1578,7 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
.then(function(result) { .then(function(result) {
var unreconciled_counts_this_year = result[0].count; var unreconciled_counts_this_year = result[0].count;
$('#unreconciled_counts_this_year').empty()
$('#unreconciled_counts_this_year').append('<span>' + unreconciled_counts_this_year + ' Item(s)</span><div class="title">This Year</div>') $('#unreconciled_counts_this_year').append('<span>' + unreconciled_counts_this_year + ' Item(s)</span><div class="title">This Year</div>')
// $('#unreconciled_counts_this_year').append('<span style= "color:#455e7b;">' + unreconciled_counts_this_year + ' Item(s)</span><div class="title">This Year</div>') // $('#unreconciled_counts_this_year').append('<span style= "color:#455e7b;">' + unreconciled_counts_this_year + ' Item(s)</span><div class="title">This Year</div>')
@ -1499,6 +1590,7 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
}) })
.then(function(result) { .then(function(result) {
var unreconciled_counts_last_year = result[0].count; var unreconciled_counts_last_year = result[0].count;
$('#unreconciled_counts_last_year').empty()
$('#unreconciled_counts_last_year').append('<span>' + unreconciled_counts_last_year + ' Item(s)</span><div class="title">Last Year</div>') $('#unreconciled_counts_last_year').append('<span>' + unreconciled_counts_last_year + ' Item(s)</span><div class="title">Last Year</div>')
@ -1523,11 +1615,15 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
if (incomes_) { if (incomes_) {
incomes_ = -incomes_; incomes_ = -incomes_;
incomes_ = self.format_currency(currency, incomes_); incomes_ = self.format_currency(currency, incomes_);
$('#total_incomes_').empty()
$('#total_incomes_').append('<span>' + incomes_ + '</span><div class="title">This month</div>') $('#total_incomes_').append('<span>' + incomes_ + '</span><div class="title">This month</div>')
} else { } else {
incomes_ = -incomes_; incomes_ = -incomes_;
incomes_ = self.format_currency(currency, incomes_); incomes_ = self.format_currency(currency, incomes_);
$('#total_incomes_').empty()
$('#total_incomes_').append('<span>' + incomes_ + '</span><div class="title">This month</div>') $('#total_incomes_').append('<span>' + incomes_ + '</span><div class="title">This month</div>')
} }
}) })
@ -1551,6 +1647,7 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
var expense = result[0].debit - result[0].credit; var expense = result[0].debit - result[0].credit;
var expenses = expense; var expenses = expense;
expenses = self.format_currency(currency, expenses); expenses = self.format_currency(currency, expenses);
$('#total_expense').append('<span>' + expenses + '</span>') $('#total_expense').append('<span>' + expenses + '</span>')
}) })
rpc.query({ rpc.query({
@ -1563,10 +1660,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
var expenses_this_month_ = expense_this_month; var expenses_this_month_ = expense_this_month;
expenses_this_month_ = self.format_currency(currency, expenses_this_month_); expenses_this_month_ = self.format_currency(currency, expenses_this_month_);
$('#total_expenses_').empty()
$('#total_expenses_').append('<span>' + expenses_this_month_ + '</span><div class="title">This month</div>') $('#total_expenses_').append('<span>' + expenses_this_month_ + '</span><div class="title">This month</div>')
} else { } else {
var expenses_this_month_ = expense_this_month; var expenses_this_month_ = expense_this_month;
expenses_this_month_ = self.format_currency(currency, expenses_this_month_); expenses_this_month_ = self.format_currency(currency, expenses_this_month_);
$('#total_expenses_').empty()
$('#total_expenses_').append('<span>' + expenses_this_month_ + '</span><div class="title">This month</div>') $('#total_expenses_').append('<span>' + expenses_this_month_ + '</span><div class="title">This month</div>')
} }
@ -1581,10 +1682,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
var expenses_this_year_ = expense_this_year; var expenses_this_year_ = expense_this_year;
expenses_this_year_ = self.format_currency(currency, expenses_this_year_); expenses_this_year_ = self.format_currency(currency, expenses_this_year_);
$('#total_expense_this_year').empty();
$('#total_expense_this_year').append('<span >' + expenses_this_year_ + '</span><div class="title">This Year</div>') $('#total_expense_this_year').append('<span >' + expenses_this_year_ + '</span><div class="title">This Year</div>')
} else { } else {
var expenses_this_year_ = expense_this_year; var expenses_this_year_ = expense_this_year;
expenses_this_year_ = self.format_currency(currency, expenses_this_year_); expenses_this_year_ = self.format_currency(currency, expenses_this_year_);
$('#total_expense_this_year').empty();
$('#total_expense_this_year').append('<span >' + expenses_this_year_ + '</span><div class="title">This Year</div>') $('#total_expense_this_year').append('<span >' + expenses_this_year_ + '</span><div class="title">This Year</div>')
} }
}) })
@ -1596,6 +1701,8 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
var incomes_last_year = result[0].debit - result[0].credit; var incomes_last_year = result[0].debit - result[0].credit;
incomes_last_year = -incomes_last_year incomes_last_year = -incomes_last_year
incomes_last_year = self.format_currency(currency, incomes_last_year); incomes_last_year = self.format_currency(currency, incomes_last_year);
$('#total_incomes_last_year').empty();
$('#total_incomes_last_year').append('<span>' + incomes_last_year + '</span><div class="title">Last Year</div>') $('#total_incomes_last_year').append('<span>' + incomes_last_year + '</span><div class="title">Last Year</div>')
}) })
rpc.query({ rpc.query({
@ -1608,10 +1715,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
if (incomes_this_year) { if (incomes_this_year) {
incomes_this_year = -incomes_this_year; incomes_this_year = -incomes_this_year;
incomes_this_year = self.format_currency(currency, incomes_this_year); incomes_this_year = self.format_currency(currency, incomes_this_year);
$('#total_incomes_this_year').empty();
$('#total_incomes_this_year').append('<span>' + incomes_this_year + '</span><div class="title">This Year</div>') $('#total_incomes_this_year').append('<span>' + incomes_this_year + '</span><div class="title">This Year</div>')
} else { } else {
incomes_this_year = -incomes_this_year; incomes_this_year = -incomes_this_year;
incomes_this_year = self.format_currency(currency, incomes_this_year); incomes_this_year = self.format_currency(currency, incomes_this_year);
$('#total_incomes_this_year').empty();
$('#total_incomes_this_year').append('<span>' + incomes_this_year + '</span><div class="title">This Year</div>') $('#total_incomes_this_year').append('<span>' + incomes_this_year + '</span><div class="title">This Year</div>')
} }
@ -1647,15 +1758,15 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
if (profit_this_months) { if (profit_this_months) {
var net_profit_this_months = profit_this_months; var net_profit_this_months = profit_this_months;
net_profit_this_months = self.format_currency(currency, net_profit_this_months); net_profit_this_months = self.format_currency(currency, net_profit_this_months);
$('#net_profit_this_months').empty(); $('#net_profit_current_months').empty();
$('#net_profit_this_months').append('<div class="title">Net Profit/Loss &nbsp;&nbsp;&nbsp;</div><span>' + net_profit_this_months + '</span>') // $('#net_profit_current_months').append('<div class="title">Net Profit/Loss &nbsp;&nbsp;&nbsp;</div><span>' + net_profit_this_months + '</span>')
$('#net_profit_current_months').append('<span>' + net_profit_this_months + '</span> <div class="title">This Month</div>') $('#net_profit_current_months').append('<span>' + net_profit_this_months + '</span> <div class="title">This Month</div>')
} else { } else {
var net_profit_this_months = profit_this_months; var net_profit_this_months = profit_this_months;
net_profit_this_months = self.format_currency(currency, net_profit_this_months); net_profit_this_months = self.format_currency(currency, net_profit_this_months);
$('#net_profit_this_months').empty(); $('#net_profit_current_months').empty();
$('#net_profit_this_months').append('<div class="title">Net Profit/Loss &nbsp;&nbsp;&nbsp;</div><span>' + net_profit_this_months + '</span>') // $('#net_profit_current_months').append('<div class="title">Net Profit/Loss &nbsp;&nbsp;&nbsp;</div><span>' + net_profit_this_months + '</span>')
$('#net_profit_current_months').append('<span>' + net_profit_this_months + '</span> <div class="title">This Month</div>') $('#net_profit_current_months').append('<span>' + net_profit_this_months + '</span> <div class="title">This Month</div>')
} }
}) })
@ -1693,14 +1804,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
if (profit_this_year) { if (profit_this_year) {
var net_profit_this_year = profit_this_year; var net_profit_this_year = profit_this_year;
net_profit_this_year = self.format_currency(currency, net_profit_this_year); net_profit_this_year = self.format_currency(currency, net_profit_this_year);
$('#net_profit_this_year').empty(); $('#net_profit_current_year').empty();
$('#net_profit_this_year').append('<div class="title">Net Profit/Loss &nbsp;&nbsp;&nbsp;</div><span>' + net_profit_this_year + '</span>') // $('#net_profit_this_year').append('<div class="title">Net Profit/Loss &nbsp;&nbsp;&nbsp;</div><span>' + net_profit_this_year + '</span>')
$('#net_profit_current_year').append('<span>' + net_profit_this_year + '</span> <div class="title">This Year</div>') $('#net_profit_current_year').append('<span>' + net_profit_this_year + '</span> <div class="title">This Year</div>')
} else { } else {
var net_profit_this_year = profit_this_year; var net_profit_this_year = profit_this_year;
net_profit_this_year = self.format_currency(currency, net_profit_this_year); net_profit_this_year = self.format_currency(currency, net_profit_this_year);
$('#net_profit_this_year').empty(); $('#net_profit_current_year').empty();
$('#net_profit_this_year').append('<div class="title">Net Profit/Loss &nbsp;&nbsp;&nbsp;</div><span>' + net_profit_this_year + '</span>') // $('#net_profit_this_year').append('<div class="title">Net Profit/Loss &nbsp;&nbsp;&nbsp;</div><span>' + net_profit_this_year + '</span>')
$('#net_profit_current_year').append('<span>' + net_profit_this_year + '</span> <div class="title">This Year</div>') $('#net_profit_current_year').append('<span>' + net_profit_this_year + '</span> <div class="title">This Year</div>')
} }
@ -1712,7 +1823,9 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
if (typeof(amount) != 'number') { if (typeof(amount) != 'number') {
amount = parseFloat(amount); amount = parseFloat(amount);
} }
var formatted_value = (parseInt(amount)).toLocaleString(currency.language, {minimumFractionDigits: 2}) var formatted_value = (parseInt(amount)).toLocaleString(currency.language, {
minimumFractionDigits: 2
})
if (currency.position === "after") { if (currency.position === "after") {
return formatted_value += ' ' + currency.symbol; return formatted_value += ' ' + currency.symbol;
} else { } else {

Loading…
Cancel
Save