diff --git a/base_accounting_kit/__manifest__.py b/base_accounting_kit/__manifest__.py
index 6307a78dc..8fa2d7ade 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.3.4.3',
+ 'version': '13.0.4.4.3',
'category': 'Accounting',
'summary': """ Asset and Budget Management,
Accounting Reports, PDC, Lock dates,
@@ -54,6 +54,8 @@
'data/followup_levels.xml',
'data/account_asset_data.xml',
'data/recurring_entry_cron.xml',
+ 'views/assets.xml',
+ 'views/dashboard_views.xml',
'views/reports_config_view.xml',
'views/accounting_menu.xml',
'views/credit_limit_view.xml',
@@ -95,6 +97,9 @@
'report/account_asset_report_views.xml',
'report/report.xml',
],
+ 'qweb': [
+ 'static/src/xml/template.xml'
+ ],
'license': 'LGPL-3',
'images': ['static/description/banner.gif'],
'installable': True,
diff --git a/base_accounting_kit/doc/changelog.md b/base_accounting_kit/doc/changelog.md
index 89995c5d5..34e5820cb 100644
--- a/base_accounting_kit/doc/changelog.md
+++ b/base_accounting_kit/doc/changelog.md
@@ -39,3 +39,8 @@
#### Version 13.0.3.4.3
#### FIX
- Asset depreciation date issue
+
+#### 12.02.2020
+#### Version 13.0.4.4.3
+#### UPDT
+- Dashboard Added
diff --git a/base_accounting_kit/models/__init__.py b/base_accounting_kit/models/__init__.py
index a9508a82c..9562f352a 100644
--- a/base_accounting_kit/models/__init__.py
+++ b/base_accounting_kit/models/__init__.py
@@ -32,3 +32,4 @@ from . import product_template
from . import recurring_payments
from . import res_config_settings
from . import res_partner
+from . import account_dashboard
diff --git a/base_accounting_kit/models/account_dashboard.py b/base_accounting_kit/models/account_dashboard.py
new file mode 100644
index 000000000..7aabfc6f7
--- /dev/null
+++ b/base_accounting_kit/models/account_dashboard.py
@@ -0,0 +1,1806 @@
+# -*- coding: utf-8 -*-
+
+from odoo import models, fields, api
+import datetime
+from datetime import datetime
+from dateutil.relativedelta import relativedelta
+import calendar
+
+
+class DashBoard(models.Model):
+ _inherit = 'account.move'
+
+ # function to getting expenses
+
+ @api.model
+ def get_expense_details(self):
+
+ self._cr.execute('''select sum(debit)-sum(credit) as expense ,to_char(account_move_line.date, 'Month') as month ,
+ internal_group from account_move_line ,
+ account_account
+ where account_move_line.account_id=account_account.id AND internal_group = 'expense' AND
+ to_char(DATE(NOW()), 'YY') = to_char(account_move_line.date, 'YY')
+ AND account_move_line.parent_state = 'posted'
+ group by internal_group,month
+ order by month desc
+ ''')
+ result = self._cr.dictfetchall()
+ month = list(sorted(set([item['month'] for item in result])))
+ incomes = list(filter(lambda i: i['internal_group'] == 'income', result))
+ expenses = list(filter(lambda i: i['internal_group'] == 'expense', result))
+ inc = [item['amount'] * -1 for item in incomes]
+ exp = [item['amount'] for item in expenses]
+ record = {
+ 'month': month,
+ 'income': inc,
+ 'expense': exp
+ }
+ return record
+
+ # function to getting expense of this year
+
+ @api.model
+ def get_ex_this_year(self):
+ month_list = []
+ for i in range(11, -1, -1):
+ l_month = datetime.now() - relativedelta(months=i)
+ text = format(l_month, '%B')
+ month_list.append(text)
+
+ self._cr.execute('''select sum(debit)-sum(credit) as expense ,to_char(account_move_line.date, 'Month') as month ,
+ internal_group from account_move_line ,
+ account_account
+ where account_move_line.account_id=account_account.id AND internal_group = 'expense' AND
+ to_char(DATE(NOW()), 'YY') = to_char(account_move_line.date, 'YY') AND account_move_line.parent_state='posted'
+ group by internal_group,month
+ ''')
+
+ record = self._cr.dictfetchall()
+ records = []
+ for month in month_list:
+ this_month = list(filter(lambda r: r['month'].strip() == month, record))
+ if not this_month:
+ records.append({
+ 'month': month,
+ 'expense': 0.0
+ })
+ else:
+ records.append(this_month[0])
+ labels = [item['month'] for item in records]
+ expense = [item['expense'] for item in records]
+ record = {
+ 'expense': expense,
+ 'label': labels
+ }
+ return record
+
+ # function to getting expense of last year
+
+ @api.model
+ def get_ex_last_year(self):
+ month_list = []
+ for i in range(11, -1, -1):
+ l_month = datetime.now() - relativedelta(months=i)
+ text = format(l_month, '%B')
+ month_list.append(text)
+
+ self._cr.execute('''
+
+ select sum(debit)-sum(credit) as expense,to_char(account_move_line.date, 'Month') as month ,
+ internal_group from account_move_line ,
+ account_account
+ where Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) -1 AND
+ account_move_line.account_id=account_account.id AND internal_group = 'expense'
+ AND account_move_line.parent_state='posted'
+ group by month, internal_group
+ ''')
+ record = self._cr.dictfetchall()
+ records = []
+ for month in month_list:
+ this_month = list(filter(lambda r: r['month'].strip() == month, record))
+ if not this_month:
+ records.append({
+ 'month': month,
+ 'expense': 0.0
+ })
+ else:
+ records.append(this_month[0])
+ labels = [item['month'] for item in records]
+ expense = [item['expense'] for item in records]
+ record = {
+ 'expense': expense,
+ 'label': labels
+ }
+ return record
+
+ # function to getting expense of this month
+
+ @api.model
+ def get_ex_this_month(self):
+
+ day_list = []
+ now = datetime.now()
+ day = calendar.monthrange(now.year, now.month)[1]
+ for x in range(1, day + 1):
+ day_list.append(x)
+ self._cr.execute('''select sum(debit)-sum(credit) as expense ,cast(to_char(account_move_line.date, 'DD')as int)
+ as date ,
+ internal_group from account_move_line ,
+ account_account
+ where 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())) AND
+ account_move_line.account_id=account_account.id AND internal_group='expense'
+ AND account_move_line.parent_state='posted'
+ group by internal_group,date
+ ''')
+
+ record = self._cr.dictfetchall()
+ records = []
+ for date in day_list:
+ last_month = list(filter(lambda m: m['date'] == date, record))
+ if not last_month:
+ records.append({
+ 'date': date,
+ 'expense': 0.0
+ })
+ else:
+ records.append(last_month[0])
+ labels = [item['date'] for item in records]
+ series = [item['expense'] for item in records]
+ record = {
+ 'expense': series,
+ 'label': labels
+ }
+ return record
+
+ # function to getting expense of last month
+
+ @api.model
+ def get_ex_last_month(self):
+ day_list = []
+ now = datetime.now()
+ day = \
+ calendar.monthrange(now.year - 1 if now.month == 1 else now.year,
+ now.month - 1 if not now.month == 1 else 12)[
+ 1]
+ for x in range(1, day + 1):
+ day_list.append(x)
+
+ one_month_ago = (datetime.now() - relativedelta(months=1)).month
+
+ self._cr.execute('''select sum(debit)-sum(credit) as expense ,cast(to_char(account_move_line.date, 'DD')as int)
+ as date ,
+ internal_group from account_move_line ,
+ account_account
+ where Extract(month FROM account_move_line.date) = ''' + str(one_month_ago) + ''' AND
+ account_move_line.account_id=account_account.id AND internal_group='expense'
+ AND account_move_line.parent_state='posted'
+ group by internal_group,date
+ ''')
+ record = self._cr.dictfetchall()
+ records = []
+ for date in day_list:
+ last_month = list(filter(lambda m: m['date'] == date, record))
+ if not last_month:
+ records.append({
+ 'date': date,
+ 'expense': 0.0
+ })
+ else:
+ records.append(last_month[0])
+ labels = [item['date'] for item in records]
+ series = [item['expense'] for item in records]
+ record = {
+ 'expense': series,
+ 'label': labels
+ }
+ return record
+
+ # function to getting income of this year
+
+ @api.model
+ def get_income_this_year(self, *post):
+
+ company_id = self.env.company.id
+
+ month_list = []
+ for i in range(11, -1, -1):
+ l_month = datetime.now() - relativedelta(months=i)
+ text = format(l_month, '%B')
+ month_list.append(text)
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ self._cr.execute(('''select sum(debit)-sum(credit) as income ,to_char(account_move_line.date, 'Month') as month ,
+ internal_group from account_move_line ,account_account where
+ account_move_line.account_id=account_account.id AND internal_group = 'income'
+ AND to_char(DATE(NOW()), 'YY') = to_char(account_move_line.date, 'YY')
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ AND %s
+ group by internal_group,month
+ ''') % (states_arg))
+ record = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(debit)-sum(credit) as expense ,to_char(account_move_line.date, 'Month') as month ,
+ internal_group from account_move_line ,account_account where
+ account_move_line.account_id=account_account.id AND internal_group = 'expense'
+ AND to_char(DATE(NOW()), 'YY') = to_char(account_move_line.date, 'YY')
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ AND %s
+ group by internal_group,month
+ ''') % (states_arg))
+
+ result = self._cr.dictfetchall()
+ 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,
+ 'month': month,
+ 'profit': profit,
+ }
+
+ # function to getting income of last year
+
+ @api.model
+ def get_income_last_year(self, *post):
+
+ company_id = self.env.company.id
+
+ month_list = []
+ for i in range(11, -1, -1):
+ l_month = datetime.now() - relativedelta(months=i)
+ text = format(l_month, '%B')
+ month_list.append(text)
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ self._cr.execute(('''select sum(debit)-sum(credit) as income ,to_char(account_move_line.date, 'Month') as month ,
+ internal_group from account_move_line ,account_account
+ where account_move_line.account_id=account_account.id AND internal_group = 'income'
+ AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) -1
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ AND %s
+ group by internal_group,month
+ ''') % (states_arg))
+ record = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(debit)-sum(credit) as expense ,to_char(account_move_line.date, 'Month') as month ,
+ internal_group from account_move_line , account_account where
+ account_move_line.account_id=account_account.id AND internal_group = 'expense'
+ AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) -1
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ AND %s
+ group by internal_group,month
+ ''') % (states_arg))
+
+ result = self._cr.dictfetchall()
+ 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,
+ 'month': month,
+ 'profit': profit,
+ }
+
+ # function to getting income of last month
+
+ @api.model
+ def get_income_last_month(self, *post):
+
+ company_id = self.env.company.id
+ day_list = []
+ now = datetime.now()
+ day = \
+ calendar.monthrange(now.year - 1 if now.month == 1 else now.year,
+ now.month - 1 if not now.month == 1 else 12)[
+ 1]
+
+ for x in range(1, day + 1):
+ day_list.append(x)
+
+ one_month_ago = (datetime.now() - relativedelta(months=1)).month
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ self._cr.execute(('''select sum(debit)-sum(credit) as income ,cast(to_char(account_move_line.date, 'DD')as int)
+ as date , internal_group from account_move_line , account_account where
+ Extract(month FROM account_move_line.date) = ''' + str(one_month_ago) + '''
+ AND %s
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ AND account_move_line.account_id=account_account.id AND internal_group='income'
+ group by internal_group,date
+ ''') % (states_arg))
+
+ record = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(debit)-sum(credit) as expense ,cast(to_char(account_move_line.date, 'DD')as int)
+ as date ,internal_group from account_move_line ,account_account where
+ Extract(month FROM account_move_line.date) = ''' + str(one_month_ago) + '''
+ AND %s
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ AND account_move_line.account_id=account_account.id AND internal_group='expense'
+ group by internal_group,date
+ ''') % (states_arg))
+ result = self._cr.dictfetchall()
+ 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
+
+ }
+
+ # function to getting income of this month
+
+ @api.model
+ def get_income_this_month(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ day_list = []
+ now = datetime.now()
+ day = calendar.monthrange(now.year, now.month)[1]
+ for x in range(1, day + 1):
+ day_list.append(x)
+
+ self._cr.execute(('''select sum(debit)-sum(credit) as income ,cast(to_char(account_move_line.date, 'DD')as int)
+ as date , internal_group from account_move_line , account_account
+ where 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()))
+ AND %s
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ AND account_move_line.account_id=account_account.id AND internal_group='income'
+ group by internal_group,date
+ ''') % (states_arg))
+
+ record = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(debit)-sum(credit) as expense ,cast(to_char(account_move_line.date, 'DD')as int)
+ as date , internal_group from account_move_line , account_account where
+ 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()))
+ AND %s
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ AND account_move_line.account_id=account_account.id AND internal_group='expense'
+ group by internal_group,date
+ ''') % (states_arg))
+ result = self._cr.dictfetchall()
+ 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
+
+ }
+
+ # function to getting late bills
+
+ @api.model
+ def get_latebills(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+ self._cr.execute((''' select res_partner.name as partner, res_partner.commercial_partner_id as res ,
+ account_move.commercial_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.type = 'in_invoice' AND
+ invoice_payment_state = 'not_paid' AND
+ account_move.company_id = ''' + str(company_id) + ''' AND
+ %s
+ AND account_move.commercial_partner_id=res_partner.commercial_partner_id
+ group by parent,partner,res
+ order by amount desc ''') % (states_arg))
+
+ record = self._cr.dictfetchall()
+
+ bill_partner = [item['partner'] for item in record]
+
+ bill_amount = [item['amount'] for item in record]
+
+ amounts = sum(bill_amount[9:])
+ name = bill_partner[9:]
+ results = []
+ pre_partner = []
+
+ bill_amount = bill_amount[:9]
+ bill_amount.append(amounts)
+ bill_partner = bill_partner[:9]
+ bill_partner.append("Others")
+ records = {
+ 'bill_partner': bill_partner,
+ 'bill_amount': bill_amount,
+ 'result': results,
+
+ }
+ return records
+
+ # return record
+
+ @api.model
+ def get_latebills_last_month(self):
+
+ # company_id = self.env.company.id
+
+ one_month_ago = (datetime.now() - relativedelta(months=1)).month
+
+ self._cr.execute(''' select to_char(account_move.date, 'Month') as month, res_partner.name as 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.type = 'in_invoice'
+ AND invoice_payment_state = 'not_paid'
+ AND state = 'posted' AND Extract(month FROM account_move.invoice_date_due) = ''' + str(
+ one_month_ago) + '''
+ 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, partner, month
+ order by amount desc ''')
+
+ record = self._cr.dictfetchall()
+ return record
+
+ @api.model
+ def get_latebills_last_year(self):
+
+ # company_id = self.env.company.id
+
+ self._cr.execute(''' select to_char(account_move.date, 'Month') as month, res_partner.name as 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.type = 'in_invoice'
+ AND invoice_payment_state = 'not_paid'
+ AND state = 'posted' AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) - 1
+ AND account_move.partner_id = res_partner.commercial_partner_id
+ group by parent, partner, month
+ order by amount desc ''')
+
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to getting over dues
+
+ @api.model
+ def get_overdues(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+ self._cr.execute((''' select res_partner.name as partner, res_partner.commercial_partner_id as res ,
+ account_move.commercial_partner_id as parent, sum(account_move.amount_total) as amount
+ from account_move, account_move_line ,res_partner where
+ account_move.partner_id=res_partner.id AND account_move.type = 'out_invoice' AND
+ invoice_payment_state = 'not_paid' AND
+ %s
+ AND account_move.company_id = ''' + str(company_id) + ''' AND
+ account_move_line.account_internal_type = 'payable' AND
+ account_move.commercial_partner_id=res_partner.commercial_partner_id
+ group by parent,partner,res
+ order by amount desc
+ ''') % (states_arg))
+
+ record = self._cr.dictfetchall()
+ due_partner = [item['partner'] for item in record]
+ due_amount = [item['amount'] for item in record]
+
+ amounts = sum(due_amount[9:])
+ name = due_partner[9:]
+ result = []
+ pre_partner = []
+
+ due_amount = due_amount[:9]
+ due_amount.append(amounts)
+ due_partner = due_partner[:9]
+ due_partner.append("Others")
+ records = {
+ 'due_partner': due_partner,
+ 'due_amount': due_amount,
+ 'result': result,
+
+ }
+ return records
+
+ @api.model
+ def get_overdues_this_month(self, *post):
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+ company_id = self.env.company.id
+ 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.type = 'out_invoice'
+ AND invoice_payment_state = 'not_paid'
+ AND %s
+ 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
+ AND account_move.company_id = ''' + str(company_id) + '''
+ group by parent, due_partner, month
+ order by amount desc ''') % (states_arg))
+
+ record = self._cr.dictfetchall()
+ due_partner = [item['due_partner'] for item in record]
+ due_amount = [item['amount'] for item in record]
+
+ amounts = sum(due_amount[9:])
+ name = due_partner[9:]
+ result = []
+ pre_partner = []
+
+ due_amount = due_amount[:9]
+ due_amount.append(amounts)
+ due_partner = due_partner[:9]
+ due_partner.append("Others")
+ records = {
+ 'due_partner': due_partner,
+ 'due_amount': due_amount,
+ 'result': result,
+
+ }
+ return records
+
+ @api.model
+ def get_latebills_this_month(self, *post):
+
+ company_id = self.env.company.id
+
+ partners = self.env['res.partner'].search([('active', '=', True)])
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+ 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.type = 'in_invoice'
+ AND invoice_payment_state = 'not_paid'
+ AND %s
+ 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.company_id = ''' + str(company_id) + '''
+ AND account_move.partner_id = res_partner.commercial_partner_id
+ group by parent, bill_partner, month
+ order by amount desc ''') % (states_arg))
+
+ result = self._cr.dictfetchall()
+ bill_partner = [item['bill_partner'] for item in result]
+
+ bill_amount = [item['amount'] for item in result]
+
+ amounts = sum(bill_amount[9:])
+ name = bill_partner[9:]
+ results = []
+ pre_partner = []
+
+ bill_amount = bill_amount[:9]
+ bill_amount.append(amounts)
+ bill_partner = bill_partner[:9]
+ bill_partner.append("Others")
+ records = {
+ 'bill_partner': bill_partner,
+ 'bill_amount': bill_amount,
+ 'result': results,
+
+ }
+ return records
+
+ @api.model
+ def get_overdues_last_month(self):
+
+ # company_id = self.env.company.id
+
+ one_month_ago = (datetime.now() - relativedelta(months=1)).month
+
+ self._cr.execute(''' select to_char(account_move.date, 'Month') as month, res_partner.name as 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.type = 'out_invoice'
+ AND invoice_payment_state = 'not_paid'
+ AND state = 'posted' AND Extract(month FROM account_move.invoice_date_due) = ''' + str(
+ one_month_ago) + '''
+ 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, partner, month
+ order by amount desc ''')
+
+ record = self._cr.dictfetchall()
+ return record
+
+ @api.model
+ def get_top_10_customers(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+
+ 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.type = 'out_invoice'
+ AND %s
+ group by parent, customers
+ order by amount desc
+ limit 10
+ ''') % (states_arg))
+
+ record_invoice = self._cr.dictfetchall()
+
+ self._cr.execute((''' select res_partner.commercial_company_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.type = 'out_refund'
+ AND %s
+ group by parent, customers
+ order by amount desc
+ limit 10
+ ''') % (states_arg))
+
+ record_refund = self._cr.dictfetchall()
+
+ summed = []
+ for out_sum in record_invoice:
+ parent = out_sum['parent']
+ su = out_sum['amount'] - \
+ (list(filter(lambda refund: refund['parent'] == out_sum['parent'], record_refund))[0][
+ 'amount'] if len(
+ list(filter(lambda refund: refund['parent'] == out_sum['parent'], record_refund))) > 0 else 0.0)
+ summed.append({
+ 'customers': out_sum['customers'],
+ 'amount': su,
+ 'parent': parent
+ })
+
+ return summed
+
+ @api.model
+ def get_top_10_customers_this_month(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+ 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.type = 'out_invoice'
+ AND %s
+ 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()))
+ group by parent, customers
+ order by amount desc
+ limit 10
+ ''') % (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.type = 'out_refund'
+ AND %s
+ 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()))
+ group by parent, customers
+ order by amount desc
+ limit 10
+ ''') % (states_arg))
+
+ record_refund = self._cr.dictfetchall()
+
+ summed = []
+ for out_sum in record_invoice:
+ parent = out_sum['parent']
+ su = out_sum['amount'] - \
+ (list(filter(lambda refund: refund['parent'] == out_sum['parent'], record_refund))[0][
+ 'amount'] if len(
+ list(filter(lambda refund: refund['parent'] == out_sum['parent'], record_refund))) > 0 else 0.0)
+ summed.append({
+ 'customers': out_sum['customers'],
+ 'amount': su,
+ 'parent': parent
+ })
+
+ return summed
+
+ @api.model
+ def get_top_10_customers_last_month(self, *post):
+
+ company_id = self.env.company.id
+ one_month_ago = (datetime.now() - relativedelta(months=1)).month
+
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+ 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.type = 'out_invoice'
+ AND %s
+ AND Extract(month FROM account_move.invoice_date_due) = ''' + str(one_month_ago) + '''
+ group by parent, customers
+ order by amount desc
+ limit 10
+ ''') % (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.type = 'out_refund'
+ AND %s
+ AND Extract(month FROM account_move.invoice_date_due) = ''' + str(one_month_ago) + '''
+ group by parent, customers
+ order by amount desc
+ limit 10
+ ''') % (states_arg))
+
+ record_refund = self._cr.dictfetchall()
+
+ summed = []
+ for out_sum in record_invoice:
+ parent = out_sum['parent']
+ su = out_sum['amount'] - \
+ (list(filter(lambda refund: refund['parent'] == out_sum['parent'], record_refund))[0][
+ 'amount'] if len(
+ list(filter(lambda refund: refund['parent'] == out_sum['parent'], record_refund))) > 0 else 0.0)
+ summed.append({
+ 'customers': out_sum['customers'],
+ 'amount': su,
+ 'parent': parent
+ })
+
+ return summed
+
+ @api.model
+ def get_overdues_this_year(self, *post):
+
+ company_id = self.env.company.id
+ partners = self.env['res.partner'].search([('active', '=', True)])
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+ 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.type = 'out_invoice'
+ AND invoice_payment_state = 'not_paid'
+ AND %s
+ AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.partner_id = res_partner.commercial_partner_id
+ AND account_move.company_id = ''' + str(company_id) + '''
+
+ group by parent, due_partner
+ order by amount desc ''') % (states_arg))
+
+ record = self._cr.dictfetchall()
+ due_partner = [item['due_partner'] for item in record]
+ due_amount = [item['amount'] for item in record]
+
+ amounts = sum(due_amount[9:])
+ name = due_partner[9:]
+ result = []
+ pre_partner = []
+
+ due_amount = due_amount[:9]
+ due_amount.append(amounts)
+ due_partner = due_partner[:9]
+ due_partner.append("Others")
+ records = {
+ 'due_partner': due_partner,
+ 'due_amount': due_amount,
+ 'result': result,
+
+ }
+ return records
+
+ @api.model
+ def get_latebills_this_year(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+ self._cr.execute((''' select 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.type = 'in_invoice'
+ AND invoice_payment_state = 'not_paid'
+ AND %s
+ AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.partner_id = res_partner.commercial_partner_id
+ AND account_move.company_id = ''' + str(company_id) + '''
+ group by parent, bill_partner
+ order by amount desc ''') % (states_arg))
+
+ result = self._cr.dictfetchall()
+
+ bill_partner = [item['bill_partner'] for item in result]
+
+ bill_amount = [item['amount'] for item in result]
+ amounts = sum(bill_amount[9:])
+ name = bill_partner[9:]
+ results = []
+ pre_partner = []
+
+ bill_amount = bill_amount[:9]
+ bill_amount.append(amounts)
+ bill_partner = bill_partner[:9]
+ bill_partner.append("Others")
+ records = {
+ 'bill_partner': bill_partner,
+ 'bill_amount': bill_amount,
+ 'result': results,
+
+ }
+ return records
+
+ @api.model
+ def get_overdues_last_year(self):
+
+ # company_id = self.env.company.id
+
+ self._cr.execute(''' select to_char(account_move.date, 'Month') as month, res_partner.name as 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.type = 'out_invoice'
+ AND invoice_payment_state = 'not_paid'
+ AND state = 'posted' AND Extract(YEAR FROM account_move.invoice_date_due) = Extract(YEAR FROM DATE(NOW())) - 1
+ AND account_move.partner_id = res_partner.commercial_partner_id
+ group by parent, partner, month
+ order by amount desc ''')
+
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get total invoice
+
+ @api.model
+ def get_total_invoice(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+ self._cr.execute(('''select sum(amount_total) as customer_invoice from account_move where type ='out_invoice'
+ AND %s AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record_customer = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(amount_total) as supplier_invoice from account_move where type ='in_invoice'
+ AND %s AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record_supplier = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(amount_total) as credit_note from account_move where type ='out_refund'
+ AND %s AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ result_credit_note = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(amount_total) as refund from account_move where type ='in_refund'
+ AND %s AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ result_refund = self._cr.dictfetchall()
+
+ customer_invoice = [item['customer_invoice'] for item in record_customer]
+ supplier_invoice = [item['supplier_invoice'] for item in record_supplier]
+ credit_note = [item['credit_note'] for item in result_credit_note]
+ refund = [item['refund'] for item in result_refund]
+
+ return customer_invoice, credit_note, supplier_invoice, refund
+
+ @api.model
+ def get_total_invoice_current_year(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+ self._cr.execute(('''select sum(amount_total_signed) as customer_invoice from account_move where type ='out_invoice'
+ AND %s
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record_customer_current_year = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(-(amount_total_signed)) as supplier_invoice from account_move where type ='in_invoice'
+ AND %s
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record_supplier_current_year = self._cr.dictfetchall()
+
+
+ self._cr.execute(('''select sum(-(amount_total_signed)) - sum(-(amount_residual_signed)) as credit_note from account_move where type ='out_refund'
+ AND %s
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ result_credit_note_current_year = self._cr.dictfetchall()
+
+
+ self._cr.execute(('''select sum(-(amount_total_signed)) as refund from account_move where type ='in_refund'
+ AND %s
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ result_refund_current_year = self._cr.dictfetchall()
+
+
+
+ self._cr.execute(('''select sum(amount_total_signed) - sum(amount_residual_signed) as customer_invoice_paid from account_move where type ='out_invoice'
+ AND %s
+ AND invoice_payment_state = 'paid'
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record_paid_customer_invoice_current_year = self._cr.dictfetchall()
+
+
+
+
+ self._cr.execute(('''select sum(-(amount_total_signed)) - sum(-(amount_residual_signed)) as supplier_invoice_paid from account_move where type ='in_invoice'
+ AND %s
+ AND invoice_payment_state = 'paid'
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ result_paid_supplier_invoice_current_year = self._cr.dictfetchall()
+
+
+
+ self._cr.execute(('''select sum(-(amount_total_signed)) - sum(-(amount_residual_signed)) as customer_credit_paid from account_move where type ='out_refund'
+ AND %s
+ AND invoice_payment_state = 'paid'
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record_paid_customer_credit_current_year = self._cr.dictfetchall()
+
+
+
+ self._cr.execute(('''select sum(amount_total_signed) - sum(amount_residual_signed) as supplier_refund_paid from account_move where type ='in_refund'
+ AND %s
+ AND invoice_payment_state = 'paid'
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ result_paid_supplier_refund_current_year = self._cr.dictfetchall()
+
+
+
+ customer_invoice_current_year = [item['customer_invoice'] for item in record_customer_current_year]
+ supplier_invoice_current_year = [item['supplier_invoice'] for item in record_supplier_current_year]
+
+ credit_note_current_year = [item['credit_note'] for item in result_credit_note_current_year]
+ refund_current_year = [item['refund'] for item in result_refund_current_year]
+
+ paid_customer_invoice_current_year = [item['customer_invoice_paid'] for item in record_paid_customer_invoice_current_year]
+ paid_supplier_invoice_current_year = [item['supplier_invoice_paid'] for item in result_paid_supplier_invoice_current_year]
+
+ paid_customer_credit_current_year = [item['customer_credit_paid'] for item in record_paid_customer_credit_current_year]
+ paid_supplier_refund_current_year = [item['supplier_refund_paid'] for item in result_paid_supplier_refund_current_year]
+
+
+
+ return customer_invoice_current_year, credit_note_current_year, supplier_invoice_current_year, refund_current_year, paid_customer_invoice_current_year,paid_supplier_invoice_current_year, paid_customer_credit_current_year, paid_supplier_refund_current_year
+
+ @api.model
+ def get_total_invoice_current_month(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+ self._cr.execute(('''select sum(amount_total_signed) as customer_invoice from account_move where type ='out_invoice'
+ AND %s
+ AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW()))
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record_customer_current_month = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(-(amount_total_signed)) as supplier_invoice from account_move where type ='in_invoice'
+ AND %s
+ AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW()))
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record_supplier_current_month = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(-(amount_total_signed)) - sum(-(amount_residual_signed)) as credit_note from account_move where type ='out_refund'
+ AND %s
+ AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW()))
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ result_credit_note_current_month = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(-(amount_total_signed)) as refund from account_move where type ='in_refund'
+ AND %s
+ AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW()))
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ result_refund_current_month = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(amount_total_signed) - sum(amount_residual_signed) as customer_invoice_paid from account_move where type ='out_invoice'
+ AND %s
+ AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW()))
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record_paid_customer_invoice_current_month = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(-(amount_total_signed)) - sum(-(amount_residual_signed)) as supplier_invoice_paid from account_move where type ='in_invoice'
+ AND %s
+ AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW()))
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ result_paid_supplier_invoice_current_month = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(-(amount_total_signed)) - sum(-(amount_residual_signed)) as customer_credit_paid from account_move where type ='out_refund'
+ AND %s
+ AND invoice_payment_state = 'paid'
+ AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW()))
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record_paid_customer_credit_current_month = self._cr.dictfetchall()
+
+ self._cr.execute(('''select sum(amount_total_signed) - sum(amount_residual_signed) as supplier_refund_paid from account_move where type ='in_refund'
+ AND %s
+ AND invoice_payment_state = 'paid'
+ AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW()))
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ result_paid_supplier_refund_current_month = self._cr.dictfetchall()
+
+ customer_invoice_current_month = [item['customer_invoice'] for item in record_customer_current_month]
+ supplier_invoice_current_month = [item['supplier_invoice'] for item in record_supplier_current_month]
+ credit_note_current_month = [item['credit_note'] for item in result_credit_note_current_month]
+ refund_current_month = [item['refund'] for item in result_refund_current_month]
+ paid_customer_invoice_current_month = [item['customer_invoice_paid'] for item in record_paid_customer_invoice_current_month]
+ paid_supplier_invoice_current_month = [item['supplier_invoice_paid'] for item in result_paid_supplier_invoice_current_month]
+
+ paid_customer_credit_current_month = [item['customer_credit_paid'] for item in record_paid_customer_credit_current_month]
+ 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
+
+ @api.model
+ def get_total_invoice_this_month(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ state in ('posted', 'draft')"""
+ else:
+ states_arg = """ state = 'posted'"""
+
+ self._cr.execute(('''select sum(amount_total) from account_move where type = 'out_invoice'
+ AND %s
+ AND Extract(month FROM account_move.date) = Extract(month FROM DATE(NOW()))
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get total invoice last month
+
+ @api.model
+ def get_total_invoice_last_month(self):
+
+ one_month_ago = (datetime.now() - relativedelta(months=1)).month
+
+ self._cr.execute('''select sum(amount_total) from account_move where type = 'out_invoice' AND
+ account_move.state = 'posted'
+ AND Extract(month FROM account_move.date) = ''' + str(one_month_ago) + '''
+ ''')
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get total invoice last year
+
+ @api.model
+ def get_total_invoice_last_year(self):
+
+ self._cr.execute(''' select sum(amount_total) from account_move where type = 'out_invoice'
+ AND account_move.state = 'posted'
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) - 1
+ ''')
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get total invoice this year
+
+ @api.model
+ def get_total_invoice_this_year(self):
+
+ company_id = self.env.company.id
+
+ self._cr.execute(''' select sum(amount_total) from account_move where type = 'out_invoice'
+ AND Extract(YEAR FROM account_move.date) = Extract(YEAR FROM DATE(NOW())) AND
+ account_move.state = 'posted' AND
+ account_move.company_id = ''' + str(company_id) + '''
+ ''')
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get unreconcile items
+
+ @api.model
+ def unreconcile_items(self):
+ self._cr.execute('''
+ 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 ''')
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get unreconcile items this month
+
+ @api.model
+ def unreconcile_items_this_month(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ qry = ''' select count(*) FROM account_move_line l,account_account a
+ where Extract(month FROM l.date) = Extract(month FROM DATE(NOW())) AND
+ Extract(YEAR FROM l.date) = Extract(YEAR FROM DATE(NOW())) AND
+ L.account_id=a.id AND l.full_reconcile_id IS NULL AND
+ l.balance != 0 AND a.reconcile IS F
+ AND l.'''+states_arg+'''
+ AND l.company_id = ''' + str(company_id) + '''
+ '''
+
+
+ self._cr.execute((''' select count(*) FROM account_move_line l,account_account a
+ where Extract(month FROM l.date) = Extract(month FROM DATE(NOW())) AND
+ Extract(YEAR FROM l.date) = Extract(YEAR FROM DATE(NOW())) AND
+ L.account_id=a.id AND l.full_reconcile_id IS NULL AND
+ l.balance != 0 AND a.reconcile IS TRUE
+ AND l.%s
+ AND l.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record = self._cr.dictfetchall()
+ return record
+
+
+ # function to get unreconcile items last month
+
+ @api.model
+ def unreconcile_items_last_month(self):
+
+ one_month_ago = (datetime.now() - relativedelta(months=1)).month
+
+ self._cr.execute(''' select count(*) FROM account_move_line l,account_account a
+ where Extract(month FROM l.date) = ''' + str(one_month_ago) + ''' AND
+ L.account_id=a.id AND l.full_reconcile_id IS NULL AND l.balance != 0 AND a.reconcile IS TRUE
+ ''')
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get unreconcile items this year
+
+ @api.model
+ def unreconcile_items_this_year(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ self._cr.execute((''' select count(*) FROM account_move_line l,account_account a
+ where Extract(year FROM l.date) = Extract(year FROM DATE(NOW())) AND
+ L.account_id=a.id AND l.full_reconcile_id IS NULL AND
+ l.balance != 0 AND a.reconcile IS TRUE
+ AND l.%s
+ AND l.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get unreconcile items last year
+
+ @api.model
+ def unreconcile_items_last_year(self):
+
+ self._cr.execute(''' select count(*) FROM account_move_line l,account_account a
+ where Extract(year FROM l.date) = Extract(year FROM DATE(NOW())) - 1 AND
+ L.account_id=a.id AND l.full_reconcile_id IS NULL AND
+ l.balance != 0 AND a.reconcile IS TRUE
+ ''')
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get total income
+
+ @api.model
+ def month_income(self):
+
+ self._cr.execute(''' select sum(debit) as debit , sum(credit) as credit from account_move, account_account,account_move_line
+ where account_move.type = 'entry' AND account_move.state = 'posted' AND account_move_line.account_id=account_account.id AND
+ account_account.internal_group='income'
+ AND to_char(DATE(NOW()), 'MM') = to_char(account_move_line.date, 'MM')
+ ''')
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get total income this month
+
+ @api.model
+ def month_income_this_month(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ 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.internal_group = 'income'
+ AND %s
+ 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()))
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+
+ ''') % (states_arg))
+ record = self._cr.dictfetchall()
+ return record
+
+ @api.model
+ def profit_income_this_month(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ self._cr.execute(('''select sum(debit) - sum(credit) as profit, account_account.internal_group from account_account, account_move_line where
+
+ account_move_line.account_id = account_account.id AND
+ %s AND
+ (account_account.internal_group = 'income' or
+ account_account.internal_group = '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()))
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ group by internal_group
+ ''') %(states_arg))
+ income = self._cr.dictfetchall()
+ profit = [item['profit'] for item in income]
+ internal_group = [item['internal_group'] for item in income]
+ net_profit = True
+ loss = True
+ if profit and profit == 0:
+ if (-profit[1]) > (profit[0]):
+ net_profit = -profit[1] - profit[0]
+ elif (profit[1]) > (profit[0]):
+ net_profit = -profit[1] - profit[0]
+ else:
+ net_profit = -profit[1] - profit[0]
+
+ return profit
+
+ @api.model
+ def profit_income_this_year(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ self._cr.execute(('''select sum(debit) - sum(credit) as profit, account_account.internal_group from account_account, account_move_line where
+
+ account_move_line.account_id = account_account.id AND
+ %s AND
+ (account_account.internal_group = 'income' or
+ account_account.internal_group = 'expense' )
+ AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW()))
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ group by internal_group
+ ''') %(states_arg))
+ income = self._cr.dictfetchall()
+ profit = [item['profit'] for item in income]
+ internal_group = [item['internal_group'] for item in income]
+ net_profit = True
+ loss = True
+
+ if profit and profit == 0:
+ if (-profit[1]) > (profit[0]):
+ net_profit = -profit[1] - profit[0]
+ elif (profit[1]) > (profit[0]):
+ net_profit = -profit[1] - profit[0]
+ else:
+ net_profit = -profit[1] - profit[0]
+
+ return profit
+
+ @api.model
+ def profit_income_last_year(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ self._cr.execute('''select sum(debit) - sum(credit) as profit, account_account.internal_group from account_account, account_move_line where
+
+ account_move_line.account_id = account_account.id AND
+ %s AND
+ (account_account.internal_group = 'income' or
+ account_account.internal_group = 'expense' )
+ AND Extract(year FROM account_move_line.date) = Extract(year FROM DATE(NOW())) - 1
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ group by internal_group
+ ''')
+ income = self._cr.dictfetchall()
+ profit = [item['profit'] for item in income]
+ internal_group = [item['internal_group'] for item in income]
+ net_profit = True
+ loss = True
+
+ if profit and profit == 0:
+ if (-profit[1]) > (profit[0]):
+ net_profit = -profit[1] - profit[0]
+ elif (profit[1]) > (profit[0]):
+ net_profit = -profit[1] - profit[0]
+ else:
+ net_profit = -profit[1] - profit[0]
+
+ return profit
+
+ # function to get total income last month
+
+ @api.model
+ def month_income_last_month(self):
+
+ one_month_ago = (datetime.now() - relativedelta(months=1)).month
+
+ 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.internal_group = 'income' AND
+ account_move_line.parent_state = 'posted'
+ AND Extract(month FROM account_move_line.date) = ''' + str(one_month_ago) + '''
+ ''')
+
+ record = self._cr.dictfetchall()
+
+ return record
+
+ # function to get total income this year
+
+ @api.model
+ def month_income_this_year(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ 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.internal_group = 'income'
+ AND %s
+ AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ ''') % (states_arg))
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get total income last year
+
+ @api.model
+ def month_income_last_year(self):
+
+ self._cr.execute(''' select sum(debit) as debit, sum(credit) as credit from account_account, account_move_line where
+ account_move_line.parent_state = 'posted'
+ AND account_move_line.account_id = account_account.id AND account_account.internal_group = 'income'
+ AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW())) - 1
+ ''')
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get currency
+
+ @api.model
+ def get_currency(self):
+ default = self.env.ref('base.main_company').currency_id
+ default = default.symbol
+ return default
+
+ # function to get total expense
+
+ @api.model
+ def month_expense(self):
+
+ self._cr.execute(''' select sum(debit) as debit , sum(credit) as credit from account_move, account_account,account_move_line
+ where account_move.type = 'entry' AND account_move.state = 'posted' AND account_move_line.account_id=account_account.id AND
+ account_account.internal_group='expense'
+ AND to_char(DATE(NOW()), 'MM') = to_char(account_move_line.date, 'MM')
+ ''')
+ record = self._cr.dictfetchall()
+ return record
+
+ # function to get total expense this month
+
+ @api.model
+ def month_expense_this_month(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ 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.internal_group = 'expense' AND
+ %s
+ 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()))
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+
+
+ ''') %(states_arg))
+ record = self._cr.dictfetchall()
+ return record
+
+
+
+ # function to get total expense this year
+
+ @api.model
+ def month_expense_this_year(self, *post):
+
+ company_id = self.env.company.id
+
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state in ('posted', 'draft')"""
+ else:
+ states_arg = """ parent_state = 'posted'"""
+
+ 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.internal_group = 'expense' AND
+ %s
+ AND Extract(YEAR FROM account_move_line.date) = Extract(YEAR FROM DATE(NOW()))
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+
+
+
+ ''') % (states_arg))
+ record = self._cr.dictfetchall()
+ return record
+
+ @api.model
+ def bank_balance(self, *post):
+
+ company_id = self.env.company.id
+
+ states_arg = ""
+ if post != ('posted',):
+ states_arg = """ parent_state = 'posted'"""
+ else:
+ states_arg = """ parent_state in ('posted', 'draft')"""
+
+ self._cr.execute((''' select account_account.name as name, sum(balance) as balance from account_move_line left join
+ account_account on account_account.id = account_move_line.account_id join
+ account_account_type on account_account_type.id = account_account.user_type_id
+ where account_account_type.name = 'Bank and Cash'
+ AND %s
+ AND account_move_line.company_id = ''' + str(company_id) + '''
+ group by account_account.name
+
+ ''') % (states_arg))
+
+ record = self._cr.dictfetchall()
+
+ banks = [item['name'] for item in record]
+
+ banking = [item['balance'] for item in record]
+
+ records = {
+ 'banks': banks,
+ 'banking': banking,
+
+ }
+ return records
+
+
+
diff --git a/base_accounting_kit/static/description/banner.gif b/base_accounting_kit/static/description/banner.gif
index 30b746d7f..54b13df56 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/accounting_kit_window.gif b/base_accounting_kit/static/description/images/accounting_kit_window.gif
new file mode 100644
index 000000000..5d00f83a5
Binary files /dev/null and b/base_accounting_kit/static/description/images/accounting_kit_window.gif differ
diff --git a/base_accounting_kit/static/description/images/accounting_kit_window.png b/base_accounting_kit/static/description/images/accounting_kit_window.png
deleted file mode 100644
index 025dffae8..000000000
Binary files a/base_accounting_kit/static/description/images/accounting_kit_window.png and /dev/null 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
new file mode 100644
index 000000000..b2126b2e4
Binary files /dev/null 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
new file mode 100644
index 000000000..34a1de66b
Binary files /dev/null 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 01e88c716..27fedd2a5 100644
--- a/base_accounting_kit/static/description/index.html
+++ b/base_accounting_kit/static/description/index.html
@@ -10,10 +10,17 @@
Odoo 13 Accounting
- Asset Management, Accounting Reports, PDC Management,
+ 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
@@ -40,7 +47,7 @@
-
+
@@ -93,6 +100,34 @@
+
+
+
+
+ Dashboard with Necessary Details.
+
+
+
+
+
+
+
+
+
+
+ Aged Receivable, Payable and Top Customer Details in Dashboard.
+
+
+
+
+
+
Odoo 13 Accounting
+
+
+ Accounting Dashboard with all necessary details.
+
Asset management system for Odoo 13 community edition.
diff --git a/base_accounting_kit/static/src/js/account_dashboard.js b/base_accounting_kit/static/src/js/account_dashboard.js
new file mode 100644
index 000000000..ad1995804
--- /dev/null
+++ b/base_accounting_kit/static/src/js/account_dashboard.js
@@ -0,0 +1,1985 @@
+odoo.define('AccountingDashboard.AccountingDashboard', function (require) {
+ 'use strict';
+ var AbstractAction = require('web.AbstractAction');
+ var ajax = require('web.ajax');
+ var core = require('web.core');
+ var rpc = require('web.rpc');
+ var session = require('web.session');
+ var web_client = require('web.web_client');
+ var _t = core._t;
+ var QWeb = core.qweb;
+ var self = this;
+ var currency;
+ var ActionMenu = AbstractAction.extend({
+
+ template: 'Invoicedashboard',
+
+
+ events: {
+ 'click .invoice_dashboard': 'onclick_dashboard',
+
+ 'click #invoice_hide': 'onclick_invoice_hide',
+ 'click #income_hide': 'onclick_income_hide',
+ 'click #ex_hide': 'onclick_ex_hide',
+ 'click #due_hide': 'onclick_due_hide',
+ 'click #top_10_hide': 'onclick_top_10_hide',
+ 'click #late_hide': 'onclick_late_hide',
+ 'click #prog_bar': 'onclick_prog_bar',
+
+ 'click #invoice_this_month': 'onclick_invoice_this_month',
+ 'click #invoice_this_year': 'onclick_invoice_this_year',
+ 'click #invoice_last_month': 'onclick_invoice_last_month',
+ 'click #invoice_last_year': 'onclick_invoice_last_year',
+
+ 'click #onclick_banks_balance': 'onclick_bank_balance',
+
+ 'click #income_this_month': 'onclick_income_this_month',
+ 'click #income_this_year': 'onclick_income_this_year',
+ 'click #income_last_month': 'onclick_income_last_month',
+ 'click #income_last_year': 'onclick_income_last_year',
+
+ 'click #aged_payable_this_month': 'onclick_aged_payable_this_month',
+ 'click #aged_receivable_this_year': 'onclick_aged_receivable_this_year',
+ 'click #total_aged_payable': 'onclick_total_aged_payable',
+ 'click #aged_payable_this_year': 'onclick_aged_payable_this_year',
+
+ 'click #in_ex_bar_chart': 'onclick_in_ex_bar_chart',
+ 'click #aged_recevable_pie_chart': 'onclick_aged_recevable_pie_chart',
+ 'click #invoice_bar_chart': 'onclick_invoice_bar_chart',
+ 'click .overdue_line_cust': 'onclick_overdue_line_cust',
+ 'click .top_customers': 'onclick_top_customers',
+ 'click .top_customers_amount': 'onclick_top_customers_amount',
+ 'click #aged_receivable_this_month': 'onclick_aged_receivable_this_month',
+
+ 'click #bank_balance_hide': 'onclick_bank_balance_hide',
+ 'click #cash_balance_hide': 'onclick_cash_balance_hide',
+ 'click #in_ex_hide': 'onclick_in_ex_hide',
+ 'click #aged_payable_hide': 'onclick_aged_payable_hide',
+ 'click #top_10_customer_this_month': 'onclick_top_10_customer_this_month',
+ 'click #top_10_customer_last_month': 'onclick_top_10_customer_last_month',
+
+ 'change #toggle-two': 'onclick_toggle_two',
+
+ },
+ onclick_toggle_two: function (ev) {
+
+
+ this.onclick_aged_payable_this_month(ev);
+ this.onclick_aged_payable_this_year(ev);
+
+ this.onclick_aged_receivable_this_month(ev);
+ this.onclick_aged_receivable_this_year(ev);
+
+ this.onclick_invoice_this_year(ev);
+ this.onclick_invoice_this_month(ev);
+
+ this.onclick_income_this_month(ev);
+ this.onclick_income_last_month(ev);
+ this.onclick_income_last_year(ev);
+ this.onclick_income_this_year(ev);
+ },
+
+ onclick_overdue_line_cust: function (ev) {
+ ev.preventDefault();
+ var data = $(ev.currentTarget).data();
+ this.do_action({
+ type: 'ir.actions.act_window',
+ res_model: 'res.partner',
+ res_id: data['userId'],
+ view_mode: 'form',
+ views: [
+ [false, 'form']
+ ],
+ })
+ },
+
+ onclick_top_customers: function (ev) {
+ ev.stopPropagation();
+ ev.preventDefault();
+ var data = $(ev.currentTarget).data();
+ this.do_action({
+ type: 'ir.actions.act_window',
+ res_model: 'res.partner',
+ res_id: data['userId'],
+ view_mode: 'tree,form',
+ target: 'current',
+ views: [
+ [false, 'tree'],
+ [false, 'form']
+ ],
+ context: {
+ create: false,
+ edit: false,
+ }
+ })
+ },
+
+ onclick_top_customers_amount: function (ev) {
+ ev.preventDefault();
+ var data = $(ev.currentTarget).data();
+ this.do_action({
+ type: 'ir.actions.act_window',
+ res_model: 'account.move',
+ res_id: data['userId'],
+ view_mode: 'list',
+
+ views: [
+ [false, 'list']
+ ],
+ name: 'Invoices',
+ domain: ['|',
+ ['type', '=', 'out_invoice'],
+ ['type', '=', 'out_refund'],
+ ['state', '=', 'posted'],
+ ['partner_id', 'child_of', data['userId'],]
+ ],
+ context: {
+ default_type: 'out_invoice',
+ type: 'out_invoice',
+ journal_type: 'sale',
+ create: false,
+ search_default_unpaid: 1,
+ }
+
+ })
+ },
+
+ onclick_prog_bar: function (ev) {
+ this.do_action({
+ type: 'ir.actions.act_window',
+ res_model: 'account.move',
+ view_mode: 'tree,form',
+ views: [
+ [false, 'list'],
+ [false, 'form']
+ ],
+ name: 'Unpaid Invoices',
+
+ domain: [
+ ['state', '=', 'posted'],
+ ['type', '=', 'out_invoice'],
+ ['invoice_payment_state', '=', 'not_paid']
+ ]
+ });
+ },
+ onclick_unreconciled_items: function (ev) {
+ this.do_action({
+ type: 'ir.actions.act_window',
+ res_model: 'account.move.line',
+ view_mode: 'tree,form',
+ target: 'new',
+ views: [
+ [false, 'list'],
+ [false, 'form']
+ ],
+ name: 'Unreconciled Payments',
+
+ domain: [
+ ['full_reconcile_id', '=', false],
+ ['balance', '!=', 0],
+ ['account_id.reconcile', '=', true]
+ ]
+ });
+ },
+
+ onclick_unreconcile_items_this_years: function (ev) {
+
+ this.do_action({
+ type: 'ir.actions.act_window',
+ res_model: 'account.move.line',
+ view_mode: 'tree,form',
+ target: 'new',
+ views: [
+ [false, 'list'],
+ [false, 'form']
+ ],
+ name: 'Unreconciled Payments',
+
+ domain: [
+ ['full_reconcile_id', '=', false],
+ ['balance', '!=', 0],
+ ['account_id.reconcile', '=', true]
+ ]
+ });
+ },
+
+ onclick_unreconcile_items_this_month: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.selected');
+ var data = $(selected[0]).data();
+
+ $('#monthly_expense').show()
+ $('#monthly_invoice').show()
+ $('#monthly_income').show()
+ $('#monthly_unreconciled').show()
+
+
+ $('#yearly_expense').hide()
+ $('#yearly_income').hide()
+ $('#yearly_invoice').hide()
+ $('#yearly_unreconciled').hide()
+ },
+
+ onclick_income_hide: function () {
+ var x = document.getElementById("income_body");
+ if (x.style.display === "none") {
+
+ x.style.display = "block";
+ } else {
+ x.style.display = "none";
+ }
+ },
+ onclick_ex_hide: function () {
+ var x = document.getElementById("ex_body");
+ if (x.style.display === "none") {
+ x.style.display = "block";
+ } else {
+ x.style.display = "none";
+ }
+ },
+ onclick_due_hide: function () {
+ var x = document.getElementById("due_body");
+
+ if (x.style.display === "none") {
+ x.style.display = "block";
+
+
+ } else {
+ x.style.display = "none";
+
+
+ }
+ },
+
+ onclick_top_10_hide: function () {
+ var x = document.getElementById("top_10_body");
+
+ if (x.style.display === "none") {
+ x.style.display = "block";
+
+
+ } else {
+ x.style.display = "none";
+
+
+ }
+ },
+
+ onclick_bank_balance_hide: function () {
+ var x = document.getElementById("bank_balance_body_hide");
+
+ if (x.style.display === "none") {
+ x.style.display = "block";
+
+
+ } else {
+ x.style.display = "none";
+
+
+ }
+ },
+ onclick_in_ex_hide: function () {
+ var x = document.getElementById("in_ex_body_hide");
+
+ if (x.style.display === "none") {
+ x.style.display = "block";
+
+
+ } else {
+ x.style.display = "none";
+
+
+ }
+ },
+
+ onclick_aged_payable_hide: function () {
+ var x = document.getElementById("aged_payable_body_hide");
+
+ if (x.style.display === "none") {
+ x.style.display = "block";
+
+
+ } else {
+ x.style.display = "none";
+
+
+ }
+ },
+
+ onclick_cash_balance_hide: function () {
+ var x = document.getElementById("cash_balance_body_hide");
+
+ if (x.style.display === "none") {
+ x.style.display = "block";
+
+
+ } else {
+ x.style.display = "none";
+
+
+ }
+ },
+
+ onclick_late_hide: function () {
+
+
+ var x = document.getElementById("late_body");
+ if (x.style.display === "none") {
+ x.style.display = "block";
+ } else {
+ x.style.display = "none";
+ }
+ },
+
+ onclick_invoice_hide: function () {
+ var x = document.getElementById("invoice_body");
+ if (x.style.display === "none") {
+ x.style.display = "block";
+ } else {
+ x.style.display = "none";
+ }
+
+ },
+
+ onclick_top_10_customer_this_month: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.income');
+ var data = $(selected[0]).data();
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+
+ rpc.query({
+ model: "account.move",
+ method: "get_top_10_customers_this_month",
+ args: [posted]
+
+ })
+ .then(function (result) {
+
+ $('#top_10_customers').hide();
+ $('#top_10_customers_last_month').hide();
+ $('#top_10_customers_this_month').show();
+ $('#top_10_customers_this_month').empty();
+
+ var due_count = 0;
+ _.forEach(result, function (x) {
+ due_count++;
+ $('#top_10_customers_this_month').append(' ' + x.customers + '
' + '' + x.amount.toFixed(2) + ' ' + currency + '
' + ' ');
+
+ });
+ })
+ },
+
+ onclick_top_10_customer_last_month: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.income');
+ var data = $(selected[0]).data();
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+ rpc.query({
+ model: "account.move",
+ method: "get_top_10_customers_last_month",
+ args: [posted]
+ })
+ .then(function (result) {
+ $('#top_10_customers').hide();
+ $('#top_10_customers_this_month').hide();
+ $('#top_10_customers_last_month').show();
+ $('#top_10_customers_last_month').empty();
+ var due_count = 0;
+ _.forEach(result, function (x) {
+ due_count++;
+ $('#top_10_customers_last_month').append('' + x.customers + '
' + '' + x.amount.toFixed(2) + ' ' + currency + '
' + ' ');
+ });
+ })
+ },
+
+ onclick_income_last_year: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.income');
+ var data = $(selected[0]).data();
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+ rpc.query({
+ model: 'account.move',
+ method: 'get_income_last_year',
+ args: [posted],
+ })
+ .then(function (result) {
+
+ $('#net_profit_this_months').hide();
+ $('#net_profit_last_month').hide();
+ $('#net_profit_last_year').show();
+ $('#net_profit_this_year').hide();
+
+ var ctx = document.getElementById("canvas").getContext('2d');
+
+ // Define the data
+ var income = result.income; // Add data values to array
+ var expense = result.expense;
+ var profit = result.profit;
+
+ var labels = result.month; // Add labels to array
+ // End Defining data
+
+ // End Defining data
+ if (window.myCharts != undefined)
+ window.myCharts.destroy();
+ window.myCharts = new Chart(ctx, {
+ //var myChart = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: labels,
+ datasets: [{
+ label: 'Income', // Name the series
+ data: income, // Specify the data values array
+ backgroundColor: '#66aecf',
+ borderColor: '#66aecf',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'bar', // Set this data to a line chart
+ fill: false
+ },
+ {
+ label: 'Expense', // Name the series
+ data: expense, // Specify the data values array
+ backgroundColor: '#6993d6',
+ borderColor: '#6993d6',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'bar', // Set this data to a line chart
+ fill: false
+ },
+ {
+ label: 'Profit/Loss', // Name the series
+ data: profit, // Specify the data values array
+ backgroundColor: '#0bd465',
+ borderColor: '#0bd465',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'line', // Set this data to a line chart
+ fill: false
+ }
+ ]
+ },
+ options: {
+ responsive: true, // Instruct chart js to respond nicely.
+ maintainAspectRatio: false, // Add to prevent default behaviour of full-width/height
+ }
+ });
+
+ })
+ },
+
+ onclick_income_last_month: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.income');
+ var data = $(selected[0]).data();
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+ rpc.query({
+ model: 'account.move',
+ method: 'get_income_last_month',
+ args: [posted],
+ })
+ .then(function (result) {
+ $('#net_profit_this_months').hide();
+ $('#net_profit_last_month').show();
+ $('#net_profit_this_year').hide();
+ $('#net_profit_last_year').hide();
+
+ var ctx = document.getElementById("canvas").getContext('2d');
+
+ // Define the data
+ var income = result.income; // Add data values to array
+ var expense = result.expense;
+ var profit = result.profit;
+
+ var labels = result.date; // Add labels to array
+ // End Defining data
+
+ // End Defining data
+ if (window.myCharts != undefined)
+ window.myCharts.destroy();
+ window.myCharts = new Chart(ctx, {
+ //var myChart = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: labels,
+ datasets: [{
+ label: 'Income', // Name the series
+ data: income, // Specify the data values array
+ backgroundColor: '#66aecf',
+ borderColor: '#66aecf',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'bar', // Set this data to a line chart
+ fill: false
+ },
+ {
+ label: 'Expense', // Name the series
+ data: expense, // Specify the data values array
+ backgroundColor: '#6993d6',
+ borderColor: '#6993d6',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'bar', // Set this data to a line chart
+ fill: false
+ },
+ {
+ label: 'Profit/Loss', // Name the series
+ data: profit, // Specify the data values array
+ backgroundColor: '#0bd465',
+ borderColor: '#0bd465',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'line', // Set this data to a line chart
+ fill: false
+ }
+ ]
+ },
+ options: {
+ responsive: true, // Instruct chart js to respond nicely.
+ maintainAspectRatio: false, // Add to prevent default behaviour of full-width/height
+ }
+ });
+
+ })
+ },
+ onclick_income_this_year: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.income');
+ var data = $(selected[0]).data();
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+
+
+ rpc.query({
+ model: 'account.move',
+ method: 'get_income_this_year',
+ args: [posted],
+
+ })
+ .then(function (result) {
+
+
+ $('#net_profit_this_months').hide();
+ $('#net_profit_last_month').hide();
+ $('#net_profit_last_year').hide();
+ $('#net_profit_this_year').show();
+
+ var ctx = document.getElementById("canvas").getContext('2d');
+
+ // Define the data
+ var income = result.income; // Add data values to array
+ var expense = result.expense;
+ var profit = result.profit;
+
+ var labels = result.month; // Add labels to array
+
+
+ if (window.myCharts != undefined)
+ window.myCharts.destroy();
+ window.myCharts = new Chart(ctx, {
+ //var myChart = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: labels,
+ datasets: [{
+ label: 'Income', // Name the series
+ data: income, // Specify the data values array
+ backgroundColor: '#66aecf',
+ borderColor: '#66aecf',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'bar', // Set this data to a line chart
+ fill: false
+ },
+ {
+ label: 'Expense', // Name the series
+ data: expense, // Specify the data values array
+ backgroundColor: '#6993d6',
+ borderColor: '#6993d6',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'bar', // Set this data to a line chart
+ fill: false
+ },
+ {
+ label: 'Profit/Loss', // Name the series
+ data: profit, // Specify the data values array
+ backgroundColor: '#0bd465',
+ borderColor: '#0bd465',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'line', // Set this data to a line chart
+ fill: false
+ }
+ ]
+ },
+ options: {
+ responsive: true, // Instruct chart js to respond nicely.
+ maintainAspectRatio: false, // Add to prevent default behaviour of full-width/height
+ }
+ });
+
+ })
+ },
+ onclick_bank_balance: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.selected');
+ var data = $(selected[0]).data();
+ var self = this;
+
+ rpc.query({
+ model: "account.move",
+ method: "bank_balance",
+ })
+ .then(function (result) {
+
+ var banks = result['banks'];
+ var balance = result['banking'];
+
+
+ $('.bank_repeat').remove();
+ $('#charts').append('' + banks + ' ' + '' + balance.toFixed(2) + ' ' + '
');
+
+
+ })
+ },
+
+
+ onclick_invoice_this_year: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.selected');
+ var data = $(selected[0]).data();
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+
+ rpc.query({
+ model: "account.move",
+ method: "get_total_invoice_current_year",
+ 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').hide();
+ $('#total_supplier_invoice_current_month').hide();
+ $('#total_customer_invoice_paid_current_month').hide();
+ $('#total_customer_invoice_current_month').hide();
+ $('#tot_invoice_current_month').hide();
+ $('#tot_supplier_inv_current_month').hide();
+
+
+ $('#total_supplier_invoice_paid_current_year').empty();
+ $('#total_supplier_invoice_current_year').empty();
+ $('#total_customer_invoice_paid_current_year').empty();
+ $('#total_customer_invoice_current_year').empty();
+ $('#tot_invoice_current_year').empty();
+ $('#tot_supplier_inv_current_year').empty();
+
+ $('#total_supplier_invoice_paid_current_year').show();
+ $('#total_supplier_invoice_current_year').show();
+ $('#total_customer_invoice_paid_current_year').show();
+ $('#total_customer_invoice_current_year').show();
+ $('#tot_invoice_current_year').show();
+ $('#tot_supplier_inv_current_year').show();
+ var tot_invoice_current_year = result[0][0]
+ var tot_credit_current_year = result[1][0]
+ var tot_supplier_inv_current_year = result[2][0]
+ var tot_supplier_refund_current_year = result[3][0]
+ var tot_customer_invoice_paid_current_year = result[4][0]
+ var tot_supplier_invoice_paid_current_year = result[5][0]
+ var tot_customer_credit_paid_current_year = result[6][0]
+ var tot_supplier_refund_paid_current_year = result[7][0]
+ var customer_invoice_total_current_year = (tot_invoice_current_year - tot_credit_current_year).toFixed(2)
+ var customer_invoice_paid_current_year = (tot_customer_invoice_paid_current_year - tot_customer_credit_paid_current_year).toFixed(2)
+ var invoice_percentage_current_year = ((customer_invoice_total_current_year / customer_invoice_paid_current_year) * 100).toFixed(2)
+ var supplier_invoice_total_current_year = (tot_supplier_inv_current_year - tot_supplier_refund_current_year).toFixed(2)
+ var supplier_invoice_paid_current_year = (tot_supplier_invoice_paid_current_year - tot_supplier_refund_paid_current_year).toFixed(2)
+ var supplier_percentage_current_year = ((supplier_invoice_total_current_year / supplier_invoice_paid_current_year) * 100).toFixed(2)
+
+ $('#tot_supplier_inv_current_year').attr("value", supplier_invoice_paid_current_year);
+ $('#tot_supplier_inv_current_year').attr("max", supplier_invoice_total_current_year);
+
+ $('#tot_invoice_current_year').attr("value", customer_invoice_paid_current_year);
+ $('#tot_invoice_current_year').attr("max", customer_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
');
+
+ $('#total_supplier_invoice_paid_current_year').append('' + '' + supplier_invoice_paid_current_year + ' Total Paid
');
+ $('#total_supplier_invoice_current_year').append('' + '' + supplier_invoice_total_current_year + ' Total Invoice
');
+
+ })
+ },
+ onclick_invoice_this_month: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.selected');
+ var data = $(selected[0]).data();
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+ 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();
+ 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]
+ var tot_supplier_refund_current_month = result[3][0]
+ var tot_customer_invoice_paid_current_month = result[4][0]
+ var tot_supplier_invoice_paid_current_month = result[5][0]
+ var tot_customer_credit_paid_current_month = result[6][0]
+ var tot_supplier_refund_paid_current_month = result[7][0]
+ var customer_invoice_total_current_month = (tot_invoice_current_month - tot_credit_current_month).toFixed(2)
+ var customer_invoice_paid_current_month = (tot_customer_invoice_paid_current_month - tot_customer_credit_paid_current_month).toFixed(2)
+ var invoice_percentage_current_month = ((customer_invoice_total_current_month / customer_invoice_paid_current_month) * 100).toFixed(2)
+ var supplier_invoice_total_current_month = (tot_supplier_inv_current_month - tot_supplier_refund_current_month).toFixed(2)
+ var supplier_invoice_paid_current_month = (tot_supplier_invoice_paid_current_month - tot_supplier_refund_paid_current_month).toFixed(2)
+ var supplier_percentage_current_month = ((supplier_invoice_total_current_month / supplier_invoice_paid_current_month) * 100).toFixed(2)
+
+ $('#tot_supplier_inv_current_month').attr("value", supplier_invoice_paid_current_month);
+ $('#tot_supplier_inv_current_month').attr("max", supplier_invoice_total_current_month);
+
+ $('#tot_invoice_current_month').attr("value", customer_invoice_paid_current_month);
+ $('#tot_invoice_current_month').attr("max", customer_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
');
+
+ $('#total_supplier_invoice_paid_current_month').append('' + '' + supplier_invoice_paid_current_month + ' Total Paid
');
+ $('#total_supplier_invoice_current_month').append('' + '' + supplier_invoice_total_current_month + ' Total Invoice
');
+
+ })
+ },
+
+ onclick_income_this_month: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.income');
+ var data = $(selected[0]).data();
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+ rpc.query({
+ model: 'account.move',
+ method: 'get_income_this_month',
+ args: [posted],
+
+ })
+ .then(function (result) {
+
+
+ var ctx = document.getElementById("canvas").getContext('2d');
+
+ // Define the data
+ var income = result.income; // Add data values to array
+ var expense = result.expense;
+ var profit = result.profit;
+
+ var labels = result.date; // Add labels to array
+ // End Defining data
+
+ // End Defining data
+ if (window.myCharts != undefined)
+ window.myCharts.destroy();
+ window.myCharts = new Chart(ctx, {
+ //var myChart = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: labels,
+ datasets: [{
+ label: 'Income', // Name the series
+ data: income, // Specify the data values array
+ backgroundColor: '#66aecf',
+ borderColor: '#66aecf',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'bar', // Set this data to a line chart
+ fill: false
+ },
+ {
+ label: 'Expense', // Name the series
+ data: expense, // Specify the data values array
+ backgroundColor: '#6993d6',
+ borderColor: '#6993d6',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'bar', // Set this data to a line chart
+ fill: false
+ },
+ {
+ label: 'Profit/Loss', // Name the series
+ data: profit, // Specify the data values array
+ backgroundColor: '#0bd465',
+ borderColor: '#0bd465',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'line', // Set this data to a line chart
+ fill: false
+ }
+ ]
+ },
+ options: {
+ responsive: true, // Instruct chart js to respond nicely.
+ maintainAspectRatio: false, // Add to prevent default behaviour of full-width/height
+ }
+ });
+
+ })
+ },
+
+ onclick_aged_recevable_pie_chart: function () {
+
+ document.getElementById("aged_recevable_pie_chart").style.color = "gray";
+
+ $('#aged_recevable_pie_chart').addClass("expense");
+
+ rpc.query({
+ model: "account.move",
+ method: "get_latebills",
+ })
+ .then(function (result) {
+
+ $(document).ready(function () {
+ var options = {
+ // legend: false,
+ responsive: true,
+ legend: {
+ position: 'bottom'
+ }
+ };
+
+ if (window.donuts != undefined)
+ window.donuts.destroy();
+
+ window.donuts = new Chart($("#horizontalbarChart"), {
+ type: 'doughnut',
+ tooltipFillColor: "rgba(51, 51, 51, 0.55)",
+ data: {
+ labels: result.bill_partner,
+ datasets: [{
+ data: result.bill_amount,
+ backgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ],
+ hoverBackgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ]
+ }]
+ },
+ options: {
+ responsive: false
+ }
+ });
+ });
+
+
+ })
+ },
+ onclick_in_ex_bar_chart: function (ev) {
+ document.getElementById("in_ex_bar_chart").style.color = "gray";
+ $('#in_ex_bar_chart').addClass("expense");
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+
+ rpc.query({
+ model: "account.move",
+ method: "get_income_this_year",
+ args: [posted],
+ })
+ .then(function (result) {
+
+
+ var ctx = document.getElementById("canvas").getContext('2d');
+
+ $('#net_profit_this_months').hide();
+ $('#net_profit_last_month').hide();
+ $('#net_profit_last_year').hide();
+ $('#net_profit_this_year').show();
+ // Define the data
+ var income = result.income; // Add data values to array
+ var expense = result.expense;
+ var profit = result.profit;
+
+ var labels = result.month; // Add labels to array
+ // End Defining data
+
+ // End Defining data
+ if (window.myCharts != undefined)
+ window.myCharts.destroy();
+ window.myCharts = new Chart(ctx, {
+ //var myChart = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: labels,
+ datasets: [{
+ label: 'Income', // Name the series
+ data: income, // Specify the data values array
+ backgroundColor: '#66aecf',
+ borderColor: '#66aecf',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'bar', // Set this data to a line chart
+ fill: false
+ },
+ {
+ label: 'Expense', // Name the series
+ data: expense, // Specify the data values array
+ backgroundColor: '#6993d6',
+ borderColor: '#6993d6',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'bar', // Set this data to a line chart
+ fill: false
+ },
+ {
+ label: 'Profit/Loss', // Name the series
+ data: profit, // Specify the data values array
+ backgroundColor: '#0bd465',
+ borderColor: '#0bd465',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'line', // Set this data to a line chart
+ fill: false
+ }
+ ]
+ },
+ options: {
+ responsive: true, // Instruct chart js to respond nicely.
+ maintainAspectRatio: false, // Add to prevent default behaviour of full-width/height
+ }
+ });
+
+
+ })
+ },
+ onclick_aged_payable_this_month: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.expense');
+ var data = $(selected[0]).data();
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+ rpc.query({
+ model: 'account.move',
+ method: 'get_overdues_this_month',
+ args: [posted],
+ })
+ .then(function (result) {
+
+ // Doughnut Chart
+ $(document).ready(function () {
+ var options = {
+ // legend: false,
+ responsive: false
+ };
+ if (window.donut != undefined)
+ window.donut.destroy();
+
+
+ window.donut = new Chart($("#canvas1"), {
+ type: 'doughnut',
+ tooltipFillColor: "rgba(51, 51, 51, 0.55)",
+ data: {
+ labels: result.due_partner,
+ datasets: [{
+ data: result.due_amount,
+ backgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ],
+ hoverBackgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ]
+ }]
+ },
+ options: {
+ responsive: false
+ }
+ });
+ });
+ // Doughnut Chart
+
+ })
+ },
+ onclick_total_aged_payable: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.expense');
+ var data = $(selected[0]).data();
+
+ rpc.query({
+ model: 'account.move',
+ method: 'get_overdues',
+ })
+ .then(function (result) {
+ // Doughnut Chart
+ $(document).ready(function () {
+ var options = {
+ // legend: false,
+ responsive: false
+ };
+
+
+ if (window.donut != undefined)
+ window.donut.destroy();
+
+
+ window.donut = new Chart($("#canvas1"), {
+ type: 'doughnut',
+ tooltipFillColor: "rgba(51, 51, 51, 0.55)",
+ data: {
+ labels: result.due_partner,
+ datasets: [{
+ data: result.due_amount,
+ backgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ],
+ hoverBackgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ]
+ }]
+ },
+ options: {
+ responsive: false
+ }
+ });
+ });
+ })
+
+ },
+ onclick_aged_payable_this_year: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.expense');
+ var data = $(selected[0]).data();
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+ rpc.query({
+ model: 'account.move',
+ method: 'get_overdues_this_year',
+ args: [posted],
+ })
+ .then(function (result) {
+ // Doughnut Chart
+ $(document).ready(function () {
+ var options = {
+ // legend: false,
+ responsive: false
+ };
+ if (window.donut != undefined)
+ window.donut.destroy();
+
+
+ window.donut = new Chart($("#canvas1"), {
+ type: 'doughnut',
+ tooltipFillColor: "rgba(51, 51, 51, 0.55)",
+ data: {
+ labels: result.due_partner,
+ datasets: [{
+ data: result.due_amount,
+ backgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ],
+ hoverBackgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ]
+ }]
+ },
+ options: {
+ responsive: false
+ }
+ });
+ });
+ // Doughnut Chart
+ })
+ },
+ onclick_aged_receivable_this_year: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.expense');
+ var data = $(selected[0]).data();
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+ rpc.query({
+ model: 'account.move',
+ method: 'get_latebills_this_year',
+ args: [posted],
+ })
+ .then(function (result) {
+
+ $(document).ready(function () {
+ var options = {
+ // legend: false,
+ responsive: true,
+ legend: {
+ position: 'bottom'
+ }
+ };
+
+
+ if (window.donuts != undefined)
+ window.donuts.destroy();
+
+
+ window.donuts = new Chart($("#horizontalbarChart"), {
+ type: 'doughnut',
+ tooltipFillColor: "rgba(51, 51, 51, 0.55)",
+ data: {
+ labels: result.bill_partner,
+ datasets: [{
+ data: result.bill_amount,
+ backgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ],
+ hoverBackgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ]
+ }]
+ },
+ options: {
+ responsive: false
+ }
+ });
+ });
+
+
+ })
+ },
+
+ onclick_aged_receivable_this_month: function (ev) {
+ ev.preventDefault();
+ var selected = $('.btn.btn-tool.expense');
+ var data = $(selected[0]).data();
+ var posted = false;
+ if ($('#toggle-two')[0].checked == true) {
+ posted = "posted"
+ }
+ rpc.query({
+ model: 'account.move',
+ method: 'get_latebills_this_month',
+ args: [posted],
+
+ })
+ .then(function (result) {
+ function myFunction() {
+ document.getElementByClass("btn btn-tool dropdown-toggle").text
+ document.getElementById("aged_receivable_this_month").text
+ }
+
+ $(document).ready(function () {
+ var options = {
+ // legend: false,
+ responsive: true,
+ legend: {
+ position: 'bottom'
+ }
+ };
+
+
+ if (window.donuts != undefined)
+ window.donuts.destroy();
+
+
+ window.donuts = new Chart($("#horizontalbarChart"), {
+ type: 'doughnut',
+ tooltipFillColor: "rgba(51, 51, 51, 0.55)",
+ data: {
+ labels: result.bill_partner,
+ datasets: [{
+ data: result.bill_amount,
+ backgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ],
+ hoverBackgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ]
+ }]
+ },
+ options: {
+ responsive: false
+ }
+ });
+ });
+
+
+ })
+ },
+ renderElement: function (ev) {
+ $.when(this._super())
+ .then(function (ev) {
+
+
+ $('#toggle-two').bootstrapToggle({
+ on: 'View All Entries',
+ off: 'View Posted Entries'
+ });
+
+
+ var posted = false;
+ 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_income_this_month",
+ args: [posted],
+ })
+ .then(function (result) {
+
+
+ var ctx = document.getElementById("canvas").getContext('2d');
+
+ // Define the data
+ var income = result.income; // Add data values to array
+ var expense = result.expense;
+ var profit = result.profit;
+
+ var labels = result.date; // Add labels to array
+ // End Defining data
+
+ // End Defining data
+ if (window.myCharts != undefined)
+ window.myCharts.destroy();
+ window.myCharts = new Chart(ctx, {
+ //var myChart = new Chart(ctx, {
+ type: 'bar',
+ data: {
+ labels: labels,
+ datasets: [{
+ label: 'Income', // Name the series
+ data: income, // Specify the data values array
+ backgroundColor: '#66aecf',
+ borderColor: '#66aecf',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'bar', // Set this data to a line chart
+ fill: false
+ },
+ {
+ label: 'Expense', // Name the series
+ data: expense, // Specify the data values array
+ backgroundColor: '#6993d6',
+ borderColor: '#6993d6',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'bar', // Set this data to a line chart
+ fill: false
+ },
+ {
+ label: 'Profit/Loss', // Name the series
+ data: profit, // Specify the data values array
+ backgroundColor: '#0bd465',
+ borderColor: '#0bd465',
+
+ borderWidth: 1, // Specify bar border width
+ type: 'line', // Set this data to a line chart
+ fill: false
+ }
+ ]
+ },
+ options: {
+ responsive: true, // Instruct chart js to respond nicely.
+ maintainAspectRatio: false, // Add to prevent default behaviour of full-width/height
+ }
+ });
+
+ })
+
+ rpc.query({
+ model: 'account.move',
+ method: 'get_overdues_this_month',
+ args: [posted],
+ }).then(function (result) {
+
+ //
+ })
+ rpc.query({
+ model: 'account.move',
+ method: 'get_overdues_this_month',
+ args: [posted],
+ })
+ .then(function (result) {
+ // Doughnut Chart
+ $(document).ready(function () {
+ var options = {
+ // legend: false,
+ responsive: true,
+ legend: {
+ position: 'bottom'
+ }
+ };
+ if (window.donut != undefined)
+ window.donut.destroy();
+ window.donut = new Chart($("#canvas1"), {
+ type: 'doughnut',
+ tooltipFillColor: "rgba(51, 51, 51, 0.55)",
+ data: {
+ labels: result.due_partner,
+ datasets: [{
+ data: result.due_amount,
+ backgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ],
+ hoverBackgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ]
+ }]
+ },
+ options: {
+ responsive: false
+ }
+ });
+ });
+ })
+ 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();
+
+
+ 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]
+ var tot_supplier_refund_current_month = result[3][0]
+ var tot_customer_invoice_paid_current_month = result[4][0]
+ var tot_supplier_invoice_paid_current_month = result[5][0]
+ var tot_customer_credit_paid_current_month = result[6][0]
+ var tot_supplier_refund_paid_current_month = result[7][0]
+ var customer_invoice_total_current_month = (tot_invoice_current_month - tot_credit_current_month).toFixed(2)
+ var customer_invoice_paid_current_month = (tot_customer_invoice_paid_current_month - tot_customer_credit_paid_current_month).toFixed(2)
+ var invoice_percentage_current_month = ((customer_invoice_total_current_month / customer_invoice_paid_current_month) * 100).toFixed(2)
+ var supplier_invoice_total_current_month = (tot_supplier_inv_current_month - tot_supplier_refund_current_month).toFixed(2)
+ var supplier_invoice_paid_current_month = (tot_supplier_invoice_paid_current_month - tot_supplier_refund_paid_current_month).toFixed(2)
+ var supplier_percentage_current_month = ((supplier_invoice_total_current_month / supplier_invoice_paid_current_month) * 100).toFixed(2)
+
+ $('#tot_supplier_inv_current_month').attr("value", supplier_invoice_paid_current_month);
+ $('#tot_supplier_inv_current_month').attr("max", supplier_invoice_total_current_month);
+
+ $('#tot_invoice_current_month').attr("value", customer_invoice_paid_current_month);
+ $('#tot_invoice_current_month').attr("max", customer_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
');
+
+ $('#total_supplier_invoice_paid_current_month').append('' + '' + supplier_invoice_paid_current_month + ' Total Paid
');
+ $('#total_supplier_invoice_current_month').append('' + '' + supplier_invoice_total_current_month + ' Total Invoice
');
+
+ })
+ rpc.query({
+ model: 'account.move',
+ method: 'get_latebills_this_month',
+ args: [posted],
+ })
+ .then(function (result) {
+
+ $(document).ready(function () {
+ var options = {
+ // legend: false,
+ responsive: true,
+ legend: {
+ position: 'bottom'
+ }
+ };
+ if (window.donuts != undefined)
+ window.donuts.destroy();
+ window.donuts = new Chart($("#horizontalbarChart"), {
+ type: 'doughnut',
+ tooltipFillColor: "rgba(51, 51, 51, 0.55)",
+ data: {
+ labels: result.bill_partner,
+ datasets: [{
+ data: result.bill_amount,
+ backgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ],
+ hoverBackgroundColor: [
+ '#66aecf ', '#6993d6 ', '#666fcf', '#7c66cf', '#9c66cf',
+ '#bc66cf ', '#b75fcc', ' #cb5fbf ', ' #cc5f7f ', ' #cc6260',
+ '#cc815f', '#cca15f ', '#ccc25f', '#b9cf66', '#99cf66',
+ ' #75cb5f ', '#60cc6c', '#804D8000', '#80B33300', '#80CC80CC', '#f2552c', '#00cccc',
+ '#1f2e2e', '#993333', '#00cca3', '#1a1a00', '#3399ff',
+ '#8066664D', '#80991AFF', '#808E666FF', '#804DB3FF', '#801AB399',
+ '#80E666B3', '#8033991A', '#80CC9999', '#80B3B31A', '#8000E680',
+ '#804D8066', '#80809980', '#80E6FF80', '#801AFF33', '#80999933',
+ '#80FF3380', '#80CCCC00', '#8066E64D', '#804D80CC', '#809900B3',
+ '#80E64D66', '#804DB380', '#80FF4D4D', '#8099E6E6', '#806666FF'
+ ]
+ }]
+ },
+ options: {
+ responsive: false
+ }
+ });
+ });
+ })
+ rpc.query({
+ model: "account.move",
+ method: "get_overdues",
+
+ }).then(function (result) {
+ var due_count = 0;
+ _.forEach(result, function (x) {
+ due_count++;
+ $('#overdues').append('' + x.due_partner + ' ' + ' ' + '' + x.due_amount + ' ' + currency + ' ' + ' ');
+
+ // $('#overdues_amounts').append('' + x.amount + ' ' + ''+' '+currency+ ' ' + ' ' );
+
+ });
+
+ $('#due_count').append('' + due_count + ' Due(s) ');
+ })
+ rpc.query({
+ model: "account.move",
+ method: "get_top_10_customers",
+ args: [posted]
+ }).then(function (result) {
+ var due_count = 0;
+ _.forEach(result, function (x) {
+
+ $('#top_10_customers').show();
+ $('#top_10_customers_this_month').hide();
+ due_count++;
+ $('#top_10_customers').append('' + x.customers + '
' + '' + x.amount.toFixed(2) + ' ' + currency + '
' + ' ');
+
+ });
+ })
+ rpc.query({
+ model: "account.move",
+ method: "bank_balance",
+ args: [posted]
+ })
+ .then(function (result) {
+ var banks = result['banks'];
+ var balance = result['banking'];
+ for (var k = 0; k < banks.length; k++) {
+ // $('#charts').append('' + banks[k] + ' '+ ' ' + ''+ balance[k] +' ' + ' ' );
+ $('#current_bank_balance').append('' + banks[k] + '
' + balance[k].toFixed(2) + ' ' + currency + '
');
+ // $('#current_bank_balance').append('' + banks[k] +' '+ balance[k] + ' ' );
+ $('#drop_charts_balance').append('' + balance[k].toFixed(2) + ' ');
+ }
+ })
+
+ rpc.query({
+ model: "account.move",
+ method: "get_latebills",
+
+ }).then(function (result) {
+ var late_count = 0;
+
+ _.forEach(result, function (x) {
+ late_count++;
+ $('#latebills').append('' + x.partner + '' + x.amount + ' ' + currency + ' ' + ' ' + ' ');
+ });
+ $('#late_count').append('' + late_count + ' Late(s) ');
+ })
+ rpc.query({
+ model: "account.move",
+ method: "get_total_invoice",
+ })
+ .then(function (result) {
+ var total_invoice = result[0].sum;
+ total_invoice = total_invoice
+ $('#total_invoice').append('' + total_invoice + ' ' + currency + ' ')
+ })
+ rpc.query({
+ model: "account.move",
+ method: "get_total_invoice_this_month",
+ args: [posted],
+ })
+ .then(function (result) {
+ var invoice_this_month = result[0].sum;
+ if (invoice_this_month) {
+ var total_invoices_this_month = invoice_this_month.toFixed(2)
+ $('#total_invoices_').append('' + total_invoices_this_month + ' ' + currency + ' This month
')
+ }
+ })
+
+ rpc.query({
+ model: "account.move",
+ method: "get_total_invoice_last_month",
+ })
+ .then(function (result) {
+ var invoice_last_month = result[0].sum;
+ var total_invoices_last_month = invoice_last_month
+ $('#total_invoices_last').append('' + total_invoices_last_month + ' ' + currency + ' Last month
')
+ })
+
+ rpc.query({
+ model: "account.move",
+ method: "unreconcile_items"
+ })
+ .then(function (result) {
+
+ var unreconciled_count = result[0].count;
+
+ $('#unreconciled_items').append('' + unreconciled_count + ' Item(s) ')
+ })
+ rpc.query({
+ model: "account.move",
+ method: "unreconcile_items_this_month",
+ args: [posted],
+ })
+ .then(function (result) {
+ var unreconciled_counts_ = result[0].count;
+ $('#unreconciled_items_').append('' + unreconciled_counts_ + ' Item(s) This month
')
+ })
+ rpc.query({
+ model: "account.move",
+ method: "unreconcile_items_this_year",
+ args: [posted],
+ })
+ .then(function (result) {
+
+ var unreconciled_counts_this_year = result[0].count;
+
+ $('#unreconciled_counts_this_year').append('' + unreconciled_counts_this_year + ' Item(s) This Year
')
+ // $('#unreconciled_counts_this_year').append('' + unreconciled_counts_this_year + ' Item(s) This Year
')
+ })
+
+ rpc.query({
+ model: "account.move",
+ method: "unreconcile_items_last_year"
+ })
+ .then(function (result) {
+ var unreconciled_counts_last_year = result[0].count;
+
+ $('#unreconciled_counts_last_year').append('' + unreconciled_counts_last_year + ' Item(s) Last Year
')
+
+ })
+ rpc.query({
+ model: "account.move",
+ method: "month_income"
+ })
+ .then(function (result) {
+ var income = result[0].debit - result[0].credit;
+ income = -income;
+
+ $('#total_income').append('' + income.toFixed(2) + ' ' + currency + ' ')
+ })
+ rpc.query({
+ model: "account.move",
+ method: "month_income_this_month",
+ args: [posted],
+ })
+ .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
')
+
+ } else {
+ incomes_ = -incomes_.toFixed(2);
+ $('#total_incomes_').append('' + 0.0 + ' ' + currency + ' This month
')
+ }
+ })
+
+ rpc.query({
+ model: "account.move",
+ method: "month_income_last_month"
+ })
+ .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
')
+ })
+
+ rpc.query({
+ model: "account.move",
+ method: "month_expense"
+ })
+ .then(function (result) {
+ var expense = result[0].debit - result[0].credit;
+ var expenses = expense.toFixed()
+ $('#total_expense').append('' + expenses + ' ' + currency + ' ')
+ })
+ rpc.query({
+ model: "account.move",
+ method: "month_expense_this_month",
+ args: [posted],
+ }).then(function (result) {
+ 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
')
+ } else {
+ var expenses_this_month_ = expense_this_month.toFixed(2)
+ $('#total_expenses_').append('' + 0.0 + ' ' + currency + ' This month
')
+
+ }
+ })
+ rpc.query({
+ model: "account.move",
+ method: "month_expense_this_year",
+ args: [posted],
+ }).then(function (result) {
+ 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
')
+ } else {
+ var expenses_this_year_ = expense_this_year.toFixed(2)
+
+ $('#total_expense_this_year').append('' + 0.0 + ' ' + currency + ' This Year
')
+ }
+ })
+ rpc.query({
+ model: "account.move",
+ method: "month_income_last_year"
+ })
+ .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
')
+ })
+ rpc.query({
+ model: "account.move",
+ method: "month_income_this_year",
+ args: [posted],
+ })
+ .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
')
+ } else {
+ incomes_this_year = -incomes_this_year.toFixed(2);
+ $('#total_incomes_this_year').append('' + 0.0 + '' + currency + ' This Year
')
+ }
+
+ })
+
+ rpc.query({
+ model: "account.move",
+ method: "profit_income_this_month",
+ args: [posted],
+ }).then(function (result) {
+ var net_profit = true
+ if (result[1] == undefined) {
+ result[1] = 0;
+ if ((result[0]) > (result[1])) {
+ net_profit = result[1] - result[0]
+ }
+
+ }
+
+ if (result[0] == undefined) {
+
+ result[0] = 0;
+ }
+
+ if ((-result[1]) > (result[0])) {
+ net_profit = -result[1] - result[0]
+ } else if ((result[1]) > (result[0])) {
+ net_profit = -result[1] - result[0]
+ } else {
+ net_profit = -result[1] - result[0]
+ }
+ var profit_this_months = net_profit;
+ if (profit_this_months) {
+ var net_profit_this_months = profit_this_months.toFixed(2)
+ $('#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
')
+
+ } else {
+ var net_profit_this_months = profit_this_months.toFixed(2)
+ $('#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
')
+ }
+ })
+
+ rpc.query({
+ model: "account.move",
+ method: "profit_income_this_year",
+ args: [posted],
+ })
+ .then(function (result) {
+ var net_profit = true
+
+
+ if (result[1] == undefined) {
+ result[1] = 0;
+ if ((result[0]) > (result[1])) {
+ net_profit = result[1] - result[0]
+ }
+
+ }
+
+ if (result[0] == undefined) {
+
+ result[0] = 0;
+ }
+
+ if ((-result[1]) > (result[0])) {
+ net_profit = -result[1] - result[0]
+ } else if ((result[1]) > (result[0])) {
+ net_profit = -result[1] - result[0]
+ } 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)
+ $('#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
')
+ } else {
+ var net_profit_this_year = profit_this_year.toFixed(2)
+ $('#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
')
+
+ }
+ })
+ });
+ },
+ willStart: function () {
+ var self = this;
+ self.drpdn_show = false;
+ return Promise.all([ajax.loadLibs(this), this._super()]);
+ },
+ });
+ core.action_registry.add('invoice_dashboard', ActionMenu);
+
+});
\ No newline at end of file
diff --git a/base_accounting_kit/static/src/scss/style.scss b/base_accounting_kit/static/src/scss/style.scss
new file mode 100644
index 000000000..db807ed34
--- /dev/null
+++ b/base_accounting_kit/static/src/scss/style.scss
@@ -0,0 +1,1164 @@
+.accounts-dashboard-wrap svg.ct-chart-bar,
+.accounts-dashboard-wrap svg.ct-chart-line {
+ overflow: visible;
+}
+
+.accounts-dashboard-wrap .ct-label.ct-vertical.ct-start {
+ color: black !important;
+}
+
+.accounts-dashboard-wrap .ct-label.ct-label.ct-horizontal.ct-end {
+ position: relative;
+ justify-content: flex-end;
+ text-align: right;
+ transform-origin: 100%;
+ color: black;
+ transform: translate(-100%) rotate(-45deg);
+ white-space: nowrap;
+}
+
+
+
+
+.accounts-dashboard-wrap .ct-series-e .ct-slice-pie {
+ fill: #7b2138 !important;
+}
+
+.accounts-dashboard-wrap .ct-series-a .ct-bar,
+.accounts-dashboard-wrap .ct-series-a .ct-line,
+.accounts-dashboard-wrap .ct-series-a .ct-point,
+.accounts-dashboard-wrap .ct-series-a .ct-slice-donut,
+.accounts-dashboard-wrap .ct-series-a .ct-slice-pie {
+ stroke: #009f9d !important;
+}
+
+
+.accounts-dashboard-wrap h4 {
+ padding-left: 20px !important;
+ padding-top: 10px !important;
+}
+
+
+
+
+.accounts-dashboard-wrap .users-list>li img {
+ border-radius: 50%;
+ height: auto;
+ max-width: 100%;
+}
+
+.accounts-dashboard-wrap .badge-danger {
+ width: 50px;
+ height: 20px;
+ color: #fff;
+ background-color: #dc3545;
+}
+
+.accounts-dashboard-wrap .card-header>.card-tools {
+ float: right;
+ margin-right: -.625rem;
+}
+
+
+.accounts-dashboard-wrap .card {
+ box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
+ margin-bottom: 1rem;
+}
+
+.accounts-dashboard-wrap .card-title {
+ float: left;
+ font-size: 1.1rem;
+ font-weight: 400;
+ margin: 0;
+ text-transform: uppercase;
+}
+
+.accounts-dashboard-wrap .col,
+.accounts-dashboard-wrap .col-1,
+.accounts-dashboard-wrap .col-10,
+.accounts-dashboard-wrap .col-11,
+.accounts-dashboard-wrap .col-12,
+.accounts-dashboard-wrap .col-2,
+.accounts-dashboard-wrap .col-3,
+.accounts-dashboard-wrap .col-4,
+.accounts-dashboard-wrap .col-5,
+.accounts-dashboard-wrap .col-6,
+.accounts-dashboard-wrap .col-7,
+.accounts-dashboard-wrap .col-8,
+.accounts-dashboard-wrap .col-9,
+.accounts-dashboard-wrap .col-auto,
+.accounts-dashboard-wrap .col-lg,
+.accounts-dashboard-wrap .col-lg-1,
+.accounts-dashboard-wrap .col-lg-10,
+.accounts-dashboard-wrap .col-lg-11,
+.accounts-dashboard-wrap .col-lg-12,
+.accounts-dashboard-wrap .col-lg-2,
+.accounts-dashboard-wrap .col-lg-3,
+.accounts-dashboard-wrap .col-lg-4,
+.accounts-dashboard-wrap .col-lg-5,
+.accounts-dashboard-wrap .col-lg-6,
+.col-lg-7,
+.col-lg-8,
+.col-lg-9,
+.col-lg-auto,
+.col-md,
+.col-md-1,
+.col-md-10,
+.col-md-11,
+.col-md-2,
+.col-md-3,
+.col-md-4,
+.col-md-5,
+.col-md-6,
+.col-md-7,
+.col-md-8,
+.col-md-9,
+.col-md-auto,
+.col-sm,
+.col-sm-1,
+.col-sm-10,
+.col-sm-11,
+.col-sm-12,
+.col-sm-2,
+.col-sm-3,
+.col-sm-4,
+.col-sm-5,
+.col-sm-6,
+.col-sm-7,
+.col-sm-8,
+.col-sm-9,
+.col-sm-auto,
+.col-xl,
+.col-xl-1,
+.col-xl-10,
+.col-xl-11,
+.col-xl-12,
+.col-xl-2,
+.col-xl-3,
+.col-xl-4,
+.col-xl-5,
+.col-xl-6,
+.col-xl-7,
+.col-xl-8,
+.col-xl-9,
+.col-xl-auto {
+ position: relative;
+ width: 100%;
+ padding-right: 7.5px;
+ padding-left: 7.5px;
+}
+
+
+.accounts-dashboard-wrap .card-header {
+ background-color:
+ transparent;
+ border-bottom: 1px solid rgba(0, 0, 0, .125);
+ padding: .75rem 1.25rem;
+ position: relative;
+ border-top-left-radius: .25rem;
+ border-top-right-radius: .25rem;
+}
+
+
+.accounts-dashboard-wrap .fa:hover {
+ -ms-transform: scale(1.5);
+ /* IE 9 */
+ -webkit-transform: scale(1.5);
+ /* Safari 3-8 */
+ transform: scale(1.5);
+}
+
+.accounts-dashboard-wrap .card-header>.card-tools {
+ float: right;
+ margin-right: -.625rem;
+}
+
+.accounts-dashboard-wrap .right {
+ float: left;
+}
+
+.accounts-dashboard-wrap .tooltip:hover .tooltiptext {
+ visibility: visible;
+}
+
+
+.accounts-dashboard-wrap .col-6 {
+ -ms-flex: 0 0 50%;
+ flex: 0 0 50%;
+ max-width: 50%;
+}
+
+.accounts-dashboard-wrap .fa-cog {
+ content: "\f013"
+}
+
+.accounts-dashboard-wrap .fa,
+.fas {
+ font-weight: 900;
+}
+
+.accounts-dashboard-wrap .fa,
+.accounts-dashboard-wrap .fab,
+.accounts-dashboard-wrap .fad,
+.accounts-dashboard-wrap .fal,
+.accounts-dashboard-wrap .far,
+.accounts-dashboard-wrap .fas {
+ -moz-osx-font-smoothing: grayscale;
+ -webkit-font-smoothing: antialiased;
+ display: inline-block;
+ font-style: normal;
+ font-variant: normal;
+ text-rendering: auto;
+ line-height: 1;
+}
+
+.accounts-dashboard-wrap .info-box .info-box-icon {
+
+ border-radius: .25rem;
+ -ms-flex-align: center;
+ align-items: center;
+ display: -ms-flexbox;
+ display: flex;
+ font-size: 1.875rem;
+ -ms-flex-pack: center;
+ justify-content: center;
+ text-align: center;
+ width: 70px;
+}
+
+.accounts-dashboard-wrap .info-box {
+
+
+ box-shadow: 0 0 1px rgba(0, 0, 0, .125), 0 1px 3px rgba(0, 0, 0, .2);
+ border-radius: .25rem;
+ background: #fff;
+ display: -ms-flexbox;
+ display: flex;
+ margin-bottom: 1rem;
+ min-height: 80px;
+ padding: .5rem;
+ position: relative;
+}
+
+.accounts-dashboard-wrap .o_datepicker .o_datepicker_input {
+ width: 100%;
+ cursor: pointer;
+}
+
+.accounts-dashboard-wrap #overdue {
+ width: 100%;
+ cursor: pointer;
+}
+
+.accounts-dashboard-wrap .o_input {
+ border: 1px solid #cfcfcf;
+ border-top-style: none;
+ border-right-style: none;
+ border-left-style: none;
+}
+
+
+.accounts-dashboard-wrap .in_graph {
+ padding-left: 90px;
+ height: auto;
+ padding-bottom: 65px;
+ text-align: center !important;
+}
+
+
+.accounts-dashboard-wrap .oh_dashboards {
+ padding-top: 15px;
+ background-color: #f8faff !important;
+}
+
+.accounts-dashboard-wrap .container-fluid.o_in_dashboard {
+ padding: 0px !important;
+}
+
+.accounts-dashboard-wrap .o_action_manager {
+ overflow-y: scroll !important;
+ max-width: 100%;
+}
+
+// new tile
+
+body {
+ background-color: #ececec;
+}
+
+.accounts-dashboard-wrap .container {
+ margin: 50px 0 0 100px;
+}
+
+.accounts-dashboard-wrap .o_dashboards {
+ color: #2a2a2a;
+ background-color: #f2f2f2 !important;
+}
+
+.accounts-dashboard-wrap .dash-header {
+
+ margin: 15px 0px 12px 0 !important;
+ display: block;
+ padding: 7px 25px 7px 0;
+ color: #0e1319;
+ font-size: 2rem;
+ font-weight: 400;
+ background-color:
+ rgba(255, 255, 255, 0.9) !important;
+ color: #212529;
+ padding: 1.5rem;
+ border-radius: 3px;
+ box-shadow: 0 0px 10px 0px rgba(0, 0, 0, 0.05) !important;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+
+}
+
+.accounts-dashboard-wrap .dashboard-h1 {
+
+ display: block;
+ padding: 7px 25px 7px 0;
+ color: #0e1319;
+ font-size: 2rem;
+ font-weight: 400;
+ color:
+
+ #212529;
+ float: left;
+ margin-bottom: 0;
+
+}
+
+.accounts-dashboard-wrap .card {
+ position: relative !important;
+ border-top: 0 !important;
+ margin-bottom: 30px !important;
+ width: 100% !important;
+ background-color: #ffffff !important;
+ border-radius: 0.25rem !important;
+ padding: 0px !important;
+ -webkit-transition: .5s !important;
+ transition: .5s !important;
+ display: -ms-flexbox !important;
+ display: flex !important;
+ -ms-flex-direction: column !important;
+ flex-direction: column !important;
+ box-shadow: 0 0px 10px 0px rgba(0, 0, 0, 0.05) !important;
+ border-radius: 0.25rem;
+}
+
+.accounts-dashboard-wrap .card-header {
+ border: 0;
+ padding: 0;
+}
+
+.accounts-dashboard-wrap .card-header>.card-tools {
+ float: right;
+ margin-right: 0.375rem;
+ margin-top: 5px;
+ margin-bottom: 10px;
+}
+
+.accounts-dashboard-wrap .card-header i.fa {
+ font-size: 1.3rem;
+ display: inline-block;
+ padding: 0 0px;
+ margin: 0 0px;
+ color: #57769c;
+ opacity: .8;
+ -webkit-transition: 0.3s linear;
+ transition: 0.3s linear;
+}
+
+.accounts-dashboard-wrap .dropdown-toggle::after {
+ display: inline-block;
+ margin-left: 0.255em;
+ vertical-align: 0.255em;
+ content: "";
+ border-top: 0.3em solid;
+ border-right: 0.3em solid transparent;
+ border-bottom: 0;
+ border-left: 0.3em solid transparent;
+ color: #7891af;
+}
+
+.accounts-dashboard-wrap .account-details {
+ display: flex;
+ justify-content: space-evenly;
+}
+
+.main-title {
+ color: #a3a3a3;
+ display: block;
+ margin-bottom: 5px;
+ font-size: 20px;
+ font-weight: 400;
+}
+
+.accounts-dashboard-wrap .main-title {
+ display: block;
+ margin-bottom: 5px;
+ font-size: 13px;
+ font-weight: 600;
+ color: #fff !important;
+ text-transform: uppercase;
+ padding: 1rem;
+ border-radius: 5px;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+}
+
+.accounts-dashboard-wrap .card-body {
+ background-color: rgba(255, 255, 255, 0.9) !important;
+ color: #212529;
+ padding-top: 0;
+}
+
+.accounts-dashboard-wrap .tile.wide.invoice {
+ margin-bottom: 27px;
+ -webkit-box-shadow: 1px 5px 24px 0 rgba(68, 102, 242, 0.05);
+ box-shadow: 1px 5px 24px 0 rgba(68, 102, 242, 0);
+ background-color: #ffffff;
+ border-radius: 5px;
+ position: relative;
+ width: 100%;
+ padding: 0rem 0rem;
+ border: 1px solid rgba(0, 0, 0, 0.07);
+}
+
+.accounts-dashboard-wrap .box-1 .main-title {
+ background: #67b7dc;
+ color: #fff;
+}
+
+.accounts-dashboard-wrap .box-2 .main-title {
+ background: #6794dc !important;
+ color: #fff;
+}
+
+.accounts-dashboard-wrap .box-3 .main-title {
+ background: #8067dc;
+ color: #fff;
+}
+
+.accounts-dashboard-wrap .box-4 .main-title {
+ background: #c767dc;
+ color: #fff;
+}
+
+.accounts-dashboard-wrap .count {
+ margin-bottom: 1rem;
+}
+
+.accounts-dashboard-wrap span#total_invoices_ span,
+.accounts-dashboard-wrap span#total_invoices_last span,
+.accounts-dashboard-wrap span#total_incomes_ span,
+.accounts-dashboard-wrap span#total_incomes_last span,
+.accounts-dashboard-wrap span#total_expenses_ span,
+.accounts-dashboard-wrap span#total_expense_last span,
+.accounts-dashboard-wrap span#unreconciled_items_ span,
+.accounts-dashboard-wrap span#unreconciled_items_last span,
+.accounts-dashboard-wrap span#unreconciled_counts_last_year span,
+.accounts-dashboard-wrap span#unreconciled_counts_this_year span,
+.accounts-dashboard-wrap span#total_expense_last_year span,
+.accounts-dashboard-wrap span#total_expense_this_year span,
+.accounts-dashboard-wrap span#total_incomes_last_year span,
+.accounts-dashboard-wrap span#total_incomes_this_year span,
+.accounts-dashboard-wrap span#total_invoices_last_year span,
+.accounts-dashboard-wrap span#total_invoices_this_year span,
+.accounts-dashboard-wrap span#net_profit_current_months span,
+.accounts-dashboard-wrap span#net_profit_current_year span {
+ padding-right: 8px;
+ font-size: 16px;
+ font-weight: 600;
+}
+
+.accounts-dashboard-wrap span#total_invoices_,
+.accounts-dashboard-wrap span#total_invoices_last,
+.accounts-dashboard-wrap span#total_incomes_,
+.accounts-dashboard-wrap span#total_incomes_last,
+.accounts-dashboard-wrap span#total_expenses_,
+.accounts-dashboard-wrap span#total_expense_last,
+.accounts-dashboard-wrap span#unreconciled_items_,
+.accounts-dashboard-wrap span#unreconciled_items_last,
+.accounts-dashboard-wrap span#unreconciled_counts_last_year,
+.accounts-dashboard-wrap span#unreconciled_counts_this_year,
+.accounts-dashboard-wrap span#total_expense_last_year,
+.accounts-dashboard-wrap span#total_expense_this_year,
+.accounts-dashboard-wrap span#total_incomes_last_year,
+.accounts-dashboard-wrap span#total_incomes_this_year,
+.accounts-dashboard-wrap span#total_invoices_last_year,
+.accounts-dashboard-wrap span#total_invoices_this_year,
+.accounts-dashboard-wrap span#net_profit_current_months,
+.accounts-dashboard-wrap span#net_profit_current_year {
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ flex-direction: column;
+ color: #455e7b !important;
+}
+
+.accounts-dashboard-wrap .main-title~div {
+ display: flex;
+ justify-content: space-between;
+ margin-top: 1rem;
+ padding: 1rem;
+ background: #fff;
+}
+
+.accounts-dashboard-wrap .card-header {
+ color: #0e1319 !important;
+ display: block !important;
+ padding: 1.5rem 1.5rem !important;
+ position: relative !important;
+ border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
+ border-top-left-radius: 0.25rem !important;
+ border-top-right-radius: 0.25rem !important;
+}
+
+.accounts-dashboard-wrap .card-header i.fa {
+ font-size: 1rem;
+ display: inline-block;
+ padding: 0 0px;
+ margin: 0 0px;
+ color: #57769c;
+ opacity: .8;
+ -webkit-transition: 0.3s linear;
+ transition: 0.3s linear;
+}
+
+.accounts-dashboard-wrap .card-header>.card-tools {
+ float: right;
+ margin-right: 0;
+ margin-top: 0px !important;
+ margin-bottom: 0;
+}
+
+.accounts-dashboard-wrap .card-tools .btn {
+ padding: 0 10px;
+ margin: 0;
+ line-height: normal !important;
+}
+
+.accounts-dashboard-wrap .ct-series-a .ct-bar,
+.accounts-dashboard-wrap .ct-series-a .ct-line,
+.accounts-dashboard-wrap .ct-series-a .ct-point,
+.accounts-dashboard-wrap .ct-series-a .ct-slice-donut,
+.accounts-dashboard-wrap .ct-series-a .ct-slice-pie {
+ stroke: rgb(132, 60, 247) !important;
+}
+
+.accounts-dashboard-wrap canvas#salesChart,
+.accounts-dashboard-wrap canvas#exChart {
+ display: none;
+}
+
+.accounts-dashboard-wrap ul#overdues li,
+.accounts-dashboard-wrap ul#latebills li {
+ list-style: none;
+ padding-top: 6px;
+ padding-bottom: 6px;
+ font-size: 13px;
+ color: #455e7b !important;
+ border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
+}
+
+.accounts-dashboard-wrap ul#overdues,
+.accounts-dashboard-wrap ul#latebills {
+ padding: 0;
+ padding-left: 1.5rem;
+ padding-right: 1.5rem;
+}
+
+.accounts-dashboard-wrap ul#overdues li a,
+.accounts-dashboard-wrap ul#latebills li a {
+ color: #455e7b !important;
+}
+
+.accounts-dashboard-wrap .badge-danger {
+ width: auto;
+ height: 20px;
+ color: #fff;
+ background-color: #843cf7 !important;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.accounts-dashboard-wrap .ct-label {
+ fill: rgba(0, 0, 0, .4);
+ color: rgba(0, 0, 0, .4);
+ font-size: 1.1rem !important;
+ line-height: 1;
+ font-weight: 600;
+}
+
+.accounts-dashboard-wrap .ct-label {
+ fill: rgb(255, 255, 255) !important;
+ color: rgb(255, 255, 255) !important;
+}
+
+.accounts-dashboard-wrap .chart {
+ .ct-legend {
+ position: relative;
+ z-index: 10;
+
+ li {
+ position: relative;
+ padding-left: 23px;
+ margin-bottom: 3px;
+ }
+
+ li:before {
+ width: 12px;
+ height: 12px;
+ position: absolute;
+ left: 0;
+ content: '';
+ border: 3px solid transparent;
+ border-radius: 2px;
+ }
+
+ li.inactive:before {
+ background: transparent;
+ }
+
+ &.ct-legend-inside {
+ position: absolute;
+ top: 0;
+ right: 0;
+ }
+
+ // @for $i from 0 to length($ct-series) {
+ // .ct-series-#{$i}:before {
+ // background-color: nth($ct-series, $i + 1);
+ // border-color: nth($ct-series, $i + 1);
+ // }
+ // }
+ }
+}
+
+.accounts-dashboard-wrap #chartdiv {
+ width: 100%;
+ height: 400px;
+}
+
+.accounts-dashboard-wrap #chartdiv_ex {
+ width: 100%;
+ height: 500px;
+}
+
+.accounts-dashboard-wrap #barChart {
+ display: block;
+ width: 595px;
+ height: 396px;
+ // pointer-events: none;
+
+}
+
+.accounts-dashboard-wrap .canvas-con {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ min-height: 365px;
+ position: relative;
+}
+
+/*p {
+ position: relative;
+ left: 194px;
+ margin-top: 64px;
+}*/
+
+.accounts-dashboard-wrap .canvas-con-inner {
+ height: 100%;
+}
+
+.accounts-dashboard-wrap .canvas-con-inner,
+.legend-con {
+ display: inline-block;
+}
+
+.accounts-dashboard-wrap .legend-con {
+ font-family: Roboto;
+ display: inline-block;
+
+ ul {
+ list-style: none;
+ }
+
+ li {
+ display: flex;
+ align-items: center;
+ margin-bottom: 4px;
+
+ span {
+ display: inline-block;
+ }
+
+ span.chart-legend {
+ width: 25px;
+ height: 25px;
+ margin-right: 10px;
+ }
+ }
+}
+
+html,
+body {
+ margin: 0;
+}
+
+.accounts-dashboard-wrap #canvas {
+ height: 277px !important;
+ width: 100% !important;
+}
+
+.accounts-dashboard-wrap #net_profit_this_year .title {
+ float: left;
+}
+
+.accounts-dashboard-wrap #net_profit_this_year {
+ display: flex;
+ justify-content: center;
+ align-content: center;
+ padding: .3rem;
+ background: #843cf7;
+ color: #fff;
+ border-radius: 10px;
+ width: auto !important;
+ font-weight: 600;
+ margin-bottom: 2rem;
+ margin-top: 1rem;
+ display: none !important;
+}
+
+.accounts-dashboard-wrap #net_profit_last_year .title {
+ float: left;
+}
+
+.accounts-dashboard-wrap #net_profit_last_year {
+ display: flex;
+ justify-content: center;
+ align-content: center;
+ padding: .3rem;
+ background:
+ #843cf7;
+ color:
+ #fff;
+ border-radius: 10px;
+ width: auto !important;
+ font-weight: 600;
+ margin-bottom: 2rem;
+ margin-top: 1rem;
+}
+
+.accounts-dashboard-wrap #net_profit_last_month .title {
+ float: left;
+}
+
+.accounts-dashboard-wrap #net_profit_last_month {
+ display: flex;
+ justify-content: center;
+ align-content: center;
+ padding: .3rem;
+ background:
+ #843cf7;
+ color:
+ #fff;
+ border-radius: 10px;
+ width: auto !important;
+ font-weight: 600;
+ margin-bottom: 2rem;
+ margin-top: 1rem;
+}
+
+
+.accounts-dashboard-wrap #net_profit_this_months .title {
+ float: left;
+}
+
+.accounts-dashboard-wrap #net_profit_this_months {
+ display: flex;
+ justify-content: center;
+ align-content: center;
+ padding: .3rem;
+ background:
+ #843cf7;
+ color:
+ #fff;
+ border-radius: 10px;
+ width: auto !important;
+ font-weight: 600;
+ margin-bottom: 2rem;
+ margin-top: 1rem;
+}
+
+
+
+.accounts-dashboard-wrap #col-graph .card {
+ height: 366px;
+}
+
+.accounts-dashboard-wrap #top_10_customers {
+ padding: 0;
+}
+
+.accounts-dashboard-wrap #top_10_customers li {
+ list-style: none;
+ padding-top: 6px;
+ padding-bottom: 6px;
+ font-size: 13px;
+ color: #455e7b !important;
+ border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
+ padding-left: 2rem;
+ display: flex;
+ justify-content: space-between;
+ padding-right: 2rem;
+}
+
+.accounts-dashboard-wrap #top_10_customers li a {
+ color:
+ #455e7b !important;
+}
+
+.accounts-dashboard-wrap #top_10_customers_this_month {
+ padding: 0;
+}
+
+.accounts-dashboard-wrap #top_10_customers_this_month li {
+ list-style: none;
+ padding-top: 6px;
+ padding-bottom: 6px;
+ font-size: 13px;
+ color: #455e7b !important;
+ border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
+ padding-left: 2rem;
+ display: flex;
+ justify-content: space-between;
+ padding-right: 2rem;
+}
+
+.accounts-dashboard-wrap #top_10_customers_this_month li a {
+ color:
+ #455e7b !important;
+}
+
+.accounts-dashboard-wrap #top_10_customers_last_month {
+ padding: 0;
+}
+
+.accounts-dashboard-wrap #top_10_customers_last_month li {
+ list-style: none;
+ padding-top: 6px;
+ padding-bottom: 6px;
+ font-size: 13px;
+ color: #455e7b !important;
+ border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
+ padding-left: 2rem;
+ display: flex;
+ justify-content: space-between;
+ padding-right: 2rem;
+}
+
+.accounts-dashboard-wrap #top_10_customers_last_month li a {
+ color:
+ #455e7b !important;
+}
+
+.accounts-dashboard-wrap #current_bank_balance {
+ padding: 0;
+}
+
+.accounts-dashboard-wrap #current_bank_balance li {
+
+ list-style: none;
+ padding-top: 6px;
+ padding-bottom: 6px;
+ font-size: 13px;
+ color: #455e7b !important;
+ border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
+ padding-left: 2rem;
+ display: flex;
+ justify-content: space-between;
+ padding-right: 2rem;
+
+}
+
+.accounts-dashboard-wrap #current_bank_balance li a {
+ color:
+ #455e7b !important;
+}
+
+.accounts-dashboard-wrap #current_cash_balance {
+ padding: 0;
+}
+
+.accounts-dashboard-wrap #current_cash_balance li {
+ list-style: none;
+ padding-top: 6px;
+ padding-bottom: 6px;
+ font-size: 13px;
+ color: #455e7b !important;
+ border-bottom: 1px solid rgba(0, 0, 0, 0.07) !important;
+ padding-left: 2rem;
+ display: flex;
+ justify-content: space-between;
+ padding-right: 2rem;
+}
+
+.accounts-dashboard-wrap #current_cash_balance li a {
+ color: #455e7b !important;
+
+}
+
+
+.accounts-dashboard-wrap .custom-h1 {
+ font-size: 1em;
+ margin-bottom: 0rem;
+}
+
+.accounts-dashboard-wrap .custom-h3 {
+ font-size: 1em;
+ margin: 0;
+}
+
+// Progress Bars
+.accounts-dashboard-wrap progress,
+.accounts-dashboard-wrap progress[role] {
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ appearance: none;
+ border: none;
+ background-size: auto;
+ height: 20px;
+ width: 100%;
+ background-color: #8067dc;
+}
+
+// The unordered list
+.accounts-dashboard-wrap .skill-list {
+ list-style: none;
+ margin: 0;
+ padding: 1em;
+}
+
+// The list item
+.accounts-dashboard-wrap .skill {
+ margin-bottom: 1em;
+ position: relative;
+
+ h3 {
+ color: #000;
+ left: 1em;
+ line-height: 1;
+ position: absolute;
+ top: 1em;
+ }
+
+ ::-webkit-progress-value {
+ -webkit-animation: bar-fill 2s;
+ width: 0px;
+ }
+}
+
+// Style the bar colors
+.accounts-dashboard-wrap .skill-1::-webkit-progress-value {
+ background: #c767dc;
+}
+
+.accounts-dashboard-wrap .skill-1::-moz-progress-bar {
+ background: #c767dc;
+}
+
+// Animation Keyframes
+@-webkit-keyframes bar-fill {
+ 0% {
+ width: 0;
+ }
+}
+
+@keyframes bar-fill {
+ 0% {
+ width: 0;
+ }
+}
+
+.accounts-dashboard-wrap #total_supplier_invoice {
+ color: #696969;
+}
+
+.accounts-dashboard-wrap #total_customer_invoice_names {
+ color: #696969;
+}
+
+.accounts-dashboard-wrap #total_customer_invoice {
+ color: #696969;
+}
+
+.accounts-dashboard-wrap #total_invoice_difference,
+.accounts-dashboard-wrap #total_supplier_difference {
+ color: #4ecdc4;
+}
+
+progress {
+ border: 0;
+ border-radius: 20px;
+}
+
+progress::-webkit-progress-bar {
+ border: 0;
+ border-radius: 20px;
+}
+
+progress::-webkit-progress-value {
+ border: 0;
+ border-radius: 20px;
+}
+
+progress::-moz-progress-bar {
+ border: 0;
+ border-radius: 20px;
+}
+
+.accounts-dashboard-wrap #total_customer_invoice_paid .logo,
+.accounts-dashboard-wrap #total_customer_invoice .logo,
+.accounts-dashboard-wrap #total_supplier_invoice_paid .logo,
+.accounts-dashboard-wrap #total_supplier_invoice .logo,
+.accounts-dashboard-wrap #total_customer_invoice_paid_current_year .logo,
+.accounts-dashboard-wrap #total_customer_invoice_current_year .logo,
+.accounts-dashboard-wrap #total_supplier_invoice_paid_current_year .logo,
+.accounts-dashboard-wrap #total_supplier_invoice_current_year .logo,
+.accounts-dashboard-wrap #total_customer_invoice_paid_current_month .logo,
+.accounts-dashboard-wrap #total_customer_invoice_current_month .logo,
+.accounts-dashboard-wrap #total_supplier_invoice_paid_current_month .logo,
+.accounts-dashboard-wrap #total_supplier_invoice_current_month .logo {
+
+ display: -webkit-box;
+ display: -webkit-flex;
+ display: flex;
+ justify-content: left;
+ flex-direction: column-reverse;
+ color: #455e7b !important;
+
+}
+
+.accounts-dashboard-wrap #total_customer_invoice_paid .logo span:nth-child(2),
+.accounts-dashboard-wrap #total_customer_invoice .logo span:nth-child(2),
+.accounts-dashboard-wrap #total_supplier_invoice_paid .logo span:nth-child(2),
+.accounts-dashboard-wrap #total_supplier_invoice .logo span:nth-child(2),
+.accounts-dashboard-wrap #total_customer_invoice_paid_current_year .logo span:nth-child(2),
+.accounts-dashboard-wrap #total_customer_invoice_current_year .logo span:nth-child(2),
+.accounts-dashboard-wrap #total_supplier_invoice_paid_current_year .logo span:nth-child(2),
+.accounts-dashboard-wrap #total_supplier_invoice_current_year .logo span:nth-child(2),
+.accounts-dashboard-wrap #total_customer_invoice_paid_current_month .logo span:nth-child(2),
+.accounts-dashboard-wrap #total_customer_invoice_current_month .logo span:nth-child(2),
+.accounts-dashboard-wrap #total_supplier_invoice_paid_current_month .logo span:nth-child(2),
+.accounts-dashboard-wrap #total_supplier_invoice_current_month .logo span:nth-child(2) {
+
+ font-weight: 600;
+
+}
+
+.accounts-dashboard-wrap .switch {
+ position: relative;
+ display: inline-block;
+ width: 60px;
+ height: 34px;
+}
+
+.accounts-dashboard-wrap .switch input {
+ opacity: 0;
+ width: 0;
+ height: 0;
+}
+
+.accounts-dashboard-wrap .slider {
+ position: absolute;
+ cursor: pointer;
+ top: 0;
+ left: 0;
+ right: 0;
+ bottom: 0;
+ background-color: #ccc;
+ -webkit-transition: .4s;
+ transition: .4s;
+}
+
+.accounts-dashboard-wrap .slider:before {
+ position: absolute;
+ content: "";
+ height: 26px;
+ width: 26px;
+ left: 4px;
+ bottom: 4px;
+ background-color: white;
+ -webkit-transition: .4s;
+ transition: .4s;
+}
+
+.accounts-dashboard-wrap input:checked+.slider {
+ background-color: #2196F3;
+}
+
+.accounts-dashboard-wrap input:focus+.slider {
+ box-shadow: 0 0 1px #2196F3;
+}
+
+.accounts-dashboard-wrap input:checked+.slider:before {
+ -webkit-transform: translateX(26px);
+ -ms-transform: translateX(26px);
+ transform: translateX(26px);
+}
+
+/* Rounded sliders */
+.accounts-dashboard-wrap .slider.round {
+ border-radius: 34px;
+}
+
+.accounts-dashboard-wrap .slider.round:before {
+ border-radius: 50%;
+}
+
+.accounts-dashboard-wrap .btn-primary {
+
+ color: #FFFFFF;
+ background-color: #7C7BAD;
+ border-color: #7C7BAD;
+
+}
+
+.accounts-dashboard-wrap .toggle-on.btn {
+
+ padding-right: 18px !important;
+ right: 50%;
+
+
+}
+
+.accounts-dashboard-wrap .toggle.btn.btn-default.off {
+
+ border: 1px solid #aaa;
+
+ background: #fff;
+ font-weight: 600 !important;
+
+}
+
+.accounts-dashboard-wrap .toggle-off.btn {
+
+ padding-left: 9px !important;
+
+}
+
+.accounts-dashboard-wrap .toggle {
+
+ width: 160px !important;
+ height: auto !important;
+
+}
+
+html .o_web_client>.o_action_manager {
+ overflow: auto !important;
+}
\ No newline at end of file
diff --git a/base_accounting_kit/static/src/xml/template.xml b/base_accounting_kit/static/src/xml/template.xml
new file mode 100644
index 000000000..62083cefa
--- /dev/null
+++ b/base_accounting_kit/static/src/xml/template.xml
@@ -0,0 +1,324 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Customer Invoice
+
+
+
+
+
+
+
+
+
+
+
+ Skill Level: 50%
+
+
+
+
+ Skill Level: 50%
+
+
+
+
+ Skill Level: 50%
+
+
+
+
+
Supplier Invoice
+
+
+
+
+
+
+
+
+
+
+
+ Skill Level: 50%
+
+
+
+
+ Skill Level: 50%
+
+
+
+
+ Skill Level: 50%
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/base_accounting_kit/views/assets.xml b/base_accounting_kit/views/assets.xml
new file mode 100644
index 000000000..bb8328bc8
--- /dev/null
+++ b/base_accounting_kit/views/assets.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/base_accounting_kit/views/dashboard_views.xml b/base_accounting_kit/views/dashboard_views.xml
new file mode 100644
index 000000000..fae08a7a0
--- /dev/null
+++ b/base_accounting_kit/views/dashboard_views.xml
@@ -0,0 +1,14 @@
+
+
+
+ Account Report
+ invoice_dashboard
+
+
+
+
+
+
\ No newline at end of file