|
|
@ -2,7 +2,6 @@ import time |
|
|
|
from datetime import datetime |
|
|
|
|
|
|
|
from odoo import models, api, fields |
|
|
|
from odoo.http import request |
|
|
|
FETCH_RANGE = 2000 |
|
|
|
import io |
|
|
|
import json |
|
|
@ -77,20 +76,6 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
'currency': currency, |
|
|
|
} |
|
|
|
|
|
|
|
def get_current_company_value(self): |
|
|
|
|
|
|
|
cookies_cids = [int(r) for r in request.httprequest.cookies.get('cids').split(",")] \ |
|
|
|
if request.httprequest.cookies.get('cids') \ |
|
|
|
else [request.env.user.company_id.id] |
|
|
|
for company_id in cookies_cids: |
|
|
|
if company_id not in self.env.user.company_ids.ids: |
|
|
|
cookies_cids.remove(company_id) |
|
|
|
if not cookies_cids: |
|
|
|
cookies_cids = [self.env.company.id] |
|
|
|
if len(cookies_cids) == 1: |
|
|
|
cookies_cids.append(0) |
|
|
|
return cookies_cids |
|
|
|
|
|
|
|
def get_filter(self, option): |
|
|
|
data = self.get_filter_data(option) |
|
|
|
filters = {} |
|
|
@ -122,24 +107,22 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
def get_filter_data(self, option): |
|
|
|
r = self.env['account.cash.flow'].search([('id', '=', option[0])]) |
|
|
|
default_filters = {} |
|
|
|
company = self.get_current_company_value()[0] |
|
|
|
company_id = self.env['res.company'].search([('id', '=', int(company))]) |
|
|
|
# company_id = self.env.company |
|
|
|
company_domain = [('company_id', '=', company_id.id)] |
|
|
|
company_id = self.env.companies |
|
|
|
company_domain = [('company_id', 'in', company_id.ids)] |
|
|
|
journals = r.journal_ids if r.journal_ids else self.env['account.journal'].search(company_domain) |
|
|
|
accounts = self.account_ids if self.account_ids else self.env['account.account'].search(company_domain) |
|
|
|
|
|
|
|
filter_dict = { |
|
|
|
'journal_ids': r.journal_ids.ids, |
|
|
|
'account_ids': self.account_ids.ids, |
|
|
|
'company_id': company_id.id, |
|
|
|
'company_id': company_id.ids, |
|
|
|
'date_from': r.date_from, |
|
|
|
'date_to': r.date_to, |
|
|
|
'levels': r.levels, |
|
|
|
'target_move': r.target_move, |
|
|
|
'journals_list': [(j.id, j.name, j.code) for j in journals], |
|
|
|
'accounts_list': [(a.id, a.name) for a in accounts], |
|
|
|
'company_name': company_id and company_id.name, |
|
|
|
'company_name': ', '.join(self.env.companies.mapped('name')), |
|
|
|
} |
|
|
|
filter_dict.update(default_filters) |
|
|
|
return filter_dict |
|
|
@ -147,9 +130,7 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
def _get_report_values(self, data, option): |
|
|
|
cr = self.env.cr |
|
|
|
data = self.get_filter(option) |
|
|
|
company = self.get_current_company_value()[0] |
|
|
|
company_id = self.env['res.company'].search([('id', '=', int(company))]) |
|
|
|
# company_id = self.env.company |
|
|
|
company_id = self.env.company |
|
|
|
currency = company_id.currency_id |
|
|
|
symbol = company_id.currency_id.symbol |
|
|
|
rounding = company_id.currency_id.rounding |
|
|
@ -159,27 +140,25 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
account_res = [] |
|
|
|
journal_res = [] |
|
|
|
fetched = [] |
|
|
|
|
|
|
|
account_type_id = self.env.ref('account.data_account_type_liquidity').id |
|
|
|
model = self.env.context.get('active_model') |
|
|
|
if data.get('levels') == 'summary': |
|
|
|
state = """ WHERE am.state = 'posted' """ if data.get('target_move') == 'posted' else '' |
|
|
|
state = """ AND am.state = 'posted' """ if data.get('target_move') == 'Posted' else '' |
|
|
|
state2 = ' AND aml.company_id IN %s' % str(tuple(self.env.companies.ids) + tuple([0])) |
|
|
|
query3 = """SELECT to_char(am.date, 'Month') as month_part, extract(YEAR from am.date) as year_part, |
|
|
|
sum(aml.debit) AS total_debit, sum(aml.credit) AS total_credit, |
|
|
|
sum(aml.balance) AS total_balance FROM (SELECT am.date, am.id, am.state FROM account_move as am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
|
LEFT JOIN res_company cmp ON cmp.id = am.company_id |
|
|
|
WHERE am.date BETWEEN '""" + str( |
|
|
|
data.get('date_from')) + """' and '""" + str( |
|
|
|
data.get('date_to')) + """' AND aat.id='""" + str( |
|
|
|
account_type_id) + """' AND cmp.id='""" + str( |
|
|
|
company_id.id) + """' ) am |
|
|
|
account_type_id) + """' """ + state + state2 +""") am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
|
""" + state + """GROUP BY month_part,year_part""" |
|
|
|
GROUP BY month_part,year_part""" |
|
|
|
cr = self._cr |
|
|
|
cr.execute(query3) |
|
|
|
fetched_data = cr.dictfetchall() |
|
|
@ -187,19 +166,19 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
account_type_id = self.env.ref( |
|
|
|
'account.data_account_type_liquidity').id |
|
|
|
state = """AND am.state = 'posted' """ if data.get( |
|
|
|
'target_move') == 'posted' else '' |
|
|
|
'target_move') == 'Posted' else """AND am.state in ('draft','posted') """ |
|
|
|
|
|
|
|
state2 = ' AND aml.company_id IN %s' % str(tuple(self.env.companies.ids) + tuple([0])) |
|
|
|
sql = """SELECT DISTINCT aa.id, aa.name,aa.code, sum(aml.debit) AS total_debit, |
|
|
|
sum(aml.credit) AS total_credit,sum(aml.balance) AS total_balance |
|
|
|
FROM (SELECT am.* FROM account_move as am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
|
LEFT JOIN res_company cmp ON cmp.id = am.company_id |
|
|
|
WHERE am.date BETWEEN '""" + str( |
|
|
|
data.get('date_from')) + """' and '""" + str( |
|
|
|
data.get('date_to')) + """' AND aat.id='""" + str( |
|
|
|
account_type_id) + """' AND cmp.id='""" + str( |
|
|
|
company_id.id) + """' """ + state + """) am |
|
|
|
account_type_id) + """' """ + state + state2 +""") am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
@ -211,19 +190,19 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
account_type_id = self.env.ref( |
|
|
|
'account.data_account_type_liquidity').id |
|
|
|
state = """AND am.state = 'posted' """ if data.get( |
|
|
|
'target_move') == 'posted' else '' |
|
|
|
'target_move') == 'Posted' else """AND am.state in ('draft','posted') """ |
|
|
|
|
|
|
|
state2 = ' AND aml.company_id IN %s' % str(tuple(self.env.companies.ids) + tuple([0])) |
|
|
|
sql = """SELECT DISTINCT aa.id, aa.name,aa.code, sum(aml.debit) AS total_debit, |
|
|
|
sum(aml.credit) AS total_credit,sum(aml.balance) AS total_balance |
|
|
|
FROM (SELECT am.* FROM account_move as am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
|
LEFT JOIN res_company cmp ON cmp.id = am.company_id |
|
|
|
WHERE am.date BETWEEN '""" + str( |
|
|
|
data.get('date_from')) + """' and '""" + str( |
|
|
|
data.get('date_to')) + """' AND aat.id='""" + str( |
|
|
|
account_type_id) + """' AND cmp.id='""" + str( |
|
|
|
company_id.id) + """' """ + state + """) am |
|
|
|
account_type_id) + """' """ + state + state2 + """) am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
@ -235,19 +214,19 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
account_type_id = self.env.ref( |
|
|
|
'account.data_account_type_liquidity').id |
|
|
|
state = """AND am.state = 'posted' """ if data.get( |
|
|
|
'target_move') == 'posted' else '' |
|
|
|
'target_move') == 'Posted' else """AND am.state in ('draft','posted') """ |
|
|
|
|
|
|
|
state2 = ' AND aml.company_id IN %s' % str(tuple(self.env.companies.ids) + tuple([0])) |
|
|
|
sql = """SELECT DISTINCT aa.id, aa.name,aa.code, sum(aml.debit) AS total_debit, |
|
|
|
sum(aml.credit) AS total_credit,sum(aml.balance) AS total_balance |
|
|
|
FROM (SELECT am.* FROM account_move as am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
|
LEFT JOIN res_company cmp ON cmp.id = am.company_id |
|
|
|
WHERE am.date BETWEEN '""" + str( |
|
|
|
data.get('date_from')) + """' and '""" + str( |
|
|
|
data.get('date_to')) + """' AND aat.id='""" + str( |
|
|
|
account_type_id) + """' AND cmp.id='""" + str( |
|
|
|
company_id.id) + """' """ + state + """) am |
|
|
|
account_type_id) + """' """ + state + state2 + """) am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
@ -260,19 +239,19 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
account_type_id = self.env.ref( |
|
|
|
'account.data_account_type_liquidity').id |
|
|
|
state = """AND am.state = 'posted' """ if data.get( |
|
|
|
'target_move') == 'posted' else '' |
|
|
|
'target_move') == 'Posted' else """AND am.state in ('draft','posted') """ |
|
|
|
|
|
|
|
state2 = ' AND aml.company_id IN %s' % str(tuple(self.env.companies.ids) + tuple([0])) |
|
|
|
sql = """SELECT DISTINCT aa.id, aa.name,aa.code, sum(aml.debit) AS total_debit, |
|
|
|
sum(aml.credit) AS total_credit,sum(aml.balance) AS total_balance |
|
|
|
FROM (SELECT am.* FROM account_move as am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
|
LEFT JOIN res_company cmp ON cmp.id = am.company_id |
|
|
|
WHERE am.date BETWEEN '""" + str( |
|
|
|
data.get('date_from')) + """' and '""" + str( |
|
|
|
data.get('date_to')) + """' AND aat.id='""" + str( |
|
|
|
account_type_id) + """' AND cmp.id='""" + str( |
|
|
|
company_id.id) + """' """ + state + """) am |
|
|
|
account_type_id) + """' """ + state + state2 + """) am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
@ -282,41 +261,39 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
fetched_data = cr.dictfetchall() |
|
|
|
|
|
|
|
elif data.get('levels') == 'consolidated': |
|
|
|
state = """ WHERE am.state = 'posted' """ if data.get('target_move') == 'posted' else '' |
|
|
|
state = """ AND am.state = 'posted' """ if data.get('target_move') == 'Posted' else '' |
|
|
|
state2 = ' AND aml.company_id IN %s' % str(tuple(self.env.companies.ids) + tuple([0])) |
|
|
|
query2 = """SELECT aat.name, sum(aml.debit) AS total_debit, sum(aml.credit) AS total_credit, |
|
|
|
sum(aml.balance) AS total_balance FROM ( SELECT am.id, am.state FROM account_move as am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
|
LEFT JOIN res_company cmp ON cmp.id = am.company_id |
|
|
|
WHERE am.date BETWEEN '""" + str(data.get('date_from')) + """' and '""" + str( |
|
|
|
data.get('date_to')) + """' AND aat.id='""" + str( |
|
|
|
account_type_id) + """' AND cmp.id='""" + str( |
|
|
|
company_id.id) + """' ) am |
|
|
|
account_type_id) + """' """ + state + state2 + """) am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
|
""" + state + """GROUP BY aat.name""" |
|
|
|
GROUP BY aat.name""" |
|
|
|
cr = self._cr |
|
|
|
cr.execute(query2) |
|
|
|
fetched_data = cr.dictfetchall() |
|
|
|
elif data.get('levels') == 'detailed': |
|
|
|
state = """ WHERE am.state = 'posted' """ if data.get('target_move') == 'posted' else '' |
|
|
|
state = """AND am.state = 'posted' """ if data.get('target_move') == 'Posted' else """AND am.state in ('draft','posted') """ |
|
|
|
state2 = ' AND aml.company_id IN %s' % str(tuple(self.env.companies.ids) + tuple([0])) |
|
|
|
query1 = """SELECT aa.id,aa.name,aa.code, sum(aml.debit) AS total_debit, sum(aml.credit) AS total_credit, |
|
|
|
sum(aml.balance) AS total_balance FROM (SELECT am.id, am.state FROM account_move as am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
|
LEFT JOIN res_company cmp ON cmp.id = am.company_id |
|
|
|
WHERE am.date BETWEEN '""" + str( |
|
|
|
data.get('date_from')) + """' and '""" + str( |
|
|
|
data.get('date_to')) + """' AND aat.id='""" + str( |
|
|
|
account_type_id) + """' AND cmp.id='""" + str( |
|
|
|
company_id.id) + """' ) am |
|
|
|
account_type_id) + """' """ + state + state2 + """) am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
|
""" + state + """GROUP BY aa.name, aa.code, aa.id""" |
|
|
|
GROUP BY aa.name, aa.code, aa.id""" |
|
|
|
cr = self._cr |
|
|
|
cr.execute(query1) |
|
|
|
fetched_data = cr.dictfetchall() |
|
|
@ -328,19 +305,19 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
else: |
|
|
|
account_type_id = self.env.ref( |
|
|
|
'account.data_account_type_liquidity').id |
|
|
|
state = """AND am.state = 'posted' """ if data.get('target_move') == 'posted' else '' |
|
|
|
state = """AND am.state = 'posted' """ if data.get('target_move') == 'Posted' else """AND am.state in ('draft','posted') """ |
|
|
|
state2 = ' AND aml.company_id IN %s' % str(tuple(self.env.companies.ids) + tuple([0])) |
|
|
|
# filter = " AND aml.parent_state in ('draft','posted')" |
|
|
|
sql = """SELECT DISTINCT aa.id, aa.name,aa.code, sum(aml.debit) AS total_debit, |
|
|
|
sum(aml.credit) AS total_credit,sum(aml.balance) AS total_balance |
|
|
|
FROM (SELECT am.* FROM account_move as am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
|
LEFT JOIN res_company cmp ON cmp.id = am.company_id |
|
|
|
WHERE am.date BETWEEN '""" + str( |
|
|
|
data.get('date_from')) + """' and '""" + str( |
|
|
|
data.get('date_to')) + """' AND aat.id='""" + str( |
|
|
|
account_type_id) + """' AND cmp.id='""" + str( |
|
|
|
company_id.id) + """' """ + state + """) am |
|
|
|
account_type_id) + """' """ + state + state2 +""") am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_account_type aat ON aat.id = aa.user_type_id |
|
|
@ -374,7 +351,8 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
def _get_lines(self, account, data): |
|
|
|
account_type_id = self.env.ref( |
|
|
|
'account.data_account_type_liquidity').id |
|
|
|
state = """AND am.state = 'posted' """ if data.get('target_move') == 'posted' else '' |
|
|
|
state = """AND am.state = 'posted' """ if data.get('target_move') == 'Posted' else """AND am.state in ('draft','posted') """ |
|
|
|
state2 = ' AND aml.company_id IN %s' % str(tuple(self.env.companies.ids) + tuple([0])) |
|
|
|
query = """SELECT aml.account_id,aj.id as j_id,aj.name,am.id, am.name as move_name, sum(aml.debit) AS total_debit, |
|
|
|
sum(aml.credit) AS total_credit, COALESCE(SUM(aml.debit - aml.credit),0) AS balance FROM (SELECT am.* FROM account_move as am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
@ -383,7 +361,7 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
WHERE am.date BETWEEN '""" + str( |
|
|
|
data.get('date_from')) + """' and '""" + str( |
|
|
|
data.get('date_to')) + """' AND aat.id='""" + str( |
|
|
|
account_type_id) + """' """ + state + """) am |
|
|
|
account_type_id) + """' """ + state + state2 + """) am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_journal aj ON aj.id = am.journal_id |
|
|
@ -402,7 +380,7 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
WHERE am.date BETWEEN '""" + str( |
|
|
|
data.get('date_from')) + """' and '""" + str( |
|
|
|
data.get('date_to')) + """' AND aat.id='""" + str( |
|
|
|
account_type_id) + """' """ + state + """) am |
|
|
|
account_type_id) + """' """ + state + state2 + """) am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_journal aj ON aj.id = am.journal_id |
|
|
@ -427,7 +405,8 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
account_type_id = self.env.ref( |
|
|
|
'account.data_account_type_liquidity').id |
|
|
|
offset_count = offset * fetch_range |
|
|
|
state = """AND am.state = 'posted' """ if data.get('target_move') == 'posted' else '' |
|
|
|
state = """AND am.state = 'posted' """ if data.get('target_move') == 'Posted' else """AND am.state in ('draft','posted') """ |
|
|
|
state2 = ' AND aml.company_id IN %s' % str(tuple(self.env.companies.ids) + tuple([0])) |
|
|
|
sql2 = """SELECT aa.name as account_name, aj.name, sum(aml.debit) AS total_debit, |
|
|
|
sum(aml.credit) AS total_credit, COALESCE(SUM(aml.debit - aml.credit),0) AS balance FROM (SELECT am.* FROM account_move as am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
@ -436,7 +415,7 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
WHERE am.date BETWEEN '""" + str( |
|
|
|
data.get('date_from')) + """' and '""" + str( |
|
|
|
data.get('date_to')) + """' AND aat.id='""" + str( |
|
|
|
account_type_id) + """' """ + state + """) am |
|
|
|
account_type_id) + """' """ + state + state2 + """) am |
|
|
|
LEFT JOIN account_move_line aml ON aml.move_id = am.id |
|
|
|
LEFT JOIN account_account aa ON aa.id = aml.account_id |
|
|
|
LEFT JOIN account_journal aj ON aj.id = am.journal_id |
|
|
@ -480,8 +459,6 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
|
|
|
|
@api.model |
|
|
|
def _get_currency(self): |
|
|
|
company = self.get_current_company_value()[0] |
|
|
|
company_id = self.env['res.company'].search([('id', '=', int(company))]) |
|
|
|
journal = self.env['account.journal'].browse( |
|
|
|
self.env.context.get('default_journal_id', False)) |
|
|
|
if journal.currency_id: |
|
|
@ -490,10 +467,8 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
if not lang: |
|
|
|
lang = 'en_US' |
|
|
|
lang = lang.replace("_", '-') |
|
|
|
# currency_array = [self.env.company.currency_id.symbol, |
|
|
|
# self.env.company.currency_id.position, lang] |
|
|
|
currency_array = [company_id.currency_id.symbol, |
|
|
|
company_id.currency_id.position, lang] |
|
|
|
currency_array = [self.env.company.currency_id.symbol, |
|
|
|
self.env.company.currency_id.position, lang] |
|
|
|
return currency_array |
|
|
|
|
|
|
|
def get_dynamic_xlsx_report(self, data, response, report_data, dfr_data): |
|
|
@ -592,7 +567,7 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
for j_rec in journal_res_list: |
|
|
|
if data['levels'] == 'detailed': |
|
|
|
for k in fetched_data_list: |
|
|
|
if k['name'] == j_rec['account']: |
|
|
|
if k['id'] == j_rec['id']: |
|
|
|
sheet.write(row_num + 1, col_num, str(k['code']) + str(k['name']), txt_bold) |
|
|
|
sheet.write(row_num + 1, col_num + 1, str(k['total_debit']) + str(currency_symbol), amount_bold) |
|
|
|
sheet.write(row_num + 1, col_num + 2, str(k['total_credit']) + str(currency_symbol), amount_bold) |
|
|
@ -611,7 +586,7 @@ class AccountCasgFlow(models.TransientModel): |
|
|
|
for j_rec in account_res_list: |
|
|
|
if data['levels'] == 'very': |
|
|
|
for k in fetched_data_list: |
|
|
|
if k['name'] == j_rec['account']: |
|
|
|
if k['id'] == j_rec['id']: |
|
|
|
sheet.write(row_num + 1, col_num, str(k['code']) + str(k['name']), txt_bold) |
|
|
|
sheet.write(row_num + 1, col_num + 1, str(k['total_debit']) + str(currency_symbol), amount_bold) |
|
|
|
sheet.write(row_num + 1, col_num + 2, str(k['total_credit']) + str(currency_symbol), amount_bold) |
|
|
|