clearcorp team mailing list archive
-
clearcorp team
-
Mailing list archive
-
Message #00893
[Merge] lp:~rr.clearcorp/openerp-costa-rica/7.0-l10n_cr_exchange_rates into lp:openerp-costa-rica/6.1
Ronald Rubi has proposed merging lp:~rr.clearcorp/openerp-costa-rica/7.0-l10n_cr_exchange_rates into lp:openerp-costa-rica/6.1.
Requested reviews:
CLEARCORP drivers (clearcorp-drivers)
For more details, see:
https://code.launchpad.net/~rr.clearcorp/openerp-costa-rica/7.0-l10n_cr_exchange_rates/+merge/194233
[ADD] Add module l10n_cr_exchange_rates
--
The attached diff has been truncated due to its size.
https://code.launchpad.net/~rr.clearcorp/openerp-costa-rica/7.0-l10n_cr_exchange_rates/+merge/194233
Your team CLEARCORP development team is subscribed to branch lp:openerp-costa-rica/6.1.
=== added directory 'TODO-7.0'
=== renamed directory 'l10n_cr_account_banking_cr_bac' => 'TODO-7.0/l10n_cr_account_banking_cr_bac'
=== renamed directory 'l10n_cr_account_banking_cr_bcr' => 'TODO-7.0/l10n_cr_account_banking_cr_bcr'
=== renamed directory 'l10n_cr_account_financial_report_webkit' => 'TODO-7.0/l10n_cr_account_financial_report_webkit'
=== renamed directory 'l10n_cr_account_financial_statements' => 'TODO-7.0/l10n_cr_account_financial_statements'
=== renamed directory 'l10n_cr_account_voucher' => 'TODO-7.0/l10n_cr_account_voucher'
=== renamed directory 'l10n_cr_base' => 'TODO-7.0/l10n_cr_base'
=== removed file 'l10n_cr_account_banking_reports/__init__.py'
--- l10n_cr_account_banking_reports/__init__.py 2012-07-18 22:46:28 +0000
+++ l10n_cr_account_banking_reports/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,25 +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 account
-from . import wizard
-from . import report
=== removed file 'l10n_cr_account_banking_reports/__openerp__.py'
--- l10n_cr_account_banking_reports/__openerp__.py 2012-11-06 00:40:55 +0000
+++ l10n_cr_account_banking_reports/__openerp__.py 1970-01-01 00:00:00 +0000
@@ -1,43 +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/>.
-#
-##############################################################################
-
-
-{
- 'name': 'Webkit reports for Banking',
- 'description': "",
- 'version': '1.0',
- 'author': 'CLEARCORP S.A.',
- 'category': 'Finance',
- 'website': "http://clearcorp.co.cr",
- 'images': [],
- 'depends': ['account_financial_report_webkit', 'account', 'account_webkit_report_library' ],
- 'init_xml': [],
- 'demo_xml' : [],
- 'update_xml': ['report/report.xml',
- 'wizard/conciliation_bank_wizard.xml',
- 'report_menus.xml',
- ],
- 'test': [],
- 'active': False,
- 'installable': True,
- 'license': 'AGPL-3',
-}
=== removed directory 'l10n_cr_account_banking_reports/i18n'
=== removed file 'l10n_cr_account_banking_reports/i18n/es_CR.po'
--- l10n_cr_account_banking_reports/i18n/es_CR.po 2013-01-17 19:04:40 +0000
+++ l10n_cr_account_banking_reports/i18n/es_CR.po 1970-01-01 00:00:00 +0000
@@ -1,231 +0,0 @@
-# Translation of OpenERP Server.
-# This file contains the translation of the following modules:
-# * l10n_cr_account_banking_reports
-#
-msgid ""
-msgstr ""
-"Project-Id-Version: OpenERP Server 6.1\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-01-11 19:33+0000\n"
-"PO-Revision-Date: 2013-01-11 19:33+0000\n"
-"Last-Translator: <>\n"
-"Language-Team: \n"
-"MIME-Version: 1.0\n"
-"Content-Type: text/plain; charset=UTF-8\n"
-"Content-Transfer-Encoding: \n"
-"Plural-Forms: \n"
-
-#. module: l10n_cr_account_banking_reports
-#: model:ir.actions.report.xml,name:l10n_cr_account_banking_reports.account_report_conciliation_bank_webkit
-msgid "Conciliation Bank Webkit"
-msgstr "Conciliarión Bancaria"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:90
-msgid "- Expenditures to register"
-msgstr "- Egresos por registrar"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:145
-msgid "Label"
-msgstr "Detalle"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:135
-msgid "Period"
-msgstr "Período"
-
-#. module: l10n_cr_account_banking_reports
-#: view:conciliation.bank.webkit:0
-msgid "Time Filters"
-msgstr "Filtros de Tiempo"
-
-#. module: l10n_cr_account_banking_reports
-#: help:conciliation.bank.webkit,historic_strict:0
-msgid "If selected, will display a historical unreconciled lines, taking into account the end of the period or date selected"
-msgstr "Si está seleccionado, mostrará el histórico de las líneas sin conciliar, tomando en cuenta la fecha final del período o la fecha final seleccionada"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:78
-msgid "Ledger Balance"
-msgstr "Saldo en Libros"
-
-#. module: l10n_cr_account_banking_reports
-#: field:conciliation.bank.webkit,special_period:0
-msgid "Special period"
-msgstr "Período especiales"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:124
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:197
-msgid "Incomes to register"
-msgstr "Ingresos por registrar"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:137
-msgid "Journal"
-msgstr "Diario"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:38
-msgid "No Filter"
-msgstr "Sin filtro"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:167
-msgid "-- No partner --"
-msgstr "-- Sin empresa --"
-
-#. module: l10n_cr_account_banking_reports
-#: view:conciliation.bank.webkit:0
-msgid "This report allows you to print or generate a pdf of your partner ledger with details of all your payable/receivable account"
-msgstr "Este reporte permite imprimir o generar un pdf de una conciliación bancaria de la cuenta seleccionada."
-
-#. module: l10n_cr_account_banking_reports
-#: model:ir.model,name:l10n_cr_account_banking_reports.model_conciliation_bank_webkit
-msgid "Conciliation Bank Report"
-msgstr "Reporte de Conciliación de Bancos"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:96
-msgid "Ledger reconciled Total"
-msgstr "Total conciliado en Libros"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:133
-msgid "Date"
-msgstr "Fecha"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:20
-msgid "Chart of Account"
-msgstr "Plan Contable"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:122
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:195
-msgid "Debits to reconcile"
-msgstr "Débitos por conciliar"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:41
-msgid "Target Moves"
-msgstr "Movimientos Destino"
-
-#. module: l10n_cr_account_banking_reports
-#: constraint:conciliation.bank.webkit:0
-msgid "When no Fiscal year is selected, you must choose to filter by periods or by date."
-msgstr "Cuando no se selecciona ningún año fiscal, se debe elegir para filtrar por períodos o por fecha."
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:47
-msgid "To:"
-msgstr "Hasta:"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:139
-msgid "Account"
-msgstr "Cuenta"
-
-#. module: l10n_cr_account_banking_reports
-#: view:conciliation.bank.webkit:0
-#: model:ir.actions.act_window,name:l10n_cr_account_banking_reports.action_conciliation_bank_menu_webkit
-#: model:ir.ui.menu,name:l10n_cr_account_banking_reports.menu_conciliation_bank
-msgid "Conciliation Bank"
-msgstr "Conciliación Bancaria"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:120
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:193
-msgid "Credits to reconcile"
-msgstr "Créditos por conciliar"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:21
-msgid "Fiscal Year"
-msgstr "Año Fiscal"
-
-#. module: l10n_cr_account_banking_reports
-#: field:conciliation.bank.webkit,historic_strict:0
-msgid "Strict History"
-msgstr "Histórico estricto"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:80
-msgid "Bank Balance"
-msgstr "Saldo en Banco"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:68
-msgid "Balance according Bank"
-msgstr "Saldo según Banco"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:98
-msgid "Bank reconciled Total"
-msgstr "Total conciliado en Banco"
-
-#. module: l10n_cr_account_banking_reports
-#: constraint:conciliation.bank.webkit:0
-msgid "The fiscalyear, periods or chart of account chosen have to belong to the same company."
-msgstr "El año fiscal, períodos o plan contable elegidos deben pertenecer a la misma compañía."
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:126
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:199
-msgid "Expenditures to register"
-msgstr "Egresos por registrar"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:143
-msgid "Reference"
-msgstr "Referencia"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:86
-msgid "+ Credits to reconcile"
-msgstr "+ Créditos por conciliar"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:92
-msgid "- Debits to reconcile"
-msgstr "- Débitos por conciliar"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:147
-msgid "Amount"
-msgstr "Monto"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:24
-msgid "Dates Filter"
-msgstr "Filtro por Fechas"
-
-#. module: l10n_cr_account_banking_reports
-#: help:conciliation.bank.webkit,special_period:0
-msgid "Include special period"
-msgstr "Include special period"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:84
-msgid "+ Incomes to register"
-msgstr "+ Ingresos por registrar"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:141
-msgid "Partner"
-msgstr "Empresa"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:193
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:195
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:197
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:199
-msgid "Total"
-msgstr "Total"
-
-#. module: l10n_cr_account_banking_reports
-#: report:addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako:31
-msgid "Periods Filter"
-msgstr "Filtro por Períodos"
-
=== removed file 'l10n_cr_account_banking_reports/report/__init__.py'
--- l10n_cr_account_banking_reports/report/__init__.py 2012-07-18 22:46:28 +0000
+++ l10n_cr_account_banking_reports/report/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,1 +0,0 @@
-import conciliation_bank
=== removed file 'l10n_cr_account_banking_reports/report/conciliation_bank.mako'
--- l10n_cr_account_banking_reports/report/conciliation_bank.mako 2013-01-17 19:04:40 +0000
+++ l10n_cr_account_banking_reports/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, data['form']['historic_strict'], data['form']['special_period'])
- %>
- <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>
=== renamed file 'l10n_cr_account_banking_reports/report/conciliation_bank.py' => 'l10n_cr_account_banking_reports/report/conciliation_bank.py.THIS'
=== removed file 'l10n_cr_account_banking_reports/report/report.xml'
--- l10n_cr_account_banking_reports/report/report.xml 2012-09-05 20:46:51 +0000
+++ l10n_cr_account_banking_reports/report/report.xml 1970-01-01 00:00:00 +0000
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
-
- <record id="l10n_cr_account_banking_reports.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_banking_reports/report/conciliation_bank.mako</field>
- <field name="report_file">l10n_cr_account_banking_reports/report/conciliation_bank.mako</field>
- </record>
-
- </data>
-</openerp>
=== removed file 'l10n_cr_account_banking_reports/report_menus.xml'
--- l10n_cr_account_banking_reports/report_menus.xml 2012-07-18 22:46:28 +0000
+++ l10n_cr_account_banking_reports/report_menus.xml 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
-
- <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>
=== removed file 'l10n_cr_account_banking_reports/wizard/__init__.py'
--- l10n_cr_account_banking_reports/wizard/__init__.py 2012-07-18 22:46:28 +0000
+++ l10n_cr_account_banking_reports/wizard/__init__.py 1970-01-01 00:00:00 +0000
@@ -1,23 +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 conciliation_bank_wizard
=== removed file 'l10n_cr_account_banking_reports/wizard/conciliation_bank_wizard.py'
--- l10n_cr_account_banking_reports/wizard/conciliation_bank_wizard.py 2013-01-17 19:04:40 +0000
+++ l10n_cr_account_banking_reports/wizard/conciliation_bank_wizard.py 1970-01-01 00:00:00 +0000
@@ -1,63 +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'),
- 'filter': fields.selection([('filter_date', 'Date'), ('filter_period', 'Periods')], "Filter by", required=True),
- 'historic_strict': fields.boolean('Strict History', help="If selected, will display a historical unreconciled lines, taking into account the end of the period or date selected"),
- 'special_period': fields.boolean('Special period', help="Include special period"),
- }
-
- _defaults = {
- 'filter': 'filter_period',
- }
-
- 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','historic_strict', 'special_period'],
- 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
=== renamed file 'l10n_cr_account_banking_reports/wizard/conciliation_bank_wizard.xml' => 'l10n_cr_account_banking_reports/wizard/conciliation_bank_wizard.xml.THIS'
=== removed file 'l10n_cr_account_banking_reports/wizard/wizard.xml'
--- l10n_cr_account_banking_reports/wizard/wizard.xml 2012-07-18 22:46:28 +0000
+++ l10n_cr_account_banking_reports/wizard/wizard.xml 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
-<?xml version="1.0" ?>
-<openerp>
- <data> </data>
-</openerp>
=== added directory 'l10n_cr_account_conciliation_bank_report'
=== added file 'l10n_cr_account_conciliation_bank_report/__init__.py'
--- l10n_cr_account_conciliation_bank_report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,25 @@
+# -*- 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 l10n_cr_account_conciliation_bank_report
+import wizard
+import report
=== added file 'l10n_cr_account_conciliation_bank_report/__openerp__.py'
--- l10n_cr_account_conciliation_bank_report/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/__openerp__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,58 @@
+# -*- 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/>.
+#
+##############################################################################
+
+
+{
+ 'name': 'Conciliation Bank Report Webkit',
+ 'description': """Install the Conciliation Bank Report.
+ Configuration:
+ 1. Configure type account that it will appear in wizard. This configuration is in Accounting -> Account -> Account Types and check
+ "Include in conciliation bank report" option.
+
+ 2. With previous configuration, accounts that will appears in wizard to generate report will be parents of account that match with type selected in
+ previous configuration.
+
+ 3. With this configuration, Conciliation Bank Report has configuration for accounts that it will be necesary, that is reconciled and transit account.
+ """,
+ 'version': '1.0',
+ 'author': 'CLEARCORP S.A.',
+ 'category': 'Finance',
+ 'website': "http://clearcorp.co.cr",
+ 'images': [],
+ 'depends': [
+ 'account',
+ 'account_report_lib',
+ 'account_report_signatures', ],
+
+ 'init_xml': [],
+ 'demo_xml' : [],
+ 'update_xml': [
+ 'report/report.xml',
+ 'wizard/l10n_cr_account_conciliation_bank_report_wizard.xml',
+ 'l10n_cr_account_conciliation_bank_report.xml',
+ 'report_menus.xml',
+ ],
+ 'test': [],
+ 'active': False,
+ 'installable': True,
+ 'license': 'AGPL-3',
+}
=== added directory 'l10n_cr_account_conciliation_bank_report/i18n'
=== added file 'l10n_cr_account_conciliation_bank_report/i18n/es_CR.po'
--- l10n_cr_account_conciliation_bank_report/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/i18n/es_CR.po 2013-11-06 21:08:21 +0000
@@ -0,0 +1,396 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * l10n_cr_account_conciliation_bank_report
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-08-12 14:35+0000\n"
+"PO-Revision-Date: 2013-08-12 14:35+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: code:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.py:198
+#, python-format
+msgid "Reconciled account does not exist. Check your configuration!"
+msgstr "Cuenta de conciliación no existe. Revise su configuración!"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:85
+msgid "- Expenditures to register"
+msgstr "- Egresos por registrar"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: help:conciliation.bank.report.wiz,amount_currency:0
+msgid "It adds the currency column on report if the currency differs from the company currency."
+msgstr "Añade una columna de moneda en el reporte si la moneda es diferente de la moneda de la compañía."
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: code:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.py:201
+#, python-format
+msgid "Transit account does not exist. Check your configuration!"
+msgstr "Cuenta de tránsito de bancos no existe. Revise su configuración!"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:conciliation.bank.report.wiz,period_from:0
+msgid "Start Period"
+msgstr "Período Inicial"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:32
+msgid "Periods Filter"
+msgstr "Filtro por períodos"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:133
+msgid "Period"
+msgstr "Período"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: view:conciliation.bank.report.wiz:0
+msgid "This report allows you to print or generate a pdf of your conciliation bank with details of all your payable/receivable account"
+msgstr "Este informe le permite imprimir o generar un pdf de su conciliación bancaria con los detalles de todas sus cuentas por pagar / por cobrar"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: model:ir.model,name:l10n_cr_account_conciliation_bank_report.model_account_account_type
+msgid "Account Type"
+msgstr "Tipo de cuenta"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: help:conciliation.bank.report.wiz,historic_strict:0
+msgid "If selected, will display a historical unreconciled lines, taking into account the end of the period or date selected"
+msgstr "Si se selecciona, se mostrarán las líneas sin conciliar históricas, teniendo en cuenta el final del período o la fecha seleccionada"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: view:conciliation.bank.report.wiz:0
+msgid "{'required':[('filter', '=', 'filter_period')]}"
+msgstr "{'required':[('filter', '=', 'filter_period')]}"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: code:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.py:198
+#: code:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.py:201
+#, python-format
+msgid "Error !"
+msgstr "Error !"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:73
+msgid "Ledger Balance"
+msgstr "Saldo en Libros"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:account.account.type,include_profit_statement_report:0
+msgid "Include in Profit Statement Report"
+msgstr "Incluir en el Reporte de Estados de Resultados"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:121
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:183
+msgid "Incomes to register"
+msgstr "Ingresos por registrar"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:conciliation.bank.report.wiz,company_id:0
+msgid "Company"
+msgstr "Compañía"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:conciliation.bank.report.wiz,amount_currency:0
+msgid "With Currency"
+msgstr "Con moneda"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:154
+msgid "-- No partner --"
+msgstr "-- Sin empresa --"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:19
+#: model:ir.actions.act_window,name:l10n_cr_account_conciliation_bank_report.action_conciliation_bank_report_menu_webkit
+#: model:ir.actions.report.xml,name:l10n_cr_account_conciliation_bank_report.conciliation_bank_report_webkit
+msgid "Conciliation Bank Report"
+msgstr "Reporte de Conciliación Bancaria"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: view:conciliation.bank.report.wiz:0
+msgid "{'invisible': True, 'required': False}"
+msgstr "{'invisible': True, 'required': False}"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:91
+msgid "Ledger reconciled Total"
+msgstr "Total conciliado en Libros"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:132
+#: selection:conciliation.bank.report.wiz,filter:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: view:conciliation.bank.report.wiz:0
+msgid "Accounts"
+msgstr "Cuentas"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:conciliation.bank.report.wiz,chart_account_id:0
+msgid "Chart of Account"
+msgstr "Catálogo de cuentas"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:119
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:181
+msgid "Debits to reconcile"
+msgstr "Débitos por conciliar"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: view:conciliation.bank.report.wiz:0
+#: field:conciliation.bank.report.wiz,journal_ids:0
+msgid "Journals"
+msgstr "Diarios"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:46
+#: field:conciliation.bank.report.wiz,target_move:0
+msgid "Target Moves"
+msgstr "Movimientos destino"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: help:conciliation.bank.report.wiz,chart_account_id:0
+msgid "Select Charts of Accounts"
+msgstr "Seleccione el catálogo contable"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:38
+msgid "To:"
+msgstr "Hasta:"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:conciliation.bank.report.wiz,date_to:0
+msgid "End Date"
+msgstr "Fecha final"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:135
+msgid "Account"
+msgstr "Cuenta"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: view:conciliation.bank.report.wiz:0
+#: model:ir.ui.menu,name:l10n_cr_account_conciliation_bank_report.menu_conciliation_bank
+msgid "Conciliation Bank"
+msgstr "Conciliación Bancaria"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:117
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:179
+msgid "Credits to reconcile"
+msgstr "Créditos por conciliar"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: view:conciliation.bank.report.wiz:0
+msgid "{'invisible': True}"
+msgstr "{'invisible': True}"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: selection:conciliation.bank.report.wiz,target_move:0
+msgid "All Posted Entries"
+msgstr "Todos los apuntes publicados"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: view:conciliation.bank.report.wiz:0
+msgid "{'required': [('filter', '=', 'filter_date')]}"
+msgstr "{'required': [('filter', '=', 'filter_date')]}"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:conciliation.bank.report.wiz,account_ids:0
+msgid "Bank Account"
+msgstr "Cuenta bancaria"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: view:conciliation.bank.report.wiz:0
+msgid "{'required': True}"
+msgstr "{'required': True}"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: help:conciliation.bank.report.wiz,fiscalyear_id:0
+msgid "Keep empty for all open fiscal year"
+msgstr "Mantega vacío para todos los años fiscales abiertos"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:conciliation.bank.report.wiz,period_to:0
+msgid "End Period"
+msgstr "Período final"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:139
+msgid "Amount"
+msgstr "Monto"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: view:conciliation.bank.report.wiz:0
+msgid "True"
+msgstr "True"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:conciliation.bank.report.wiz,historic_strict:0
+msgid "Strict History"
+msgstr "Histórico estricto"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:75
+#: field:conciliation.bank.report.wiz,bank_balance:0
+msgid "Bank Balance"
+msgstr "Balance en Bancos"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:215
+msgid "Authorized by: "
+msgstr "Autorizado por: "
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: model:ir.model,name:l10n_cr_account_conciliation_bank_report.model_conciliation_bank_report_wiz
+msgid "Conciliation Bank Report Wizard"
+msgstr "Asistente del repote de Conciliación Bancaria"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:138
+msgid "Label"
+msgstr "Etiqueta"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:61
+msgid "Balance according Bank"
+msgstr "Saldo según Banco"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: help:account.account.type,include_profit_statement_report:0
+msgid "If it's checked, the account that have this type is include in Profit Statement Report Wizard as Base Account to compare."
+msgstr "Si está marcado, la cuenta que tenga este tipo es incluída en el asistente del Reporte de Estado de REsultados como cuenta base para comparar."
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: view:account.account.type:0
+msgid "Configuration for Conciliation Bank Report"
+msgstr "Configuración para el Reporte de Conciliación Bancaria"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:27
+#: field:conciliation.bank.report.wiz,fiscalyear_id:0
+msgid "Fiscal Year"
+msgstr "Año fiscal"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:93
+msgid "Bank reconciled Total"
+msgstr "Total conciliado en Banco"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: help:account.account.type,include_conciliation_report:0
+msgid "If it's checked, the account that have this type is include in Conciliation Bank Report Wizard"
+msgstr "Si está chequeado, la cuenta que tenga este tipo es incluído en el asistente para el Reporte de Conciliación Bancaria"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:123
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:185
+msgid "Expenditures to register"
+msgstr "Egresos por registrar"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:conciliation.bank.report.wiz,special_period:0
+msgid "Special period"
+msgstr "Período especial"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:137
+msgid "Reference"
+msgstr "Referencia"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:account.account.type,include_conciliation_report:0
+msgid "Include in conciliation bank report"
+msgstr "Incluir en el reporte de conciliación bancaria"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:conciliation.bank.report.wiz,filter:0
+msgid "Filter by"
+msgstr "Filtrado por"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:81
+msgid "+ Credits to reconcile"
+msgstr "+ Créditos por conciliar"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:87
+msgid "- Debits to reconcile"
+msgstr "- Débitos por conciliar"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:conciliation.bank.report.wiz,account_base_report:0
+msgid "Account Base Report"
+msgstr "Cuenta Base de comparación"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:30
+msgid "Dates Filter"
+msgstr "Filtro por Fechas"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: help:conciliation.bank.report.wiz,special_period:0
+msgid "Include special period"
+msgstr "Incluir períodos especiales"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:79
+msgid "+ Incomes to register"
+msgstr "+ Ingresos por registrar"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: selection:conciliation.bank.report.wiz,filter:0
+msgid "Periods"
+msgstr "Períodos"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:34
+msgid "No filters"
+msgstr "Sin filtros"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:136
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: field:conciliation.bank.report.wiz,date_from:0
+msgid "Start Date"
+msgstr "Fecha inicial"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:179
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:181
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:183
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:185
+msgid "Total"
+msgstr "Total"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: view:conciliation.bank.report.wiz:0
+msgid "Account Financial Report"
+msgstr "Reporte Financiero"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: report:addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako:134
+msgid "Journal"
+msgstr "Diario"
+
+#. module: l10n_cr_account_conciliation_bank_report
+#: selection:conciliation.bank.report.wiz,target_move:0
+msgid "All Entries"
+msgstr "Todos los apuntes"
+
=== added file 'l10n_cr_account_conciliation_bank_report/l10n_cr_account_conciliation_bank_report.py'
--- l10n_cr_account_conciliation_bank_report/l10n_cr_account_conciliation_bank_report.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/l10n_cr_account_conciliation_bank_report.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,39 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import fields, orm, osv
+from tools.translate import _
+
+class acccountAccounttypeConciliationbank(orm.Model):
+ """
+ This class extend functions of account.account.type
+
+ If include_conciliation_report is checked, all parent accounts that child account have some account type with include_conciliation_report in True,
+ they will appear in Conciliation Bank Wizard as a option account for print the report.
+
+ """
+ _name = "account.account.type"
+ _inherit = "account.account.type"
+
+ _columns = {
+ 'include_conciliation_report': fields.boolean('Include in conciliation bank report', help="If it's checked, the account that have this type is include in Conciliation Bank Report Wizard")
+ }
\ No newline at end of file
=== added file 'l10n_cr_account_conciliation_bank_report/l10n_cr_account_conciliation_bank_report.xml'
--- l10n_cr_account_conciliation_bank_report/l10n_cr_account_conciliation_bank_report.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/l10n_cr_account_conciliation_bank_report.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- Account Type -->
+ <record id="view_account_type_form_inherit" model="ir.ui.view">
+ <field name="name">account.account.type.form.inherit</field>
+ <field name="model">account.account.type</field>
+ <field name="inherit_id" ref="account.view_account_type_form"/>
+ <field name="arch" type="xml">
+ <field name="note" position="after">
+ <group col="4" string="Configuration for Conciliation Bank Report">
+ <field name="include_conciliation_report"/>
+ </group>
+ </field>
+ </field>
+ </record>
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_conciliation_bank_report/report'
=== added file 'l10n_cr_account_conciliation_bank_report/report/__init__.py'
--- l10n_cr_account_conciliation_bank_report/report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/report/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_account_conciliation_bank_report
=== added file 'l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako'
--- l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako 2013-11-06 21:08:21 +0000
@@ -0,0 +1,237 @@
+<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <link rel='stylesheet' href='addons/account_webkit_report_library/webkit_headers/main.css' />
+ <style>
+ ${css}
+ </style>
+ </head>
+ <body>
+ <%setLang(user.lang)%>
+ <%
+ bank_account = get_accounts_ids(cr, uid, data)
+ %>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell logo">${helper.embed_logo_by_name('default_logo', height=60)|n}</div>
+ <div class="table-cell text">
+ <p class="company">${get_fiscal_year(data).company_id.name}</p>
+ <p class="title">${_('Conciliation Bank Report')}</p>
+ <p class="subtitle">${bank_account.name} - ${(bank_account.currency_id and bank_account.currency_id.name) or bank_account.company_id.currency_id.name}</p>
+ </div>
+ </div>
+ </div>
+ <div class="table list">
+ <div class="table-header">
+ <div class="table-row labels no-wrap">
+ <div class="table-cell" style="width: 100px">${_('Fiscal Year')}<br/>${get_fiscal_year(data).name}</div>
+ <div class="table-cell" style="width: 100px">
+ %if get_filter(data) == 'filter_date':
+ ${_('Dates Filter')}
+ %elif get_filter(data) == 'filter_period':
+ ${_('Periods Filter')}
+ %else:
+ ${_('No filters')}
+ %endif
+ <br/>
+ %if get_filter(data) != 'filter_no':
+ ${_('To:')}
+ %if get_filter(data) == 'filter_date':
+ ${ formatLang(get_date_to(data), date=True)}
+ %else:
+ ${get_end_period(data).name}
+ %endif
+ %endif
+ </div>
+ <div class="table-cell" style="width: 100px">${_('Target Moves')}<br/>${ display_target_move(data) }</div>
+ </div>
+ </div>
+ </div>
+ <br/><br/>
+ <%
+ account_id = get_accounts_ids(cr, uid, data).id
+ bank_balance, bank_move_lines, account_is_foreign = get_data(cr, uid, data, account_id)
+ input_bank_balance = get_bank_balance(data) or 0.0
+ %>
+ <div align="center">
+ <div class="table result">
+ <div class="table-row blank no-wrap">
+ <div class="table-cell" style="width: 70px"> </div>
+ <div class="table-cell" style="width: 70px"> </div>
+ <div class="table-cell" style="width: 70px">${_('Balance according Bank')}</div>
+ %if input_bank_balance == bank_balance['bank_balance']:
+ <div class="act_as_cell amount">
+ ${formatLang(input_bank_balance)}
+ </div>
+ %else:
+ <div class="act_as_cell amount alert">
+ ${formatLang(input_bank_balance)}
+ </div>
+ %endif
+ </div>
+ <div class="table-row labels no-wrap">
+ <div class="table-cell">${_('Ledger Balance')}</div>
+ <div class="table-cell amount">${formatLang(bank_balance['accounting_balance'])}</div>
+ <div class="table-cell">${_('Bank Balance')}</div>
+ <div class="table-cell amount">${formatLang(bank_balance['bank_balance'])}</div>
+ </div>
+ <div class="table-row blank no-wrap">
+ <div class="table-cell">${_('+ Incomes to register')}</div>
+ <div class="table-cell amount">${formatLang(bank_balance['incomes_to_register'])}</div>
+ <div class="table-cell">${_('+ Credits to reconcile')}</div>
+ <div class="table-cell amount">${formatLang(bank_balance['credits_to_reconcile'])}</div>
+ </div>
+ <div class="table-row blank no-wrap">
+ <div class="table-cell">${_('- Expenditures to register')}</div>
+ <div class="table-cell amount">${formatLang(bank_balance['expenditures_to_register'])}</div>
+ <div class="table-cell">${_('- Debits to reconcile')}</div>
+ <div class="table-cell amount">${formatLang(bank_balance['debits_to_reconcile'])}</div>
+ </div>
+ <div class="table-row labels no-wrap">
+ <div class="table-cell">${_('Ledger reconciled Total')}</div>
+ <div class="table-cell amount">${formatLang(bank_balance['accounting_total'])}</div>
+ <div class="table-cell">${_('Bank reconciled Total')}</div>
+ <div class="table-cell 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):
+ <br/><br/>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ %if line_group_key == 'credits_to_reconcile':
+ <p class="subtitle">${_('Credits to reconcile')}</p>
+ %elif line_group_key == 'debits_to_reconcile':
+ <p class="subtitle">${_('Debits to reconcile')}</p>
+ %elif line_group_key == 'incomes_to_register':
+ <p class="subtitle">${_('Incomes to register')}</p>
+ %else:
+ <p class="subtitle">${_('Expenditures to register')}</p>
+ %endif
+ </div>
+ </div>
+ </div>
+ <br/><br/>
+ <div class="table list">
+ <div class="table-header">
+ <div class="table-row labels no-wrap">
+ <div class="table-cell first-column" style="width: 55px">${_('Date')}</div>
+ <div class="table-cell" style="width: 70px">${_('Period')}</div>
+ <div class="table-cell" style="width: 70px">${_('Journal')}</div>
+ <div class="table-cell" style="width: 100px">${_('Account')}</div>
+ <div class="table-cell" style="width: 100px">${_('Partner')}</div>
+ <div class="table-cell" style="width: 70px">${_('Reference')}</div>
+ <div class="table-cell" style="width: 100px">${_('Label')}</div>
+ <div class="table-cell last_column" style="width: 70px">${_('Amount')}</div>
+ </div>
+ </div>
+ <div class="table-body">
+ %for line in line_group:
+ <div class="table-row ${row_even and 'even' or 'odd'}">
+ <div class="table-cell first-column">${formatLang(line.date, date=True)}</div>
+ <div class="table-cell">${line.period_id.code or ''}</div>
+ <div class="table-cell">${line.journal_id.code or ''}</div>
+ <div class="table-cell">${line.account_id.code}</div>
+ <div class="table-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>
+ <div class="table-cell">${line.ref or ''}</div>
+ <div class="table-cell">${line.name}</div>
+ <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="table-row spacer">
+ <div class="table-cell"> </div>
+ </div>
+ <div class="table list">
+ <div class="table-row subtotal">
+ <div class="table-cell first-column" style="width: 300px">
+ %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="table-cell" style="width: 70px"> </div>
+ <div class="table-cell" style="width: 70px"> </div>
+ <div class="table-cell" style="width: 100px"> </div>
+ <div class="table-cell" style="width: 100px"> </div>
+ <div class="table-cell" style="width: 70px"> </div>
+ <div class="table-cell" style="width: 100px"> </div>
+ <div class="table-cell last_column amount" style="width: 70px">
+ %if account_is_foreign:
+ ${bank_account.currency_id.symbol} ${formatLang(bank_balance[line_group_key]) or 0.0}
+ %else:
+ ${company.currency_id.symbol} ${formatLang(bank_balance[line_group_key]) or 0.0}
+ %endif
+ </div>
+ </div>
+ </div>
+ %endfor
+ <div class="table-row spacer">
+ <div class="table-cell"> </div>
+ </div>
+ <%
+ signatures = get_signatures_report(cr, uid, 'Conciliation Bank Report')
+ cont = 0
+ %>
+ %if len(signatures) > 0:
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ <p class="title">${_('Authorized by: ')}</p>
+ </div>
+ </div>
+ </div>
+ <br/><br/>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ %for user_sign in signatures:
+ <div class="table-cell text">_________________________________________________________<br/>
+ <p class="subtitle">${user_sign.name}</p>
+ <p class="company"><i>${user_sign.job_id.name or ''}</i></p>
+ </div>
+ <br/><br/><br/>
+ </div>
+ %endfor
+ </div>
+ </div>
+ %endif
+ <p style="page-break-after:always"></p>
+ </body>
+</html>
+
=== added file 'l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.py'
--- l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,412 @@
+# -*- 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
+import pooler
+from report import report_sxw
+from tools.translate import _
+from openerp.osv import fields, osv
+
+from openerp.addons.account_report_lib.account_report_base import accountReportbase
+
+class conciliationBankreport(accountReportbase):
+
+ def __init__(self, cursor, uid, name, context):
+ #change uid by 1, because 1 is the id for the admin user
+ #problems with partner read.
+ super(conciliationBankreport, self).__init__(cursor, 1, 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_bank_balance': self.get_bank_balance,
+ 'get_amount': self.get_amount,
+ 'get_data': self.get_data,
+ })
+
+ #Extract bank_balance from wizard.
+ def get_bank_balance(self, data):
+ return self._get_form_param('bank_balance', data)
+
+ 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_data(self, cr, uid, data, parent_account_id, context=None):
+ result_bank_balance = {}
+ result_move_lines = []
+ filters = {}
+ account_foreign = False
+ filter_data = []
+ reconciled_account = None
+ transit_accounts = []
+ transit_account_ids = []
+ input_bank_balance = self.get_bank_balance(data) or 0.0 #Extract bank_balance from wizard
+ 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
+
+ account_obj = self.pool.get('account.account')
+ account_webkit_report_library_obj = self.pool.get('account.webkit.report.library')
+
+ #######################Parameters
+ fiscalyear = self.get_fiscalyear(data)
+ target_move = self.get_target_move(data)
+ historic_strict = self.get_historic_strict(data)
+ special_period = self.get_special_period(data)
+ filter_type = self.get_filter(data)
+
+ #Build fiscal_year and filter_data
+ if fiscalyear:
+ fiscal_year_id = fiscalyear.id
+ else:
+ fiscal_year_id = False
+
+ if filter_type == 'filter_date':
+ period_ids = False
+ end_date = self.get_date_to(data)
+
+ #Build the filter data
+ filter_data.append(None)
+ filter_data.append(end_date)
+
+ elif filter_type == 'filter_period':
+ period_ids = [self.get_end_period(data).id]
+ end_date = False
+
+ #Build the filter data
+ filter_data.append(None)
+ filter_data.append(self.get_end_period(data))
+
+ ######################Account configuration
+ #1. Get acccount_id (parent_account) selected in wizard
+ parent_account = account_obj.browse(cr, uid, parent_account_id)
+
+ #2. Get child of this account
+ 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
+
+ #Return empty values if account doesn't have children.
+ if not child_accounts:
+ return result_bank_balance, result_move_lines, account_foreign
+
+ #Check values
+ for child_account in child_accounts:
+ '''
+ *** NOTE: This part required previous configuration ***
+ One of child_accounts must have include_conciliation_report attribute checked as True.
+ This account is reconciled_account, other accounts are transit_accounts.
+ '''
+ #Account with include_conciliation_report checked is reconciled_account
+ if child_account.user_type.include_conciliation_report == True:
+ reconciled_account = child_account
+ else:
+ #Others accounts are transit accounts.
+ 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
+ #Return an error if those accounts don't exist.
+ if not reconciled_account:
+ raise osv.except_osv(_('Error !'),_('Reconciled account does not exist. Check your configuration!'))
+
+ elif not transit_accounts:
+ raise osv.except_osv(_('Error !'),_('Transit account does not exist. Check your configuration!'))
+
+ #######################################################################################################
+
+ #############If accounts configuration is correct, procedeed with report.
+ #3. Check currency
+ 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
+
+ #4. Define if account currency is same that company currency
+ if account_currency.id == parent_account.company_id.currency_id.id:
+ account_is_foreign = False
+ else:
+ account_is_foreign = True
+
+ #######################################################################
+
+ #Compute balances.
+ if account_is_foreign:
+ bank_balance = account_webkit_report_library_obj.get_account_balance(cr,
+ 1,
+ [reconciled_account.id],
+ ['balance'],
+ filter_type = filter_type,
+ end_date=end_date,
+ period_ids=period_ids,
+ fiscal_year_id=fiscal_year_id,
+ context=context)[reconciled_account.id]['balance']
+
+ accounting_balance = account_webkit_report_library_obj.get_account_balance(cr,
+ 1,
+ [parent_account_id],
+ ['balance'],
+ filter_type = filter_type,
+ end_date=end_date,
+ period_ids=period_ids,
+ fiscal_year_id=fiscal_year_id,
+ context=context)[parent_account_id]['balance']
+ else:
+ bank_balance = account_webkit_report_library_obj.get_account_balance(cr,
+ 1,
+ [reconciled_account.id],
+ ['balance'],
+ filter_type = filter_type,
+ end_date=end_date,
+ period_ids=period_ids,
+ fiscal_year_id=fiscal_year_id,
+ context=context)[reconciled_account.id]['balance']
+
+ accounting_balance = account_webkit_report_library_obj.get_account_balance(cr,
+ 1,
+ [parent_account_id],
+ ['balance'],
+ filter_type = filter_type,
+ end_date=end_date,
+ period_ids=period_ids,
+ fiscal_year_id=fiscal_year_id,
+ context=context)[parent_account_id]['balance']
+
+ move_obj = self.pool.get('account.move')
+ move_line_obj = self.pool.get('account.move.line')
+
+ """
+ Cambio realizado el 9 de enero de 2012
+
+ Anteriormente, el método get_move_lines (del objeto account.webkit.report.library, librería estándar de los reportes,
+ sólo se utilizaba en el reporte de Conciliación bancaria. El reporte de conciliación bancaria no recibe el período de inicio
+ por lo que el método de get_move_lines no contempla el período de inicio, necesario en el reporte de saldo de cuenta de bancos.
+ Se realiza el cambio tanto en el reporte de conciliación bancaria para que el período inicial no se tome en cuenta (inicializado en None)
+ y en la librería se especifica que si se encuentra en None no lo tome en cuenta y que si trae información lo utilice dentro del filtro
+ para sacar el rango de periodos que se digita en el wizard.
+
+ Se modifica tanto el reporte de conciliación bancaria, como la librería, para que el método funcione solamente con un período final o bien
+ con un rango de períodos, como trabaja el reporte de saldo de cuenta de bancos.
+
+ Para el caso de las fechas, se trabaja de la misma forma. (El saldo de cuentas de bancos si toma la fecha de inicio)
+
+ OBSERVACIÓN -> data['form']['historic_strict'],las variables boleanas (historic_strict y special_period) se deben pasar
+ de esta forma, sino vienen como objetos y no con el valor real (True or False). Esto se hace desde el conciliation_bank.mako
+
+ """
+
+ unreconciled_move_lines = account_webkit_report_library_obj.get_move_lines(cr, 1, transit_account_ids, filter_type=filter_type, filter_data=filter_data, fiscalyear=fiscalyear, target_move=target_move, unreconcile = True, historic_strict=historic_strict, special_period=special_period, context=context)
+
+ 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
+
+report_sxw.report_sxw(
+ 'report.conciliation_bank_report_webkit',
+ 'account.account',
+ 'addons/l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako',
+ parser=conciliationBankreport)
+
=== added file 'l10n_cr_account_conciliation_bank_report/report/report.xml'
--- l10n_cr_account_conciliation_bank_report/report/report.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/report/report.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="conciliation_bank_report_webkit" model="ir.actions.report.xml">
+ <field name="report_type">webkit</field>
+ <field name="report_name">conciliation_bank_report_webkit</field>
+ <field eval="[(6,0,[])]" name="groups_id"/>
+ <field name="model">account.account</field>
+ <field name="type">ir.actions.report.xml</field>
+ <field name="name">Conciliation Bank Report</field>
+ <field name="report_rml">l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako</field>
+ <field name="report_file">l10n_cr_account_conciliation_bank_report/report/l10n_cr_account_conciliation_bank_report.mako</field>
+ <field name="webkit_header" ref="report_webkit_lib.webkit_header_clearcorp_official_portrait" />
+ </record>
+
+ </data>
+</openerp>
=== added file 'l10n_cr_account_conciliation_bank_report/report_menus.xml'
--- l10n_cr_account_conciliation_bank_report/report_menus.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/report_menus.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <menuitem icon="STOCK_PRINT"
+ name="Conciliation Bank"
+ parent="account.next_id_22"
+ action="action_conciliation_bank_report_menu_webkit"
+ id="menu_conciliation_bank"/>
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_conciliation_bank_report/wizard'
=== added file 'l10n_cr_account_conciliation_bank_report/wizard/__init__.py'
--- l10n_cr_account_conciliation_bank_report/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/wizard/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_account_conciliation_bank_report_wizard
=== added file 'l10n_cr_account_conciliation_bank_report/wizard/l10n_cr_account_conciliation_bank_report_wizard.py'
--- l10n_cr_account_conciliation_bank_report/wizard/l10n_cr_account_conciliation_bank_report_wizard.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/wizard/l10n_cr_account_conciliation_bank_report_wizard.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,94 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import fields, osv
+from openerp.tools.translate import _
+
+class conciliationBankreportWizard(osv.osv_memory):
+
+ _inherit = "account.report.wiz"
+ _name = "conciliation.bank.report.wiz"
+ _description = "Conciliation Bank Report Wizard"
+
+ def _get_parent_accounts(self, cr, uid, context=None):
+
+ if context is None:
+ context = {}
+
+ res = []
+ account_obj = self.pool.get('account.account')
+
+ #Search accounts that have in user_type checked include_conciliation_report attribute. Then, return a tuple list with name and id for
+ #parent_id for this accounts
+ #Include accounts with type == 'view'
+ account_ids = account_obj.search(cr, uid, [('user_type.include_conciliation_report', '=', True)], context=context)
+
+ if account_ids:
+ accounts = account_obj.browse(cr, uid, account_ids, context)
+ for account in accounts:
+ if account.parent_id:
+ res.append((account.parent_id.id, account.parent_id.name)) #Append parent_id.id and parent_id.name for account.
+
+ return res
+
+ '''
+ account_ids is define as a selection field, because with a domain can't obtain necessary data.
+ account_ids are all accounts that their parents user_type have include_conciliation_report attribute mark as True.
+ This configuration solves the problem of searching for a specific code in accounts and makes configurable the accounts that
+ you want in the bank reconciliation report
+ '''
+ _columns = {
+ 'bank_balance': fields.float('Bank Balance'),
+ 'filter': fields.selection([('filter_date', 'Date'), ('filter_period', 'Periods')], "Filter by"),
+ 'account_ids': fields.selection(_get_parent_accounts, 'Bank Account'),
+ }
+
+
+ _defaults = {
+ 'filter': 'filter_period',
+ }
+
+ def pre_print_report(self, cr, uid, ids, data, context=None):
+
+ if context is None:
+ context = {}
+
+ # read the bank_banlance, because this field don't belongs to the account.report.wiz
+ # this field is added by conciliation.bank.report.wiz and add to data['form']
+ vals = self.read(cr, uid, ids,['bank_balance'], context=context)[0] #this method read the field and included it in the form (account.common.report has this method)
+
+ 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': 'conciliation_bank_report_webkit',
+ 'datas': data
+ }
\ No newline at end of file
=== added file 'l10n_cr_account_conciliation_bank_report/wizard/l10n_cr_account_conciliation_bank_report_wizard.xml'
--- l10n_cr_account_conciliation_bank_report/wizard/l10n_cr_account_conciliation_bank_report_wizard.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_conciliation_bank_report/wizard/l10n_cr_account_conciliation_bank_report_wizard.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="conciliation_bank_report_view_webkit" model="ir.ui.view">
+ <field name="name">Conciliation Bank</field>
+ <field name="model">conciliation.bank.report.wiz</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account_report_lib.account_report_lib_wizard_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 conciliation bank with details of all your payable/receivable account"/>
+ </xpath>
+
+ <group string="Account Financial Report" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+
+ <field name="filter" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+
+ <group string="Accounts" position="replace">
+ <group string="Accounts">
+ <field name="account_ids" colspan="2" required="True" readonly="False"/>
+ </group>
+ </group>
+
+ <field name="amount_currency" position="attributes">
+ <attribute name="invisible">True</attribute>
+ </field>
+
+ <group string="Accounts" position="inside">
+ <field name="bank_balance" required="True"/>
+ </group>
+
+ <field name="chart_account_id" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+
+ <field name="target_move" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+ <field name="fiscalyear_id" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+ <field name="period_from" position="attributes">
+ <attribute name="attrs">{'invisible': True, 'required': False}</attribute>
+ </field>
+ <field name="date_from" position="attributes">
+ <attribute name="attrs">{'invisible': True, 'required': False}</attribute>
+ </field>
+ <field name="period_to" position="attributes">
+ <attribute name="attrs">{'required':[('filter', '=', 'filter_period')]}</attribute>
+ </field>
+ <field name="date_to" position="attributes">
+ <attribute name="attrs">{'required': [('filter', '=', 'filter_date')]}</attribute>
+ </field>
+
+ <group string="Journals" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+
+ </data>
+ </field>
+ </record>
+
+ <record id="action_conciliation_bank_report_menu_webkit" model="ir.actions.act_window">
+ <field name="name">Conciliation Bank Report</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">conciliation.bank.report.wiz</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="conciliation_bank_report_view_webkit"/>
+ <field name="target">new</field>
+ </record>
+
+ <record model="ir.values" id="action_account_conciliation_bank_report_webkit">
+ <field name="model_id" ref="account.model_account_account"/>
+ <field name="object" eval="1"/>
+ <field name="name">Conciliation Bank Report</field>
+ <field name="key2">client_print_multi</field>
+ <field name="value"
+ eval="'ir.actions.act_window,' +str(ref('action_conciliation_bank_report_menu_webkit'))"/>
+ <field name="key">action</field>
+ <field name="model">account.account</field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_invoice_D-151'
=== added file 'l10n_cr_account_invoice_D-151/__init__.py'
--- l10n_cr_account_invoice_D-151/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_invoice_D-151/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,26 @@
+# -*- 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 l10n_cr_account_invoice_line
+import l10n_cr_account_invoice_report
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'l10n_cr_account_invoice_D-151/__openerp__.py'
--- l10n_cr_account_invoice_D-151/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_invoice_D-151/__openerp__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,41 @@
+# -*- 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/>.
+#
+##############################################################################
+{
+ 'name': 'D-151 for Account Invoice',
+ 'version': '1.0',
+ 'category': 'Accounting & Finance',
+ 'description': """
+ Add category to account.invoice.line for apply the D-151
+ Add category in the account.move
+ """,
+ 'author': 'CLEARCORP S.A.',
+ 'website': 'http://www.clearcorp.co.cr',
+ 'depends': [
+ 'account',
+ ],
+ 'data': ['l10n_cr_account_invoice_line.xml',
+ 'l10n_cr_account_invoice_report.xml' ],
+ 'installable': True,
+ 'auto_install': False,
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added directory 'l10n_cr_account_invoice_D-151/i18n'
=== added file 'l10n_cr_account_invoice_D-151/i18n/es_CR.po'
--- l10n_cr_account_invoice_D-151/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_invoice_D-151/i18n/es_CR.po 2013-11-06 21:08:21 +0000
@@ -0,0 +1,91 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * l10n_cr_account_invoice_D-151
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-06-20 21:03+0000\n"
+"PO-Revision-Date: 2013-06-20 21:03+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: l10n_cr_account_invoice_D-151
+#: view:account.invoice.report:0
+msgid "Refund"
+msgstr "Factura rectificativa"
+
+#. module: l10n_cr_account_invoice_D-151
+#: selection:account.invoice.line,d_151_type:0
+#: selection:account.invoice.report,d_151_type:0
+msgid "Interest"
+msgstr "Intereses"
+
+#. module: l10n_cr_account_invoice_D-151
+#: selection:account.invoice.line,d_151_type:0
+#: selection:account.invoice.report,d_151_type:0
+msgid "Goods and services sales"
+msgstr "Ventas de bienes y servicios"
+
+#. module: l10n_cr_account_invoice_D-151
+#: selection:account.invoice.line,d_151_type:0
+#: selection:account.invoice.report,d_151_type:0
+msgid "Commissions"
+msgstr "Comisiones"
+
+#. module: l10n_cr_account_invoice_D-151
+#: selection:account.invoice.line,d_151_type:0
+#: selection:account.invoice.report,d_151_type:0
+msgid "Goods and services purchases"
+msgstr "Compras de bienes y servicios"
+
+#. module: l10n_cr_account_invoice_D-151
+#: model:ir.model,name:l10n_cr_account_invoice_D-151.model_account_invoice_line
+msgid "Invoice Line"
+msgstr "Línea de factura"
+
+#. module: l10n_cr_account_invoice_D-151
+#: selection:account.invoice.line,d_151_type:0
+#: selection:account.invoice.report,d_151_type:0
+msgid "Rent"
+msgstr "Renta"
+
+#. module: l10n_cr_account_invoice_D-151
+#: model:ir.model,name:l10n_cr_account_invoice_D-151.model_account_invoice
+msgid "Invoice"
+msgstr "Factura"
+
+#. module: l10n_cr_account_invoice_D-151
+#: field:account.invoice,type_invoice:0
+#: field:account.invoice.line,type_invoice:0
+msgid "Invoice type"
+msgstr "Tipo de Factura"
+
+#. module: l10n_cr_account_invoice_D-151
+#: field:account.invoice.line,d_151_type:0
+#: view:account.invoice.report:0
+#: field:account.invoice.report,d_151_type:0
+msgid "D-151 Type"
+msgstr "D-151"
+
+#. module: l10n_cr_account_invoice_D-151
+#: view:account.invoice.report:0
+msgid "Type"
+msgstr "Tipo"
+
+#. module: l10n_cr_account_invoice_D-151
+#: model:ir.model,name:l10n_cr_account_invoice_D-151.model_account_invoice_report
+msgid "Invoices Statistics"
+msgstr "Estadísticas de facturas"
+
+#. module: l10n_cr_account_invoice_D-151
+#: selection:account.invoice.line,d_151_type:0
+#: selection:account.invoice.report,d_151_type:0
+msgid "Profesional services"
+msgstr "Servicios profesionales"
+
=== added file 'l10n_cr_account_invoice_D-151/l10n_cr_account_invoice_line.py'
--- l10n_cr_account_invoice_D-151/l10n_cr_account_invoice_line.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_invoice_D-151/l10n_cr_account_invoice_line.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,72 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from openerp.osv import fields, osv, orm
+
+class accountInvoiceD151(orm.Model):
+
+ _name = 'account.invoice'
+ _inherit = 'account.invoice'
+
+ #Work arround to get the type of the invoice from context
+ def _get_type_invoice(self, cr, uid, context=None):
+ if context is None:
+ context = {}
+ return context.get('type')
+
+ #This field add category D-151 to invoice line.
+ _columns = {
+ 'type_invoice': fields.char(string='Invoice type', size=64)
+ }
+
+ #Get the type of invoice for category D-151
+ _defaults = {
+ 'type_invoice': _get_type_invoice,
+ }
+
+class accountInvoicelineD151(orm.Model):
+
+ _name = 'account.invoice.line'
+ _inherit = 'account.invoice.line'
+
+ #Work arround to get the type of the invoice from context
+ def _get_type_invoice(self, cr, uid, context=None):
+ if context is None:
+ context = {}
+ return context.get('type')
+
+ #This field add category D-151 to invoice line.
+ _columns = {
+ 'd_151_type':fields.selection([('V','Goods and services sales'),
+ ('C','Goods and services purchases'),
+ ('A','Rent'),
+ ('SP','Profesional services'),
+ ('M','Commissions'),
+ ('I','Interest')], string="D-151 Type"),
+
+ 'type_invoice': fields.char(string='Invoice type', size=64)
+ }
+
+ #Get the type of invoice for category D-151
+ _defaults = {
+ 'type_invoice': _get_type_invoice,
+ }
=== added file 'l10n_cr_account_invoice_D-151/l10n_cr_account_invoice_line.xml'
--- l10n_cr_account_invoice_D-151/l10n_cr_account_invoice_line.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_invoice_D-151/l10n_cr_account_invoice_line.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<openerp>
+ <data>
+ <!--Account invoice line -->
+ <record id="invoice_supplier_form_inherit_D_151" model="ir.ui.view">
+ <field name = "name">invoice.supplier.form.inherit.D151</field>
+ <field name = "model">account.invoice</field>
+ <field name = "type">form</field>
+ <field name="inherit_id" ref="account.invoice_supplier_form"/>
+ <field name = "arch" type = "xml">
+ <xpath expr="/form/sheet[@string='Supplier Invoice']/notebook/page[@string='Invoice']/field/tree/field[@name='name']" position="after">
+ <field name="type_invoice" invisible="1"/>
+ <field name="d_151_type" attrs="{'required':[('type_invoice', '=','in_invoice')]}"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record model = "ir.ui.view" id = "account_type_D151_inherit">
+ <field name = "name">account.type.D151.inherit</field>
+ <field name = "model">account.invoice.line</field>
+ <field name = "type">tree</field>
+ <field name="inherit_id" ref="account.view_invoice_line_form"/>
+ <field name = "arch" type = "xml">
+ <field name="price_unit" position="after">
+ <field name="type_invoice" invisible="1"/>
+ <field name="d_151_type" attrs="{'invisible':[('type_invoice', '!=','in_invoice')], 'required':[('type_invoice', '=','in_invoice')]}"/>
+ </field>
+ </field>
+ </record>
+
+ </data>
+</openerp>
=== added file 'l10n_cr_account_invoice_D-151/l10n_cr_account_invoice_report.py'
--- l10n_cr_account_invoice_D-151/l10n_cr_account_invoice_report.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_invoice_D-151/l10n_cr_account_invoice_report.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,61 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from openerp.osv import fields, osv, orm
+
+class accountInvoicereportInherit(osv.osv):
+
+ _name = 'account.invoice.report'
+ _inherit = 'account.invoice.report'
+
+ _columns = {
+ 'd_151_type':fields.selection([('V','Goods and services sales'),
+ ('C','Goods and services purchases'),
+ ('A','Rent'),
+ ('SP','Profesional services'),
+ ('M','Commissions'),
+ ('I','Interest')], 'D-151 Type',readonly=True),
+ }
+
+ #Add into query the D-151-type field
+ def _select (self):
+ select_str = super(accountInvoicereportInherit, self)._select()
+ new_str = select_str.replace('SELECT sub.id,', 'SELECT sub.id, sub.d_151_type,')
+
+ return new_str
+
+ #Add into query the D-151-type field
+ def _sub_select(self):
+ select_str = super(accountInvoicereportInherit,self)._sub_select()
+ new_str = select_str.replace('ai.payment_term, ai.period_id,', 'ai.payment_term, ai.period_id, ail.d_151_type AS d_151_type,')
+
+ return new_str
+
+ #Add into query the D-151-type field
+ def _group_by(self):
+ group_by_str = super(accountInvoicereportInherit,self)._group_by()
+ new_str = group_by_str.replace('GROUP BY ail.product_id,', 'GROUP BY ail.product_id, ail.d_151_type,')
+
+ return new_str
+
+accountInvoicereportInherit()
+
\ No newline at end of file
=== added file 'l10n_cr_account_invoice_D-151/l10n_cr_account_invoice_report.xml'
--- l10n_cr_account_invoice_D-151/l10n_cr_account_invoice_report.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_invoice_D-151/l10n_cr_account_invoice_report.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<openerp>
+ <data>
+ <!--Account invoice report -->
+ <record id="view_account_invoice_report_tree_inherit" model="ir.ui.view">
+ <field name = "name">account.invoice.report.tree.inherit</field>
+ <field name = "model">account.invoice.report</field>
+ <field name="inherit_id" ref="account.view_account_invoice_report_tree"/>
+ <field name = "arch" type = "xml">
+ <xpath expr="/tree/field[@name='account_line_id']" position="after">
+ <field name="d_151_type" invisible="1"/>
+ </xpath>
+ </field>
+ </record>
+
+ <record id="view_account_invoice_report_search_inherit" model="ir.ui.view">
+ <field name = "name">account.invoice.report.search.inherit</field>
+ <field name = "model">account.invoice.report</field>
+ <field name = "type">form</field>
+ <field name="inherit_id" ref="account.view_account_invoice_report_search"/>
+ <field name = "arch" type = "xml">
+ <filter string="Refund" position="after">
+ <field name="d_151_type"/>
+ </filter>
+ <filter string="Type" position="after">
+ <filter string="D-151 Type" icon="terp-stock_symbol-selection" context="{'group_by':'d_151_type'}"/>
+ </filter>
+ </field>
+ </record>
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_profit_statement_report'
=== added file 'l10n_cr_account_profit_statement_report/__init__.py'
--- l10n_cr_account_profit_statement_report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,25 @@
+# -*- 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 l10n_cr_account_profit_statement_report
+import report
+import wizard
\ No newline at end of file
=== added file 'l10n_cr_account_profit_statement_report/__openerp__.py'
--- l10n_cr_account_profit_statement_report/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/__openerp__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,47 @@
+# -*- 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/>.
+#
+##############################################################################
+
+{
+ 'name': 'Profit Statement Report Webkit',
+ 'description': "Create the Profit Statement report",
+ 'version': '1.0',
+ 'author': 'CLEARCORP S.A.',
+ 'category': 'Finance',
+ 'website': "http://clearcorp.co.cr",
+ 'images': [],
+ 'depends': ['account',
+ 'account_report_lib',
+ 'account_report_signatures',],
+ 'init_xml': [],
+ 'demo_xml' : [],
+ 'update_xml': [
+ 'report/report.xml',
+ 'l10n_cr_account_profit_statement_report.xml',
+ 'wizard/l10n_cr_account_profit_statement_wizard_view.xml',
+ 'report_menus.xml'
+ ],
+ 'test': [],
+ 'active': False,
+ 'installable': True,
+ 'license': 'AGPL-3',
+}
+
=== added directory 'l10n_cr_account_profit_statement_report/i18n'
=== added file 'l10n_cr_account_profit_statement_report/i18n/es_CR.po'
--- l10n_cr_account_profit_statement_report/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/i18n/es_CR.po 2013-11-06 21:08:21 +0000
@@ -0,0 +1,285 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * l10n_cr_account_profit_statement_report
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-08-12 20:08+0000\n"
+"PO-Revision-Date: 2013-08-12 20:08+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: l10n_cr_account_profit_statement_report
+#: report:addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako:32
+msgid "Previous period"
+msgstr "Período anterior"
+
+#. module: l10n_cr_account_profit_statement_report
+#: report:addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako:22
+msgid "Until Period:"
+msgstr "Período hasta:"
+
+#. module: l10n_cr_account_profit_statement_report
+#: view:profit.statement.report.wiz:0
+msgid "{'required':True}"
+msgstr "{'required':True}"
+
+#. module: l10n_cr_account_profit_statement_report
+#: view:profit.statement.report.wiz:0
+msgid "[('type', '=', 'sum'),('account_type.code','=','PROSTA')]"
+msgstr "[('type', '=', 'sum'),('account_type.code','=','PROSTA')]"
+
+#. module: l10n_cr_account_profit_statement_report
+#: help:profit.statement.report.wiz,amount_currency:0
+msgid "It adds the currency column on report if the currency differs from the company currency."
+msgstr "Añade la columna de moneda en el reporte si la moneda es diferente de la moneda de la compañía."
+
+#. module: l10n_cr_account_profit_statement_report
+#: report:addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako:38
+msgid "Acum. Fiscal Year"
+msgstr "Acum. Año Fiscal"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,base_compare_account:0
+msgid "Base Income Account"
+msgstr "Cuenta base de Ingreso"
+
+#. module: l10n_cr_account_profit_statement_report
+#: view:account.account.type:0
+msgid "Configuration for Profit Statement Report"
+msgstr "Configuración para el reporte de Estado de Resultados"
+
+#. module: l10n_cr_account_profit_statement_report
+#: view:profit.statement.report.wiz:0
+msgid "Period"
+msgstr "Período"
+
+#. module: l10n_cr_account_profit_statement_report
+#: model:ir.model,name:l10n_cr_account_profit_statement_report.model_account_account_type
+msgid "Account Type"
+msgstr "Tipo de cuenta"
+
+#. module: l10n_cr_account_profit_statement_report
+#: report:addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako:21
+#: view:profit.statement.report.wiz:0
+msgid "Profit Statement"
+msgstr "Estado de Resultados"
+
+#. module: l10n_cr_account_profit_statement_report
+#: help:profit.statement.report.wiz,historic_strict:0
+msgid "If selected, will display a historical unreconciled lines, taking into account the end of the period or date selected"
+msgstr "Si se selecciona, se desplegará el histórico de las líneas no conciliadas, tomando en cuenta el final del período o la fecha seleccionada"
+
+#. module: l10n_cr_account_profit_statement_report
+#: report:addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako:31
+msgid "Account<br />Name"
+msgstr "Account<br />Name"
+
+#. module: l10n_cr_account_profit_statement_report
+#: report:addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako:34
+msgid "Selected period"
+msgstr "Período seleccionado"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,company_id:0
+msgid "Company"
+msgstr "Compañía"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,amount_currency:0
+msgid "With Currency"
+msgstr "Con moneda"
+
+#. module: l10n_cr_account_profit_statement_report
+#: report:addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako:36
+msgid "Variation"
+msgstr "Variación"
+
+#. module: l10n_cr_account_profit_statement_report
+#: view:profit.statement.report.wiz:0
+msgid "{'invisible': True, 'required': False}"
+msgstr "{'invisible': True, 'required': False}"
+
+#. module: l10n_cr_account_profit_statement_report
+#: selection:profit.statement.report.wiz,filter:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: l10n_cr_account_profit_statement_report
+#: view:profit.statement.report.wiz:0
+msgid "This report allows you to print or generate a pdf of your profit statement"
+msgstr "Este informe le permite imprimir o generar un pdf del Estado de Resultados"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,chart_account_id:0
+msgid "Chart of Account"
+msgstr "Catálogo de cuentas"
+
+#. module: l10n_cr_account_profit_statement_report
+#: report:addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako:37
+msgid "Var."
+msgstr "Var."
+
+#. module: l10n_cr_account_profit_statement_report
+#: view:profit.statement.report.wiz:0
+#: field:profit.statement.report.wiz,journal_ids:0
+msgid "Journals"
+msgstr "Diarios"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,target_move:0
+msgid "Target Moves"
+msgstr "Movimientos destino"
+
+#. module: l10n_cr_account_profit_statement_report
+#: help:profit.statement.report.wiz,chart_account_id:0
+msgid "Select Charts of Accounts"
+msgstr "Seleccionar catálogo de cuentas"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,date_to:0
+msgid "End Date"
+msgstr "Fecha final"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,period_from:0
+msgid "Start Period"
+msgstr "Período Inicial"
+
+#. module: l10n_cr_account_profit_statement_report
+#: view:profit.statement.report.wiz:0
+msgid "{'invisible': True}"
+msgstr "{'invisible': True}"
+
+#. module: l10n_cr_account_profit_statement_report
+#: selection:profit.statement.report.wiz,target_move:0
+msgid "All Posted Entries"
+msgstr "Todos los apuntes publicados"
+
+#. module: l10n_cr_account_profit_statement_report
+#: view:profit.statement.report.wiz:0
+msgid "{'required': True}"
+msgstr "{'required': True}"
+
+#. module: l10n_cr_account_profit_statement_report
+#: help:profit.statement.report.wiz,fiscalyear_id:0
+msgid "Keep empty for all open fiscal year"
+msgstr "Mantener vacío para todos los años fiscales"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,period_to:0
+msgid "End Period"
+msgstr "Período final"
+
+#. module: l10n_cr_account_profit_statement_report
+#: model:ir.actions.act_window,name:l10n_cr_account_profit_statement_report.action_profit_statement_report_menu_webkit
+msgid "Action Profit Statement Report"
+msgstr "Generar reporte de Estado de Resultados"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,fiscalyear_id:0
+msgid "Fiscal Year"
+msgstr "Año Fiscal"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,historic_strict:0
+msgid "Strict History"
+msgstr "Histórico estricto"
+
+#. module: l10n_cr_account_profit_statement_report
+#: selection:profit.statement.report.wiz,filter:0
+msgid "No Filters"
+msgstr "Sin Filtros"
+
+#. module: l10n_cr_account_profit_statement_report
+#: report:addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako:95
+msgid "Authorized by: "
+msgstr "Autorizado por: "
+
+#. module: l10n_cr_account_profit_statement_report
+#: view:profit.statement.report.wiz:0
+msgid "Advanced options"
+msgstr "Opciones avanzadas"
+
+#. module: l10n_cr_account_profit_statement_report
+#: help:profit.statement.report.wiz,base_compare_account:0
+msgid "This account is the base for compare all other accounts in report."
+msgstr "Esta cuenta es la base para comparar todas las otras cuentas en este reporte"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,special_period:0
+msgid "Special period"
+msgstr "Período especial"
+
+#. module: l10n_cr_account_profit_statement_report
+#: report:addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako:36
+msgid "Prev. vs Sel."
+msgstr "Prev. vs Sel."
+
+#. module: l10n_cr_account_profit_statement_report
+#: view:profit.statement.report.wiz:0
+msgid "True"
+msgstr "True"
+
+#. module: l10n_cr_account_profit_statement_report
+#: model:ir.model,name:l10n_cr_account_profit_statement_report.model_profit_statement_report_wiz
+msgid "Profit Statement Report Wizard"
+msgstr "Generar reporte de Estado de Resultados"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,account_base_report:0
+msgid "Account Base Report"
+msgstr "Informe Finaciero Base"
+
+#. module: l10n_cr_account_profit_statement_report
+#: help:profit.statement.report.wiz,special_period:0
+msgid "Include special period"
+msgstr "Incluir período especial"
+
+#. module: l10n_cr_account_profit_statement_report
+#: view:profit.statement.report.wiz:0
+#: field:profit.statement.report.wiz,account_ids:0
+msgid "Accounts"
+msgstr "Cuentas"
+
+#. module: l10n_cr_account_profit_statement_report
+#: selection:profit.statement.report.wiz,filter:0
+msgid "Periods"
+msgstr "Períodos"
+
+#. module: l10n_cr_account_profit_statement_report
+#: report:addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako:30
+msgid "Account<br />Code"
+msgstr "Account<br />Code"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,date_from:0
+msgid "Start Date"
+msgstr "Fecha inicial"
+
+#. module: l10n_cr_account_profit_statement_report
+#: field:profit.statement.report.wiz,filter:0
+msgid "Filter by"
+msgstr "Filtrar por"
+
+#. module: l10n_cr_account_profit_statement_report
+#: report:addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako:22
+msgid "Fiscal Year:"
+msgstr "Año fiscal:"
+
+#. module: l10n_cr_account_profit_statement_report
+#: selection:profit.statement.report.wiz,target_move:0
+msgid "All Entries"
+msgstr "Todos los apuntes"
+
+#. module: account
+#: model:ir.ui.menu,name:account.menu_account_report_pl
+msgid "Profit And Loss"
+msgstr "Estado de Resultados"
+
=== added file 'l10n_cr_account_profit_statement_report/l10n_cr_account_profit_statement_report.py'
--- l10n_cr_account_profit_statement_report/l10n_cr_account_profit_statement_report.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/l10n_cr_account_profit_statement_report.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,38 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import fields, orm, osv
+from tools.translate import _
+
+class acccountAccounttypeProfitstatement(orm.Model):
+ """
+ This class extend functions of account.account.type
+
+ If include_profit_statement_report is checked, those accounts that have this account_type and type == 'view' are include in Profit Statement Report.
+
+ """
+ _name = "account.account.type"
+ _inherit = "account.account.type"
+
+ _columns = {
+ 'include_profit_statement_report': fields.boolean('Include in Profit Statement Report', help="If it's checked, the account that have this type is include in Profit Statement Report Wizard as Base Account to compare.")
+ }
\ No newline at end of file
=== added file 'l10n_cr_account_profit_statement_report/l10n_cr_account_profit_statement_report.xml'
--- l10n_cr_account_profit_statement_report/l10n_cr_account_profit_statement_report.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/l10n_cr_account_profit_statement_report.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <!-- Account Type -->
+ <record id="view_account_type_profit_form_inherit" model="ir.ui.view">
+ <field name="name">account.account.type.profit.form.inherit</field>
+ <field name="model">account.account.type</field>
+ <field name="inherit_id" ref="account.view_account_type_form"/>
+ <field name="arch" type="xml">
+ <field name="note" position="after">
+ <group col="4" string="Configuration for Profit Statement Report">
+ <field name="include_profit_statement_report"/>
+ </group>
+ </field>
+ </field>
+ </record>
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_profit_statement_report/report'
=== added file 'l10n_cr_account_profit_statement_report/report/__init__.py'
--- l10n_cr_account_profit_statement_report/report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/report/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_account_profit_statement_report
=== added file 'l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako'
--- l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako 2013-11-06 21:08:21 +0000
@@ -0,0 +1,116 @@
+<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <link rel='stylesheet' href='addons/account_webkit_report_library/webkit_headers/main.css' />
+ <style>
+ ${css}
+ </style>
+ </head>
+ <body class="data">
+ <%setLang(user.lang)%>
+ <%
+ last_period = get_last_period(cr, uid, data)
+ balance_data = get_data(cr, uid, data)
+ fiscalyear = get_fiscal_year(data)
+ %>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell logo">${helper.embed_logo_by_name('default_logo', height=80)|n}</div>
+ <div class="table-cell text">
+ <p class="company">${fiscalyear.company_id.partner_id.name}</p>
+ <p class="title">${_('Profit Statement')}</p>
+ <p class="subtitle">${_('Fiscal Year:')} ${fiscalyear.name} - ${_('Until Period:')} ${get_start_period(data).name}</p>
+ </div>
+ </div>
+ </div>
+ <br/><br/>
+ <div class="table list">
+ <div class="table-header">
+ <div class="table-row labels no-wrap">
+ <div class="table-cell first-column" style="width: 70px">${_('Account<br />Code')}</div>
+ <div class="table-cell" style="width: 430px">${_('Account<br />Name')}</div>
+ <div class="table-cell" style="width: 100px">${_('Previous period')}<br />${last_period.name}</div>
+ <div class="table-cell" style="width: 40px">${_('%')}<br />${_('V')}</div>
+ <div class="table-cell" style="width: 100px">${_('Selected period')}<br />${get_start_period(data).name}</div>
+ <div class="table-cell" style="width: 40px">${_('%')}<br />${_('V')}</div>
+ <div class="table-cell" style="width: 100px">${_('Variation')}<br />${_('Prev. vs Sel.')}</div>
+ <div class="table-cell" style="width: 40px">${_('Var.')}<br />${_('%')}</div>
+ <div class="table-cell" style="width: 100px">${_('Acum. Fiscal Year')}<br />${fiscalyear.name}</div>
+ <div class="table-cell last-column" style="width: 40px">${_('%')}<br />${_('V')}</div>
+ </div>
+ </div>
+ <div class="table-body">
+ <% row_even = False %>
+ %for account in balance_data:
+ %if account['level'] == 0 or account['is_parent'] == 'True' :
+ <div class="table-row bold ${row_even and 'even' or 'odd'}">
+ %elif 'child' in account:
+ <div class="table-row bold ${row_even and 'even' or 'odd'}">
+ %else:
+ <div class="table-row ${row_even and 'even' or 'odd'}">
+ %endif
+ <div class="table-cell first-column">${account['code']}</div>
+ <div class="table-cell" style="padding-left:${account['level']*10}px" >${account['name']}</div>
+ %if account['is_parent'] == False:
+ <div class="table-cell amount">${formatLang(account['balance_total_last_period'])}</div>
+ <div class="table-cell amount">${formatLang(account['balance_total_percentage_last_period'])}</div>
+ <div class="table-cell amount" >${formatLang(account['balance_total_period'])}</div>
+ <div class="table-cell amount" >${formatLang(account['balance_total_percentage_period'])}</div>
+ <div class="table-cell amount" >${formatLang(account['balance_total_variation'])}</div>
+ <div class="table-cell amount" >${formatLang(account['balance_total_percentage_variation'])}</div>
+ <div class="table-cell amount" >${formatLang(account['balance_total_fiscal_year'])}</div>
+ <div class="table-cell amount" >${formatLang(account['balance_total_percentage_fiscal_year'])}</div>
+ %else:
+ <div class="table-cell amount">${account['balance_total_last_period']}</div>
+ <div class="table-cell amount">${account['balance_total_percentage_last_period']}</div>
+ <div class="table-cell amount" >${account['balance_total_period']}</div>
+ <div class="table-cell amount" >${account['balance_total_percentage_period']}</div>
+ <div class="table-cell amount" >${account['balance_total_variation']}</div>
+ <div class="table-cell amount" >${account['balance_total_percentage_variation']}</div>
+ <div class="table-cell amount" >${account['balance_total_fiscal_year']}</div>
+ <div class="table-cell amount" >${account['balance_total_percentage_fiscal_year']}</div>
+ %endif
+
+ <%
+ if row_even:
+ row_even = False
+ else:
+ row_even = True
+ %>
+ </div>
+ %endfor
+ </div>
+ </div>
+ <div class="table-row spacer">
+ <div class="table-cell"> </div>
+ </div>
+ <%
+ signatures = get_signatures_report(cr, uid, 'Profit Statement')
+ cont = 0
+ %>
+ %if len(signatures) > 0:
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ <p class="title">${_('Authorized by: ')}</p>
+ </div>
+ </div>
+ </div>
+ <br/><br/>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ %for user_sign in signatures:
+ <div class="table-cell text">_________________________________________________________<br/>
+ <p class="subtitle">${user_sign.name}</p>
+ <p class="company"><i>${user_sign.job_id.name or ''}</i></p>
+ </div>
+ <br/><br/><br/>
+ </div>
+ %endfor
+ </div>
+ </div>
+ %endif
+ <p style="page-break-after:always"></p>
+ </body>
+</html>
=== added file 'l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.py'
--- l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,639 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from copy import copy
+import pooler
+from report import report_sxw
+from tools.translate import _
+import types
+from osv import fields, orm
+
+from openerp.addons.account_report_lib.account_report_base import accountReportbase
+
+class profitStatementreport(accountReportbase):
+ def __init__(self, cr, uid, name, context):
+ super(profitStatementreport, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update({
+ 'cr': cr,
+ 'uid': uid,
+ 'get_last_period': self.get_last_period,
+ 'get_base_account_compare': self.get_base_account_compare,
+ 'get_data': self.get_data,
+ })
+
+ #Get base account to compare result
+ def get_base_account_compare(self, data):
+ return self._get_info(data, 'base_compare_account', 'account.account')
+
+ #Get last period based in period selected.
+ def get_last_period(self, cr, uid, data):
+ start_period = self.get_start_period(data)
+ return self.pool.get('account.period').get_last_period(cr,uid,start_period)
+
+ '''
+ If the display_detail == display_flat, compute all the balance, debit, credit and initial_balance and return
+ one result for each type account selected in the list.
+ @param child_list: Can be a list of ids (int) or a browse record list.
+ '''
+ def compute_data(self, cr, uid, result_dict, child_list):
+ balance = 0.0
+
+ #Child list can be a list of int or browse_record list
+ for c in child_list:
+ if isinstance(c, orm.browse_record):
+ if c.id in result_dict.keys():
+ balance += result_dict[c.id]['balance']
+
+ elif isinstance(c, int):
+ if c in result_dict.keys():
+ balance += result_dict[c]['balance']
+
+ return balance
+
+ """
+ Main methods to compute data. Split account.financial.report types in different
+ methods to improve usabillity and maintenance.
+ """
+ #Method for account.financial.report account_type type.
+ def get_data_account_type(self, cr, uid, base_account, fiscal_year, filter_type, period, last_period, structure={}, final_list=[]):
+
+ result_dict = {}
+ final_data_parent = {'child_list': []} #Define empty list, avoid problem when list is empty and key isn't created
+ final_data = {}
+ list_ids = []
+ child_list = []
+
+ library_obj = self.pool.get('account.webkit.report.library')
+
+ #1. Extract children. It's a list of dictionaries.
+ child_list = structure['account_type_child']
+
+ #Extract base_account selected and add id into list_ids to compute data.
+ base_account_id = base_account[0].id
+ list_ids.append(base_account_id)
+
+ '''
+ Display_detail = no_detail = special case
+ '''
+ #no_detail: Iterate in the list and compute result in one line.
+ if structure['display_detail'] == 'no_detail':
+ final_data_parent['name'] = structure['name']
+ final_data_parent['code'] = ''
+ final_data_parent['is_parent'] = False
+ final_data_parent['level'] = 0
+ final_data_parent['display_detail'] = 'no_detail'
+
+ #In account type, iterate in child, because child is all accounts that
+ #match with account types selected.
+
+ for parent, child in child_list.iteritems():
+ #Add child id to compute data
+ final_data_parent['child_list'] = child
+
+ for c in child:
+ list_ids.append(c.id)
+
+ if len(list_ids) > 0:
+ #In this report, call method three times, calculate balance for
+ # period selected
+ # last period
+ # fiscal year
+
+ #Period selected -> Change witch period take as start_period and end_period
+ result_dict_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=period.id,
+ end_period_id=period.id,
+ filter_type=filter_type)
+
+ #Last period
+ result_dict_last_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=last_period.id,
+ end_period_id=last_period.id,
+ filter_type=filter_type)
+
+ #Fiscal year
+ result_dict_fiscal_year = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ end_period_id=period.id,
+ fiscal_year_id=fiscal_year.id,
+ filter_type=filter_type)
+
+ ##Extract results for base_account selected in wizard.
+ base_account_last_period = result_dict_last_period[base_account_id]['balance']
+ base_account_period = result_dict_period[base_account_id]['balance']
+ base_account_total_variation = base_account_period - base_account_last_period
+ base_account_fiscal_year = result_dict_fiscal_year[base_account_id]['balance']
+ base_account_percentage_period = 100
+ base_account_percentage_last_period = 100
+ base_account_percentage_variation = base_account_last_period != 0 and (100 * base_account_total_variation / base_account_last_period) or 0
+ base_account_percentage_fiscalyear = 100
+
+ balance_period = 0.0
+ balance_last_period = 0.0
+ balance_fiscal_year = 0.0
+ balance_total_variation = 0.0
+
+ for parent, child in child_list.iteritems():
+ #Get results for all groups that belongs to account_type.
+ balance_period += self.compute_data(cr, uid, result_dict_period, child)
+ balance_last_period += self.compute_data(cr, uid, result_dict_last_period, child)
+ balance_fiscal_year += self.compute_data(cr, uid, result_dict_fiscal_year, child)
+ balance_total_variation += balance_period - balance_last_period
+
+ #Update dictionary
+ final_data_parent.update({
+ 'balance_total_period': balance_period,
+ 'balance_total_last_period': balance_last_period,
+ 'balance_total_variation': balance_period - balance_last_period,
+ 'balance_total_fiscal_year':base_account_fiscal_year,
+ 'balance_total_percentage_last_period': base_account_last_period != 0 and (100 * balance_last_period / base_account_last_period) or 0,
+ 'balance_total_percentage_period': base_account_period != 0 and (100 * balance_period / base_account_period) or 0,
+ 'balance_total_percentage_variation': balance_last_period != 0 and (100 * balance_total_variation / balance_last_period) or 0,
+ 'balance_total_percentage_fiscal_year': base_account_fiscal_year != 0 and (100 * balance_fiscal_year / base_account_fiscal_year) or 0,
+ })
+
+ #Update the dictionary with final results.
+ final_list.append(copy(final_data_parent))
+
+ else:
+ final_data_parent.update({
+ 'balance_total_period': 0.0,
+ 'balance_total_last_period': 0.0,
+ 'balance_total_variation': 0.0,
+ 'balance_total_fiscal_year':0.0,
+ 'balance_total_percentage_period': 0.0,
+ 'balance_total_percentage_last_period': 0.0,
+ 'balance_total_percentage_variation': 0.0,
+ 'balance_total_percentage_fiscal_year': 0.0,
+ })
+
+ #Update the dictionary with final results.
+ final_list.append(copy(final_data_parent))
+
+ else:
+ '''
+ Optimization process: Call get_account_balance the least possible.
+ '''
+ if child_list:
+ #2. Create dictionaries for parent and children.
+ for parent, child in child_list.iteritems():
+ final_data_parent['id'] = parent.id
+ final_data_parent['name'] = parent.name
+ final_data_parent['code'] = parent.code
+ final_data_parent['level'] = 0
+
+ if child != []:
+ final_data_parent['child_list'] = child
+ else:
+ final_data_parent['child_list'] = []
+
+ if structure['display_detail'] == 'detail_flat':
+ final_data_parent['is_parent'] = False #Distinct child from parent.
+ #Update keys to numbers, because this keys now show results
+ final_data_parent['balance_total_period'] = 0.0
+ final_data_parent['balance_total_last_period'] = 0.0
+ final_data_parent['balance_total_variation'] = 0.0
+ final_data_parent['balance_total_fiscal_year'] = 0.0
+ final_data_parent['balance_total_percentage_period'] = 0.0,
+ final_data_parent['balance_total_percentage_last_period'] = 0.0
+ final_data_parent['balance_total_percentage_variation'] = 0.0
+ final_data_parent['balance_total_percentage_fiscal_year'] = 0.0
+
+ #Add parent into list
+ final_list.append(copy(final_data_parent))
+
+ elif structure['display_detail'] == 'detail_with_hierarchy':
+ final_data_parent['is_parent'] = True #Distinct child from parent.
+ final_data_parent['balance_total_period'] = ''
+ final_data_parent['balance_total_last_period'] = ''
+ final_data_parent['balance_total_variation'] = ''
+ final_data_parent['balance_total_fiscal_year'] = ''
+ final_data_parent['balance_total_percentage_period'] = ''
+ final_data_parent['balance_total_percentage_last_period'] = ''
+ final_data_parent['balance_total_percentage_variation'] = ''
+ final_data_parent['balance_total_percentage_fiscal_year'] = ''
+
+ #Add parent into list
+ final_list.append(copy(final_data_parent))
+
+ #Build child in a dictionary
+ if 'child_list' in final_data_parent.keys():
+ for c in final_data_parent['child_list']:
+ final_data['id'] = c.id
+ final_data['level'] = c.level
+ if 'child' in final_data:
+ final_data['child'] = c.child
+ final_data['name'] = c.name
+ final_data['code'] = c.code
+ final_data['is_parent'] = False
+
+ final_list.append(copy(final_data))
+
+ #Add child in final list and id to compute data.
+ for c in child:
+ list_ids.append(c.id)
+
+ if len(list_ids) > 0:
+ #Compute the balance for child ids list.
+ #Period selected -> Change witch period take as start_period and end_period
+ result_dict_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=period.id,
+ end_period_id=period.id,
+ filter_type=filter_type)
+
+ #Last period
+ result_dict_last_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=last_period.id,
+ end_period_id=last_period.id,
+ filter_type=filter_type)
+
+ #Fiscal year
+ result_dict_fiscal_year = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ end_period_id=period.id,
+ fiscal_year_id=fiscal_year.id,
+ filter_type=filter_type)
+
+
+ ##Extract results for base_account selected in wizard.
+ base_account_last_period = result_dict_last_period[base_account_id]['balance']
+ base_account_period = result_dict_period[base_account_id]['balance']
+ base_account_total_variation = base_account_period - base_account_last_period
+ base_account_fiscal_year = result_dict_fiscal_year[base_account_id]['balance']
+ base_account_percentage_period = 100
+ base_account_percentage_last_period = 100
+ base_account_percentage_variation = base_account_last_period != 0 and (100 * base_account_total_variation / base_account_last_period) or 0
+ base_account_percentage_fiscalyear = 100
+
+ #Iterate again the list for improve performance. Compute results.
+ if structure['display_detail'] == 'detail_flat':
+ #final_list has categories and child of this categories
+ #Compute results for each category
+ for data in final_list:
+ if 'child_list' in data.keys():
+ #Balance for all accounts (compare with base_account_selected)
+ balance_period = self.compute_data(cr, uid, result_dict_period, data['child_list'])
+ balance_last_period = self.compute_data(cr, uid, result_dict_last_period, data['child_list'])
+ balance_fiscal_year = self.compute_data(cr, uid, result_dict_fiscal_year, data['child_list'])
+ balance_total_variation = balance_period - balance_last_period
+
+ #Update dictionary
+ data.update({
+ 'balance_total_period': balance_period,
+ 'balance_total_last_period': balance_last_period,
+ 'balance_total_variation': balance_total_variation,
+ 'balance_total_fiscal_year':balance_fiscal_year,
+ 'balance_total_percentage_period': base_account_period != 0 and (100 * balance_period / base_account_period) or 0,
+ 'balance_total_percentage_last_period': base_account_last_period != 0 and (100 * balance_last_period / base_account_last_period) or 0,
+ 'balance_total_percentage_variation': balance_last_period != 0 and (100 * balance_total_variation / balance_last_period) or 0,
+ 'balance_total_percentage_fiscal_year': base_account_fiscal_year != 0 and (100 * balance_fiscal_year / base_account_fiscal_year) or 0,
+ })
+
+ #For this case, search id account in dictionary results and update dictionary.
+ #Categories id can't be in dictionary result
+ elif structure['display_detail'] == 'detail_with_hierarchy':
+ for data in final_list:
+ if 'id' in data.keys():
+ if data['is_parent'] == False and \
+ (data['id'] in result_dict_period.keys() and data['id'] in result_dict_last_period.keys() and data['id'] in result_dict_fiscal_year.keys()):
+
+ balance_total_period = result_dict_period[data['id']]['balance']
+ balance_total_last_period = result_dict_last_period[data['id']]['balance']
+ balance_fiscal_year = result_dict_fiscal_year[data['id']]['balance']
+ balance_total_variation = balance_total_period - balance_total_last_period
+
+ data.update({
+ 'balance_total_period': balance_total_period,
+ 'balance_total_last_period': balance_total_last_period,
+ 'balance_total_fiscal_year': balance_fiscal_year,
+ 'balance_total_variation': balance_total_variation,
+ 'balance_total_percentage_period': base_account_period != 0 and (100 * balance_total_period / base_account_period) or 0,
+ 'balance_total_percentage_last_period': base_account_last_period != 0 and (100 * balance_total_last_period / base_account_last_period) or 0,
+ 'balance_total_percentage_variation': balance_total_last_period != 0 and (100 * balance_total_variation / balance_total_last_period) or 0,
+ 'balance_total_percentage_fiscal_year': base_account_fiscal_year != 0 and (100 * balance_fiscal_year / base_account_fiscal_year) or 0,
+
+ })
+
+ return final_list
+
+ def get_data_accounts(self, cr, uid, base_account, fiscal_year, filter_type, period, last_period, structure={}, final_list=[]):
+ result_dict = {}
+ final_data_parent = {'child_list': []} #Define empty list, avoid problem when list is empty and key isn't created
+ final_data = {}
+ list_ids = []
+ child_list = []
+
+ library_obj = self.pool.get('account.webkit.report.library')
+
+ #1. Extract children. It's a list of dictionaries.
+ child_list = structure['account_child']
+
+ #Extract base_account selected and add id into list_ids to compute data.
+ base_account_id = base_account[0].id
+ list_ids.append(base_account_id)
+
+ '''
+ Display_detail = no_detail = special case
+ '''
+ #no_detail: Iterate in the list and compute result in one line.
+ if structure['display_detail'] == 'no_detail':
+ final_data_parent['name'] = structure['name']
+ final_data_parent['code'] = ''
+ final_data_parent['is_parent'] = False
+ final_data_parent['level'] = 0
+ final_data_parent['display_detail'] = 'no_detail'
+
+ #For accounts append parents, no childs.
+ for parent, child in child_list.iteritems():
+ list_ids.append(parent.id)
+
+ if len(list_ids) > 0:
+ #In this report, call method three times, calculate balance for
+ # period selected
+ # last period
+ # fiscal year
+
+ #Period selected -> Change witch period take as start_period and end_period
+ result_dict_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=period.id,
+ end_period_id=period.id,
+ filter_type=filter_type)
+
+ #Last period
+ result_dict_last_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=last_period.id,
+ end_period_id=last_period.id,
+ filter_type=filter_type)
+
+ #Fiscal year
+ result_dict_fiscal_year = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ end_period_id=period.id,
+ fiscal_year_id=fiscal_year.id,
+ filter_type=filter_type)
+
+ ##Extract results for base_account selected in wizard.
+ base_account_last_period = result_dict_last_period[base_account_id]['balance']
+ base_account_period = result_dict_period[base_account_id]['balance']
+ base_account_total_variation = base_account_period - base_account_last_period
+ base_account_fiscal_year = result_dict_fiscal_year[base_account_id]['balance']
+ base_account_percentage_period = 100
+ base_account_percentage_last_period = 100
+ base_account_percentage_variation = base_account_last_period != 0 and (100 * base_account_total_variation / base_account_last_period) or 0
+ base_account_percentage_fiscalyear = 100
+
+ balance_period = 0.0
+ balance_last_period = 0.0
+ balance_fiscal_year = 0.0
+ balance_total_variation = 0.0
+
+ for parent, child in child_list.iteritems():
+ balance_period += result_dict_period[parent.id]['balance']
+ balance_last_period += result_dict_last_period[parent.id]['balance']
+ balance_fiscal_year += result_dict_fiscal_year[parent.id]['balance']
+ balance_total_variation += balance_period - balance_last_period
+
+ #Update dictionary
+ final_data_parent.update({
+ 'balance_total_last_period': balance_last_period,
+ 'balance_total_percentage_last_period': base_account_last_period != 0 and (100 * (balance_last_period / base_account_last_period)) or 0,
+ 'balance_total_period': balance_period,
+ 'balance_total_percentage_period': base_account_period != 0 and (100 * balance_period / base_account_period) or 0,
+ 'balance_total_variation': balance_period - balance_last_period,
+ 'balance_total_fiscal_year':balance_fiscal_year,
+ 'balance_total_percentage_variation': balance_last_period != 0 and (100 * (balance_total_variation / balance_last_period)) or 0,
+ 'balance_total_percentage_fiscal_year': base_account_fiscal_year != 0 and (100 * balance_fiscal_year / base_account_fiscal_year) or 0,
+ })
+
+ #Update the dictionary with final results.
+ final_list.append(copy(final_data_parent))
+
+ else:
+ final_data_parent.update({
+ 'balance_total_period': 0.0,
+ 'balance_total_last_period': 0.0,
+ 'balance_total_variation': 0.0,
+ 'balance_total_fiscal_year':0.0,
+ 'balance_total_percentage_period': 0.0,
+ 'balance_total_percentage_last_period': 0.0,
+ 'balance_total_percentage_variation': 0.0,
+ 'balance_total_percentage_fiscal_year': 0.0,
+ })
+
+ #Update the dictionary with final results.
+ final_list.append(copy(final_data_parent))
+
+ else:
+ '''
+ Optimization process: Call get_account_balance the least possible.
+ '''
+ if child_list:
+ for parent, child in child_list.iteritems():
+ final_data_parent['id'] = parent.id
+ final_data_parent['name'] = parent.name
+ final_data_parent['code'] = parent.code
+ final_data_parent['is_parent'] = False #In Both case, parents show numerics results
+ final_data_parent['level'] = 0
+
+ if child != []:
+ final_data_parent['child_list'] = child
+ else:
+ final_data_parent['child_list'] = []
+
+ final_data_parent['initial_balance'] = 0.0
+ final_data_parent['debit'] = 0.0
+ final_data_parent['credit'] = 0.0
+ final_data_parent['balance'] = 0.0
+
+ final_list.append(copy(final_data_parent))
+
+ #For detail_flat, append parent.id, that is id for account selected in list.
+ if structure['display_detail'] == 'detail_flat':
+ list_ids.append(parent.id)
+
+ #Build list of data child.
+ if structure['display_detail'] == 'detail_with_hierarchy':
+ for c in child:
+ list_ids.append(c.id) #Add child.id
+
+ if c.id != parent.id: #Avoid duplicate accounts.
+ final_data['id'] = c.id
+ final_data['level'] = c.level
+ if 'child' in final_data:
+ final_data['child'] = c.child
+ final_data['name'] = c.name
+ final_data['code'] = c.code
+ final_data['is_parent'] = False
+
+ final_list.append(copy(final_data))
+
+ #if parent.id don't exist in list, add it
+ if parent.id not in list_ids:
+ #Add parent.id
+ list_ids.append(parent.id)
+
+ if len(list_ids) > 0:
+ #In this report, call method three times, calculate balance for
+ # period selected
+ # last period
+ # fiscal year
+
+ #Period selected -> Change witch period take as start_period and end_period
+ result_dict_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=period.id,
+ end_period_id=period.id,
+ filter_type=filter_type)
+
+ #Last period
+ result_dict_last_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=last_period.id,
+ end_period_id=last_period.id,
+ filter_type=filter_type)
+
+ #Fiscal year
+ result_dict_fiscal_year = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ end_period_id=period.id,
+ fiscal_year_id=fiscal_year.id,
+ filter_type=filter_type)
+
+ ##Extract results for base_account selected in wizard.
+ base_account_last_period = result_dict_last_period[base_account_id]['balance']
+ base_account_period = result_dict_period[base_account_id]['balance']
+ base_account_total_variation = base_account_period - base_account_last_period
+ base_account_fiscal_year = result_dict_fiscal_year[base_account_id]['balance']
+ base_account_percentage_period = 100
+ base_account_percentage_last_period = 100
+ base_account_percentage_variation = base_account_last_period != 0 and (100 * base_account_total_variation / base_account_last_period) or 0
+ base_account_percentage_fiscalyear = 100
+
+ #Iterate again the list for improve performance. Compute results.
+ #In this case, accounts in list and child are in final_list, isn't necessary check wich type of display is.
+ #Check only if id is in result_dict keys.
+ for data in final_list:
+ if 'id' in data.keys():
+ if (data['id'] in result_dict_period.keys() and data['id'] in result_dict_last_period.keys() \
+ and data['id'] in result_dict_fiscal_year.keys()):
+
+ balance_total_period = result_dict_period[data['id']]['balance']
+ balance_total_last_period = result_dict_last_period[data['id']]['balance']
+ balance_fiscal_year = result_dict_fiscal_year[data['id']]['balance']
+ balance_total_variation = balance_total_period - balance_total_last_period
+
+ data.update({
+ 'balance_total_period': balance_total_period,
+ 'balance_total_last_period': balance_total_last_period,
+ 'balance_total_fiscal_year': balance_fiscal_year,
+ 'balance_total_variation': balance_total_variation,
+ 'balance_total_percentage_period': base_account_period != 0 and (100 * balance_total_period / base_account_period) or 0,
+ 'balance_total_percentage_last_period': base_account_last_period != 0 and (100 * balance_total_last_period / base_account_last_period) or 0,
+ 'balance_total_percentage_variation': balance_total_last_period != 0 and (100 * balance_total_variation / balance_total_last_period) or 0,
+ 'balance_total_percentage_fiscal_year': base_account_fiscal_year != 0 and (100 * balance_fiscal_year / base_account_fiscal_year) or 0,
+
+ })
+
+ return final_list
+
+ def get_total_result(self, cr, uid, main_structure, data, final_list=[]):
+
+ account_period_obj = self.pool.get('account.period')
+
+ period = self.get_start_period(data)
+ last_period = account_period_obj.get_last_period(cr, uid, period)
+ fiscal_year = self.get_fiscalyear(data)
+ filter_type = self.get_filter(data)
+
+ #Get base_account to compare
+ base_account = self.get_base_account_compare(data)
+
+ #################################################################################
+
+ '''
+ In the dictionary (main_structure['account_type_child'] or main_structure['account_child'])
+ the key is the account or type account and content is a list of child's account or
+ all the accounts that match with type account in the list.
+ '''
+
+ #The main account.financial.report (parent view) is always a dictionary.
+ #If the instance is a dictionary and doesn't has a parent_id is the main structure
+ #Child of main structure is a list.
+
+ #Clean list, avoid problem that repeat structure (print twice)
+ if final_list != []:
+ final_list = []
+
+ if isinstance(main_structure, list) == True:
+ #TODO: Implement account_report (Valor en informe)
+ for structure in main_structure:
+ if structure['type'] == 'account_type':
+ list_data = [] #Avoid repeat accounts when an account is in list and it's a child for account type selected.
+ final_list += self.get_data_account_type(cr, uid, base_account, fiscal_year, filter_type, period, last_period, structure, list_data)
+
+ elif structure['type'] == 'accounts':
+ list_data = [] #Avoid repeat accounts when an account is in list and it's a child for account type selected.
+ final_list += self.get_data_accounts(cr, uid, base_account, fiscal_year, filter_type, period, last_period, structure, list_data)
+
+ #Call the method only with a dictionary list.
+ if type(main_structure) is types.DictType:
+ self.get_total_result(cr, uid, main_structure['child'], data, final_list)
+
+ return final_list
+
+ #Call all the methods that extract data, and build final dictionary with all the result.
+ def get_data(self, cr, uid, data):
+
+ #1. Extract the account_financial_report.
+ account_financial_report = self.get_account_base_report(data)
+
+ #2. Call method that extract the account_financial_report
+ main_structure = self.pool.get('account.financial.report').get_structure_account_financial_report(cr, uid, account_financial_report.id)
+
+ #3. Return a dictionary with all result.
+ final_data = self.get_total_result(cr, uid, main_structure,data)
+
+ return final_data
+
+report_sxw.report_sxw(
+ 'report.l10n_cr_profit_statement_report',
+ 'account.account',
+ 'addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako',
+ parser=profitStatementreport)
=== added file 'l10n_cr_account_profit_statement_report/report/report.xml'
--- l10n_cr_account_profit_statement_report/report/report.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/report/report.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="account.account_financial_report_profitandloss0" model="ir.actions.report.xml">
+ <field name="report_type">webkit</field>
+ <field name="report_name">l10n_cr_profit_statement_report</field>
+ <field name="model">account.account</field>
+ <field name="type">ir.actions.report.xml</field>
+ <field name="name">Profit Statement</field>
+ <field name="report_rml">l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako</field>
+ <field name="report_file">l10n_cr_account_profit_statement_report/report/l10n_cr_account_profit_statement_report.mako</field>
+ <field name="webkit_header" ref="report_webkit_lib.webkit_header_clearcorp_official_portrait" />
+ </record>
+ </data>
+</openerp>
=== added file 'l10n_cr_account_profit_statement_report/report_menus.xml'
--- l10n_cr_account_profit_statement_report/report_menus.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/report_menus.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <menuitem icon="STOCK_PRINT"
+ name="Profit And Loss"
+ parent="account.final_accounting_reports"
+ action="action_profit_statement_report_menu_webkit"
+ id="account.menu_account_report_pl"/>
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_profit_statement_report/wizard'
=== added file 'l10n_cr_account_profit_statement_report/wizard/__init__.py'
--- l10n_cr_account_profit_statement_report/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/wizard/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_account_profit_statement_wizard
\ No newline at end of file
=== added file 'l10n_cr_account_profit_statement_report/wizard/l10n_cr_account_profit_statement_wizard.py'
--- l10n_cr_account_profit_statement_report/wizard/l10n_cr_account_profit_statement_wizard.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/wizard/l10n_cr_account_profit_statement_wizard.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,67 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import osv, fields
+
+class profitStatementreportWizard(osv.osv_memory):
+
+ _inherit = "account.report.wiz"
+ _name = "profit.statement.report.wiz"
+ _description = "Profit Statement Report Wizard"
+
+ #base_compare_account: Base account for compute balance. It will be use for compare rest of accounts in report.
+ #This account would be income account.
+ _columns = {
+ 'base_compare_account': fields.many2one('account.account', string='Base Income Account', help="This account is the base for compare all other accounts in report.")
+ }
+
+ _defaults = {
+ 'filter': 'filter_period',
+ }
+
+ def pre_print_report(self, cr, uid, ids, data, context=None):
+
+ if context is None:
+ context = {}
+
+ # read the bank_banlance, because this field don't belongs to the account.report.wiz
+ # this field is added by conciliation.bank.report.wiz and add to data['form']
+ vals = self.read(cr, uid, ids,['base_compare_account'], context=context)[0] #this method read the field and included it in the form (account.common.report has this method)
+
+ 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': 'l10n_cr_profit_statement_report',
+ 'datas': data
+ }
+
+profitStatementreportWizard()
=== added file 'l10n_cr_account_profit_statement_report/wizard/l10n_cr_account_profit_statement_wizard_view.xml'
--- l10n_cr_account_profit_statement_report/wizard/l10n_cr_account_profit_statement_wizard_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_profit_statement_report/wizard/l10n_cr_account_profit_statement_wizard_view.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="profit_statement_report_view_webkit" model="ir.ui.view">
+ <field name="name">Profit Statement Report</field>
+ <field name="model">profit.statement.report.wiz</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account_report_lib.account_report_lib_wizard_view"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/label[@string='']" position="replace">
+ <separator string="Profit Statement" colspan="4"/>
+ <label nolabel="1" colspan="4" string="This report allows you to print or generate a pdf of your profit statement"/>
+ </xpath>
+ <field name="target_move" position="attributes">
+ <attribute name="invisible">True</attribute>
+ </field>
+ <field name="fiscalyear_id" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+ <field name="period_from" position="replace">
+ <field widget="selection" name="period_from" string="Period" domain="[('state', '=', 'draft'),('special', '=', False)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}"/>
+ </field>
+ <field name="period_to" position="attributes">
+ <attribute name="attrs">{'invisible': True, 'required': False}</attribute>
+ </field>
+ <field name="special_period" position="attributes">
+ <attribute name="invisible">True</attribute>
+ </field>
+ <field name="filter" position="attributes">
+ <attribute name="readonly">True</attribute>
+ </field>
+ <xpath expr="//group[@name='Dates']" position="attributes">
+ <attribute name="invisible">True</attribute>
+ </xpath>
+ <group string="Journals" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+ <group string="Advanced options" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+
+ <group string="Accounts" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+
+ <field name="account_base_report" position="attributes">
+ <attribute name="attrs">{'required':True}</attribute>
+ <attribute name="domain">[('type', '=', 'sum'),('account_type.code','=','PROSTA')]</attribute>
+ </field>
+
+ <field name="account_base_report" position="after">
+ <field name="base_compare_account" required="True" domain="[('user_type.include_profit_statement_report','=', True),('type','=','view')]"/>
+ </field>
+ </data>
+ </field>
+ </record>
+
+ <record id="action_profit_statement_report_menu_webkit" model="ir.actions.act_window">
+ <field name="name">Action Profit Statement Report</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">profit.statement.report.wiz</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="profit_statement_report_view_webkit"/>
+ <field name="target">new</field>
+ </record>
+
+ <record model="ir.values" id="action_profit_statement_report_values_webkit">
+ <field name="model_id" ref="account.model_account_account"/>
+ <field name="object" eval="1"/>
+ <field name="name">Profit Statement Report</field>
+ <field name="key2">client_print_multi</field>
+ <field name="value"
+ eval="'ir.actions.act_window,' +str(ref('action_profit_statement_report_menu_webkit'))"/>
+ <field name="key">action</field>
+ <field name="model">account.account</field>
+ </record>
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_situation_balance_report'
=== added file 'l10n_cr_account_situation_balance_report/__init__.py'
--- l10n_cr_account_situation_balance_report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_situation_balance_report/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,24 @@
+# -*- 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 report
+import wizard
\ No newline at end of file
=== added file 'l10n_cr_account_situation_balance_report/__openerp__.py'
--- l10n_cr_account_situation_balance_report/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_situation_balance_report/__openerp__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,44 @@
+# -*- 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/>.
+#
+##############################################################################
+
+{
+ 'name': 'Situation Balance Report Webkit',
+ 'description': "Create the situation balance report",
+ 'version': '1.0',
+ 'author': 'CLEARCORP S.A.',
+ 'category': 'Finance',
+ 'website': "http://clearcorp.co.cr",
+ 'images': [],
+ 'depends': ['account_report_lib', 'account_report_signatures',
+ ],
+ 'init_xml': [],
+ 'demo_xml' : [],
+ 'update_xml': ['report/report.xml',
+ 'wizard/l10n_cr_account_situation_balance_wizard_view.xml',
+ 'report_menus.xml'
+ ],
+ 'test': [],
+ 'active': False,
+ 'installable': True,
+ 'license': 'AGPL-3',
+}
+
=== added directory 'l10n_cr_account_situation_balance_report/i18n'
=== added file 'l10n_cr_account_situation_balance_report/i18n/es_CR.po'
--- l10n_cr_account_situation_balance_report/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_situation_balance_report/i18n/es_CR.po 2013-11-06 21:08:21 +0000
@@ -0,0 +1,239 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * l10n_cr_account_situation_balance_report
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-08-12 22:12+0000\n"
+"PO-Revision-Date: 2013-08-12 22:12+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,amount_currency:0
+msgid "With Currency"
+msgstr "Con Moneda"
+
+#. module: l10n_cr_account_situation_balance_report
+#: model:ir.actions.act_window,name:l10n_cr_account_situation_balance_report.action_situation_balance_report_menu_webkit
+msgid "Action Situation Balance Report"
+msgstr "Generar Reporte Balance de Situación"
+
+#. module: l10n_cr_account_situation_balance_report
+#: report:addons/l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako:32
+msgid "Per. vs. FY Open."
+msgstr "Per. vs. AF abierto."
+
+#. module: l10n_cr_account_situation_balance_report
+#: help:situation.balance.report.wiz,amount_currency:0
+msgid "It adds the currency column on report if the currency differs from the company currency."
+msgstr "Añade una columna de moneda al reporte si la moneda es diferente de la moneda de la compañía"
+
+#. module: l10n_cr_account_situation_balance_report
+#: view:situation.balance.report.wiz:0
+msgid "Situation Balance Report"
+msgstr "Reporte Balance de Situación"
+
+#. module: l10n_cr_account_situation_balance_report
+#: view:situation.balance.report.wiz:0
+msgid "Period"
+msgstr "Período"
+
+#. module: l10n_cr_account_situation_balance_report
+#: model:ir.model,name:l10n_cr_account_situation_balance_report.model_situation_balance_report_wiz
+msgid "Situation Balance Report Wizard"
+msgstr "Generar Reporte Balance de Situación"
+
+#. module: l10n_cr_account_situation_balance_report
+#: help:situation.balance.report.wiz,historic_strict:0
+msgid "If selected, will display a historical unreconciled lines, taking into account the end of the period or date selected"
+msgstr "Si se selecciona se despliega las líneas sin conciliar históricas dentro de la cuenta al final del período o fecha seleccionado"
+
+#. module: l10n_cr_account_situation_balance_report
+#: report:addons/l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako:29
+msgid "Account<br />Name"
+msgstr "Account<br />Name"
+
+#. module: l10n_cr_account_situation_balance_report
+#: report:addons/l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako:31
+msgid "Selected period"
+msgstr "Período seleccionado"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,company_id:0
+msgid "Company"
+msgstr "Compañía"
+
+#. module: l10n_cr_account_situation_balance_report
+#: report:addons/l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako:19
+msgid "Situation Balance at "
+msgstr "Balance de situación del período "
+
+#. module: l10n_cr_account_situation_balance_report
+#: help:situation.balance.report.wiz,special_period:0
+msgid "Include special period"
+msgstr "Incluir período especial"
+
+#. module: l10n_cr_account_situation_balance_report
+#: report:addons/l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako:32
+msgid "Variation"
+msgstr "Variación"
+
+#. module: l10n_cr_account_situation_balance_report
+#: view:situation.balance.report.wiz:0
+msgid "{'invisible': True, 'required': False}"
+msgstr "{'invisible': True, 'required': False}"
+
+#. module: l10n_cr_account_situation_balance_report
+#: selection:situation.balance.report.wiz,filter:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,chart_account_id:0
+msgid "Chart of Account"
+msgstr "Catálogo de cuentas"
+
+#. module: l10n_cr_account_situation_balance_report
+#: report:addons/l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako:33
+msgid "Var."
+msgstr "Var."
+
+#. module: l10n_cr_account_situation_balance_report
+#: view:situation.balance.report.wiz:0
+#: field:situation.balance.report.wiz,journal_ids:0
+msgid "Journals"
+msgstr "Diarios"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,target_move:0
+msgid "Target Moves"
+msgstr "Movimientos destino"
+
+#. module: l10n_cr_account_situation_balance_report
+#: help:situation.balance.report.wiz,chart_account_id:0
+msgid "Select Charts of Accounts"
+msgstr "Seleccionar catálogo de cuentas"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,date_to:0
+msgid "End Date"
+msgstr "Fecha Final"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,period_from:0
+msgid "Start Period"
+msgstr "Período inicial"
+
+#. module: l10n_cr_account_situation_balance_report
+#: view:situation.balance.report.wiz:0
+msgid "{'invisible': True}"
+msgstr "{'invisible': True}"
+
+#. module: l10n_cr_account_situation_balance_report
+#: selection:situation.balance.report.wiz,target_move:0
+msgid "All Posted Entries"
+msgstr "Todos los apuntes publicados"
+
+#. module: l10n_cr_account_situation_balance_report
+#: view:situation.balance.report.wiz:0
+msgid "{'required': True}"
+msgstr "{'required': True}"
+
+#. module: l10n_cr_account_situation_balance_report
+#: help:situation.balance.report.wiz,fiscalyear_id:0
+msgid "Keep empty for all open fiscal year"
+msgstr "Mantener vacío para todo el año fiscal abierto"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,period_to:0
+msgid "End Period"
+msgstr "Período final"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,fiscalyear_id:0
+msgid "Fiscal Year"
+msgstr "Año fiscal"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,historic_strict:0
+msgid "Strict History"
+msgstr "Histórico Estricto"
+
+#. module: l10n_cr_account_situation_balance_report
+#: selection:situation.balance.report.wiz,filter:0
+msgid "No Filters"
+msgstr "Sin filtros"
+
+#. module: l10n_cr_account_situation_balance_report
+#: report:addons/l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako:82
+msgid "Authorized by: "
+msgstr "Autorizado por: "
+
+#. module: l10n_cr_account_situation_balance_report
+#: view:situation.balance.report.wiz:0
+msgid "Advanced options"
+msgstr "Opciones avanzadas"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,special_period:0
+msgid "Special period"
+msgstr "Período especial"
+
+#. module: l10n_cr_account_situation_balance_report
+#: view:situation.balance.report.wiz:0
+msgid "True"
+msgstr "True"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,account_base_report:0
+msgid "Account Base Report"
+msgstr "Informe Financiero Base"
+
+#. module: l10n_cr_account_situation_balance_report
+#: view:situation.balance.report.wiz:0
+msgid "This report allows you to print or generate a pdf of your income statement"
+msgstr "Este informe le permite imprimir o generar un pdf de su cuenta de resultados"
+
+#. module: l10n_cr_account_situation_balance_report
+#: report:addons/l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako:30
+msgid "Fiscal Year Opening"
+msgstr "Año fiscal abierto"
+
+#. module: l10n_cr_account_situation_balance_report
+#: view:situation.balance.report.wiz:0
+#: field:situation.balance.report.wiz,account_ids:0
+msgid "Accounts"
+msgstr "Cuentas"
+
+#. module: l10n_cr_account_situation_balance_report
+#: selection:situation.balance.report.wiz,filter:0
+msgid "Periods"
+msgstr "Períodos"
+
+#. module: l10n_cr_account_situation_balance_report
+#: report:addons/l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako:28
+msgid "Account<br />Code"
+msgstr "Account<br />Code"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,date_from:0
+msgid "Start Date"
+msgstr "Fecha inicial"
+
+#. module: l10n_cr_account_situation_balance_report
+#: field:situation.balance.report.wiz,filter:0
+msgid "Filter by"
+msgstr "Filtrado por"
+
+#. module: l10n_cr_account_situation_balance_report
+#: selection:situation.balance.report.wiz,target_move:0
+msgid "All Entries"
+msgstr "Todos los movimientos"
+
=== added directory 'l10n_cr_account_situation_balance_report/report'
=== added file 'l10n_cr_account_situation_balance_report/report/__init__.py'
--- l10n_cr_account_situation_balance_report/report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_situation_balance_report/report/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_account_financial_report_situation_balance_report
=== added file 'l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako'
--- l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako 2013-11-06 21:08:21 +0000
@@ -0,0 +1,103 @@
+<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <link rel='stylesheet' href='addons/report_webkit_lib/webkit_headers/main.css' />
+ <style>
+ ${css}
+ </style>
+ </head>
+ <body class="data">
+ <%setLang(user.lang)%>
+ <%
+ balance_data = get_data(cr, uid, data)
+ %>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell logo">${helper.embed_logo_by_name('default_logo', height=80)|n}</div>
+ <div class="table-cell text">
+ <p class="company">${get_fiscal_year(data).company_id.partner_id.name}</p>
+ <p class="title">${_('Situation Balance at ')}${formatLang(get_start_period(data).date_stop, date=True)}</p>
+ <p class="subtitle"> </p>
+ </div>
+ </div>
+ </div>
+ <br/><br/>
+ <div class="table list">
+ <div class="table-header">
+ <div class="table-row labels no-wrap">
+ <div class="table-cell first-column" style="width: 70px">${_('Account<br />Code')}</div>
+ <div class="table-cell" style="width: 650px">${_('Account<br />Name')}</div>
+ <div class="table-cell" style="width: 100px">${_('Fiscal Year Opening')}<br />${get_fiscal_year(data).name}</div>
+ <div class="table-cell" style="width: 100px">${_('Selected period')}<br />${get_start_period(data).name}</div>\
+ <div class="table-cell" style="width: 100px">${_('Variation')}<br />${_('Per. vs. FY Open.')}</div>
+ <div class="table-cell last-column" style="width: 40px">${_('Var.')}<br />${_('%')}</div>
+ </div>
+ </div>
+ <div class="table-body">
+ <% row_even = False %>
+ %for account in balance_data:
+ %if account['level'] == 0 or account['is_parent'] == 'True' :
+ <div class="table-row bold ${row_even and 'even' or 'odd'}">
+ %elif 'child' in account:
+ <div class="table-row bold ${row_even and 'even' or 'odd'}">
+ %else:
+ <div class="table-row ${row_even and 'even' or 'odd'}">
+ %endif
+ <div class="table-cell first-column">${account['code']}</div>
+ <div class="table-cell" style="padding-left:${account['level']*10}px" >${account['name']}</div>
+ %if account['is_parent'] == False:
+ <div class="table-cell amount">${formatLang(account['total_fiscal_year'])}</div>
+ <div class="table-cell amount">${formatLang(account['total_period'])}</div>
+ <div class="table-cell amount" >${formatLang(account['total_variation'])}</div>
+ <div class="table-cell amount" >${formatLang(account['total_percent_variation'])}</div>
+ %else:
+ <div class="table-cell amount">${account['total_fiscal_year']}</div>
+ <div class="table-cell amount">${account['total_period']}</div>
+ <div class="table-cell amount" >${account['total_variation']}</div>
+ <div class="table-cell amount" >${account['total_percent_variation']}</div>
+
+ %endif
+
+ <%
+ if row_even:
+ row_even = False
+ else:
+ row_even = True
+ %>
+ </div>
+ %endfor
+ </div>
+ </div>
+ <div class="table-row spacer">
+ <div class="table-cell"> </div>
+ </div>
+ <%
+ signatures = get_signatures_report(cr, uid, 'Situation Balance Report')
+ cont = 0
+ %>
+ %if len(signatures) > 0:
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ <p class="title">${_('Authorized by: ')}</p>
+ </div>
+ </div>
+ </div>
+ <br/><br/>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ %for user_sign in signatures:
+ <div class="table-cell text">_________________________________________________________<br/>
+ <p class="subtitle">${user_sign.name}</p>
+ <p class="company"><i>${user_sign.job_id.name or ''}</i></p>
+ </div>
+ <br/><br/><br/>
+ </div>
+ %endfor
+ </div>
+ </div>
+ %endif
+ <p style="page-break-after:always"></p>
+ </body>
+</html>
=== added file 'l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.py'
--- l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,475 @@
+# -*- 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 types
+import pooler
+from report import report_sxw
+from tools.translate import _
+from copy import copy
+from osv import fields, orm
+
+from openerp.addons.account_report_lib.account_report_base import accountReportbase
+
+class situationBalancereport(accountReportbase):
+
+ def __init__(self, cr, uid, name, context):
+ super(situationBalancereport, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update({
+ 'cr': cr,
+ 'uid':uid,
+ 'get_data': self.get_data,
+ })
+
+ '''
+ If the display_detail == display_flat, compute all the balance, debit, credit and initial_balance and return
+ one result for each type account selected in the list.
+ '''
+ def compute_balances(self, cr, uid, result_dict, child_list):
+ balance = 0.0
+
+ #Child list can be a list of int or browse_record list
+ for c in child_list:
+ if isinstance(c, orm.browse_record):
+ if c.id in result_dict.keys():
+ balance += result_dict[c.id]['balance']
+
+ elif isinstance(c, int):
+ if c in result_dict.keys():
+ balance += result_dict[c]['balance']
+
+ return balance
+
+ """
+ Main methods to compute data. Split account.financial.report types in different
+ methods to improve usabillity and maintenance.
+ """
+ #Method for account.financial.report account_type type.
+ def get_data_account_type(self, cr, uid, period, opening_period, fiscal_year, filter_type, structure={}, final_list=[]):
+
+ result_dict_period_balance = {}
+ result_dict_fiscal_year_balance = {}
+ final_data = {}
+ final_data_parent = {}
+ list_ids = []
+ child_list = []
+
+ library_obj = self.pool.get('account.webkit.report.library')
+
+ #1. Extract children. It's a list of dictionaries.
+ child_list = structure['account_type_child']
+
+ #no_detail: Iterate in the list and compute result in one line.
+ if structure['display_detail'] == 'no_detail':
+ final_data_parent['name'] = structure['name']
+ final_data_parent['code'] = ''
+ final_data_parent['is_parent'] = False
+ final_data_parent['level'] = 0
+
+ #In account type, iterate in child, because child is all accounts that
+ #match with account types selected.
+ for parent, child in child_list.iteritems():
+ #Add child id to compute data
+ for c in child:
+ list_ids.append(c.id)
+
+ if len(list_ids) > 0:
+ #Compute the balance for child ids list.
+ result_dict_period_balance = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ end_period_id=period.id,
+ fiscal_year_id=fiscal_year.id,
+ filter_type=filter_type)
+
+ result_dict_fiscal_year_balance = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=opening_period.id,
+ end_period_id=opening_period.id,
+ filter_type=filter_type)
+ total_period = 0.0
+ total_fiscal_year = 0.0
+ total_variation = 0.0
+
+ #Compute all result in one line.
+ #for parent, child in child_list.iteritems():
+ total_period += self.compute_balances(cr, uid, result_dict_period_balance, list_ids)
+ total_fiscal_year += self.compute_balances(cr, uid, result_dict_fiscal_year_balance, list_ids)
+ total_variation += total_period - total_fiscal_year
+
+ final_data_parent.update({
+ 'total_fiscal_year': total_fiscal_year,
+ 'total_period': total_period,
+ 'total_variation': total_variation,
+ 'total_percent_variation': total_fiscal_year != 0 and (100 * total_variation / total_fiscal_year) or 0,
+ })
+
+ else:
+ final_data_parent.update({
+ 'total_fiscal_year': 0.0,
+ 'total_period': 0.0,
+ 'total_variation': 0.0,
+ 'total_percent_variation': 0.0,
+ })
+
+ #Update the dictionary with final results.
+ final_list.append(copy(final_data_parent))
+
+ else:
+ if child_list:
+ #2. Create dictionaries for parent and children.
+ for parent, child in child_list.iteritems():
+ final_data_parent['id'] = parent.id
+ final_data_parent['name'] = parent.name
+ final_data_parent['code'] = parent.code
+ final_data_parent['is_parent'] = True #Distinct child from parent.
+ final_data_parent['level'] = 0
+
+ if child != []:
+ final_data_parent['child_list'] = child
+ else:
+ final_data_parent['child_list'] = []
+
+ #3. For parent account_types when display_detail = detail_with_hierarchy, don't compute the balance, debit, credit and initial_balance.
+ if structure['display_detail'] == 'detail_flat':
+ #Update keys to numbers, because this keys now show results
+ final_data_parent['total_fiscal_year'] = 0.0
+ final_data_parent['total_period'] = 0.0
+ final_data_parent['total_variation'] = 0.0
+ final_data_parent['total_percent_variation'] = 0.0
+
+ #Add parent
+ final_list.append(copy(final_data_parent))
+
+ #Add child id to compute data
+ for c in child:
+ list_ids.append(c.id)
+
+ elif structure['display_detail'] == 'detail_with_hierarchy':
+ final_data_parent['total_fiscal_year'] = ''
+ final_data_parent['total_period'] = ''
+ final_data_parent['total_variation'] = ''
+ final_data_parent['total_percent_variation'] = ''
+
+ #Add parent
+ final_list.append(copy(final_data_parent))
+
+ #Add child in final list and id to compute data.
+ for c in child:
+ list_ids.append(c.id)
+
+ final_data['id'] = c.id
+ final_data['level'] = c.level
+ if 'child' in final_data:
+ final_data['child'] = c.child
+ final_data['name'] = c.name
+ final_data['code'] = c.code
+ final_data['is_parent'] = False
+
+ final_list.append(copy(final_data))
+
+ if len(list_ids) > 0:
+ #Compute the balance, debit and credit for child ids list.
+ result_dict_period_balance = library_obj.get_account_balance(cr,
+ uid,
+ list_ids,
+ ['balance'],
+ end_period_id=period.id,
+ fiscal_year_id=fiscal_year.id,
+ filter_type=filter_type)
+
+ result_dict_fiscal_year_balance = library_obj.get_account_balance(cr,
+ uid,
+ list_ids,
+ ['balance'],
+ start_period_id=opening_period.id,
+ end_period_id=opening_period.id,
+ filter_type=filter_type)
+
+ if structure['display_detail'] == 'detail_flat':
+ #Compute all the results
+ for data in final_list:
+ if 'child_list' in data.keys():
+ total_period = self.compute_balances(cr, uid, result_dict_period_balance, data['child_list'])
+ total_fiscal_year = self.compute_balances(cr, uid, result_dict_fiscal_year_balance, data['child_list'])
+ total_variation = total_period - total_fiscal_year
+
+ data.update({
+ 'total_fiscal_year': total_fiscal_year,
+ 'total_period': total_period,
+ 'total_variation': total_variation,
+ 'total_percent_variation': total_fiscal_year != 0 and (100 * total_variation / total_fiscal_year) or 0,
+ })
+
+ elif structure['display_detail'] == 'detail_with_hierarchy':
+ for data in final_list:
+ #Only for child, compute this values
+ if data['is_parent'] == False:
+ #Search the result with the account id in the result dictionary
+ if 'id' in data.keys():
+ if data['id'] in result_dict_period_balance.keys() and \
+ data['id'] in result_dict_fiscal_year_balance.keys():
+ #Search the result with the account id in the result dictionary
+ total_period = result_dict_period_balance[data['id']]['balance']
+ total_fiscal_year = result_dict_fiscal_year_balance[data['id']]['balance']
+ total_variation = total_period - total_fiscal_year
+
+ data.update({
+ 'total_fiscal_year': total_fiscal_year,
+ 'total_period': total_period,
+ 'total_variation': total_variation,
+ 'total_percent_variation': total_fiscal_year != 0 and (100 * total_variation / total_fiscal_year) or 0,
+ })
+
+
+ return final_list
+
+ def get_data_accounts(self, cr, uid, period, opening_period, fiscal_year, filter_type, structure={}, final_list=[]):
+
+ result_dict_period_balance = {}
+ result_dict_fiscal_year_balance = {}
+ final_data = {}
+ final_data_parent = {}
+ list_ids = []
+ child_list = []
+
+ library_obj = self.pool.get('account.webkit.report.library')
+
+ #1. Extract children. It's a list of dictionaries.
+ child_list = structure['account_child']
+
+ #no_detail: Iterate in the list and compute result in one line.
+ if structure['display_detail'] == 'no_detail':
+ final_data_parent['name'] = structure['name']
+ final_data_parent['code'] = ''
+ final_data_parent['is_parent'] = True
+ final_data_parent['level'] = 0
+
+ #In accounts, iterate in parent, parent is
+ #accounts selected in list.
+ for parent, child in child_list.iteritems():
+ list_ids.append(parent.id)
+
+ if len(list_ids) > 0:
+ #Compute the balance for child ids list.
+ result_dict_period_balance = library_obj.get_account_balance(cr,
+ uid,
+ list_ids,
+ ['balance'],
+ end_period_id=period.id,
+ fiscal_year_id=fiscal_year.id,
+ filter_type=filter_type)
+
+ result_dict_fiscal_year_balance = library_obj.get_account_balance(cr,
+ uid,
+ list_ids,
+ ['balance'],
+ start_period_id=opening_period.id,
+ end_period_id=opening_period.id,
+ filter_type=filter_type)
+
+ total_period = 0.0
+ total_fiscal_year = 0.0
+ total_variation = 0.0
+
+ #Compute all result in one line.
+ for parent, child in child_list.iteritems():
+ total_period += self.compute_balances(cr, uid, result_dict_period_balance,child)
+ total_fiscal_year += self.compute_balances(cr, uid, result_dict_fiscal_year_balance,child)
+ total_variation += total_period - total_fiscal_year
+
+ final_data_parent.update({
+ 'total_fiscal_year': total_fiscal_year,
+ 'total_period': total_period,
+ 'total_variation': total_variation,
+ 'total_percent_variation': total_fiscal_year != 0 and (100 * total_variation / total_fiscal_year) or 0,
+ })
+
+ else:
+ final_data_parent.update({
+ 'total_fiscal_year': 0.0,
+ 'total_period': 0.0,
+ 'total_variation': 0.0,
+ 'total_percent_variation': 0.0,
+ })
+
+ #Update the dictionary with final results.
+ final_list.append(copy(final_data_parent))
+
+ else:
+ for parent, child in child_list.iteritems():
+ #Create a dictionary with parent info
+ final_data_parent['id'] = parent.id
+ final_data_parent['name'] = parent.name
+ final_data_parent['code'] = parent.code
+ final_data_parent['is_parent'] = True #Distinct child from parent.
+ final_data_parent['level'] = 0
+
+ final_data_parent['total_fiscal_year'] = 0.0
+ final_data_parent['total_period'] = 0.0
+ final_data_parent['total_variation'] = 0.0
+ final_data_parent['total_percent_variation'] = 0.0
+
+ #Show and compute data of account selected
+ final_list.append(copy(final_data_parent))
+
+ #Add parents ids, parents are accounts in main list
+ list_ids.append(parent.id)
+
+ if structure['display_detail'] == 'detail_with_hierarchy':
+ for c in child:
+ if c.id not in list_ids: #Avoid duplicate ids
+ list_ids.append(c.id)
+
+ final_data['id'] = c.id
+ final_data['level'] = c.level
+ if 'child' in final_data:
+ final_data['child'] = c.child
+ final_data['name'] = c.name
+ final_data['code'] = c.code
+ final_data['is_parent'] = False
+
+ final_list.append(copy(final_data))
+
+ if len(list_ids) > 0:
+ #Compute the balance, debit and credit for child ids list.
+ result_dict_period_balance = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ end_period_id=period.id,
+ fiscal_year_id=fiscal_year.id,
+ filter_type=filter_type)
+
+ result_dict_fiscal_year_balance = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=opening_period.id,
+ end_period_id=opening_period.id,
+ filter_type=filter_type)
+
+ #Get data for accounts selected in list.
+ if structure['display_detail'] == 'detail_flat':
+ for final_data_parent in final_list:
+ total_period = result_dict_period_balance[parent.id]['balance']
+ total_fiscal_year = result_dict_fiscal_year_balance[parent.id]['balance']
+ total_variation = total_period - total_fiscal_year
+
+ final_data_parent.update({
+ 'total_period':total_period,
+ 'total_fiscal_year':total_fiscal_year,
+ 'total_variation':total_variation,
+ 'total_percent_variation': total_fiscal_year != 0 and (100 * total_variation / total_fiscal_year) or 0,
+ })
+
+ elif structure['display_detail'] == 'detail_with_hierarchy':
+ for data in final_list:
+ #Search the result with the account id in the result dictionary
+ if 'id' in data.keys():
+ if data['id'] in result_dict_period_balance.keys() and \
+ data['id'] in result_dict_fiscal_year_balance.keys():
+
+ #Search the result with the account id in the result dictionary
+ total_period = result_dict_period_balance[data['id']]['balance']
+ total_fiscal_year = result_dict_fiscal_year_balance[data['id']]['balance']
+ total_variation = total_period - total_fiscal_year
+
+ data.update({
+ 'total_fiscal_year': total_fiscal_year,
+ 'total_period': total_period,
+ 'total_variation': total_variation,
+ 'total_percent_variation': total_fiscal_year != 0 and (100 * total_variation / total_fiscal_year) or 0,
+ })
+
+
+ return final_list
+
+ '''
+ Get a dictionary list, each dictionary have debit, credit, initial balance and balance for each account or
+ for each group of type account.
+
+ @param main_structure: account.financial.report choose in wizard, comes from the library in a dictionary.
+ @param data: dictionary, contains all values selected in wizard
+ @param final_list: list, return a list with all dictionaries.
+ '''
+
+ def get_total_result(self, cr, uid, main_structure, data, final_list=[]):
+
+ account_period_obj = self.pool.get('account.period')
+ library_obj = self.pool.get('account.webkit.report.library')
+
+ #************ Parameters
+ period = self.get_start_period(data)
+ fiscal_year = self.get_fiscalyear(data)
+ opening_period = account_period_obj.get_opening_period(cr, uid, period)
+ filter_type = self.get_filter(data)
+ #****************
+
+ #################################################################################
+
+ '''
+ In the dictionary (main_structure['account_type_child'] or main_structure['account_child'])
+ the key is the account or type account and content is a list of child's account or
+ all the accounts that match with type account in the list.
+ '''
+
+ #The main account.financial.report (parent view) is always a dictionary.
+ #If the instance is a dictionary and doesn't has a parent_id is the main structure
+ #Child of main structure is a list.
+
+ #Clean list, avoid problem that repeat structure (print twice)
+ if final_list != []:
+ final_list = []
+
+ if isinstance(main_structure, list) == True:
+ #TODO: Implement account_report (Valor en informe)
+ for structure in main_structure:
+ if structure['type'] == 'account_type':
+ list_data = [] #Avoid repeat accounts when an account is in list and it's a child for account type selected.
+ final_list += self.get_data_account_type(cr, uid, period, opening_period, fiscal_year, filter_type, structure, list_data)
+
+ elif structure['type'] == 'accounts':
+ list_data = [] #Avoid repeat accounts when an account is in list and it's a child for account type selected.
+ final_list += self.get_data_accounts(cr, uid, period, opening_period, fiscal_year, filter_type, structure, list_data)
+
+
+ #Call the method only with a dictionary list.
+ if type(main_structure) is types.DictType:
+ self.get_total_result(cr, uid, main_structure['child'], data, final_list)
+
+ return final_list
+
+ def get_data(self, cr, uid, data):
+ #1. Extract the account_financial_report.
+ account_financial_report = self.get_account_base_report(data)
+
+ #2. Call method that extract the account_financial_report
+ main_structure = self.pool.get('account.financial.report').get_structure_account_financial_report(cr, uid, account_financial_report.id)
+
+ #3. Return a dictionary with all result.
+ final_data = self.get_total_result(cr, uid, main_structure,data)
+
+ return final_data
+
+report_sxw.report_sxw(
+ 'report.l10n_cr_situation_balance_report',
+ 'account.account',
+ 'addons/l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako',
+ parser=situationBalancereport)
=== added file 'l10n_cr_account_situation_balance_report/report/report.xml'
--- l10n_cr_account_situation_balance_report/report/report.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_situation_balance_report/report/report.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="account.account_financial_report_balancesheet0" model="ir.actions.report.xml">
+ <field name="report_type">webkit</field>
+ <field name="report_name">l10n_cr_situation_balance_report</field>
+ <field name="model">account.account</field>
+ <field name="type">ir.actions.report.xml</field>
+ <field name="name">Situation Balance Report</field>
+ <field name="report_rml">l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako</field>
+ <field name="report_file">l10n_cr_account_situation_balance_report/report/l10n_cr_account_financial_report_situation_balance_report.mako</field>
+ <field name="webkit_header" ref="report_webkit_lib.webkit_header_clearcorp_official_portrait"/>
+ </record>
+ </data>
+</openerp>
+
\ No newline at end of file
=== added file 'l10n_cr_account_situation_balance_report/report_menus.xml'
--- l10n_cr_account_situation_balance_report/report_menus.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_situation_balance_report/report_menus.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <menuitem icon="STOCK_PRINT"
+ name="Balance de situación"
+ parent="account.final_accounting_reports"
+ action="action_situation_balance_report_menu_webkit"
+ id="account.menu_account_report_bs"/>
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_situation_balance_report/wizard'
=== added file 'l10n_cr_account_situation_balance_report/wizard/__init__.py'
--- l10n_cr_account_situation_balance_report/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_situation_balance_report/wizard/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_account_situation_balance_wizard
\ No newline at end of file
=== added file 'l10n_cr_account_situation_balance_report/wizard/l10n_cr_account_situation_balance_wizard.py'
--- l10n_cr_account_situation_balance_report/wizard/l10n_cr_account_situation_balance_wizard.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_situation_balance_report/wizard/l10n_cr_account_situation_balance_wizard.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,48 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import fields, osv
+
+class situationBalancereportWizard(osv.osv_memory):
+
+ _inherit = "account.report.wiz"
+ _name = "situation.balance.report.wiz"
+ _description = "Situation Balance Report Wizard"
+
+ _columns = {
+ 'account_base_report':fields.many2one('account.financial.report', string="Account Base Report",domain=[('parent_id','=', False), ('account_type.code','=','SITBAL')]),
+ }
+
+ _defaults = {
+ 'filter': 'filter_period',
+ }
+
+ def _print_report(self, cursor, uid, ids, data, context=None):
+ context = context or {}
+
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'l10n_cr_situation_balance_report',
+ 'datas': data
+ }
+
+situationBalancereportWizard()
=== added file 'l10n_cr_account_situation_balance_report/wizard/l10n_cr_account_situation_balance_wizard_view.xml'
--- l10n_cr_account_situation_balance_report/wizard/l10n_cr_account_situation_balance_wizard_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_situation_balance_report/wizard/l10n_cr_account_situation_balance_wizard_view.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="situation_balance_report_view_webkit" model="ir.ui.view">
+ <field name="name">Situation Balance Report</field>
+ <field name="model">situation.balance.report.wiz</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account_report_lib.account_report_lib_wizard_view"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/label[@string='']" position="replace">
+ <separator string="Situation Balance Report" colspan="4"/>
+ <label nolabel="1" colspan="4" string="This report allows you to print or generate a pdf of your income statement"/>
+ </xpath>
+ <field name="target_move" position="attributes">
+ <attribute name="invisible">True</attribute>
+ </field>
+ <field name="fiscalyear_id" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+ <field name="period_from" position="replace">
+ <field widget="selection" name="period_from" string="Period" domain="[('state', '=', 'draft'),('special', '=', False)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}"/>
+ </field>
+ <field name="period_to" position="attributes">
+ <attribute name="attrs">{'invisible': True, 'required': False}</attribute>
+ </field>
+ <field name="special_period" position="attributes">
+ <attribute name="invisible">True</attribute>
+ </field>
+ <field name="filter" position="attributes">
+ <attribute name="readonly">True</attribute>
+ </field>
+ <group name="Dates" position="attributes">
+ <attribute name="invisible">True</attribute>
+ </group>
+ <group string="Journals" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+
+ <group string="Advanced options" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+
+ <field name="account_base_report" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+
+ <group string="Accounts" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+
+ </data>
+ </field>
+ </record>
+
+ <record id="action_situation_balance_report_menu_webkit" model="ir.actions.act_window">
+ <field name="name">Action Situation Balance Report</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">situation.balance.report.wiz</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="situation_balance_report_view_webkit"/>
+ <field name="target">new</field>
+ </record>
+
+ <record model="ir.values" id="action_situation_balance_report_values_webkit">
+ <field name="model_id" ref="account.model_account_account"/>
+ <field name="object" eval="1"/>
+ <field name="name">Situation Balance Report</field>
+ <field name="key2">client_print_multi</field>
+ <field name="value" eval="'ir.actions.act_window,' +str(ref('action_situation_balance_report_menu_webkit'))"/>
+ <field name="key">action</field>
+ <field name="model">account.account</field>
+ </record>
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_statement_change_equity_report'
=== added file 'l10n_cr_account_statement_change_equity_report/__init__.py'
--- l10n_cr_account_statement_change_equity_report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_statement_change_equity_report/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,24 @@
+# -*- 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 report
+import wizard
\ No newline at end of file
=== added file 'l10n_cr_account_statement_change_equity_report/__openerp__.py'
--- l10n_cr_account_statement_change_equity_report/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_statement_change_equity_report/__openerp__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,46 @@
+# -*- 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/>.
+#
+##############################################################################
+
+{
+ 'name': 'Statement Change Equity Report Webkit',
+ 'description': "Create the Statement Change Equity Report",
+ 'version': '1.0',
+ 'author': 'CLEARCORP S.A.',
+ 'category': 'Finance',
+ 'website': "http://clearcorp.co.cr",
+ 'images': [],
+ 'depends': ['account',
+ 'account_report_lib',
+ 'account_report_signatures',],
+ 'init_xml': [],
+ 'demo_xml' : [],
+ 'update_xml': [
+ 'report/report.xml',
+ 'wizard/l10n_cr_account_statement_change_equity_wizard_view.xml',
+ 'report_menus.xml',
+ ],
+ 'test': [],
+ 'active': False,
+ 'installable': True,
+ 'license': 'AGPL-3',
+}
+
=== added directory 'l10n_cr_account_statement_change_equity_report/i18n'
=== added file 'l10n_cr_account_statement_change_equity_report/i18n/es_CR.po'
--- l10n_cr_account_statement_change_equity_report/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_statement_change_equity_report/i18n/es_CR.po 2013-11-06 21:08:21 +0000
@@ -0,0 +1,236 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * l10n_cr_account_statement_change_equity_report
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-08-23 18:53+0000\n"
+"PO-Revision-Date: 2013-08-23 18:53+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: report:addons/l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako:32
+msgid "Previous period"
+msgstr "Período anterior"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: report:addons/l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako:22
+msgid "Until Period:"
+msgstr "Hasta el período:"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: view:statement.change.equity.report.wiz:0
+msgid "{'required':True}"
+msgstr "{'required':True}"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: help:statement.change.equity.report.wiz,amount_currency:0
+msgid "It adds the currency column on report if the currency differs from the company currency."
+msgstr "Añade la columna de moneda en el reporte si la moneda es diferente de la moneda de la compañía"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: view:statement.change.equity.report.wiz:0
+msgid "Period"
+msgstr "Período"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: report:addons/l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako:21
+#: model:ir.actions.report.xml,name:l10n_cr_account_statement_change_equity_report.statement_changes_equity_report
+#: model:ir.ui.menu,name:l10n_cr_account_statement_change_equity_report.menu_statement_changes_equity_report
+msgid "Statement Changes of Equity"
+msgstr "Estados de Cambios de Patrimonio"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: view:statement.change.equity.report.wiz:0
+msgid "This report allows you to print or generate a pdf of your Statement Change Of Equity Report"
+msgstr "Este reporte permite generar o imprimir un pdf del Estado de Cambios de Patrimionio"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: help:statement.change.equity.report.wiz,historic_strict:0
+msgid "If selected, will display a historical unreconciled lines, taking into account the end of the period or date selected"
+msgstr "Si se selecciona se desplegará un histórico de líneas no conciliadas tomando en cuenta el final del período o la fecha seleccionada"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: model:ir.model,name:l10n_cr_account_statement_change_equity_report.model_statement_change_equity_report_wiz
+msgid "Statement Change of Equity Report Wizard"
+msgstr "Asistente para el Estado de Cambios de Patrimonio"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: report:addons/l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako:31
+msgid "Account<br />Name"
+msgstr "Cuenta<br />Nombre"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: report:addons/l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako:33
+msgid "Selected period"
+msgstr "Período seleccionado"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,company_id:0
+msgid "Company"
+msgstr "Compañía"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,amount_currency:0
+msgid "With Currency"
+msgstr "Con Moneda"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: report:addons/l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako:34
+msgid "Variation"
+msgstr "Variación"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: selection:statement.change.equity.report.wiz,filter:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,chart_account_id:0
+msgid "Chart of Account"
+msgstr "Catálogo Contable"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: report:addons/l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako:35
+msgid "Var."
+msgstr "Var."
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: view:statement.change.equity.report.wiz:0
+#: field:statement.change.equity.report.wiz,journal_ids:0
+msgid "Journals"
+msgstr "Journals"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,target_move:0
+msgid "Target Moves"
+msgstr "Movimientos Destino"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: help:statement.change.equity.report.wiz,chart_account_id:0
+msgid "Select Charts of Accounts"
+msgstr "Seleccione el Catálogo Contable"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,date_to:0
+msgid "End Date"
+msgstr "Fecha Final"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,period_from:0
+msgid "Start Period"
+msgstr "Período inicial"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: selection:statement.change.equity.report.wiz,target_move:0
+msgid "All Posted Entries"
+msgstr "Todos los apuntes publicados"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: help:statement.change.equity.report.wiz,fiscalyear_id:0
+msgid "Keep empty for all open fiscal year"
+msgstr "Mantener vacío para todo el año fiscal"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,period_to:0
+msgid "End Period"
+msgstr "Período Final"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,fiscalyear_id:0
+msgid "Fiscal Year"
+msgstr "Año Fiscal"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,historic_strict:0
+msgid "Strict History"
+msgstr "Histórico Estricto"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: selection:statement.change.equity.report.wiz,filter:0
+msgid "No Filters"
+msgstr "Sin Filstros"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: report:addons/l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako:83
+msgid "Authorized by: "
+msgstr "Autorizado por: "
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: view:statement.change.equity.report.wiz:0
+msgid "Advanced options"
+msgstr "Opciones Avanzadas"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: view:statement.change.equity.report.wiz:0
+msgid "Statement Change Of Equity Report"
+msgstr "Cambios de Estado de Patrimonio"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,special_period:0
+msgid "Special period"
+msgstr "Período Especial"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: report:addons/l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako:34
+msgid "Prev. vs Sel."
+msgstr "Anterior. vs Sel."
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,account_base_report:0
+msgid "Account Base Report"
+msgstr "Informe Financiero Base"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: help:statement.change.equity.report.wiz,special_period:0
+msgid "Include special period"
+msgstr "Incluir períodos especiales"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: view:statement.change.equity.report.wiz:0
+#: field:statement.change.equity.report.wiz,account_ids:0
+msgid "Accounts"
+msgstr "Cuentas"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: selection:statement.change.equity.report.wiz,filter:0
+msgid "Periods"
+msgstr "Períodos"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: model:ir.actions.act_window,name:l10n_cr_account_statement_change_equity_report.action_statement_change_equity_report_menu_webkit
+msgid "Action Statement Change of Equity Report"
+msgstr "Generar Reporte de Cambios de Estado de Patrimonio"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: report:addons/l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako:30
+msgid "Account<br />Code"
+msgstr "Cuenta<br />Código"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,date_from:0
+msgid "Start Date"
+msgstr "Fecha Inicial"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: field:statement.change.equity.report.wiz,filter:0
+msgid "Filter by"
+msgstr "Filtrado por"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: report:addons/l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako:22
+msgid "Fiscal Year:"
+msgstr "Año Fiscal:"
+
+#. module: l10n_cr_account_statement_change_equity_report
+#: selection:statement.change.equity.report.wiz,target_move:0
+msgid "All Entries"
+msgstr "Todos los apuntes"
+
=== added directory 'l10n_cr_account_statement_change_equity_report/report'
=== added file 'l10n_cr_account_statement_change_equity_report/report/__init__.py'
--- l10n_cr_account_statement_change_equity_report/report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_statement_change_equity_report/report/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_account_statement_change_equity_report
=== added file 'l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako'
--- l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako 2013-11-06 21:08:21 +0000
@@ -0,0 +1,104 @@
+<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <link rel='stylesheet' href='addons/account_webkit_report_library/webkit_headers/main.css' />
+ <style>
+ ${css}
+ </style>
+ </head>
+ <body class="data">
+ <%setLang(user.lang)%>
+ <%
+ last_period = get_last_period(cr, uid, data)
+ balance_data = get_data(cr, uid, data)
+ fiscalyear = get_fiscal_year(data)
+ %>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell logo">${helper.embed_logo_by_name('default_logo', height=80)|n}</div>
+ <div class="table-cell text">
+ <p class="company">${fiscalyear.company_id.partner_id.name}</p>
+ <p class="title">${_('Statement Changes of Equity')}</p>
+ <p class="subtitle">${_('Fiscal Year:')} ${fiscalyear.name} - ${_('Until Period:')} ${get_start_period(data).name}</p>
+ </div>
+ </div>
+ </div>
+ <br/><br/>
+ <div class="table list">
+ <div class="table-header">
+ <div class="table-row labels no-wrap">
+ <div class="table-cell first-column" style="width: 70px">${_('Account<br />Code')}</div>
+ <div class="table-cell" style="width: 430px">${_('Account<br />Name')}</div>
+ <div class="table-cell" style="width: 100px">${_('Previous period')}<br />${last_period.name}</div>
+ <div class="table-cell" style="width: 100px">${_('Selected period')}<br />${get_start_period(data).name}</div>
+ <div class="table-cell" style="width: 100px">${_('Variation')}<br />${_('Prev. vs Sel.')}</div>
+ <div class="table-cell last-column" style="width: 40px">${_('Var.')}<br />${_('%')}</div>
+ </div>
+ </div>
+ <div class="table-body">
+ <% row_even = False %>
+ %for account in balance_data:
+ %if account['level'] == 0 or account['is_parent'] == 'True' :
+ <div class="table-row bold ${row_even and 'even' or 'odd'}">
+ %elif 'child' in account:
+ <div class="table-row bold ${row_even and 'even' or 'odd'}">
+ %else:
+ <div class="table-row ${row_even and 'even' or 'odd'}">
+ %endif
+ <div class="table-cell first-column">${account['code']}</div>
+ <div class="table-cell" style="padding-left:${account['level']*10}px" >${account['name']}</div>
+ %if account['is_parent'] == False:
+ <div class="table-cell amount">${formatLang(account['balance_total_last_period'])}</div>
+ <div class="table-cell amount" >${formatLang(account['balance_total_period'])}</div>
+ <div class="table-cell amount" >${formatLang(account['balance_total_variation'])}</div>
+ <div class="table-cell amount" >${formatLang(account['balance_total_percentage_variation'])}</div>
+ %else:
+ <div class="table-cell amount">${account['balance_total_last_period']}</div>
+ <div class="table-cell amount" >${account['balance_total_period']}</div>
+ <div class="table-cell amount" >${account['balance_total_variation']}</div>
+ <div class="table-cell amount" >${account['balance_total_percentage_variation']}</div>
+ %endif
+
+ <%
+ if row_even:
+ row_even = False
+ else:
+ row_even = True
+ %>
+ </div>
+ %endfor
+ </div>
+ </div>
+ <div class="table-row spacer">
+ <div class="table-cell"> </div>
+ </div>
+ <%
+ signatures = get_signatures_report(cr, uid, 'Profit Statement')
+ cont = 0
+ %>
+ %if len(signatures) > 0:
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ <p class="title">${_('Authorized by: ')}</p>
+ </div>
+ </div>
+ </div>
+ <br/><br/>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ %for user_sign in signatures:
+ <div class="table-cell text">_________________________________________________________<br/>
+ <p class="subtitle">${user_sign.name}</p>
+ <p class="company"><i>${user_sign.job_id.name or ''}</i></p>
+ </div>
+ <br/><br/><br/>
+ </div>
+ %endfor
+ </div>
+ </div>
+ %endif
+ <p style="page-break-after:always"></p>
+ </body>
+</html>
=== added file 'l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.py'
--- l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,506 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from copy import copy
+import pooler
+from report import report_sxw
+from tools.translate import _
+import types
+from osv import fields, orm
+
+from openerp.addons.account_report_lib.account_report_base import accountReportbase
+
+class statementChangesequityReport(accountReportbase):
+ def __init__(self, cr, uid, name, context):
+ super(statementChangesequityReport, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update({
+ 'cr': cr,
+ 'uid': uid,
+ 'get_last_period': self.get_last_period,
+ 'get_data': self.get_data,
+ })
+
+ #Get last period based in period selected.
+ def get_last_period(self, cr, uid, data):
+ start_period = self.get_start_period(data)
+ return self.pool.get('account.period').get_last_period(cr,uid,start_period)
+
+ '''
+ If the display_detail == display_flat, compute all the balance, debit, credit and initial_balance and return
+ one result for each type account selected in the list.
+ @param child_list: Can be a list of ids (int) or a browse record list.
+ '''
+ def compute_data(self, cr, uid, result_dict, child_list):
+ balance = 0.0
+
+ #Child list can be a list of int or browse_record list
+ for c in child_list:
+ if isinstance(c, orm.browse_record):
+ if c.id in result_dict.keys():
+ balance += result_dict[c.id]['balance']
+
+ elif isinstance(c, int):
+ if c in result_dict.keys():
+ balance += result_dict[c]['balance']
+
+ return balance
+
+ """
+ Main methods to compute data. Split account.financial.report types in different
+ methods to improve usabillity and maintenance.
+ """
+ #Method for account.financial.report account_type type.
+ def get_data_account_type(self, cr, uid, filter_type, period, last_period, structure={}, final_list=[]):
+
+ result_dict = {}
+ final_data_parent = {'child_list': []} #Define empty list, avoid problem when list is empty and key isn't created
+ final_data = {}
+ list_ids = []
+ child_list = []
+
+ library_obj = self.pool.get('account.webkit.report.library')
+
+ #1. Extract children. It's a list of dictionaries.
+ child_list = structure['account_type_child']
+
+ '''
+ Display_detail = no_detail = special case
+ '''
+ #no_detail: Iterate in the list and compute result in one line.
+ if structure['display_detail'] == 'no_detail':
+ final_data_parent['name'] = structure['name']
+ final_data_parent['code'] = ''
+ final_data_parent['is_parent'] = False
+ final_data_parent['level'] = 0
+ final_data_parent['display_detail'] = 'no_detail'
+
+ #In account type, iterate in child, because child is all accounts that
+ #match with account types selected.
+
+ for parent, child in child_list.iteritems():
+ for c in child:
+ list_ids.append(c.id)
+
+ if len(list_ids) > 0:
+ #In this report, call method three times, calculate balance for
+ # period selected
+ # last period
+ # fiscal year
+
+ #Period selected -> Change witch period take as start_period and end_period
+ result_dict_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=period.id,
+ end_period_id=period.id,
+ filter_type=filter_type)
+
+ #Last period
+ result_dict_last_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=last_period.id,
+ end_period_id=last_period.id,
+ filter_type=filter_type)
+
+ balance_period = 0.0
+ balance_last_period = 0.0
+ balance_total_variation = 0.0
+ balance_total_variation_percentage = 0.0
+
+ for parent, child in child_list.iteritems():
+ #Get results for all groups that belongs to account_type.
+ balance_period += self.compute_data(cr, uid, result_dict_period, child)
+ balance_last_period += self.compute_data(cr, uid, result_dict_last_period, child)
+ balance_total_variation += balance_period - balance_last_period
+ balance_total_variation_percentage = balance_last_period != 0 and ((100 * balance_total_variation) / balance_last_period) or 0,
+
+ #Update dictionary
+ final_data_parent.update({
+ 'balance_total_period': balance_period,
+ 'balance_total_last_period': balance_last_period,
+ 'balance_total_variation': balance_total_variation,
+ 'balance_total_percentage_variation': balance_total_variation_percentage,
+ })
+
+ else:
+ final_data_parent.update({
+ 'balance_total_period': 0.0,
+ 'balance_total_last_period': 0.0,
+ 'balance_total_variation': 0.0,
+ 'balance_total_percentage_variation': 0.0,
+ })
+
+ #Update the dictionary with final results.
+ final_list.append(copy(final_data_parent))
+
+ else:
+ '''
+ Optimization process: Call get_account_balance the least possible.
+ '''
+ if child_list:
+ #2. Create dictionaries for parent and children.
+ for parent, child in child_list.iteritems():
+ final_data_parent['id'] = parent.id
+ final_data_parent['name'] = parent.name
+ final_data_parent['code'] = parent.code
+ final_data_parent['is_parent'] = True #Distinct child from parent.
+ final_data_parent['level'] = 0
+
+ if child != []:
+ final_data_parent['child_list'] = child
+ else:
+ final_data_parent['child_list'] = []
+
+ if structure['display_detail'] == 'detail_flat':
+ #Update keys to numbers, because this keys now show results
+ final_data_parent['balance_total_period'] = 0.0
+ final_data_parent['balance_total_last_period'] = 0.0
+ final_data_parent['balance_total_variation'] = 0.0
+ final_data_parent['balance_total_percentage_variation'] = 0.0
+
+ #Add parent into list
+ final_list.append(copy(final_data_parent))
+
+ elif structure['display_detail'] == 'detail_with_hierarchy':
+ final_data_parent['balance_total_period'] = ''
+ final_data_parent['balance_total_last_period'] = ''
+ final_data_parent['balance_total_variation'] = ''
+ final_data_parent['balance_total_percentage_variation'] = ''
+
+ #Add parent into list
+ final_list.append(copy(final_data_parent))
+
+ #Build child in a dictionary
+ if 'child_list' in final_data_parent.keys():
+ for c in final_data_parent['child_list']:
+ final_data['id'] = c.id
+ final_data['level'] = c.level
+ if 'child' in final_data:
+ final_data['child'] = c.child
+ final_data['name'] = c.name
+ final_data['code'] = c.code
+ final_data['is_parent'] = False
+
+ final_list.append(copy(final_data))
+
+ #Add child in final list and id to compute data.
+ for c in child:
+ list_ids.append(c.id)
+
+ if len(list_ids) > 0:
+ #Compute the balance for child ids list.
+ #Period selected -> Change witch period take as start_period and end_period
+ result_dict_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=period.id,
+ end_period_id=period.id,
+ filter_type=filter_type)
+
+ #Last period
+ result_dict_last_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=last_period.id,
+ end_period_id=last_period.id,
+ filter_type=filter_type)
+
+ #Iterate again the list for improve performance. Compute results.
+ if structure['display_detail'] == 'detail_flat':
+ #final_list has categories and child of this categories
+ #Compute results for each category
+ for data in final_list:
+ if 'child_list' in data.keys():
+ #Balance for all accounts (compare with base_account_selected)
+ balance_period = self.compute_data(cr, uid, result_dict_period, data['child_list'])
+ balance_last_period = self.compute_data(cr, uid, result_dict_last_period, data['child_list'])
+ balance_total_variation = balance_period - balance_last_period
+ balance_total_variation_percentage = balance_last_period != 0 and ((100 * balance_total_variation) / balance_last_period) or 0,
+
+ #Update dictionary
+ data.update({
+ 'balance_total_period': balance_period,
+ 'balance_total_last_period': balance_last_period,
+ 'balance_total_variation': balance_total_variation,
+ 'balance_total_percentage_variation': balance_total_variation_percentage,
+
+ })
+
+ #For this case, search id account in dictionary results and update dictionary.
+ #Categories id can't be in dictionary result
+ elif structure['display_detail'] == 'detail_with_hierarchy':
+ for data in final_list:
+ if 'id' in data.keys():
+ if data['is_parent'] == False and \
+ (data['id'] in result_dict_period.keys() and data['id'] in result_dict_last_period.keys()):
+
+ balance_total_period = result_dict_period[data['id']]['balance']
+ balance_total_last_period = result_dict_last_period[data['id']]['balance']
+ balance_total_variation = balance_total_period - balance_total_last_period
+ balance_total_variation_percentage = balance_total_last_period != 0 and ((100 * balance_total_variation) / balance_total_last_period) or 0,
+
+ data.update({
+ 'balance_total_period': balance_total_period,
+ 'balance_total_last_period': balance_total_last_period,
+ 'balance_total_variation': balance_total_variation,
+ 'balance_total_percentage_variation': balance_total_variation_percentage,
+ })
+
+ return final_list
+
+ def get_data_accounts(self, cr, uid, filter_type, period, last_period, structure={}, final_list=[]):
+ result_dict = {}
+ final_data_parent = {'child_list': []} #Define empty list, avoid problem when list is empty and key isn't created
+ final_data = {}
+ list_ids = []
+ child_list = []
+
+ library_obj = self.pool.get('account.webkit.report.library')
+
+ #1. Extract children. It's a list of dictionaries.
+ child_list = structure['account_child']
+
+ '''
+ Display_detail = no_detail = special case
+ '''
+ #no_detail: Iterate in the list and compute result in one line.
+ if structure['display_detail'] == 'no_detail':
+ final_data_parent['name'] = structure['name']
+ final_data_parent['code'] = ''
+ final_data_parent['is_parent'] = False
+ final_data_parent['level'] = 0
+ final_data_parent['display_detail'] = 'no_detail'
+
+ #In account type, iterate in child, because child is all accounts that
+ #match with account types selected.
+
+ for parent, child in child_list.iteritems():
+ for c in child:
+ list_ids.append(c.id)
+
+ if len(list_ids) > 0:
+ #In this report, call method three times, calculate balance for
+ # period selected
+ # last period
+ # fiscal year
+
+ #Period selected -> Change witch period take as start_period and end_period
+ result_dict_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=period.id,
+ end_period_id=period.id,
+ filter_type=filter_type)
+
+ #Last period
+ result_dict_last_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=last_period.id,
+ end_period_id=last_period.id,
+ filter_type=filter_type)
+
+ balance_period = 0.0
+ balance_last_period = 0.0
+ balance_total_variation = 0.0
+ balance_total_variation_percentage = 0.0
+
+ for parent, child in child_list.iteritems():
+ #Get results for all groups that belongs to account_type.
+ balance_period += self.compute_data(cr, uid, result_dict_period, child)
+ balance_last_period += self.compute_data(cr, uid, result_dict_last_period, child)
+ balance_total_variation += balance_period - balance_last_period
+ balance_total_variation_percentage = balance_last_period != 0 and ((100 * balance_total_variation) / balance_last_period) or 0,
+
+ #Update dictionary
+ final_data_parent.update({
+ 'balance_total_period': balance_period,
+ 'balance_total_last_period': balance_last_period,
+ 'balance_total_variation': balance_total_variation,
+ 'balance_total_percentage_variation': balance_total_variation_percentage,
+ })
+
+ #Update the dictionary with final results.
+ final_list.append(copy(final_data_parent))
+
+ else:
+ final_data_parent.update({
+ 'balance_total_period': 0.0,
+ 'balance_total_last_period': 0.0,
+ 'balance_total_variation': 0.0,
+ 'balance_total_percentage_variation': 0.0,
+ })
+
+ #Update the dictionary with final results.
+ final_list.append(copy(final_data_parent))
+
+ else:
+ '''
+ Optimization process: Call get_account_balance the least possible.
+ '''
+ if child_list:
+ for parent, child in child_list.iteritems():
+ final_data_parent['id'] = parent.id
+ final_data_parent['name'] = parent.name
+ final_data_parent['code'] = parent.code
+ final_data_parent['is_parent'] = True #Distinct child from parent.
+ final_data_parent['level'] = 0
+
+ if child != []:
+ final_data_parent['child_list'] = child
+ else:
+ final_data_parent['child_list'] = []
+
+ final_data_parent['initial_balance'] = 0.0
+ final_data_parent['debit'] = 0.0
+ final_data_parent['credit'] = 0.0
+ final_data_parent['balance'] = 0.0
+
+ final_list.append(copy(final_data_parent))
+
+ #For detail_flat, append parent.id, that is id for account selected in list.
+ if structure['display_detail'] == 'detail_flat':
+ list_ids.append(parent.id)
+
+ #Build list of data child.
+ if structure['display_detail'] == 'detail_with_hierarchy':
+ for c in child:
+ list_ids.append(c.id) #Add child.id
+
+ if c.id != parent.id: #Avoid duplicate accounts.
+ final_data['id'] = c.id
+ final_data['level'] = c.level
+ if 'child' in final_data:
+ final_data['child'] = c.child
+ final_data['name'] = c.name
+ final_data['code'] = c.code
+ final_data['is_parent'] = False
+
+ final_list.append(copy(final_data))
+
+ #if parent.id don't exist in list, add it
+ if parent.id not in list_ids:
+ #Add parent.id
+ list_ids.append(parent.id)
+
+ if len(list_ids) > 0:
+ #In this report, call method three times, calculate balance for
+ # period selected
+ # last period
+ # fiscal year
+
+ #Period selected -> Change witch period take as start_period and end_period
+ result_dict_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=period.id,
+ end_period_id=period.id,
+ filter_type=filter_type)
+
+ #Last period
+ result_dict_last_period = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ start_period_id=last_period.id,
+ end_period_id=last_period.id,
+ filter_type=filter_type)
+
+ #Iterate again the list for improve performance. Compute results.
+ #In this case, accounts in list and child are in final_list, isn't necesary check wich type of display is.
+ #Check only if id is in result_dict keys.
+ for data in final_list:
+ if 'id' in data.keys():
+ if (data['id'] in result_dict_period.keys() and data['id'] in result_dict_last_period.keys()):
+ balance_total_period = result_dict_period[data['id']]['balance']
+ balance_total_last_period = result_dict_last_period[data['id']]['balance']
+ balance_total_variation = balance_total_period - balance_total_last_period
+ balance_total_variation_percentage = balance_total_last_period != 0 and ((100 * balance_total_variation) / balance_total_last_period) or 0,
+
+ data.update({
+ 'balance_total_period': balance_total_period,
+ 'balance_total_last_period': balance_total_last_period,
+ 'balance_total_variation': balance_total_variation,
+ 'balance_total_percentage_variation': balance_total_variation_percentage,
+ })
+
+ return final_list
+
+ def get_total_result(self, cr, uid, main_structure, data, final_list=[]):
+
+ account_period_obj = self.pool.get('account.period')
+
+ period = self.get_start_period(data)
+ last_period = account_period_obj.get_last_period(cr, uid, period)
+ fiscal_year = self.get_fiscalyear(data)
+ filter_type = self.get_filter(data)
+
+ #################################################################################
+
+ '''
+ In the dictionary (main_structure['account_type_child'] or main_structure['account_child'])
+ the key is the account or type account and content is a list of child's account or
+ all the accounts that match with type account in the list.
+ '''
+
+ #The main account.financial.report (parent view) is always a dictionary.
+ #If the instance is a dictionary and doesn't has a parent_id is the main structure
+ #Child of main structure is a list.
+
+ #Clean list, avoid problem that repeat structure (print twice)
+ if final_list != []:
+ final_list = []
+
+ if isinstance(main_structure, list) == True:
+ #TODO: Implement account_report (Valor en informe)
+ for structure in main_structure:
+ if structure['type'] == 'account_type':
+ final_list = self.get_data_account_type(cr, uid,filter_type, period, last_period, structure, final_list)
+
+ elif structure['type'] == 'accounts':
+ final_list = self.get_data_accounts(cr, uid, filter_type, period, last_period, structure, final_list)
+
+ #Call the method only with a dictionary list.
+ if type(main_structure) is types.DictType:
+ self.get_total_result(cr, uid, main_structure['child'], data, final_list)
+
+ return final_list
+
+ #Call all the methods that extract data, and build final dictionary with all the result.
+ def get_data(self, cr, uid, data):
+
+ #1. Extract the account_financial_report.
+ account_financial_report = self.get_account_base_report(data)
+
+ #2. Call method that extract the account_financial_report
+ main_structure = self.pool.get('account.financial.report').get_structure_account_financial_report(cr, uid, account_financial_report.id)
+
+ #3. Return a dictionary with all result.
+ final_data = self.get_total_result(cr, uid, main_structure,data)
+
+ return final_data
+
+report_sxw.report_sxw(
+ 'report.l10n_cr_statement_change_equity_report',
+ 'account.account',
+ 'addons/l10n_cr_account_profit_statement_report/report/l10n_cr_account_statement_change_equity_report.mako',
+ parser=statementChangesequityReport)
=== added file 'l10n_cr_account_statement_change_equity_report/report/report.xml'
--- l10n_cr_account_statement_change_equity_report/report/report.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_statement_change_equity_report/report/report.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="statement_changes_equity_report" model="ir.actions.report.xml">
+ <field name="report_type">webkit</field>
+ <field name="report_name">l10n_cr_statement_change_equity_report</field>
+ <field name="model">account.account</field>
+ <field name="type">ir.actions.report.xml</field>
+ <field name="name">Statement Changes of Equity</field>
+ <field name="report_rml">l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako</field>
+ <field name="report_file">l10n_cr_account_statement_change_equity_report/report/l10n_cr_account_statement_change_equity_report.mako</field>
+ <field name="webkit_header" ref="report_webkit_lib.webkit_header_clearcorp_official_portrait" />
+ </record>
+
+ </data>
+</openerp>
=== added file 'l10n_cr_account_statement_change_equity_report/report_menus.xml'
--- l10n_cr_account_statement_change_equity_report/report_menus.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_statement_change_equity_report/report_menus.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <menuitem icon="STOCK_PRINT"
+ name="Statement Changes of Equity"
+ parent="account.final_accounting_reports"
+ action="action_statement_change_equity_report_menu_webkit"
+ id="menu_statement_changes_equity_report"/>
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_statement_change_equity_report/wizard'
=== added file 'l10n_cr_account_statement_change_equity_report/wizard/__init__.py'
--- l10n_cr_account_statement_change_equity_report/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_statement_change_equity_report/wizard/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_account_statement_change_equity_wizard
\ No newline at end of file
=== added file 'l10n_cr_account_statement_change_equity_report/wizard/l10n_cr_account_statement_change_equity_wizard.py'
--- l10n_cr_account_statement_change_equity_report/wizard/l10n_cr_account_statement_change_equity_wizard.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_statement_change_equity_report/wizard/l10n_cr_account_statement_change_equity_wizard.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,44 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import osv, fields
+
+class statementChangeequityReport(osv.osv_memory):
+
+ _inherit = "account.report.wiz"
+ _name = "statement.change.equity.report.wiz"
+ _description = "Statement Change of Equity Report Wizard"
+
+ _defaults = {
+ 'filter': 'filter_period',
+ }
+
+ def _print_report(self, cursor, uid, ids, data, context=None):
+ context = context or {}
+
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'l10n_cr_statement_change_equity_report',
+ 'datas': data
+ }
+
+statementChangeequityReport()
=== added file 'l10n_cr_account_statement_change_equity_report/wizard/l10n_cr_account_statement_change_equity_wizard_view.xml'
--- l10n_cr_account_statement_change_equity_report/wizard/l10n_cr_account_statement_change_equity_wizard_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_statement_change_equity_report/wizard/l10n_cr_account_statement_change_equity_wizard_view.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="statement_change_equity_report_view_webkit" model="ir.ui.view">
+ <field name="name">Statement Change of Equity Report</field>
+ <field name="model">statement.change.equity.report.wiz</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account_report_lib.account_report_lib_wizard_view"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/label[@string='']" position="replace">
+ <separator string="Statement Change Of Equity Report" colspan="4"/>
+ <label nolabel="1" colspan="4" string="This report allows you to print or generate a pdf of your Statement Change Of Equity Report"/>
+ </xpath>
+ <field name="target_move" position="attributes">
+ <attribute name="invisible">True</attribute>
+ </field>
+ <field name="fiscalyear_id" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+ <field name="period_from" position="replace">
+ <field widget="selection" name="period_from" string="Period" domain="[('state', '=', 'draft'),('special', '=', False)]" attrs="{'readonly':[('filter','!=','filter_period')], 'required':[('filter', '=', 'filter_period')]}"/>
+ </field>
+ <field name="period_to" position="attributes">
+ <attribute name="attrs">{'invisible': True, 'required': False}</attribute>
+ </field>
+ <field name="special_period" position="attributes">
+ <attribute name="invisible">True</attribute>
+ </field>
+ <field name="filter" position="attributes">
+ <attribute name="readonly">True</attribute>
+ </field>
+ <xpath expr="//group[@name='Dates']" position="attributes">
+ <attribute name="invisible">True</attribute>
+ </xpath>
+ <group string="Journals" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+ <group string="Advanced options" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+ <group string="Accounts" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+ <field name="account_base_report" position="attributes">
+ <attribute name="attrs">{'required':True}</attribute>
+ <attribute name="domain">[('type', '=', 'sum'),('account_type.code','=','STCHEQ')]</attribute>
+ </field>
+ </data>
+ </field>
+ </record>
+
+ <record id="action_statement_change_equity_report_menu_webkit" model="ir.actions.act_window">
+ <field name="name">Action Statement Change of Equity Report</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">statement.change.equity.report.wiz</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="statement_change_equity_report_view_webkit"/>
+ <field name="target">new</field>
+ </record>
+
+ <record model="ir.values" id="action_statement_changes_equity_report_values_webkit">
+ <field name="model_id" ref="account.model_account_account"/>
+ <field name="name">Statement Changes of Equity Report</field>
+ <field name="key2">client_print_multi</field>
+ <field name="value" eval="'ir.actions.act_window,' +str(ref('action_statement_change_equity_report_menu_webkit'))"/>
+ <field name="key">action</field>
+ <field name="model">account.account</field>
+ </record>
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_trial_balance_report'
=== added file 'l10n_cr_account_trial_balance_report/__init__.py'
--- l10n_cr_account_trial_balance_report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_trial_balance_report/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,24 @@
+# -*- 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 report
+import wizard
\ No newline at end of file
=== added file 'l10n_cr_account_trial_balance_report/__openerp__.py'
--- l10n_cr_account_trial_balance_report/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_trial_balance_report/__openerp__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,44 @@
+# -*- 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/>.
+#
+##############################################################################
+
+{
+ 'name': 'Trial Balance Report Webkit',
+ 'description': "Create the Trial Balance report",
+ 'version': '1.0',
+ 'author': 'CLEARCORP S.A.',
+ 'category': 'Finance',
+ 'website': "http://clearcorp.co.cr",
+ 'images': [],
+ 'depends': ['account_report_lib','account_report_signatures',
+ ],
+ 'init_xml': [],
+ 'demo_xml' : [],
+ 'update_xml': ['report/report.xml',
+ 'wizard/l10n_cr_account_trial_balance_wizard_view.xml',
+ 'report_menus.xml'
+ ],
+ 'test': [],
+ 'active': False,
+ 'installable': True,
+ 'license': 'AGPL-3',
+}
+
=== added directory 'l10n_cr_account_trial_balance_report/i18n'
=== added file 'l10n_cr_account_trial_balance_report/i18n/es_CR.po'
--- l10n_cr_account_trial_balance_report/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_trial_balance_report/i18n/es_CR.po 2013-11-06 21:08:21 +0000
@@ -0,0 +1,293 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * l10n_cr_account_trial_balance_report
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-08-12 22:26+0000\n"
+"PO-Revision-Date: 2013-08-12 22:26+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+msgid "{'required':True}"
+msgstr "{'required':True}"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:63
+msgid "Initial balance"
+msgstr "Balance inicial"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:19
+msgid "Trial Balance Report"
+msgstr "Reporte de Balance de Comprobación"
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+msgid "{'required':[('filter', '=', 'filter_date')]}"
+msgstr "{'required':[('filter', '=', 'filter_date')]}"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:64
+msgid "Debit"
+msgstr "Débito"
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+msgid "[('type', '=', 'sum'),('account_type.code','=','TRIBAL')]"
+msgstr "[('type', '=', 'sum'),('account_type.code','=','TRIBAL')]"
+
+#. module: l10n_cr_account_trial_balance_report
+#: help:trial.balance.report.wiz,historic_strict:0
+msgid "If selected, will display a historical unreconciled lines, taking into account the end of the period or date selected"
+msgstr "Si está seleccionado se desplegarán las líneas no conciliadas históricas, tomadas de la cuenta hasta el final del período o la fecha seleccionada"
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+msgid "Trial Balance"
+msgstr "Balance de comprobación"
+
+#. module: l10n_cr_account_trial_balance_report
+#: field:trial.balance.report.wiz,special_period:0
+msgid "Special period"
+msgstr "Período especial"
+
+#. module: l10n_cr_account_trial_balance_report
+#: field:trial.balance.report.wiz,company_id:0
+msgid "Company"
+msgstr "Compañía"
+
+#. module: l10n_cr_account_trial_balance_report
+#: field:trial.balance.report.wiz,amount_currency:0
+msgid "With Currency"
+msgstr "Con moneda"
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+msgid "{'required':[('filter', '=', 'filter_period')]}"
+msgstr "{'required':[('filter', '=', 'filter_period')]}"
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+msgid "[('fiscalyear_id', '=', fiscalyear_id), ('special', '=', False)]"
+msgstr "[('fiscalyear_id', '=', fiscalyear_id), ('special', '=', False)]"
+
+#. module: l10n_cr_account_trial_balance_report
+#: model:ir.actions.act_window,name:l10n_cr_account_trial_balance_report.action_trial_balance_report_menu_webkit
+msgid "Action Trial Balance Report"
+msgstr "Generar reporte Balance de Comprobación"
+
+#. module: l10n_cr_account_trial_balance_report
+#: selection:trial.balance.report.wiz,filter:0
+msgid "Date"
+msgstr "Fecha"
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+msgid "This report allows you to print or generate a pdf of your trial balance"
+msgstr "Este reporte le permitirá imprimir o generar un pdf de su balance de comprobación"
+
+#. module: l10n_cr_account_trial_balance_report
+#: field:trial.balance.report.wiz,chart_account_id:0
+msgid "Chart of Account"
+msgstr "Catálogo de cuentas"
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+#: field:trial.balance.report.wiz,journal_ids:0
+msgid "Journals"
+msgstr "Diarios"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:53
+#: field:trial.balance.report.wiz,target_move:0
+msgid "Target Moves"
+msgstr "Movimientos destino"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:38
+msgid "From:"
+msgstr "Desde:"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:44
+msgid "To:"
+msgstr "Hasta:"
+
+#. module: l10n_cr_account_trial_balance_report
+#: field:trial.balance.report.wiz,date_to:0
+msgid "End Date"
+msgstr "Fecha Final"
+
+#. module: l10n_cr_account_trial_balance_report
+#: field:trial.balance.report.wiz,period_from:0
+msgid "Start Period"
+msgstr "Período inicial"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:62
+msgid "Name"
+msgstr "Nombre"
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+msgid "{'invisible': True}"
+msgstr "{'invisible': True}"
+
+#. module: l10n_cr_account_trial_balance_report
+#: selection:trial.balance.report.wiz,target_move:0
+msgid "All Posted Entries"
+msgstr "Todos los apuntes publicados"
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+msgid "{'required': True}"
+msgstr "{'required': True}"
+
+#. module: l10n_cr_account_trial_balance_report
+#: help:trial.balance.report.wiz,fiscalyear_id:0
+msgid "Keep empty for all open fiscal year"
+msgstr "Mantener vacío para todos los años fiscales abiertos"
+
+#. module: l10n_cr_account_trial_balance_report
+#: help:trial.balance.report.wiz,amount_currency:0
+msgid "It adds the currency column on report if the currency differs from the company currency."
+msgstr "Añade una columna de moneda en el reporte si la moneda es diferente de la moneda de la compañía"
+
+#. module: l10n_cr_account_trial_balance_report
+#: field:trial.balance.report.wiz,period_to:0
+msgid "End Period"
+msgstr "Período final"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:65
+msgid "Credit"
+msgstr "Crédito"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:27
+#: field:trial.balance.report.wiz,fiscalyear_id:0
+msgid "Fiscal Year"
+msgstr "Año fiscal"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:52
+msgid "Accounts Filter"
+msgstr "Filtro de cuentas"
+
+#. module: l10n_cr_account_trial_balance_report
+#: selection:trial.balance.report.wiz,filter:0
+msgid "No Filters"
+msgstr "Sin Filtros"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:117
+msgid "Authorized by: "
+msgstr "Autorizado por: "
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+msgid "Advanced options"
+msgstr "Advanced options"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:66
+msgid "Balance"
+msgstr "Balance"
+
+#. module: l10n_cr_account_trial_balance_report
+#: model:ir.model,name:l10n_cr_account_trial_balance_report.model_trial_balance_report_wiz
+msgid "Trial Balance Report Wizard"
+msgstr "Asistente de creación del Reporte de Balance de Comprobación"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:61
+msgid "Code"
+msgstr "Código"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:26
+msgid "Chart of Accounts: "
+msgstr "Catálogo de cuentas: "
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+msgid "True"
+msgstr "True"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:32
+msgid "Periods Filter"
+msgstr "Filtro de períodos"
+
+#. module: l10n_cr_account_trial_balance_report
+#: field:trial.balance.report.wiz,account_base_report:0
+msgid "Account Base Report"
+msgstr "Informe Financiero"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:30
+msgid "Dates Filter"
+msgstr "Filtro por fechas"
+
+#. module: l10n_cr_account_trial_balance_report
+#: help:trial.balance.report.wiz,special_period:0
+msgid "Include special period"
+msgstr "Incluir períodos especiales"
+
+#. module: l10n_cr_account_trial_balance_report
+#: view:trial.balance.report.wiz:0
+#: field:trial.balance.report.wiz,account_ids:0
+msgid "Accounts"
+msgstr "Cuentas"
+
+#. module: l10n_cr_account_trial_balance_report
+#: selection:trial.balance.report.wiz,filter:0
+msgid "Periods"
+msgstr "Períodos"
+
+#. module: l10n_cr_account_trial_balance_report
+#: report:addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako:34
+msgid "No filters"
+msgstr "Sin filtros"
+
+#. module: l10n_cr_account_trial_balance_report
+#: field:trial.balance.report.wiz,date_from:0
+msgid "Start Date"
+msgstr "Fecha inicial"
+
+#. module: l10n_cr_account_trial_balance_report
+#: help:trial.balance.report.wiz,chart_account_id:0
+msgid "Select Charts of Accounts"
+msgstr "Seleccione el catálogo de cuentas"
+
+#. module: l10n_cr_account_trial_balance_report
+#: field:trial.balance.report.wiz,filter:0
+msgid "Filter by"
+msgstr "Filtrado por"
+
+#. module: l10n_cr_account_trial_balance_report
+#: selection:trial.balance.report.wiz,target_move:0
+msgid "All Entries"
+msgstr "Todos los apuntes"
+
+#. module: l10n_cr_account_trial_balance_report
+#: field:trial.balance.report.wiz,historic_strict:0
+msgid "Strict History"
+msgstr "Histórico estricto"
+
+#. module: account
+#: report:account.account.balance:0
+#: model:ir.actions.act_window,name:account.action_account_balance_menu
+#: model:ir.actions.report.xml,name:account.account_account_balance
+#: model:ir.ui.menu,name:account.menu_general_Balance_report
+msgid "Trial Balance"
+msgstr "Balance de comprobación"
=== added directory 'l10n_cr_account_trial_balance_report/report'
=== added file 'l10n_cr_account_trial_balance_report/report/__init__.py'
--- l10n_cr_account_trial_balance_report/report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_trial_balance_report/report/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_account_financial_report_trial_balance_report
=== added file 'l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako'
--- l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako 2013-11-06 21:08:21 +0000
@@ -0,0 +1,138 @@
+<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <link rel='stylesheet' href='addons/account_webkit_report_library/webkit_headers/main.css' />
+ <style>
+ ${css}
+ </style>
+ </head>
+ <body>
+ <%setLang(user.lang)%>
+ <%
+ fiscalyear = get_fiscal_year(data)
+ %>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell logo">${helper.embed_logo_by_name('default_logo', height=80)|n}</div>
+ <div class="table-cell text">
+ <p class="company">${fiscalyear.company_id.name}</p>
+ <p class="title">${_('Trial Balance Report')}</p>
+ </div>
+ </div>
+ </div>
+ <div class="table list">
+ <div class="table-header">
+ <div class="table-row labels no-wrap">
+ <div class="table-cell first-column" style="width: 70px">${_('Chart of Accounts: ')}<br/>${get_chart_account_id(data).name}</div>
+ <div class="table-cell first-column" style="width: 70px">${_('Fiscal Year')}<br/>${get_fiscal_year(data).name}</div>
+ <div class="table-cell first-column" style="width: 70px">
+ %if get_filter(data) == 'filter_date':
+ ${_('Dates Filter')}
+ %elif get_filter(data) == 'filter_period':
+ ${_('Periods Filter')}
+ %else:
+ ${_('No filters')}
+ %endif
+ <br/>
+ %if get_filter(data) != 'filter_no':
+ ${_('From:')}
+ %if get_filter(data) == 'filter_date':
+ ${formatLang(get_date_from(data), date=True)}
+ %else:
+ ${get_start_period(data).name}
+ %endif
+ ${_('To:')}
+ %if get_filter(data) == 'filter_date':
+ ${ formatLang(get_date_to(data), date=True)}
+ %else:
+ ${get_end_period(data).name}
+ %endif
+ %endif
+ </div>
+ <div class="table-cell first-column" style="width: 70px">${_('Accounts Filter')}<br/>${ get_chart_account_id(data).name }</div>
+ <div class="table-cell first-column" style="width: 70px">${_('Target Moves')}<br/>${ display_target_move(data) }</div>
+ </div>
+ </div>
+ </div>
+ <br/><br/>
+ <div class="table list">
+ <div class="table-header">
+ <div class="table-row labels no-wrap">
+ <div class="table-cell first-column" style="width: 100px">${_('Code')}</div>
+ <div class="table-cell" style="width: 300px">${_('Name')}</div>
+ <div class="table-cell" style="width: 100px">${_('Initial balance')}</div>
+ <div class="table-cell" style="width: 100px">${_('Debit')}</div>
+ <div class="table-cell" style="width: 100px">${_('Credit')}</div>
+ <div class="table-cell last-column" style="width: 70px">${_('Balance')}</div>
+ </div>
+ </div>
+ <div class="table-body">
+ <% row_even = False %>
+ <%
+ final_list = get_data(cr, uid, data)
+ %>
+ %for account in final_list:
+ %if account['level'] == 0 or account['is_parent'] == 'True' :
+ <div class="table-row bold ${row_even and 'even' or 'odd'}">
+ %elif 'child' in account:
+ <div class="table-row bold ${row_even and 'even' or 'odd'}">
+ %else:
+ <div class="table-row ${row_even and 'even' or 'odd'}">
+ %endif
+ <div class="table-cell first-column">${account['code']}</div>
+ <div class="table-cell" style="padding-left:${account['level']*10}px" >${account['name']}</div>
+ %if account['is_parent'] == False:
+ <div class="table-cell amount">${formatLang(account['initial_balance'])}</div>
+ <div class="table-cell amount">${formatLang(account['debit'])}</div>
+ <div class="table-cell amount" >${formatLang(account['credit'])}</div>
+ <div class="table-cell amount" >${formatLang(account['balance'])}</div>
+ %else:
+ <div class="table-cell amount">${account['initial_balance']}</div>
+ <div class="table-cell amount">${account['debit']}</div>
+ <div class="table-cell amount" >${account['credit']}</div>
+ <div class="table-cell amount" >${account['balance']}</div>
+ %endif
+
+ <%
+ if row_even:
+ row_even = False
+ else:
+ row_even = True
+ %>
+ </div>
+ %endfor
+ </div>
+ </div>
+ <div class="table-row spacer">
+ <div class="table-cell"> </div>
+ </div>
+ <%
+ signatures = get_signatures_report(cr, uid, 'Trial Balance Report')
+ cont = 0
+ %>
+ %if len(signatures) > 0:
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ <p class="title">${_('Authorized by: ')}</p>
+ </div>
+ </div>
+ </div>
+ <br/><br/>
+ <div class="table header">
+ <div class="table-row">
+ <div class="table-cell text">
+ %for user_sign in signatures:
+ <div class="table-cell text">_________________________________________________________<br/>
+ <p class="subtitle">${user_sign.name}</p>
+ <p class="company"><i>${user_sign.job_id.name or ''}</i></p>
+ </div>
+ <br/><br/><br/>
+ </div>
+ %endfor
+ </div>
+ </div>
+ %endif
+ <p style="page-break-after:always"></p>
+ </body>
+</html>
=== added file 'l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.py'
--- l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,608 @@
+# -*- 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 pooler
+from report import report_sxw
+from tools.translate import _
+from copy import copy
+import types
+from osv import fields, orm
+
+from openerp.addons.account_report_lib.account_report_base import accountReportbase
+
+class trialBalancereport(accountReportbase):
+
+ def __init__(self, cr, uid, name, context):
+ super(trialBalancereport, self).__init__(cr, uid, name, context=context)
+ self.localcontext.update({
+ 'cr': cr,
+ 'uid':uid,
+ 'pool': pooler,
+ 'get_data':self.get_data,
+ })
+
+ '''
+ If the display_detail == display_flat, compute all the balance, debit, credit and initial_balance and return
+ one result for each type account selected in the list.
+ @param child_list: Can be a list of ids (int) or a browse record list.
+ '''
+ def compute_data(self, cr, uid,
+ result_dict,
+ child_list,
+ filter_type='',
+ filter_data=None,
+ fiscalyear=None,
+ target_move='all',
+ unreconcile = False,
+ historic_strict= False,
+ special_period = False,
+ all_accounts = True,
+ context=None):
+
+ balance = 0.0
+ credit = 0.0
+ debit = 0.0
+ initial_balance = 0.0
+ res = {}
+ list_accounts = []
+ account_report_lib = self.pool.get('account.webkit.report.library')
+
+ #Distinct how return the results if in 4 singles variables or in a dictionary, where key is account_id
+ #With all_accounts = False, return a dictionary with account_id as key and four values: Balance, credit, debit and initial_balance
+ if all_accounts:
+ #Child list can be a list of int or browse_record list
+ for c in child_list:
+ if isinstance(c, orm.browse_record):
+ list_accounts.append(c.id)
+ account_id = c.id
+
+ elif isinstance(c, int):
+ list_accounts.append(c)
+ account_id = c
+
+ if account_id in result_dict.keys():
+ initial_balance += result_dict[account_id]['balance']
+
+ #Call get_move_lines method to calculate debit and credit
+ move_lines = account_report_lib.get_move_lines(cr, uid,
+ account_ids = list_accounts,
+ filter_type=filter_type,
+ filter_data=filter_data,
+ fiscalyear=fiscalyear,
+ target_move=target_move,
+ unreconcile=unreconcile,
+ historic_strict=historic_strict,
+ special_period=special_period,
+ context=context)
+
+ # Compute debit and credit amounts
+ for line in move_lines:
+ debit += line.debit
+ credit += line.credit
+
+ balance += initial_balance + debit - credit
+
+ return balance, debit, credit, initial_balance
+
+ else:
+ for c in child_list:
+ balance = 0.0
+ credit = 0.0
+ debit = 0.0
+ initial_balance = 0.0
+
+ if isinstance(c, orm.browse_record):
+ account_id = c.id
+
+ elif isinstance(c, int):
+ account_id = c
+
+ initial_balance = result_dict[account_id]['balance']
+
+ move_lines = account_report_lib.get_move_lines(cr, uid,
+ account_ids = [account_id],
+ filter_type=filter_type,
+ filter_data=filter_data,
+ fiscalyear=fiscalyear,
+ target_move=target_move,
+ unreconcile=unreconcile,
+ historic_strict=historic_strict,
+ special_period=special_period,
+ context=context)
+
+ # Compute debit and credit amounts
+ for line in move_lines:
+ debit += line.debit
+ credit += line.credit
+
+ balance += initial_balance + debit - credit
+
+ res[account_id] = {
+ 'initial_balance': initial_balance,
+ 'debit': debit,
+ 'credit': credit,
+ 'balance': balance,
+
+ }
+
+ return res
+
+ """
+ Main methods to compute data. Split account.financial.report types in different
+ methods to improve usabillity and maintenance.
+ """
+
+ #Method for account.financial.report account_type type.
+ def get_data_account_type(self, cr, uid, filter_data, fiscal_year, filter_type, target_move, chart_account_id, start_date, end_date, start_period_id, end_period_id, structure={}, final_list=[]):
+
+ result_dict = {}
+ final_data_parent = {'child_list': []} #Define empty list, avoid problem when list is empty and key isn't created
+ final_data = {}
+ list_ids = []
+ child_list = []
+
+ library_obj = self.pool.get('account.webkit.report.library')
+
+ #1. Extract children. It's a list of dictionaries.
+ child_list = structure['account_type_child']
+
+ '''
+ Display_detail = no_detail = special case
+ '''
+ #no_detail: Iterate in the list and compute result in one line.
+ if structure['display_detail'] == 'no_detail':
+ final_data_parent['name'] = structure['name']
+ final_data_parent['code'] = ''
+ final_data_parent['is_parent'] = False
+ final_data_parent['level'] = 0
+ final_data_parent['display_detail'] = 'no_detail'
+
+ #In account type, iterate in child, because child is all accounts that
+ #match with account types selected.
+ for parent, child in child_list.iteritems():
+ #Add child id to compute data
+ for c in child:
+ list_ids.append(c.id)
+
+ if len(list_ids) > 0:
+ #Compute the balance, debit and credit for child ids list.
+ #Try to reduce numbers of call to get_account_balance method.
+ result_dict = library_obj.get_account_balance(cr,uid,
+ list_ids,
+ ['balance'],
+ initial_balance=True,
+ fiscal_year_id=fiscal_year.id,
+ state = target_move,
+ start_date= start_date,
+ end_date=end_date,
+ start_period_id = start_period_id,
+ end_period_id = end_period_id,
+ chart_account_id=chart_account_id.id,
+ filter_type=filter_type)
+
+ #Compute all result in one line.
+ #list_ids have all the accounts.
+ all_accounts = True
+ balance, debit, credit, initial_balance = self.compute_data(cr, uid,
+ result_dict,
+ list_ids,
+ filter_type=filter_type,
+ filter_data=filter_data,
+ fiscalyear=fiscal_year,
+ target_move=target_move,
+ all_accounts=all_accounts)
+
+ final_data_parent.update({
+ 'initial_balance':initial_balance,
+ 'credit':credit,
+ 'debit':debit,
+ 'balance': balance,
+ })
+
+ else:
+ final_data_parent.update({
+ 'initial_balance':0.0,
+ 'credit':0.0,
+ 'debit':0.0,
+ 'balance': 0.0,
+ })
+
+ #Update the dictionary with final results.
+ final_list.append(copy(final_data_parent))
+
+ else:
+ '''
+ Optimization process: Call get_account_balance the least possible.
+ '''
+ if child_list:
+ #2. Create dictionaries for parent and children.
+ for parent, child in child_list.iteritems():
+ final_data_parent['id'] = parent.id
+ final_data_parent['name'] = parent.name
+ final_data_parent['code'] = parent.code
+ final_data_parent['is_parent'] = True #Distinct child from parent.
+ final_data_parent['level'] = 0
+
+ if child != []:
+ final_data_parent['child_list'] = child
+ else:
+ final_data_parent['child_list'] = []
+
+ if structure['display_detail'] == 'detail_flat':
+ #Update keys to numbers, because this keys now show results
+ final_data_parent['initial_balance'] = 0.0
+ final_data_parent['debit'] = 0.0
+ final_data_parent['credit'] = 0.0
+ final_data_parent['balance'] = 0.0
+
+ #Add parent into list
+ final_list.append(copy(final_data_parent))
+
+ elif structure['display_detail'] == 'detail_with_hierarchy':
+ final_data_parent['initial_balance'] = ''
+ final_data_parent['debit'] = ''
+ final_data_parent['credit'] = ''
+ final_data_parent['balance'] = ''
+
+ #Add parent into list
+ final_list.append(copy(final_data_parent))
+
+ #Build child in a dictionary
+ if 'child_list' in final_data_parent.keys():
+ for c in final_data_parent['child_list']:
+ final_data['id'] = c.id
+ final_data['level'] = c.level
+ if 'child' in final_data:
+ final_data['child'] = c.child
+ final_data['name'] = c.name
+ final_data['code'] = c.code
+ final_data['is_parent'] = False
+
+ final_list.append(copy(final_data))
+
+ #Add child in final list and id to compute data.
+ for c in child:
+ list_ids.append(c.id)
+
+ if len(list_ids) > 0:
+ #Compute the balance, debit and credit for child ids list.
+ result_dict = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ initial_balance=True,
+ fiscal_year_id=fiscal_year.id,
+ state = target_move,
+ start_date= start_date,
+ end_date=end_date,
+ start_period_id = start_period_id,
+ end_period_id = end_period_id,
+ chart_account_id=chart_account_id.id,
+ filter_type=filter_type)
+
+ #Iterate again the list for improve performance. Compute results.
+ if structure['display_detail'] == 'detail_flat':
+ #final_list has categories and child of this categories
+ #Compute results for each category
+ all_accounts = True
+ for data in final_list:
+ if 'child_list' in data.keys():
+ balance, debit, credit, initial_balance = self.compute_data(cr, uid,
+ result_dict,
+ list_ids,
+ filter_type=filter_type,
+ filter_data=filter_data,
+ fiscalyear=fiscal_year,
+ target_move=target_move,
+ all_accounts=all_accounts)
+ data.update({
+ 'initial_balance': initial_balance,
+ 'debit': debit,
+ 'credit': credit,
+ 'balance': balance,
+ })
+
+ #For this case, search id account in dictionary results and update dictionary.
+ #Categories id can't be in dictionary result
+ elif structure['display_detail'] == 'detail_with_hierarchy':
+ #list_ids have all the accounts.
+ #Call once this method with all accounts
+
+ #In this case, res is a dictionary.
+ all_accounts = False
+ res = self.compute_data(cr, uid, result_dict,
+ list_ids,
+ filter_type=filter_type,
+ filter_data=filter_data,
+ fiscalyear=fiscal_year,
+ target_move=target_move,
+ all_accounts=all_accounts)
+
+ for data in final_list:
+ if data['is_parent'] == False and data['id'] in res.keys():
+ data.update({
+ 'initial_balance': res[data['id']]['initial_balance'],
+ 'debit': res[data['id']]['debit'],
+ 'credit': res[data['id']]['credit'],
+ 'balance': res[data['id']]['balance'],
+ })
+
+ return final_list
+
+ def get_data_accounts(self, cr, uid, filter_data, fiscal_year, filter_type, target_move, chart_account_id, start_date, end_date, start_period_id, end_period_id, structure={}, final_list=[]):
+ result_dict = {}
+ final_data_parent = {'child_list': []} #Define empty list, avoid problem when list is empty and key isn't created
+ final_data = {}
+ list_ids = []
+ child_list = []
+
+ library_obj = self.pool.get('account.webkit.report.library')
+
+ #1. Extract children. It's a list of dictionaries.
+ child_list = structure['account_child']
+
+ #no_detail: Iterate in the list and compute result in one line.
+ if structure['display_detail'] == 'no_detail':
+ final_data_parent['name'] = structure['name']
+ final_data_parent['code'] = ''
+ final_data_parent['id'] = structure['code']
+ final_data_parent['is_parent'] = True
+ final_data_parent['level'] = 0
+ final_data_parent['display_detail'] = 'no_detail'
+
+ #In accounts, iterate in parent, parent is
+ #accounts selected in list.
+ for parent, child in child_list.iteritems():
+ list_ids.append(parent.id)
+
+ if len(list_ids) > 0:
+ #Compute the balance, debit and credit for child ids list.
+ result_dict = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance'],
+ initial_balance=True,
+ fiscal_year_id=fiscal_year.id,
+ state = target_move,
+ start_date= start_date,
+ end_date=end_date,
+ start_period_id = start_period_id,
+ end_period_id = end_period_id,
+ chart_account_id=chart_account_id.id,
+ filter_type=filter_type)
+
+
+ #Compute all result in one line.
+ #list_ids have all the accounts.
+ all_accounts = True
+ balance, debit, credit, initial_balance = self.compute_data(cr, uid,
+ result_dict,
+ list_ids,
+ filter_type=filter_type,
+ filter_data=filter_data,
+ fiscalyear=fiscal_year,
+ target_move=target_move,
+ all_accounts=all_accounts)
+
+ final_data_parent.update({
+ 'initial_balance':0.0,
+ 'credit':0.0,
+ 'debit':0.0,
+ 'balance': 0.0,
+ })
+
+ else:
+ final_data_parent.update({
+ 'initial_balance':0.0,
+ 'credit':0.0,
+ 'debit':0.0,
+ 'balance': 0.0,
+ })
+
+ #Update the dictionary with final results.
+ final_list.append(copy(final_data_parent))
+
+ else:
+ for parent, child in child_list.iteritems():
+ final_data_parent['id'] = parent.id
+ final_data_parent['name'] = parent.name
+ final_data_parent['code'] = parent.code
+ final_data_parent['is_parent'] = True #Distinct child from parent.
+ final_data_parent['level'] = 0
+
+ if child != []:
+ final_data_parent['child_list'] = child
+ else:
+ final_data_parent['child_list'] = []
+
+ final_data_parent['initial_balance'] = 0.0
+ final_data_parent['debit'] = 0.0
+ final_data_parent['credit'] = 0.0
+ final_data_parent['balance'] = 0.0
+
+ final_list.append(copy(final_data_parent))
+
+ list_ids.append(parent.id)
+
+ #Build list of data child.
+ if structure['display_detail'] == 'detail_with_hierarchy':
+ for c in child:
+ list_ids.append(c.id) #Add child.id
+
+ if c.id != parent.id: #Avoid duplicate accounts.
+ final_data['id'] = c.id
+ final_data['level'] = c.level
+ if 'child' in final_data:
+ final_data['child'] = c.child
+ final_data['name'] = c.name
+ final_data['code'] = c.code
+ final_data['is_parent'] = False
+
+ final_list.append(copy(final_data))
+
+ if len(list_ids) > 0:
+ #Compute the balance, debit and credit for child ids list.
+ result_dict = library_obj.get_account_balance(cr, uid,
+ list_ids,
+ ['balance', 'debit', 'credit'],
+ initial_balance=True,
+ fiscal_year_id=fiscal_year.id,
+ state = target_move,
+ start_date= start_date,
+ end_date=end_date,
+ start_period_id = start_period_id,
+ end_period_id = end_period_id,
+ chart_account_id=chart_account_id.id,
+ filter_type=filter_type)
+
+ #Iterate again the list for improve performance. Compute results.
+ #In this case, accounts in list and child are in final_list, isn't necesary check wich type of display is.
+ #Check only if id is in result_dict keys.
+
+ #In this case, res is a dictionary.
+ all_accounts = False
+ res = self.compute_data(cr, uid, result_dict,
+ list_ids,
+ filter_type=filter_type,
+ filter_data=filter_data,
+ fiscalyear=fiscal_year,
+ target_move=target_move,
+ all_accounts=all_accounts)
+
+ for data in final_list:
+ if data['is_parent'] == False and data['id'] in res.keys():
+ data.update({
+ 'initial_balance': res[data['id']]['initial_balance'],
+ 'debit': res[data['id']]['debit'],
+ 'credit': res[data['id']]['credit'],
+ 'balance': res[data['id']]['balance'],
+ })
+
+ return final_list
+
+ '''
+ Get a dictionary list, each dictionary have debit, credit, initial balance and balance for each account or
+ for each group of type account.
+
+ @param main_structure: account.financial.report choose in wizard, comes from the library in a dictionary.
+ @param data: dictionary, contains all values selected in wizard
+ @param final_list: list, return a list with all dictionaries.
+ '''
+
+ def get_total_result(self, cr, uid, main_structure, data, final_list=[]):
+
+ filter_data = [] #contains the start and stop period or dates.
+
+ fiscal_year = self.get_fiscalyear(data)
+
+ #get the filters
+ filter_type = self.get_filter(data)
+
+ target_move = self.get_target_move(data)
+
+ #Get the accounts with the chart account selected.
+ chart_account_id = self.get_chart_account_id(data)
+
+ #############################Parameters depends of the type.
+ if filter_type == 'filter_period':
+ #el método recibe los ids de los períodos (filtro por períodos)
+ start_period_id = self.get_start_period(data).id
+ end_period_id = self.get_end_period(data).id
+
+ #Build filter_data
+ filter_data.append(self.get_start_period(data))
+ filter_data.append(self.get_end_period(data))
+
+ start_date = False
+ end_date = False
+
+
+ elif filter_type == 'filter_date':
+ #el método recibe las fechas (en caso de filtro por fechas)
+ start_date = self.get_date_from(data)
+ end_date = self.get_date_to(data)
+
+ #Build filter_data
+ filter_data.append(start_date)
+ filter_data.append(end_date)
+
+ start_period_id = False
+ end_period_id = False
+
+ else:
+ filter_type = ''
+
+ start_period_id = False
+ end_period_id = False
+ start_date = False
+ end_date = False
+
+ #################################################################################
+
+ '''
+ In the dictionary (main_structure['account_type_child'] or main_structure['account_child'])
+ the key is the account or type account and content is a list of child's account or
+ all the accounts that match with type account in the list.
+ '''
+
+ #The main account.financial.report (parent view) is always a dictionary.
+ #If the instance is a dictionary and doesn't has a parent_id is the main structure
+ #Child of main structure is a list.
+
+ #Clean list, avoid problem that repeat structure (print twice)
+ if final_list != []:
+ final_list = []
+
+ if isinstance(main_structure, list) == True:
+ #TODO: Implement account_report (Valor en informe)
+ for structure in main_structure:
+ if structure['type'] == 'account_type':
+ final_list = self.get_data_account_type(cr, uid, filter_data, fiscal_year, filter_type, target_move, chart_account_id, start_date, end_date, start_period_id, end_period_id, structure, final_list)
+
+ elif structure['type'] == 'accounts':
+ final_list = self.get_data_accounts(cr, uid, filter_data, fiscal_year, filter_type, target_move, chart_account_id, start_date, end_date, start_period_id, end_period_id, structure, final_list)
+
+
+ #Call the method only with a dictionary list.
+ if type(main_structure) is types.DictType:
+ self.get_total_result(cr, uid, main_structure['child'], data, final_list)
+
+ return final_list
+
+ #Call all the methods that extract data, and build final dictionary with all the result.
+ def get_data(self, cr, uid, data):
+
+ #1. Extract the account_financial_report.
+ account_financial_report = self.get_account_base_report(data)
+
+ #2. Call method that extract the account_financial_report
+ main_structure = self.pool.get('account.financial.report').get_structure_account_financial_report(cr, uid, account_financial_report.id)
+
+ #3. Return a dictionary with all result.
+ final_data = self.get_total_result(cr, uid, main_structure,data)
+
+ return final_data
+
+report_sxw.report_sxw(
+ 'report.l10n_cr_trial_balance_report',
+ 'account.account',
+ 'addons/l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako',
+ parser=trialBalancereport)
+
=== added file 'l10n_cr_account_trial_balance_report/report/report.xml'
--- l10n_cr_account_trial_balance_report/report/report.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_trial_balance_report/report/report.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="account.account_account_balance" model="ir.actions.report.xml">
+ <field name="report_type">webkit</field>
+ <field name="report_name">l10n_cr_trial_balance_report</field>
+ <field name="model">account.account</field>
+ <field name="type">ir.actions.report.xml</field>
+ <field name="name">Trial Balance Report</field>
+ <field name="report_rml">l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako</field>
+ <field name="report_file">l10n_cr_account_trial_balance_report/report/l10n_cr_account_financial_report_trial_balance_report.mako</field>
+ <field name="webkit_header" ref="report_webkit_lib.webkit_header_clearcorp_official_portrait" />
+ </record>
+ </data>
+</openerp>
+
\ No newline at end of file
=== added file 'l10n_cr_account_trial_balance_report/report_menus.xml'
--- l10n_cr_account_trial_balance_report/report_menus.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_trial_balance_report/report_menus.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <menuitem icon="STOCK_PRINT"
+ name="Trial Balance"
+ parent="account.final_accounting_reports"
+ action="action_trial_balance_report_menu_webkit"
+ id="account.menu_general_Balance_report"/>
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_trial_balance_report/wizard'
=== added file 'l10n_cr_account_trial_balance_report/wizard/__init__.py'
--- l10n_cr_account_trial_balance_report/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_trial_balance_report/wizard/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_account_trial_balance_wizard
=== added file 'l10n_cr_account_trial_balance_report/wizard/l10n_cr_account_trial_balance_wizard.py'
--- l10n_cr_account_trial_balance_report/wizard/l10n_cr_account_trial_balance_wizard.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_trial_balance_report/wizard/l10n_cr_account_trial_balance_wizard.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,40 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import osv
+
+class situationBalancereportWizard(osv.osv_memory):
+
+ _inherit = "account.report.wiz"
+ _name = "trial.balance.report.wiz"
+ _description = "Trial Balance Report Wizard"
+
+ def _print_report(self, cursor, uid, ids, data, context=None):
+ context = context or {}
+
+ return {
+ 'type': 'ir.actions.report.xml',
+ 'report_name': 'l10n_cr_trial_balance_report',
+ 'datas': data
+ }
+
+situationBalancereportWizard()
=== added file 'l10n_cr_account_trial_balance_report/wizard/l10n_cr_account_trial_balance_wizard_view.xml'
--- l10n_cr_account_trial_balance_report/wizard/l10n_cr_account_trial_balance_wizard_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_trial_balance_report/wizard/l10n_cr_account_trial_balance_wizard_view.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="trial_balance_report_view_webkit" model="ir.ui.view">
+ <field name="name">Trial Balance Report</field>
+ <field name="model">trial.balance.report.wiz</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account_report_lib.account_report_lib_wizard_view"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/label[@string='']" position="replace">
+ <separator string="Trial Balance" colspan="4"/>
+ <label nolabel="1" colspan="4" string="This report allows you to print or generate a pdf of your trial balance"/>
+ </xpath>
+ <field name="chart_account_id" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+ <field name="fiscalyear_id" position="attributes">
+ <attribute name="attrs">{'required': True}</attribute>
+ </field>
+ <field name="period_from" position="attributes">
+ <attribute name="domain">[('fiscalyear_id', '=', fiscalyear_id), ('special', '=', False)]</attribute>
+ <attribute name="attrs">{'required':[('filter', '=', 'filter_period')]}</attribute>
+ </field>
+ <field name="period_to" position="attributes">
+ <attribute name="domain">[('fiscalyear_id', '=', fiscalyear_id), ('special', '=', False)]</attribute>
+ <attribute name="attrs">{'required':[('filter', '=', 'filter_period')]}</attribute>
+ </field>
+ <field name="date_from" position="attributes">
+ <attribute name="attrs">{'required':[('filter', '=', 'filter_date')]}</attribute>
+ </field>
+ <field name="date_to" position="attributes">
+ <attribute name="attrs">{'required':[('filter', '=', 'filter_date')]}</attribute>
+ </field>
+
+ <group string="Journals" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+
+ <group string="Advanced options" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+
+ <field name="special_period" position="attributes">
+ <attribute name="invisible">True</attribute>
+ </field>
+
+ <group string="Accounts" position="attributes">
+ <attribute name="attrs">{'invisible': True}</attribute>
+ </group>
+
+ <field name="account_base_report" position="attributes">
+ <attribute name="attrs">{'required':True}</attribute>
+ <attribute name="domain">[('type', '=', 'sum'),('account_type.code','=','TRIBAL')]</attribute>
+ </field>
+
+ </data>
+ </field>
+ </record>
+
+ <record id="action_trial_balance_report_menu_webkit" model="ir.actions.act_window">
+ <field name="name">Action Trial Balance Report</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">trial.balance.report.wiz</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="trial_balance_report_view_webkit"/>
+ <field name="target">new</field>
+ </record>
+
+ <record model="ir.values" id="action_trial_balance_report_values_webkit">
+ <field name="model_id" ref="account.model_account_account"/>
+ <field name="object" eval="1"/>
+ <field name="name">Trial Balance Report</field>
+ <field name="key2">client_print_multi</field>
+ <field name="value"
+ eval="'ir.actions.act_window,' +str(ref('action_trial_balance_report_menu_webkit'))"/>
+ <field name="key">action</field>
+ <field name="model">account.account</field>
+ </record>
+ </data>
+</openerp>
=== modified file 'l10n_cr_account_voucher_check_bcr/__init__.py'
--- l10n_cr_account_voucher_check_bcr/__init__.py 2012-06-08 17:19:18 +0000
+++ l10n_cr_account_voucher_check_bcr/__init__.py 2013-11-06 21:08:21 +0000
@@ -1,1 +1,23 @@
+# -*- 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 report
=== modified file 'l10n_cr_account_voucher_check_bcr/__openerp__.py'
--- l10n_cr_account_voucher_check_bcr/__openerp__.py 2012-06-08 17:19:18 +0000
+++ l10n_cr_account_voucher_check_bcr/__openerp__.py 2013-11-06 21:08:21 +0000
@@ -1,43 +1,33 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
#
-# account_voucher_check.py
-# account_voucher_check
-# First author: Mag Guevara <mag.guevara@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2011-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
+# 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/>.
+#
##############################################################################
{
"name" : "Voucher Check BCR",
"author" : "ClearCorp S.A.",
"version" : "0.1",
- "depends" : ["base","account","report_webkit","base_currency_symbol"],
+ "depends" : ["base","account","account_report_lib","base_currency_symbol"],
"init_xml" : [],
- "update_xml" : ['l10n_cr_account_voucher_check_bcr_view.xml','l10n_cr_account_voucher_check_bcr_report.xml',],
+ "update_xml" : ['data/l10n_cr_account_voucher_check_bcr_webkit_header.xml',
+ 'l10n_cr_account_voucher_check_bcr_view.xml',
+ 'l10n_cr_account_voucher_check_bcr_report.xml',],
"category" : "Accounting",
"active" : False,
"instalable" : True,
=== added directory 'l10n_cr_account_voucher_check_bcr/data'
=== added file 'l10n_cr_account_voucher_check_bcr/data/l10n_cr_account_voucher_check_bcr_webkit_header.xml'
--- l10n_cr_account_voucher_check_bcr/data/l10n_cr_account_voucher_check_bcr_webkit_header.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_voucher_check_bcr/data/l10n_cr_account_voucher_check_bcr_webkit_header.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,186 @@
+<?xml version="1.0"?>
+<openerp>
+ <data>
+
+ <record id="webkit_header_l10n_cr_account_voucher_check_bcr" model="ir.header_webkit">
+ <field name="name">Check CLEARCORP official header</field>
+ <field name="orientation">Portrait</field>
+ <field name="format">Letter</field>
+ <field eval="0.50" name="margin_top"/>
+ <field eval="0.0" name="margin_bottom"/>
+ <field eval="0.10" name="margin_left"/>
+ <field eval="0.10" name="margin_right"/>
+ <field name="html"><![CDATA[<html> </html>]]></field>
+ <field name="css"><![CDATA[
+body {
+ /*margin-top : 10px;cambio de 20 a 10*/
+}
+
+#wrapper{
+
+}
+
+#document_data{
+ /*padding : 5px;*/
+ padding-top : 15px;
+ width : 100%;
+ height : 185px;/*cambio de 210 a 200*/
+}
+
+#date {
+ margin : 20px 0px 5px 350px;/*cambio de 400 a 200*/
+}
+
+#detail {
+ margin-top : 13px;
+ width : 100%;
+
+}
+
+.amount_detail {
+ margin : 0px 0px 0px 375px;/*cambio de 400 a 200*/
+}
+
+#accounting_data {
+ /*margin-right : 100px;*/
+
+}
+
+#document_desc {
+ height : 90px;/*cambio de 110 a 90*/
+ margin-bottom : 10px;/*cambio de 7 a 3*/
+ width : 100%;
+}
+
+#accounts{
+ margin-top : 4px;/*cambio de 8 a 2*/
+ margin-bottom : 7px;/*cambio de 13 a 7*/
+ height : 250px;/*cambio de 290 a 250*/
+ width : 82%;
+ /*width : 660px; /*643*/
+}
+
+#table_account{
+ border-collapse: collapse;
+}
+
+#table_account td {
+ padding: 3px;
+}
+
+#table_account tr.account_line td {
+ border: 0px solid black;
+ border-bottom-width: 1px;
+ font-family : sans-serif;
+ font-size : 13px;
+}
+
+#footer_data{}
+
+.detail_desc{
+ font-family : sans-serif;
+ font-size : 13px;
+ font-style : italic;
+}
+
+.text_font{
+ font-family : sans-serif;
+ font-size : 13px;
+}
+
+.amount{
+ font-family : sans-serif;
+ font-size : 13px;
+ font-style : italic;
+}
+
+.account_line{
+ font-family : sans-serif;
+ font-size : 13px;
+}
+.detail_line{
+ width : 60%;/*cambio de 70 a 30*/
+ float : left;
+ margin-left : 50px;/*cambio de 70 a 30*/
+}
+.amount_text{
+ /*margin : 5px;*/
+ width : 70%;
+ margin-top : 15px;
+ margin-left : 50px;/*cambio de 70 a 30*/
+ word-spacing:-1px;
+}
+
+
+.account_id{
+ width : 288px;
+ text-align : left;
+ word-spacing:-1px;
+}
+
+.code_cell {
+ width : 120px;/*125*/
+ text-align : left;
+}
+
+.code_div {
+ float : left;
+ width : 120px;
+
+}
+
+.amount_acc {
+ width : 120px;/*125*/
+ text-align : right;
+ word-spacing:-1px;
+}
+
+.made_by{
+ float : left;
+ width : 85px;
+ margin-left : 5px;
+ font-family : sans-serif;
+ font-size : 13px;
+ text-align : center;
+}
+
+#receipt {
+ float : left;
+ margin-left : 15px;
+}
+
+#related{
+ float : left;
+}
+
+.sub_receipt{
+ width : 140px;
+ font-family : sans-serif;
+ font-size : 10px;
+ text-align : center;
+}
+
+ td {border-collapse: collapse; }
+
+.amount_desc {
+ font-family : sans-serif;
+ font-size : 13px;
+ word-spacing: -2px;
+ }
+
+.amount_desc_medium {
+ font-family : sans-serif;
+ font-size : 10px;
+ word-spacing: -2px;
+ }
+
+.amount_desc_small {
+ font-family : sans-serif;
+ font-size : 8.2px;
+ word-spacing: 0px;
+ }
+ ]]>
+ </field>
+ </record>
+ </data>
+</openerp>
=== modified file 'l10n_cr_account_voucher_check_bcr/l10n_cr_account_voucher_check_bcr_report.xml'
--- l10n_cr_account_voucher_check_bcr/l10n_cr_account_voucher_check_bcr_report.xml 2012-06-12 16:56:45 +0000
+++ l10n_cr_account_voucher_check_bcr/l10n_cr_account_voucher_check_bcr_report.xml 2013-11-06 21:08:21 +0000
@@ -1,197 +1,19 @@
<?xml version="1.0"?>
<openerp>
- <data >
- <record id="webkit_header_l10n_cr_account_voucher_check_bcr" model="ir.header_webkit">
- <field name="name">Check print BCR</field>
- <field name="orientation">Portrait</field>
- <field name="format">Letter</field>
- <field eval="0.50" name="margin_top"/>
- <field eval="0.0" name="margin_bottom"/>
- <field eval="0.10" name="margin_left"/>
- <field eval="0.10" name="margin_right"/>
- <field name="html"><![CDATA[<html> </html>]]></field>
- <field name="css"><![CDATA[
-body {
- /*margin-top : 10px;cambio de 20 a 10*/
-}
-
-#wrapper{
-
-}
-
-#document_data{
- /*padding : 5px;*/
- padding-top : 15px;
- width : 100%;
- height : 185px;/*cambio de 210 a 200*/
-}
-
-#date {
- margin : 20px 0px 5px 350px;/*cambio de 400 a 200*/
-}
-
-#detail {
- margin-top : 13px;
- width : 100%;
-
-}
-
-.amount_detail {
- margin : 0px 0px 0px 375px;/*cambio de 400 a 200*/
-}
-
-#accounting_data {
- /*margin-right : 100px;*/
-
-}
-
-#document_desc {
- height : 90px;/*cambio de 110 a 90*/
- margin-bottom : 10px;/*cambio de 7 a 3*/
- width : 100%;
-}
-
-#accounts{
- margin-top : 4px;/*cambio de 8 a 2*/
- margin-bottom : 7px;/*cambio de 13 a 7*/
- height : 250px;/*cambio de 290 a 250*/
- width : 82%;
- /*width : 660px; /*643*/
-}
-
-#table_account{
- border-collapse: collapse;
-}
-
-#table_account td {
- padding: 3px;
-}
-
-#table_account tr.account_line td {
- border: 0px solid black;
- border-bottom-width: 1px;
- font-family : sans-serif;
- font-size : 13px;
-}
-
-#footer_data{}
-
-.detail_desc{
- font-family : sans-serif;
- font-size : 13px;
- font-style : italic;
-}
-
-.text_font{
- font-family : sans-serif;
- font-size : 13px;
-}
-
-.amount{
- font-family : sans-serif;
- font-size : 13px;
- font-style : italic;
-}
-
-.account_line{
- font-family : sans-serif;
- font-size : 13px;
-}
-.detail_line{
- width : 60%;/*cambio de 70 a 30*/
- float : left;
- margin-left : 50px;/*cambio de 70 a 30*/
-}
-.amount_text{
- /*margin : 5px;*/
- width : 70%;
- margin-top : 15px;
- margin-left : 50px;/*cambio de 70 a 30*/
- word-spacing:-1px;
-}
-
-
-.account_id{
- width : 288px;
- text-align : left;
- word-spacing:-1px;
-}
-
-.code_cell {
- width : 120px;/*125*/
- text-align : left;
-}
-
-.code_div {
- float : left;
- width : 120px;
-
-}
-
-.amount_acc {
- width : 120px;/*125*/
- text-align : right;
- word-spacing:-1px;
-}
-
-.made_by{
- float : left;
- width : 85px;
- margin-left : 5px;
- font-family : sans-serif;
- font-size : 13px;
- text-align : center;
-}
-
-#receipt {
- float : left;
- margin-left : 15px;
-}
-
-#related{
- float : left;
-}
-
-.sub_receipt{
- width : 140px;
- font-family : sans-serif;
- font-size : 10px;
- text-align : center;
-}
-
- td {border-collapse: collapse; }
-
-.amount_desc {
- font-family : sans-serif;
- font-size : 13px;
- word-spacing: -2px;
- }
-
-.amount_desc_medium {
- font-family : sans-serif;
- font-size : 10px;
- word-spacing: -2px;
- }
-
-.amount_desc_small {
- font-family : sans-serif;
- font-size : 8.2px;
- word-spacing: 0px;
- }
- ]]>
- </field>
- </record>
+ <data >
+
<report auto="False"
id="webkit_report_l10n_cr_account_voucher_check_bcr"
model="account.voucher"
name="webkit_report_l10n_cr_account_voucher_check_bcr"
file="l10n_cr_account_voucher_check_bcr/report/l10n_cr_account_voucher_check_bcr.mako"
- string="Imprimir Cheque BCR"
- report_type="webkit"
-
+ string="Imprimir Cheque"
+ report_type="webkit"
/>
+
<record id="webkit_report_l10n_cr_account_voucher_check_bcr" model="ir.actions.report.xml">
- <field name="webkit_header" ref="webkit_header_l10n_cr_account_voucher_check_bcr" />
+ <field name="webkit_header" ref="report_webkit_lib.webkit_header_l10n_cr_account_voucher_check_bcr" />
</record>
+
</data>
</openerp>
=== modified file 'l10n_cr_account_voucher_check_bcr/l10n_cr_account_voucher_check_bcr_view.xml'
--- l10n_cr_account_voucher_check_bcr/l10n_cr_account_voucher_check_bcr_view.xml 2013-03-11 16:26:20 +0000
+++ l10n_cr_account_voucher_check_bcr/l10n_cr_account_voucher_check_bcr_view.xml 2013-11-06 21:08:21 +0000
@@ -1,5 +1,6 @@
<?xml version = "1.0" encoding = "UTF-8"?>
<openerp>
+<<<<<<< TREE
<data>
<record id="action_check_payment" model="ir.actions.act_window">
@@ -25,6 +26,48 @@
<field name="act_window_id" ref="action_check_payment"/>
</record>
+=======
+ <data>
+ <record id="action_check_payment" model="ir.actions.act_window">
+ <field name="name">Check Payment</field>
+ <field name="res_model">account.voucher</field>
+ <field name="view_type">form</field>
+ <field name="domain">[('journal_id.type', 'in', ['bank']), ('type','=','payment')]</field>
+ <field name="context">{'type':'payment'}</field>
+ <field name="view_id" eval="False"/>
+ <field name="search_view_id" ref="account_voucher.view_voucher_filter_vendor_pay"/>
+ <field name="target">current</field>
+ <field name="help">The Check payment form allows you to track the payment by check you do to your suppliers. When you select a supplier, the payment method and an amount for the payment, OpenERP will propose to reconcile your payment with the open supplier invoices or bills.</field>
+ </record>
+
+ <record id="action_check_payment_tree" model="ir.actions.act_window.view">
+ <field eval="1" name="sequence"/>
+ <field name="view_mode">tree</field>
+ <field name="act_window_id" ref="action_check_payment"/>
+ </record>
+
+ <record id="action_check_payment_form" model="ir.actions.act_window.view">
+ <field eval="2" name="sequence"/>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="account_voucher.view_vendor_payment_form"/>
+ <field name="act_window_id" ref="action_check_payment"/>
+ </record>
+
+ <record model = "ir.ui.view" id = "rent_invoice_form_view">
+ <field name = "name">check.invoice.supplier.form</field>
+ <field name = "model">account.invoice</field>
+ <field name = "type">form</field>
+ <field name = "inherit_id" ref = "account.invoice_supplier_form"/>
+ <field name = "arch" type="xml">
+ <data>
+ <field name="date_invoice" position="before">
+ <field name = "name" />
+ </field>
+ </data>
+ </field>
+ </record>
+
+>>>>>>> MERGE-SOURCE
<menuitem action="action_check_payment" icon="STOCK_JUSTIFY_FILL" sequence="12"
id="menu_action_vendor_payment" parent="account.menu_finance_payables"/>
=== modified file 'l10n_cr_account_voucher_check_bcr/report/__init__.py'
--- l10n_cr_account_voucher_check_bcr/report/__init__.py 2012-06-08 17:19:18 +0000
+++ l10n_cr_account_voucher_check_bcr/report/__init__.py 2013-11-06 21:08:21 +0000
@@ -1,35 +1,22 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# __init__.py
-# check_voucher
-# First author: Mag Guevara <mag.guevara@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2011-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
-##############################################################################
-
+# -*- 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 l10n_cr_account_voucher_check_bcr
=== modified file 'l10n_cr_account_voucher_check_bcr/report/l10n_cr_account_voucher_check_bcr.py'
--- l10n_cr_account_voucher_check_bcr/report/l10n_cr_account_voucher_check_bcr.py 2012-06-12 16:56:45 +0000
+++ l10n_cr_account_voucher_check_bcr/report/l10n_cr_account_voucher_check_bcr.py 2013-11-06 21:08:21 +0000
@@ -1,44 +1,30 @@
-# -*- encoding: utf-8 -*-
+# -*- coding: utf-8 -*-
##############################################################################
#
-# check_voucher.py
-# account_voucher_check
-# First author: Mag Guevara <mag.guevara@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Second author: Juan Felipe Muñoz <juan.munoz@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
+# 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
import pooler
from report import report_sxw
-from l10n_cr_account_voucher_check_bcr_amount_to_text import number_to_text_es
+from openerp.addons.account_report_lib.tools.tools_amount_to_text import number_to_text_es
import locale
-#from tools import #debug
class check_voucher(report_sxw.rml_parse):
=== removed file 'l10n_cr_account_voucher_check_bcr/report/l10n_cr_account_voucher_check_bcr_amount_to_text.py'
--- l10n_cr_account_voucher_check_bcr/report/l10n_cr_account_voucher_check_bcr_amount_to_text.py 2012-06-08 17:19:18 +0000
+++ l10n_cr_account_voucher_check_bcr/report/l10n_cr_account_voucher_check_bcr_amount_to_text.py 1970-01-01 00:00:00 +0000
@@ -1,130 +0,0 @@
-#!/usr/bin/python
-# -*- coding: utf-8 -*-
-
-#from tools import #debug
-UNIDADES = (
- '',
- 'UN ',
- 'DOS ',
- 'TRES ',
- 'CUATRO ',
- 'CINCO ',
- 'SEIS ',
- 'SIETE ',
- 'OCHO ',
- 'NUEVE ',
- 'DIEZ ',
- 'ONCE ',
- 'DOCE ',
- 'TRECE ',
- 'CATORCE ',
- 'QUINCE ',
- 'DIECISEIS ',
- 'DIECISIETE ',
- 'DIECIOCHO ',
- 'DIECINUEVE ',
- 'VEINTE '
-)
-DECENAS = (
- 'VENTI',
- 'TREINTA ',
- 'CUARENTA ',
- 'CINCUENTA ',
- 'SESENTA ',
- 'SETENTA ',
- 'OCHENTA ',
- 'NOVENTA ',
- 'CIEN '
-)
-CENTENAS = (
- 'CIENTO ',
- 'DOSCIENTOS ',
- 'TRESCIENTOS ',
- 'CUATROCIENTOS ',
- 'QUINIENTOS ',
- 'SEISCIENTOS ',
- 'SETECIENTOS ',
- 'OCHOCIENTOS ',
- 'NOVECIENTOS '
-)
-
-def number_to_text_es(number_in,currency,join_dec=' Y ',separator=',',decimal_point='.'):
-
- converted = ''
- if currency == False:
- currency = ''
-
- if currency == None:
- currency = ''
-
- if type(number_in) != 'str':
- number = str(number_in)
- else:
- number = number_in
-
- number_str=number
- #if we are using the coma as separator we need to remove them from the string
- try:
- number_str = number_str.replace(separator,'')
- except ValueError:
- print 'The separator used for the thousands its not supported'
-
- #debug(number_str)
-
- try:
- number_int, number_dec = number_str.split(decimal_point)
- except ValueError:
- number_int = number_str
- number_dec = ""
-
- number_str = number_int.zfill(9)
- millones = number_str[:3]
- miles = number_str[3:6]
- cientos = number_str[6:]
-
- if(millones):
- if(millones == '001'):
- converted += 'UN MILLON '
- elif(int(millones) > 0):
- converted += '%sMILLONES ' % __convertNumber(millones)
-
- if(miles):
- if(miles == '001'):
- converted += 'MIL '
- elif(int(miles) > 0):
- converted += '%sMIL ' % __convertNumber(miles)
- if(cientos):
- if(cientos == '001'):
- converted += 'UN '
- elif(int(cientos) > 0):
- converted += '%s ' % __convertNumber(cientos)
-
- if number_dec == "":
- number_dec = "00"
- if (len(number_dec) < 2 ):
- number_dec+='0'
-
- has_decimal = float(number_dec) != 0 and join_dec + number_dec + "/100" or ' EXACTOS'
- converted += currency + has_decimal
-
-
- return converted
-
-def __convertNumber(n):
- output = ''
-
- if(n == '100'):
- output = "CIEN "
- elif(n[0] != '0'):
- output = CENTENAS[int(n[0])-1]
-
- k = int(n[1:])
- if(k <= 20):
- output += UNIDADES[k]
- else:
- if((k > 30) & (n[2] != '0')):
- output += '%sY %s' % (DECENAS[int(n[1])-2], UNIDADES[int(n[2])])
- else:
- output += '%s%s' % (DECENAS[int(n[1])-2], UNIDADES[int(n[2])])
-
- return output
=== removed file 'l10n_cr_account_voucher_check_bcr/report/l10n_cr_account_voucher_check_bcr_check_voucher.py'
--- l10n_cr_account_voucher_check_bcr/report/l10n_cr_account_voucher_check_bcr_check_voucher.py 2012-06-08 17:19:18 +0000
+++ l10n_cr_account_voucher_check_bcr/report/l10n_cr_account_voucher_check_bcr_check_voucher.py 1970-01-01 00:00:00 +0000
@@ -1,100 +0,0 @@
-# -*- encoding: utf-8 -*-
-##############################################################################
-#
-# check_voucher.py
-# account_voucher_check
-# First author: Mag Guevara <mag.guevara@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Second author: Juan Felipe Muñoz <juan.munoz@xxxxxxxxxxxxxxx> (ClearCorp S.A.)
-# Third author: Diana Rodriguez <diana.rodriguez@xxxxxxxxxxxxxxx>(ClearCorp S.A)
-# Copyright (c) 2010-TODAY ClearCorp S.A. (http://clearcorp.co.cr). All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without modification, are
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of source code must retain the above copyright notice, this list of
-# conditions and the following disclaimer.
-#
-# 2. Redistributions in binary form must reproduce the above copyright notice, this list
-# of conditions and the following disclaimer in the documentation and/or other materials
-# provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY <COPYRIGHT HOLDER> ``AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> OR
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# The views and conclusions contained in the software and documentation are those of the
-# authors and should not be interpreted as representing official policies, either expressed
-# or implied, of ClearCorp S.A..
-#
-##############################################################################
-
-import time
-import pooler
-from report import report_sxw
-from l10n_cr_account_voucher_check_bcr_amount_to_text import number_to_text_es
-import locale
-#from tools import #debug
-
-class check_voucher(report_sxw.rml_parse):
-
- def __init__(self, cr, uid, name, context):
- super(check_voucher, self).__init__(cr, uid, name, context=context)
- self.localcontext.update({
- 'time': time,
- 'cr' : cr,
- 'uid' : uid,
- 'get_text':self.get_text,
- 'count_text':self.count_text,
- 'get_concept':self.get_concept,
- })
- self.context = context
- self._node = None
-
-
- def get_text(self,amount,currency,lang,company_id):
- separator = ','
- decimal_point = '.'
- name_currency = currency.currency_name
- if name_currency == False:
- name_currency = company_id.currency_id.currency_name
- if name_currency == None:
- name_currency = company_id.currency_id.currency_name
- if lang:
- lang_pool = self.pool.get('res.lang')
- id_lang = lang_pool.search(self.cr,self.uid,[('code','=',lang)])
- obj_lang = lang_pool.browse(self.cr,self.uid,id_lang)[0]
- separator = obj_lang and obj_lang.thousands_sep or separator
- decimal_point = obj_lang and obj_lang.decimal_point or decimal_point
- #debug(separator)
- #debug(decimal_point)
- res = number_to_text_es(amount,name_currency,separator=separator,decimal_point=decimal_point)
- return res
-
-
-
- def count_text(self,amount,currency,lang,company_id):
- res = len(self.get_text(amount,currency,lang,company_id))
- return res
-
-
- def get_concept(self,moves):
- res = 'error'
- for move in moves:
- move_line = self.pool.get('acccount.move.line').browse(self.cr,self.uid,move.id)
- invoice = self.pool.get('account.invoice').browse(self.cr,self.uid,move_line.invoice)
- if invoice.name != ''or invoice.name != False:
- res = invoice.name
- return res
-
-report_sxw.report_sxw(
- 'report.webkit_report_l10n_cr_account_voucher_check_bcr',
- 'account.voucher',
- 'addons/account_voucher_check/report/l10n_cr_account_voucher_check_bcr.mako',
- parser=check_voucher
-)
=== added directory 'l10n_cr_exchange_rates'
=== renamed directory 'l10n_cr_exchange_rates' => 'l10n_cr_exchange_rates.moved'
=== added file 'l10n_cr_exchange_rates/__init__.py'
--- l10n_cr_exchange_rates/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_exchange_rates/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,24 @@
+# -*- 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 l10n_cr_exchange_rates
+import wizard
=== added file 'l10n_cr_exchange_rates/__openerp__.py'
--- l10n_cr_exchange_rates/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_exchange_rates/__openerp__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,51 @@
+# -*- 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/>.
+#
+##############################################################################
+
+{
+ "name" : 'l10n_cr_exchange_rates',
+ "version" : '1.0',
+ "author" : 'CLEARCORP S.A',
+ 'complexity': 'normal',
+ "description": """
+l10n_cr_exchange_rates
+ """,
+ "category": 'Accounting & Finance',
+ "sequence": 4,
+ "website" : "http://clearcorp.co.cr",
+ "images" : [],
+ "icon" : False,
+ "depends" : [
+ "account",
+ "base_import_exchange_rates",
+ "res_currency_sequence",
+ ],
+ "init_xml" : [],
+ "demo_xml" : [],
+ "update_xml" : [
+ "l10n_cr_exchange_rates_view.xml",
+ "wizard/l10n_cr_exchange_rates_wizard.xml",
+ ],
+ "test" : [],
+ "auto_install": False,
+ "application": False,
+ "installable": True,
+}
=== added directory 'l10n_cr_exchange_rates/i18n'
=== added symlink 'l10n_cr_exchange_rates/i18n/es.po'
=== target is u'es_CR.po'
=== added file 'l10n_cr_exchange_rates/i18n/es_CR.po'
--- l10n_cr_exchange_rates/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ l10n_cr_exchange_rates/i18n/es_CR.po 2013-11-06 21:08:21 +0000
@@ -0,0 +1,183 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * l10n_cr_exchange_rates
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-07-25 21:36+0000\n"
+"PO-Revision-Date: 2013-07-25 21:36+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: l10n_cr_exchange_rates
+#: constraint:account.move:0
+msgid "You can not create more than one move per period on centralized journal"
+msgstr "No puede crear más de un asiento por periodo en un diario centralizado"
+
+#. module: l10n_cr_exchange_rates
+#: constraint:account.move.line:0
+msgid "Company must be the same for its related account and period."
+msgstr "La compañía debe ser la misma para su cuenta y periodos relacionados"
+
+#. module: l10n_cr_exchange_rates
+#: model:ir.model,name:l10n_cr_exchange_rates.model_generate_exchange_rates_wizard
+msgid "generate.exchange.rates.wizard"
+msgstr "generate.exchange.rates.wizard"
+
+#. module: l10n_cr_exchange_rates
+#: sql_constraint:account.account:0
+msgid "The code of the account must be unique per company !"
+msgstr "¡El código de la cuenta debe ser único por compañía!"
+
+#. module: l10n_cr_exchange_rates
+#: field:account.account,exchange_rate_adjustment:0
+msgid "Exchange rate adjustment"
+msgstr "Ajuste de la tasa de cambio"
+
+#. module: l10n_cr_exchange_rates
+#: help:account.move.line,amount_exchange_rate:0
+msgid "The amount of exchange rate."
+msgstr "El monto de tipo de cambio."
+
+#. module: l10n_cr_exchange_rates
+#: view:generate.exchange.rates.wizard:0
+msgid "This wizard will generates an move about exchange rate of the moves that belong to the selected period."
+msgstr "Este asistente genera un asiento sobre el tipo de cambio de los asientos que pertenecen al período seleccionado."
+
+#. module: l10n_cr_exchange_rates
+#: field:generate.exchange.rates.wizard,journal_id:0
+msgid "Journal"
+msgstr "Diario"
+
+#. module: l10n_cr_exchange_rates
+#: view:generate.exchange.rates.wizard:0
+#: model:ir.actions.act_window,name:l10n_cr_exchange_rates.action_generate_exchange_rates_wizard
+#: model:ir.ui.menu,name:l10n_cr_exchange_rates.menu_generate_exchange_rates_wizard
+msgid "Generate move exchange rate adjustment"
+msgstr "Generar asiento de ajuste cambiario"
+
+#. module: l10n_cr_exchange_rates
+#: model:ir.model,name:l10n_cr_exchange_rates.model_account_move_line
+msgid "Journal Items"
+msgstr "Apuntes contables"
+
+#. module: l10n_cr_exchange_rates
+#: constraint:account.move.line:0
+msgid "You can not create journal items on an account of type view."
+msgstr "No puede crear asientos en una cuenta de tipo vista"
+
+#. module: l10n_cr_exchange_rates
+#: help:account.move.line,amount_base_import_exchange_rate:0
+msgid "Exchange rate in the system."
+msgstr "Tipo de cambio en el sistema."
+
+#. module: l10n_cr_exchange_rates
+#: model:ir.model,name:l10n_cr_exchange_rates.model_account_account
+msgid "Account"
+msgstr "Cuenta"
+
+#. module: l10n_cr_exchange_rates
+#: view:generate.exchange.rates.wizard:0
+msgid "Compute"
+msgstr "Crear"
+
+#. module: l10n_cr_exchange_rates
+#: help:generate.exchange.rates.wizard,journal_id:0
+#: help:generate.exchange.rates.wizard,period_id:0
+msgid "Choose the journal for the move automatically generated"
+msgstr "Elija el diario para el asiento generado automáticamente"
+
+#. module: l10n_cr_exchange_rates
+#: field:account.move.line,amount_base_import_exchange_rate:0
+msgid "Base amount exchange rate"
+msgstr "Monto base del tipo de cambio"
+
+#. module: l10n_cr_exchange_rates
+#: view:generate.exchange.rates.wizard:0
+msgid "Select the options do you need"
+msgstr "Seleccione las opciones que necesita"
+
+#. module: l10n_cr_exchange_rates
+#: sql_constraint:account.move.line:0
+msgid "Wrong credit or debit value in accounting entry !"
+msgstr "¡Valor haber o debe erróneo en el asiento contable!"
+
+#. module: l10n_cr_exchange_rates
+#: constraint:account.move.line:0
+msgid "You can not create journal items on closed account."
+msgstr "No puede crear asientos en cuentas cerradas"
+
+#. module: l10n_cr_exchange_rates
+#: model:ir.model,name:l10n_cr_exchange_rates.model_account_move
+msgid "Account Entry"
+msgstr "Asiento contable"
+
+#. module: l10n_cr_exchange_rates
+#: constraint:account.account:0
+msgid "Error ! You can not create recursive accounts."
+msgstr "¡Error! No se pueden crear cuentas recursivas."
+
+#. module: l10n_cr_exchange_rates
+#: field:generate.exchange.rates.wizard,reference:0
+msgid "Reference"
+msgstr "Referencia"
+
+#. module: l10n_cr_exchange_rates
+#: constraint:account.account:0
+msgid "Configuration Error! \n"
+"You can not select an account type with a deferral method different of \"Unreconciled\" for accounts with internal type \"Payable/Receivable\"! "
+msgstr "¡Error de configuración! \n"
+"¡No se puede seleccionar un tipo de cuenta con un método diferente de aplazamiento \"no reconciliadas\" para las cuentas con el tipo interno \"por pagar / por cobrar\"! "
+
+#. module: l10n_cr_exchange_rates
+#: field:account.move.line,amount_exchange_rate:0
+msgid "Amount of exchange rate"
+msgstr "Importe de tipo de cambio"
+
+#. module: l10n_cr_exchange_rates
+#: field:generate.exchange.rates.wizard,period_id:0
+msgid "Period"
+msgstr "Período"
+
+#. module: l10n_cr_exchange_rates
+#: constraint:account.move.line:0
+msgid "The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal."
+msgstr "La cuenta seleccionada en su asiento fuerza a tener una moneda secundaria. Debería eliminar la moneda secundaria de la cuenta o asignar al diario una vista multi-moneda"
+
+#. module: l10n_cr_exchange_rates
+#: constraint:account.move.line:0
+msgid "The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal."
+msgstr "¡La fecha de su asiento no está en el periodo definido! Usted debería cambiar la fecha o borar esta restricción del diario."
+
+#. module: l10n_cr_exchange_rates
+#: help:account.account,exchange_rate_adjustment:0
+msgid "Choose if the account needed an adjusted exchange rate"
+msgstr "Elija si la cuenta requiere ajuste de tipo de cambio"
+
+#. module: l10n_cr_exchange_rates
+#: constraint:account.account:0
+msgid "Configuration Error! \n"
+"You can not define children to an account with internal type different of \"View\"! "
+msgstr "¡Error de configuración! "
+
+#. module: l10n_cr_exchange_rates
+#: view:generate.exchange.rates.wizard:0
+msgid "Cancel"
+msgstr "Cancelar"
+
+#. module: l10n_cr_exchange_rates
+#: code:addons/l10n_cr_exchange_rates/wizard/l10n_cr_exchange_rates_wizard.py:51
+#, python-format
+msgid "Created Account Moves"
+msgstr "Asientos contables creados"
+
+#. module: l10n_cr_exchange_rates
+#: field:account.move.line,adjustment:0
+msgid "Adjustment"
+msgstr "Ajuste"
=== added file 'l10n_cr_exchange_rates/l10n_cr_exchange_rates.py'
--- l10n_cr_exchange_rates/l10n_cr_exchange_rates.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_exchange_rates/l10n_cr_exchange_rates.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,269 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import osv, fields
+from tools.translate import _
+
+class AccountAccount(osv.osv):
+ _name = "account.account"
+ _inherit = "account.account"
+
+ _columns = {
+ 'exchange_rate_adjustment': fields.boolean('Exchange rate adjustment', help="Choose if the account needed an adjusted exchange rate"),
+ }
+
+class AccountMoveLine(osv.osv):
+ _name = "account.move.line"
+ _inherit = "account.move.line"
+
+ def _amount_exchange_rate(self, cr, uid, ids, field_names, args, context=None):
+ """
+ This function returns an amount of exchange rate base in the debit/credit and amount_currency,
+ and returns an amount of exchange rate of the day.
+ """
+ res = {}
+ if context is None:
+ context = {}
+ res_currency_obj = self.pool.get('res.currency')
+ res_currency_rate_obj = self.pool.get('res.currency.rate')
+ res_users_obj = self.pool.get('res.users')
+
+ res_user = res_users_obj.browse(cr, uid, uid, context=context)
+ company_currency = res_user.company_id.currency_id
+
+ lines = self.browse(cr, uid, ids, context=context)
+ for move_line in lines:
+ res[move_line.id] = {
+ 'amount_exchange_rate': 0.0,
+ 'amount_base_import_exchange_rate': 0.0,
+ }
+
+ if not move_line.currency_id or move_line.amount_currency == 0:
+ continue
+ if move_line.debit and move_line.debit > 0.00:
+ sign = move_line.amount_currency < 0 and -1 or 1
+ result = sign * move_line.debit / move_line.amount_currency
+ res[move_line.id]['amount_exchange_rate'] = res_currency_obj.round(cr, uid, move_line.currency_id, result) or result
+ elif move_line.credit and move_line.credit > 0.00:
+ sign = move_line.amount_currency < 0 and -1 or 1
+ result = sign * move_line.credit / move_line.amount_currency
+ res[move_line.id]['amount_exchange_rate'] = res_currency_obj.round(cr, uid, move_line.currency_id, result) or result
+ res[move_line.id]['amount_base_import_exchange_rate'] = res_currency_obj.get_exchange_rate(cr, uid, move_line.currency_id, company_currency, move_line.date, context)
+ return res
+
+ _columns = {
+ 'amount_exchange_rate': fields.function(_amount_exchange_rate, string='Amount of exchange rate', multi="residual", help="The amount of exchange rate."),
+ 'amount_base_import_exchange_rate': fields.function(_amount_exchange_rate, string='Base amount exchange rate', multi="residual", help="Exchange rate in the system."),
+ 'adjustment': fields.many2one('account.move.line', 'Adjustment'),
+ }
+
+ def copy(self, cr, uid, id, default={}, context=None):
+ default.update({
+ 'adjustment':False,
+ })
+
+class AccountMove(osv.osv):
+ _name = "account.move"
+ _inherit = "account.move"
+
+ def get_balance_amount(self, cr, uid, move_id, context):
+ cr.execute( 'SELECT SUM(debit-credit) '\
+ 'FROM account_move_line '\
+ 'WHERE move_id = %s ', (move_id,))
+ result = cr.fetchall()
+ return result[0][0] or 0.00
+
+ def get_adjustment_amount(self, cr, uid, move_id, context):
+ cr.execute( 'SELECT SUM(debit-credit) '\
+ 'FROM account_move_line '\
+ 'WHERE adjustment = %s ', (move_id,))
+ result = cr.fetchall()
+ return result[0][0] or 0.00
+
+ def create_move_lines_reconcile(self, cr, uid, move, exchange_rate_end_period, context=None):
+ move_line_obj = self.pool.get('account.move.line')
+ account_account_obj = self.pool.get('account.account')
+ lines_created_ids = []
+ account_reconcile_ids = account_account_obj.search(cr, uid, [('exchange_rate_adjustment', '=', True), ('reconcile', '=', True)], context=context)
+ line_reconcile_ids = move_line_obj.search(cr, uid, [('currency_id','!=',None), ('period_id','=',move.period_id.id), ('amount_currency','!=',0), ('account_id','in',account_reconcile_ids), ('adjustment','=',None), ('reconcile_id','=',None)], context=context)
+ lines_reconcile = move_line_obj.browse(cr, uid, line_reconcile_ids, context=context)
+
+ for line in lines_reconcile:
+ if line.move_id.state == 'draft' or not line.amount_currency:
+ continue
+
+ sign_amount_currency = line.amount_currency < 0 and -1 or 1
+ line_difference = 0
+ adjustment_amount = self.get_adjustment_amount(cr, uid, line.id, context=context)
+ if line.credit != 0:
+ line_difference = sign_amount_currency * line.amount_currency * exchange_rate_end_period - line.credit
+ elif line.debit != 0:
+ line_difference = sign_amount_currency * line.amount_currency * exchange_rate_end_period - line.debit
+
+ sign = line_difference < 0 and -1 or 1
+ if line_difference == 0:
+ continue
+ elif line.credit == 0 and exchange_rate_end_period > line.amount_exchange_rate or line.debit == 0 and exchange_rate_end_period < line.amount_exchange_rate:
+ credit = 0.00
+ debit = sign * line_difference - adjustment_amount
+ else:
+ credit = sign * line_difference + adjustment_amount
+ debit = 0.00
+ move_line = {
+ 'name': line.name or '',
+ 'ref': line.ref or '',
+ 'debit': debit,
+ 'credit': credit,
+ 'account_id':line.account_id.id,
+ 'move_id': move.id,
+ 'period_id': line.period_id.id,
+ 'journal_id': line.journal_id.id,
+ 'partner_id': line.partner_id.id,
+ 'currency_id': line.account_id.currency_id.id,
+ 'amount_currency': 0.00,
+ 'state': 'valid',
+ 'company_id': line.company_id.id,
+ 'adjustment': line.id,
+ }
+ new_move_line_id = move_line_obj.create(cr, uid, move_line, context=context)
+ lines_created_ids.append(new_move_line_id)
+
+ return lines_created_ids
+
+ def create_move_lines_unreconcile(self, cr, uid, move, exchange_rate_end_period, context=None):
+ move_line_obj = self.pool.get('account.move.line')
+ account_account_obj = self.pool.get('account.account')
+ lines_created_ids = []
+ account_unreconcile_ids = account_account_obj.search(cr, uid, [('exchange_rate_adjustment', '=', True), ('reconcile', '=', False)], context=context)
+
+ for account_id in account_unreconcile_ids:
+ total_credit = 0.00
+ total_debit = 0.00
+ adjustment_lines = []
+ line_unreconcile_ids = move_line_obj.search(cr, uid, [('currency_id','!=',None), ('period_id','=',move.period_id.id), ('amount_currency','!=',0), ('account_id','=',account_id), ('adjustment','=',None)], context=context)
+ lines_unreconcile = move_line_obj.browse(cr, uid, line_unreconcile_ids, context=context)
+ for line in lines_unreconcile:
+ if line.move_id.state == 'draft' or not line.amount_currency:
+ continue
+
+ adjustment_lines.append(line.id)
+ sign_amount_currency = line.amount_currency < 0 and -1 or 1
+ line_difference = 0
+ if line.credit != 0:
+ line_difference = sign_amount_currency * line.amount_currency * exchange_rate_end_period - line.credit
+ elif line.debit != 0:
+ line_difference = sign_amount_currency * line.amount_currency * exchange_rate_end_period - line.debit
+
+ sign = line_difference < 0 and -1 or 1
+ if line_difference == 0:
+ continue
+ elif line.credit == 0 and exchange_rate_end_period > line.amount_exchange_rate or line.debit == 0 and exchange_rate_end_period < line.amount_exchange_rate:
+ total_debit += sign * line_difference
+ else:
+ total_credit += sign * line_difference
+
+ account = account_account_obj.browse(cr, uid, account_id, context=context)
+
+ if total_debit != 0.00 or total_credit != 0.00:
+
+ if total_debit > total_credit:
+ total_debit -= total_credit
+ total_credit = 0.00
+ elif total_debit < total_credit:
+ total_debit = 0.00
+ total_credit -= total_debit
+ else:
+ continue
+
+ move_line = {
+ 'name': _('Unreconcile lines adjustment'),
+ 'debit': total_debit,
+ 'credit': total_credit,
+ 'account_id':account_id,
+ 'move_id': move.id,
+ 'period_id': move.period_id.id,
+ 'journal_id': move.journal_id.id,
+ 'currency_id': account.currency_id.id,
+ 'amount_currency': 0.00,
+ 'state': 'valid',
+ 'company_id': move.company_id.id,
+ }
+ new_move_line_id = move_line_obj.create(cr, uid, move_line, context=context)
+ move_line_obj.write(cr, uid, adjustment_lines, {'adjustment' : new_move_line_id}, context=context)
+ lines_created_ids.append(new_move_line_id)
+
+ return lines_created_ids
+
+ def create_balance_line(self, cr, uid, move, res_user, name, context=None):
+ move_line_obj = self.pool.get('account.move.line')
+ amount = self.get_balance_amount(cr, uid, move.id, context=context)
+ if amount > 0:
+ account_id = res_user.company_id.expense_currency_exchange_account_id.id
+ credit = amount
+ debit = 0.00
+ else:
+ account_id = res_user.company_id.income_currency_exchange_account_id.id
+ credit = 0.00
+ debit = amount * -1
+ move_line = {
+ 'name': name,
+ 'ref': name,
+ 'debit': debit,
+ 'credit': credit,
+ 'account_id': account_id,
+ 'move_id': move.id,
+ 'period_id': move.period_id.id,
+ 'journal_id': move.journal_id.id,
+ 'currency_id': False,
+ 'amount_currency': 0.00,
+ 'state': 'valid',
+ 'company_id': res_user.company_id.id,
+ }
+ new_move_line_id = move_line_obj.create(cr, uid, move_line, context=context)
+ return new_move_line_id
+
+ def generate_adjustment_move(self, cr, uid, reference, journal, period, context=None):
+ res_currency_obj = self.pool.get('res.currency')
+ res_currency_rate_obj = self.pool.get('res.currency.rate')
+ res_user_obj = self.pool.get('res.users')
+
+ res_user = res_user_obj.browse(cr, uid, uid, context=context)
+ company_currency = res_user.company_id.currency_id
+ name = reference + " " + period.name
+
+ move_created = {
+ 'ref': name,
+ 'journal_id': journal.id,
+ 'period_id': period.id,
+ 'to_check': False,
+ 'company_id': res_user.company_id.id,
+ }
+ move_created_id = self.create(cr, uid, move_created)
+ move_created = self.browse(cr, uid, move_created_id, context=context)
+
+ exchange_rate_end_period = res_currency_obj._current_rate(cr, uid, [company_currency.id], period.date_stop, arg=None, context=context)[company_currency.id]
+ lines_reconcile_ids = self.create_move_lines_reconcile(cr, uid, move_created, exchange_rate_end_period, context=context)
+ print lines_reconcile_ids
+ lines_unreconcile_ids = self.create_move_lines_unreconcile(cr, uid, move_created, exchange_rate_end_period, context=context)
+ balance_line_id = self.create_balance_line(cr, uid, move_created, res_user, name, context=context)
+ return move_created_id
+
=== added file 'l10n_cr_exchange_rates/l10n_cr_exchange_rates_view.xml'
--- l10n_cr_exchange_rates/l10n_cr_exchange_rates_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_exchange_rates/l10n_cr_exchange_rates_view.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,62 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<openerp>
+ <data>
+
+ <!--
+ ======================================
+ account.account
+ ======================================
+ -->
+
+ <record id="account_view_form" model="ir.ui.view">
+ <field name="name">account.view.form</field>
+ <field name="model">account.account</field>
+ <field name="inherit_id" ref="account.view_account_form"/>
+ <field name="arch" type="xml">
+ <data>
+ <field name="currency_mode" position="after">
+ <field name="exchange_rate_adjustment"/>
+ </field>
+ </data>
+ </field>
+ </record>
+
+ <!--
+ ======================================
+ account.move.line
+ ======================================
+ -->
+
+ <record model = "ir.ui.view" id = "view_move_line_form_l10n_cr">
+ <field name = "name">view.move.line.form.l10n.cr</field>
+ <field name = "model">account.move.line</field>
+ <field name = "type">form</field>
+ <field name="inherit_id" ref="account.view_move_line_form"/>
+ <field name = "arch" type = "xml">
+ <data>
+ <field name = "amount_currency" position = "after">
+ <field name = "amount_exchange_rate"/>
+ <field name = "amount_base_import_exchange_rate"/>
+ </field>
+ </data>
+ </field>
+ </record>
+
+ <record model = "ir.ui.view" id = "view_move_line_form2_l10n_cr">
+ <field name = "name">view.move.line.form2.l10n.cr</field>
+ <field name = "model">account.move.line</field>
+ <field name = "type">form</field>
+ <field name="inherit_id" ref="account.view_move_line_form2"/>
+ <field name = "arch" type = "xml">
+ <data>
+ <field name = "amount_currency" position = "after">
+ <field name = "amount_exchange_rate"/>
+ <field name = "amount_base_import_exchange_rate"/>
+ </field>
+ </data>
+ </field>
+ </record>
+
+ </data>
+</openerp>
+
=== added directory 'l10n_cr_exchange_rates/wizard'
=== added file 'l10n_cr_exchange_rates/wizard/__init__.py'
--- l10n_cr_exchange_rates/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_exchange_rates/wizard/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_exchange_rates_wizard
=== added file 'l10n_cr_exchange_rates/wizard/l10n_cr_exchange_rates_wizard.py'
--- l10n_cr_exchange_rates/wizard/l10n_cr_exchange_rates_wizard.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_exchange_rates/wizard/l10n_cr_exchange_rates_wizard.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,62 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from osv import osv, fields
+from tools.translate import _
+
+class GenerateExchangeRatesWizard(osv.osv_memory):
+ _name = "generate.exchange.rates.wizard"
+ _description = "generate.exchange.rates.wizard"
+ _columns = {
+ 'reference': fields.char('Reference', size=256, required=True),
+ 'journal_id': fields.many2one('account.journal', 'Journal', required=True, help="Choose the journal for the move automatically generated"),
+ 'period_id': fields.many2one('account.period', 'Period', required=True, help="Choose the journal for the move automatically generated"),
+ }
+
+ def _get_period(self, cr, uid, context=None):
+ periods = self.pool.get('account.period').find(cr, uid)
+ if periods:
+ return periods[0]
+ return False
+
+ _defaults = {
+ 'period_id': _get_period,
+ }
+
+ def generate_exchange_rates(self, cr, uid, ids, context):
+ account_move_obj = self.pool.get('account.move')
+ data = self.browse(cr, uid, ids, context=context)
+ reference = data[0].reference
+ journal = data[0].journal_id
+ period = data[0].period_id
+ created_move_id = account_move_obj.generate_adjustment_move(cr, uid, reference, journal, period, context=context)
+ return {
+ 'name': _('Created Account Moves'),
+ 'view_type': 'form',
+ 'view_mode': 'tree,form',
+ 'res_model': 'account.move',
+ 'view_id': False,
+ 'domain': "[('id','=',"+str(created_move_id)+")]",
+ 'type': 'ir.actions.act_window',
+ }
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'l10n_cr_exchange_rates/wizard/l10n_cr_exchange_rates_wizard.xml'
--- l10n_cr_exchange_rates/wizard/l10n_cr_exchange_rates_wizard.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_exchange_rates/wizard/l10n_cr_exchange_rates_wizard.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <record id="view_generate_exchange_rates_wizard" model="ir.ui.view">
+ <field name="name">view.generate.exchange.rates.wizard</field>
+ <field name="model">generate.exchange.rates.wizard</field>
+ <field name="type">form</field>
+ <field name="arch" type="xml">
+ <form string="Generate move exchange rate adjustment">
+ <separator string="Select the options do you need" colspan="4"/>
+ <label string="This wizard will generates an move about exchange rate of the moves that belong to the selected period." colspan="4"/>
+ <newline/>
+ <field name="reference" colspan="4"/>
+ <field name="journal_id"/>
+ <field name="period_id"/>
+ <separator colspan="4"/>
+ <group colspan="4" col="6">
+ <label string="" colspan="2"/>
+ <button icon="gtk-cancel" special="cancel" string="Cancel"/>
+ <button icon="gtk-execute" string="Compute" name="generate_exchange_rates" type="object"/>
+ </group>
+ </form>
+ </field>
+ </record>
+
+ <record id="action_generate_exchange_rates_wizard" model="ir.actions.act_window">
+ <field name="name">Generate move exchange rate adjustment</field>
+ <field name="res_model">generate.exchange.rates.wizard</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">tree,form</field>
+ <field name="view_id" ref="view_generate_exchange_rates_wizard"/>
+ <field name="target">new</field>
+ </record>
+
+ <menuitem action="action_generate_exchange_rates_wizard"
+ id="menu_generate_exchange_rates_wizard"
+ parent="account.menu_finance_recurrent_entries" />
+
+ </data>
+</openerp>
=== added directory 'l10n_cr_hr_holidays'
=== added file 'l10n_cr_hr_holidays/__init__.py'
--- l10n_cr_hr_holidays/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_holidays/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_hr_holidays
\ No newline at end of file
=== added file 'l10n_cr_hr_holidays/__openerp__.py'
--- l10n_cr_hr_holidays/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_holidays/__openerp__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,49 @@
+# -*- 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/>.
+#
+##############################################################################
+
+{
+ 'name': 'l10n_cr_hr_holidays',
+ 'version': '1.0',
+ 'category': 'Human Resources',
+ "sequence": 38,
+ 'complexity': "normal",
+ 'description': """
+l10n_cr_hr_holidays
+===================
+ *Legal leaves per period
+ *Scheduled legal leaves calculations per period
+""",
+ 'author': 'CLEARCORP S.A.',
+ 'website': 'http://www.clearcorp.co.cr',
+ 'depends': [
+ 'hr_holidays'
+ ],
+ 'data': [
+ 'l10n_cr_hr_holidays_view.xml',
+ 'leaves_per_period_scheduled_task.xml',
+ ],
+ 'installable': True,
+ 'auto_install': False,
+ 'license': 'AGPL-3',
+}
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
=== added directory 'l10n_cr_hr_holidays/i18n'
=== added symlink 'l10n_cr_hr_holidays/i18n/es.po'
=== target is u'es_CR.po'
=== added file 'l10n_cr_hr_holidays/i18n/es_CR.po'
--- l10n_cr_hr_holidays/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_holidays/i18n/es_CR.po 2013-11-06 21:08:21 +0000
@@ -0,0 +1,37 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * l10n_cr_hr_holidays
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-09-12 18:27+0000\n"
+"PO-Revision-Date: 2013-09-12 18:27+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: l10n_cr_hr_holidays
+#: model:ir.model,name:l10n_cr_hr_holidays.model_hr_employee
+msgid "Employee"
+msgstr "Empleado"
+
+#. module: l10n_cr_hr_holidays
+#: field:hr.employee,leaves_per_period:0
+msgid "Legal Leaves per Period"
+msgstr "Permisos Legales por Periodo"
+
+#. module: l10n_cr_hr_holidays
+#: view:hr.employee:0
+msgid "days"
+msgstr "días"
+
+#. module: l10n_cr_hr_holidays
+#: help:hr.employee,leaves_per_period:0
+msgid "Total number of legal leaves to be added to this employee per period."
+msgstr "Número total de permisos legales para ser agregados a este empleado por periodo."
+
=== added file 'l10n_cr_hr_holidays/i18n/l10n_cr_hr_holidays.po'
--- l10n_cr_hr_holidays/i18n/l10n_cr_hr_holidays.po 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_holidays/i18n/l10n_cr_hr_holidays.po 2013-11-06 21:08:21 +0000
@@ -0,0 +1,37 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * l10n_cr_hr_holidays
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-09-12 18:27+0000\n"
+"PO-Revision-Date: 2013-09-12 18:27+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: l10n_cr_hr_holidays
+#: model:ir.model,name:l10n_cr_hr_holidays.model_hr_employee
+msgid "Employee"
+msgstr ""
+
+#. module: l10n_cr_hr_holidays
+#: field:hr.employee,leaves_per_period:0
+msgid "Legal Leaves per Period"
+msgstr ""
+
+#. module: l10n_cr_hr_holidays
+#: view:hr.employee:0
+msgid "days"
+msgstr ""
+
+#. module: l10n_cr_hr_holidays
+#: help:hr.employee,leaves_per_period:0
+msgid "Total number of legal leaves to be added to this employee per period."
+msgstr ""
+
=== added file 'l10n_cr_hr_holidays/l10n_cr_hr_holidays.py'
--- l10n_cr_hr_holidays/l10n_cr_hr_holidays.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_holidays/l10n_cr_hr_holidays.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,39 @@
+# -*- 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/>.
+#
+##############################################################################
+from openerp.osv import osv, fields
+
+class hr_employee(osv.Model):
+
+ def add_legal_leaves_per_period(self, cr, uid, ids=[], context={}):
+ if not ids:
+ ids = self.search(cr, uid, [], context=context)
+ employees = self.browse(cr, uid, ids, context=context)
+ for employee_obj in employees:
+ sum = employee_obj.remaining_leaves + employee_obj.leaves_per_period
+ self.write(cr, uid, employee_obj.id, {'remaining_leaves': sum}, context=context)
+
+ _inherit="hr.employee"
+
+ _columns= {
+ 'leaves_per_period': fields.float(string='Legal Leaves per Period',
+ help='Total number of legal leaves to be added to this employee per period.')
+ }
\ No newline at end of file
=== added file 'l10n_cr_hr_holidays/l10n_cr_hr_holidays_view.xml'
--- l10n_cr_hr_holidays/l10n_cr_hr_holidays_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_holidays/l10n_cr_hr_holidays_view.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<openerp>
+ <data>
+ <record id="view_l10n_cr_hr_holidays_employee_form" model="ir.ui.view">
+ <field name="name">view.l10n.cr.hr.holidays.employee.form</field>
+ <field name="model">hr.employee</field>
+ <field name="inherit_id" ref="hr.view_employee_form"/>
+ <field name="priority" eval="17"/>
+ <field name="arch" type="xml">
+ <xpath expr="//group[@string='Leaves']/div" position="after">
+ <label for="leaves_per_period"/>
+ <div>
+ <field name="leaves_per_period" class="oe_inline"/> days
+ </div>
+ </xpath>
+ </field>
+ </record>
+ </data>
+</openerp>
=== added file 'l10n_cr_hr_holidays/leaves_per_period_scheduled_task.xml'
--- l10n_cr_hr_holidays/leaves_per_period_scheduled_task.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_holidays/leaves_per_period_scheduled_task.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<openerp>
+ <data>
+ <record model="ir.cron" id="cronjob_legal_leaves_per_period">
+ <field name='name'>Add legal leaves per period</field>
+ <field name='interval_number'>1</field>
+ <field name='interval_type'>months</field>
+ <field name="numbercall">-1</field>
+ <field name="active">True</field>
+ <field name="doall" eval="True" />
+ <field name="model">hr.employee</field>
+ <field name="function">add_legal_leaves_per_period</field>
+ <field name="args">()</field>
+ </record>
+ </data>
+</openerp>
\ No newline at end of file
=== added directory 'l10n_cr_hr_ins_csv_generator'
=== added file 'l10n_cr_hr_ins_csv_generator/__init__.py'
--- l10n_cr_hr_ins_csv_generator/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_ins_csv_generator/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,24 @@
+# -*- 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 l10n_cr_hr_ins_csv_generator
+import wizard
\ No newline at end of file
=== added file 'l10n_cr_hr_ins_csv_generator/__openerp__.py'
--- l10n_cr_hr_ins_csv_generator/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_ins_csv_generator/__openerp__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,52 @@
+# -*- 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/>.
+#
+##############################################################################
+
+{
+ "name" : 'Costa Rica INS csv Generator',
+ "version" : '1.0',
+ "author" : 'CLEARCORP S.A.',
+ 'complexity': 'normal',
+ "description": """
+Module build for the generation of custom files to upload information to the INS systems
+ """,
+ "category": 'Human Resources',
+ "sequence": 4,
+ "website" : "http://clearcorp.co.cr",
+ "images" : [],
+ "icon" : False,
+ "depends" : [
+ 'hr_payroll',
+ ],
+ "data" : [
+ 'wizard/l10n_cr_hr_ins_csv_generator_wizard_view.xml',
+ 'wizard/l10n_cr_hr_ins_csv_generator_wizard_menu.xml',
+ 'view/l10n_cr_hr_ins_csv_generator_view.xml',
+ ],
+ "init_xml" : [],
+ "demo_xml" : [],
+ "update_xml" : [],
+ "test" : [],
+ "auto_install": False,
+ "application": False,
+ "installable": True,
+ 'license': 'AGPL-3',
+}
\ No newline at end of file
=== added directory 'l10n_cr_hr_ins_csv_generator/i18n'
=== added symlink 'l10n_cr_hr_ins_csv_generator/i18n/es.po'
=== target is u'es_CR.po'
=== added file 'l10n_cr_hr_ins_csv_generator/i18n/es_CR.po'
--- l10n_cr_hr_ins_csv_generator/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_ins_csv_generator/i18n/es_CR.po 2013-11-06 21:08:21 +0000
@@ -0,0 +1,213 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * ins_csv_generator
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 7.0\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-10-14 18:12+0000\n"
+"PO-Revision-Date: 2013-10-14 18:12+0000\n"
+"Last-Translator: <>\n"
+"Language-Team: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: \n"
+"Plural-Forms: \n"
+
+#. module: ins_csv_generator
+#: field:hr.employee,ins_working_day:0
+msgid "Working Day"
+msgstr "Jornada Laboral"
+
+#. module: ins_csv_generator
+#: view:hr.ins.csv.generator.generator.wizard:0
+msgid "Encoded text file:"
+msgstr "Archivo de texto codificado"
+
+#. module: ins_csv_generator
+#: field:hr.employee,ins_id_type:0
+msgid "Id Type"
+msgstr "Tipo de Indentificación"
+
+#. module: ins_csv_generator
+#: model:ir.ui.menu,name:ins_csv_generator.menu_generator
+msgid "Generate INS File"
+msgstr "Generar Archivo INS"
+
+#. module: ins_csv_generator
+#: selection:hr.employee,ins_id_type:0
+msgid "Cédula Residencia"
+msgstr "Cédula Residencia"
+
+#. module: ins_csv_generator
+#: view:hr.ins.csv.generator.generator.wizard:0
+msgid "Wizard"
+msgstr "Asistente"
+
+#. module: ins_csv_generator
+#: selection:hr.employee,ins_working_day:0
+msgid "Tiempo completo"
+msgstr "Tiempo Completo"
+
+#. module: ins_csv_generator
+#: selection:hr.employee,ins_id_type:0
+msgid "Cédula Nacional"
+msgstr "Cédula Nacional"
+
+#. module: ins_csv_generator
+#: model:ir.model,name:ins_csv_generator.model_hr_employee
+msgid "Employee"
+msgstr "Empleado"
+
+#. module: ins_csv_generator
+#: view:hr.employee:0
+msgid "Identification Information"
+msgstr "Información de Identificación"
+
+#. module: ins_csv_generator
+#: view:hr.ins.csv.generator.generator.wizard:0
+msgid "Generate csv File"
+msgstr "Generar Archivos csv"
+
+#. module: ins_csv_generator
+#: view:hr.employee:0
+msgid "Working Information"
+msgstr "Información Laboral"
+
+#. module: ins_csv_generator
+#: field:hr.employee,ins_paid_days:0
+msgid "Paid Days"
+msgstr "Días Pagados"
+
+#. module: ins_csv_generator
+#: field:hr.employee,ins_last_name1:0
+msgid "First Last Name"
+msgstr "Primer Apellido"
+
+#. module: ins_csv_generator
+#: field:hr.ins.csv.generator.generator.wizard,state:0
+msgid "State"
+msgstr "Estado"
+
+#. module: ins_csv_generator
+#: selection:hr.employee,ins_working_day:0
+msgid "Medio tiempo"
+msgstr "Medio Tiempo"
+
+#. module: ins_csv_generator
+#: selection:hr.ins.csv.generator.generator.wizard,state:0
+msgid "get"
+msgstr "Obtener"
+
+#. module: ins_csv_generator
+#: view:hr.ins.csv.generator.generator.wizard:0
+msgid "Fill the required fields"
+msgstr "Llenar los campos requeridos"
+
+#. module: ins_csv_generator
+#: view:hr.employee:0
+msgid "Others"
+msgstr "Others"
+
+#. module: ins_csv_generator
+#: field:hr.employee,ins_job_code:0
+msgid "Job Code"
+msgstr "Código de Trabajo"
+
+#. module: ins_csv_generator
+#: field:hr.employee,ins_last_name2:0
+msgid "Second Last Name"
+msgstr "Segundo Apellido"
+
+#. module: ins_csv_generator
+#: selection:hr.employee,ins_working_day:0
+msgid "Ocasional"
+msgstr "Ocasional"
+
+#. module: ins_csv_generator
+#: view:hr.ins.csv.generator.generator.wizard:0
+msgid "Are you sure you want to generate the csv file?"
+msgstr "¿Estás seguro que deseas generar el archivo csv?"
+
+#. module: ins_csv_generator
+#: field:hr.employee,ins_name:0
+#: field:hr.ins.csv.generator.generator.wizard,name:0
+msgid "Name"
+msgstr "Nombre"
+
+#. module: ins_csv_generator
+#: field:hr.employee,ins_paid_hours:0
+msgid "Paid Hours"
+msgstr "Horas Pagadas"
+
+#. module: ins_csv_generator
+#: selection:hr.employee,ins_working_day:0
+msgid "Por jornales"
+msgstr "Por Jornales"
+
+#. module: ins_csv_generator
+#: view:hr.employee:0
+msgid "Full Name Configuration"
+msgstr "Configuración de Nombre Completo"
+
+#. module: ins_csv_generator
+#: selection:hr.employee,ins_id_type:0
+msgid "Permiso Trabajo"
+msgstr "Permiso de Trabajo"
+
+#. module: ins_csv_generator
+#: selection:hr.ins.csv.generator.generator.wizard,state:0
+msgid "generate"
+msgstr "Generar"
+
+#. module: ins_csv_generator
+#: selection:hr.employee,ins_id_type:0
+msgid "Número Pasaporte"
+msgstr "Número de Pasaporte"
+
+#. module: ins_csv_generator
+#: view:hr.employee:0
+msgid "INS Information"
+msgstr "Información INS"
+
+#. module: ins_csv_generator
+#: field:hr.ins.csv.generator.generator.wizard,date_end:0
+msgid "Date End"
+msgstr "Fecha Final"
+
+#. module: ins_csv_generator
+#: model:ir.actions.act_window,name:ins_csv_generator.action_generator_wizard_create
+msgid "INS csv Generator"
+msgstr "Generador de csv INS"
+
+#. module: ins_csv_generator
+#: field:hr.employee,ins_exportable:0
+msgid "Export?"
+msgstr "Exportar?"
+
+#. module: ins_csv_generator
+#: field:hr.ins.csv.generator.generator.wizard,data:0
+msgid "File"
+msgstr "Archivo"
+
+#. module: ins_csv_generator
+#: view:hr.ins.csv.generator.generator.wizard:0
+msgid "Cancel"
+msgstr "Cancelar"
+
+#. module: ins_csv_generator
+#: selection:hr.employee,ins_id_type:0
+msgid "Sin Documentos"
+msgstr "Sin Documentos"
+
+#. module: ins_csv_generator
+#: field:hr.ins.csv.generator.generator.wizard,date_start:0
+msgid "Date Start"
+msgstr "Fecha Inicial"
+
+#. module: ins_csv_generator
+#: field:hr.ins.csv.generator.generator.wizard,salary_rule_id:0
+msgid "Salary Rule"
+msgstr "Regla de Salario"
+
=== added file 'l10n_cr_hr_ins_csv_generator/l10n_cr_hr_ins_csv_generator.py'
--- l10n_cr_hr_ins_csv_generator/l10n_cr_hr_ins_csv_generator.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_ins_csv_generator/l10n_cr_hr_ins_csv_generator.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,55 @@
+# -*- 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/>.
+#
+##############################################################################
+
+from openerp.osv import osv, fields
+
+class hrEmployee(osv.Model):
+ _inherit = 'hr.employee'
+
+ _defaults = {
+ 'ins_exportable': True,
+ 'ins_working_day': 'Tiempo completo',
+ 'ins_paid_days': 30,
+ 'ins_paid_hours': 240,
+ }
+
+ _columns = {
+ 'ins_exportable': fields.boolean('Export?'),
+ 'ins_id_type': fields.selection([
+ ('CN','Cédula Nacional'),
+ ('CR','Cédula Residencia'),
+ ('NP', 'Número Pasaporte'),
+ ('PT','Permiso Trabajo'),
+ ('SD','Sin Documentos'),
+ ], 'Id Type'),
+ 'ins_name': fields.char('Name', size=128),
+ 'ins_last_name1': fields.char('First Last Name', size=128),
+ 'ins_last_name2': fields.char('Second Last Name', size=128),
+ 'ins_working_day': fields.selection([('Tiempo completo','Tiempo completo'),
+ ('Medio tiempo','Medio tiempo'),
+ ('Ocasional','Ocasional'),
+ ('Por jornales','Por jornales'),
+ ],'Working Day'),
+ 'ins_paid_days': fields.integer('Paid Days'),
+ 'ins_paid_hours': fields.integer('Paid Hours'),
+ 'ins_job_code': fields.char('Job Code'),
+ }
\ No newline at end of file
=== added directory 'l10n_cr_hr_ins_csv_generator/tools'
=== added file 'l10n_cr_hr_ins_csv_generator/tools/__init__.py'
--- l10n_cr_hr_ins_csv_generator/tools/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_ins_csv_generator/tools/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 custom_encoder
\ No newline at end of file
=== added file 'l10n_cr_hr_ins_csv_generator/tools/custom_encoder.py'
--- l10n_cr_hr_ins_csv_generator/tools/custom_encoder.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_ins_csv_generator/tools/custom_encoder.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,87 @@
+# -*- 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 base64
+import cStringIO
+import csv
+
+import openerp.pooler as pooler
+
+def encodeInsCsv(cr, uid, date_start, date_end, code, context=None):
+ def _information_export(buffer, cr, uid, code, context):
+ def _get_user_wage(cr, uid, pool, date_start, date_end, code, id, context):
+ payslip_obj = pool.get('hr.payslip')
+ payslip_ids = payslip_obj.search(cr, uid, [('employee_id','=',id),('date_to','>=',date_start),('date_to','<=',date_end)], context=context)
+ payslips = payslip_obj.browse(cr, uid, payslip_ids, context=context)
+ wage_sum = 0
+ for payslip in payslips:
+ for line in payslip.line_ids:
+ if line.salary_rule_id.code == code:
+ wage_sum+= line.total
+ return int(wage_sum)
+
+ def _encode(s):
+ if isinstance(s, unicode):
+ return s.encode('utf8')
+ else:
+ if isinstance(s,bool):
+ return ""
+ return str(s)
+
+ def _process(employees, buffer):
+ writer = csv.writer(buffer, 'excel', delimiter=';')
+ # write header first
+ writer.writerow(("TI","NA","N° Cedula","N° Asegurado","Nombre",
+ "Apellido1","Apellido2","Tipo Jornada","Dias",
+ "Horas","Salario","Observaciones","Ocupacion"))
+ for tuple in employees:
+ employee = tuple[0]
+ writer.writerow((_encode(employee.ins_id_type),
+ _encode(employee.country_id.code),
+ _encode(employee.identification_id),
+ _encode(employee.sinid),
+ _encode(employee.ins_name),
+ _encode(employee.ins_last_name1),
+ _encode(employee.ins_last_name2),
+ _encode(employee.ins_working_day),
+ _encode(employee.ins_paid_days),
+ _encode(employee.ins_paid_hours),
+ _encode(tuple[1]),
+ "",#Observations are not added automatically
+ _encode(employee.ins_job_code)))
+
+ dbname = cr.dbname
+ pool = pooler.get_pool(dbname)
+ employee_obj = pool.get('hr.employee')
+ employee_ids = employee_obj.search(cr, uid, [('ins_exportable','=',True)], context=context)
+ employees = employee_obj.browse(cr, uid, employee_ids, context=context)
+ tmp_employees = []
+ for employee in employees:
+ ins_wage = _get_user_wage(cr,uid,pool,date_start,date_end,code,employee.id,context)
+ tmp_employees.append((employee,ins_wage))
+ _process(tmp_employees, buffer)
+
+ buffer = cStringIO.StringIO()
+ _information_export(buffer,cr,uid,code,context)
+ out = base64.encodestring(buffer.getvalue())
+ buffer.close()
+ return out
\ No newline at end of file
=== added directory 'l10n_cr_hr_ins_csv_generator/view'
=== added file 'l10n_cr_hr_ins_csv_generator/view/l10n_cr_hr_ins_csv_generator_view.xml'
--- l10n_cr_hr_ins_csv_generator/view/l10n_cr_hr_ins_csv_generator_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_ins_csv_generator/view/l10n_cr_hr_ins_csv_generator_view.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<openerp>
+ <data>
+ <!-- Views -->
+ <record model="ir.ui.view" id ="ins_csv_generator_employee_form_view">
+ <field name="name">ins.csv.generator.employee.form.view</field>
+ <field name="model">hr.employee</field>
+ <field name="priority" eval="16"/>
+ <field name="inherit_id" ref="hr.view_employee_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="//page[@string='HR Settings']" position="after">
+ <page string="INS Information">
+ <group name="ins_information_group" colspan="4" col="2">
+ <group colspan="1" col="2">
+ <separator string="Identification Information" colspan="2"/>
+ <field name="ins_id_type"/>
+ <field name="sinid"/>
+ </group>
+ <group colspan="1" col="2">
+ <separator string="Full Name Configuration" colspan="2"/>
+ <field name="ins_name"/>
+ <field name="ins_last_name1"/>
+ <field name="ins_last_name2"/>
+ </group>
+ <group colspan="1" col="2">
+ <separator string="Working Information" colspan="2"/>
+ <field name="ins_working_day"/>
+ <field name="ins_paid_days"/>
+ <field name="ins_paid_hours"/>
+ <field name="ins_job_code"/>
+ </group>
+ <group colspan="1" col="2">
+ <separator string="Others" colspan="2"/>
+ <field name="ins_exportable"/>
+ </group>
+ </group>
+ </page>
+ </xpath>
+ </field>
+ </record>
+ </data>
+</openerp>
\ No newline at end of file
=== added directory 'l10n_cr_hr_ins_csv_generator/wizard'
=== added file 'l10n_cr_hr_ins_csv_generator/wizard/__init__.py'
--- l10n_cr_hr_ins_csv_generator/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_ins_csv_generator/wizard/__init__.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,23 @@
+# -*- 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 l10n_cr_hr_ins_csv_generator_wizard
\ No newline at end of file
=== added file 'l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard.py'
--- l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard.py 2013-11-06 21:08:21 +0000
@@ -0,0 +1,65 @@
+# -*- 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 base64
+import cStringIO
+
+from openerp.osv import osv, fields
+from ..tools import custom_encoder
+
+class generatorWizardCreate(osv.TransientModel):
+
+ _name = "hr.ins.csv.generator.generator.wizard"
+
+ _columns = {
+ 'name': fields.char('Name', size=128),
+ 'salary_rule_id':fields.many2one('hr.salary.rule','Salary Rule', required=True),
+ 'date_start': fields.date('Date Start', required=True),
+ 'date_end': fields.date('Date End', required=True),
+ 'data': fields.binary('File', readonly=True),
+ 'state': fields.selection([('generate','generate'), # generate file
+ ('get','get')], string="State"), # get the file
+ }
+
+ _defaults = {
+ 'state': 'generate',
+ }
+
+ def generate_csv(self, cr, uid, ids, context=None):
+ this = self.browse(cr, uid, ids)[0]
+ this.name = 'ins_generated_file.csv'
+ out = custom_encoder.encodeInsCsv(cr, uid, this.date_start,this.date_end,
+ this.salary_rule_id.code, context)
+ self.write(cr, uid, ids, {
+ 'state': 'get',
+ 'data': out,
+ 'name':this.name}, context=context)
+ return {
+ 'type': 'ir.actions.act_window',
+ 'res_model': 'hr.ins.csv.generator.generator.wizard',
+ 'view_mode': 'form',
+ 'view_type': 'form',
+ 'res_id': this.id,
+ 'views': [(False, 'form')],
+ 'target': 'new',
+ }
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
=== added file 'l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_menu.xml'
--- l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_menu.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_menu.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<openerp>
+ <data>
+ <menuitem id="menu_generator"
+ parent="hr.menu_hr_main"
+ name="Generate INS File"
+ sequence="100"
+ action="action_generator_wizard_create"/>
+ </data>
+</openerp>
\ No newline at end of file
=== added file 'l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_view.xml'
--- l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_hr_ins_csv_generator/wizard/l10n_cr_hr_ins_csv_generator_wizard_view.xml 2013-11-06 21:08:21 +0000
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<openerp>
+ <data>
+ <!-- Views -->
+ <record model="ir.ui.view" id ="ins_csv_generator_generator_wizard_create_form">
+ <field name="name">ins.csv.generator.generator.wizard.create.form</field>
+ <field name="model">hr.ins.csv.generator.generator.wizard</field>
+ <field name="priority" eval="16"/>
+ <field name="arch" type="xml">
+ <form string="Wizard" version="7.0">
+ <sheet>
+ <field invisible="1" name="state"/>
+ <group states="get">
+ <p>Encoded text file: <field name="data" readonly="1" filename="name"/></p>
+ </group>
+ <group states="generate" colspan="4" col="2">
+ <separator string="Fill the required fields" colspan="2"/>
+ <field name="salary_rule_id"/>
+ <field name="date_start"/>
+ <field name="date_end"/>
+ </group>
+ </sheet>
+ <footer states="generate">
+ <button type="object" name="generate_csv" string="Generate csv File" icon="gtk-ok"
+ confirm="Are you sure you want to generate the csv file?" class="oe_highlight" />
+ <button type="special" special="cancel" string="Cancel" class="oe_link" />
+ </footer>
+ </form>
+ </field>
+ </record>
+
+ <!-- Actions -->
+ <act_window id="action_generator_wizard_create"
+ name="INS csv Generator"
+ res_model="hr.ins.csv.generator.generator.wizard"
+ view_mode="form"
+ target="new"
+ />
+ </data>
+</openerp>
\ No newline at end of file
=== modified file 'l10n_cr_hr_payroll/__init__.py'
--- l10n_cr_hr_payroll/__init__.py 2012-09-01 00:22:31 +0000
+++ l10n_cr_hr_payroll/__init__.py 2013-11-06 21:08:21 +0000
@@ -22,8 +22,8 @@
import hr_payroll
import account
-from . import wizard
-from . import report
-from . import l10n_cr_hr_payroll
+import wizard
+import report
+import l10n_cr_hr_payroll
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'l10n_cr_hr_payroll/__openerp__.py'
--- l10n_cr_hr_payroll/__openerp__.py 2012-09-01 00:22:31 +0000
+++ l10n_cr_hr_payroll/__openerp__.py 2013-11-06 21:08:21 +0000
@@ -31,24 +31,22 @@
* Employee Contracts
* Fortnightly Payroll Register
* Payroll Report
+ * Report Employee by Periods
""",
'author': 'CLEARCORP S.A.',
'website': 'http://www.clearcorp.co.cr',
'depends': [
- 'hr',
- 'hr_contract',
- 'hr_payroll',
'account',
- 'account_financial_report_webkit',
- 'account_voucher_payment_method',
- 'base_currency_symbol',
+ 'report_webkit_lib',
+ 'hr_payroll_account',
],
- 'update_xml': [
+ 'data': [
+ 'security/ir.model.access.csv',
'l10n_cr_hr_payroll_view.xml',
'report/report.xml',
'wizard/payroll_report_for_month_wizard_view.xml',
+ 'wizard/report_employee_by_periods_wizard_view.xml',
'report_menus.xml',
- 'payroll_report.xml',
],
'installable': True,
'auto_install': False,
=== modified file 'l10n_cr_hr_payroll/i18n/es_CR.po'
--- l10n_cr_hr_payroll/i18n/es_CR.po 2013-06-03 21:26:11 +0000
+++ l10n_cr_hr_payroll/i18n/es_CR.po 2013-11-06 21:08:21 +0000
@@ -4,10 +4,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: OpenERP Server 6.1\n"
+"Project-Id-Version: OpenERP Server 7.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-10-23 17:52+0000\n"
-"PO-Revision-Date: 2012-10-23 17:52+0000\n"
+"POT-Creation-Date: 2013-08-26 23:30+0000\n"
+"PO-Revision-Date: 2013-08-26 23:30+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -16,15 +16,16 @@
"Plural-Forms: \n"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:75
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:85
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:60
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:62
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:45
msgid "Gross"
msgstr "Bruto"
#. module: l10n_cr_hr_payroll
-#: field:payroll.report.for.month,account_ids:0
-msgid "Filter on accounts"
-msgstr "Filtro en cuentas"
+#: selection:hr.payslip.run,schedule_pay:0
+msgid "Bi-monthly"
+msgstr "Bi-semanal"
#. module: l10n_cr_hr_payroll
#: selection:hr.payslip.run,schedule_pay:0
@@ -32,14 +33,16 @@
msgstr "Mensual"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:77
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:87
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:62
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:64
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:47
msgid "Tax"
msgstr "Impuesto"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:77
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:87
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:62
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:64
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:47
msgid "Rent"
msgstr "Renta"
@@ -49,33 +52,30 @@
msgstr "Forzar periodo"
#. module: l10n_cr_hr_payroll
-#: view:payroll.report.for.month:0
-msgid "This report allows you to print or generate a pdf of your payslip in a special month"
-msgstr "Este informe le permite imprimir o generar un pdf de su recibo de sueldo en un mes especial"
+#: view:report.employee.by.periods:0
+msgid "Report employee by periods"
+msgstr "Informe de empleado por períodos"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:43
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:20
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:20
msgid "Payslips of periods:"
msgstr "Nóminas del periodo:"
#. module: l10n_cr_hr_payroll
-#: view:hr.payslip.run:0
-msgid "Generate Payslips"
-msgstr "Generar nómina"
-
-#. module: l10n_cr_hr_payroll
#: model:ir.model,name:l10n_cr_hr_payroll.model_hr_job
msgid "Job Description"
msgstr "Descripción del trabajo"
#. module: l10n_cr_hr_payroll
-#: help:payroll.report.for.month,account_ids:0
-msgid "Only selected accounts will be printed. Leave empty to print all accounts."
-msgstr "Sólo las cuentas seleccionadas se imprimirán. Dejar en blanco para imprimir todas las cuentas."
+#: selection:hr.payslip.run,schedule_pay:0
+msgid "Quarterly"
+msgstr "Trimestral"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:78
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:88
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:63
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:65
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:48
msgid "Net"
msgstr "Neto"
@@ -85,83 +85,84 @@
msgstr "Confirmar Nóminas"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:178
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:186
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:159
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:164
msgid "REVIEWED BY:"
msgstr "REVISADO POR:"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:43
+#: selection:hr.payslip.run,schedule_pay:0
+msgid "Semi-annually"
+msgstr "Semestral"
+
+#. module: l10n_cr_hr_payroll
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:20
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:20
msgid "to"
msgstr "al"
#. module: l10n_cr_hr_payroll
-#: code:addons/l10n_cr_hr_payroll/l10n_cr_hr_payroll.py:122
+#: code:addons/l10n_cr_hr_payroll/l10n_cr_hr_payroll.py:137
#, python-format
msgid "weekly"
msgstr "semanal"
#. module: l10n_cr_hr_payroll
-#: code:addons/l10n_cr_hr_payroll/l10n_cr_hr_payroll.py:132
+#: code:addons/l10n_cr_hr_payroll/l10n_cr_hr_payroll.py:147
#, python-format
msgid "%s payroll of %s from %s to %s"
msgstr "planilla %s de %s del %s al %s"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:42
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:19
msgid "Payroll Report for Specific Periods"
msgstr "Informe de nómina para periodos específicas"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:177
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:185
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:158
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:163
msgid "BY:"
msgstr "HECHO POR:"
#. module: l10n_cr_hr_payroll
-#: constraint:payroll.report.for.month:0
-msgid "When no Fiscal year is selected, you must choose to filter by periods or by date."
-msgstr "Cuando no se ha seleccionado el año fiscal, se debe optar por filtrar por puntos o por fecha."
-
-#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:73
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:83
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:58
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:60
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:43
msgid "Normal"
msgstr "Normal"
#. module: l10n_cr_hr_payroll
-#: code:addons/l10n_cr_hr_payroll/l10n_cr_hr_payroll.py:124
+#: code:addons/l10n_cr_hr_payroll/l10n_cr_hr_payroll.py:139
#, python-format
msgid "monthly"
msgstr "mensual"
#. module: l10n_cr_hr_payroll
+#: view:payroll.report.for.month:0
#: field:payroll.report.for.month,company_id:0
+#: view:report.employee.by.periods:0
+#: field:report.employee.by.periods,company_id:0
msgid "Company"
msgstr "Compañía"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:70
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:80
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:55
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:57
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:40
msgid "Bank account"
msgstr "Cuenta bancaria"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:68
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:78
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:53
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:55
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:38
msgid "Id card"
msgstr "Cédula"
#. module: l10n_cr_hr_payroll
-#: selection:payroll.report.for.month,display_account:0
-msgid "With balance is not equal to 0"
-msgstr "Con el balance no es igual a 0"
-
-#. module: l10n_cr_hr_payroll
#: model:ir.actions.report.xml,name:l10n_cr_hr_payroll.payroll_report_for_month
#: model:ir.model,name:l10n_cr_hr_payroll.model_payroll_report_for_month
#: model:ir.ui.menu,name:l10n_cr_hr_payroll.menu_payroll_report_for_month
-#: view:payroll.report.for.month:0
msgid "Payroll Report for Month"
msgstr "Informe de Nómina para el mes"
@@ -171,95 +172,73 @@
msgstr "Lotes de Nóminas"
#. module: l10n_cr_hr_payroll
-#: selection:payroll.report.for.month,comp0_filter:0
-#: selection:payroll.report.for.month,comp1_filter:0
-#: selection:payroll.report.for.month,comp2_filter:0
-#: selection:payroll.report.for.month,filter:0
-msgid "Date"
-msgstr "Fecha"
-
-#. module: l10n_cr_hr_payroll
#: view:hr.payslip.run:0
msgid "Schedule pay"
msgstr "Plan de pago"
#. module: l10n_cr_hr_payroll
-#: field:payroll.report.for.month,chart_account_id:0
-msgid "Chart of Account"
-msgstr "Gráfico de la Cuenta"
+#: view:payroll.report.for.month:0
+#: view:report.employee.by.periods:0
+msgid "Validate"
+msgstr "Validar"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:159
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:168
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:142
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:145
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:101
msgid "TOTAL"
msgstr "TOTAL GENERAL"
#. module: l10n_cr_hr_payroll
-#: field:payroll.report.for.month,journal_ids:0
-msgid "Journals"
-msgstr "Diarios"
-
-#. module: l10n_cr_hr_payroll
-#: field:payroll.report.for.month,target_move:0
-msgid "Target Moves"
-msgstr "Target Moves"
-
-#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:71
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:81
+#: model:ir.model,name:l10n_cr_hr_payroll.model_hr_payslip
+msgid "Pay Slip"
+msgstr "Nómina"
+
+#. module: l10n_cr_hr_payroll
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:56
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:58
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:41
msgid "Nor"
msgstr "Nor"
#. module: l10n_cr_hr_payroll
-#: selection:payroll.report.for.month,comp0_filter:0
-#: selection:payroll.report.for.month,comp1_filter:0
-#: selection:payroll.report.for.month,comp2_filter:0
-#: selection:payroll.report.for.month,filter:0
+#: view:payroll.report.for.month:0
+#: view:report.employee.by.periods:0
msgid "Periods"
-msgstr "Periodos"
-
-#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:75
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:78
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:85
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:88
-msgid "Salary"
-msgstr "Salario"
-
-#. module: l10n_cr_hr_payroll
-#: field:payroll.report.for.month,comp0_date_to:0
-#: field:payroll.report.for.month,comp1_date_to:0
-#: field:payroll.report.for.month,comp2_date_to:0
-#: field:payroll.report.for.month,date_to:0
-msgid "End Date"
-msgstr "Fecha de fin"
-
-#. module: l10n_cr_hr_payroll
-#: view:payroll.report.for.month:0
-msgid "Dates"
-msgstr "Fechas"
-
-#. module: l10n_cr_hr_payroll
-#: field:payroll.report.for.month,comp0_period_from:0
-#: field:payroll.report.for.month,comp1_period_from:0
-#: field:payroll.report.for.month,comp2_period_from:0
+msgstr "Períodos"
+
+#. module: l10n_cr_hr_payroll
+#: model:ir.actions.act_window,name:l10n_cr_hr_payroll.action_report_employee_by_periods_menu
+msgid "Action Report Employee by Periods"
+msgstr "Acción Informe de Empleado por períodos"
+
+#. module: l10n_cr_hr_payroll
+#: selection:hr.payslip.run,schedule_pay:0
+msgid "Fortnightly"
+msgstr "Quincenal"
+
+#. module: l10n_cr_hr_payroll
#: field:payroll.report.for.month,period_from:0
+#: field:report.employee.by.periods,period_from:0
msgid "Start Period"
msgstr "Periodo de inicio"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:69
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:79
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:54
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:56
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:39
msgid "Name"
msgstr "Nombre"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:76
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:86
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:61
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:63
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:46
msgid "CCSS/BP"
msgstr "CCSS/BP"
#. module: l10n_cr_hr_payroll
+<<<<<<< TREE
#: code:addons/l10n_cr_hr_payroll/l10n_cr_hr_payroll.py:91
#, python-format
msgid "You did not confirm some of the payroll"
@@ -280,6 +259,24 @@
#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:160
#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:151
#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:169
+=======
+#: code:addons/l10n_cr_hr_payroll/l10n_cr_hr_payroll.py:90
+#, python-format
+msgid "You did not confirm some of the payroll"
+msgstr "Usted no confirmó algunas de las nóminas"
+
+#. module: l10n_cr_hr_payroll
+#: view:payroll.report.for.month:0
+msgid "Payroll report for month"
+msgstr "Informe de nómina para el mes"
+
+#. module: l10n_cr_hr_payroll
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:125
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:143
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:128
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:146
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:102
+>>>>>>> MERGE-SOURCE
msgid "Employees"
msgstr "Empleados"
@@ -289,10 +286,12 @@
msgstr "Frecuencia de pago"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:71
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:72
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:81
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:82
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:56
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:57
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:58
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:59
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:41
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:42
msgid "Hrs."
msgstr "Hrs."
@@ -302,93 +301,52 @@
msgstr "Contrato"
#. module: l10n_cr_hr_payroll
-#: field:payroll.report.for.month,comp0_period_to:0
-#: field:payroll.report.for.month,comp1_period_to:0
-#: field:payroll.report.for.month,comp2_period_to:0
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:19
+#: model:ir.actions.report.xml,name:l10n_cr_hr_payroll.report_employee_by_periods
+#: model:ir.model,name:l10n_cr_hr_payroll.model_report_employee_by_periods
+#: model:ir.ui.menu,name:l10n_cr_hr_payroll.menu_report_employee_by_periods
+msgid "Report Employee by Periods"
+msgstr "Informe de Empleado por períodos"
+
+#. module: l10n_cr_hr_payroll
#: field:payroll.report.for.month,period_to:0
+#: field:report.employee.by.periods,period_to:0
msgid "End Period"
msgstr "Periodo de fin"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:45
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:30
#: model:ir.actions.report.xml,name:l10n_cr_hr_payroll.hr_payslip_run_ccorp
msgid "Payroll Report"
msgstr "Reporte de planilla"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:72
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:82
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:57
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:59
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:42
msgid "Ext"
msgstr "Ext"
#. module: l10n_cr_hr_payroll
-#: help:payroll.report.for.month,filter:0
-msgid "Filter by date : no opening balance will be displayed. (opening balance can only be calculated based on period to be correct)."
-msgstr "Filtrar por fecha: el saldo inicial no se mostrará. (balance de apertura sólo se puede calcular basándose en el período que es correcto)."
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:60
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:63
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:62
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:65
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:45
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:48
+msgid "Salary"
+msgstr "Salario"
+
+#. module: l10n_cr_hr_payroll
+#: code:addons/l10n_cr_hr_payroll/l10n_cr_hr_payroll.py:90
+#, python-format
+msgid "Warning !"
+msgstr "Advertencia !"
#. module: l10n_cr_hr_payroll
#: selection:hr.payslip.run,schedule_pay:0
-msgid "Weekly"
-msgstr "Semanal"
-
-#. module: l10n_cr_hr_payroll
-#: help:payroll.report.for.month,fiscalyear_id:0
-msgid "Keep empty for all open fiscal year"
-msgstr "Mantenga vacío para todo el año fiscal abierto"
-
-#. module: l10n_cr_hr_payroll
-#: field:payroll.report.for.month,display_account:0
-msgid "Display Accounts"
-msgstr "Mostrar cuentas"
-
-#. module: l10n_cr_hr_payroll
-#: selection:payroll.report.for.month,comp0_filter:0
-#: selection:payroll.report.for.month,comp1_filter:0
-#: selection:payroll.report.for.month,comp2_filter:0
-msgid "No Comparison"
-msgstr "No comparar"
-
-#. module: l10n_cr_hr_payroll
-#: selection:payroll.report.for.month,comp0_filter:0
-#: selection:payroll.report.for.month,comp1_filter:0
-#: selection:payroll.report.for.month,comp2_filter:0
-#: selection:payroll.report.for.month,filter:0
-msgid "Opening Only"
-msgstr "Solo apertura"
-
-#. module: l10n_cr_hr_payroll
-#: field:payroll.report.for.month,comp0_date_from:0
-#: field:payroll.report.for.month,comp1_date_from:0
-#: field:payroll.report.for.month,comp2_date_from:0
-#: field:payroll.report.for.month,date_from:0
-msgid "Start Date"
-msgstr "Fecha Inicial"
-
-#. module: l10n_cr_hr_payroll
-#: constraint:hr.contract:0
-msgid "Error! contract start-date must be lower then contract end-date."
-msgstr "¡Error! La fecha de inicio de contrato debe ser menor que la fecha de finalización."
-
-#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:139
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:150
-msgid "Total"
-msgstr "Total"
-
-#. module: l10n_cr_hr_payroll
-#: selection:payroll.report.for.month,display_account:0
-msgid "With movements"
-msgstr "Con movimientos"
-
-#. module: l10n_cr_hr_payroll
-#: constraint:payroll.report.for.month:0
-msgid "The fiscalyear, periods or chart of account chosen have to belong to the same company."
-msgstr "El año fiscal, períodos o plan de cuentas elegido tiene que pertenecer a la misma compañía."
-
-#. module: l10n_cr_hr_payroll
-#: selection:payroll.report.for.month,display_account:0
-msgid "All"
-msgstr "Todo"
+msgid "Annually"
+msgstr "Anualmente"
#. module: l10n_cr_hr_payroll
#: field:hr.job,code:0
@@ -396,54 +354,41 @@
msgstr "Código"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:73
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:74
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:83
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:84
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:58
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:59
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:60
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:61
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:43
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:44
msgid "Ingr."
msgstr "Ingr."
#. module: l10n_cr_hr_payroll
-#: sql_constraint:hr.job:0
-msgid "The name of the job position must be unique per company!"
-msgstr "¡El nombre del puesto de trabajo debe ser único por compañía!"
+#: selection:hr.payslip.run,schedule_pay:0
+msgid "Weekly"
+msgstr "Semanal"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:74
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:84
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:59
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:61
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:44
msgid "Extra"
msgstr "Extra"
#. module: l10n_cr_hr_payroll
-#: model:ir.model,name:l10n_cr_hr_payroll.model_hr_payslip
-msgid "Pay Slip"
-msgstr "Nómina"
-
-#. module: l10n_cr_hr_payroll
#: field:hr.payslip.run,period_id:0
msgid "Force Period"
msgstr "Forzar período"
#. module: l10n_cr_hr_payroll
-#: selection:payroll.report.for.month,comp0_filter:0
-#: field:payroll.report.for.month,comp0_fiscalyear_id:0
-#: selection:payroll.report.for.month,comp1_filter:0
-#: field:payroll.report.for.month,comp1_fiscalyear_id:0
-#: selection:payroll.report.for.month,comp2_filter:0
-#: field:payroll.report.for.month,comp2_fiscalyear_id:0
-#: field:payroll.report.for.month,fiscalyear_id:0
-msgid "Fiscal Year"
-msgstr "Año fiscal"
-
-#. module: l10n_cr_hr_payroll
-#: selection:payroll.report.for.month,target_move:0
-msgid "All Entries"
-msgstr "Todas las entradas"
-
-#. module: l10n_cr_hr_payroll
-#: selection:payroll.report.for.month,filter:0
-msgid "No Filters"
-msgstr "Sin filtros"
+#: view:hr.payslip.run:0
+msgid "Generate Payslips"
+msgstr "Generar nómina"
+
+#. module: l10n_cr_hr_payroll
+#: selection:hr.payslip.run,schedule_pay:0
+msgid "Bi-weekly"
+msgstr "Bi-semanal"
#. module: l10n_cr_hr_payroll
#: model:ir.actions.act_window,name:l10n_cr_hr_payroll.action_payroll_report_for_month_menu_webkit
@@ -451,31 +396,32 @@
msgstr "Acción de informe de nómina para el mes"
#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:179
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:187
+#: view:payroll.report.for.month:0
+#: view:report.employee.by.periods:0
+msgid "Cancel"
+msgstr "Cancelar"
+
+#. module: l10n_cr_hr_payroll
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:160
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:165
msgid "APPROVED BY:"
msgstr "APROBADO POR:"
#. module: l10n_cr_hr_payroll
-#: help:payroll.report.for.month,chart_account_id:0
-msgid "Select Charts of Accounts"
-msgstr "Seleccione Gráficos de Cuentas"
-
-#. module: l10n_cr_hr_payroll
-#: field:payroll.report.for.month,filter:0
-msgid "Filter by"
-msgstr "Filtrar por"
-
-#. module: l10n_cr_hr_payroll
-#: field:payroll.report.for.month,comp0_filter:0
-#: field:payroll.report.for.month,comp1_filter:0
-#: field:payroll.report.for.month,comp2_filter:0
-msgid "Compare By"
-msgstr "Comparar por"
-
-#. module: l10n_cr_hr_payroll
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:76
-#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:86
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:124
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:127
+msgid "Total"
+msgstr "Total"
+
+#. module: l10n_cr_hr_payroll
+#: view:payroll.report.for.month:0
+#: view:report.employee.by.periods:0
+msgid "or"
+msgstr "o"
+
+#. module: l10n_cr_hr_payroll
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report.mako:61
+#: report:addons/l10n_cr_hr_payroll/report/payroll_report_for_month.mako:63
+#: report:addons/l10n_cr_hr_payroll/report/report_employee_by_periods.mako:46
msgid "Deducc."
msgstr "Deducc."
-
=== modified file 'l10n_cr_hr_payroll/l10n_cr_hr_payroll.py'
--- l10n_cr_hr_payroll/l10n_cr_hr_payroll.py 2013-06-03 21:26:11 +0000
+++ l10n_cr_hr_payroll/l10n_cr_hr_payroll.py 2013-11-06 21:08:21 +0000
@@ -93,6 +93,7 @@
return result
def confirm_payslips(self, cr, uid, ids, context=None):
+<<<<<<< TREE
payslip_obj = self.pool.get('hr.payslip')
for batches in self.browse(cr, uid, ids, context=context):
payslip_ids = map(lambda x: x.id, batches.slip_ids)
@@ -101,6 +102,16 @@
payslip_obj.process_sheet(cr, uid, [payslip.id], context=context)
return True
+=======
+ payslip_obj = self.pool.get('hr.payslip')
+ for batches in self.browse(cr, uid, ids, context=context):
+ payslip_ids = map(lambda x: x.id, batches.slip_ids)
+ for payslip in payslip_obj.browse(cr, uid, payslip_ids):
+ if payslip.state == 'draft':
+ payslip_obj.process_sheet(cr, uid, [payslip.id], context=context)
+ return True
+
+>>>>>>> MERGE-SOURCE
hr_payslip_run()
class HrPayslip(osv.osv):
@@ -113,6 +124,7 @@
def onchange_employee_id(self, cr, uid, ids, date_from, date_to, employee_id=False, contract_id=False, context=None):
res = super(HrPayslip, self).onchange_employee_id(cr, uid, ids, date_from, date_to, employee_id=employee_id, contract_id=contract_id, context=context)
+ contract = []
if (not employee_id) or (not date_from) or (not date_to):
return res
@@ -127,9 +139,11 @@
else:
contract_id = [contract_id]
- contract = contract_obj.browse(cr, uid, contract_id, context=context)[0]
+ contracts = contract_obj.browse(cr, uid, contract_id, context=context)
+ if len(contracts) > 0 and len(contracts) >= 2:
+ contract = contracts[0]
schedule_pay = ''
- if contract.schedule_pay:
+ if contract and contract.schedule_pay:
#This is to translate the terms
if contract.schedule_pay == 'weekly':
schedule_pay = _('weekly')
=== modified file 'l10n_cr_hr_payroll/l10n_cr_hr_payroll_view.xml'
--- l10n_cr_hr_payroll/l10n_cr_hr_payroll_view.xml 2012-10-23 16:16:01 +0000
+++ l10n_cr_hr_payroll/l10n_cr_hr_payroll_view.xml 2013-11-06 21:08:21 +0000
@@ -9,7 +9,7 @@
<field name