@ -0,0 +1,46 @@ |
|||
.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg |
|||
:target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html |
|||
:alt: License: LGPL-3 |
|||
|
|||
Accounting Dashboard |
|||
==================== |
|||
* This module allow to view the Dashboard of Accounting with complete details. |
|||
|
|||
Configuration |
|||
============= |
|||
* No additional configurations needed. |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
------- |
|||
General Public License, Version 3 (LGPL-3). |
|||
(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) |
|||
|
|||
Credits |
|||
------- |
|||
* Developer: (V18) Manasa T P, Contact: odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from . import models |
@ -0,0 +1,51 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
{ |
|||
'name': 'Accounting Dashboard Odoo18', |
|||
'version': '18.0.1.0.0', |
|||
'category': 'Accounting ', |
|||
'summary': """The Odoo Accounting Dashboard shows key financial metrics, |
|||
tracks payments, and visualizes income and expenses in one place.""", |
|||
'description': """Accounting, Odoo Accounting Dashboard, |
|||
Accounting Dashboard V18, Account Dashboard, Dashboard, Invoice Dashboard, |
|||
Invoice Graph View, Odoo18""", |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://cybrosys.com', |
|||
'depends': ['account', 'base_accounting_kit'], |
|||
'data': [ |
|||
'views/account_move_data.xml', |
|||
], |
|||
'assets': { |
|||
'web.assets_backend': [ |
|||
'odoo_accounting_dashboard/static/src/js/lib/chart/chart.min.js', |
|||
'odoo_accounting_dashboard/static/src/xml/accounting_dashboard.xml', |
|||
'odoo_accounting_dashboard/static/src/js/accounting_dashboard.js', |
|||
] |
|||
}, |
|||
'images': ['static/description/banner.png'], |
|||
'license': 'LGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,7 @@ |
|||
## Module <odoo_accounting_dashboard> |
|||
|
|||
#### 26.11.2024 |
|||
#### Version 18.0.1.0.0 |
|||
##### ADD |
|||
|
|||
- Initial Commit for Accounting Dashboard |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
from . import account_move |
@ -0,0 +1,415 @@ |
|||
# -*- coding: utf-8 -*- |
|||
############################################################################# |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>) |
|||
# Author: Cybrosys Techno Solutions(<https://www.cybrosys.com>) |
|||
# |
|||
# You can modify it under the terms of the GNU LESSER |
|||
# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. |
|||
# |
|||
# This program is distributed in the hope that it will be useful, |
|||
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. |
|||
# |
|||
# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE |
|||
# (LGPL v3) along with this program. |
|||
# If not, see <http://www.gnu.org/licenses/>. |
|||
# |
|||
############################################################################# |
|||
import calendar |
|||
from odoo import api, models, fields |
|||
|
|||
|
|||
class AccountMove(models.Model): |
|||
_inherit = 'account.move' |
|||
|
|||
@api.model |
|||
def get_datas(self): |
|||
""" Getting datas for tiles in the dashboard like count of open invoice , paid invoice etc""" |
|||
invoices = self.search([]) |
|||
invoice_in_draft = invoices.filtered(lambda x: x.state == 'draft') |
|||
invoice_in_paid = invoices.filtered(lambda x: x.payment_state == 'paid') |
|||
self._cr.execute(""" select sum(debit) as debit, sum(credit) as credit from account_account, account_move_line where |
|||
account_move_line.account_id = account_account.id AND account_account.account_type = 'income' """) |
|||
debit_credit = self._cr.dictfetchall() |
|||
income = [i['debit'] - i['credit'] if ( |
|||
i['debit'] is not None and i['credit'] is not None) else 0 |
|||
for i in debit_credit] |
|||
income = income[0] * -1 |
|||
qry_reconcile = """ select count(*) FROM account_move_line l,account_account a |
|||
where L.account_id=a.id AND l.full_reconcile_id IS NULL |
|||
AND l.balance != 0 AND a.reconcile IS TRUE""" |
|||
self._cr.execute(qry_reconcile) |
|||
reconcile_count = [i['count'] for i in self._cr.dictfetchall()] |
|||
journal_list = self.env['account.journal'].search([]) |
|||
journal_data = [] |
|||
for i in journal_list: |
|||
journal_data.append({'id': i.id, |
|||
'name': i.name, |
|||
'type': i.type}) |
|||
|
|||
return { |
|||
'open_invoice': len(invoice_in_draft), |
|||
'paid_invoice': len(invoice_in_paid), |
|||
'income': income, |
|||
'currency_symbol': self.env.company.currency_id.symbol, |
|||
'unreconcile_items': reconcile_count, |
|||
'journal_data': journal_data, |
|||
} |
|||
|
|||
@api.model |
|||
def get_income_chart(self, income): |
|||
""" Getting datas for income expense and profit chart based on current month and year """ |
|||
if income == 'income_this_month': |
|||
query_income = """ select sum(debit)-sum(credit) as income ,cast(to_char(account_move_line.date, 'DD')as int) |
|||
as date , account_type from account_move_line , account_account |
|||
where account_move_line.account_id=account_account.id AND account_type='income' AND Extract(month FROM account_move_line.date) = Extract(month FROM DATE(NOW())) |
|||
AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW())) group by account_type,date """ |
|||
self._cr.execute(query_income) |
|||
record = self._cr.dictfetchall() |
|||
query_expense = """ select sum(debit)-sum(credit) as expense ,cast(to_char(account_move_line.date, 'DD')as int) |
|||
as date , account_type from account_move_line , account_account where |
|||
account_move_line.account_id=account_account.id AND account_type='expense' AND Extract(month FROM account_move_line.date) = Extract(month FROM DATE(NOW())) |
|||
AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW())) group by account_type,date """ |
|||
self._cr.execute(query_expense) |
|||
result = self._cr.dictfetchall() |
|||
|
|||
now = fields.Date.today() |
|||
last_day = calendar.monthrange(now.year, now.month)[1] |
|||
day_list = list(range(1, last_day + 1)) |
|||
records = [] |
|||
for date in day_list: |
|||
last_month_inc = list( |
|||
filter(lambda m: m['date'] == date, record)) |
|||
last_month_exp = list( |
|||
filter(lambda m: m['date'] == date, result)) |
|||
if not last_month_inc and not last_month_exp: |
|||
records.append({ |
|||
'date': date, |
|||
'income': 0.0, |
|||
'expense': 0.0, |
|||
'profit': 0.0 |
|||
}) |
|||
elif (not last_month_inc) and last_month_exp: |
|||
last_month_exp[0].update({ |
|||
'income': 0.0, |
|||
'expense': -1 * last_month_exp[0]['expense'] if |
|||
last_month_exp[0]['expense'] < 1 else |
|||
last_month_exp[0]['expense'] |
|||
}) |
|||
last_month_exp[0].update({ |
|||
'profit': last_month_exp[0]['income'] - |
|||
last_month_exp[0]['expense'] |
|||
}) |
|||
records.append(last_month_exp[0]) |
|||
elif (not last_month_exp) and last_month_inc: |
|||
last_month_inc[0].update({ |
|||
'expense': 0.0, |
|||
'income': -1 * last_month_inc[0]['income'] if |
|||
last_month_inc[0]['income'] < 1 else |
|||
last_month_inc[0]['income'] |
|||
}) |
|||
last_month_inc[0].update({ |
|||
'profit': last_month_inc[0]['income'] - |
|||
last_month_inc[0]['expense'] |
|||
}) |
|||
records.append(last_month_inc[0]) |
|||
else: |
|||
last_month_inc[0].update({ |
|||
'income': -1 * last_month_inc[0]['income'] if |
|||
last_month_inc[0]['income'] < 1 else |
|||
last_month_inc[0]['income'], |
|||
'expense': -1 * last_month_exp[0]['expense'] if |
|||
last_month_exp[0]['expense'] < 1 else |
|||
last_month_exp[0]['expense'] |
|||
}) |
|||
last_month_inc[0].update({ |
|||
'profit': last_month_inc[0]['income'] - |
|||
last_month_inc[0]['expense'] |
|||
}) |
|||
records.append(last_month_inc[0]) |
|||
income = [] |
|||
expense = [] |
|||
date = [] |
|||
profit = [] |
|||
for rec in records: |
|||
income.append(rec['income']) |
|||
expense.append(rec['expense']) |
|||
date.append(rec['date']) |
|||
profit.append(rec['profit']) |
|||
return { |
|||
'income': income, |
|||
'expense': expense, |
|||
'date': date, |
|||
'profit': profit |
|||
} |
|||
elif income == 'income_this_year': |
|||
query_income = """ select sum(debit)-sum(credit) as income ,to_char(account_move_line.date, 'Month') as month , |
|||
account_type from account_move_line ,account_account |
|||
where account_move_line.account_id=account_account.id AND account_type = 'income' |
|||
AND to_char(DATE(NOW()), 'YY') = to_char(account_move_line.date, 'YY') |
|||
group by account_type,month """ |
|||
self._cr.execute(query_income) |
|||
record = self._cr.dictfetchall() |
|||
query_expense = """ select sum(debit)-sum(credit) as expense ,to_char(account_move_line.date, 'Month') as month , |
|||
account_type from account_move_line , account_account where |
|||
account_move_line.account_id=account_account.id AND account_type = 'expense' |
|||
AND to_char(DATE(NOW()), 'YY') = to_char(account_move_line.date, 'YY') |
|||
group by account_type,month """ |
|||
self._cr.execute(query_expense) |
|||
result = self._cr.dictfetchall() |
|||
|
|||
month_list = calendar.month_name[1:] |
|||
records = [] |
|||
for month in month_list: |
|||
last_month_inc = list( |
|||
filter(lambda m: m['month'].strip() == month, record)) |
|||
last_month_exp = list( |
|||
filter(lambda m: m['month'].strip() == month, result)) |
|||
if not last_month_inc and not last_month_exp: |
|||
records.append({ |
|||
'month': month, |
|||
'income': 0.0, |
|||
'expense': 0.0, |
|||
'profit': 0.0, |
|||
}) |
|||
elif (not last_month_inc) and last_month_exp: |
|||
last_month_exp[0].update({ |
|||
'income': 0.0, |
|||
'expense': -1 * last_month_exp[0]['expense'] if |
|||
last_month_exp[0]['expense'] < 1 else |
|||
last_month_exp[0]['expense'] |
|||
}) |
|||
last_month_exp[0].update({ |
|||
'profit': last_month_exp[0]['income'] - |
|||
last_month_exp[0]['expense'] |
|||
}) |
|||
records.append(last_month_exp[0]) |
|||
elif (not last_month_exp) and last_month_inc: |
|||
last_month_inc[0].update({ |
|||
'expense': 0.0, |
|||
'income': -1 * last_month_inc[0]['income'] if |
|||
last_month_inc[0]['income'] < 1 else |
|||
last_month_inc[0]['income'] |
|||
}) |
|||
last_month_inc[0].update({ |
|||
'profit': last_month_inc[0]['income'] - |
|||
last_month_inc[0]['expense'] |
|||
}) |
|||
records.append(last_month_inc[0]) |
|||
else: |
|||
last_month_inc[0].update({ |
|||
'income': -1 * last_month_inc[0]['income'] if |
|||
last_month_inc[0]['income'] < 1 else |
|||
last_month_inc[0]['income'], |
|||
'expense': -1 * last_month_exp[0]['expense'] if |
|||
last_month_exp[0]['expense'] < 1 else |
|||
last_month_exp[0]['expense'] |
|||
}) |
|||
last_month_inc[0].update({ |
|||
'profit': last_month_inc[0]['income'] - |
|||
last_month_inc[0]['expense'] |
|||
}) |
|||
records.append(last_month_inc[0]) |
|||
income = [] |
|||
expense = [] |
|||
month = [] |
|||
profit = [] |
|||
for rec in records: |
|||
income.append(rec['income']) |
|||
expense.append(rec['expense']) |
|||
month.append(rec['month']) |
|||
profit.append(rec['profit']) |
|||
return { |
|||
'income': income, |
|||
'expense': expense, |
|||
'date': month, |
|||
'profit': profit, |
|||
} |
|||
|
|||
@api.model |
|||
def get_payment_data(self, payment_list_filter, payment_data_filter): |
|||
""" Getting datas for customer payment list and vendor payment list based on current year and month""" |
|||
last_day = (calendar.monthrange(fields.Date.today().year, fields.Date.today().month))[1] |
|||
if payment_list_filter == 'customer_payment': |
|||
if payment_data_filter == 'this_month': |
|||
start_date = f"{fields.Date.today().year}-{fields.Date.today().month}-01" |
|||
end_date = f"{fields.Date.today().year}-{fields.Date.today().month}-{last_day}" |
|||
invoices = self.search( |
|||
[('move_type', '=', 'out_invoice'), |
|||
('payment_state', '=', 'paid'), |
|||
('invoice_date', '>=', start_date), |
|||
('invoice_date', '<=', end_date)]) |
|||
else: |
|||
start_date = f"{fields.Date.today().year}-01-01" |
|||
end_date = f"{fields.Date.today().year}-12-31" |
|||
invoices = self.search( |
|||
[('move_type', '=', 'out_invoice'), |
|||
('payment_state', '=', 'paid'), |
|||
('invoice_date', '>=', start_date), |
|||
('invoice_date', '<=', end_date)]) |
|||
result = [] |
|||
for i in invoices: |
|||
result.append({'id': i.id, |
|||
'partner': i.partner_id.name, |
|||
'amount': i.amount_total, |
|||
'date': str(i.invoice_date)}) |
|||
return result |
|||
else: |
|||
if payment_data_filter == 'this_month': |
|||
start_date = f"{fields.Date.today().year}-{fields.Date.today().month}-01" |
|||
end_date = f"{fields.Date.today().year}-{fields.Date.today().month}-{last_day}" |
|||
vendor_bills = self.search( |
|||
[('move_type', '=', 'in_invoice'), |
|||
('payment_state', '=', 'paid'), |
|||
('invoice_date', '>=', start_date), |
|||
('invoice_date', '<=', end_date)]) |
|||
else: |
|||
start_date = f"{fields.Date.today().year}-01-01" |
|||
end_date = f"{fields.Date.today().year}-12-31" |
|||
vendor_bills = self.search( |
|||
[('move_type', '=', 'in_invoice'), |
|||
('payment_state', '=', 'paid'), |
|||
('invoice_date', '>=', start_date), |
|||
('invoice_date', '<=', end_date)]) |
|||
result = [] |
|||
for i in vendor_bills: |
|||
result.append({'id': i.id, |
|||
'partner': i.partner_id.name, |
|||
'amount': i.amount_total, |
|||
'date': str(i.invoice_date)}) |
|||
return result |
|||
|
|||
@api.model |
|||
def get_top_datas(self, top_filter): |
|||
""" Getting datas for top customer and top vendors based on current month and current year""" |
|||
last_day = (calendar.monthrange(fields.Date.today().year, |
|||
fields.Date.today().month))[1] |
|||
if top_filter == 'this_month': |
|||
start_date = f"{fields.Date.today().year}-{fields.Date.today().month}-01" |
|||
end_date = f"{fields.Date.today().year}-{fields.Date.today().month}-{last_day}" |
|||
vendor_bills = self.search( |
|||
[('move_type', '=', 'in_invoice'), |
|||
('invoice_date', '>=', start_date), |
|||
('invoice_date', '<=', end_date)]) |
|||
customer_invoices = self.search( |
|||
[('move_type', '=', 'out_invoice'), |
|||
('invoice_date', '>=', start_date), |
|||
('invoice_date', '<=', end_date)]) |
|||
else: |
|||
start_date = f"{fields.Date.today().year}-01-01" |
|||
end_date = f"{fields.Date.today().year}-12-31" |
|||
vendor_bills = self.search( |
|||
[('move_type', '=', 'in_invoice'), |
|||
('invoice_date', '>=', start_date), |
|||
('invoice_date', '<=', end_date)]) |
|||
customer_invoices = self.search( |
|||
[('move_type', '=', 'out_invoice'), |
|||
('invoice_date', '>=', start_date), |
|||
('invoice_date', '<=', end_date)]) |
|||
vendor_partners = vendor_bills.mapped('partner_id') |
|||
top_vendors = [] |
|||
for vendor in vendor_partners: |
|||
vendor_bills.filtered(lambda data: data.partner_id == vendor) |
|||
top_vendors.append({ |
|||
'id': vendor.id, |
|||
'name': vendor.name}) |
|||
customer_partners = customer_invoices.mapped('partner_id') |
|||
top_customers = [] |
|||
for customer in customer_partners: |
|||
customer_invoices.filtered(lambda x: x.partner_id == customer) |
|||
top_customers.append({ |
|||
'id': customer.id, |
|||
'name': customer.name}) |
|||
return { |
|||
'top_vendors': top_vendors, |
|||
'top_customers': top_customers, |
|||
} |
|||
|
|||
@api.model |
|||
def get_aged_payable(self, aged_filter, aged_payable_filter): |
|||
""" Getting Datas for aged payable and aged receivable chart based on current month and year""" |
|||
if aged_filter == 'aged_receive': |
|||
if aged_payable_filter == 'this_month': |
|||
self._cr.execute(""" select to_char(account_move.date, 'Month') as month, res_partner.name as due_partner, account_move.partner_id as parent, |
|||
sum(account_move.amount_total) as amount from account_move, res_partner where account_move.partner_id = res_partner.id |
|||
AND account_move.move_type = 'out_invoice' |
|||
AND payment_state = 'not_paid' |
|||
AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW())) |
|||
AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) |
|||
AND account_move.partner_id = res_partner.commercial_partner_id |
|||
group by parent, due_partner, month |
|||
order by amount desc""") |
|||
else: |
|||
self._cr.execute("""select res_partner.name as due_partner, account_move.partner_id as parent, |
|||
sum(account_move.amount_total) as amount from account_move, res_partner where account_move.partner_id = res_partner.id |
|||
AND account_move.move_type = 'out_invoice' |
|||
AND payment_state = 'not_paid' |
|||
AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) |
|||
AND account_move.partner_id = res_partner.commercial_partner_id |
|||
group by parent, due_partner |
|||
order by amount desc""") |
|||
record = self._cr.dictfetchall() |
|||
partner = [item['due_partner'] for item in record] |
|||
amount = [item['amount'] for item in record] |
|||
return {'partner': partner, |
|||
'amount': amount, } |
|||
else: |
|||
if aged_payable_filter == 'this_month': |
|||
self._cr.execute("""select to_char(account_move.date, 'Month') as month, res_partner.name as bill_partner, account_move.partner_id as parent, |
|||
sum(account_move.amount_total) as amount from account_move, res_partner where account_move.partner_id = res_partner.id |
|||
AND account_move.move_type = 'in_invoice' |
|||
AND payment_state = 'not_paid' |
|||
AND Extract(month FROM account_move.invoice_date_due) = Extract(month FROM DATE(NOW())) |
|||
AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) |
|||
AND account_move.partner_id = res_partner.commercial_partner_id |
|||
group by parent, bill_partner, month |
|||
order by amount desc""") |
|||
else: |
|||
self._cr.execute("""select to_char(account_move.date, 'Month') as month, res_partner.name as bill_partner, account_move.partner_id as parent, |
|||
sum(account_move.amount_total) as amount from account_move, res_partner where account_move.partner_id = res_partner.id |
|||
AND account_move.move_type = 'in_invoice' |
|||
AND payment_state = 'not_paid' |
|||
AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) |
|||
AND account_move.partner_id = res_partner.commercial_partner_id |
|||
group by parent, bill_partner, month |
|||
order by amount desc""") |
|||
record = self._cr.dictfetchall() |
|||
partner = [item['bill_partner'] for item in record] |
|||
amount = [item['amount'] for item in record] |
|||
return {'partner': partner, |
|||
'amount': amount, } |
|||
|
|||
@api.model |
|||
def get_sale_revenue(self, top_sale_cust_filter): |
|||
""" Getting datas for top 10 sale revenue customer based on current month and year """ |
|||
query = """ SELECT partner_id as customer_id, MAX(res_partner.name) as customer , SUM(amount_total_signed) as total_amount |
|||
FROM account_move JOIN res_partner ON account_move.partner_id = res_partner.id |
|||
WHERE move_type = 'out_invoice' """ |
|||
if top_sale_cust_filter == 'this_month': |
|||
query += """AND Extract(month FROM account_move.invoice_date) = Extract(month FROM DATE(NOW())) |
|||
AND Extract(YEAR FROM account_move.invoice_date) = Extract(YEAR FROM DATE(NOW())) |
|||
GROUP BY partner_id |
|||
ORDER BY total_amount DESC LIMIT 10 """ |
|||
self._cr.execute(query) |
|||
else: |
|||
query += """AND Extract(YEAR FROM account_move.invoice_date) = Extract(YEAR FROM DATE(NOW())) |
|||
GROUP BY partner_id |
|||
ORDER BY total_amount DESC LIMIT 10""" |
|||
self._cr.execute(query) |
|||
records = self._cr.dictfetchall() |
|||
return records |
|||
|
|||
@api.model |
|||
def get_bank_balance(self): |
|||
""" Getting data for bank and cash balance """ |
|||
self._cr.execute("""select account_account.name as name, sum(balance) as balance, |
|||
min(account_account.id) as id from account_move_line left join |
|||
account_account on account_account.id = account_move_line.account_id where |
|||
account_account.account_type = 'asset_cash' |
|||
group by account_account.name""") |
|||
records = self._cr.dictfetchall() |
|||
return records |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 350 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 767 KiB |
After Width: | Height: | Size: 138 KiB |
After Width: | Height: | Size: 760 KiB |
After Width: | Height: | Size: 92 KiB |
After Width: | Height: | Size: 697 KiB |
After Width: | Height: | Size: 1.1 MiB |
After Width: | Height: | Size: 110 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 58 KiB |
After Width: | Height: | Size: 25 KiB |
After Width: | Height: | Size: 24 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 87 KiB |
After Width: | Height: | Size: 9.5 KiB |
@ -0,0 +1,186 @@ |
|||
/** @odoo-module */ |
|||
import { registry } from "@web/core/registry" |
|||
import { useService } from "@web/core/utils/hooks" |
|||
const { Component, useRef, onMounted, useState , onWillStart } = owl |
|||
|
|||
export class AccountDashboard extends Component { |
|||
setup(){ |
|||
this.state = useState({ |
|||
data:{}, |
|||
top:{}, |
|||
income_chart:{}, |
|||
chart:[], |
|||
payment_data: [], |
|||
top_sale_cust: [], |
|||
IncomeExpense:'income', |
|||
top_filter: 'this_month', |
|||
income:'income_this_month', |
|||
aged_filter: 'aged_receive', |
|||
top_sale_cust_filter: 'this_month', |
|||
aged_payable_filter: 'this_month', |
|||
payment_data_filter: 'this_month', |
|||
payment_list_filter: 'customer_payment', |
|||
}) |
|||
this.All = useRef("All"); |
|||
this.AgedRecords = useRef("AgedRecords"); |
|||
this.Balance = useRef("Balance"); |
|||
this.orm = useService("orm"); |
|||
onWillStart(async () => { |
|||
await this.FetchData(); |
|||
}) |
|||
onMounted(() => { |
|||
this.RenderChart() |
|||
}) |
|||
} |
|||
async onPeriodChange(){ |
|||
if (this.state.chart.length !=0) { |
|||
this.state.chart.forEach((chart)=> { |
|||
chart.destroy() |
|||
}) |
|||
await this.fetchAndRender() |
|||
} |
|||
} |
|||
async fetchAndRender() { |
|||
await this.FetchData() |
|||
this.RenderChart() |
|||
} |
|||
|
|||
async FetchData(){ |
|||
this.state.data = await this.orm.call('account.move','get_datas',[]); |
|||
this.state.income_chart = await this.orm.call("account.move","get_income_chart", [this.state.income]); |
|||
this.state.payment_data = await this.orm.call("account.move","get_payment_data", [this.state.payment_list_filter, this.state.payment_data_filter]); |
|||
this.state.top = await this.orm.call("account.move","get_top_datas", [this.state.top_filter]); |
|||
this.state.aged_payable = await this.orm.call("account.move","get_aged_payable", [this.state.aged_filter,this.state.aged_payable_filter]); |
|||
this.state.top_sale_cust = await this.orm.call("account.move","get_sale_revenue", [this.state.top_sale_cust_filter]); |
|||
this.state.balance = await this.orm.call("account.move","get_bank_balance", []); |
|||
} |
|||
|
|||
RenderChart() { |
|||
this.aged_chart(this.AgedRecords.el, 'bar', this.state.aged_payable.partner, 'Amount', this.state.aged_payable.amount) |
|||
if (this.state.IncomeExpense == 'income') { |
|||
this.income_charts(this.All.el, 'bar', this.state.income_chart.date, this.state.income_chart.income) |
|||
} else if (this.state.IncomeExpense == 'expense') { |
|||
this.expense_charts(this.All.el, 'bar', this.state.income_chart.date, this.state.income_chart.expense) |
|||
} else if (this.state.IncomeExpense == 'profit') { |
|||
this.profit_charts(this.All.el, 'line', this.state.income_chart.date, this.state.income_chart.profit) |
|||
} else { |
|||
this.AllInOneChart(this.All.el, 'bar', this.state.income_chart.date, this.state.income_chart.income, this.state.income_chart.expense, this.state.income_chart.profit) |
|||
} |
|||
} |
|||
|
|||
aged_chart(canvas,type,labels,label,data){ |
|||
this.state.chart.push(new Chart( |
|||
canvas, |
|||
{ |
|||
type:type, |
|||
data: { |
|||
labels: labels, |
|||
datasets: [ |
|||
{ |
|||
label: label, |
|||
data: data, |
|||
borderRadius: 10, |
|||
backgroundColor: 'rgba(39, 232, 232, 0.5)', |
|||
borderColor: 'rgba(39, 232, 232, 1)', |
|||
} |
|||
] |
|||
}, |
|||
} |
|||
)) |
|||
} |
|||
income_charts(canvas,type,labels,data){ |
|||
this.state.chart.push(new Chart( |
|||
canvas, |
|||
{ |
|||
type: type, |
|||
data: { |
|||
labels: labels, |
|||
datasets: [ |
|||
{ |
|||
label: 'Income', |
|||
data: data, |
|||
borderWidth: 2, |
|||
borderRadius: 10, |
|||
borderSkipped: false, |
|||
backgroundColor: 'rgba(39, 232, 232, 0.5)', |
|||
borderColor: 'rgba(39, 232, 232, 1)', |
|||
}, |
|||
] |
|||
}, |
|||
} |
|||
)); |
|||
}; |
|||
expense_charts(canvas,type,labels,expense){ |
|||
this.state.chart.push(new Chart( |
|||
canvas, |
|||
{ |
|||
type: type, |
|||
data: { |
|||
labels: labels, |
|||
datasets: [ |
|||
{ |
|||
label: 'Expense', |
|||
data: expense, |
|||
type: type === 'bar' ? 'polarArea' : 'bar', |
|||
}, |
|||
] |
|||
}, |
|||
} |
|||
)); |
|||
}; |
|||
profit_charts(canvas,type,labels,profit){ |
|||
this.state.chart.push(new Chart( |
|||
canvas, |
|||
{ |
|||
type: type, |
|||
data: { |
|||
labels: labels, |
|||
datasets: [ |
|||
{ |
|||
label: 'Profit/Loss', |
|||
data: profit, |
|||
fill: true, |
|||
borderColor: 'rgba(245, 65, 10, 1)', |
|||
}, |
|||
] |
|||
}, |
|||
} |
|||
)); |
|||
}; |
|||
AllInOneChart(canvas,type,labels,data,expense,profit){ |
|||
this.state.chart.push(new Chart( |
|||
canvas, |
|||
{ |
|||
type: type, |
|||
data: { |
|||
labels: labels, |
|||
datasets: [ |
|||
{ |
|||
label: 'Income', |
|||
data: data, |
|||
type: type === 'line' ? 'line' : 'bar', |
|||
backgroundColor: 'rgba(39, 232, 232, 0.5)', |
|||
borderColor: 'rgba(39, 232, 232, 1)', |
|||
}, |
|||
{ |
|||
label: 'Expense', |
|||
data: expense, |
|||
type: type === 'bar' ? 'radar' : 'bar', |
|||
backgroundColor: 'rgba(0, 0, 0, 0.5)', |
|||
borderColor: 'rgba(0, 0, 0, 1)', |
|||
}, |
|||
{ |
|||
label: 'Profit/Loss', |
|||
data: profit, |
|||
type: 'line', |
|||
fill: false, |
|||
borderColor: 'rgba(245, 65, 10, 1)', |
|||
}, |
|||
] |
|||
}, |
|||
} |
|||
)); |
|||
}; |
|||
} |
|||
AccountDashboard.template = "AccountDashboard" |
|||
registry.category("actions").add('accounting_dashboard_tags', AccountDashboard) |
@ -0,0 +1,414 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<templates xml:space="preserve"> |
|||
<t t-name="AccountDashboard" owl="1"> |
|||
<div class="accounts-dashboard-wrap" style="margin-top:20px;"> |
|||
<div style="overflow-y: scroll;height: 100vh;"> |
|||
<!-- Tiles --> |
|||
<div class="wrapper" |
|||
style="display:flex;justify-content: space-around;"> |
|||
<div> |
|||
<div class="shadow-sm border m-2 text-center" |
|||
style="background-image: radial-gradient( circle 311px at 8.6% 27.9%, rgba(62,147,252,0.57) 12.9%, rgba(239,183,192,0.44) 91.2% ); |
|||
border-radius: 10px;width:350px;"> |
|||
<div class="h1 fw-bold text-dark" |
|||
style="font-size: 48px"> |
|||
<t t-esc="state.data.open_invoice"/></div> |
|||
<div class="h3">Open Invoice</div> |
|||
</div> |
|||
</div> |
|||
<div> |
|||
<div class="shadow-sm border m-2 text-center" |
|||
style="background-image: linear-gradient( 184.1deg, rgba(249,255,182,1) 44.7%, rgba(226,255,172,1) 67.2% ); |
|||
border-radius: 10px;width:350px;"> |
|||
<div class="h1 fw-bold text-dark" |
|||
style="font-size: 48px"> |
|||
<t t-esc="state.data.paid_invoice"/></div> |
|||
<div class="h3">Paid Invoice</div> |
|||
</div> |
|||
</div> |
|||
<div> |
|||
<div class="shadow-sm border m-2 text-center" |
|||
style="background-image: radial-gradient( circle farthest-corner at 10% 20%, rgba(176,229,208,1) 42%, rgba(92,202,238,0.41) 93.6% ); |
|||
border-radius: 10px;width:350px;"> |
|||
<div class="h1 fw-bold text-dark" |
|||
style="font-size: 48px"> |
|||
<t t-esc="state.data.currency_symbol"/> |
|||
<t t-esc="state.data.income"/></div> |
|||
<div class="h3">Total Income</div> |
|||
</div> |
|||
</div> |
|||
<div> |
|||
<div class="shadow-sm border m-2 text-center" |
|||
style="background-image: linear-gradient( 111.4deg, rgba(238,113,113,1) 1%, rgba(246,215,148,1) 58% ); border-radius: 10px;width:350px;"> |
|||
<div class="h1 fw-bold text-dark" |
|||
style="font-size: 48px"> |
|||
<t t-esc="state.data.unreconcile_items"/></div> |
|||
<div class="h3">UnReconciled Items</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<div class="col-xs-12 col-sm-12 col-lg-12 col-md-12"> |
|||
<!-- Income/Expense/Profit --> |
|||
<div class="row" style="margin:0px"> |
|||
<div class="col-md-4" id="col-graph"> |
|||
<div class="card" style="margin-top:20px;"> |
|||
<!--card-header--> |
|||
<div class="card-header" |
|||
style=" padding: 17px 1.5rem !important; |
|||
background:linear-gradient(90deg, #3F2B96 0%, #A8C0FF 100%); |
|||
display: flex !IMPORTANT; justify-content: space-between; |
|||
align-items: center;border-radius: 10px 10px 0px 0px; "> |
|||
<div class="card-title"> |
|||
<b> |
|||
<h3 class="custom-h3" |
|||
style="color:aqua;" |
|||
t-if="state.IncomeExpense == 'income' ">INCOME CHART</h3> |
|||
<h3 class="custom-h3" |
|||
style="color:aqua;" |
|||
t-if="state.IncomeExpense == 'expense' ">EXPENSE CHART</h3> |
|||
<h3 class="custom-h3" |
|||
style="color:aqua;" |
|||
t-if="state.IncomeExpense == 'profit' ">PROFIT CHART</h3> |
|||
<h3 class="custom-h3" |
|||
style="color:aqua;" |
|||
t-if="state.IncomeExpense == 'all' ">ALL IN ONE</h3> |
|||
</b> |
|||
</div> |
|||
<div class="card-tools" |
|||
style="margin-left:auto;"> |
|||
<select class="form-select" |
|||
style="color: #000000;" |
|||
t-model="state.IncomeExpense" |
|||
t-on-change="onPeriodChange"> |
|||
<option value="income">Income </option> |
|||
<option value="expense">Expense </option> |
|||
<option value="profit">Profit </option> |
|||
<option value="all">All In One</option> |
|||
</select> |
|||
</div> |
|||
<div class="card-tools" |
|||
style="margin-left:5px;"> |
|||
<select class="form-select" |
|||
style="color:#000000;" |
|||
t-model="state.income" |
|||
t-on-change="onPeriodChange"> |
|||
<option value="income_this_year">This Year</option> |
|||
<option value="income_this_month">This Month</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<!--card-body--> |
|||
<div class="card-body"> |
|||
<div class="row"> |
|||
<div class="col-md-12"> |
|||
<div class="chart"> |
|||
<canvas id="canvas" |
|||
t-ref="All" |
|||
width="300" height="200"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
<!-- PAYMENT LIST --> |
|||
<div class="col-md-4"> |
|||
<div class="card" style="margin-top:20px;"> |
|||
<!-- card-header--> |
|||
<div class="card-header" |
|||
style=" padding: 17px 1.5rem !important; |
|||
background:linear-gradient(90deg, #3F2B96 0%, #A8C0FF 100%); |
|||
display: flex !IMPORTANT; justify-content: space-between; |
|||
align-items: center;border-radius: 10px 10px 0px 0px; "> |
|||
<div class="card-title"> |
|||
<b> |
|||
<h3 class="custom-h3" |
|||
style="color:aqua;" |
|||
t-if="state.payment_list_filter == 'customer_payment' ">CUSTOMER PAYMENT LIST</h3> |
|||
<h3 class="custom-h3" |
|||
style="color:aqua;" |
|||
t-if="state.payment_list_filter == 'vendor_payment' ">VENDOR PAYMENT LIST</h3> |
|||
</b> |
|||
</div> |
|||
<div class="card-tools" |
|||
style="margin-left:auto;"> |
|||
<select class="form-select" |
|||
style="color: #000000;" |
|||
t-model="state.payment_list_filter" |
|||
t-on-change="onPeriodChange"> |
|||
<option value="customer_payment">Customer List</option> |
|||
<option value="vendor_payment">Vendor List</option> |
|||
</select> |
|||
</div> |
|||
<div class="card-tools" |
|||
style="margin-left:5px;"> |
|||
<select class="form-select" |
|||
style="color:#000000;" |
|||
t-model="state.payment_data_filter" |
|||
t-on-change="onPeriodChange"> |
|||
<option value="this_month">This Month</option> |
|||
<option value="this_year">This Year</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<!--card-body--> |
|||
<div class="card-body" |
|||
style="height:400px;overflow: overlay;"> |
|||
<div class="row"> |
|||
<div class="col-md-12"> |
|||
<div class="chart"> |
|||
<table class="table table-striped" |
|||
t-if="state.payment_data.length != 0"> |
|||
<thead> |
|||
<tr> |
|||
<th>Name</th> |
|||
<th>Amount</th> |
|||
<th>Date</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-foreach="state.payment_data" |
|||
t-as="payment" |
|||
t-key="payment.id"> |
|||
<td><t t-esc="payment.partner"/> </td> |
|||
<td><t t-esc="payment.amount"/> </td> |
|||
<td><t t-esc="payment.date"/> </td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<div t-else=""> |
|||
<h2>NO DATA AVAILABLE</h2> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- TOP SALE REVENUE CUSTOMER--> |
|||
<div class="col-md-4" id="col-graph"> |
|||
<div class="card" style="margin-top:20px;"> |
|||
<!--card-header--> |
|||
<div class="card-header" |
|||
style=" padding: 17px 1.5rem !important; |
|||
background:linear-gradient(90deg, #3F2B96 0%, #A8C0FF 100%); |
|||
display: flex !IMPORTANT; justify-content: space-between; |
|||
align-items: center;border-radius: 10px 10px 0px 0px; "> |
|||
<div class="card-title"> |
|||
<b> |
|||
<h3 class="custom-h3" |
|||
style="color:aqua;">TOP SALE REVENUE CUSTOMER</h3> |
|||
</b> |
|||
</div> |
|||
<div class="card-tools"> |
|||
<select class="form-select" |
|||
style="color:#000000;" |
|||
t-model="state.top_sale_cust_filter" |
|||
t-on-change="onPeriodChange"> |
|||
<option value="this_month">This Month</option> |
|||
<option value="this_year">This Year</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<!--card-body--> |
|||
<div class="card-body" |
|||
style="height:400px;overflow: overlay;"> |
|||
<div class="row"> |
|||
<div class="col-md-12"> |
|||
<div class="chart"> |
|||
<table class="table table-striped" |
|||
t-if="state.top_sale_cust.length != 0"> |
|||
<thead> |
|||
<tr> |
|||
<th>Name</th> |
|||
<th>Amount</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-foreach="state.top_sale_cust" |
|||
t-as="revenue" |
|||
t-key="revenue.customer_id"> |
|||
<td><t t-esc="revenue.customer"/> </td> |
|||
<td><t t-esc="revenue.total_amount"/> </td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<div t-else=""> |
|||
<h2>NO DATA AVAILABLE</h2> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
</div> |
|||
</div> |
|||
<!-- BANK AND CASH BALANCE --> |
|||
<div class="col-md-4"> |
|||
<div class="card" style="margin-top:20px;height:521px;"> |
|||
<!--card-header--> |
|||
<div class="card-header" |
|||
style=" padding: 17px 1.5rem !important; |
|||
background:linear-gradient(90deg, #3F2B96 0%, #A8C0FF 100%); |
|||
display: flex !IMPORTANT; justify-content: space-between; |
|||
align-items: center;border-radius: 10px 10px 0px 0px; "> |
|||
<div class="card-title"> |
|||
<b> |
|||
<h3 class="custom-h3" |
|||
style="color:aqua;">BANK AND CASH BALANCE</h3> |
|||
</b> |
|||
</div> |
|||
</div> |
|||
<!--card-body--> |
|||
<div class="card-body" style="overflow: overlay;"> |
|||
<div class="row"> |
|||
<div class="col-md-12"> |
|||
<table class="table table-striped" |
|||
t-if="state.balance"> |
|||
<thead> |
|||
<tr> |
|||
<th>Name</th> |
|||
<th>Amount</th> |
|||
</tr> |
|||
</thead> |
|||
<tbody> |
|||
<tr t-foreach="state.balance" |
|||
t-as="balance" |
|||
t-key="balance.id"> |
|||
<td><t t-esc="balance.name.en_US"/> </td> |
|||
<td><t t-esc="balance.balance"/> </td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<div t-else=""> |
|||
<h2>NO DATA AVAILABLE</h2> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
|
|||
|
|||
<!-- AGED RECEIVABLE/PAYABLE --> |
|||
<div class="col-md-4"> |
|||
<div class="card" style="margin-top:20px;"> |
|||
<!--card-header--> |
|||
<div class="card-header" |
|||
style=" padding: 17px 1.5rem !important; |
|||
background:linear-gradient(90deg, #3F2B96 0%, #A8C0FF 100%); |
|||
display: flex !IMPORTANT; justify-content: space-between; |
|||
align-items: center; border-radius: 10px 10px 0px 0px; "> |
|||
<div class="card-title"> |
|||
<b> |
|||
<h3 class="custom-h3" |
|||
style="color:aqua;" |
|||
t-if="state.aged_filter =='aged_receive'">AGED RECEIVABLE</h3> |
|||
<h3 class="custom-h3" |
|||
style="color:aqua;" |
|||
t-if="state.aged_filter =='aged_payable'">AGED PAYABLE</h3> |
|||
</b> |
|||
</div> |
|||
<div class="card-tools" |
|||
style="margin-left:auto;"> |
|||
<select class="form-select" |
|||
style="color:#000000;" |
|||
t-model="state.aged_filter" |
|||
t-on-change="onPeriodChange"> |
|||
<option value="aged_receive">Aged Receivable</option> |
|||
<option value="aged_payable">Aged Payable</option> |
|||
</select> |
|||
</div> |
|||
<div class="card-tools" |
|||
style="margin-left:5px;"> |
|||
<select class="form-select" |
|||
style="color:#000000;" |
|||
t-model="state.aged_payable_filter" |
|||
t-on-change="onPeriodChange"> |
|||
<option value="this_month">This Month</option> |
|||
<option value="this_year">This Year</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<!--card-body--> |
|||
<div class="card-body" style="overflow: overlay;"> |
|||
<div class="row"> |
|||
<div class="col-md-12"> |
|||
<div id="chart"> |
|||
<canvas t-ref="AgedRecords" |
|||
width="400" height="303"/> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<!-- TOP CUSTOMERS / VENDORS --> |
|||
<div class="col-md-4" style="margin-bottom:115px;"> |
|||
<div class="card" style="margin-top:20px;height:521px;"> |
|||
<!--card-header--> |
|||
<div class="card-header" |
|||
style=" padding: 17px 1.5rem !important; |
|||
background:linear-gradient(90deg, #3F2B96 0%, #A8C0FF 100%); |
|||
display: flex !IMPORTANT; justify-content: space-between; |
|||
align-items: center; border-radius: 10px 10px 0px 0px; "> |
|||
<h3 class="custom-h3 card-title" |
|||
style="color:aqua;"> |
|||
TOP CUSTOMERS/VENDORS |
|||
</h3> |
|||
<div class="card-tools"> |
|||
<select class="form-select" |
|||
style="color:#000000;" |
|||
t-model="state.top_filter" |
|||
t-on-change="onPeriodChange"> |
|||
<option id="top_10_customer_this_month" |
|||
value="this_month">This Month</option> |
|||
<option value="this_year">This Year</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<!--card-body--> |
|||
<div class="card-body" |
|||
style="overflow: overlay;"> |
|||
<div class="row"> |
|||
<div class="col-md-12"> |
|||
<div class="chart"> |
|||
<h2>Customers </h2> |
|||
<table class="table table-striped" t-if="state.top.top_customers"> |
|||
<tbody> |
|||
<tr t-foreach="state.top.top_customers" |
|||
t-as="customer" |
|||
t-key="customer.id"> |
|||
<td><t t-esc="customer.name"/> </td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<div t-else=""> |
|||
<h2>NO DATA AVAILABLE</h2> |
|||
</div> |
|||
<h2>Vendors</h2> |
|||
<table class="table table-striped" t-if="state.top.top_vendors"> |
|||
<tbody> |
|||
<tr t-foreach="state.top.top_vendors" |
|||
t-as="vendor" |
|||
t-key="vendor.id"> |
|||
<td><t t-esc="vendor.name"/> </td> |
|||
</tr> |
|||
</tbody> |
|||
</table> |
|||
<div t-else=""> |
|||
<h2>NO DATA AVAILABLE</h2> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</templates> |
@ -0,0 +1,11 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<data> |
|||
<record id="accounting_dashboard_action" model="ir.actions.client"> |
|||
<field name="name">Dashboard</field> |
|||
<field name="tag">accounting_dashboard_tags</field> |
|||
</record> |
|||
<menuitem name="Accounting Dashboard" id="account_dashboard" |
|||
action="accounting_dashboard_action"/> |
|||
</data> |
|||
</odoo> |