clearcorp team mailing list archive
-
clearcorp team
-
Mailing list archive
-
Message #00241
lp:~as.clearcorp/openerp-costa-rica/6.1-l10n_cr_account_financial_report_webkit into lp:openerp-costa-rica
Armando Soto Rodríguez has proposed merging lp:~as.clearcorp/openerp-costa-rica/6.1-l10n_cr_account_financial_report_webkit into lp:openerp-costa-rica.
Requested reviews:
CLEARCORP drivers (clearcorp-drivers)
For more details, see:
https://code.launchpad.net/~as.clearcorp/openerp-costa-rica/6.1-l10n_cr_account_financial_report_webkit/+merge/116022
[FIX] Fixed currency_symbol in reports
[RMV] Conciliation Bank Report removed from this module
--
https://code.launchpad.net/~as.clearcorp/openerp-costa-rica/6.1-l10n_cr_account_financial_report_webkit/+merge/116022
Your team CLEARCORP development team is subscribed to branch lp:openerp-costa-rica.
=== modified file 'l10n_cr_account_financial_report_webkit/__openerp__.py'
--- l10n_cr_account_financial_report_webkit/__openerp__.py 2012-07-11 20:30:16 +0000
+++ l10n_cr_account_financial_report_webkit/__openerp__.py 2012-07-20 16:05:22 +0000
@@ -38,7 +38,6 @@
'wizard/account_bank_balances_wizard_view.xml',
'wizard/l10n_cr_partners_ledger_wizard_view.xml',
'wizard/l10n_cr_open_invoices_wizard_view.xml',
- 'wizard/conciliation_bank_wizard.xml',
'report_menus.xml',
'account_view.xml',
],
=== modified file 'l10n_cr_account_financial_report_webkit/account_account.py'
--- l10n_cr_account_financial_report_webkit/account_account.py 2012-07-03 21:28:44 +0000
+++ l10n_cr_account_financial_report_webkit/account_account.py 2012-07-20 16:05:22 +0000
@@ -27,7 +27,7 @@
class AccountAccount(orm.Model):
_inherit = "account.account"
-
+
_columns = {
'report_currency_id': fields.many2one('res.currency', 'Report Currency', help="Currency to show in the reports."),
- }
+ }
\ No newline at end of file
=== modified file 'l10n_cr_account_financial_report_webkit/report/__init__.py'
--- l10n_cr_account_financial_report_webkit/report/__init__.py 2012-07-06 22:56:13 +0000
+++ l10n_cr_account_financial_report_webkit/report/__init__.py 2012-07-20 16:05:22 +0000
@@ -3,4 +3,3 @@
import l10n_cr_partner_balance
import account_bank_balances
import l10n_cr_account_financial_report
-import conciliation_bank
=== removed file 'l10n_cr_account_financial_report_webkit/report/conciliation_bank.mako'
--- l10n_cr_account_financial_report_webkit/report/conciliation_bank.mako 2012-07-12 20:56:35 +0000
+++ l10n_cr_account_financial_report_webkit/report/conciliation_bank.mako 1970-01-01 00:00:00 +0000
@@ -1,213 +0,0 @@
-<html>
-<head>
- <style type="text/css">${css}</style>
-</head>
-<body>
- <%setLang(user.context_lang)%>
- <%
- filter_type = ''
- filter_data = []
- bank_account = get_bank_account(cr, uid, data)
- %>
-
- <div class="header">
- <div style="font-size: 20px; font-weight: bold; text-align: center;"> ${company.partner_id.name | entity} - ${company.currency_id.name | entity}</div>
- <div style="font-size: 25px; font-weight: bold; text-align: center;"> Conciliación de Bancos</div>
- <div style="font-size: 20px; font-weight: bold; text-align: center;"> ${bank_account.name} - ${(bank_account.currency_id and bank_account.currency_id.name) or bank_account.company_id.currency_id.name}</div>
- </div>
- <div class="act_as_table data_table" style="margin-top:10px;">
- <div class="act_as_row labels" style = "font-size: 12px;">
- <div class="act_as_cell">${_('Chart of Account')}</div>
- <div class="act_as_cell">${_('Fiscal Year')}</div>
- <div class="act_as_cell">
- %if filter_form(data) == 'filter_date':
- ${_('Dates Filter')}
- <%
- filter_data.append(start_date)
- filter_data.append(stop_date)
- filter_type = 'filter_date'
- %>
- %elif filter_form(data) == 'filter_period':
- ${_('Periods Filter')}
- <%
- filter_data.append(start_period)
- filter_data.append(stop_period)
- filter_type = 'filter_period'
- %>
- %else:
- ${_('No Filter')}
- %endif
- </div>
- <div class="act_as_cell">${_('Target Moves')}</div>
- </div>
- <div class="act_as_row" style = "font-size: 12px;">
- <div class="act_as_cell">${ chart_account.name }</div>
- <div class="act_as_cell">${ fiscalyear.name if fiscalyear else '-' }</div>
- <div class="act_as_cell">
- ${_('To:')}
- %if filter_form(data) == 'filter_date':
- ${ formatLang(stop_date, date=True) if stop_date else u'' }
- %elif filter_form(data) == 'filter_period':
- ${stop_period.name if stop_period else u'' }
- %else:
- ${''}
- %endif
- </div>
- <div class="act_as_cell">${ display_target_move(data) }</div>
- </div>
- </div>
-
- <%
- bank_balance, bank_move_lines, account_is_foreign = get_bank_data(cr, uid, bank_account.id, filter_type, filter_data, fiscalyear, target_move, context)
- %>
- <div align="center">
- <div class="act_as_table data_table no_wrap results left" style="margin-top:20px; margin-bottom: 10px; width:500px">
- <div class="act_as_row">
- <div class="act_as_cell" style="border-left:0px; border-right:0px; border-top:0px"></div>
- <div class="act_as_cell" style="column-span:2; -webkit-column-span:2; border-left:0px; border-top:0px"></div>
- <div class="act_as_cell label">${_('Balance according Bank')}</div>
- <div class="act_as_cell amount">
- %if bank_balance['input_bank_balance'] == bank_balance['bank_balance']:
- ${formatLang(input_bank_balance)}
- %else:
- <span style="color:red; font-weight:bold;">${formatLang(input_bank_balance)}</span>
- %endif
- </div>
- </div>
- <div class="act_as_row">
- <div class="act_as_cell label">${_('Ledger Balance')}</div>
- <div class="act_as_cell label amount">${formatLang(bank_balance['accounting_balance'])}</div>
- <div class="act_as_cell label">${_('Bank Balance')}</div>
- <div class="act_as_cell label amount">${formatLang(bank_balance['bank_balance'])}</div>
- </div>
- <div class="act_as_row">
- <div class="act_as_cell">${_('+ Incomes to register')}</div>
- <div class="act_as_cell amount">${formatLang(bank_balance['incomes_to_register'])}</div>
- <div class="act_as_cell">${_('+ Credits to reconcile')}</div>
- <div class="act_as_cell amount">${formatLang(bank_balance['credits_to_reconcile'])}</div>
- </div>
- <div class="act_as_row">
- <div class="act_as_cell">${_('- Expenditures to register')}</div>
- <div class="act_as_cell amount">${formatLang(bank_balance['expenditures_to_register'])}</div>
- <div class="act_as_cell">${_('- Debits to reconcile')}</div>
- <div class="act_as_cell amount">${formatLang(bank_balance['debits_to_reconcile'])}</div>
- </div>
- <div class="act_as_row">
- <div class="act_as_cell label">${_('Ledger reconciled Total')}</div>
- <div class="act_as_cell label amount">${formatLang(bank_balance['accounting_total'])}</div>
- <div class="act_as_cell label">${_('Bank reconciled Total')}</div>
- <div class="act_as_cell label amount">${formatLang(bank_balance['bank_total'])}</div>
- </div>
- </div>
- </div>
-
- <%
- def cmp (first, second):
- list_ = [
- 'incomes_to_register',
- 'expenditures_to_register',
- 'credits_to_reconcile',
- 'debits_to_reconcile',
- ]
- first_index = len(first) > 0 and first[0] in list_ and list_.index(first[0]) or -1
- second_index = len(second) > 0 and second[0] in list_ and list_.index(second[0]) or -1
-
- return first_index - second_index
- %>
- %for line_group_key, line_group in sorted(bank_move_lines.items(),cmp):
- <div class="account_title bg" style="width: 100%; margin-top: 15px; font-size: 12px;">
- %if line_group_key == 'credits_to_reconcile':
- ${_('Credits to reconcile')}
- %elif line_group_key == 'debits_to_reconcile':
- ${_('Debits to reconcile')}
- %elif line_group_key == 'incomes_to_register':
- ${_('Incomes to register')}
- %else:
- ${_('Expenditures to register')}
- %endif
- </div>
- <div class="act_as_table list_table" style="margin-top: 5px;">
- <div class="act_as_thead">
- <div class="act_as_row labels no_wrap">
- ## date
- <div class="act_as_cell first_column">${_('Date')}</div>
- ## period
- <div class="act_as_cell">${_('Period')}</div>
- ## journal
- <div class="act_as_cell">${_('Journal')}</div>
- ## Account
- <div class="act_as_cell">${_('Account')}</div>
- ## Partner
- <div class="act_as_cell" style="width: 40%;">${_('Partner')}</div>
- ## Reference
- <div class="act_as_cell" style="width: 20%;">${_('Reference')}</div>
- ## label
- <div class="act_as_cell" style="width: 40%;">${_('Label')}</div>
- ## Amount
- <div class="act_as_cell last_column amount">${_('Amount')}</div>
- </div>
- </div>
- <div class="act_as_tbody">\
- %for line in line_group:
- <div class="act_as_row lines">
- ## date
- <div class="act_as_cell first_column no_wrap">${formatLang(line.date, date=True)}</div>
- ## period
- <div class="act_as_cell no_wrap">${line.period_id.code}</div>
- ## journal
- <div class="act_as_cell no_wrap">${line.journal_id.code}</div>
- ## Account
- <div class="act_as_cell no_wrap">${line.account_id.code}</div>
- ## Partner
- <div class="act_as_cell">
- %if line.partner_id:
- ${(line.partner_id.ref and line.partner_id.ref + ' ') or ''}
- ${(line.partner_id.name and line.partner_id.name) or ''}
- %else:
- ${_('-- No partner --')}
- %endif
- </div>
- ## Reference
- <div class="act_as_cell">${line.ref}</div>
- ## label
- <div class="act_as_cell">${line.name}</div>
- ## Amount
- <div class="act_as_cell last_column amount">
- %if account_is_foreign:
- ${formatLang(line.amount_currency)}
- %elif line.debit > 0:
- ${formatLang(line.debit)}
- %else:
- ${formatLang(line.credit)}
- %endif
- </div>
- </div>
- %endfor
- </div>
- </div>
- <div class="act_as_table list_table" style="margin-top:5px;">
- <div class="act_as_row labels" style="font-weight: bold; font-size: 12px;">
- ## label
- <div class="act_as_cell" style="width: 880px;">
- %if line_group_key == 'credits_to_reconcile':
- ${_("Total")} ${_('Credits to reconcile')}
- %elif line_group_key == 'debits_to_reconcile':
- ${_("Total")} ${_('Debits to reconcile')}
- %elif line_group_key == 'incomes_to_register':
- ${_("Total")} ${_('Incomes to register')}
- %else:
- ${_("Total")} ${_('Expenditures to register')}
- %endif
- </div>
- <div class="act_as_cell amount" style="width: 200px;">
- %if account_is_foreign:
- ${bank_account.currency_id.symbol} ${formatLang(bank_balance[line_group_key])}
- %else:
- ${company.currency_id.symbol} ${formatLang(bank_balance[line_group_key])}
- %endif
- </div>
- </div>
- </div>
- %endfor
-</body>
-</html>
=== removed file 'l10n_cr_account_financial_report_webkit/report/conciliation_bank.py'
--- l10n_cr_account_financial_report_webkit/report/conciliation_bank.py 2012-07-13 01:41:42 +0000
+++ l10n_cr_account_financial_report_webkit/report/conciliation_bank.py 1970-01-01 00:00:00 +0000
@@ -1,391 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Addons modules by CLEARCORP S.A.
-# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import time
-from report import report_sxw
-from tools.translate import _
-import pooler
-from datetime import datetime
-
-from openerp.addons.account_financial_report_webkit.report.common_reports import CommonReportHeaderWebkit
-from openerp.addons.account_financial_report_webkit.report.partners_ledger import PartnersLedgerWebkit
-
-
-
-
-class conciliation_bank(report_sxw.rml_parse, CommonReportHeaderWebkit):
-
- def __init__(self, cursor, uid, name, context):
- super(conciliation_bank, self).__init__(cursor, uid, name, context=context)
- self.pool = pooler.get_pool(self.cr.dbname)
- self.cursor = self.cr
-
- self.localcontext.update({
- 'time': time,
- 'cr' : cursor,
- 'uid': uid,
- 'get_amount': self.get_amount,
- 'get_bank_data': self.get_bank_data,
- 'get_bank_account': self.get_bank_account,
- 'filter_form': self._get_filter,
- 'display_target_move': self._get_display_target_move,
- })
-
- def set_context(self, objects, data, ids, report_type=None):
- main_filter = self._get_form_param('filter', data, default='filter_no')
- target_move = self._get_form_param('target_move', data, default='all')
- start_date = self._get_form_param('date_from', data)
- stop_date = self._get_form_param('date_to', data)
- input_bank_balance = self._get_form_param('bank_balance', data)
- start_period = self.get_start_period_br(data)
- stop_period = self.get_end_period_br(data)
- fiscalyear = self.get_fiscalyear_br(data)
- chart_account = self._get_chart_account_id_br(data)
-
- if main_filter == 'filter_no' and fiscalyear:
- start_period = self.get_first_fiscalyear_period(fiscalyear)
- stop_period = self.get_last_fiscalyear_period(fiscalyear)
- elif main_filter == 'filter_date':
- start = start_date
- stop = stop_date
- else:
- start = start_period
- stop = stop_period
-
- self.localcontext.update({
- 'fiscalyear': fiscalyear,
- 'start_date': start_date,
- 'stop_date': stop_date,
- 'start_period': start_period,
- 'stop_period': stop_period,
- 'target_move': target_move,
- 'input_bank_balance': input_bank_balance,
- 'chart_account': chart_account,
-
- })
-
- return super(conciliation_bank, self).set_context(objects, data, ids,
- report_type=report_type)
-
- def get_amount(self,cr, uid, account_move_line, currency):
- account_obj = self.pool.get('account.account').browse(cr,uid,account_move_line.account_id.id)
-
- obj_invoice = self.pool.get('account.invoice')
- invoice_search = obj_invoice.search(cr,uid,[('move_id','=',account_move_line.move_id.id)])
- invoice = None
- if invoice_search != []:
- invoice = obj_invoice.browse(cr,uid,invoice_search[0])
-
- obj_voucher = self.pool.get('account.voucher')
- voucher_search = obj_voucher.search(cr,uid,[('move_id','=',account_move_line.move_id.id)])
-
- voucher = None
- if voucher_search != []:
- voucher = obj_voucher.browse(cr,uid,voucher_search[0])
-
- res = ('none', 0.0, 0.0)
-
- amount = 0.0
- if currency != False:
- amount = account_move_line.amount_currency
- else:
- if account_move_line.debit != 0.0 :
- amount = account_move_line.debit
- elif account_move_line.credit != 0.0 :
- amount = account_move_line.credit * -1
-
- # Invoices
- if invoice:
- if invoice.type == 'out_invoice': # Customer Invoice
- res = ('invoice', amount)
- elif invoice.type == 'in_invoice': # Supplier Invoice
- res = ('invoice', amount)
- elif invoice.type == 'in_refund': # Debit Note
- res = ('debit', amount)
- elif invoice.type == 'out_refund': # Credit Note
- res = ('credit', amount)
- # Vouchers
- elif voucher:
- if voucher.type == 'payment': # Payment
- res = ('payment', amount)
- elif voucher.type == 'sale': # Invoice
- res = ('invoice', amount)
- elif voucher.type == 'receipt': # Payment
- res = ('payment', amount)
- # Debit o Credit
- else:
- if amount > 0.0:
- res = ('debit', amount)
- else:
- res = ('credit', amount)
-
-
- if res[1] == None or (currency != None and res[1] == 0.0):
- secundary_amount = (account_move_line.debit != 0.0) and account_move_line.debit or account_move_line.credit
- res = (res[0], 0.0, secundary_amount)
- else:
- res = (res[0], res[1], None)
-
- return res
-
- def get_bank_data(self, cr, uid, parent_account_id, filter_type, filter_data, fiscalyear, target_move, context=None):
- result_bank_balance = {}
- result_move_lines = []
-
- account_obj = self.pool.get('account.account')
- parent_account = account_obj.browse(cr, uid, parent_account_id)
- child_account_ids = account_obj.search(cr, uid, [('parent_id','=',parent_account_id)])
- child_accounts = child_account_ids and account_obj.browse(cr, uid, child_account_ids) or False
-
- if not child_accounts:
- return result_bank_balance, result_move_lines, account_foreign
-
- if parent_account.report_currency_id:
- account_currency = parent_account.report_currency_id
- elif parent_account.currency_id:
- account_currency = parent_account.currency_id
- else:
- account_currency = parent_account.company_id.currency_id
- if account_currency.id == parent_account.company_id.currency_id.id:
- account_is_foreign = False
- else:
- account_is_foreign = True
-
- reconciled_account = None
- transit_accounts = []
- transit_account_ids = []
- for child_account in child_accounts:
- #TODO: get the user types for the reconciled_account from system properties
- if child_account.user_type.code == 'BKRE':
- reconciled_account = child_account
- else:
- if child_account.reconcile:
- transit_accounts.append(child_account)
- transit_account_ids.append(child_account.id)
-
- #A reconciled_account and at least one transit_account is needed
- if not (reconciled_account or transit_accounts):
- return result_bank_balance, result_move_lines, account_foreign
-
- #TODO: set input_bank_balance with data from wizard
- input_bank_balance = 0.0
- bank_balance = 0.0
- accounting_balance = 0.0
- incomes_to_register = 0.0
- credits_to_reconcile = 0.0
- expenditures_to_register = 0.0
- debits_to_reconcile = 0.0
- accounting_total = 0.0
- bank_total = 0.0
-
- #TODO: Set the max date or period list for the balance query from the wizard data
- # If the wizard is filtered by date, the max date is entered as is
- # If the wizard is filtered by period, the query needs the valid list of periods in a WHERE statement form
- balance_query_filter = ''
- if account_is_foreign:
- '''
- bank_balance = account_obj.__compute(cr,
- uid,
- [reconciled_account.id],
- ['balance'],
- query=balance_query_filter)[reconciled_account.id]['balance']
- accounting_balance = account_obj.__compute(cr,
- uid,
- [parent_account_id],
- ['balance'],
- query=balance_query_filter)[parent_account_id]['balance']
- else:
- bank_balance = account_obj.__compute(cr,
- uid,
- [reconciled_account.id],
- ['balance'],
- query=balance_query_filter)[reconciled_account.id]['foreign_balance']
- accounting_balance = account_obj.__compute(cr,
- uid,
- [parent_account_id],
- ['balance'],
- query=balance_query_filter)[parent_account_id]['foreign_balance']
- '''
- bank_balance = reconciled_account.foreign_balance
- accounting_balance = parent_account.foreign_balance
- else:
- bank_balance = reconciled_account.balance
- accounting_balance = parent_account.balance
-
- move_obj = self.pool.get('account.move')
- move_line_obj = self.pool.get('account.move.line')
-
- if target_move == 'posted':
- if filter_type == 'filter_period':
- date_stop = filter_data[1].date_stop
- unreconciled_move_line_ids = move_line_obj.search(cr, uid, [('account_id', 'in', transit_account_ids), ('move_id.state', '=', 'posted'), ('period_id.date_stop', '<', date_stop), ('reconcile_id', '=', False)], context=context)
- elif filter_type == 'filter_date':
- date_stop = filter_data[1]
- unreconciled_move_line_ids = move_line_obj.search(cr, uid, [('account_id', 'in', transit_account_ids), ('move_id.state', '=', 'posted'), ('date', '<', date_stop), ('reconcile_id', '=', False)], context=context)
- else:
- date_stop = fiscalyear.date_stop
- unreconciled_move_line_ids = move_line_obj.search(cr, uid, [('account_id', 'in', transit_account_ids), ('move_id.state', '=', 'posted'), ('date', '<', date_stop), ('reconcile_id', '=', False)], context=context)
- else:
- if filter_type == 'filter_period':
- date_stop = filter_data[1].date_stop
- unreconciled_move_line_ids = move_line_obj.search(cr, uid, [('account_id', 'in', transit_account_ids), ('period_id.date_stop', '<', date_stop), ('reconcile_id', '=', False)], context=context)
- elif filter_type == 'filter_date':
- date_stop = filter_data[1]
- unreconciled_move_line_ids = move_line_obj.search(cr, uid, [('account_id', 'in', transit_account_ids), ('date', '<', date_stop), ('reconcile_id', '=', False)], context=context)
- else:
- date_stop = fiscalyear.date_stop
- unreconciled_move_line_ids = move_line_obj.search(cr, uid, [('account_id', 'in', transit_account_ids), ('date', '<', date_stop), ('reconcile_id', '=', False)], context=context)
-
- unreconciled_move_lines = unreconciled_move_line_ids and move_line_obj.browse(cr, uid, unreconciled_move_line_ids) or []
-
-
- result_move_lines = {
- 'credits_to_reconcile' : [],
- 'debits_to_reconcile' : [],
- 'incomes_to_register' : [],
- 'expenditures_to_register' : [],
- }
- for line in unreconciled_move_lines:
- move = line.move_id
- if not move:
- if account_is_foreign:
- if line.amount_currency > 0:
- result_move_lines['incomes_to_register'].append(line)
- incomes_to_register += line.amount_currency
- else:
- result_move_lines['expenditures_to_register'].append(line)
- expenditures_to_register -= line.amount_currency
- else:
- if line.debit > 0:
- result_move_lines['incomes_to_register'].append(line)
- incomes_to_register += line.debit
- else:
- result_move_lines['expenditures_to_register'].append(line)
- expenditures_to_register += line.credit
- print "No move"
- continue
-
- #Select the best contra move line (biggest amount, inverse amount from line)
- contra_line = line
- for other_line in move.line_id:
- if other_line.id == line.id:
- continue
- elif other_line.debit == line.credit or other_line.credit == line.debit:
- contra_line = other_line
- break
- elif account_is_foreign and (other_line.amount_currency == -1 * line.amount_currency):
- contra_line = other_line
- break
- if (line.debit != 0 and contra_line.credit > other_line.credit) or \
- (line.credit != 0 and contra_line.debit < other_line.debit):
- contra_line = other_line
- elif (account_is_foreign and
- (
- (line.amount_currency > 0 and
- contra_line.amount_currency < other_line.amount_currency)
- or
- (line.amount_currency <= 0 and
- contra_line.amount_currency > other_line.amount_currency)
- )
- ):
- contra_line = other_line
-
- if line.id == contra_line.id:
- if account_is_foreign:
- if line.amount_currency > 0:
- result_move_lines['incomes_to_register'].append(line)
- incomes_to_register += line.amount_currency
- else:
- result_move_lines['expenditures_to_register'].append(line)
- expenditures_to_register -= line.amount_currency
- else:
- if line.debit > 0:
- result_move_lines['incomes_to_register'].append(line)
- incomes_to_register += line.debit
- else:
- result_move_lines['expenditures_to_register'].append(line)
- expenditures_to_register += line.credit
- else:
- #Debit or credit to register: present in statement but not in other accounts
- if contra_line.account_id.id == reconciled_account.id:
- if account_is_foreign:
- if line.amount_currency < 0:
- result_move_lines['incomes_to_register'].append(line)
- incomes_to_register -= line.amount_currency
- else:
- result_move_lines['expenditures_to_register'].append(line)
- expenditures_to_register += line.amount_currency
- else:
- if line.credit > 0:
- result_move_lines['incomes_to_register'].append(line)
- incomes_to_register += line.credit
- else:
- result_move_lines['expenditures_to_register'].append(line)
- expenditures_to_register += line.debit
- #Debit or credit to reconcile: present in other accounts but not in statements
- else:
- if account_is_foreign:
- if line.amount_currency > 0:
- result_move_lines['credits_to_reconcile'].append(line)
- credits_to_reconcile += line.amount_currency
- else:
- result_move_lines['debits_to_reconcile'].append(line)
- debits_to_reconcile -= line.amount_currency
- else:
- if line.debit > 0:
- result_move_lines['credits_to_reconcile'].append(line)
- credits_to_reconcile += line.debit
- else:
- result_move_lines['debits_to_reconcile'].append(line)
- debits_to_reconcile += line.credit
-
- accounting_total = accounting_balance + incomes_to_register - expenditures_to_register
- bank_total = bank_balance + credits_to_reconcile - debits_to_reconcile
-
- result_bank_balance = {
- 'input_bank_balance' : input_bank_balance,
- 'bank_balance' : bank_balance,
- 'accounting_balance' : accounting_balance,
- 'incomes_to_register' : incomes_to_register,
- 'credits_to_reconcile' : credits_to_reconcile,
- 'expenditures_to_register' : expenditures_to_register,
- 'debits_to_reconcile' : debits_to_reconcile,
- 'accounting_total' : accounting_total,
- 'bank_total' : bank_total,
- }
-
- return result_bank_balance, result_move_lines, account_is_foreign
-
- def get_bank_account(self, cr, uid, data):
- info = data.get('form', {}).get('bank_account_ids')
- if info:
- bank_account = self.pool.get('account.account').browse(cr, uid, info[0])
- return bank_account
- return False
-
-
-report_sxw.report_sxw(
- 'report.account_financial_report_webkit.account.account_report_conciliation_bank_webkit',
- 'account.account',
- 'addons/l10n_cr_account_financial_report_webkit/report/conciliation_bank.mako',
- parser=conciliation_bank)
-
=== modified file 'l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_open_invoices.mako'
--- l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_open_invoices.mako 2012-07-03 21:28:44 +0000
+++ l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_open_invoices.mako 2012-07-20 16:05:22 +0000
@@ -278,7 +278,6 @@
## curency code
<div class="act_as_cell" style="text-align: right; ">${line.get('currency_code') or ''}</div>
%endif
- <% last_line_currency = line.get('currency_id') %>
</div>
<%
total_cumul_balance = total_invoice + total_payment + total_debit + total_credit + total_manual_move
@@ -301,7 +300,7 @@
## reconcile
<!--div class="act_as_cell"></div-->
%if currency[0] != 'CRC':
- <% currency_symbol = get_currency_symbol(cr, uid, last_line_currency) %>
+ <% currency_symbol = get_currency_symbol(cr, uid, currency[0]) %>
## invoice
<div class="act_as_cell amount">${currency_symbol} ${formatLang(total_invoice) }</div>
## payment
=== modified file 'l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partners_ledger.mako'
--- l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partners_ledger.mako 2012-07-05 03:41:55 +0000
+++ l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partners_ledger.mako 2012-07-20 16:05:22 +0000
@@ -312,10 +312,6 @@
## curency code
<div class="act_as_cell" style="text-align: right; ">${line.get('currency_code') or ''}</div>
%endif
- <%
- last_line_currency = line.get('currency_id')
- currency_symbol = get_currency_symbol(cr, uid, last_line_currency)
- %>
</div>
%endfor
<div class="act_as_row lines labels">
@@ -334,6 +330,7 @@
## reconcile
<!--div class="act_as_cell"></div-->
%if currency[0] != 'CRC':
+ <%currency_symbol = get_currency_symbol(cr, uid, currency[0]) %>
## invoice
<div class="act_as_cell amount">${currency_symbol} ${formatLang(total_invoice) }</div>
## payment
=== modified file 'l10n_cr_account_financial_report_webkit/report/l10n_cr_partners_ledger.py'
--- l10n_cr_account_financial_report_webkit/report/l10n_cr_partners_ledger.py 2012-07-03 21:28:44 +0000
+++ l10n_cr_account_financial_report_webkit/report/l10n_cr_partners_ledger.py 2012-07-20 16:05:22 +0000
@@ -139,9 +139,12 @@
return res
- def get_currency_symbol(self, cr, uid, currency_id):
- currency = self.pool.get('res.currency').browse(cr,uid,currency_id)
-
+ def get_currency_symbol(self, cr, uid, currency_name, context=None):
+ currency_obj = self.pool.get('res.currency')
+
+ currency_id = currency_obj.search(cr, uid, [('name', '=', currency_name)], context=context)[0]
+ currency = currency_obj.browse(cr, uid, currency_id)
+
return currency.symbol
def get_initial_balance(self, cr, uid, partner, account, filter_type, filter_data, fiscal_year, currency, context=None):
=== modified file 'l10n_cr_account_financial_report_webkit/report/report.xml'
--- l10n_cr_account_financial_report_webkit/report/report.xml 2012-07-11 20:30:16 +0000
+++ l10n_cr_account_financial_report_webkit/report/report.xml 2012-07-20 16:05:22 +0000
@@ -36,10 +36,6 @@
<report auto="False" id="l10n_cr_partner_balance" model="res.partner"
name="l10n.cr.partner.balance.layout_ccorp" file="l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako" string="Estado de Cuenta" report_type="webkit"/>
- <!--
- <report auto="False" id="conciliation_bank" model="account.account"
- name="l10n.cr.conciliation.bank.layout_ccorp" file="l10n_cr_account_financial_report_webkit/report/conciliation_bank.mako" string="Conciliacion de Bancos" report_type="webkit"/>
- -->
<record id="l10n_cr_account_financial_report_webkit.account_report_account_balances_webkit" model="ir.actions.report.xml">
<field name="report_type">webkit</field>
@@ -55,20 +51,6 @@
<field name="report_file">l10n_cr_account_financial_report_webkit/report/account_bank_balances.mako</field>
<field name="webkit_header" ref="financial_portrait_header"/>
</record>
-
- <record id="l10n_cr_account_financial_report_webkit.account_report_conciliation_bank_webkit" model="ir.actions.report.xml">
- <field name="report_type">webkit</field>
- <field name="report_name">account_financial_report_webkit.account.account_report_conciliation_bank_webkit</field>
- <field eval="[(6,0,[])]" name="groups_id"/>
- <field eval="0" name="multi"/>
- <field eval="0" name="auto"/>
- <field eval="1" name="header"/>
- <field name="model">account.account</field>
- <field name="type">ir.actions.report.xml</field>
- <field name="name">Conciliation Bank Webkit</field>
- <field name="report_rml">l10n_cr_account_financial_report_webkit/report/conciliation_bank.mako</field>
- <field name="report_file">l10n_cr_account_financial_report_webkit/report/conciliation_bank.mako</field>
- </record>
<record id="l10n_cr_account_financial_report" model="ir.actions.report.xml">
<field name="report_type">webkit</field>
=== modified file 'l10n_cr_account_financial_report_webkit/report_menus.xml'
--- l10n_cr_account_financial_report_webkit/report_menus.xml 2012-07-11 20:30:16 +0000
+++ l10n_cr_account_financial_report_webkit/report_menus.xml 2012-07-20 16:05:22 +0000
@@ -14,9 +14,5 @@
parent="account.final_accounting_reports" action="action_account_balances_menu_webkit"
groups="account.group_account_manager,account.group_account_user" id="account_financial_report_webkit.menu_Account_Balances_report"/>
- <menuitem icon="STOCK_PRINT" name="Conciliation Bank"
- parent="account.next_id_22" action="action_conciliation_bank_menu_webkit"
- groups="account.group_account_manager,account.group_account_user" id="menu_conciliation_bank"/>
-
</data>
</openerp>
=== modified file 'l10n_cr_account_financial_report_webkit/wizard/__init__.py'
--- l10n_cr_account_financial_report_webkit/wizard/__init__.py 2012-07-06 22:56:13 +0000
+++ l10n_cr_account_financial_report_webkit/wizard/__init__.py 2012-07-20 16:05:22 +0000
@@ -25,4 +25,3 @@
import open_invoices_wizard
import account_bank_balances_wizard
import l10n_cr_account_financial_report_wizard
-import conciliation_bank_wizard
=== removed file 'l10n_cr_account_financial_report_webkit/wizard/conciliation_bank_wizard.py'
--- l10n_cr_account_financial_report_webkit/wizard/conciliation_bank_wizard.py 2012-07-11 20:30:16 +0000
+++ l10n_cr_account_financial_report_webkit/wizard/conciliation_bank_wizard.py 1970-01-01 00:00:00 +0000
@@ -1,57 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Addons modules by CLEARCORP S.A.
-# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-##############################################################################
-
-import time
-
-from osv import fields, osv
-
-
-class l10n_cr_ConciliationBankWizard(osv.osv_memory):
-
- _inherit = "partners.ledger.webkit"
- _name = "conciliation.bank.webkit"
- _description = "Conciliation Bank Report"
-
- _columns = {
- 'bank_account_ids': fields.many2one('account.account', 'Bank Account', domain="[('user_type.code','=','BKVI')]", help="Bank Account"),
- 'bank_balance': fields.float('Bank Balance'),
- }
-
- def pre_print_report(self, cr, uid, ids, data, context=None):
- data = super(l10n_cr_ConciliationBankWizard, self).pre_print_report(cr, uid, ids, data, context)
- if context is None:
- context = {}
- # will be used to attach the report on the main account
- data['ids'] = [data['form']['chart_account_id']]
- vals = self.read(cr, uid, ids,
- ['bank_account_ids', 'bank_balance',],
- context=context)[0]
- data['form'].update(vals)
- return data
-
- def _print_report(self, cursor, uid, ids, data, context=None):
- context = context or {}
- # we update form with display account value
- data = self.pre_print_report(cursor, uid, ids, data, context=context)
- return {'type': 'ir.actions.report.xml',
- 'report_name': 'account_financial_report_webkit.account.account_report_conciliation_bank_webkit',
- 'datas': data}
\ No newline at end of file
=== removed file 'l10n_cr_account_financial_report_webkit/wizard/conciliation_bank_wizard.xml'
--- l10n_cr_account_financial_report_webkit/wizard/conciliation_bank_wizard.xml 2012-07-11 20:30:16 +0000
+++ l10n_cr_account_financial_report_webkit/wizard/conciliation_bank_wizard.xml 1970-01-01 00:00:00 +0000
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
-
- <record id="conciliation_bank_view_webkit" model="ir.ui.view">
- <field name="name">Conciliation Bank</field>
- <field name="model">conciliation.bank.webkit</field>
- <field name="type">form</field>
- <field name="inherit_id" ref="account.account_common_report_view"/>
- <field name="arch" type="xml">
- <data>
- <xpath expr="/form/label[@string='']" position="replace">
- <separator string="Conciliation Bank" colspan="4"/>
- <label nolabel="1" colspan="4" string="This report allows you to print or generate a pdf of your partner ledger with details of all your payable/receivable account"/>
- </xpath>
- <field name="chart_account_id" position='attributes'>
- <attribute name="colspan">4</attribute>
- </field>
- <field name="chart_account_id" position='after'>
- <field name="bank_account_ids" required = 'True'/>
- <field name="bank_balance" required = 'True'/>
- </field>
- <page name="filters" position="attributes">
- <attribute name="string">Time Filters</attribute>
- </page>
- <page name="journal_ids" position="attributes">
- <attribute name="invisible">True</attribute>
- </page>
- <field name="date_from" position="replace">
- <field name="date_from" invisible="1" required = "False" attrs="{'readonly':[('filter', '!=', 'filter_date')]}" colspan="4"/>
- </field>
- <field name="period_from" position="replace">
- <field name="period_from" invisible="1" required = "False" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')]}" colspan="4"/>
- </field>
- <field name="period_to" position="attributes">
- <attribute name="domain">[('fiscalyear_id', '=', fiscalyear_id), ('special', '=', False)]</attribute>
- </field>
- </data>
- </field>
- </record>
-
- <record id="action_conciliation_bank_menu_webkit" model="ir.actions.act_window">
- <field name="name">Conciliation Bank</field>
- <field name="type">ir.actions.act_window</field>
- <field name="res_model">conciliation.bank.webkit</field>
- <field name="view_type">form</field>
- <field name="view_mode">form</field>
- <field name="view_id" ref="conciliation_bank_view_webkit"/>
- <field name="target">new</field>
- </record>
-
- <record model="ir.values" id="action_account_conciliation_bank_values_webkit">
- <field name="model_id" ref="account.model_account_account"/>
- <field name="object" eval="1"/>
- <field name="name">Conciliation Bank</field>
- <field name="key2">client_print_multi</field>
- <field name="value"
- eval="'ir.actions.act_window,' +str(ref('action_conciliation_bank_menu_webkit'))"/>
- <field name="key">action</field>
- <field name="model">account.account</field>
- </record>
-
- </data>
-</openerp>
Follow ups