diff --git a/base_accounting_kit/__manifest__.py b/base_accounting_kit/__manifest__.py
index 3a61a451b..b8c7f0567 100644
--- a/base_accounting_kit/__manifest__.py
+++ b/base_accounting_kit/__manifest__.py
@@ -22,7 +22,7 @@
{
'name': 'Odoo 13 Full Accounting Kit',
- 'version': '13.0.4.7.8',
+ 'version': '13.0.4.8.9',
'category': 'Accounting',
'live_test_url': 'https://www.youtube.com/watch?v=peAp2Tx_XIs',
'summary': """ Asset and Budget Management,
diff --git a/base_accounting_kit/doc/changelog.md b/base_accounting_kit/doc/changelog.md
index 6999ad746..bbf2cc559 100644
--- a/base_accounting_kit/doc/changelog.md
+++ b/base_accounting_kit/doc/changelog.md
@@ -74,3 +74,11 @@
#### Version 13.0.4.7.8
#### UPDT
- Report updated.
+
+#### 10.06.2020
+#### Version 13.0.4.8.9
+#### UPDT
+- Comma separator in Dashboard
+- Currency symbol position in Dashboard
+- Monthly invoice filter in Dashboard
+- Check payment issue, in case of multi payment
diff --git a/base_accounting_kit/models/account_asset.py b/base_accounting_kit/models/account_asset.py
index 57f0a5c3a..4bf3a14bd 100644
--- a/base_accounting_kit/models/account_asset.py
+++ b/base_accounting_kit/models/account_asset.py
@@ -586,7 +586,6 @@ class AccountAssetAsset(models.Model):
res = super(AccountAssetAsset, self).write(vals)
if 'depreciation_line_ids' not in vals and 'state' not in vals:
for rec in self:
- print("rec",rec)
rec.compute_depreciation_board()
return res
diff --git a/base_accounting_kit/models/account_dashboard.py b/base_accounting_kit/models/account_dashboard.py
index 730f39b86..9e246000b 100644
--- a/base_accounting_kit/models/account_dashboard.py
+++ b/base_accounting_kit/models/account_dashboard.py
@@ -639,6 +639,7 @@ class DashBoard(models.Model):
self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent,
sum(account_move.amount_total) as amount from account_move, res_partner
where account_move.commercial_partner_id = res_partner.id
+ AND account_move.company_id = %s
AND account_move.type = 'out_invoice'
AND %s
AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW()))
@@ -646,13 +647,14 @@ class DashBoard(models.Model):
group by parent, customers
order by amount desc
limit 10
- ''') % (states_arg))
+ ''') % (company_id, states_arg))
record_invoice = self._cr.dictfetchall()
self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent,
sum(account_move.amount_total) as amount from account_move, res_partner
where account_move.commercial_partner_id = res_partner.id
+ AND account_move.company_id = %s
AND account_move.type = 'out_refund'
AND %s
AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW()))
@@ -660,7 +662,7 @@ class DashBoard(models.Model):
group by parent, customers
order by amount desc
limit 10
- ''') % (states_arg))
+ ''') % (company_id, states_arg))
record_refund = self._cr.dictfetchall()
else:
@@ -668,6 +670,7 @@ class DashBoard(models.Model):
self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent,
sum(account_move.amount_total) as amount from account_move, res_partner
where account_move.commercial_partner_id = res_partner.id
+ AND account_move.company_id = %s
AND account_move.type = 'out_invoice'
AND %s
AND Extract(month FROM account_move.invoice_date_due) = ''' + str(
@@ -675,13 +678,14 @@ class DashBoard(models.Model):
group by parent, customers
order by amount desc
limit 10
- ''') % (states_arg))
+ ''') % (company_id, states_arg))
record_invoice = self._cr.dictfetchall()
self._cr.execute((''' select res_partner.name as customers, account_move.commercial_partner_id as parent,
sum(account_move.amount_total) as amount from account_move, res_partner
where account_move.commercial_partner_id = res_partner.id
+ AND account_move.company_id = %s
AND account_move.type = 'out_refund'
AND %s
AND Extract(month FROM account_move.invoice_date_due) = ''' + str(
@@ -689,7 +693,7 @@ class DashBoard(models.Model):
group by parent, customers
order by amount desc
limit 10
- ''') % (states_arg))
+ ''') % (company_id, states_arg))
record_refund = self._cr.dictfetchall()
@@ -928,7 +932,8 @@ class DashBoard(models.Model):
paid_supplier_refund_current_month = [item['supplier_refund_paid'] for item in
result_paid_supplier_refund_current_month]
- return customer_invoice_current_month, credit_note_current_month, supplier_invoice_current_month, refund_current_month, paid_customer_invoice_current_month, paid_supplier_invoice_current_month, paid_customer_credit_current_month, paid_supplier_refund_current_month
+ currency = self.get_currency()
+ return customer_invoice_current_month, credit_note_current_month, supplier_invoice_current_month, refund_current_month, paid_customer_invoice_current_month, paid_supplier_invoice_current_month, paid_customer_credit_current_month, paid_supplier_refund_current_month, currency
@api.model
def get_total_invoice_this_month(self, *post):
@@ -1162,10 +1167,12 @@ class DashBoard(models.Model):
def get_current_company_value(self):
current_company = request.httprequest.cookies.get('cids')
if current_company:
- company_id = current_company[0]
+ company_id = int(current_company[0])
else:
company_id = self.env.company.id
- return int(company_id)
+ if company_id not in self.env.user.company_ids.ids:
+ company_id = self.env.company.id
+ return company_id
@api.model
def profit_income_this_year(self, *post):
@@ -1263,8 +1270,12 @@ class DashBoard(models.Model):
def get_currency(self):
current_company = self.env['res.company'].browse(self.get_current_company_value())
default = current_company.currency_id or self.env.ref('base.main_company').currency_id
- default = default.symbol
- return default
+ lang = self.env.user.lang
+ if not lang:
+ lang = 'en_US'
+ lang = lang.replace("_", '-')
+ currency = {'position': default.position, 'symbol': default.symbol, 'language': lang}
+ return currency
# function to get total expense
diff --git a/base_accounting_kit/models/account_payment.py b/base_accounting_kit/models/account_payment.py
index e969b17f2..5a3e2f9e7 100755
--- a/base_accounting_kit/models/account_payment.py
+++ b/base_accounting_kit/models/account_payment.py
@@ -32,14 +32,20 @@ class AccountRegisterPayments(models.TransientModel):
help='Effective date of PDC', copy=False,
default=False)
- def get_payments_vals(self):
- res = super(AccountRegisterPayments, self).get_payments_vals()
- if self.payment_method_id == self.env.ref(
- 'account_check_printing.account_payment_method_check'):
+ def _prepare_payment_vals(self, invoices):
+ res = super(AccountRegisterPayments, self)._prepare_payment_vals(invoices)
+ # Check payment method is Check or PDC
+ check_pdc_ids = self.env['account.payment.method'].search([('code', 'in', ['pdc', 'check_printing'])])
+ if self.payment_method_id.id in check_pdc_ids.ids:
+ currency_id = self.env['res.currency'].browse(res['currency_id'])
+ journal_id = self.env['account.journal'].browse(res['journal_id'])
+ # Updating values in case of Multi payments
res.update({
- 'check_amount_in_words': self.check_amount_in_words,
- 'check_manual_sequencing': self.check_manual_sequencing,
+ 'bank_reference': self.bank_reference,
+ 'cheque_reference': self.cheque_reference,
+ 'check_manual_sequencing': journal_id.check_manual_sequencing,
'effective_date': self.effective_date,
+ 'check_amount_in_words': currency_id.amount_to_text(res['amount']),
})
return res
diff --git a/base_accounting_kit/static/description/banner.gif b/base_accounting_kit/static/description/banner.gif
index dea243cdb..8924ce5a7 100644
Binary files a/base_accounting_kit/static/description/banner.gif and b/base_accounting_kit/static/description/banner.gif differ
diff --git a/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-1.png b/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-1.png
index b2126b2e4..67d1d0df3 100644
Binary files a/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-1.png and b/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-1.png differ
diff --git a/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-2.png b/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-2.png
index 34a1de66b..f97d91134 100644
Binary files a/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-2.png and b/base_accounting_kit/static/description/images/base_accounting_kit_dashboard-2.png differ
diff --git a/base_accounting_kit/static/description/index.html b/base_accounting_kit/static/description/index.html
index 86b9e1829..edb4019b9 100644
--- a/base_accounting_kit/static/description/index.html
+++ b/base_accounting_kit/static/description/index.html
@@ -8,19 +8,25 @@
+
Latest Updates
+
+
+ Comma separator added in Dashboard
+
+
+ Updated currency symbol position in Dashboard
+
+
+ Accounting Dashboard.
+
+
+
Odoo 13 Accounting
Dashboard, Asset Management, Accounting Reports, PDC Management,
Account Lock dates, Customer Credit Limit and Follow Ups, Day book,
Bank book and Cash book reports in Odoo 13 community edition.
-
New Feature
-
-
- Accounting Dashboard.
-
-
-
Key Highlights
diff --git a/base_accounting_kit/static/src/js/account_dashboard.js b/base_accounting_kit/static/src/js/account_dashboard.js
index 4e36205b3..2d93625f0 100644
--- a/base_accounting_kit/static/src/js/account_dashboard.js
+++ b/base_accounting_kit/static/src/js/account_dashboard.js
@@ -79,11 +79,17 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
var selected = $('.btn.btn-tool.income');
var data = $(selected[0]).data();
var posted = false;
+ var self = this;
var f = f;
if ($('#toggle-two')[0].checked == true) {
posted = "posted"
}
-
+ rpc.query({
+ model: "account.move",
+ method: "get_currency",
+ }).then(function (result) {
+ currency = result;
+ })
rpc.query({
model: "account.move",
method: "get_top_10_customers_month",
@@ -99,7 +105,8 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
var due_count = 0;
_.forEach(result, function (x) {
due_count++;
- $('#top_10_customers_this_month').append('' + x.customers + '
' + '' + x.amount.toFixed(2) + ' ' + currency + '
' + ' ');
+ var amount = self.format_currency(currency, x.amount);
+ $('#top_10_customers_this_month').append('' + x.customers + '
' + '' + amount + '
' + ' ');
});
})
@@ -349,10 +356,18 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
var selected = $('.btn.btn-tool.selected');
var data = $(selected[0]).data();
var posted = false;
+ var self = this;
if ($('#toggle-two')[0].checked == true) {
posted = "posted"
}
+ rpc.query({
+ model: "account.move",
+ method: "get_currency",
+ }).then(function (result) {
+ currency = result;
+ })
+
rpc.query({
model: "account.move",
method: "get_total_invoice_current_year",
@@ -409,6 +424,11 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
$('#tot_invoice_current_year').attr("value", customer_invoice_paid_current_year);
$('#tot_invoice_current_year').attr("max", customer_invoice_total_current_year);
+ customer_invoice_paid_current_year = self.format_currency(currency, customer_invoice_paid_current_year);
+ customer_invoice_total_current_year = self.format_currency(currency, customer_invoice_total_current_year);
+ supplier_invoice_paid_current_year = self.format_currency(currency, supplier_invoice_paid_current_year);
+ supplier_invoice_total_current_year = self.format_currency(currency, supplier_invoice_total_current_year);
+
$('#total_customer_invoice_paid_current_year').append('' + '' + customer_invoice_paid_current_year + 'Total Paid
');
$('#total_customer_invoice_current_year').append('' + '' + customer_invoice_total_current_year + 'Total Invoice
');
@@ -422,40 +442,46 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
var selected = $('.btn.btn-tool.selected');
var data = $(selected[0]).data();
var posted = false;
+ var self = this;
if ($('#toggle-two')[0].checked == true) {
posted = "posted"
}
+ rpc.query({
+ model: "account.move",
+ method: "get_currency",
+ }).then(function (result) {
+ currency = result;
+ })
rpc.query({
model: "account.move",
method: "get_total_invoice_current_month",
args: [posted],
})
.then(function (result) {
-
-// $('#total_supplier_invoice_paid').hide();
-// $('#total_supplier_invoice').hide();
-// $('#total_customer_invoice_paid').hide();
-// $('#total_customer_invoice').hide();
-// $('#tot_invoice').hide();
-// $('#tot_supplier_inv').hide();
-// $('#total_supplier_invoice_paid_current_month').empty();
-// $('#total_supplier_invoice_current_month').empty();
-// $('#total_customer_invoice_paid_current_month').empty();
-// $('#total_customer_invoice_current_month').empty();
-// $('#tot_invoice_current_month').empty();
-// $('#tot_supplier_inv_current_month').empty();
-// $('#total_supplier_invoice_paid_current_year').hide();
-// $('#total_supplier_invoice_current_year').hide();
-// $('#total_customer_invoice_paid_current_year').hide();
-// $('#total_customer_invoice_current_year').hide();
-// $('#tot_invoice_current_year').hide();
-// $('#tot_supplier_inv_current_year').hide();
-// $('#total_supplier_invoice_paid_current_month').show();
-// $('#total_supplier_invoice_current_month').show();
-// $('#total_customer_invoice_paid_current_month').show();
-// $('#total_customer_invoice_current_month').show();
-// $('#tot_invoice_current_month').show();
-// $('#tot_supplier_inv_current_month').show();
+ $('#total_supplier_invoice_paid').hide();
+ $('#total_supplier_invoice').hide();
+ $('#total_customer_invoice_paid').hide();
+ $('#total_customer_invoice').hide();
+ $('#tot_invoice').hide();
+ $('#tot_supplier_inv').hide();
+ $('#total_supplier_invoice_paid_current_month').empty();
+ $('#total_supplier_invoice_current_month').empty();
+ $('#total_customer_invoice_paid_current_month').empty();
+ $('#total_customer_invoice_current_month').empty();
+ $('#tot_invoice_current_month').empty();
+ $('#tot_supplier_inv_current_month').empty();
+ $('#total_supplier_invoice_paid_current_year').hide();
+ $('#total_supplier_invoice_current_year').hide();
+ $('#total_customer_invoice_paid_current_year').hide();
+ $('#total_customer_invoice_current_year').hide();
+ $('#tot_invoice_current_year').hide();
+ $('#tot_supplier_inv_current_year').hide();
+ $('#total_supplier_invoice_paid_current_month').show();
+ $('#total_supplier_invoice_current_month').show();
+ $('#total_customer_invoice_paid_current_month').show();
+ $('#total_customer_invoice_current_month').show();
+ $('#tot_invoice_current_month').show();
+ $('#tot_supplier_inv_current_month').show();
var tot_invoice_current_month = result[0][0]
var tot_credit_current_month = result[1][0]
var tot_supplier_inv_current_month = result[2][0]
@@ -477,6 +503,12 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
$('#tot_invoice_current_month').attr("value", customer_invoice_paid_current_month);
$('#tot_invoice_current_month').attr("max", customer_invoice_total_current_month);
+ customer_invoice_paid_current_month = self.format_currency(currency, customer_invoice_paid_current_month);
+ customer_invoice_total_current_month = self.format_currency(currency, customer_invoice_total_current_month);
+ supplier_invoice_paid_current_month = self.format_currency(currency, supplier_invoice_paid_current_month);
+ supplier_invoice_total_current_month = self.format_currency(currency, supplier_invoice_total_current_month);
+
+
$('#total_customer_invoice_paid_current_month').append('' + '' + customer_invoice_paid_current_month + 'Total Paid
');
$('#total_customer_invoice_current_month').append('' + '' + customer_invoice_total_current_month + 'Total Invoice
');
@@ -578,7 +610,6 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
args: [posted,f],
})
.then(function (result) {
-
// Doughnut Chart
$(document).ready(function () {
var options = {
@@ -709,7 +740,9 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
})
},
+
renderElement: function (ev) {
+ var self = this;
$.when(this._super())
.then(function (ev) {
@@ -923,6 +956,11 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
$('#tot_invoice_current_month').attr("value", customer_invoice_paid_current_month);
$('#tot_invoice_current_month').attr("max", customer_invoice_total_current_month);
+ currency = result[8]
+ customer_invoice_paid_current_month = self.format_currency(currency, customer_invoice_paid_current_month);
+ customer_invoice_total_current_month = self.format_currency(currency, customer_invoice_total_current_month);
+ supplier_invoice_paid_current_month = self.format_currency(currency, supplier_invoice_paid_current_month);
+ supplier_invoice_total_current_month = self.format_currency(currency, supplier_invoice_total_current_month);
$('#total_customer_invoice_paid_current_month').append('' + '' + customer_invoice_paid_current_month + 'Total Paid
');
$('#total_customer_invoice_current_month').append('' + '' + customer_invoice_total_current_month + 'Total Invoice
');
@@ -1011,11 +1049,12 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
args: [posted,f]
}).then(function (result) {
var due_count = 0;
+ var amount;
_.forEach(result, function (x) {
-
$('#top_10_customers_this_month').show();
due_count++;
- $('#top_10_customers_this_month').append('' + x.customers + '
' + '' + x.amount.toFixed(2) + ' ' + currency + '
' + ' ');
+ amount = self.format_currency(currency, x.amount);
+ $('#top_10_customers_this_month').append('' + x.customers + '
' + '' + amount + '
' + ' ');
});
})
@@ -1026,10 +1065,12 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
})
.then(function (result) {
var banks = result['banks'];
+ var amount;
var balance = result['banking'];
for (var k = 0; k < banks.length; k++) {
+ amount = self.format_currency(currency, balance[k]);
// $('#charts').append('- ' + banks[k] + ''+ ' ' + ''+ balance[k] +'' + '
' );
- $('#current_bank_balance').append('' + banks[k] + '
' + balance[k].toFixed(2) + ' ' + currency + '
');
+ $('#current_bank_balance').append('' + banks[k] + '
' + amount + '
');
// $('#current_bank_balance').append('- ' + banks[k] +' '+ balance[k] + '
' );
$('#drop_charts_balance').append('- ' + balance[k].toFixed(2) + '
');
}
@@ -1129,8 +1170,8 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
.then(function (result) {
var income = result[0].debit - result[0].credit;
income = -income;
-
- $('#total_income').append('' + income.toFixed(2) + ' ' + currency + '')
+ income = self.format_currency(currency, income);
+ $('#total_income').append('' + income + '')
})
rpc.query({
model: "account.move",
@@ -1140,13 +1181,14 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
.then(function (result) {
var incomes_ = result[0].debit - result[0].credit;
if (incomes_) {
- incomes_ = -incomes_.toFixed(2);
-
- $('#total_incomes_').append('' + incomes_.toFixed(2) + ' ' + currency + 'This month
')
+ incomes_ = -incomes_;
+ incomes_ = self.format_currency(currency, incomes_);
+ $('#total_incomes_').append('' + incomes_ + 'This month
')
} else {
- incomes_ = -incomes_.toFixed(2);
- $('#total_incomes_').append('' + 0.0 + ' ' + currency + 'This month
')
+ incomes_ = -incomes_;
+ incomes_ = self.format_currency(currency, incomes_);
+ $('#total_incomes_').append('' + incomes_ + 'This month
')
}
})
@@ -1157,8 +1199,8 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
.then(function (result) {
var incomes_last = result[0].debit - result[0].credit;
incomes_last = -incomes_last;
-
- $('#total_incomes_last').append('' + incomes_last + ' ' + currency + 'Last month
')
+ incomes_last = self.format_currency(currency, incomes_last);
+ $('#total_incomes_last').append('' + incomes_last + 'Last month
')
})
rpc.query({
@@ -1167,8 +1209,9 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
})
.then(function (result) {
var expense = result[0].debit - result[0].credit;
- var expenses = expense.toFixed()
- $('#total_expense').append('' + expenses + ' ' + currency + '')
+ var expenses = expense;
+ expenses = self.format_currency(currency, expenses);
+ $('#total_expense').append('' + expenses + '')
})
rpc.query({
model: "account.move",
@@ -1178,11 +1221,13 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
var expense_this_month = result[0].debit - result[0].credit;
if (expense_this_month) {
- var expenses_this_month_ = expense_this_month.toFixed(2)
- $('#total_expenses_').append('' + expenses_this_month_ + ' ' + currency + 'This month
')
+ var expenses_this_month_ = expense_this_month;
+ expenses_this_month_ = self.format_currency(currency, expenses_this_month_);
+ $('#total_expenses_').append('' + expenses_this_month_ + 'This month
')
} else {
- var expenses_this_month_ = expense_this_month.toFixed(2)
- $('#total_expenses_').append('' + 0.0 + ' ' + currency + 'This month
')
+ var expenses_this_month_ = expense_this_month;
+ expenses_this_month_ = self.format_currency(currency, expenses_this_month_);
+ $('#total_expenses_').append('' + expenses_this_month_ + 'This month
')
}
})
@@ -1194,13 +1239,13 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
var expense_this_year = result[0].debit - result[0].credit;
if (expense_this_year) {
- var expenses_this_year_ = expense_this_year.toFixed(2)
-
- $('#total_expense_this_year').append('' + expenses_this_year_ + ' ' + currency + 'This Year
')
+ var expenses_this_year_ = expense_this_year;
+ expenses_this_year_ = self.format_currency(currency, expenses_this_year_);
+ $('#total_expense_this_year').append('' + expenses_this_year_ + 'This Year
')
} else {
- var expenses_this_year_ = expense_this_year.toFixed(2)
-
- $('#total_expense_this_year').append('' + 0.0 + ' ' + currency + 'This Year
')
+ var expenses_this_year_ = expense_this_year;
+ expenses_this_year_ = self.format_currency(currency, expenses_this_year_);
+ $('#total_expense_this_year').append('' + expenses_this_year_ + 'This Year
')
}
})
rpc.query({
@@ -1210,8 +1255,8 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
.then(function (result) {
var incomes_last_year = result[0].debit - result[0].credit;
incomes_last_year = -incomes_last_year
-
- $('#total_incomes_last_year').append('' + incomes_last_year + '' + currency + 'Last Year
')
+ incomes_last_year = self.format_currency(currency, incomes_last_year);
+ $('#total_incomes_last_year').append('' + incomes_last_year + 'Last Year
')
})
rpc.query({
model: "account.move",
@@ -1221,13 +1266,13 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
.then(function (result) {
var incomes_this_year = result[0].debit - result[0].credit;
if (incomes_this_year) {
-
- incomes_this_year = -incomes_this_year.toFixed(2);
-
- $('#total_incomes_this_year').append('' + incomes_this_year.toFixed(2) + ' ' + currency + 'This Year
')
+ incomes_this_year = -incomes_this_year;
+ incomes_this_year = self.format_currency(currency, incomes_this_year);
+ $('#total_incomes_this_year').append('' + incomes_this_year + 'This Year
')
} else {
- incomes_this_year = -incomes_this_year.toFixed(2);
- $('#total_incomes_this_year').append('' + 0.0 + '' + currency + 'This Year
')
+ incomes_this_year = -incomes_this_year;
+ incomes_this_year = self.format_currency(currency, incomes_this_year);
+ $('#total_incomes_this_year').append('' + incomes_this_year + 'This Year
')
}
})
@@ -1260,16 +1305,18 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
}
var profit_this_months = net_profit;
if (profit_this_months) {
- var net_profit_this_months = profit_this_months.toFixed(2)
+ var net_profit_this_months = profit_this_months;
+ net_profit_this_months = self.format_currency(currency, net_profit_this_months);
$('#net_profit_this_months').empty();
- $('#net_profit_this_months').append('Net Profit/Loss
' + net_profit_this_months + ' ' + currency + '')
- $('#net_profit_current_months').append('' + net_profit_this_months + ' ' + currency + ' This Month
')
+ $('#net_profit_this_months').append('Net Profit/Loss
' + net_profit_this_months + '')
+ $('#net_profit_current_months').append('' + net_profit_this_months + ' This Month
')
} else {
- var net_profit_this_months = profit_this_months.toFixed(2)
+ var net_profit_this_months = profit_this_months;
+ net_profit_this_months = self.format_currency(currency, net_profit_this_months);
$('#net_profit_this_months').empty();
- $('#net_profit_this_months').append('Net Profit/Loss
' + 0.0 + ' ' + currency + '')
- $('#net_profit_current_months').append('' + 0.0 + ' ' + currency + ' This Month
')
+ $('#net_profit_this_months').append('Net Profit/Loss
' + net_profit_this_months + '')
+ $('#net_profit_current_months').append('' + net_profit_this_months + ' This Month
')
}
})
@@ -1302,24 +1349,37 @@ odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
} else {
net_profit = -result[1] - result[0]
}
-
-
var profit_this_year = net_profit;
if (profit_this_year) {
- var net_profit_this_year = profit_this_year.toFixed(2)
+ var net_profit_this_year = profit_this_year;
+ net_profit_this_year = self.format_currency(currency, net_profit_this_year);
$('#net_profit_this_year').empty();
- $('#net_profit_this_year').append('Net Profit/Loss
' + net_profit_this_year + ' ' + currency + '')
- $('#net_profit_current_year').append('' + net_profit_this_year + ' ' + currency + ' This Year
')
+ $('#net_profit_this_year').append('Net Profit/Loss
' + net_profit_this_year + '')
+ $('#net_profit_current_year').append('' + net_profit_this_year + ' This Year
')
} else {
- var net_profit_this_year = profit_this_year.toFixed(2)
+ var net_profit_this_year = profit_this_year;
+ net_profit_this_year = self.format_currency(currency, net_profit_this_year);
$('#net_profit_this_year').empty();
- $('#net_profit_this_year').append('Net Profit/Loss
' + 0.0 + ' ' + currency + '')
- $('#net_profit_current_year').append('' + 0.0 + ' ' + currency + ' This Year
')
+ $('#net_profit_this_year').append('Net Profit/Loss
' + net_profit_this_year + '')
+ $('#net_profit_current_year').append('' + net_profit_this_year + ' This Year
')
}
})
});
},
+
+ format_currency: function(currency, amount){
+ if (typeof(amount) != 'number'){
+ amount = parseFloat(amount);
+ }
+ var formatted_value = (parseInt(amount)).toLocaleString(currency.language, {minimumFractionDigits: 2})
+ if (currency.position === "after") {
+ return formatted_value += ' ' + currency.symbol;
+ } else {
+ return currency.symbol + ' ' + formatted_value;
+ }
+ },
+
willStart: function () {
var self = this;
self.drpdn_show = false;
diff --git a/base_accounting_kit/views/account_payment_view.xml b/base_accounting_kit/views/account_payment_view.xml
index 636eaa90f..eb8982133 100755
--- a/base_accounting_kit/views/account_payment_view.xml
+++ b/base_accounting_kit/views/account_payment_view.xml
@@ -33,4 +33,18 @@
+
+
+
+ view.account.reg.payment.form.check.pdc
+ account.payment.register
+
+
+
+
+
+
+
+
+
\ No newline at end of file