clearcorp team mailing list archive
-
clearcorp team
-
Mailing list archive
-
Message #00861
[Merge] lp:openerp-costa-rica/6.1 into lp:openerp-costa-rica
moazar has proposed merging lp:openerp-costa-rica/6.1 into lp:openerp-costa-rica.
Requested reviews:
CLEARCORP drivers (clearcorp-drivers)
For more details, see:
https://code.launchpad.net/~clearcorp-drivers/openerp-costa-rica/6.1/+merge/180982
--
https://code.launchpad.net/~clearcorp-drivers/openerp-costa-rica/6.1/+merge/180982
Your team CLEARCORP development team is subscribed to branch lp:openerp-costa-rica/6.1.
=== modified file 'TODO-7.0/l10n_cr_account_banking_cr_bac/__openerp__.py'
--- TODO-7.0/l10n_cr_account_banking_cr_bac/__openerp__.py 2012-07-12 00:37:04 +0000
+++ TODO-7.0/l10n_cr_account_banking_cr_bac/__openerp__.py 2013-08-20 07:28:14 +0000
@@ -27,7 +27,7 @@
'author': 'CLEARCORP S.A.',
'website': 'http://www.clearcorp.co.cr',
'category': 'Account Banking',
- 'depends': ['account_banking'],
+ 'depends': ['account_banking','account_parser_type',],
'init_xml': [],
'update_xml': [
],
=== modified file 'TODO-7.0/l10n_cr_account_banking_cr_bac/bac_mt940.py'
--- TODO-7.0/l10n_cr_account_banking_cr_bac/bac_mt940.py 2013-02-22 22:35:48 +0000
+++ TODO-7.0/l10n_cr_account_banking_cr_bac/bac_mt940.py 2013-08-20 07:28:14 +0000
@@ -22,12 +22,13 @@
#
from account_banking.parsers import models
-from tools.translate import _
from mt940_parser import BACParser
import re
-import osv
+from osv import osv, fields
import logging
import datetime
+from tools.translate import _
+import base64
bt = models.mem_bank_transaction
logger = logging.getLogger('bac_mt940')
@@ -155,8 +156,8 @@
This format is available through
the BAC web interface.
''')
-
- def parse(self, cr, data,**kwargs):
+
+ def parse(self, cr, statements_file,**kwargs):
'''
** Kwargs parameter is used for a dynamic list of parameters.
The wizard imported extracts used in all parsers and not all parsers have all the necessary information in your file,
@@ -171,91 +172,112 @@
list_record = []
inversion_colocada = 0
+ """
+ **kwargs have all the parameters that have the wizard and
+ has all the parameters passed from the wizard before calling
+ the method that parses the file.
+ """
+ #pass to encoding with the correct type of file.
+ data = base64.decodestring(statements_file)
+
# Split into statements
statements = [st for st in re.split('[\r\n]*(?=:20:)', data)]
# Split by records
statement_list = [re.split('[\r\n ]*(?=:\d\d[\w]?:)', st) for st in statements]
-
- for statement_lines in statement_list:
- stmnt = statement()
-
- """EXTRACCION DE DATOS """
- for record in statement_lines:
- records = parser.parse_record(record)
-
- if records is not None:
- ############START PAGO CAPITAL INVERSION
- if records['recordid'] == '60F':
- start_balance = float(records['startingbalance'])
- if records['recordid'] == '61':
- amount = float(records['amount'])
- if records['recordid'] == '86' and records['infoline1'] == 'PAGO CAPITAL INVERSION':
- start_amount = amount
- start_balance += amount #con la suma ya realizada.
- ############END PAGO CAPITAL INVERSION
-
- ############START INVERSION COLOCADA
- if records['recordid'] == '86':
- cad = records['infoline1']
- if cad.find('INVERSION COLOCADA') > 0:
- inversion_colocada = amount
-
- if records['recordid'] == '62F':
- ending_balance = (inversion_colocada + float(records['endingbalance']))
-
- if records is not None:
- """ACTUALIZACION DE DATOS """
- for record in statement_lines:
- if record is not None:
- records = parser.parse_record(record)
+
+ '''
+ In the first position of the statement_list is the account number.
+ If the account number that pass in the **kwargs dictionary.
+ '''
+ account_number_wizard = kwargs['account_number']
+ #statement_list is a list, extract the first position
+ accnum = statement_list[1][1]
+
+ #find the number in the account string.
+ if accnum.find(account_number_wizard) > -1:
+ for statement_lines in statement_list:
+ stmnt = statement()
- if (records['recordid'] == '60F'):
- dic = {'startingbalance':start_balance}
- records.update(dic)
+ """EXTRACCION DE DATOS """
+ for record in statement_lines:
+ records = parser.parse_record(record,**kwargs)
+
+ if records is not None:
+ ############START PAGO CAPITAL INVERSION
+ if records['recordid'] == '60F':
+ start_balance = float(records['startingbalance'])
+ if records['recordid'] == '61':
+ amount = float(records['amount'])
+ if records['recordid'] == '86' and records['infoline1'] == 'PAGO CAPITAL INVERSION':
+ start_amount = amount
+ start_balance += amount #con la suma ya realizada.
+ ############END PAGO CAPITAL INVERSION
- if (records['recordid'] == '62F'):
- dic = {'endingbalance': ending_balance}
- records.update(dic)
-
- if (records['recordid'] == '64'):
- dic = {'endingbalance': ending_balance}
- records.update(dic)
-
- #SI LA LINEA NO ES INVERSION COLOCADA O PAGO CAPITAL INVERSION, SE AGREGA A LA LISTA
- #PAGO_CAPITAL
- if (records['recordid'] == '86'):
+ ############START INVERSION COLOCADA
+ if records['recordid'] == '86':
cad = records['infoline1']
-
- if (cad != "PAGO CAPITAL INVERSION") and (cad.find("INVERSION COLOCADA") < 0):
- list_record.append(records)
-
- if (records['recordid'] == '61'):
- try:
- if float(records['amount']) != start_amount and float(records['amount']) != inversion_colocada:
- list_record.append(records)
- except:
- list_record.append(records)
- #####################################################################
-
- if (records['recordid'] != '61' and records['recordid'] != '86' ):
- list_record.append(records)
-
- [stmnt.import_record(r) for r in list_record if r is not None]
-
- if stmnt.is_valid():
- result.append(stmnt)
- list_record = []
- inversion_colocada = 0
- start_balance = 0
- else:
- logger.info("Invalid Statement:")
- logger.info(records[0])
- logger.info(records[1])
- logger.info(records[2])
- logger.info(records[3])
- logger.info(records[4])
- list_record = []
-
- return result
-
+ if cad.find('INVERSION COLOCADA') > 0:
+ inversion_colocada = amount
+
+ if records['recordid'] == '62F':
+ ending_balance = (inversion_colocada + float(records['endingbalance']))
+
+ if records is not None:
+ """ACTUALIZACION DE DATOS """
+ for record in statement_lines:
+ if record is not None:
+ records = parser.parse_record(record)
+
+ if (records['recordid'] == '60F'):
+ dic = {'startingbalance':start_balance}
+ records.update(dic)
+
+ if (records['recordid'] == '62F'):
+ dic = {'endingbalance': ending_balance}
+ records.update(dic)
+
+ if (records['recordid'] == '64'):
+ dic = {'endingbalance': ending_balance}
+ records.update(dic)
+
+ #SI LA LINEA NO ES INVERSION COLOCADA O PAGO CAPITAL INVERSION, SE AGREGA A LA LISTA
+ #PAGO_CAPITAL
+ if (records['recordid'] == '86'):
+ cad = records['infoline1']
+
+ if (cad != "PAGO CAPITAL INVERSION") and (cad.find("INVERSION COLOCADA") < 0):
+ list_record.append(records)
+
+ if (records['recordid'] == '61'):
+ try:
+ if float(records['amount']) != start_amount and float(records['amount']) != inversion_colocada:
+ list_record.append(records)
+ except:
+ list_record.append(records)
+ #####################################################################
+
+ if (records['recordid'] != '61' and records['recordid'] != '86' ):
+ list_record.append(records)
+
+ [stmnt.import_record(r) for r in list_record if r is not None]
+
+ if stmnt.is_valid():
+ result.append(stmnt)
+ list_record = []
+ inversion_colocada = 0
+ start_balance = 0
+ else:
+ logger.info("Invalid Statement:")
+ logger.info(records[0])
+ logger.info(records[1])
+ logger.info(records[2])
+ logger.info(records[3])
+ logger.info(records[4])
+ list_record = []
+ return result
+
+ else:
+ raise osv.except_osv(_('Error'),
+ _('Error en la importación! La cuenta especificada en el archivo no coincide con la seleccionada en el asistente de importacion'))
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'TODO-7.0/l10n_cr_account_banking_cr_bcr/__init__.py' (properties changed: +x to -x)
=== modified file 'TODO-7.0/l10n_cr_account_banking_cr_bcr/__openerp__.py' (properties changed: +x to -x)
--- TODO-7.0/l10n_cr_account_banking_cr_bcr/__openerp__.py 2012-07-06 05:08:02 +0000
+++ TODO-7.0/l10n_cr_account_banking_cr_bcr/__openerp__.py 2013-08-20 07:28:14 +0000
@@ -27,7 +27,7 @@
'author': 'CLEARCORP S.A.',
'website': 'http://www.clearcorp.co.cr',
'category': 'Account Banking',
- 'depends': ['account_banking'],
+ 'depends': ['account_banking','account_parser_type'],
'init_xml': [],
'update_xml': [],
'demo_xml': [],
=== modified file 'TODO-7.0/l10n_cr_account_banking_cr_bcr/bcr_format.py' (properties changed: +x to -x)
--- TODO-7.0/l10n_cr_account_banking_cr_bcr/bcr_format.py 2013-02-22 22:35:48 +0000
+++ TODO-7.0/l10n_cr_account_banking_cr_bcr/bcr_format.py 2013-08-20 07:28:14 +0000
@@ -24,10 +24,11 @@
from tools.translate import _
from bcr_parser import BCRParser
import re
-import osv
+from osv import osv, fields
import logging
import pprint
from datetime import datetime
+import base64
bt = models.mem_bank_transaction
logger = logging.getLogger( 'bcr_mt940' )
@@ -138,8 +139,8 @@
This format is available through
the BCR web interface.
''')
-
- def parse(self, cr, data, **kwargs):
+
+ def parse(self, cr, statements_file, **kwargs):
'''
** Kwargs parameter is used for a dynamic list of parameters.
@@ -155,7 +156,16 @@
parser = BCRParser()
stmnt = statement()
- records = parser.parse_stamenent_record(data)
+ """
+ **kwargs have all the parameters that have the wizard and
+ has all the parameters passed from the wizard before calling
+ the method that parses the file.
+ """
+
+ #pass to encoding with the correct type of file.
+ data = base64.decodestring(statements_file)
+
+ records = parser.parse_stamenent_record(data,**kwargs)
stmnt._transmission_number(records)
stmnt._account_number(records)
@@ -168,7 +178,7 @@
if stmnt.is_valid():
result.append(stmnt)
-
+
return result
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'TODO-7.0/l10n_cr_account_banking_cr_bcr/bcr_parser.py'
--- TODO-7.0/l10n_cr_account_banking_cr_bcr/bcr_parser.py 2013-02-22 22:35:48 +0000
+++ TODO-7.0/l10n_cr_account_banking_cr_bcr/bcr_parser.py 2013-08-20 07:28:14 +0000
@@ -27,6 +27,8 @@
from dateutil import parser
from pprint import PrettyPrinter
from copy import copy
+from tools.translate import _
+from osv import osv, fields
class BCRParser( object ):
"""
@@ -72,75 +74,90 @@
cad = ''
list_split = rec.split('\r\n')
-
- for l in list_split:
-
- # _transmission_number -> FIRST REVISION
- if (l.find('Movimiento realizado el periodo', 0, len('Movimiento realizado el periodo')) > -1):
- line_dict['statementnr'] = self.extract_number(l)
- # _transmission_number -> SECOND REVISION
- elif (l.find('MOVIMIENTO REALIZADO', 0, len('MOVIMIENTO REALIZADO')) > -1):
- line_dict['statementnr'] = self.extract_number(l)
-
- #_account_number -> FIRST REVISION
- if l.find('Movimiento de Cuenta Corriente', 0, len('Movimiento de Cuenta Corriente')) > -1:
- line_dict['account_number'] = self.extract_number(l)
- if (l.find('D',0,len(l)) > -1):
- line_dict['currencycode'] = 'USD'
- else:
- line_dict['currencycode'] = 'CRC'
- #_account_number -> SECOND REVISION
- elif (l.find('MOVIMIENTO DE LA CUENTA CORRIENTE No.', 0, len('MOVIMIENTO DE LA CUENTA CORRIENTE No.')) > -1):
- account_str = self.extract_number(l)
- #001-0246447-0
- account_1 = account_str[2:3] #1
- account_2 = account_str[4:] #246447-0
- account_complete = account_1+self.extract_number(account_2)#12464470
- line_dict['account_number'] = self.extract_number(account_complete)
- if (l.find('DOLARES',0,len(l)) > -1):
- line_dict['currencycode'] = 'USD'
- else:
- line_dict['currencycode'] = 'CRC'
-
- #FECHA Y HORA -> FIRST REVISION
- if (l.find('Solicitado el', 0, len('Solicitado el')) > -1):
- date = hour = cad = ''
- date = self.extract_date_regular_expresion(l)
- if len(date) > 0:
- hour = self.extract_hour_regular_expresion(l)
- cad = date + ' ' + hour
- line_dict['transref'] = cad
- line_dict['bookingdate'] = cad
- #FECHA Y HORA -> SECOND REVISION
- elif (l.find('SOLICITADO EL', 0, len('SOLICITADO EL')) > -1):
- date = hour = cad = ''
- date = self.extract_date_regular_expresion(l)
- if len(date) > 0:
- hour = self.extract_hour_regular_expresion(l)
- cad = date + ' ' + hour
- line_dict['transref'] = cad
- line_dict['bookingdate'] = cad
-
- #_opening_balance -> FIRST REVISION
- if l.find('Saldo Inicial', 0, len('Saldo Inicial')) > -1:
- line_dict['startingbalance'] = self.extract_float(l)
- #_opening_balance -> SECOND REVISION
- elif l.find('INICIAL', 0, len('INICIAL')) > -1:
- line_dict['startingbalance'] = self.extract_float(l)
-
- #_closing_balance -> FIRST REVISION
- if l.find('FINAL', 0, len('FINAL')) > -1:
- line_dict['endingbalance'] = self.extract_float(l)
- #_closing_balance -> SECOND REVISION
- elif l.find('Saldo Final', 0, len('Saldo Final')) > -1:
- line_dict['endingbalance'] = self.extract_float(l)
-
- line_dict['ammount'] = float( line_dict['startingbalance'] ) + float( line_dict['endingbalance'] )
- line_dict['id'] = line_dict['bookingdate'] + ' - ' + line_dict['account_number']
- self.line_dict = line_dict
-
- return line_dict
-
+ account_number_wizard = kwargs['account_number']
+
+ #If return True, the account are the same.
+ if self.match_account(list_split, account_number_wizard):
+ for l in list_split:
+ #_account_number -> FIRST REVISION
+ if l.find('Movimiento de Cuenta Corriente', 0, len('Movimiento de Cuenta Corriente')) > -1:
+ line_dict['account_number'] = self.extract_number(l)
+
+ if (l.find('D',0,len(l)) > -1):
+ line_dict['currencycode'] = 'USD'
+ else:
+ line_dict['currencycode'] = 'CRC'
+
+ #_account_number -> SECOND REVISION
+ elif (l.find('MOVIMIENTO DE LA CUENTA CORRIENTE No.', 0, len('MOVIMIENTO DE LA CUENTA CORRIENTE No.')) > -1):
+ account_str = self.extract_number(l)
+ #001-0246447-0
+ account_1 = account_str[2:3] #1
+ account_2 = account_str[4:] #246447-0
+ account_complete = account_1+self.extract_number(account_2)#12464470
+ line_dict['account_number'] = self.extract_number(account_complete)
+ if (l.find('DOLARES',0,len(l)) > -1):
+ line_dict['currencycode'] = 'USD'
+ else:
+ line_dict['currencycode'] = 'CRC'
+
+ # _transmission_number -> FIRST REVISION
+ if (l.find('Movimiento realizado el periodo', 0, len('Movimiento realizado el periodo')) > -1):
+ line_dict['statementnr'] = self.extract_number(l)
+ date_1 = self.extract_date_regular_expresion_line_format_2(l,0)
+ date_2 = self.extract_date_regular_expresion_line_format_2(l,1)
+
+ # _transmission_number -> SECOND REVISION
+ elif (l.find('MOVIMIENTO REALIZADO', 0, len('MOVIMIENTO REALIZADO')) > -1):
+ line_dict['statementnr'] = self.extract_number(l)
+ date_1 = self.extract_date_regular_expresion_line_format_2(l,0)
+ date_2 = self.extract_date_regular_expresion_line_format_2(l,1)
+
+ #date and hour -> FIRST REVISION
+ if (l.find('Solicitado el', 0, len('Solicitado el')) > -1):
+ date = hour = cad = ''
+ date = self.extract_date_regular_expresion(l)
+ if len(date) > 0:
+ hour = self.extract_hour_regular_expresion(l)
+ cad = date + ' ' + hour
+ line_dict['transref'] = cad
+ line_dict['bookingdate'] = cad
+
+ #date and hour -> SECOND REVISION
+ elif (l.find('SOLICITADO EL', 0, len('SOLICITADO EL')) > -1):
+ date = hour = cad = ''
+ date = self.extract_date_regular_expresion(l)
+ if len(date) > 0:
+ hour = self.extract_hour_regular_expresion(l)
+ cad = date + ' ' + hour
+ line_dict['transref'] = cad
+ line_dict['bookingdate'] = cad
+
+ #_opening_balance -> FIRST REVISION
+ if l.find('Saldo Inicial', 0, len('Saldo Inicial')) > -1:
+ line_dict['startingbalance'] = self.extract_float(l)
+ #_opening_balance -> SECOND REVISION
+ elif l.find('INICIAL', 0, len('INICIAL')) > -1:
+ line_dict['startingbalance'] = self.extract_float(l)
+
+ #_closing_balance -> FIRST REVISION
+ if l.find('FINAL', 0, len('FINAL')) > -1:
+ line_dict['endingbalance'] = self.extract_float(l)
+
+ #_closing_balance -> SECOND REVISION
+ elif l.find('Saldo Final', 0, len('Saldo Final')) > -1:
+ line_dict['endingbalance'] = self.extract_float(l)
+
+ line_dict['ammount'] = float( line_dict['startingbalance'] ) + float( line_dict['endingbalance'] )
+ line_dict['id'] = date_1 + ' - ' + date_2 + ' Extracto BCR ' + line_dict['account_number']
+ self.line_dict = line_dict
+
+ return line_dict
+
+ else:
+ raise osv.except_osv(_('Error'),
+ _('Error en la importación! La cuenta especificada en el archivo no coincide con la seleccionada en el asistente de importacion'))
+
def statement_lines ( self, rec ):
parser = BCRParser()
mapping = {
@@ -315,6 +332,19 @@
cad = cad + character
return cad
+ #with the pos parameter is said which of the two dates must be brought
+ #result brings a list of two elements, the post tells us to choose
+ def extract_date_regular_expresion_line_format_2(self, date, pos):
+ cad = ''
+ result = []
+ date_string = ''
+ result = re.findall('([0-9]{2}-[0-9]{2}-[0-9]{4})[\s]*',date)
+ date_str = result[pos]
+
+ for character in date_str:
+ cad = cad + character
+ return cad
+
def extract_hour_regular_expresion(self, date):
cad = ''
result = []
@@ -349,10 +379,36 @@
output.append( self.parse_stamenent_record( rec ) )
return output
+
+ #check if the account_number in the file match with the selected in the wizard.
+ def match_account(self, list_split, account_number_wizard):
+ accnumber = ''
+ for l in list_split:
+ #_account_number -> FIRST REVISION
+ if l.find('Movimiento de Cuenta Corriente', 0, len('Movimiento de Cuenta Corriente')) > -1:
+ accnumber = self.extract_number(l)
+ break
+
+ #_account_number -> SECOND REVISION
+ elif (l.find('MOVIMIENTO DE LA CUENTA CORRIENTE No.', 0, len('MOVIMIENTO DE LA CUENTA CORRIENTE No.')) > -1):
+ account_str = self.extract_number(l)
+ #001-0246447-0
+ account_1 = account_str[2:3] #1
+ account_2 = account_str[4:] #246447-0
+ account_complete = account_1+self.extract_number(account_2)#12464470
+ accnumber = self.extract_number(account_complete)
+ break
+
+ #If return True, the account_number in the wizard and the account in the file are the same.
+ if accnumber.find(account_number_wizard) > -1:
+ return True
+ else:
+ return False
+
def parse_file( filename ):
bacfile = open( filename, "r" )
- p = BCRParser().parse( bacfile.readlines() )
+ p = BCRParser().parse(bacfile.readlines())
def main():
"""The main function, currently just calls a dummy filename
=== modified file 'TODO-7.0/l10n_cr_account_financial_report_webkit/__openerp__.py'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/__openerp__.py 2013-02-01 14:30:02 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/__openerp__.py 2013-08-20 07:28:14 +0000
@@ -36,8 +36,6 @@
'data/financial_webkit_header.xml',
'report/report.xml',
'wizard/account_bank_balances_wizard_view.xml',
- 'wizard/l10n_cr_partners_ledger_wizard_view.xml',
- 'wizard/l10n_cr_open_invoices_wizard_view.xml',
'report_menus.xml',
'account_view.xml',
],
=== modified file 'TODO-7.0/l10n_cr_account_financial_report_webkit/i18n/de.po'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/i18n/de.po 2013-03-05 05:26:24 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/i18n/de.po 2013-08-20 07:28:14 +0000
@@ -13,8 +13,8 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2013-03-05 05:26+0000\n"
-"X-Generator: Launchpad (build 16514)\n"
+"X-Launchpad-Export-Date: 2013-08-06 05:01+0000\n"
+"X-Generator: Launchpad (build 16718)\n"
#. module: account_financial_report_webkit
#: field:account.common.balance.report,account_ids:0
=== modified file 'TODO-7.0/l10n_cr_account_financial_report_webkit/i18n/es_CR.po'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/i18n/es_CR.po 2012-11-01 17:12:59 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/i18n/es_CR.po 2013-08-20 07:28:14 +0000
@@ -76,7 +76,7 @@
msgstr "Cuenta"
#. module: l10n_cr_account_financial_report_webkit
-#: report:addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako:55
+#: report:addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako:63
msgid "Due Date"
msgstr "Fecha de Vencimiento"
@@ -169,6 +169,11 @@
msgstr "Filtrar por"
#. module: l10n_cr_account_financial_report_webkit
+#: report:addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako:63
+msgid "Date maturity"
+msgstr "Fecha de Vencimiento"
+
+#. module: l10n_cr_account_financial_report_webkit
#: report:addons/l10n_cr_account_financial_report_webkit/report/account_bank_balances.mako:60
#: report:addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_financial_report.mako:23
#: report:addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_open_invoices.mako:34
@@ -289,6 +294,11 @@
msgstr "Sólo Apertura"
#. module: l10n_cr_account_financial_report_webkit
+#: report:addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako:45
+msgid "RECEIVABLE"
+msgstr "POR COBRAR"
+
+#. module: l10n_cr_account_financial_report_webkit
#: report:addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_open_invoices.mako:60
#: report:addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partners_ledger.mako:70
msgid "Custom Filter"
@@ -549,6 +559,11 @@
msgstr "Este informe le permite imprimir o generar un pdf del saldo de cuentas de banco que le permite comprobar rápidamente el balance de cada una de sus cuentas en un único informe"
#. module: l10n_cr_account_financial_report_webkit
+#: report:addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako:64
+msgid "Number"
+msgstr "Número"
+
+#. module: l10n_cr_account_financial_report_webkit
#: view:account.balances:0
msgid "Accounts Filters"
msgstr "Filtros de Cuentas"
@@ -562,6 +577,11 @@
msgstr "Filtro por Fechas"
#. module: l10n_cr_account_financial_report_webkit
+#: report:addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako:43
+msgid "PAYABLE"
+msgstr "POR PAGAR"
+
+#. module: l10n_cr_account_financial_report_webkit
#: selection:account.balances,filter:0
#: selection:conciliation.bank.webkit,filter:0
msgid "No Filters"
@@ -654,8 +674,8 @@
msgstr "Reporte de Conciliación de Bancos"
#. module: l10n_cr_account_financial_report_webkit
-#: report:addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako:149
-msgid "Nota: "
+#: report:addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako:169
+msgid "Note: "
msgstr "Nota: "
#. module: l10n_cr_account_financial_report_webkit
=== modified file 'TODO-7.0/l10n_cr_account_financial_report_webkit/i18n/fr.po'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/i18n/fr.po 2013-03-05 05:26:24 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/i18n/fr.po 2013-08-20 07:28:14 +0000
@@ -14,8 +14,8 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2013-03-05 05:26+0000\n"
-"X-Generator: Launchpad (build 16514)\n"
+"X-Launchpad-Export-Date: 2013-08-06 05:01+0000\n"
+"X-Generator: Launchpad (build 16718)\n"
#. module: account_financial_report_webkit
#: field:account.common.balance.report,account_ids:0
=== modified file 'TODO-7.0/l10n_cr_account_financial_report_webkit/report/__init__.py'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/report/__init__.py 2012-11-04 16:56:05 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/report/__init__.py 2013-08-20 07:28:14 +0000
@@ -1,5 +1,3 @@
-import l10n_cr_partners_ledger
-import l10n_cr_open_invoices
import l10n_cr_partner_balance
import account_bank_balances
import l10n_cr_account_financial_report
=== removed file 'TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_open_invoices.mako'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_open_invoices.mako 2012-11-01 17:21:31 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_open_invoices.mako 1970-01-01 00:00:00 +0000
@@ -1,407 +0,0 @@
-<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <style type="text/css">
- .overflow_ellipsis {
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- }
-
- ${css}
- </style>
- </head>
- <body>
- <%!
- def amount(text):
- return text.replace('-', '‑') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers)
- %>
-
- <%setLang(user.context_lang)%>
-
- <%
- initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')}
- %>
-
- <div class="act_as_table data_table">
- <div class="act_as_row labels">
- <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')}
- %else:
- ${_('Periods Filter')}
- %endif
- </div>
- <div class="act_as_cell">${_('Accounts Filter')}</div>
- <div class="act_as_cell">${_('Target Moves')}</div>
- <div class="act_as_cell">${_('Initial Balance')}</div>
- </div>
- <div class="act_as_row">
- <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">
- ${_('From:')}
- %if filter_form(data) == 'filter_date':
- ${formatLang(start_date, date=True) if start_date else u'' }
- %else:
- ${start_period.name if start_period else u''}
- %endif
- ${_('To:')}
- %if filter_form(data) == 'filter_date':
- ${ formatLang(stop_date, date=True) if stop_date else u'' }
- %else:
- ${stop_period.name if stop_period else u'' }
- %endif
- </div>
- <div class="act_as_cell">
- %if partner_ids:
- ${_('Custom Filter')}
- %else:
- ${ display_partner_account(data) }
- %endif
- </div>
- <div class="act_as_cell">${ display_target_move(data) }</div>
- <div class="act_as_cell">${ initial_balance_text[initial_balance_mode] }</div>
- </div>
- </div>
- <%
- account_by_curr = get_accounts_by_curr(cr, uid, objects)
- %>
- %for currency in account_by_curr:
- %if currency[0] != 'CRC':
- <div class="account_title bg" style="margin-top: 20px; font-size: 14px; width: 1080px;">${_('Accounts in ')} ${currency[0]}</div>
- %else:
- <div class="account_title bg" style="margin-top: 20px; font-size: 14px; width: 1080px;">${_('Accounts in ')} ${company.currency_id.name}</div>
- %endif
- %for account in currency[1]:
- %if account.ledger_lines or account.init_balance:
- <%
- if not account.partners_order:
- continue
- account_total_invoice = 0.0
- account_total_payment = 0.0
- account_total_debit = 0.0
- account_total_credit = 0.0
- account_total_manual_move = 0.0
- account_balance_cumul = 0.0
- account_balance_cumul_curr = 0.0
- %>
-
- <div class="account_title bg" style="width: 1080px; margin-top: 15px; font-size: 12px;">${account.code} - ${account.name} - ${account.report_currency_id.name or account.company_id.currency_id.name}</div>
-
- %for partner_name, p_id, p_ref, p_name in account.partners_order:
- <%
- total_invoice = 0.0
- total_payment = 0.0
- total_debit = 0.0
- total_credit = 0.0
- total_manual_move = 0.0
- cumul_balance = 0.0
- cumul_balance_curr = 0.0
-
- part_cumul_balance = 0.0
- part_cumul_balance_curr = 0.0
- %>
- <div class="act_as_table list_table" style="margin-top: 5px;">
- <div class="act_as_caption account_title">
- ${ get_partner_name(cr, uid, partner_name, p_id, p_ref, p_name) or _('No Partner')}
- </div>
- <div class="act_as_thead">
- <div class="act_as_row labels">
- ## date
- <div class="act_as_cell first_column" style="width: 50px;">${_('Date')}</div>
- ## due date
- <div class="act_as_cell" style="width: 55px;">${_('Due Date')}</div>
- ## period
- <div class="act_as_cell" style="width: 70px;">${_('Period')}</div>
- ## move
- <div class="act_as_cell" style="width: 70px;">${_('Entry')}</div>
- ## journal
- <div class="act_as_cell" style="width: 70px;">${_('Journal')}</div>
- ## partner
- <!--div class="act_as_cell" style="width: 60px;">${_('Partner')}</div-->
- ## label
- <div class="act_as_cell" style="width: 215px;">${_('Label')}</div>
- ## reconcile
- <div class="act_as_cell" style="width: 70px;">${_('Rec.')}</div>
- ## Invoices
- <div class="act_as_cell amount" style="width: 100px;">${_('Invoice')}</div>
- ## credit
- <div class="act_as_cell amount" style="width: 100px;">${_('Payments')}</div>
- ## debit
- <div class="act_as_cell amount" style="width: 100px;">${_('Credit')}</div>
- ## Payments
- <div class="act_as_cell amount" style="width: 100px;">${_('Debit')}</div>
- ## Manual Move
- <div class="act_as_cell amount" style="width: 115px;">${_('Manual Move')}</div>
- ## balance cumulated
- <div class="act_as_cell amount" style="width: 115px;">${_('Cumul. Bal.')}</div>
- %if amount_currency(data):
- ## currency balance
- <div class="act_as_cell amount sep_left" style="width: 80px;">${_('Curr. Balance')}</div>
- ## curency code
- <div class="act_as_cell amount" style="width: 30px; text-align: right;">${_('Curr.')}</div>
- %endif
- </div>
- </div>
- <div class="act_as_tbody">
- <!--<%
- #total_debit = account.init_balance.get(p_id, {}).get('debit') or 0.0
- #total_credit = account.init_balance.get(p_id, {}).get('credit') or 0.0
- total_cumul_balance = 0.0
- %>-->
- %if initial_balance_mode and (total_debit or total_credit):
- <%
- #part_cumul_balance = account.init_balance.get(p_id, {}).get('init_balance') or 0.0
- #part_cumul_balance_curr = account.init_balance.get(p_id, {}).get('init_balance_currency') or 0.0
- #balance_forward_currency = account.init_balance.get(p_id, {}).get('currency_name') or ''
-
- #cumul_balance += part_cumul_balance
- #cumul_balance_curr += part_cumul_balance_curr
- %>
- %endif
-
-
- %for line in account.ledger_lines.get(p_id, []):
- <%open = is_open(cr, uid, line)%>
- %if open:
- <%
- label_elements = [line.get('lname') or '']
- if line.get('invoice_number'):
- label_elements.append("(%s)" % (line['invoice_number'],))
- label = ' '.join(label_elements)
-
- invoice_amount = 0.0
- payment_amount = 0.0
- credit_amount = 0.0
- debit_amount = 0.0
- MM_amount = 0.0
-
- amount = get_amount(cr, uid, line, currency[0])
- %>
- <div class="act_as_row lines">
- ## date
- <div class="act_as_cell first_column">${formatLang(line.get('ldate') or '', date=True)}</div>
- ## date
- <div class="act_as_cell">${formatLang(line.get('date_maturity') or '', date=True)}</div>
- ## period
- <div class="act_as_cell">${line.get('period_code') or ''}</div>
- ## move
- <div class="act_as_cell">${line.get('move_name') or ''}</div>
- ## journal
- <div class="act_as_cell">${line.get('jcode') or ''}</div>
- ## partner
- <!--div class="act_as_cell overflow_ellipsis">${line.get('partner_name') or ''}</div-->
- ## label
- <div class="act_as_cell">${label}</div>
- ## reconcile
- <div class="act_as_cell">${line.get('rec_name') or ''}</div>
- ## Invoice
- <div class="act_as_cell amount">
- %if amount[0] == 'invoice':
- <%
- invoice_amount = amount[1]
- total_invoice += invoice_amount
- %>
- ${ formatLang(invoice_amount or 0.0) }
- %else:
- ${'0.0'}
- %endif
- %if amount[2] != None and amount[0] == 'invoice':
- ${' ('}${ formatLang(amount[2]) }${')'}
- %endif
- </div>
- ## Payment
- <div class="act_as_cell amount">
- %if amount[0] == 'payment':
- <%
- payment_amount = amount[1]
- total_payment += payment_amount
- %>
- ${ formatLang(payment_amount or 0.0) }
- %else:
- ${'0.0'}
- %endif
- %if amount[2] != None and amount[0] == 'payment':
- ${' ('}${ formatLang(amount[2]) }${')'}
- %endif
- </div>
- ## Credit
- <div class="act_as_cell amount">
- %if amount[0] == 'credit':
- <%
- credit_amount = amount[1]
- total_credit += credit_amount
- %>
- ${ formatLang(credit_amount or 0.0) }
- %else:
- ${'0.0'}
- %endif
- %if amount[2] != None and amount[0] == 'credit':
- ${' ('}${ formatLang(amount[2]) }${')'}
- %endif
- </div>
- ## Debit
- <div class="act_as_cell amount">
- %if amount[0] == 'debit':
- <%
- debit_amount = amount[1]
- total_debit += debit_amount
- %>
- ${ formatLang(debit_amount or 0.0) }
- %else:
- ${'0.0'}
- %endif
- %if amount[2] != None and amount[0] == 'debit':
- ${' ('}${ formatLang(amount[2]) }${')'}
- %endif
- </div>
- ## Manual move
- <div class="act_as_cell amount">
- %if amount[0] == 'manual':
- <%
- MM_amount = amount[1]
- total_manual_move += MM_amount
- %>
- ${ formatLang(MM_amount or 0.0) }
- %else:
- ${'0.0'}
- %endif
- %if amount[2] != None and amount[0] == 'manual':
- ${' ('}${ formatLang(amount[2]) }${')'}
- %endif
- </div>
- ## balance cumulated
- <% cumul_balance = (invoice_amount+payment_amount+credit_amount+debit_amount+MM_amount) or 0.0 %>
- <div class="act_as_cell amount" style="padding-right: 1px;">${formatLang(cumul_balance) }</div>
- %if amount_currency(data):
- ## currency balance
- <div class="act_as_cell sep_left amount">${formatLang(line.get('amount_currency') or 0.0) }</div>
- ## curency code
- <div class="act_as_cell" style="text-align: right; ">${line.get('currency_code') or ''}</div>
- %endif
- </div>
- <%
- total_cumul_balance = total_invoice + total_payment + total_debit + total_credit + total_manual_move
- %>
- %endif
- %endfor
- <div class="act_as_row lines labels">
- ## date
- <div class="act_as_cell first_column"></div>
- ## period
- <div class="act_as_cell"></div>
- ## move
- <div class="act_as_cell"></div>
- ## journal
- <div class="act_as_cell"></div>
- ## partner
- <div class="act_as_cell"></div>
- ## label
- <div class="act_as_cell">${_('Saldo')}</div>
- ## reconcile
- <!--div class="act_as_cell"></div-->
- %if currency[0] != 'CRC':
- <% currency_symbol = get_currency_symbol(cr, uid, currency[0]) %>
- ## invoice
- <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_invoice) }</div>
- ## payment
- <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_payment) }</div>
- ## credit
- <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_credit) }</div>
- ## debit
- <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_debit) }</div>
- ## manual move
- <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_manual_move) }</div>
- ## balance cumulated
- <div class="act_as_cell amount" style="padding-right: 1px;">${currency_symbol} ${formatLang(total_cumul_balance) }</div>
- %else:
- ## invoice
- <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_invoice) }</div>
- ## payment
- <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_payment) }</div>
- ## credit
- <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_credit) }</div>
- ## debit
- <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_debit) }</div>
- ## manual move
- <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_manual_move) }</div>
- ## balance cumulated
- <div class="act_as_cell amount" style="padding-right: 1px;">${company.currency_id.symbol} ${formatLang(total_cumul_balance) }</div>
- %endif
- %if amount_currency(data):
- ## currency balance
- %if account.report_currency_id:
- <!--div class="act_as_cell amount sep_left">${formatLang(cumul_balance_curr) | amount }</div-->
- %else:
- <div class="act_as_cell sep_left amount">${ u'-' }</div>
- %endif
- ## currency code
- <div class="act_as_cell" style="text-align: right; padding-right: 1px;">${ account.report_currency_id.name if account.report_currency_id else u'' }</div>
- %endif
- </div>
- </div>
- </div>
- <%
- account_total_invoice += total_invoice
- account_total_payment += total_payment
- account_total_debit += total_debit
- account_total_credit += total_credit
- account_total_manual_move += total_manual_move
- account_balance_cumul += total_cumul_balance
- account_balance_cumul_curr += account_balance_cumul
- %>
- %endfor
-
- <div class="act_as_table list_table" style="margin-top:5px;">
- <div class="act_as_row labels" style="font-weight: bold; font-size: 12px;">
- <div class="act_as_cell first_column" style="width: 300px;">${account.code} - ${account.name}</div>
- ## label
- <div class="act_as_cell" style="width: 302px;">${_("Saldo")}</div>
- %if currency[0] != 'CRC':
- ## invoice
- <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_invoice) }</div>
- ## payment
- <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_payment) }</div>
- ## credit
- <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_credit) }</div>
- ## debit
- <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_debit) }</div>
- ## manual move
- <div class="act_as_cell amount" style="width: 115px;">${currency_symbol} ${ formatLang(account_total_manual_move) }</div>
- ## balance cumulated
- <div class="act_as_cell amount" style="width: 115px; padding-right: 1px;">${currency_symbol} ${ formatLang(account_balance_cumul) }</div>
- %else:
- ## invoice
- <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_invoice) }</div>
- ## payment
- <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_payment) }</div>
- ## credit
- <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_credit) }</div>
- ## debit
- <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_debit) }</div>
- ## manual move
- <div class="act_as_cell amount" style="width: 115px;">${company.currency_id.symbol} ${ formatLang(account_total_manual_move) }</div>
- ## balance cumulated
- <div class="act_as_cell amount" style="width: 115px; padding-right: 1px;">${company.currency_id.symbol} ${ formatLang(account_balance_cumul) }</div>
- %endif
- %if amount_currency(data):
- ## currency balance
- %if account.report_currency_id:
- <!--div class="act_as_cell amount sep_left" style="width: 80px;">${ formatLang(account_balance_cumul_curr) | amount }</div-->
- %else:
- <div class="act_as_cell amount sep_left" style="width: 80px;">${ u'-' }</div>
- %endif
- ## curency code
- <div class="act_as_cell amount" style="width: 30px; text-align: right; padding-right: 1px;">${ account.report_currency_id.name if account.report_currency_id else u'' }</div>
- %endif
- </div>
- </div>
- </div>
- %endif
- %endfor
- %endfor
- </body>
-</html>
=== modified file 'TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako 2012-07-04 20:52:00 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako 2013-08-20 07:28:14 +0000
@@ -1,162 +1,178 @@
<html>
<head>
- <style type="text/css">
- ${css}
-
- .list_table .act_as_row {
- margin-top: 10px;
- margin-bottom: 10px;
- font-size:10px;
- }
-
- .account_line {
- font-weight: bold;
- font-size: 15px;
- background-color:#F0F0F0;
- }
-
- .account_line .act_as_cell {
- height: 30px;
- vertical-align: bottom;
- }
-
- </style>
+ <style type="text/css">
+ ${css}
+
+ .list_table .act_as_row {
+ margin-top: 10px;
+ margin-bottom: 10px;
+ font-size:10px;
+ }
+
+ .account_line {
+ font-weight: bold;
+ font-size: 15px;
+ background-color:#F0F0F0;
+ }
+
+ .account_line .act_as_cell {
+ height: 30px;
+ vertical-align: bottom;
+ }
+
+ </style>
</head>
<body class = "data">
- %for partner in objects :
- <%
- part_by_curr = get_partners_by_curr(cr, uid, partner)
- %>
- <%setLang(user.context_lang)%>
- <%
- total_balance = 0.0
- %>
- <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;"> Estado de Cuenta</div>
- <div style="font-size: 20px; font-weight: bold; text-align: center;"> ${partner.name}</div>
- </br></br>
- %for currency in part_by_curr:
- <%
- total_debit_curr = 0.0
- total_credit_curr = 0.0
- total_balance_curr = 0.0
- balance_curr = 0.0
- %>
- %if currency[0] != None:
- <div class="account_title bg" style="margin-top: 20px; font-size: 12px; width: 1080px;">${_('Partner Balance in ')} ${currency[0]}</div>
- %else:
- <div class="account_title bg" style="margin-top: 20px; font-size: 12px; width: 1080px;">${_('Partner Balance in ')} ${company.currency_id.name}</div>
- %endif
- <div class="act_as_table list_table">
- <div class="act_as_thead">
- <div class="act_as_row labels" style="font-weight: bold; font-size: 11x;">
- <div class="act_as_cell first_column" style="vertical-align: middle">${_('Date')}</div>
- <div class="act_as_cell" style="width: 250px; vertical-align: middle">${_('Detail')}</div>
- <div class="act_as_cell">${_('Due Date')}</div>
- <div class="act_as_cell amount">${_('Credit')}</div>
- <div class="act_as_cell amount">${_('Debit')}</div>
- </div>
- </div>
-
- <div class="act_as_tbody">
- %for move_line in sorted(currency[1], key=lambda currency: currency.date):
- <div class="act_as_row lines">
- ## Fecha
- <div class="act_as_cell first_column">${move_line.date or '0'}</div>
- ## Detalle
- <div class="act_as_cell">${move_line.name or '-'}</div>
- ## Fecha de Vencimiento
- <div class="act_as_cell">${move_line.date_maturity or '-'}</div>
- %if currency[0] != None:
- %if move_line.amount_currency > 0:
- ## Cobros
- <div class="act_as_cell amount">${formatLang(move_line.amount_currency) or '0'}</div>
- ## Pagos
- <div class="act_as_cell amount">${'0.00'}</div>
- <%total_debit_curr += move_line.amount_currency%>
- %else:
- ## Cobros
- <div class="act_as_cell amount">${'0.00'}</div>
- ## Pagos
- <div class="act_as_cell amount">${formatLang(move_line.amount_currency*-1) or '0'}</div>
- <%total_credit_curr += move_line.amount_currency*-1%>
- %endif
- %else:
- ## Pagos
- <div class="act_as_cell amount">${formatLang(move_line.debit) or '0'}</div>
- ## Cobros
- <div class="act_as_cell amount">${formatLang(move_line.credit) or '0'}</div>
- <%
- ## Totales por Moneda
- total_debit_curr += move_line.debit
- total_credit_curr += move_line.credit
- %>
- %endif
- </div>
- %endfor
- </div>
- <%
- ## Totales
- total_balance_curr = total_debit_curr - total_credit_curr
- if currency[0] != None:
- balance_curr = currency_convert(cr, uid, move_line.currency_id.id, company.currency_id.id, total_balance_curr)
- else:
- balance_curr = total_balance_curr
- endif
-
- total_balance += balance_curr
- %>
- <div class="act_as_tfoot">
- <div class="act_as_row labels" style="font-weight: bold; font-size: 11px;" >
- <div class="act_as_cell first_column" style="vertical-align: middle">${_('Balance')}</div>
- %if currency[0] != None:
- <div class="act_as_cell" style="width: 250px; vertical-align: middle">${move_line.currency_id.symbol} ${formatLang(total_balance_curr)}</div>
- <div class="act_as_cell">${_('')}</div>
- <div class="act_as_cell amount">${move_line.currency_id.symbol} ${formatLang(total_debit_curr)}</div>
- <div class="act_as_cell amount">${move_line.currency_id.symbol} ${formatLang(total_credit_curr)}</div>
- %else:
- <div class="act_as_cell" style="width: 250px; vertical-align: middle">${company.currency_id.symbol} ${formatLang(total_balance_curr)}</div>
- <div class="act_as_cell">${_('')}</div>
- <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_debit_curr)}</div>
- <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_credit_curr)}</div>
- %endif
-
- </div>
- </div>
- </div>
-
- %endfor
-
- %if part_by_curr != []:
- <div class="act_as_table list_table " style="margin-top: 20px;">
- <div class="act_as_tfoot">
- <div class="act_as_row labels" style="font-weight: bold; font-size: 11px;">
- <div class="act_as_cell first_column" style="width: 205px; font-size: 12px; text-align: left">${_('TOTAL BALANCE in ')} ${company.currency_id.name}</div>
- <div class="act_as_cell" style="text-align: left">${company.currency_id.symbol} ${formatLang(total_balance)}</div>
- </div>
- </div>
- </div>
- <div>
+ %for partner in objects :
+ <%
+ account_types = ['payable','receivable']
+
+ setLang(user.context_lang)
+ %>
+ </br></br>
+ <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;"> Estado de Cuenta</div>
+ <div style="font-size: 20px; font-weight: bold; text-align: center;"> ${partner.name}</div>
+ %for account_type in account_types :
<%
- today = get_time_today()
+ part_by_curr = get_partners_by_curr(cr, uid, partner, account_type)
+ total_balance = 0.0
+ %>
+ </br></br>
+ %if account_type == 'payable':
+ <div style="font-size: 20px; font-weight: bold;"> ${_('PAYABLE')}</div>
+ %elif account_type == 'receivable':
+ <div style="font-size: 20px; font-weight: bold;"> ${_('RECEIVABLE')}</div>
+ %endif
+ %for currency in part_by_curr:
+ <%
+ total_debit_curr = 0.0
+ total_credit_curr = 0.0
+ total_balance_curr = 0.0
+ balance_curr = 0.0
+ %>
+ %if currency[0] != None:
+ <div class="account_title bg" style="margin-top: 20px; font-size: 12px; width: 1080px;">${_('Partner Balance in ')} ${currency[0]}</div>
+ %else:
+ <div class="account_title bg" style="margin-top: 20px; font-size: 12px; width: 1080px;">${_('Partner Balance in ')} ${company.currency_id.name}</div>
+ %endif
+ <div class="act_as_table list_table">
+ <div class="act_as_thead">
+ <div class="act_as_row labels" style="font-weight: bold; font-size: 11x;">
+ <div class="act_as_cell first_column" style="vertical-align: middle">${_('Date')}</div>
+ <div class="act_as_cell">${_('Date maturity')}</div>
+ <div class="act_as_cell">${_('Number')}</div>
+ <div class="act_as_cell" style="width: 250px; vertical-align: middle">${_('Detail')}</div>
+ <div class="act_as_cell amount">${_('Credit')}</div>
+ <div class="act_as_cell amount">${_('Debit')}</div>
+ </div>
+ </div>
+
+ <div class="act_as_tbody">
+ %for move_line in sorted(currency[1], key=lambda currency: currency.date):
+ <div class="act_as_row lines">
+ ## Date
+ <div class="act_as_cell first_column">${move_line.date or '0'}</div>
+ ## Due date
+ <div class="act_as_cell">${move_line.date_maturity or '-'}</div>
+ ## Name Move
+ <div class="act_as_cell">${move_line.move_id.name or '-'}</div>
+ ## Detail
+ <div class="act_as_cell" style="width: 250px; vertical-align: middle">${move_line.name or '-'}</div>
+ %if currency[0] != None:
+ %if move_line.amount_currency > 0:
+ ## Receivables
+ <div class="act_as_cell amount">${formatLang(move_line.amount_currency) or '0'}</div>
+ ## Payments
+ <div class="act_as_cell amount">${'0.00'}</div>
+ <%total_debit_curr += move_line.amount_currency%>
+ %else:
+ ## Receivables
+ <div class="act_as_cell amount">${'0.00'}</div>
+ ## Payments
+ <div class="act_as_cell amount">${formatLang(move_line.amount_currency*-1) or '0'}</div>
+ <%total_credit_curr += move_line.amount_currency*-1%>
+ %endif
+ %else:
+ ## Payments
+ <div class="act_as_cell amount">${formatLang(move_line.debit) or '0'}</div>
+ ## Receivables
+ <div class="act_as_cell amount">${formatLang(move_line.credit) or '0'}</div>
+ <%
+ ## Totales por Moneda
+ total_debit_curr += move_line.debit
+ total_credit_curr += move_line.credit
+ %>
+ %endif
+ </div>
+ %endfor
+ </div>
+ <%
+ ## Totales
+ total_balance_curr = total_debit_curr - total_credit_curr
if currency[0] != None:
- conversion_rate = get_conversion_rate(cr, uid, move_line.currency_id, company.currency_id)
+ balance_curr = currency_convert(cr, uid, move_line.currency_id.id, company.currency_id.id, total_balance_curr)
else:
- from_currency = get_currency(cr, uid, 2)
- conversion_rate = get_conversion_rate(cr, uid, from_currency, company.currency_id)
+ balance_curr = total_balance_curr
endif
- %>
- <div style="font-family: Helvetica, Arial; font-size: 13px; font-weight: bold; margin-top: 20px;"> ${_('Nota: ')} </div>
- <div style="font-family: Helvetica, Arial; font-size: 12px;"> ${_('In the event of any foreign currencies the Total Balance was calculated according to the exchange rate of the day ')} ${formatLang( today, date=True)} (${company.currency_id.symbol} ${conversion_rate})</div>
- </div>
- %else:
- <div class="account_title bg" style="margin-top: 20px; font-size: 14px; width: 1080px;">${_('There is no open invoices')}</div>
- %endif
+
+ total_balance += balance_curr
+ %>
+ <div class="act_as_tfoot">
+ <div class="act_as_row labels" style="font-weight: bold; font-size: 11px;" >
+ <div class="act_as_cell first_column" style="vertical-align: middle">${_('Balance')}</div>
+ %if currency[0] != None:
+ <div class="act_as_cell" style="width: 250px; vertical-align: middle">${move_line.currency_id.symbol} ${formatLang(total_balance_curr)}</div>
+ <div class="act_as_cell">${_('')}</div>
+ <div class="act_as_cell">${_('')}</div>
+ <div class="act_as_cell amount">${move_line.currency_id.symbol} ${formatLang(total_debit_curr)}</div>
+ <div class="act_as_cell amount">${move_line.currency_id.symbol} ${formatLang(total_credit_curr)}</div>
+ %else:
+ <div class="act_as_cell" style="width: 250px; vertical-align: middle">${company.currency_id.symbol} ${formatLang(total_balance_curr)}</div>
+ <div class="act_as_cell">${_('')}</div>
+ <div class="act_as_cell">${_('')}</div>
+ <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_debit_curr)}</div>
+ <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_credit_curr)}</div>
+ %endif
+
+ </div>
+ </div>
+ </div>
+
+ %endfor
+
+ %if part_by_curr != []:
+ <div class="act_as_table list_table " style="margin-top: 20px;">
+ <div class="act_as_tfoot">
+ <div class="act_as_row labels" style="font-weight: bold; font-size: 11px;">
+ <div class="act_as_cell first_column" style="width: 205px; font-size: 12px; text-align: left">${_('TOTAL BALANCE in ')} ${company.currency_id.name}</div>
+ <div class="act_as_cell" style="text-align: left">${company.currency_id.symbol} ${formatLang(total_balance)}</div>
+ </div>
+ </div>
+ </div>
+ <div>
+ <%
+ today = get_time_today()
+ if currency[0] != None:
+ conversion_rate = get_conversion_rate(cr, uid, move_line.currency_id, company.currency_id)
+ else:
+ from_currency = get_currency(cr, uid, 2)
+ conversion_rate = get_conversion_rate(cr, uid, from_currency, company.currency_id)
+ endif
+ %>
+ </div>
+ %else:
+ <div class="account_title bg" style="margin-top: 20px; font-size: 14px; width: 1080px;">${_('There is no open invoices')}</div>
+ %endif
- <p style="page-break-after:always"></p>
-
- %endfor
-
+ %endfor
+ </br></br>
+ <div style="font-family: Helvetica, Arial; font-size: 13px; font-weight: bold; margin-top: 20px;"> ${_('Note: ')} </div>
+ <div style="font-family: Helvetica, Arial; font-size: 12px;"> ${_('In the event of any foreign currencies the Total Balance was calculated according to the exchange rate of the day ')} ${formatLang( today, date=True)} (${company.currency_id.symbol} ${conversion_rate})</div>
+ <p style="page-break-after:always"></p>
+
+ %endfor
+
</body>
</html>
=== removed file 'TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partners_ledger.mako'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partners_ledger.mako 2012-08-07 20:21:11 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partners_ledger.mako 1970-01-01 00:00:00 +0000
@@ -1,480 +0,0 @@
-<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <style type="text/css">
- .overflow_ellipsis {
- text-overflow: ellipsis;
- overflow: hidden;
- white-space: nowrap;
- }
- ${css}
- </style>
-</head>
-<body>
- <%!
- def amount(text):
- return text.replace('-', '‑') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers)
- %>
- <%
- setLang(user.context_lang)
-
- initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')}
- filter_type = ''
- filter_data = []
- %>
-
- <div class="act_as_table data_table">
- <div class="act_as_row labels">
- <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')}
- %else:
- ${_('Periods Filter')}
- %endif
- </div>
- <div class="act_as_cell">${_('Accounts Filter')}</div>
- <div class="act_as_cell">${_('Target Moves')}</div>
- <div class="act_as_cell">${_('Initial Balance')}</div>
- </div>
- <div class="act_as_row">
- <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">
- ${_('From:')}
- %if filter_form(data) == 'filter_date':
- ${formatLang(start_date, date=True) if start_date else u'' }
- <%
- filter_data.append(start_date)
- filter_type = 'filter_date'
- %>
- %else:
- ${start_period.name if start_period else u''}
- <%
- filter_data.append(start_period)
- filter_type = 'filter_period'
- %>
- %endif
- ${_('To:')}
- %if filter_form(data) == 'filter_date':
- ${ formatLang(stop_date, date=True) if stop_date else u'' }
- <% filter_data.append(stop_date) %>
- %else:
- ${stop_period.name if stop_period else u'' }
- <% filter_data.append(stop_period) %>
- %endif
- </div>
- <div class="act_as_cell">
- %if partner_ids:
- ${_('Custom Filter')}
- %else:
- ${ display_partner_account(data) }
- %endif
- </div>
- <div class="act_as_cell">${ display_target_move(data) }</div>
- <div class="act_as_cell">${ initial_balance_text[initial_balance_mode] }</div>
- </div>
- </div>
- <%
- account_by_curr = get_accounts_by_curr(cr, uid, objects)
- %>
- %for currency in account_by_curr:
- %if currency[0] != 'CRC':
- <%currency_symbol = get_currency_symbol(cr, uid, currency[0]) %>
- %endif
- <%
- currency_total_invoice = 0.0
- currency_total_payment = 0.0
- currency_total_debit = 0.0
- currency_total_credit = 0.0
- currency_total_manual_move = 0.0
- currency_balance_accumulated = 0.0
- %>
-
- <div class="account_title bg" style="margin-top: 20px; font-size: 14px; width: 100%;">${_('Accounts in ')} ${currency[0]}</div>
-
- %for account in currency[1]:
- %if account.ledger_lines or account.init_balance:
- <%
- if not account.partners_order:
- continue
- account_total_invoice = 0.0
- account_total_payment = 0.0
- account_total_debit = 0.0
- account_total_credit = 0.0
- account_total_manual_move = 0.0
- account_balance_accumulated = 0.0
- account_balance_accumulated_curr = 0.0
- %>
-
- <div class="account_title bg" style="width: 100%; margin-top: 15px; font-size: 12px;">${account.code} - ${account.name} - ${account.report_currency_id.name or account.company_id.currency_id.name}</div>
-
- %for partner_name, p_id, p_ref, p_name in account.partners_order:
- <%
- total_invoice = 0.0
- total_payment = 0.0
- total_debit = 0.0
- total_credit = 0.0
- total_manual_move = 0.0
- accumulated_balance = 0.0
- accumulated_balance_curr = 0.0
- total_accumulated_balance = 0.0
-
- partner_accumulated_balance = 0.0
- partner_accumulated_balance_curr = 0.0
-
- partner_accumulated_balance = account.init_balance.get(p_id, {}).get('init_balance') or 0.0
- init_balance = 0.0
- init_balance = get_initial_balance(cr, uid, p_id, account, filter_type, filter_data, fiscal_year, currency[0])
- accumulated_balance = init_balance
- %>
- <div class="act_as_table list_table" style="margin-top: 5px;">
- <div class="act_as_caption account_title">
- ${ get_partner_name(cr, uid, partner_name, p_id, p_ref, p_name) or _('No Partner')}
- </div>
- <div class="act_as_thead">
- <div class="act_as_row labels">
- ## date
- <div class="act_as_cell first_column" style="width: 50px;">${_('Date')}</div>
- ## period
- <div class="act_as_cell" style="width: 70px;">${_('Period')}</div>
- ## move
- <div class="act_as_cell" style="width: 70px;">${_('Entry')}</div>
- ## journal
- <div class="act_as_cell" style="width: 70px;">${_('Journal')}</div>
- ## partner
- <!--div class="act_as_cell" style="width: 60px;">${_('Partner')}</div-->
- ## label
- <div class="act_as_cell" style="width: 270px;">${_('Label')}</div>
- ## reconcile
- <div class="act_as_cell" style="width: 70px;">${_('Rec.')}</div>
- ## Invoices
- <div class="act_as_cell amount" style="width: 100px;">${_('Invoice')}</div>
- ## credit
- <div class="act_as_cell amount" style="width: 100px;">${_('Payments')}</div>
- ## debit
- <div class="act_as_cell amount" style="width: 100px;">${_('Credit')}</div>
- ## Payments
- <div class="act_as_cell amount" style="width: 100px;">${_('Debit')}</div>
- ## Manual Move
- <div class="act_as_cell amount" style="width: 115px;">${_('Manual Move')}</div>
- ## balance cumulated
- <div class="act_as_cell amount" style="width: 115px;">${_('Cumul. Bal.')}</div>
- %if amount_currency(data):
- ## currency balance
- <div class="act_as_cell amount sep_left" style="width: 80px;">${_('Curr. Balance')}</div>
- ## curency code
- <div class="act_as_cell amount" style="width: 30px; text-align: right;">${_('Curr.')}</div>
- %endif
- </div>
- </div>
- <div class="act_as_tbody">
- %if initial_balance_mode and (total_debit or total_credit):
- <%
- #partner_accumulated_balance = account.init_balance.get(p_id, {}).get('init_balance') or 0.0
- #partner_accumulated_balance_curr = account.init_balance.get(p_id, {}).get('init_balance_currency') or 0.0
- #balance_forward_currency = account.init_balance.get(p_id, {}).get('currency_name') or ''
-
- #accumulated_balance += partner_accumulated_balance
- #accumulated_balance_curr += partner_accumulated_balance_curr
- %>
- %endif
- <div class="act_as_cell first_column" style="width: 50px;">${_('')}</div>
- ## period
- <div class="act_as_cell" style="width: 70px;">${_('')}</div>
- ## move
- <div class="act_as_cell" style="width: 70px;">${_('')}</div>
- ## journal
- <div class="act_as_cell" style="width: 70px;">${_('')}</div>
- <div class="act_as_cell" style="width: 270px;">${_('Initial Balance')}</div>
- <div class="act_as_cell" style="width: 70px;">${_('')}</div>
- <div class="act_as_cell amount" style="width: 100px;">${_('')}</div>
- <div class="act_as_cell amount" style="width: 100px;">${_('')}</div>
- <div class="act_as_cell amount" style="width: 100px;">${_('')}</div>
- <div class="act_as_cell amount" style="width: 100px;">${_('')}</div>
- <div class="act_as_cell amount" style="width: 115px;">${_('')}</div>
- <div class="act_as_cell amount" style="width: 115px;">${formatLang(init_balance)}</div>
-
- <%total_accumulated_balance = init_balance %>
-
- %for line in account.ledger_lines.get(p_id, []):
- <%
- label_elements = [line.get('lname') or '']
- if line.get('invoice_number'):
- label_elements.append("(%s)" % (line['invoice_number'],))
- label = ' '.join(label_elements)
-
- invoice_amount = 0.0
- payment_amount = 0.0
- credit_amount = 0.0
- debit_amount = 0.0
- MM_amount = 0.0
-
- amount = get_amount(cr, uid, line, currency[0])
- %>
- <div class="act_as_row lines">
- ## date
- <div class="act_as_cell first_column">${formatLang(line.get('ldate') or '', date=True)}</div>
- ## period
- <div class="act_as_cell">${line.get('period_code') or ''}</div>
- ## move
- <div class="act_as_cell">${line.get('move_name') or ''}</div>
- ## journal
- <div class="act_as_cell">${line.get('jcode') or ''}</div>
- ## partner
- <!--div class="act_as_cell overflow_ellipsis">${line.get('partner_name') or ''}</div-->
- ## label
- <div class="act_as_cell">${label}</div>
- ## reconcile
- <div class="act_as_cell">${line.get('rec_name') or ''}</div>
- ## Invoice
- <div class="act_as_cell amount">
- %if amount[0] == 'invoice':
- <%
- invoice_amount = amount[1]
- total_invoice += invoice_amount
- %>
- ${ formatLang(invoice_amount or 0.0) }
- %else:
- ${'0.0'}
- %endif
- %if amount[2] != None and amount[0] == 'invoice':
- ${' ('}${ formatLang(amount[2]) }${')'}
- %endif
- </div>
- ## Payment
- <div class="act_as_cell amount">
- %if amount[0] == 'payment':
- <%
- payment_amount = amount[1]
- total_payment += payment_amount
- %>
- ${ formatLang(payment_amount or 0.0) }
- %else:
- ${'0.0'}
- %endif
- %if amount[2] != None and amount[0] == 'payment':
- ${' ('}${ formatLang(amount[2]) }${')'}
- %endif
- </div>
- ## Credit
- <div class="act_as_cell amount">
- %if amount[0] == 'credit':
- <%
- credit_amount = amount[1]
- total_credit += credit_amount
- %>
- ${ formatLang(credit_amount or 0.0) }
- %else:
- ${'0.0'}
- %endif
- %if amount[2] != None and amount[0] == 'credit':
- ${' ('}${ formatLang(amount[2]) }${')'}
- %endif
- </div>
- ## Debit
- <div class="act_as_cell amount">
- %if amount[0] == 'debit':
- <%
- debit_amount = amount[1]
- total_debit += debit_amount
- %>
- ${ formatLang(debit_amount or 0.0) }
- %else:
- ${'0.0'}
- %endif
- %if amount[2] != None and amount[0] == 'debit':
- ${' ('}${ formatLang(amount[2]) }${')'}
- %endif
- </div>
- ## Manual move
- <div class="act_as_cell amount">
- %if amount[0] == 'manual':
- <%
- MM_amount = amount[1]
- total_manual_move += MM_amount
- %>
- ${ formatLang(MM_amount or 0.0) }
- %else:
- ${'0.0'}
- %endif
- %if amount[2] != None and amount[0] == 'manual':
- ${' ('}${ formatLang(amount[2]) }${')'}
- %endif
- </div>
- ## balance cumulated
- <%
- accumulated_balance = (invoice_amount+payment_amount+credit_amount+debit_amount+MM_amount) or 0.0
- total_accumulated_balance += accumulated_balance
- %>
- <div class="act_as_cell amount" style="padding-right: 1px;">${formatLang(total_accumulated_balance) }</div>
- %if amount_currency(data):
- ## currency balance
- <div class="act_as_cell sep_left amount">${formatLang(line.get('amount_currency') or 0.0) }</div>
- ## curency code
- <div class="act_as_cell" style="text-align: right; ">${line.get('currency_code') or ''}</div>
- %endif
- </div>
- %endfor
- <div class="act_as_row lines labels">
- ## date
- <div class="act_as_cell first_column"></div>
- ## period
- <div class="act_as_cell"></div>
- ## move
- <div class="act_as_cell"></div>
- ## journal
- <div class="act_as_cell"></div>
- ## partner
- <div class="act_as_cell"></div>
- ## label
- <div class="act_as_cell">${_('Saldo')}</div>
- ## reconcile
- <!--div class="act_as_cell"></div-->
- %if currency[0] != 'CRC':
- ## invoice
- <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_invoice) }</div>
- ## payment
- <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_payment) }</div>
- ## credit
- <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_credit) }</div>
- ## debit
- <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_debit) }</div>
- ## manual move
- <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_manual_move) }</div>
- ## balance cumulated
- <div class="act_as_cell amount" style="padding-right: 1px;">${currency_symbol} ${formatLang(total_accumulated_balance) }</div>
- %else:
- ## invoice
- <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_invoice) }</div>
- ## payment
- <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_payment) }</div>
- ## credit
- <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_credit) }</div>
- ## debit
- <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_debit) }</div>
- ## manual move
- <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_manual_move) }</div>
- ## balance cumulated
- <div class="act_as_cell amount" style="padding-right: 1px;">${company.currency_id.symbol} ${formatLang(total_accumulated_balance) }</div>
- %endif
- %if amount_currency(data):
- ## currency balance
- %if account.report_currency_id:
- <!--div class="act_as_cell amount sep_left">${formatLang(accumulated_balance_curr) | amount }</div-->
- %else:
- <div class="act_as_cell sep_left amount">${ u'-' }</div>
- %endif
- ## currency code
- <div class="act_as_cell" style="text-align: right; padding-right: 1px;">${ account.report_currency_id.name if account.report_currency_id else u'' }</div>
- %endif
- </div>
- </div>
- </div>
- <%
- account_total_invoice += total_invoice
- account_total_payment += total_payment
- account_total_debit += total_debit
- account_total_credit += total_credit
- account_total_manual_move += total_manual_move
- account_balance_accumulated += total_accumulated_balance
- account_balance_accumulated_curr += account_balance_accumulated
-
- currency_total_invoice += total_invoice
- currency_total_payment += total_payment
- currency_total_debit += total_debit
- currency_total_credit += total_credit
- currency_total_manual_move += total_manual_move
- currency_balance_accumulated += total_accumulated_balance
- %>
- %endfor
-
- <div class="act_as_table list_table" style="margin-top:5px;">
- <div class="act_as_row labels" style="font-weight: bold; font-size: 12px;">
- <div class="act_as_cell first_column" style="width: 300px;">${account.code} - ${account.name}</div>
- ## label
- <div class="act_as_cell" style="width: 302px;">${_("Saldo")}</div>
- %if currency[0] != 'CRC':
- ## invoice
- <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_invoice) }</div>
- ## payment
- <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_payment) }</div>
- ## credit
- <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_credit) }</div>
- ## debit
- <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_debit) }</div>
- ## manual move
- <div class="act_as_cell amount" style="width: 115px;">${currency_symbol} ${ formatLang(account_total_manual_move) }</div>
- ## balance cumulated
- <div class="act_as_cell amount" style="width: 115px; padding-right: 1px;">${currency_symbol} ${ formatLang(account_balance_accumulated) }</div>
- %else:
- ## invoice
- <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_invoice) }</div>
- ## payment
- <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_payment) }</div>
- ## credit
- <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_credit) }</div>
- ## debit
- <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_debit) }</div>
- ## manual move
- <div class="act_as_cell amount" style="width: 115px;">${company.currency_id.symbol} ${ formatLang(account_total_manual_move) }</div>
- ## balance cumulated
- <div class="act_as_cell amount" style="width: 115px; padding-right: 1px;">${company.currency_id.symbol} ${ formatLang(account_balance_accumulated) }</div>
- %endif
- %if amount_currency(data):
- ## currency balance
- %if account.report_currency_id:
- <!--div class="act_as_cell amount sep_left" style="width: 80px;">${ formatLang(account_balance_accumulated_curr) | amount }</div-->
- %else:
- <div class="act_as_cell amount sep_left" style="width: 80px;">${ u'-' }</div>
- %endif
- ## curency code
- <div class="act_as_cell amount" style="width: 30px; text-align: right; padding-right: 1px;">${ account.report_currency_id.name if account.report_currency_id else u'' }</div>
- %endif
- </div>
- </div>
- </div>
- %endif
- %endfor
- <div class="act_as_table list_table" style="margin-top:5px;">
- <div class="act_as_row labels" style="font-weight: bold; font-size: 12px;">
- %if currency[0] != 'CRC':
- <div class="act_as_cell first_column" style="width: 300px;">${_('Total for Accounts in ')} ${currency[0]}</div>
- %else:
- <div class="act_as_cell first_column" style="width: 300px;">${_('Total for Accounts in ')} ${company.currency_id.name}</div>
- %endif
- ## label
- <div class="act_as_cell" style="width: 302px;"></div>
- %if currency[0] != 'CRC':
- ## invoice
- <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(currency_total_invoice) }</div>
- ## payment
- <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(currency_total_payment) }</div>
- ## credit
- <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(currency_total_credit) }</div>
- ## debit
- <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(currency_total_debit) }</div>
- ## manual move
- <div class="act_as_cell amount" style="width: 115px;">${currency_symbol} ${ formatLang(currency_total_manual_move) }</div>
- ## balance cumulated
- <div class="act_as_cell amount" style="width: 115px; padding-right: 1px;">${currency_symbol} ${ formatLang(currency_balance_accumulated) }</div>
- %else:
- ## invoice
- <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(currency_total_invoice) }</div>
- ## payment
- <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(currency_total_payment) }</div>
- ## credit
- <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(currency_total_credit) }</div>
- ## debit
- <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(currency_total_debit) }</div>
- ## manual move
- <div class="act_as_cell amount" style="width: 115px;">${company.currency_id.symbol} ${ formatLang(currency_total_manual_move) }</div>
- ## balance cumulated
- <div class="act_as_cell amount" style="width: 115px; padding-right: 1px;">${company.currency_id.symbol} ${ formatLang(currency_balance_accumulated) }</div>
- %endif
- </div>
- </div>
- %endfor
-</body>
-</html>
=== removed file 'TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_open_invoices.py'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_open_invoices.py 2012-06-21 23:21:28 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_open_invoices.py 1970-01-01 00:00:00 +0000
@@ -1,80 +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 pooler
-
-from collections import defaultdict
-from report import report_sxw
-from datetime import datetime
-from itertools import groupby
-from operator import itemgetter
-from mako.template import Template
-
-from tools.translate import _
-
-from openerp.osv import osv
-from openerp.addons.report_webkit import report_helper
-import addons
-
-from l10n_cr_partners_ledger import l10n_cr_PartnersLedgerWebkit
-from openerp.addons.account_financial_report_webkit.report.webkit_parser_header_fix import HeaderFooterTextWebKitParser
-
-class l10n_cr_PartnersOpenInvoicesWebkit(l10n_cr_PartnersLedgerWebkit):
-
- def __init__(self, cursor, uid, name, context):
- super(l10n_cr_PartnersOpenInvoicesWebkit, self).__init__(cursor, uid, name, context=context)
- self.pool = pooler.get_pool(self.cr.dbname)
- self.cursor = self.cr
-
- company = self.pool.get('res.users').browse(self.cr, uid, uid, context=context).company_id
- header_report_name = ' - '.join((_('OPEN INVOICES REPORT'), company.name, company.currency_id.name))
-
- footer_date_time = self.formatLang(str(datetime.today()), date_time=True)
-
- self.localcontext.update({
- 'is_open': self.is_open,
- 'report_name':_('Open Invoices Report'),
- 'additional_args': [
- ('--header-font-name', 'Helvetica'),
- ('--footer-font-name', 'Helvetica'),
- ('--header-font-size', '10'),
- ('--footer-font-size', '6'),
- ('--header-left', header_report_name),
- ('--header-spacing', '2'),
- ('--footer-left', footer_date_time),
- ('--footer-right', ' '.join((_('Page'), '[page]', _('of'), '[topage]'))),
- ('--footer-line',),
- ],
- })
-
- def is_open(self,cr, uid, account_move_line):
- move_line_obj = self.pool.get('account.move.line').browse(cr,uid,account_move_line['id'])
-
- if move_line_obj.reconcile_id.id == False:
- return True
- else:
- return False
-
-HeaderFooterTextWebKitParser('report.account_financial_report_webkit.account.account_report_open_invoices_webkit',
- 'account.account',
- 'addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_open_invoices.mako',
- parser=l10n_cr_PartnersOpenInvoicesWebkit)
=== modified file 'TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_partner_balance.py'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_partner_balance.py 2012-06-13 20:01:31 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_partner_balance.py 2013-08-20 07:28:14 +0000
@@ -41,13 +41,13 @@
})
- def get_partners_by_curr(self, cr, uid, partner):
+ def get_partners_by_curr(self, cr, uid, partner, account_type):
currency_names_list = []
partners_curr_list = []
partners_by_curr = []
obj_move = self.pool.get('account.move.line')
- obj_search = obj_move.search(cr, uid, [('partner_id','=',partner.id),'&',('reconcile_id','=',False),'|',('account_id.type','=','payable'),('account_id.type','=','receivable')])
+ obj_search = obj_move.search(cr, uid, [('partner_id','=',partner.id),('reconcile_id','=',False),('account_id.type','=', account_type)])
move_lines = obj_move.browse(cr, uid, obj_search)
for move_line in move_lines:
=== removed file 'TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_partners_ledger.py'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_partners_ledger.py 2012-07-20 16:00:33 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/report/l10n_cr_partners_ledger.py 1970-01-01 00:00:00 +0000
@@ -1,183 +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 pooler
-
-from collections import defaultdict
-from report import report_sxw
-from osv import osv
-from tools.translate import _
-from datetime import datetime
-
-from openerp.addons.account_financial_report_webkit.report.partners_ledger import PartnersLedgerWebkit
-from openerp.addons.account_financial_report_webkit.report.webkit_parser_header_fix import HeaderFooterTextWebKitParser
-
-class l10n_cr_PartnersLedgerWebkit(PartnersLedgerWebkit):
-
- def __init__(self, cursor, uid, name, context):
- super(l10n_cr_PartnersLedgerWebkit, self).__init__(cursor, uid, name, context=context)
- self.pool = pooler.get_pool(self.cr.dbname)
- self.cursor = self.cr
-
- self.localcontext.update({
- 'get_amount': self.get_amount,
- 'get_partner_name': self.get_partner_name,
- 'get_accounts_by_curr': self.get_accounts_by_curr,
- 'get_currency_symbol': self.get_currency_symbol,
- 'get_initial_balance': self.get_initial_balance,
- })
-
- def get_accounts_by_curr(self, cr, uid, objects):
- currency_names_list = []
- accounts_curr_list = []
- accounts_by_curr = []
-
- for account in objects:
- currency_name = account.report_currency_id.name
- if currency_name not in currency_names_list:
- currency_names_list.append(currency_name)
-
- for currency_name in currency_names_list:
- account_by_curr = []
- for account in objects:
- if account.report_currency_id.name == currency_name:
- account_by_curr.append(account)
- accounts_curr_list.append(account_by_curr)
-
- i = 0
- for currency_name in currency_names_list:
- temp_tup = (currency_name, accounts_curr_list[i])
- accounts_by_curr.append(temp_tup)
- i += 1
-
- return accounts_by_curr
-
- 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'])
-
- obj_invoice = self.pool.get('account.invoice')
- invoice_search = obj_invoice.search(cr,uid,[('move_id','=',account_move_line['move_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'])])
-
- 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 != 'CRC':
- 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)
- # Manual Move
- else:
- res = ('manual', 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_partner_name(self,cr,uid,partner_name, p_id, p_ref, p_name):
-
- res = ''
- if p_ref != None and p_name != None:
- res = res+p_ref+' '+p_name
- else:
- res = partner_name
-
-
- return res
-
- def get_currency_symbol(self, cr, uid, currency_name, context=None):
- currency_obj = self.pool.get('res.currency')
-
- currency_id = currency_obj.search(cr, uid, [('name', '=', currency_name)], context=context)[0]
- currency = currency_obj.browse(cr, uid, currency_id)
-
- return currency.symbol
-
- def get_initial_balance(self, cr, uid, partner, account, filter_type, filter_data, fiscal_year, currency, context=None):
- date_start = ''
- initial_balance = 0.0
-
- if filter_type == '':
- date_start = fiscal_year.date_start
- move_lines_id = self.pool.get('account.move.line').search(cr, uid, [('account_id', '=', account.id), ('partner_id', '=', partner), ('period_id.fiscalyear_id.date_start', '<', date_start), ('reconcile_id', '=', False)], context=context)
- else:
- if filter_type == 'filter_period':
- date_start = filter_data[0].date_start
- move_lines_id = self.pool.get('account.move.line').search(cr, uid, [('account_id', '=', account.id), ('partner_id', '=', partner), ('period_id.date_start', '<', date_start), ('reconcile_id', '=', False)], context=context)
- elif filter_type == 'filter_date':
- date_start = filter_data[0]
- move_lines_id = self.pool.get('account.move.line').search(cr, uid, [('account_id', '=', account.id), ('partner_id', '=', partner), ('date', '<', date_start), ('reconcile_id', '=', False)], context=context)
-
- move_lines = self.pool.get('account.move.line').browse(cr, uid, move_lines_id)
-
- amount = 0.0
- for move_line in move_lines:
- if currency != 'CRC':
- amount = move_line.amount_currency
- else:
- if move_line.debit != 0.0 :
- amount = move_line.debit
- elif move_line.credit != 0.0 :
- amount = move_line.credit * -1
- initial_balance += amount
-
- return initial_balance
-
-HeaderFooterTextWebKitParser('report.account_financial_report_webkit.account.account_report_partners_ledger_webkit',
- 'account.account',
- 'addons/l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partners_ledger.mako',
- parser=l10n_cr_PartnersLedgerWebkit)
\ No newline at end of file
=== modified file 'TODO-7.0/l10n_cr_account_financial_report_webkit/report/report.xml'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/report/report.xml 2013-02-06 22:22:56 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/report/report.xml 2013-08-20 07:28:14 +0000
@@ -1,39 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
-
- <!-- we do not use report tag has we can not set header ref -->
- <record id="account_financial_report_webkit.account_report_partners_ledger_webkit" model="ir.actions.report.xml">
- <field name="report_type">webkit</field>
- <field name="report_name">account_financial_report_webkit.account.account_report_partners_ledger_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">Partner Ledger Webkit</field>
- <field name="report_rml">l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partners_ledger.mako</field>
- <field name="report_file">l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partners_ledger.mako</field>
- <field name="webkit_header" ref="financial_landscape_header"/>
- </record>
-
-
- <record id="account_financial_report_webkit.account_report_open_invoices_webkit" model="ir.actions.report.xml">
- <field name="report_type">webkit</field>
- <field name="report_name">account_financial_report_webkit.account.account_report_open_invoices_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">Open Invoices Report</field>
- <field name="report_rml">l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_open_invoices.mako</field>
- <field name="report_file">l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_open_invoices.mako</field>
- <field name="webkit_header" ref="financial_landscape_header"/>
- </record>
-
+
<report auto="False" id="l10n_cr_partner_balance" model="res.partner"
name="l10n.cr.partner.balance.layout_ccorp" file="l10n_cr_account_financial_report_webkit/report/l10n_cr_account_report_partner_balance.mako" string="Statement of Account" report_type="webkit"/>
=== modified file 'TODO-7.0/l10n_cr_account_financial_report_webkit/report_menus.xml'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/report_menus.xml 2013-01-22 19:54:28 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/report_menus.xml 2013-08-20 07:28:14 +0000
@@ -2,15 +2,6 @@
<openerp>
<data>
- <!-- TODO
- <menuitem icon="STOCK_PRINT" name="Partner Ledger"
- parent="account.next_id_22" action="action_account_partners_ledger_menu_webkit"
- groups="account.group_account_manager,account.group_account_user" id="account.menu_account_partner_ledger"/> -->
-
- <menuitem icon="STOCK_PRINT" name="Open Invoices"
- parent="account.next_id_22" action="action_account_open_invoices_menu_webkit"
- groups="account.group_account_manager,account.group_account_user" id="account_financial_report_webkit.menu_account_open_invoices"/>
-
<menuitem icon="STOCK_PRINT" name="Account Bank Balances"
parent="account.final_accounting_reports" action="action_account_balances_menu_webkit"
groups="account.group_account_manager,account.group_account_user" id="account_financial_report_webkit.menu_Account_Balances_report"/>
=== modified file 'TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/__init__.py'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/__init__.py 2012-07-20 16:00:33 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/__init__.py 2013-08-20 07:28:14 +0000
@@ -20,8 +20,5 @@
#
##############################################################################
-
-import partners_ledger_wizard
-import open_invoices_wizard
import account_bank_balances_wizard
import l10n_cr_account_financial_report_wizard
=== removed file 'TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/l10n_cr_open_invoices_wizard_view.xml'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/l10n_cr_open_invoices_wizard_view.xml 2012-06-22 20:40:49 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/l10n_cr_open_invoices_wizard_view.xml 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
-
- <record id="l10n_cr_account_open_invoices_view_webkit" model="ir.ui.view">
- <field name="name">Open Invoices Report</field>
- <field name="model">open.invoices.webkit</field>
- <field name="type">form</field>
- <field name="inherit_id" ref="account_financial_report_webkit.account_open_invoices_view_webkit"/>
- <field name="arch" type="xml">
- <data>
- <page string="Layout Options" name="layout_options" position = "replace">
- <field name="amount_currency" invisible = "True"/>
- <field name="group_by_currency" invisible = "True"/>
- </page>
- </data>
- </field>
- </record>
-
- <record id="action_account_open_invoices_menu_webkit" model="ir.actions.act_window">
- <field name="name">Open Invoices Report</field>
- <field name="type">ir.actions.act_window</field>
- <field name="res_model">open.invoices.webkit</field>
- <field name="view_type">form</field>
- <field name="view_mode">form</field>
- <field name="view_id" ref="l10n_cr_account_open_invoices_view_webkit"/>
- <field name="target">new</field>
- </record>
-
- </data>
-</openerp>
=== removed file 'TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/l10n_cr_partners_ledger_wizard_view.xml'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/l10n_cr_partners_ledger_wizard_view.xml 2012-06-22 20:40:49 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/l10n_cr_partners_ledger_wizard_view.xml 1970-01-01 00:00:00 +0000
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<openerp>
- <data>
-
- <record id="l10n_cr_account_partner_ledger_view_webkit" model="ir.ui.view">
- <field name="name">Partner Ledger</field>
- <field name="model">partners.ledger.webkit</field>
- <field name="type">form</field>
- <field name="inherit_id" ref="account_financial_report_webkit.account_partner_ledger_view_webkit"/>
- <field name="arch" type="xml">
- <data>
- <page string="Layout Options" name="layout_options" position = "replace">
- <field name="amount_currency" invisible = "True"/>
- </page>
- </data>
- </field>
- </record>
-
- <record id="action_account_partners_ledger_menu_webkit" model="ir.actions.act_window">
- <field name="name">Partner Ledger</field>
- <field name="type">ir.actions.act_window</field>
- <field name="res_model">partners.ledger.webkit</field>
- <field name="view_type">form</field>
- <field name="view_mode">form</field>
- <field name="view_id" ref="l10n_cr_account_partner_ledger_view_webkit"/>
- <field name="target">new</field>
- </record>
-
- </data>
-</openerp>
=== removed file 'TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/open_invoices_wizard.py'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/open_invoices_wizard.py 2012-07-09 21:54:26 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/open_invoices_wizard.py 1970-01-01 00:00:00 +0000
@@ -1,52 +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/>.
-#
-##############################################################################
-
-from osv import fields, osv
-
-
-class l10n_cr_AccountReportOpenInvoicesWizard(osv.osv_memory):
- """Will launch partner ledger report and pass required args"""
-
- _inherit = "open.invoices.webkit"
- _name = "open.invoices.webkit"
- _description = "Open Invoices Report"
-
-
- def pre_print_report(self, cr, uid, ids, data, context=None):
- data = super(l10n_cr_AccountReportOpenInvoicesWizard, self).pre_print_report(cr, uid, ids, data, context)
- if context is None:
- context = {}
- vals = self.read(cr, uid, ids,
- ['until_date',],
- 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_open_invoices_webkit',
- 'datas': data}
-
=== removed file 'TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/partners_ledger_wizard.py'
--- TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/partners_ledger_wizard.py 2012-06-05 20:10:55 +0000
+++ TODO-7.0/l10n_cr_account_financial_report_webkit/wizard/partners_ledger_wizard.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/>.
-#
-##############################################################################
-
-import time
-
-from osv import fields, osv
-
-
-class l10n_cr_AccountReportPartnersLedgerWizard(osv.osv_memory):
- """Will launch partner ledger report and pass required args"""
-
- _inherit = "partners.ledger.webkit"
- _name = "partners.ledger.webkit"
- _description = "Partner Ledger Report"
-
-
- 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_partners_ledger_webkit',
- 'datas': data}
-
=== modified file 'TODO-7.0/l10n_cr_account_financial_statements/i18n/es_CR.po'
--- TODO-7.0/l10n_cr_account_financial_statements/i18n/es_CR.po 2012-11-14 08:12:05 +0000
+++ TODO-7.0/l10n_cr_account_financial_statements/i18n/es_CR.po 2013-08-20 07:28:14 +0000
@@ -452,3 +452,11 @@
msgid "Compare By"
msgstr "Comparar por"
+
+#. module: account
+#: model:ir.ui.menu,name:account.menu_account_report_pl
+msgid "Profit And Loss"
+msgstr "Estado de Resultados"
+
+
+
=== modified file 'TODO-7.0/l10n_cr_account_financial_statements/report/profit_statement_report.mako'
--- TODO-7.0/l10n_cr_account_financial_statements/report/profit_statement_report.mako 2013-01-02 20:44:43 +0000
+++ TODO-7.0/l10n_cr_account_financial_statements/report/profit_statement_report.mako 2013-08-20 07:28:14 +0000
@@ -64,7 +64,7 @@
total_fiscalyear = income_total_fiscalyear + expense_total_fiscalyear
total_percentage_last_period = income_total_last_period != 0 and (100 * total_last_period / income_total_last_period) or 0
total_percentage_period = income_total_period != 0 and (100 * total_period / income_total_period) or 0
- total_percentage_variation = income_total_last_period != 0 and (100 * total_variation / total_last_period) or 0
+ total_percentage_variation = total_last_period != 0 and (100 * total_variation / total_last_period) or 0
total_percentage_fiscalyear = income_total_fiscalyear != 0 and (100 * total_fiscalyear / income_total_fiscalyear) or 0
%>
<% row_even = False %>
=== modified file 'TODO-7.0/l10n_cr_account_financial_statements/report/profit_statement_report.py'
--- TODO-7.0/l10n_cr_account_financial_statements/report/profit_statement_report.py 2012-11-14 05:24:25 +0000
+++ TODO-7.0/l10n_cr_account_financial_statements/report/profit_statement_report.py 2013-08-20 07:28:14 +0000
@@ -104,6 +104,7 @@
period = account_period_obj.browse(cr, uid, self._get_form_param('period_from', data))
last_period = self.get_last_period(cr, uid, period)
fiscal_year = self.get_fiscalyear(cr, uid, period)
+ filter_type = self._get_filter(data)
#build account_ids list
income_account_ids = library_obj.get_account_child_ids(cr, uid, category_account_ids['income'])
@@ -114,12 +115,12 @@
expense_accounts = account_account_obj.browse(cr, uid, expense_account_ids)
#build balances
- income_period_balances = library_obj.get_account_balance(cr, uid, income_account_ids, ['balance'], start_period_id=period.id, end_period_id=period.id)
- expense_period_balances = library_obj.get_account_balance(cr, uid, expense_account_ids, ['balance'], start_period_id=period.id, end_period_id=period.id)
- income_last_period_balances = library_obj.get_account_balance(cr, uid, income_account_ids, ['balance'], start_period_id=last_period.id, end_period_id=last_period.id)
- expense_last_period_balances = library_obj.get_account_balance(cr, uid, expense_account_ids, ['balance'], start_period_id=last_period.id, end_period_id=last_period.id)
- income_fiscal_year_balances = library_obj.get_account_balance(cr, uid, income_account_ids, ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id)
- expense_fiscal_year_balances = library_obj.get_account_balance(cr, uid, expense_account_ids, ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id)
+ income_period_balances = library_obj.get_account_balance(cr, uid, income_account_ids, ['balance'], start_period_id=period.id, end_period_id=period.id,filter_type=filter_type)
+ expense_period_balances = library_obj.get_account_balance(cr, uid, expense_account_ids, ['balance'], start_period_id=period.id, end_period_id=period.id,filter_type=filter_type)
+ income_last_period_balances = library_obj.get_account_balance(cr, uid, income_account_ids, ['balance'], start_period_id=last_period.id, end_period_id=last_period.id,filter_type=filter_type)
+ expense_last_period_balances = library_obj.get_account_balance(cr, uid, expense_account_ids, ['balance'], start_period_id=last_period.id, end_period_id=last_period.id,filter_type=filter_type)
+ income_fiscal_year_balances = library_obj.get_account_balance(cr, uid, income_account_ids, ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id,filter_type=filter_type)
+ expense_fiscal_year_balances = library_obj.get_account_balance(cr, uid, expense_account_ids, ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id, filter_type=filter_type)
#build total balances
total_income_balances = {
=== modified file 'TODO-7.0/l10n_cr_account_financial_statements/report/situation_balance_report.py'
--- TODO-7.0/l10n_cr_account_financial_statements/report/situation_balance_report.py 2012-11-14 08:22:28 +0000
+++ TODO-7.0/l10n_cr_account_financial_statements/report/situation_balance_report.py 2013-08-20 07:28:14 +0000
@@ -117,6 +117,7 @@
period = account_period_obj.browse(cr, uid, self._get_form_param('period_from', data))
fiscal_year = self.get_fiscalyear(cr, uid, period)
opening_period = self.get_opening_period(cr, uid, period)
+ filter_type = self._get_filter(data)
#build account_ids list
asset_account_ids = library_obj.get_account_child_ids(cr, uid, category_account_ids['asset'])
@@ -133,17 +134,17 @@
expense_account = category_account_ids['expense']
#build balances
- asset_period_balances = library_obj.get_account_balance(cr, uid, asset_account_ids, ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id)
- liability_period_balances = library_obj.get_account_balance(cr, uid, liability_account_ids, ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id)
- equity_period_balances = library_obj.get_account_balance(cr, uid, equity_account_ids, ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id)
- income_period_balance = library_obj.get_account_balance(cr, uid, [income_account_id], ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id)
- expense_period_balance = library_obj.get_account_balance(cr, uid, [expense_account_id], ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id)
+ asset_period_balances = library_obj.get_account_balance(cr, uid, asset_account_ids, ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id,filter_type=filter_type)
+ liability_period_balances = library_obj.get_account_balance(cr, uid, liability_account_ids, ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id, filter_type=filter_type)
+ equity_period_balances = library_obj.get_account_balance(cr, uid, equity_account_ids, ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id, filter_type=filter_type)
+ income_period_balance = library_obj.get_account_balance(cr, uid, [income_account_id], ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id, filter_type=filter_type)
+ expense_period_balance = library_obj.get_account_balance(cr, uid, [expense_account_id], ['balance'], end_period_id=period.id, fiscal_year_id=fiscal_year.id,filter_type=filter_type)
- asset_fiscal_year_balances = library_obj.get_account_balance(cr, uid, asset_account_ids, ['balance'], start_period_id=opening_period.id, end_period_id=opening_period.id)
- liability_fiscal_year_balances = library_obj.get_account_balance(cr, uid, liability_account_ids, ['balance'], start_period_id=opening_period.id, end_period_id=opening_period.id)
- equity_fiscal_year_balances = library_obj.get_account_balance(cr, uid, equity_account_ids, ['balance'], start_period_id=opening_period.id, end_period_id=opening_period.id)
- income_fiscal_year_balance = library_obj.get_account_balance(cr, uid, [income_account_id], ['balance'], start_period_id=opening_period.id, end_period_id=opening_period.id)
- expense_fiscal_year_balance = library_obj.get_account_balance(cr, uid, [expense_account_id], ['balance'], start_period_id=opening_period.id, end_period_id=opening_period.id)
+ asset_fiscal_year_balances = library_obj.get_account_balance(cr, uid, asset_account_ids, ['balance'], start_period_id=opening_period.id, end_period_id=opening_period.id,filter_type=filter_type)
+ liability_fiscal_year_balances = library_obj.get_account_balance(cr, uid, liability_account_ids, ['balance'], start_period_id=opening_period.id, end_period_id=opening_period.id,filter_type=filter_type)
+ equity_fiscal_year_balances = library_obj.get_account_balance(cr, uid, equity_account_ids, ['balance'], start_period_id=opening_period.id, end_period_id=opening_period.id,filter_type=filter_type)
+ income_fiscal_year_balance = library_obj.get_account_balance(cr, uid, [income_account_id], ['balance'], start_period_id=opening_period.id, end_period_id=opening_period.id,filter_type=filter_type)
+ expense_fiscal_year_balance = library_obj.get_account_balance(cr, uid, [expense_account_id], ['balance'], start_period_id=opening_period.id, end_period_id=opening_period.id,filter_type=filter_type)
=== modified file 'TODO-7.0/l10n_cr_account_financial_statements/report_menus.xml'
--- TODO-7.0/l10n_cr_account_financial_statements/report_menus.xml 2012-11-13 22:28:19 +0000
+++ TODO-7.0/l10n_cr_account_financial_statements/report_menus.xml 2013-08-20 07:28:14 +0000
@@ -2,13 +2,13 @@
<openerp>
<data>
- <menuitem icon="STOCK_PRINT" name="Profit Statement Report"
+ <menuitem icon="STOCK_PRINT" name="Profit And Loss"
parent="account.final_accounting_reports" action="action_profit_statement_report_menu_webkit"
- id="menu_profit_statement_report"/>
+ id="account.menu_account_report_pl"/>
<menuitem icon="STOCK_PRINT" name="Situation Balance Report"
parent="account.final_accounting_reports" action="action_situation_balance_report_menu_webkit"
- id="menu_situation_balance_report"/>
+ id="account.menu_account_report_bs"/>
</data>
</openerp>
=== removed directory 'TODO-7.0/l10n_cr_accounting_report_library'
=== modified file 'TODO-7.0/l10n_cr_base/i18n/es.po'
--- TODO-7.0/l10n_cr_base/i18n/es.po 2013-03-05 05:26:24 +0000
+++ TODO-7.0/l10n_cr_base/i18n/es.po 2013-08-20 07:28:14 +0000
@@ -14,8 +14,8 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2013-03-05 05:26+0000\n"
-"X-Generator: Launchpad (build 16514)\n"
+"X-Launchpad-Export-Date: 2013-08-06 05:01+0000\n"
+"X-Generator: Launchpad (build 16718)\n"
#. module: l10n_cr_base
#: model:res.partner.title,name:l10n_cr_base.res_partner_title_ing
=== added directory 'l10n_cr_account_banking_cr_bncr'
=== added file 'l10n_cr_account_banking_cr_bncr/__init__.py'
--- l10n_cr_account_banking_cr_bncr/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_banking_cr_bncr/__init__.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,24 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 credativ Ltd (<http://www.credativ.co.uk>).
+# All Rights Reserved
+#
+# 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 bncr_format
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'l10n_cr_account_banking_cr_bncr/__openerp__.py'
--- l10n_cr_account_banking_cr_bncr/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_banking_cr_bncr/__openerp__.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,37 @@
+# -*- 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': 'National Bank Account Banking',
+ 'version': '0.5',
+ 'license': 'AGPL-3',
+ 'author': 'CLEARCORP S.A.',
+ 'website': 'http://www.clearcorp.co.cr',
+ 'category': 'Account Banking',
+ 'depends': ['account_banking','account_parser_type',],
+ 'init_xml': [],
+ 'update_xml': [],
+ 'demo_xml': [],
+ 'description': '',
+ 'active': False,
+ 'installable': True,
+}
=== added file 'l10n_cr_account_banking_cr_bncr/bncr_format.py'
--- l10n_cr_account_banking_cr_bncr/bncr_format.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_banking_cr_bncr/bncr_format.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,189 @@
+# -*- 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 account_banking.parsers import models
+from tools.translate import _
+from bncr_parser import BNCRParser
+import re
+from osv import osv, fields
+import logging
+import pprint
+from datetime import datetime
+import base64
+
+bt = models.mem_bank_transaction
+logger = logging.getLogger( 'bncr_logger' )
+
+class transaction(models.mem_bank_transaction):
+
+ mapping = {
+ 'execution_date' : '',
+ 'effective_date' : '',
+ 'local_currency' : '',
+ 'transfer_type' : '',
+ 'reference' : '',
+ 'message' : '',
+ 'name' : '',
+ 'amount': '',
+ 'creditmarker': '',
+ }
+
+ def __init__(self, record, *args, **kwargs):
+
+ '''
+ Transaction creation
+ '''
+ #record is a dictionary, that is the reason to use iteritems().
+ super(transaction, self).__init__(*args, **kwargs)
+ for key, value in record.iteritems():
+ if record.has_key(key):
+ setattr(self, key, record[key])
+
+ if not self.is_valid():
+ logger.info("Invalid: %s", record)
+
+ def is_valid(self):
+ '''
+ We don't have remote_account so override base
+ '''
+ return (self.execution_date
+ and self.transferred_amount and True) or False
+
+class statement(models.mem_bank_statement):
+ '''
+ Bank statement imported data '''
+
+ def _transmission_number(self, record):
+ self.id = record['transref']
+
+ def _account_number(self, record):
+ self.local_account = record['account_number']
+ self.local_currency = record['currencycode']
+
+ def _statement_number(self, record):
+ self.id = record['id']
+
+ def _opening_balance(self, record):
+ self.start_balance = float(record['startingbalance'])
+
+ def _closing_balance(self, record):
+ self.end_balance = float(record['endingbalance'])
+ self.date = record['bookingdate']
+
+ def _transaction_new(self, record):
+ parser = BNCRParser()
+ sub_record = parser.statement_lines(record) #dictionary
+ for sub in sub_record:
+ self.transactions.append(transaction(sub))
+
+ def _not_used():
+ logger.info("Didn't use record: %s", record)
+
+ def _forward_available(self, record):
+ self.end_balance = float(record['endingbalance'])
+ self.date = record['bookingdate']
+
+ def _execution_date_transferred_amount (self, record):
+ self.execution_date = record['bookingdate']
+ self.transferred_amount = float(record['ammount'])
+
+ def transaction_info(self, record):
+ '''
+ Add extra information to transaction
+ '''
+ # Additional information for previous transaction
+ if len(self.transactions) < 1:
+ logger.info("Received additional information for non existent transaction:")
+ logger.info(record)
+ else:
+ transaction = self.transactions[-1]
+ transaction.id = ','.join([record[k] for k in ['infoline{0}'.format(i) for i in range(2,5)] if record.has_key(k)])
+
+def raise_error(message, line):
+ raise osv.osv.except_osv(_('Import error'),
+ 'Error in import:%s\n\n%s' % (message, line))
+
+class parser_bncr( models.parser ):
+
+ '''
+ This adds a new parser in the selection options.
+ When the account is associated to a parser, the following code makes it appear as an option
+ '''
+ code = 'BNCR-Parser'
+ name = _( 'BNCR Bank statement import' )
+ country_code = 'CR'
+ doc = _('''\
+ This format is available through
+ the National Bank web interface.
+ ''')
+
+ '''
+ ** Kwargs parameter is used for a dynamic list of parameters.
+ The wizard imported extracts used in all parsers and not all parsers have all the necessary information in your file,
+ so get information from the wizard and passed by the ** kwargs.
+ Then in the parses that are needed, are extracted from the ** kwargs and if needed,
+ the parser still works the same way without this parameter.
+
+ The rest of the methods must receive this parameter. (As the method that parse the header and the lines).
+
+ If you need a new parameter, you specify its name and value, using the ** kwargs is a dictionary,
+ extract its value, with the respective key
+ '''
+
+ def parse(self, cr, statements_file, **kwargs):
+ result = []
+ parser = BNCRParser()
+ stmnt = statement()
+
+ """
+ **kwargs have all the parameters that have the wizard and
+ has all the parameters passed from the wizard before calling
+ the method that parses the file.
+ """
+ #try:
+ #pass to encoding with the correct type of file.
+ data = base64.decodestring(statements_file)
+
+ records = parser.parse_stamenent_record(data,**kwargs)
+
+ stmnt._transmission_number(records)
+ stmnt._account_number(records)
+ stmnt._statement_number(records)
+ stmnt._opening_balance(records)
+ stmnt._closing_balance(records)
+ stmnt._forward_available(records)
+ stmnt._execution_date_transferred_amount (records)
+ stmnt._transaction_new(data)#call the method statement_lines in parser to parse all the lines in file and add to stament.
+
+ '''
+ A stament must have a header and transacctions. The method parse_stamenent_record parse the header and the
+ method _transaction_new parse all the line (transactions) in the file.
+ '''
+ if stmnt.is_valid():
+ result.append(stmnt)
+
+ return result
+ '''
+ except:
+ raise osv.except_osv(_('Error'), _('The file have a invalid extension for this parser.\nThe valid extension are .txt or .csv'))
+ '''
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'l10n_cr_account_banking_cr_bncr/bncr_parser.py'
--- l10n_cr_account_banking_cr_bncr/bncr_parser.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_banking_cr_bncr/bncr_parser.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,274 @@
+# -*- 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/>.
+#
+##############################################################################
+"""
+Parser for Davivienda format files
+"""
+import re
+from datetime import datetime
+from dateutil import parser
+from pprint import PrettyPrinter
+from copy import copy
+
+class BNCRParser( object ):
+
+ #Define the header for the extract to import.
+ '''
+ ** Kwargs parameter is used for a dynamic list of parameters.
+ The wizard imported extracts used in all parsers and not all parsers have all the necessary information in your file,
+ so get information from the wizard and passed by the ** kwargs.
+ Then in the parses that are needed, are extracted from the ** kwargs and if needed,
+ the parser still works the same way without this parameter.
+
+ The rest of the methods must receive this parameter. (As the method that parse the header and the lines).
+
+ If you need a new parameter, you specify its name and value, using the ** kwargs is a dictionary,
+ extract its value, with the respective key
+ '''
+ def statement_record ( self, rec, **kwargs):
+ lines = []
+ line_dict = {}
+ startingbalance = 0.0
+
+ line_dict = {
+ 'transref': '', # _transmission_number
+ 'account_number': '', #_account_number
+ 'statementnr':'', # statement_number
+ 'startingbalance': 0.0, #_opening_balance
+ 'currencycode': '', #currencycode
+ 'endingbalance': 0.0, #_closing_balance
+ 'bookingdate': '', #moving_date
+ 'ammount': 0.0,
+ 'id': '',
+ }
+ #Split the file in statements
+ list_split = rec.split('\n')
+
+ #currency_code (local_currency in the stament) extracted from account_number object from the wizard.
+ #account_number (local_account) extracted from account_number object from the wizard.
+ #date_to_str and date_from_str are the dates in wizard, both are strings
+
+ line_dict['account_number'] = kwargs['account_number']
+
+ line_dict['currencycode'] = kwargs['local_currency']
+
+ line_dict['statementnr'] = kwargs['date_from_str'] + ' - '+ kwargs['date_to_str'] + ' Extracto BNCR ' + line_dict['account_number'] #Interval time of the file.
+
+ #transmission_number (Date when done the import)
+ date_obj= datetime.now()
+ line_dict['transref'] = date_obj.strftime("%d-%m-%Y %H:%M:%S")
+ #bookingdate
+ line_dict['bookingdate'] = date_obj.strftime("%d-%m-%Y %H:%M:%S")
+
+ '''
+ For the BNCR parser, the ending_balance comes from wizard. With total of debit and credit and the ending_balance
+ compute the initial_balance.
+ '''
+ #extract the total of debit and credit from the file. The last statements and compute the startingbalance
+ last_position = (len(list_split) - 1)
+ last_line = list_split[last_position]
+ #last line can be blanck, find the last line with data.
+ if last_line == "":
+ while True:
+ last_position -= 1
+ last_line = list_split[last_position]
+ if last_line is not "":
+ break
+
+ last_line_split = last_line.split(';')
+
+ #For another type of format, take the character \t
+ if len(last_line_split) > 1:
+ final_line_totals = last_line_split
+ else:
+ final_line_totals = last_line.split('\t')
+
+ #######################################################
+
+ if final_line_totals[3] != '':
+ debit = float(final_line_totals[3].replace(",",""))
+ else:
+ debit = 0.0
+ if final_line_totals[4] != '':
+ credit = float(final_line_totals[4].replace(",",""))
+ else:
+ credit = 0.0
+
+ startingbalance = float(kwargs['ending_balance']) + debit - credit
+ line_dict['startingbalance'] = str(startingbalance)
+
+ #the ending_balance extracted from **kwargs (comes from wizard)
+ endingbalance = float(kwargs['ending_balance'])
+ line_dict['endingbalance'] = str(kwargs['ending_balance'])
+
+ line_dict['ammount'] = startingbalance + endingbalance
+ line_dict['id'] = kwargs['date_from_str'] + ' - '+ kwargs['date_to_str'] + ' Extracto BNCR ' + line_dict['account_number']
+
+ return line_dict
+
+ '''
+ Parse all the lines in the file. Once the header is parser, the next step are the lines.
+ '''
+ def statement_lines ( self, rec ):
+ parser = BNCRParser()
+ mapping = {
+ 'execution_date' : '',
+ 'effective_date' : '',
+ 'transfer_type' : '',
+ 'reference' : '',
+ 'message' : '',
+ 'name' : '',
+ 'transferred_amount': '',
+ 'creditmarker': '',
+ }
+
+ lines = []
+ line_dict = {}
+ currencycode = ''
+
+ list_split = rec.split('\n')
+ entrada = False
+
+ start = 1
+ end = (len(list_split) - 1)
+ last_line = list_split[end]
+ #last line can be blanck, find the last line with data.
+ if last_line == "":
+ while True:
+ end -= 1
+ last_line = list_split[end]
+ if last_line is not "":
+ break
+
+ sub_list = list_split [start:end] #The end line is amount totals of credit and debit
+ for sub in sub_list:
+ line = sub.split(';')
+ if len(line) > 1:
+ final_line = line
+ #For another type of format, take the character \t
+ else:
+ final_line = sub.split('\t')
+
+ #effective_date
+ date_str = final_line[1].replace("/","-")
+ date= datetime.strptime(date_str, "%Y-%m-%d")
+ mapping['effective_date'] = date #fecha_contable.
+ #execution_date
+ mapping['execution_date'] = date #fecha_movimiento
+
+ mapping['transfer_type'] = 'NTRF'
+ mapping['reference'] = final_line[2] #NumDocumento
+ mapping['message'] = final_line[2]+' '+final_line[5] #NumDocumento + Description
+ mapping['name'] = final_line[2]+' '+final_line[5] #NumDocumento + Description
+ mapping['id'] = final_line[2]+' '+final_line[5] #NumDocumento + Description
+
+ #the field in position 3 is debit, the position 4 is credit
+ if final_line[4] != '':
+ credit = float(final_line[4].replace(",",""))
+ mapping['transferred_amount'] = credit
+ mapping['creditmarker'] = 'C'
+
+ elif final_line[3] != '':
+ #In this case, the debit is negative.
+ debit = float(final_line[3].replace(",",""))
+ mapping['transferred_amount'] = -1 * debit
+
+ lines.append(copy(mapping))
+
+ return lines
+
+ """
+ ** Kwargs parameter is used for a dynamic list of parameters.
+ The wizard imported extracts used in all parsers and not all parsers have all the necessary information in your file,
+ so get information from the wizard and passed by the ** kwargs.
+ Then in the parses that are needed, are extracted from the ** kwargs and if needed,
+ the parser still works the same way without this parameter.
+
+ The rest of the methods must receive this parameter. (As the method that parse the header and the lines).
+
+ If you need a new parameter, you specify its name and value, using the ** kwargs is a dictionary,
+ extract its value, with the respective key
+ """
+ def parse_stamenent_record( self, rec, **kwargs):
+
+ matchdict = dict()
+
+ #Set the header for the stament.
+ matchdict = self.statement_record(rec, **kwargs);
+
+ # Remove members set to None
+ matchdict = dict( [( k, v ) for k, v in matchdict.iteritems() if v] )
+
+ matchkeys = set( matchdict.keys() )
+ needstrip = set( [ 'transref', 'account_number', 'statementnr', 'currencycode', 'endingbalance', 'bookingdate'] )
+
+ for field in matchkeys & needstrip:
+ matchdict[field] = matchdict[field].strip()
+
+ # Convert to float. Comma is decimal separator
+ needsfloat = set( ["startingbalance", "endingbalance", "amount"] )
+ for field in matchkeys & needsfloat:
+ matchdict[field] = float( matchdict[field].replace( ',', '.' ) )
+
+ # Convert date fields
+ needdate = set( ["bookingdate"] )
+
+ for field in matchkeys & needdate:
+ datestring = matchdict[field]
+ date_obj= datetime.strptime(datestring, "%d-%m-%Y %H:%M:%S")
+ matchdict[field] = date_obj
+
+ return matchdict
+
+ def parse( self, cr, data ):
+ records = []
+ # Some records are multiline
+ for line in data:
+ if len(line) <= 1:
+ continue
+ if line[0] == ':' and len(line) > 1:
+ records.append(line)
+ else:
+ records[-1] = '\n'.join([records[-1], line])
+
+ output = []
+
+ for rec in records:
+ #parse_stament_record call the method that parse the header and the stament of the file.
+ output.append(self.parse_stamenent_record( rec ))
+
+ return output
+
+def parse_file( filename ):
+ bncrfile = open( filename, "r" )
+ p = BNCRParser().parse( bncrfile.readlines() )
+
+
+def main():
+ """The main function, currently just calls a dummy filename
+
+ :returns: description
+ """
+ parse_file("testfile")
+
+if __name__ == '__main__':
+ main()
+
=== modified file 'l10n_cr_account_banking_cr_davivienda/__init__.py' (properties changed: +x to -x)
=== modified file 'l10n_cr_account_banking_cr_davivienda/__openerp__.py' (properties changed: +x to -x)
--- l10n_cr_account_banking_cr_davivienda/__openerp__.py 2013-02-22 22:35:48 +0000
+++ l10n_cr_account_banking_cr_davivienda/__openerp__.py 2013-08-20 07:28:14 +0000
@@ -27,7 +27,7 @@
'author': 'CLEARCORP S.A.',
'website': 'http://www.clearcorp.co.cr',
'category': 'Account Banking',
- 'depends': ['account_banking'],
+ 'depends': ['account_banking','account_parser_type'],
'init_xml': [],
'update_xml': [],
'demo_xml': [],
=== modified file 'l10n_cr_account_banking_cr_davivienda/davivienda_format.py' (properties changed: +x to -x)
--- l10n_cr_account_banking_cr_davivienda/davivienda_format.py 2013-02-22 22:35:48 +0000
+++ l10n_cr_account_banking_cr_davivienda/davivienda_format.py 2013-08-20 07:28:14 +0000
@@ -24,10 +24,11 @@
from tools.translate import _
from davivienda_parser import DaviviendaParser
import re
-import osv
+from osv import osv, fields
import logging
import pprint
from datetime import datetime
+import base64
bt = models.mem_bank_transaction
logger = logging.getLogger( 'davivienda_logger' )
@@ -76,6 +77,7 @@
def _account_number(self, record):
self.local_account = record['account_number']
+ self.local_currency = record['currencycode']
def _statement_number(self, record):
self.id = record['id']
@@ -102,7 +104,7 @@
def _execution_date_transferred_amount (self, record):
self.execution_date = record['bookingdate']
- self.transferred_amount = float(record['ammount'])
+ self.transferred_amount = float(record['amount'])
def transaction_info(self, record):
'''
@@ -133,7 +135,8 @@
This format is available through
the Davivienda web interface.
''')
- '''
+
+ '''
** Kwargs parameter is used for a dynamic list of parameters.
The wizard imported extracts used in all parsers and not all parsers have all the necessary information in your file,
so get information from the wizard and passed by the ** kwargs.
@@ -146,12 +149,19 @@
extract its value, with the respective key
'''
- def parse(self, cr, data, **kwargs):
+ def parse(self, cr, statements_file, **kwargs):
result = []
parser = DaviviendaParser()
stmnt = statement()
+ """
+ **kwargs have all the parameters that have the wizard and
+ has all the parameters passed from the wizard before calling
+ the method that parses the file.
+ """
+ #pass to encoding with the correct type of file.
+ data = base64.decodestring(statements_file)
- #parse the data for the header of the stament.
+ #parse the data for the header of the stament.amount
records = parser.parse_stamenent_record(data, **kwargs)
stmnt._transmission_number(records)
@@ -171,5 +181,5 @@
result.append(stmnt)
return result
-
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'l10n_cr_account_banking_cr_davivienda/davivienda_parser.py'
--- l10n_cr_account_banking_cr_davivienda/davivienda_parser.py 2013-02-22 22:35:48 +0000
+++ l10n_cr_account_banking_cr_davivienda/davivienda_parser.py 2013-08-20 07:28:14 +0000
@@ -27,6 +27,8 @@
from dateutil import parser
from pprint import PrettyPrinter
from copy import copy
+from osv import osv, fields
+from tools.translate import _
class DaviviendaParser( object ):
@@ -55,53 +57,67 @@
'currencycode': '', #currencycode
'endingbalance': 0.0, #_closing_balance
'bookingdate': '', #moving_date
- 'ammount': 0.0,
+ 'amount': 0.0,
'id': '',
}
- #currency_code (local_currency in the stament) extracted from account_number object from the wizard.
- #account_number (local_account) extracted from account_number object from the wizard.
- #date_to_str and date_from_str are the dates in wizard, both are strings
- #the parameters come from davivienda_format in parser class.
- line_dict['account_number'] = kwargs['account_number']
-
- line_dict['currencycode'] = kwargs['local_currency']
-
- line_dict['statementnr'] = kwargs['date_from_str'] + ' - '+ kwargs['date_to_str'] + 'Extracto Davivienda ' + line_dict['account_number'] #Interval time of the file.
-
- startingbalance = endingbalance = 0.0
+ #Separe the file in statements
list_split = rec.split('\n')
-
- #transmission_number (Date when done the import)
- date_obj= datetime.now()
- line_dict['transref'] = date_obj.strftime("%d-%m-%Y %H:%M:%S")
- #bookingdate
- line_dict['bookingdate'] = date_obj.strftime("%d-%m-%Y %H:%M:%S")
-
- #with the first line compute the initial_balance
+ #Obtain the first line to know the account number
fist_line = list_split[1]
first_line_split = fist_line.split(';')
- startingbalance = float(first_line_split[5].replace(",","")) + float(first_line_split[3].replace(",","")) - float(first_line_split[4].replace(",",""))
- line_dict['startingbalance'] = str(startingbalance)
-
- #the ending_balance is the balance of the last line.
- last_position = (len(list_split) - 1)
- last_line = list_split[last_position]
- #last line can be blanck, find the last line with data.
- if last_line == "":
- while True:
- last_position -= 1
- last_line = list_split[last_position]
- if last_line is not "":
- break
- last_line_split = last_line.split(';')
- endingbalance += float(last_line_split[5].replace(",",""))
- line_dict['endingbalance'] = str(endingbalance)
-
- line_dict['ammount'] = startingbalance + endingbalance
- line_dict['id'] = kwargs['date_from_str'] + ' - '+ kwargs['date_to_str'] + ' Extracto Davivienda ' + line_dict['account_number']
-
- return line_dict
+
+ account_number_wizard = kwargs['account_number']#from wizard
+ account_number_file = first_line_split[11]#from file.
+
+ #if the account_number in the file match with the account selected in the wizard, return True
+ if account_number_file.find(account_number_wizard) > -1:
+ #currency_code (local_currency in the stament) extracted from account_number object from the wizard.
+ #account_number (local_account) extracted from account_number object from the wizard.
+ #date_to_str and date_from_str are the dates in wizard, both are strings
+ #the parameters come from davivienda_format in parser class.
+ line_dict['account_number'] = kwargs['account_number']
+
+ line_dict['currencycode'] = kwargs['local_currency']
+
+ line_dict['statementnr'] = kwargs['date_from_str'] + ' - '+ kwargs['date_to_str'] + 'Extracto Davivienda ' + line_dict['account_number'] #Interval time of the file.
+
+ startingbalance = endingbalance = 0.0
+
+ #transmission_number (Date when done the import)
+ date_obj= datetime.now()
+ line_dict['transref'] = date_obj.strftime("%d-%m-%Y %H:%M:%S")
+ #bookingdate
+ line_dict['bookingdate'] = date_obj.strftime("%d-%m-%Y %H:%M:%S")
+
+ #with the first line compute the initial_balance
+ fist_line = list_split[1]
+ first_line_split = fist_line.split(';')
+ startingbalance = float(first_line_split[5].replace(",","")) + float(first_line_split[3].replace(",","")) - float(first_line_split[4].replace(",",""))
+ line_dict['startingbalance'] = str(startingbalance)
+
+ #the ending_balance is the balance of the last line.
+ last_position = (len(list_split) - 1)
+ last_line = list_split[last_position]
+ #last line can be blanck, find the last line with data.
+ if last_line == "":
+ while True:
+ last_position -= 1
+ last_line = list_split[last_position]
+ if len(last_line) > 0 and last_line != "" and last_line != '\r':
+ break
+ last_line_split = last_line.split(';')
+ endingbalance += float(last_line_split[5].replace(",",""))
+ line_dict['endingbalance'] = str(endingbalance)
+
+ line_dict['amount'] = str(startingbalance + endingbalance)
+ line_dict['id'] = kwargs['date_from_str'] + ' - '+ kwargs['date_to_str'] + ' Extracto Davivienda ' + line_dict['account_number']
+
+ return line_dict
+
+ else:
+ raise osv.except_osv(_('Error'),
+ _('Error en la importación! La cuenta especificada en el archivo no coincide con la seleccionada en el asistente de importacion'))
'''
Parse all the lines in the file. Once the header is parser, the next step are the lines.
@@ -137,7 +153,7 @@
if last_line is not "":
break
- sub_list = list_split [start:end+1]
+ sub_list = list_split [start:end]
for sub in sub_list:
line = sub.split(';')
#effective_date
@@ -165,7 +181,17 @@
lines.append(copy(mapping))
- return lines
+ return lines
+
+ #clear special characters in a row.
+ def clean_special_characters(self, text_celd):
+ special_characters = {'\r':''}
+
+ for i, j in special_characters.iteritems():
+ text = text_celd.replace(i, j)
+
+ #remove all the blank space.
+ return re.sub(r'\s', '', text)
"""
** Kwargs parameter is used for a dynamic list of parameters.
@@ -179,7 +205,8 @@
If you need a new parameter, you specify its name and value, using the ** kwargs is a dictionary,
extract its value, with the respective key
"""
- def parse_stamenent_record( self, rec, **kwargs):
+
+ def parse_stamenent_record( self, rec, **kwargs): #parse the header.
matchdict = dict()
@@ -187,7 +214,7 @@
matchdict = self.statement_record(rec, **kwargs);
# Remove members set to None
- matchdict = dict( [( k, v ) for k, v in matchdict.iteritems() if v] )
+ #matchdict = dict( [( k, v ) for k, v in matchdict.iteritems() if v] )
matchkeys = set( matchdict.keys() )
needstrip = set( [ 'transref', 'account_number', 'statementnr', 'currencycode', 'endingbalance', 'bookingdate'] )
@@ -201,7 +228,7 @@
matchdict[field] = float( matchdict[field].replace( ',', '.' ) )
# Convert date fields
- needdate = set( ["bookingdate"] )
+ needdate = set( ["bookingdate", "effective_date", "execution_date"] )
for field in matchkeys & needdate:
datestring = matchdict[field]
@@ -209,7 +236,8 @@
matchdict[field] = date_obj
return matchdict
-
+
+ #call the method that parse the header and the statements.
def parse( self, cr, data ):
records = []
# Some records are multiline
@@ -224,23 +252,9 @@
output = []
for rec in records:
+ #parse_stamenent_record parse the header and the statements
output.append( self.parse_stamenent_record( rec ) )
return output
-def parse_file( filename ):
- daviviendafile = open( filename, "r" )
- p = DaviviendaParser().parse( daviviendafile.readlines() )
-
-
-def main():
- """The main function, currently just calls a dummy filename
-
- :returns: description
- """
- parse_file("testfile")
-
-if __name__ == '__main__':
- main()
-
=== added directory 'l10n_cr_account_banking_cr_lafise'
=== added file 'l10n_cr_account_banking_cr_lafise/__init__.py'
--- l10n_cr_account_banking_cr_lafise/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_banking_cr_lafise/__init__.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,24 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# Copyright (C) 2011 credativ Ltd (<http://www.credativ.co.uk>).
+# All Rights Reserved
+#
+# 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 lafise_format
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'l10n_cr_account_banking_cr_lafise/__openerp__.py'
--- l10n_cr_account_banking_cr_lafise/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_banking_cr_lafise/__openerp__.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,37 @@
+# -*- 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': 'Lafise Account Banking',
+ 'version': '0.5',
+ 'license': 'AGPL-3',
+ 'author': 'CLEARCORP S.A.',
+ 'website': 'http://www.clearcorp.co.cr',
+ 'category': 'Account Banking',
+ 'depends': ['account_banking','account_parser_type'],
+ 'init_xml': [],
+ 'update_xml': [],
+ 'demo_xml': [],
+ 'description': 'Module to import Lafise CR format transation files.',
+ 'active': False,
+ 'installable': True,
+}
=== added file 'l10n_cr_account_banking_cr_lafise/lafise_format.py'
--- l10n_cr_account_banking_cr_lafise/lafise_format.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_banking_cr_lafise/lafise_format.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,205 @@
+# -*- 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 account_banking.parsers import models
+from tools.translate import _
+from lafise_parser import LafiseParser
+import re
+from osv import osv, fields
+import logging
+import pprint
+from datetime import datetime
+import base64
+import StringIO
+from lxml import etree
+
+bt = models.mem_bank_transaction
+logger = logging.getLogger( 'lafise_logger' )
+
+class transaction(models.mem_bank_transaction):
+
+ mapping = {
+ 'execution_date' : '',
+ 'effective_date' : '',
+ 'local_currency' : '',
+ 'transfer_type' : '',
+ 'reference' : '',
+ 'message' : '',
+ 'name' : '',
+ 'amount': '',
+ 'creditmarker': '',
+ }
+
+ def __init__(self, record, *args, **kwargs):
+
+ '''
+ Transaction creation
+ '''
+ #record is a dictionary, that is the reason to use iteritems().
+ super(transaction, self).__init__(*args, **kwargs)
+ for key, value in record.iteritems():
+ if record.has_key(key):
+ setattr(self, key, record[key])
+
+ if not self.is_valid():
+ logger.info("Invalid: %s", record)
+
+ def is_valid(self):
+ '''
+ We don't have remote_account so override base
+ '''
+ return (self.execution_date
+ and self.transferred_amount and True) or False
+
+class statement(models.mem_bank_statement):
+ '''
+ Bank statement imported data '''
+
+ def _transmission_number(self, record):
+ self.id = record['transref']
+
+ def _account_number(self, record):
+ self.local_account = record['account_number']
+ self.local_currency = record['currencycode']
+
+ def _statement_number(self, record):
+ self.id = record['id']
+
+ def _opening_balance(self, record):
+ self.start_balance = float(record['startingbalance'])
+
+ def _closing_balance(self, record):
+ self.end_balance = float(record['endingbalance'])
+ self.date = record['bookingdate']
+
+ def _transaction_new(self, record, rows):
+ parser = LafiseParser()
+ #parse the lines in the file.
+
+ '''
+ Record is the header of the file
+ Rows is the lines when the parser to html read the file.
+ '''
+ sub_record = parser.statement_lines(record, rows) #dictionary
+ for sub in sub_record:
+ self.transactions.append(transaction(sub))
+
+ def _not_used():
+ logger.info("Didn't use record: %s", record)
+
+ def _forward_available(self, record):
+ self.end_balance = float(record['endingbalance'])
+ self.date = record['bookingdate']
+
+ def _execution_date_transferred_amount (self, record):
+ self.execution_date = record['bookingdate']
+ self.transferred_amount = float(record['ammount'])
+
+ def transaction_info(self, record):
+ '''
+ Add extra information to transaction
+ '''
+ # Additional information for previous transaction
+ if len(self.transactions) < 1:
+ logger.info("Received additional information for non existent transaction:")
+ logger.info(record)
+ else:
+ transaction = self.transactions[-1]
+ transaction.id = ','.join([record[k] for k in ['infoline{0}'.format(i) for i in range(2,5)] if record.has_key(k)])
+
+def raise_error(message, line):
+ raise osv.osv.except_osv(_('Import error'),
+ 'Error in import:%s\n\n%s' % (message, line))
+
+class parse_lafise( models.parser ):
+
+ '''
+ This adds a new parser in the selection options.
+ When the account is associated to a parser, the following code makes it appear as an option
+ '''
+ code = 'Lafise-Parser'
+ name = _( 'Lafise statement import' )
+ country_code = 'CR'
+ doc = _('''\
+ This format is available through
+ the Lafise web interface.
+ ''')
+ '''
+ ** Kwargs parameter is used for a dynamic list of parameters.
+ The wizard imported extracts used in all parsers and not all parsers have all the necessary information in your file,
+ so get information from the wizard and passed by the ** kwargs.
+ Then in the parses that are needed, are extracted from the ** kwargs and if needed,
+ the parser still works the same way without this parameter.
+
+ The rest of the methods must receive this parameter. (As the method that parse the header and the lines).
+
+ If you need a new parameter, you specify its name and value, using the ** kwargs is a dictionary,
+ extract its value, with the respective key
+ '''
+
+ def parse(self, cr, statements_file, **kwargs):
+ list_result = []
+ stmnt = statement()
+ parser_lafise = LafiseParser()
+
+ #decode to string the binary file in the wizard
+ content = base64.decodestring(statements_file)
+
+ '''
+ The lafise file when the content is decode to string return a html string.
+ The html format for the file is incorrect, so the function etree.HTMLParser()
+ With this function, the file have the correct tags and content for the file in html.
+ '''
+ parser = etree.HTMLParser() #parse to correct html format.
+ tree = etree.parse(StringIO.StringIO(content), parser) #Create a root with tags and content with the html file.
+ result = etree.tostring(tree.getroot(),pretty_print=True, method="html") #parse to string.
+
+ table = etree.HTML(result) #pass a tags HTML
+ rows = table.iter() #extract all the rows in the file.
+
+ #pass the rows to parse the headers
+ records = parser_lafise.parse_stamenent_record(rows, **kwargs)
+
+ stmnt._transmission_number(records)
+ stmnt._account_number(records)
+ stmnt._statement_number(records)
+ stmnt._opening_balance(records)
+ stmnt._closing_balance(records)
+ stmnt._forward_available(records)
+ stmnt._execution_date_transferred_amount (records)
+
+ #call the method statement_lines in parser to parse all the lines in file and add to stament. Receive the rows.
+ #pass the records to extract the currency (the currency is in the header file)
+ rows = table.iter() #extract all the rows in the file, when a iteration finish, must be reload the variable.
+ stmnt._transaction_new(records,rows)
+
+ '''
+ A stament must have a header and transacctions. The method parse_stamenent_record parse the header and the
+ method _transaction_new parse all the line (transactions) in the file.
+ '''
+
+ if stmnt.is_valid():
+ list_result.append(stmnt)
+
+ return list_result
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== added file 'l10n_cr_account_banking_cr_lafise/lafise_parser.py'
--- l10n_cr_account_banking_cr_lafise/lafise_parser.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_banking_cr_lafise/lafise_parser.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,339 @@
+# -*- 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/>.
+#
+##############################################################################
+"""
+Parser for Lafise html format files
+"""
+import re
+from datetime import datetime
+from dateutil import parser
+from pprint import PrettyPrinter
+from copy import copy
+from tools.translate import _
+from osv import osv, fields
+
+class LafiseParser(object):
+
+ #Define the header for the extract to import.
+ '''
+ ** Kwargs parameter is used for a dynamic list of parameters.
+ The wizard imported extracts used in all parsers and not all parsers have all the necessary information in your file,
+ so get information from the wizard and passed by the ** kwargs.
+ Then in the parses that are needed, are extracted from the ** kwargs and if needed,
+ the parser still works the same way without this parameter.
+
+ The rest of the methods must receive this parameter. (As the method that parse the header and the lines).
+
+ If you need a new parameter, you specify its name and value, using the ** kwargs is a dictionary,
+ extract its value, with the respective key
+ '''
+
+ """
+ As the lafise file comes in a html format, the parameter rows is the file parser,
+ the values can be extracted with the property .text in the row.
+ For the header, extracted the account, currency, initial_balance, ending_balance.
+
+ It must iterate in the rows to obtain the values.
+ """
+
+ def statement_record ( self, rows, **kwargs):
+ lines = []
+ line_dict = {}
+ count = 1
+ currency_code = ''
+
+ line_dict = {
+ 'transref': '', # _transmission_number
+ 'account_number': '', #_account_number
+ 'statementnr':'', # statement_number
+ 'startingbalance': 0.0, #_opening_balance
+ 'currencycode': '', #currencycode
+ 'endingbalance': 0.0, #_closing_balance
+ 'bookingdate': '', #moving_date
+ 'ammount': 0.0,
+ 'id': '',
+ }
+ #transmission_number and bookingdate -> Date when make the extract import.
+ date_obj= datetime.now()
+ line_dict['transref'] = date_obj
+
+ #delete blank rows
+ for row in rows:
+ values = [col.text for col in row]
+ if len(values) > 0:
+ lines.append(values)
+
+ #lines is a list of lists.
+ #First, check if the account in the wizard match with the account in the file.
+ if self.match_account(lines, kwargs['account_number']):
+ #extract from the wizard the account
+ line_dict['account_number'] = kwargs['account_number']
+
+ for list in lines:
+ #currency_code in th file
+ if count == 4:
+ currency = list[4]
+
+ if "COL" in currency:
+ currency_code = 'CRC'
+
+ elif "USD" in currency:
+ currency_code = 'USD'
+
+ line_dict['currencycode'] = currency_code
+
+ #initial balance
+ if count == 16:
+ line_dict['startingbalance'] = self.extract_float(str(list[5]).replace(",",""))
+
+ #interrupted the cycle, because the information is complete for the header.
+ elif count >= 24:
+ break
+ count +=1
+
+ #statementnr
+ line_dict['statementnr'] = kwargs['date_from_str'] + ' - '+ kwargs['date_to_str'] + ' Extracto Lafise ' + line_dict['account_number'] #Interval time of the file.
+
+ #bookingdate
+ line_dict['bookingdate'] = date_obj
+
+ #id
+ line_dict['id'] = kwargs['date_from_str'] + ' - '+ kwargs['date_to_str'] + ' Extracto Lafise ' + line_dict['account_number']
+
+ #ending_balance
+ list = self.clean_special_characters_list(lines) #clean all the special characters and the rows without information
+ result = self.calculate_final_balance(list)
+ line_dict['endingbalance'] = float(line_dict['startingbalance']) - float(result['debit']) + float(result['credit'])
+
+ #amount
+ line_dict['ammount'] = float(line_dict['startingbalance']) + float(line_dict['endingbalance'])
+
+ return line_dict
+
+ else:
+ raise osv.except_osv(_('Error'),
+ _('Error en la importación! La cuenta especificada en el archivo no coincide con la seleccionada en el asistente de importacion'))
+
+ '''
+ Parse all the lines in the file. Once the header is parser, the next step are the lines.
+ '''
+ def statement_lines (self, records, rows):
+ parser = LafiseParser()
+ line_id = 1 #To distinct the lines, in the case of someone are repeat.
+
+ mapping = {
+ 'execution_date' : '',
+ 'effective_date' : '',
+ 'transfer_type' : '',
+ 'reference' : '',
+ 'message' : '',
+ 'name' : '',
+ 'transferred_amount': '',
+ 'creditmarker': '',
+ }
+
+ lines = clean_list = []
+ statements = []
+ currencycode = records['currencycode']
+ count = 1 #in line 18 start the statements.
+
+ #delete blank rows
+ for row in rows:
+ values = [col.text for col in row]
+ if len(values) > 0:
+ lines.append(values)
+
+ #clear lines of special characters
+ clean_list = self.clean_special_characters_list(lines)
+
+ for line in clean_list:
+ #effective_date
+ date_str = self.extract_date_regular_expresion(self.clean_special_characters(line[0]))
+ date = datetime.strptime(date_str, "%d/%m/%y")
+ mapping['effective_date'] = date #fecha_contable.
+
+ #execution_date
+ mapping['execution_date'] = date #fecha_movimiento
+
+ str_line = self.clean_special_characters(line[2]) + ' ID line: ' + str(line_id)
+
+ mapping['local_currency'] = currencycode
+ mapping['transfer_type'] = 'NTRF'
+ mapping['reference'] = self.extract_number(self.clean_special_characters(line[1]))
+ mapping['message'] = str_line
+ mapping['name'] = str_line
+ mapping['id'] = str_line
+
+ debit = float(self.extract_float(self.clean_special_characters(line[3])))
+ credit = float(self.extract_float(self.clean_special_characters(line[4])))
+
+ if (credit > 0.0): #in this case, credit is a input of money
+ mapping['transferred_amount'] = credit
+ mapping['creditmarker'] = 'C'
+
+ else: #debit is output
+ mapping['transferred_amount'] = -debit
+
+ statements.append(copy(mapping))
+ line_id += 1
+
+ return statements
+
+ """
+ ** Kwargs parameter is used for a dynamic list of parameters.
+ The wizard imported extracts used in all parsers and not all parsers have all the necessary information in your file,
+ so get information from the wizard and passed by the ** kwargs.
+ Then in the parses that are needed, are extracted from the ** kwargs and if needed,
+ the parser still works the same way without this parameter.
+
+ The rest of the methods must receive this parameter. (As the method that parse the header and the lines).
+
+ If you need a new parameter, you specify its name and value, using the ** kwargs is a dictionary,
+ extract its value, with the respective key
+ """
+ def parse_stamenent_record( self, rec, **kwargs):
+
+ matchdict = dict()
+
+ #Set the header for the stament.
+ matchdict = self.statement_record(rec, **kwargs);
+
+ return matchdict
+
+ def parse( self, cr, data ):
+ records = []
+ # Some records are multiline
+ for line in data:
+ if len(line) <= 1:
+ continue
+ if line[0] == ':' and len(line) > 1:
+ records.append(line)
+ else:
+ records[-1] = '\n'.join([records[-1], line])
+
+ output = []
+
+ for rec in records:
+ output.append( self.parse_stamenent_record( rec ) )
+
+ return output
+
+ ##################################<-AUXILIAR METHODS->####################################
+ def extract_number( self, account_number ):
+ cad = ''
+ result = re.findall(r'[0-9]+', account_number)
+
+ for character in result:
+ cad = cad + character
+ return cad
+
+ def extract_float ( self, ammount ):
+ cad = ''
+ result = re.findall(r"[-+]?\d*\.\d+|\d+",ammount)
+
+ for character in result:
+ cad = cad + character
+ return cad
+
+ def extract_date_regular_expresion(self, date):
+ cad = ''
+ result = []
+ date_string = ''
+ result = re.findall('[0-9]{1,2}/[0-9]{1,2}/[0-9]{2}', date)
+
+ for character in result:
+ cad = cad + character
+ return cad
+
+ #clear special characters in a specific celd.
+ def clean_special_characters(self, text_celd):
+ special_characters = {'\r\n':'','\t':''}
+
+ for i, j in special_characters.iteritems():
+ text = text_celd.replace(i, j)
+
+ #remove all the blank space.
+ #return re.sub(r'\s', '', text)
+ return text
+
+ #clear special characters in a specific row.
+ def clean_special_characters_list(self, lines):
+ new_row = list = []
+ special_characters = {'\r\n':'','\t':'','\r':'','\n':'','\\t':'','\t':''}
+ count = 1
+
+ for l in lines:
+ if (count >= 18): #in the line 18 start the statements
+ if len(list) == 0:
+ list = []
+
+ for celd in l:
+ if celd != None:
+ for i, j in special_characters.iteritems():
+ text = celd.replace(i, j)
+ text = re.sub(r'\t', '', text) #'\t' is the "tab" character
+
+ if text != '':
+ new_row.append(text)
+
+ if len(new_row) > 0:
+ list.append(new_row) #list containt all the rows clean
+ new_row = []
+
+ count +=1
+
+ return list
+
+ #Return true if the account selected in the wizard match with the account in the file.
+ def match_account(self, lines, account_wizard):
+ count = 1
+ acc_number = ''
+ for list in lines:
+ if count == 4:
+ acc_number= self.extract_number(list[1])
+ break
+ else:
+ count +=1
+
+ if acc_number.find(account_wizard) > -1:
+ return True
+
+ else:
+ return False
+
+ #List is the list of the statements, the method calculate the final_balance
+ #with the debit and credit
+ def calculate_final_balance(self, list):
+ result = {'debit': 0.0, 'credit':0.0}
+ total_debit = total_credit = 0.0
+
+ for line in list:
+ debit = float(self.extract_float(self.clean_special_characters(line[3])))
+ credit = float(self.extract_float(self.clean_special_characters(line[4])))
+
+ total_debit += debit
+ total_credit += credit
+
+ result ['debit'] = total_debit
+ result ['credit'] = total_credit
+
+ return result
+
\ No newline at end of file
=== added directory 'l10n_cr_account_banking_reports'
=== added directory 'l10n_cr_account_banking_reports/report'
=== added file 'l10n_cr_account_banking_reports/report/conciliation_bank.py.OTHER'
--- l10n_cr_account_banking_reports/report/conciliation_bank.py.OTHER 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_banking_reports/report/conciliation_bank.py.OTHER 2013-08-20 07:28:14 +0000
@@ -0,0 +1,420 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Addons modules by CLEARCORP S.A.
+# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import time
+from report import report_sxw
+from tools.translate import _
+import pooler
+from datetime import datetime
+
+from openerp.addons.account_financial_report_webkit.report.common_reports import CommonReportHeaderWebkit
+from openerp.addons.account_financial_report_webkit.report.partners_ledger import PartnersLedgerWebkit
+
+class conciliation_bank(report_sxw.rml_parse, CommonReportHeaderWebkit):
+
+ def __init__(self, cursor, uid, name, context):
+ super(conciliation_bank, self).__init__(cursor, uid, name, context=context)
+ self.pool = pooler.get_pool(self.cr.dbname)
+ self.cursor = self.cr
+
+ self.localcontext.update({
+ 'time': time,
+ 'cr' : cursor,
+ 'uid': uid,
+ 'get_amount': self.get_amount,
+ 'get_bank_data': self.get_bank_data,
+ 'get_bank_account': self.get_bank_account,
+ 'filter_form': self._get_filter,
+ 'display_target_move': self._get_display_target_move,
+ })
+
+ def set_context(self, objects, data, ids, report_type=None):
+ main_filter = self._get_form_param('filter', data, default='filter_no')
+ target_move = self._get_form_param('target_move', data, default='all')
+ start_date = self._get_form_param('date_from', data)
+ stop_date = self._get_form_param('date_to', data)
+ input_bank_balance = self._get_form_param('bank_balance', data)
+ start_period = self.get_start_period_br(data)
+ stop_period = self.get_end_period_br(data)
+ fiscalyear = self.get_fiscalyear_br(data)
+ chart_account = self._get_chart_account_id_br(data)
+
+ if main_filter == 'filter_no' and fiscalyear:
+ start_period = self.get_first_fiscalyear_period(fiscalyear)
+ stop_period = self.get_last_fiscalyear_period(fiscalyear)
+ elif main_filter == 'filter_date':
+ start = start_date
+ stop = stop_date
+ else:
+ start = start_period
+ stop = stop_period
+
+ self.localcontext.update({
+ 'fiscalyear': fiscalyear,
+ 'start_date': start_date,
+ 'stop_date': stop_date,
+ 'start_period': start_period,
+ 'stop_period': stop_period,
+ 'target_move': target_move,
+ 'input_bank_balance': input_bank_balance,
+ 'chart_account': chart_account,
+
+ })
+
+ return super(conciliation_bank, self).set_context(objects, data, ids,
+ report_type=report_type)
+
+ def get_amount(self,cr, uid, account_move_line, currency):
+ account_obj = self.pool.get('account.account').browse(cr,uid,account_move_line.account_id.id)
+
+ obj_invoice = self.pool.get('account.invoice')
+ invoice_search = obj_invoice.search(cr,uid,[('move_id','=',account_move_line.move_id.id)])
+ invoice = None
+ if invoice_search != []:
+ invoice = obj_invoice.browse(cr,uid,invoice_search[0])
+
+ obj_voucher = self.pool.get('account.voucher')
+ voucher_search = obj_voucher.search(cr,uid,[('move_id','=',account_move_line.move_id.id)])
+
+ voucher = None
+ if voucher_search != []:
+ voucher = obj_voucher.browse(cr,uid,voucher_search[0])
+
+ res = ('none', 0.0, 0.0)
+
+ amount = 0.0
+ if currency != False:
+ amount = account_move_line.amount_currency
+ else:
+ if account_move_line.debit != 0.0 :
+ amount = account_move_line.debit
+ elif account_move_line.credit != 0.0 :
+ amount = account_move_line.credit * -1
+
+ # Invoices
+ if invoice:
+ if invoice.type == 'out_invoice': # Customer Invoice
+ res = ('invoice', amount)
+ elif invoice.type == 'in_invoice': # Supplier Invoice
+ res = ('invoice', amount)
+ elif invoice.type == 'in_refund': # Debit Note
+ res = ('debit', amount)
+ elif invoice.type == 'out_refund': # Credit Note
+ res = ('credit', amount)
+ # Vouchers
+ elif voucher:
+ if voucher.type == 'payment': # Payment
+ res = ('payment', amount)
+ elif voucher.type == 'sale': # Invoice
+ res = ('invoice', amount)
+ elif voucher.type == 'receipt': # Payment
+ res = ('payment', amount)
+ # Debit o Credit
+ else:
+ if amount > 0.0:
+ res = ('debit', amount)
+ else:
+ res = ('credit', amount)
+
+
+ if res[1] == None or (currency != None and res[1] == 0.0):
+ secundary_amount = (account_move_line.debit != 0.0) and account_move_line.debit or account_move_line.credit
+ res = (res[0], 0.0, secundary_amount)
+ else:
+ res = (res[0], res[1], None)
+
+ return res
+
+ def get_bank_data(self, cr, uid, parent_account_id, filter_type, filter_data, fiscalyear, target_move, historic_strict, special_period, context=None):
+ result_bank_balance = {}
+ result_move_lines = []
+ filters = {}
+
+ account_obj = self.pool.get('account.account')
+ account_webkit_report_library_obj = self.pool.get('account.webkit.report.library')
+ parent_account = account_obj.browse(cr, uid, parent_account_id)
+ child_account_ids = account_obj.search(cr, uid, [('parent_id','=',parent_account_id)])
+ child_accounts = child_account_ids and account_obj.browse(cr, uid, child_account_ids) or False
+
+ if not child_accounts:
+ return result_bank_balance, result_move_lines, account_foreign
+
+ if parent_account.report_currency_id:
+ account_currency = parent_account.report_currency_id
+ elif parent_account.currency_id:
+ account_currency = parent_account.currency_id
+ else:
+ account_currency = parent_account.company_id.currency_id
+ if account_currency.id == parent_account.company_id.currency_id.id:
+ account_is_foreign = False
+ else:
+ account_is_foreign = True
+
+ reconciled_account = None
+ transit_accounts = []
+ transit_account_ids = []
+ for child_account in child_accounts:
+ #TODO: get the user types for the reconciled_account from system properties
+ if child_account.user_type.code == 'BKRE':
+ reconciled_account = child_account
+ else:
+ if child_account.reconcile:
+ transit_accounts.append(child_account)
+ transit_account_ids.append(child_account.id)
+
+ #A reconciled_account and at least one transit_account is needed
+ if not (reconciled_account or transit_accounts):
+ return result_bank_balance, result_move_lines, account_foreign
+
+ #TODO: set input_bank_balance with data from wizard
+ input_bank_balance = 0.0
+ bank_balance = 0.0
+ accounting_balance = 0.0
+ incomes_to_register = 0.0
+ credits_to_reconcile = 0.0
+ expenditures_to_register = 0.0
+ debits_to_reconcile = 0.0
+ accounting_total = 0.0
+ bank_total = 0.0
+
+ fiscal_year_id = fiscalyear.id
+
+ if filter_type == 'filter_date':
+ end_period = False
+ end_date = filter_data[1]
+
+ elif filter_type == 'filter_period':
+ end_period = filter_data[1]
+ end_date = False
+
+ #TODO: Set the max date or period list for the balance query from the wizard data
+ # If the wizard is filtered by date, the max date is entered as is
+ # If the wizard is filtered by period, the query needs the valid list of periods in a WHERE statement form
+ balance_query_filter = ''
+
+ if account_is_foreign:
+
+ bank_balance = account_webkit_report_library_obj.get_account_balance(cr,
+ uid,
+ [reconciled_account.id],
+ ['foreign_balance'],
+ end_date=end_date,
+ end_period_id=end_period.id,
+ fiscal_year_id=fiscal_year_id,
+ filter_type=filter_type,
+ context=context)[reconciled_account.id]['foreign_balance']
+
+ accounting_balance = account_webkit_report_library_obj.get_account_balance(cr,
+ uid,
+ [parent_account_id],
+ ['foreign_balance'],
+ end_date=end_date,
+ end_period_id=end_period.id,
+ fiscal_year_id=fiscal_year_id,
+ filter_type = filter_type,
+ context=context)[parent_account_id]['foreign_balance']
+ else:
+ bank_balance = account_webkit_report_library_obj.get_account_balance(cr,
+ uid,
+ [reconciled_account.id],
+ ['balance'],
+ end_date=end_date,
+ end_period_id=end_period.id,
+ fiscal_year_id=fiscal_year_id,
+ filter_type = filter_type,
+ context=context)[reconciled_account.id]['balance']
+ accounting_balance = account_webkit_report_library_obj.get_account_balance(cr,
+ uid,
+ [parent_account_id],
+ ['balance'],
+ end_date=end_date,
+ end_period_id=end_period.id,
+ fiscal_year_id=fiscal_year_id,
+ filter_type = filter_type,
+ context=context)[parent_account_id]['balance']
+
+ '''
+ bank_balance = reconciled_account.foreign_balance
+ accounting_balance = parent_account.foreign_balance
+ else:
+ bank_balance = reconciled_account.balance
+ accounting_balance = parent_account.balance
+ '''
+
+ move_obj = self.pool.get('account.move')
+ move_line_obj = self.pool.get('account.move.line')
+
+ """
+ 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
+
+ """
+ filter_data[0] = None
+ unreconciled_move_lines = account_webkit_report_library_obj.get_move_lines(cr, uid, 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,
+ }
+
+ #special_period = historic_strict = False
+
+ return result_bank_balance, result_move_lines, account_is_foreign
+
+ def get_bank_account(self, cr, uid, data):
+ info = data.get('form', {}).get('bank_account_ids')
+ if info:
+ bank_account = self.pool.get('account.account').browse(cr, uid, info[0])
+ return bank_account
+ return False
+
+
+report_sxw.report_sxw(
+ 'report.account_financial_report_webkit.account.account_report_conciliation_bank_webkit',
+ 'account.account',
+ 'addons/l10n_cr_account_banking_reports/report/conciliation_bank.mako',
+ parser=conciliation_bank)
+
=== added directory 'l10n_cr_account_banking_reports/wizard'
=== added file 'l10n_cr_account_banking_reports/wizard/conciliation_bank_wizard.xml.OTHER'
--- l10n_cr_account_banking_reports/wizard/conciliation_bank_wizard.xml.OTHER 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_banking_reports/wizard/conciliation_bank_wizard.xml.OTHER 2013-08-20 07:28:14 +0000
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="conciliation_bank_view_webkit" model="ir.ui.view">
+ <field name="name">Conciliation Bank</field>
+ <field name="model">conciliation.bank.webkit</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account.account_common_report_view"/>
+ <field name="arch" type="xml">
+ <data>
+ <xpath expr="/form/label[@string='']" position="replace">
+ <separator string="Conciliation Bank" colspan="4"/>
+ <label nolabel="1" colspan="4" string="This report allows you to print or generate a pdf of your partner ledger with details of all your payable/receivable account"/>
+ </xpath>
+ <field name="target_move" position="after">
+ <field name="historic_strict"></field>
+ </field>
+ <field name="chart_account_id" position='attributes'>
+ <attribute name="colspan">4</attribute>
+ </field>
+ <field name="chart_account_id" position='after'>
+ <field name="bank_account_ids" required = 'True'/>
+ <field name="bank_balance" required = 'True'/>
+ </field>
+ <page name="filters" position="attributes">
+ <attribute name="string">Time Filters</attribute>
+ </page>
+ <page name="journal_ids" position="attributes">
+ <attribute name="invisible">True</attribute>
+ </page>
+ <field name="date_from" position="replace">
+ <field name="date_from" invisible="1" required = "False" attrs="{'readonly':[('filter', '!=', 'filter_date')]}" colspan="4"/>
+ </field>
+ <field name="period_from" position="replace">
+ <field name="period_from" invisible="1" required = "False" domain="[('fiscalyear_id', '=', fiscalyear_id)]" attrs="{'readonly':[('filter','!=','filter_period')]}" colspan="4"/>
+ </field>
+ <field name="period_to" position="attributes">
+ <attribute name="domain">[('fiscalyear_id', '=', fiscalyear_id), ('special', '=', False)]</attribute>
+ </field>
+ <field name="period_to" position="after">
+ <field name="special_period" attrs="{'readonly':[('filter', '!=', 'filter_period')]}"></field>
+ </field>
+ <field name="fiscalyear_id" position="attributes">
+ <attribute name="required">1</attribute>
+ </field>
+ </data>
+ </field>
+ </record>
+
+ <record id="action_conciliation_bank_menu_webkit" model="ir.actions.act_window">
+ <field name="name">Conciliation Bank</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">conciliation.bank.webkit</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="conciliation_bank_view_webkit"/>
+ <field name="target">new</field>
+ </record>
+
+ <record model="ir.values" id="action_account_conciliation_bank_values_webkit">
+ <field name="model_id" ref="account.model_account_account"/>
+ <field name="object" eval="1"/>
+ <field name="name">Conciliation Bank</field>
+ <field name="key2">client_print_multi</field>
+ <field name="value"
+ eval="'ir.actions.act_window,' +str(ref('action_conciliation_bank_menu_webkit'))"/>
+ <field name="key">action</field>
+ <field name="model">account.account</field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_financial_report_open_invoices'
=== added file 'l10n_cr_account_financial_report_open_invoices/__init__.py'
--- l10n_cr_account_financial_report_open_invoices/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_open_invoices/__init__.py 2013-08-20 07:28:14 +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 account
+import wizard
+import report
+
=== added file 'l10n_cr_account_financial_report_open_invoices/__openerp__.py'
--- l10n_cr_account_financial_report_open_invoices/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_open_invoices/__openerp__.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,43 @@
+# -*- 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 based extended report financial report',
+ 'description': "",
+ 'version': '1.0',
+ 'author': 'CLEARCORP S.A.',
+ 'category': 'Finance',
+ 'website': "http://clearcorp.co.cr",
+ 'images': [],
+ 'depends': ['account','account_financial_report_webkit'],
+ 'init_xml': [],
+ 'demo_xml' : [],
+ 'update_xml': ['report/report.xml',
+ 'wizard/l10n_cr_account_report_open_invoices_wizard_view.xml',
+ 'report_menus.xml',
+ ],
+ 'test': [],
+ 'active': False,
+ 'installable': True,
+ 'license': 'AGPL-3',
+}
=== added directory 'l10n_cr_account_financial_report_open_invoices/i18n'
=== added file 'l10n_cr_account_financial_report_open_invoices/i18n/es_CR.po'
--- l10n_cr_account_financial_report_open_invoices/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_open_invoices/i18n/es_CR.po 2013-08-20 07:28:14 +0000
@@ -0,0 +1,225 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * l10n_cr_account_financial_report_open_invoices
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-04-01 20:34+0000\n"
+"PO-Revision-Date: 2013-04-01 20:34+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_financial_report_open_invoices
+#: constraint:open.invoices.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_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:23
+msgid "No"
+msgstr "No"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: view:open.invoices.webkit:0
+msgid "Layout Options"
+msgstr "Opciones de Diseño"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:145
+msgid "Curr."
+msgstr "Curr."
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:126
+msgid "Label"
+msgstr "Etiqueta"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:136
+msgid "Debit"
+msgstr "Débito"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:39
+msgid "Initial Balance"
+msgstr "Balance inicial"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:122
+msgid "Journal"
+msgstr "Diario"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:303
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:362
+msgid "Saldo"
+msgstr "Saldo"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:118
+msgid "Period"
+msgstr "Período"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:114
+msgid "Date"
+msgstr "Fecha"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:28
+msgid "Chart of Account"
+msgstr "Catálogo de cuentas"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:38
+msgid "Target Moves"
+msgstr "Movimientos destino"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:45
+msgid "From:"
+msgstr "Desde:"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:51
+msgid "To:"
+msgstr "Hasta:"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:116
+msgid "Due Date"
+msgstr "Due Date"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: constraint:open.invoices.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_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:134
+msgid "Credit"
+msgstr "Crédito"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:29
+msgid "Fiscal Year"
+msgstr "Año fiscal"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:37
+msgid "Accounts Filter"
+msgstr "Filtro de cuentas"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:138
+msgid "Manual Move"
+msgstr "Movimiento manual"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:120
+msgid "Entry"
+msgstr "Apunte"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:60
+msgid "Custom Filter"
+msgstr "Filtro personalizado"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: code:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.py:64
+#, python-format
+msgid "Page"
+msgstr "Página"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:74
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:76
+msgid "Accounts in "
+msgstr "Cuentas en "
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:140
+msgid "Cumul. Bal."
+msgstr "Bal. Acuml."
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:128
+msgid "Rec."
+msgstr "Rec."
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:23
+msgid "Computed"
+msgstr "Computed"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: code:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.py:64
+#, python-format
+msgid "of"
+msgstr "de"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:34
+msgid "Periods Filter"
+msgstr "Filtro de períodos"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: code:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.py:55
+#: model:ir.actions.act_window,name:l10n_cr_account_financial_report_open_invoices.action_account_open_invoices_menu_webkit
+#: model:ir.model,name:l10n_cr_account_financial_report_open_invoices.model_open_invoices_webkit
+#, python-format
+msgid "Open Invoices Report"
+msgstr "Reporte de Facturas Pendientes"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:32
+msgid "Dates Filter"
+msgstr "Filtro de fechas"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:109
+msgid "No Partner"
+msgstr "Sin compañía"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: code:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.py:49
+#, python-format
+msgid "OPEN INVOICES REPORT"
+msgstr "REPORTE DE FACTURAS PENDIENTES"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: constraint:open.invoices.webkit:0
+msgid "Clearance date must be the very last date of the last period or later."
+msgstr "Fecha de Liquidación debe ser la última fecha del último período o después de este."
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:130
+msgid "Invoice"
+msgstr "Factura"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:124
+msgid "Partner"
+msgstr "Compañía"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:132
+msgid "Payments"
+msgstr "Pagos"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:143
+msgid "Curr. Balance"
+msgstr "Curr. Balance"
+
+#. module: l10n_cr_account_financial_report_open_invoices
+#: report:addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako:23
+msgid "Opening Entries"
+msgstr "Opening Entries"
+
=== added directory 'l10n_cr_account_financial_report_open_invoices/report'
=== added file 'l10n_cr_account_financial_report_open_invoices/report/__init__.py'
--- l10n_cr_account_financial_report_open_invoices/report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_open_invoices/report/__init__.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,22 @@
+# -*- 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_report_open_invoices
\ No newline at end of file
=== added file 'l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako'
--- l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako 2013-08-20 07:28:14 +0000
@@ -0,0 +1,407 @@
+<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <style type="text/css">
+ .overflow_ellipsis {
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ }
+
+ ${css}
+ </style>
+ </head>
+ <body>
+ <%!
+ def amount(text):
+ return text.replace('-', '‑') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers)
+ %>
+
+ <%setLang(user.context_lang)%>
+
+ <%
+ initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')}
+ %>
+
+ <div class="act_as_table data_table">
+ <div class="act_as_row labels">
+ <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')}
+ %else:
+ ${_('Periods Filter')}
+ %endif
+ </div>
+ <div class="act_as_cell">${_('Accounts Filter')}</div>
+ <div class="act_as_cell">${_('Target Moves')}</div>
+ <div class="act_as_cell">${_('Initial Balance')}</div>
+ </div>
+ <div class="act_as_row">
+ <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">
+ ${_('From:')}
+ %if filter_form(data) == 'filter_date':
+ ${formatLang(start_date, date=True) if start_date else u'' }
+ %else:
+ ${start_period.name if start_period else u''}
+ %endif
+ ${_('To:')}
+ %if filter_form(data) == 'filter_date':
+ ${ formatLang(stop_date, date=True) if stop_date else u'' }
+ %else:
+ ${stop_period.name if stop_period else u'' }
+ %endif
+ </div>
+ <div class="act_as_cell">
+ %if partner_ids:
+ ${_('Custom Filter')}
+ %else:
+ ${ display_partner_account(data) }
+ %endif
+ </div>
+ <div class="act_as_cell">${ display_target_move(data) }</div>
+ <div class="act_as_cell">${ initial_balance_text[initial_balance_mode] }</div>
+ </div>
+ </div>
+ <%
+ account_by_curr = get_accounts_by_curr(cr, uid, objects)
+ %>
+ %for currency in account_by_curr:
+ %if currency[0] != 'CRC':
+ <div class="account_title bg" style="margin-top: 20px; font-size: 14px; width: 1080px;">${_('Accounts in ')} ${currency[0]}</div>
+ %else:
+ <div class="account_title bg" style="margin-top: 20px; font-size: 14px; width: 1080px;">${_('Accounts in ')} ${company.currency_id.name}</div>
+ %endif
+ %for account in currency[1]:
+ %if account.ledger_lines or account.init_balance:
+ <%
+ if not account.partners_order:
+ continue
+ account_total_invoice = 0.0
+ account_total_payment = 0.0
+ account_total_debit = 0.0
+ account_total_credit = 0.0
+ account_total_manual_move = 0.0
+ account_balance_cumul = 0.0
+ account_balance_cumul_curr = 0.0
+ %>
+
+ <div class="account_title bg" style="width: 1080px; margin-top: 15px; font-size: 12px;">${account.code} - ${account.name} - ${account.report_currency_id.name or account.company_id.currency_id.name}</div>
+
+ %for partner_name, p_id, p_ref, p_name in account.partners_order:
+ <%
+ total_invoice = 0.0
+ total_payment = 0.0
+ total_debit = 0.0
+ total_credit = 0.0
+ total_manual_move = 0.0
+ cumul_balance = 0.0
+ cumul_balance_curr = 0.0
+
+ part_cumul_balance = 0.0
+ part_cumul_balance_curr = 0.0
+ %>
+ <div class="act_as_table list_table" style="margin-top: 5px;">
+ <div class="act_as_caption account_title">
+ ${ get_partner_name(cr, uid, partner_name, p_id, p_ref, p_name) or _('No Partner')}
+ </div>
+ <div class="act_as_thead">
+ <div class="act_as_row labels">
+ ## date
+ <div class="act_as_cell first_column" style="width: 50px;">${_('Date')}</div>
+ ## due date
+ <div class="act_as_cell" style="width: 55px;">${_('Due Date')}</div>
+ ## period
+ <div class="act_as_cell" style="width: 70px;">${_('Period')}</div>
+ ## move
+ <div class="act_as_cell" style="width: 70px;">${_('Entry')}</div>
+ ## journal
+ <div class="act_as_cell" style="width: 70px;">${_('Journal')}</div>
+ ## partner
+ <!--div class="act_as_cell" style="width: 60px;">${_('Partner')}</div-->
+ ## label
+ <div class="act_as_cell" style="width: 215px;">${_('Label')}</div>
+ ## reconcile
+ <div class="act_as_cell" style="width: 70px;">${_('Rec.')}</div>
+ ## Invoices
+ <div class="act_as_cell amount" style="width: 100px;">${_('Invoice')}</div>
+ ## credit
+ <div class="act_as_cell amount" style="width: 100px;">${_('Payments')}</div>
+ ## debit
+ <div class="act_as_cell amount" style="width: 100px;">${_('Credit')}</div>
+ ## Payments
+ <div class="act_as_cell amount" style="width: 100px;">${_('Debit')}</div>
+ ## Manual Move
+ <div class="act_as_cell amount" style="width: 115px;">${_('Manual Move')}</div>
+ ## balance cumulated
+ <div class="act_as_cell amount" style="width: 115px;">${_('Cumul. Bal.')}</div>
+ %if amount_currency(data):
+ ## currency balance
+ <div class="act_as_cell amount sep_left" style="width: 80px;">${_('Curr. Balance')}</div>
+ ## curency code
+ <div class="act_as_cell amount" style="width: 30px; text-align: right;">${_('Curr.')}</div>
+ %endif
+ </div>
+ </div>
+ <div class="act_as_tbody">
+ <!--<%
+ #total_debit = account.init_balance.get(p_id, {}).get('debit') or 0.0
+ #total_credit = account.init_balance.get(p_id, {}).get('credit') or 0.0
+ total_cumul_balance = 0.0
+ %>-->
+ %if initial_balance_mode and (total_debit or total_credit):
+ <%
+ #part_cumul_balance = account.init_balance.get(p_id, {}).get('init_balance') or 0.0
+ #part_cumul_balance_curr = account.init_balance.get(p_id, {}).get('init_balance_currency') or 0.0
+ #balance_forward_currency = account.init_balance.get(p_id, {}).get('currency_name') or ''
+
+ #cumul_balance += part_cumul_balance
+ #cumul_balance_curr += part_cumul_balance_curr
+ %>
+ %endif
+
+
+ %for line in account.ledger_lines.get(p_id, []):
+ <%open = is_open(cr, uid, line)%>
+ %if open:
+ <%
+ label_elements = [line.get('lname') or '']
+ if line.get('invoice_number'):
+ label_elements.append("(%s)" % (line['invoice_number'],))
+ label = ' '.join(label_elements)
+
+ invoice_amount = 0.0
+ payment_amount = 0.0
+ credit_amount = 0.0
+ debit_amount = 0.0
+ MM_amount = 0.0
+
+ amount = get_amount(cr, uid, line, currency[0])
+ %>
+ <div class="act_as_row lines">
+ ## date
+ <div class="act_as_cell first_column">${formatLang(line.get('ldate') or '', date=True)}</div>
+ ## date
+ <div class="act_as_cell">${formatLang(line.get('date_maturity') or '', date=True)}</div>
+ ## period
+ <div class="act_as_cell">${line.get('period_code') or ''}</div>
+ ## move
+ <div class="act_as_cell">${line.get('move_name') or ''}</div>
+ ## journal
+ <div class="act_as_cell">${line.get('jcode') or ''}</div>
+ ## partner
+ <!--div class="act_as_cell overflow_ellipsis">${line.get('partner_name') or ''}</div-->
+ ## label
+ <div class="act_as_cell">${label}</div>
+ ## reconcile
+ <div class="act_as_cell">${line.get('rec_name') or ''}</div>
+ ## Invoice
+ <div class="act_as_cell amount">
+ %if amount[0] == 'invoice':
+ <%
+ invoice_amount = amount[1]
+ total_invoice += invoice_amount
+ %>
+ ${ formatLang(invoice_amount or 0.0) }
+ %else:
+ ${'0.0'}
+ %endif
+ %if amount[2] != None and amount[0] == 'invoice':
+ ${' ('}${ formatLang(amount[2]) }${')'}
+ %endif
+ </div>
+ ## Payment
+ <div class="act_as_cell amount">
+ %if amount[0] == 'payment':
+ <%
+ payment_amount = amount[1]
+ total_payment += payment_amount
+ %>
+ ${ formatLang(payment_amount or 0.0) }
+ %else:
+ ${'0.0'}
+ %endif
+ %if amount[2] != None and amount[0] == 'payment':
+ ${' ('}${ formatLang(amount[2]) }${')'}
+ %endif
+ </div>
+ ## Credit
+ <div class="act_as_cell amount">
+ %if amount[0] == 'credit':
+ <%
+ credit_amount = amount[1]
+ total_credit += credit_amount
+ %>
+ ${ formatLang(credit_amount or 0.0) }
+ %else:
+ ${'0.0'}
+ %endif
+ %if amount[2] != None and amount[0] == 'credit':
+ ${' ('}${ formatLang(amount[2]) }${')'}
+ %endif
+ </div>
+ ## Debit
+ <div class="act_as_cell amount">
+ %if amount[0] == 'debit':
+ <%
+ debit_amount = amount[1]
+ total_debit += debit_amount
+ %>
+ ${ formatLang(debit_amount or 0.0) }
+ %else:
+ ${'0.0'}
+ %endif
+ %if amount[2] != None and amount[0] == 'debit':
+ ${' ('}${ formatLang(amount[2]) }${')'}
+ %endif
+ </div>
+ ## Manual move
+ <div class="act_as_cell amount">
+ %if amount[0] == 'manual':
+ <%
+ MM_amount = amount[1]
+ total_manual_move += MM_amount
+ %>
+ ${ formatLang(MM_amount or 0.0) }
+ %else:
+ ${'0.0'}
+ %endif
+ %if amount[2] != None and amount[0] == 'manual':
+ ${' ('}${ formatLang(amount[2]) }${')'}
+ %endif
+ </div>
+ ## balance cumulated
+ <% cumul_balance = (invoice_amount+payment_amount+credit_amount+debit_amount+MM_amount) or 0.0 %>
+ <div class="act_as_cell amount" style="padding-right: 1px;">${formatLang(cumul_balance) }</div>
+ %if amount_currency(data):
+ ## currency balance
+ <div class="act_as_cell sep_left amount">${formatLang(line.get('amount_currency') or 0.0) }</div>
+ ## curency code
+ <div class="act_as_cell" style="text-align: right; ">${line.get('currency_code') or ''}</div>
+ %endif
+ </div>
+ <%
+ total_cumul_balance = total_invoice + total_payment + total_debit + total_credit + total_manual_move
+ %>
+ %endif
+ %endfor
+ <div class="act_as_row lines labels">
+ ## date
+ <div class="act_as_cell first_column"></div>
+ ## period
+ <div class="act_as_cell"></div>
+ ## move
+ <div class="act_as_cell"></div>
+ ## journal
+ <div class="act_as_cell"></div>
+ ## partner
+ <div class="act_as_cell"></div>
+ ## label
+ <div class="act_as_cell">${_('Saldo')}</div>
+ ## reconcile
+ <!--div class="act_as_cell"></div-->
+ %if currency[0] != 'CRC':
+ <% currency_symbol = get_currency_symbol(cr, uid, currency[0]) %>
+ ## invoice
+ <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_invoice) }</div>
+ ## payment
+ <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_payment) }</div>
+ ## credit
+ <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_credit) }</div>
+ ## debit
+ <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_debit) }</div>
+ ## manual move
+ <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_manual_move) }</div>
+ ## balance cumulated
+ <div class="act_as_cell amount" style="padding-right: 1px;">${currency_symbol} ${formatLang(total_cumul_balance) }</div>
+ %else:
+ ## invoice
+ <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_invoice) }</div>
+ ## payment
+ <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_payment) }</div>
+ ## credit
+ <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_credit) }</div>
+ ## debit
+ <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_debit) }</div>
+ ## manual move
+ <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_manual_move) }</div>
+ ## balance cumulated
+ <div class="act_as_cell amount" style="padding-right: 1px;">${company.currency_id.symbol} ${formatLang(total_cumul_balance) }</div>
+ %endif
+ %if amount_currency(data):
+ ## currency balance
+ %if account.report_currency_id:
+ <!--div class="act_as_cell amount sep_left">${formatLang(cumul_balance_curr) | amount }</div-->
+ %else:
+ <div class="act_as_cell sep_left amount">${ u'-' }</div>
+ %endif
+ ## currency code
+ <div class="act_as_cell" style="text-align: right; padding-right: 1px;">${ account.report_currency_id.name if account.report_currency_id else u'' }</div>
+ %endif
+ </div>
+ </div>
+ </div>
+ <%
+ account_total_invoice += total_invoice
+ account_total_payment += total_payment
+ account_total_debit += total_debit
+ account_total_credit += total_credit
+ account_total_manual_move += total_manual_move
+ account_balance_cumul += total_cumul_balance
+ account_balance_cumul_curr += account_balance_cumul
+ %>
+ %endfor
+
+ <div class="act_as_table list_table" style="margin-top:5px;">
+ <div class="act_as_row labels" style="font-weight: bold; font-size: 12px;">
+ <div class="act_as_cell first_column" style="width: 300px;">${account.code} - ${account.name}</div>
+ ## label
+ <div class="act_as_cell" style="width: 302px;">${_("Saldo")}</div>
+ %if currency[0] != 'CRC':
+ ## invoice
+ <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_invoice) }</div>
+ ## payment
+ <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_payment) }</div>
+ ## credit
+ <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_credit) }</div>
+ ## debit
+ <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_debit) }</div>
+ ## manual move
+ <div class="act_as_cell amount" style="width: 115px;">${currency_symbol} ${ formatLang(account_total_manual_move) }</div>
+ ## balance cumulated
+ <div class="act_as_cell amount" style="width: 115px; padding-right: 1px;">${currency_symbol} ${ formatLang(account_balance_cumul) }</div>
+ %else:
+ ## invoice
+ <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_invoice) }</div>
+ ## payment
+ <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_payment) }</div>
+ ## credit
+ <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_credit) }</div>
+ ## debit
+ <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_debit) }</div>
+ ## manual move
+ <div class="act_as_cell amount" style="width: 115px;">${company.currency_id.symbol} ${ formatLang(account_total_manual_move) }</div>
+ ## balance cumulated
+ <div class="act_as_cell amount" style="width: 115px; padding-right: 1px;">${company.currency_id.symbol} ${ formatLang(account_balance_cumul) }</div>
+ %endif
+ %if amount_currency(data):
+ ## currency balance
+ %if account.report_currency_id:
+ <!--div class="act_as_cell amount sep_left" style="width: 80px;">${ formatLang(account_balance_cumul_curr) | amount }</div-->
+ %else:
+ <div class="act_as_cell amount sep_left" style="width: 80px;">${ u'-' }</div>
+ %endif
+ ## curency code
+ <div class="act_as_cell amount" style="width: 30px; text-align: right; padding-right: 1px;">${ account.report_currency_id.name if account.report_currency_id else u'' }</div>
+ %endif
+ </div>
+ </div>
+ </div>
+ %endif
+ %endfor
+ %endfor
+ </body>
+</html>
=== added file 'l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.py'
--- l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,80 @@
+# -*- 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 collections import defaultdict
+from report import report_sxw
+from datetime import datetime
+from itertools import groupby
+from operator import itemgetter
+from mako.template import Template
+
+from tools.translate import _
+
+from openerp.osv import osv
+from openerp.addons.report_webkit import report_helper
+import addons
+
+from l10n_cr_account_financial_report_partner_ledger.report.l10n_cr_account_report_partners_ledger import l10n_cr_PartnersLedgerWebkit
+from report import report_sxw
+
+class l10n_cr_PartnersOpenInvoicesWebkit(l10n_cr_PartnersLedgerWebkit):
+
+ def __init__(self, cursor, uid, name, context):
+ super(l10n_cr_PartnersOpenInvoicesWebkit, self).__init__(cursor, uid, name, context=context)
+ self.pool = pooler.get_pool(self.cr.dbname)
+ self.cursor = self.cr
+
+ company = self.pool.get('res.users').browse(self.cr, uid, uid, context=context).company_id
+ header_report_name = ' - '.join((_('OPEN INVOICES REPORT'), company.name, company.currency_id.name))
+
+ footer_date_time = self.formatLang(str(datetime.today()), date_time=True)
+
+ self.localcontext.update({
+ 'is_open': self.is_open,
+ 'report_name':_('Open Invoices Report'),
+ 'additional_args': [
+ ('--header-font-name', 'Helvetica'),
+ ('--footer-font-name', 'Helvetica'),
+ ('--header-font-size', '10'),
+ ('--footer-font-size', '6'),
+ ('--header-left', header_report_name),
+ ('--header-spacing', '2'),
+ ('--footer-left', footer_date_time),
+ ('--footer-right', ' '.join((_('Page'), '[page]', _('of'), '[topage]'))),
+ ('--footer-line',),
+ ],
+ })
+
+ def is_open(self,cr, uid, account_move_line):
+ move_line_obj = self.pool.get('account.move.line').browse(cr,uid,account_move_line['id'])
+
+ if move_line_obj.reconcile_id.id == False:
+ return True
+ else:
+ return False
+
+report_sxw.report_sxw('report.account_financial_report_open_invoices_webkit',
+ 'account.account',
+ 'addons/l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako',
+ parser=l10n_cr_PartnersOpenInvoicesWebkit)
=== added file 'l10n_cr_account_financial_report_open_invoices/report/report.xml'
--- l10n_cr_account_financial_report_open_invoices/report/report.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_open_invoices/report/report.xml 2013-08-20 07:28:14 +0000
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="account_financial_report_webkit.account_report_open_invoices_webkit" model="ir.actions.report.xml">
+ <field name="report_type">webkit</field>
+ <field name="report_name">account_financial_report_open_invoices_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">Open Invoices Report</field>
+ <field name="report_rml">l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako</field>
+ <field name="report_file">l10n_cr_account_financial_report_open_invoices/report/l10n_cr_account_report_open_invoices.mako</field>
+ </record>
+ </data>
+</openerp>
=== added file 'l10n_cr_account_financial_report_open_invoices/report_menus.xml'
--- l10n_cr_account_financial_report_open_invoices/report_menus.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_open_invoices/report_menus.xml 2013-08-20 07:28:14 +0000
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <menuitem icon="STOCK_PRINT" name="Open Invoices"
+ parent="account.next_id_22" action="action_account_open_invoices_menu_webkit"
+ groups="account.group_account_manager,account.group_account_user" id="account_financial_report_webkit.menu_account_open_invoices"/>
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_financial_report_open_invoices/wizard'
=== added file 'l10n_cr_account_financial_report_open_invoices/wizard/__init__.py'
--- l10n_cr_account_financial_report_open_invoices/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_open_invoices/wizard/__init__.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,22 @@
+# -*- 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_report_open_invoices_wizard
\ No newline at end of file
=== added file 'l10n_cr_account_financial_report_open_invoices/wizard/l10n_cr_account_report_open_invoices_wizard.py'
--- l10n_cr_account_financial_report_open_invoices/wizard/l10n_cr_account_report_open_invoices_wizard.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_open_invoices/wizard/l10n_cr_account_report_open_invoices_wizard.py 2013-08-20 07:28:14 +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/>.
+#
+##############################################################################
+
+from osv import fields, osv
+
+
+class l10n_cr_AccountReportOpenInvoicesWizard(osv.osv_memory):
+ """Will launch partner ledger report and pass required args"""
+
+ _inherit = "open.invoices.webkit"
+ _name = "open.invoices.webkit"
+ _description = "Open Invoices Report"
+
+
+ def pre_print_report(self, cr, uid, ids, data, context=None):
+ data = super(l10n_cr_AccountReportOpenInvoicesWizard, self).pre_print_report(cr, uid, ids, data, context)
+ if context is None:
+ context = {}
+ vals = self.read(cr, uid, ids,
+ ['until_date',],
+ 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_open_invoices_webkit',
+ 'datas': data}
+
=== added file 'l10n_cr_account_financial_report_open_invoices/wizard/l10n_cr_account_report_open_invoices_wizard_view.xml'
--- l10n_cr_account_financial_report_open_invoices/wizard/l10n_cr_account_report_open_invoices_wizard_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_open_invoices/wizard/l10n_cr_account_report_open_invoices_wizard_view.xml 2013-08-20 07:28:14 +0000
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="l10n_cr_account_open_invoices_view_webkit" model="ir.ui.view">
+ <field name="name">Open Invoices Report</field>
+ <field name="model">open.invoices.webkit</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account_financial_report_webkit.account_open_invoices_view_webkit"/>
+ <field name="arch" type="xml">
+ <data>
+ <page string="Layout Options" name="layout_options" position = "replace">
+ <field name="amount_currency" invisible = "True"/>
+ <field name="group_by_currency" invisible = "True"/>
+ </page>
+ </data>
+ </field>
+ </record>
+
+ <record id="action_account_open_invoices_menu_webkit" model="ir.actions.act_window">
+ <field name="name">Open Invoices Report</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">open.invoices.webkit</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="l10n_cr_account_open_invoices_view_webkit"/>
+ <field name="target">new</field>
+ </record>
+
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_financial_report_partner_ledger'
=== added file 'l10n_cr_account_financial_report_partner_ledger/__init__.py'
--- l10n_cr_account_financial_report_partner_ledger/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_partner_ledger/__init__.py 2013-08-20 07:28:14 +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 account
+import wizard
+import report
+
=== added file 'l10n_cr_account_financial_report_partner_ledger/__openerp__.py'
--- l10n_cr_account_financial_report_partner_ledger/__openerp__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_partner_ledger/__openerp__.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,42 @@
+# -*- 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': 'Account Financial Report Partner Ledger',
+ 'description': "",
+ 'version': '1.0',
+ 'author': 'CLEARCORP S.A.',
+ 'category': 'Finance',
+ 'website': "http://clearcorp.co.cr",
+ 'images': [],
+ 'depends': ['account','account_financial_report_webkit'],
+ 'init_xml': [],
+ 'demo_xml' : [],
+ 'update_xml': ['report/report.xml',
+ 'wizard/l10n_cr_partners_ledger_wizard_view.xml',
+ 'report_menus.xml',
+ ],
+ 'test': [],
+ 'active': False,
+ 'installable': True,
+ 'license': 'AGPL-3',
+}
=== added directory 'l10n_cr_account_financial_report_partner_ledger/i18n'
=== added file 'l10n_cr_account_financial_report_partner_ledger/i18n/es_CR.po'
--- l10n_cr_account_financial_report_partner_ledger/i18n/es_CR.po 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_partner_ledger/i18n/es_CR.po 2013-08-20 07:28:14 +0000
@@ -0,0 +1,266 @@
+# Translation of OpenERP Server.
+# This file contains the translation of the following modules:
+# * l10n_cr_account_financial_report_partner_ledger
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: OpenERP Server 6.1\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2013-04-01 19:36+0000\n"
+"PO-Revision-Date: 2013-04-01 19: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_account_financial_report_partner_ledger
+#: constraint:partners.ledger.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_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:195
+msgid "')}</div>\n"
+" <div class=\"act_as_cell amount\" style=\"width: 115px;\">${_('"
+msgstr "')}</div>\n"
+" <div class=\"act_as_cell amount\" style=\"width: 115px;\">${_('"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:21
+msgid "No"
+msgstr "No"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: view:partners.ledger.webkit:0
+msgid "Layout Options"
+msgstr "Opciones de Diseño"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:168
+msgid "Curr."
+msgstr "Curr."
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:187
+msgid "')}</div>\n"
+" ## journal\n"
+" <div class=\"act_as_cell\" style=\"width: 70px;\">${_('"
+msgstr "')}</div>\n"
+" ## journal\n"
+" <div class=\"act_as_cell\" style=\"width: 70px;\">${_('"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:159
+msgid "Debit"
+msgstr "Débito"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:39
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:190
+msgid "Initial Balance"
+msgstr "Balance inicial"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:443
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:445
+msgid "Total for Accounts in "
+msgstr "Total de cuentas en "
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:145
+msgid "Journal"
+msgstr "Diario"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: constraint:account.account:0
+msgid "Error ! You can not create recursive accounts."
+msgstr "¡Error! No se pueden crear cuentas recursivas."
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:332
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:397
+msgid "Saldo"
+msgstr "Saldo"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:139
+msgid "Date"
+msgstr "Fecha"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:28
+msgid "Chart of Account"
+msgstr "Catálogo de cuentas"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:95
+msgid "Accounts in "
+msgstr "Cuentas en "
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:38
+msgid "Target Moves"
+msgstr "Movimientos destino"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:45
+msgid "From:"
+msgstr "Desde:"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:59
+msgid "To:"
+msgstr "Hasta:"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: model:ir.model,name:l10n_cr_account_financial_report_partner_ledger.model_account_account
+msgid "Account"
+msgstr "Cuenta"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: 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_account_financial_report_partner_ledger
+#: model:ir.model,name:l10n_cr_account_financial_report_partner_ledger.model_partners_ledger_webkit
+msgid "Partner Ledger Report"
+msgstr "Reporte de Libro Mayor de Empresa"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: constraint:partners.ledger.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_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:157
+msgid "Credit"
+msgstr "Crédito"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:29
+msgid "Fiscal Year"
+msgstr "Año fiscal"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: model:ir.actions.act_window,name:l10n_cr_account_financial_report_partner_ledger.action_account_partners_ledger_menu_webkit
+msgid "Partner Ledger"
+msgstr "Libro Mayor de Empresa"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:37
+msgid "Accounts Filter"
+msgstr "Filtro de cuentas"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:161
+msgid "Manual Move"
+msgstr "Movimientos manuales"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:143
+msgid "Entry"
+msgstr "Apunte"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:149
+msgid "Label"
+msgstr "Etiqueta"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:70
+msgid "Custom Filter"
+msgstr "Filtro personalizado"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:21
+msgid "Computed"
+msgstr "Procesado"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:163
+msgid "Cumul. Bal."
+msgstr "Bal. Acumul."
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:151
+msgid "Rec."
+msgstr "Rec."
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:191
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:193
+msgid "')}</div>\n"
+" <div class=\"act_as_cell amount\" style=\"width: 100px;\">${_('"
+msgstr "')}</div>\n"
+" <div class=\"act_as_cell amount\" style=\"width: 100px;\">${_('"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: 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_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:34
+msgid "Periods Filter"
+msgstr "Periods Filter"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:141
+msgid "Period"
+msgstr "Período"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:32
+msgid "Dates Filter"
+msgstr "Filtros de fechas"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:134
+msgid "No Partner"
+msgstr "Sin empresa"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:183
+msgid "')}</div>\n"
+" ## period\n"
+" <div class=\"act_as_cell\" style=\"width: 70px;\">${_('"
+msgstr "')}</div>\n"
+" ## period\n"
+" <div class=\"act_as_cell\" style=\"width: 70px;\">${_('"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:153
+msgid "Invoice"
+msgstr "Factura"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: 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_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:147
+msgid "Partner"
+msgstr "Empresa"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:155
+msgid "Payments"
+msgstr "Pagos"
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:166
+msgid "Curr. Balance"
+msgstr "Balance Act."
+
+#. module: l10n_cr_account_financial_report_partner_ledger
+#: report:addons/l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako:21
+msgid "Opening Entries"
+msgstr "Opening Entries"
+
=== added directory 'l10n_cr_account_financial_report_partner_ledger/report'
=== added file 'l10n_cr_account_financial_report_partner_ledger/report/__init__.py'
--- l10n_cr_account_financial_report_partner_ledger/report/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_partner_ledger/report/__init__.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,22 @@
+# -*- 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_report_partners_ledger
\ No newline at end of file
=== added file 'l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako'
--- l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako 2013-08-20 07:28:14 +0000
@@ -0,0 +1,480 @@
+<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <style type="text/css">
+ .overflow_ellipsis {
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ }
+ ${css}
+ </style>
+</head>
+<body>
+ <%!
+ def amount(text):
+ return text.replace('-', '‑') # replace by a non-breaking hyphen (it will not word-wrap between hyphen and numbers)
+ %>
+ <%
+ setLang(user.context_lang)
+
+ initial_balance_text = {'initial_balance': _('Computed'), 'opening_balance': _('Opening Entries'), False: _('No')}
+ filter_type = ''
+ filter_data = []
+ %>
+
+ <div class="act_as_table data_table">
+ <div class="act_as_row labels">
+ <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')}
+ %else:
+ ${_('Periods Filter')}
+ %endif
+ </div>
+ <div class="act_as_cell">${_('Accounts Filter')}</div>
+ <div class="act_as_cell">${_('Target Moves')}</div>
+ <div class="act_as_cell">${_('Initial Balance')}</div>
+ </div>
+ <div class="act_as_row">
+ <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">
+ ${_('From:')}
+ %if filter_form(data) == 'filter_date':
+ ${formatLang(start_date, date=True) if start_date else u'' }
+ <%
+ filter_data.append(start_date)
+ filter_type = 'filter_date'
+ %>
+ %else:
+ ${start_period.name if start_period else u''}
+ <%
+ filter_data.append(start_period)
+ filter_type = 'filter_period'
+ %>
+ %endif
+ ${_('To:')}
+ %if filter_form(data) == 'filter_date':
+ ${ formatLang(stop_date, date=True) if stop_date else u'' }
+ <% filter_data.append(stop_date) %>
+ %else:
+ ${stop_period.name if stop_period else u'' }
+ <% filter_data.append(stop_period) %>
+ %endif
+ </div>
+ <div class="act_as_cell">
+ %if partner_ids:
+ ${_('Custom Filter')}
+ %else:
+ ${ display_partner_account(data) }
+ %endif
+ </div>
+ <div class="act_as_cell">${ display_target_move(data) }</div>
+ <div class="act_as_cell">${ initial_balance_text[initial_balance_mode] }</div>
+ </div>
+ </div>
+ <%
+ account_by_curr = get_accounts_by_curr(cr, uid, objects)
+ %>
+ %for currency in account_by_curr:
+ %if currency[0] != 'CRC':
+ <%currency_symbol = get_currency_symbol(cr, uid, currency[0]) %>
+ %endif
+ <%
+ currency_total_invoice = 0.0
+ currency_total_payment = 0.0
+ currency_total_debit = 0.0
+ currency_total_credit = 0.0
+ currency_total_manual_move = 0.0
+ currency_balance_accumulated = 0.0
+ %>
+
+ <div class="account_title bg" style="margin-top: 20px; font-size: 14px; width: 100%;">${_('Accounts in ')} ${currency[0]}</div>
+
+ %for account in currency[1]:
+ %if account.ledger_lines or account.init_balance:
+ <%
+ if not account.partners_order:
+ continue
+ account_total_invoice = 0.0
+ account_total_payment = 0.0
+ account_total_debit = 0.0
+ account_total_credit = 0.0
+ account_total_manual_move = 0.0
+ account_balance_accumulated = 0.0
+ account_balance_accumulated_curr = 0.0
+ %>
+
+ <div class="account_title bg" style="width: 100%; margin-top: 15px; font-size: 12px;">${account.code} - ${account.name} - ${account.report_currency_id.name or account.company_id.currency_id.name}</div>
+
+ %for partner_name, p_id, p_ref, p_name in account.partners_order:
+ <%
+ total_invoice = 0.0
+ total_payment = 0.0
+ total_debit = 0.0
+ total_credit = 0.0
+ total_manual_move = 0.0
+ accumulated_balance = 0.0
+ accumulated_balance_curr = 0.0
+ total_accumulated_balance = 0.0
+
+ partner_accumulated_balance = 0.0
+ partner_accumulated_balance_curr = 0.0
+
+ partner_accumulated_balance = account.init_balance.get(p_id, {}).get('init_balance') or 0.0
+ init_balance = 0.0
+ init_balance = get_initial_balance(cr, uid, p_id, account, filter_type, filter_data, fiscal_year, currency[0])
+ accumulated_balance = init_balance
+ %>
+ <div class="act_as_table list_table" style="margin-top: 5px;">
+ <div class="act_as_caption account_title">
+ ${ get_partner_name(cr, uid, partner_name, p_id, p_ref, p_name) or _('No Partner')}
+ </div>
+ <div class="act_as_thead">
+ <div class="act_as_row labels">
+ ## date
+ <div class="act_as_cell first_column" style="width: 50px;">${_('Date')}</div>
+ ## period
+ <div class="act_as_cell" style="width: 70px;">${_('Period')}</div>
+ ## move
+ <div class="act_as_cell" style="width: 70px;">${_('Entry')}</div>
+ ## journal
+ <div class="act_as_cell" style="width: 70px;">${_('Journal')}</div>
+ ## partner
+ <!--div class="act_as_cell" style="width: 60px;">${_('Partner')}</div-->
+ ## label
+ <div class="act_as_cell" style="width: 270px;">${_('Label')}</div>
+ ## reconcile
+ <div class="act_as_cell" style="width: 70px;">${_('Rec.')}</div>
+ ## Invoices
+ <div class="act_as_cell amount" style="width: 100px;">${_('Invoice')}</div>
+ ## credit
+ <div class="act_as_cell amount" style="width: 100px;">${_('Payments')}</div>
+ ## debit
+ <div class="act_as_cell amount" style="width: 100px;">${_('Credit')}</div>
+ ## Payments
+ <div class="act_as_cell amount" style="width: 100px;">${_('Debit')}</div>
+ ## Manual Move
+ <div class="act_as_cell amount" style="width: 115px;">${_('Manual Move')}</div>
+ ## balance cumulated
+ <div class="act_as_cell amount" style="width: 115px;">${_('Cumul. Bal.')}</div>
+ %if amount_currency(data):
+ ## currency balance
+ <div class="act_as_cell amount sep_left" style="width: 80px;">${_('Curr. Balance')}</div>
+ ## curency code
+ <div class="act_as_cell amount" style="width: 30px; text-align: right;">${_('Curr.')}</div>
+ %endif
+ </div>
+ </div>
+ <div class="act_as_tbody">
+ %if initial_balance_mode and (total_debit or total_credit):
+ <%
+ #partner_accumulated_balance = account.init_balance.get(p_id, {}).get('init_balance') or 0.0
+ #partner_accumulated_balance_curr = account.init_balance.get(p_id, {}).get('init_balance_currency') or 0.0
+ #balance_forward_currency = account.init_balance.get(p_id, {}).get('currency_name') or ''
+
+ #accumulated_balance += partner_accumulated_balance
+ #accumulated_balance_curr += partner_accumulated_balance_curr
+ %>
+ %endif
+ <div class="act_as_cell first_column" style="width: 50px;">${_('')}</div>
+ ## period
+ <div class="act_as_cell" style="width: 70px;">${_('')}</div>
+ ## move
+ <div class="act_as_cell" style="width: 70px;">${_('')}</div>
+ ## journal
+ <div class="act_as_cell" style="width: 70px;">${_('')}</div>
+ <div class="act_as_cell" style="width: 270px; font-size:10px; font-weight: bold;">${_('Initial Balance')}</div>
+ <div class="act_as_cell" style="width: 70px;">${_('')}</div>
+ <div class="act_as_cell amount" style="width: 100px;">${_('')}</div>
+ <div class="act_as_cell amount" style="width: 100px;">${_('')}</div>
+ <div class="act_as_cell amount" style="width: 100px;">${_('')}</div>
+ <div class="act_as_cell amount" style="width: 100px;">${_('')}</div>
+ <div class="act_as_cell amount" style="width: 115px;">${_('')}</div>
+ <div class="act_as_cell amount" style="width: 115px; font-size:10px; font-weight: bold;">${formatLang(init_balance)}</div>
+
+ <%total_accumulated_balance = init_balance %>
+
+ %for line in account.ledger_lines.get(p_id, []):
+ <%
+ label_elements = [line.get('lname') or '']
+ if line.get('invoice_number'):
+ label_elements.append("(%s)" % (line['invoice_number'],))
+ label = ' '.join(label_elements)
+
+ invoice_amount = 0.0
+ payment_amount = 0.0
+ credit_amount = 0.0
+ debit_amount = 0.0
+ MM_amount = 0.0
+
+ amount = get_amount(cr, uid, line, currency[0])
+ %>
+ <div class="act_as_row lines">
+ ## date
+ <div class="act_as_cell first_column">${formatLang(line.get('ldate') or '', date=True)}</div>
+ ## period
+ <div class="act_as_cell">${line.get('period_code') or ''}</div>
+ ## move
+ <div class="act_as_cell">${line.get('move_name') or ''}</div>
+ ## journal
+ <div class="act_as_cell">${line.get('jcode') or ''}</div>
+ ## partner
+ <!--div class="act_as_cell overflow_ellipsis">${line.get('partner_name') or ''}</div-->
+ ## label
+ <div class="act_as_cell">${label}</div>
+ ## reconcile
+ <div class="act_as_cell">${line.get('rec_name') or ''}</div>
+ ## Invoice
+ <div class="act_as_cell amount">
+ %if amount[0] == 'invoice':
+ <%
+ invoice_amount = amount[1]
+ total_invoice += invoice_amount
+ %>
+ ${ formatLang(invoice_amount or 0.0) }
+ %else:
+ ${'0.0'}
+ %endif
+ %if amount[2] != None and amount[0] == 'invoice':
+ ${' ('}${ formatLang(amount[2]) }${')'}
+ %endif
+ </div>
+ ## Payment
+ <div class="act_as_cell amount">
+ %if amount[0] == 'payment':
+ <%
+ payment_amount = amount[1]
+ total_payment += payment_amount
+ %>
+ ${ formatLang(payment_amount or 0.0) }
+ %else:
+ ${'0.0'}
+ %endif
+ %if amount[2] != None and amount[0] == 'payment':
+ ${' ('}${ formatLang(amount[2]) }${')'}
+ %endif
+ </div>
+ ## Credit
+ <div class="act_as_cell amount">
+ %if amount[0] == 'credit':
+ <%
+ credit_amount = amount[1]
+ total_credit += credit_amount
+ %>
+ ${ formatLang(credit_amount or 0.0) }
+ %else:
+ ${'0.0'}
+ %endif
+ %if amount[2] != None and amount[0] == 'credit':
+ ${' ('}${ formatLang(amount[2]) }${')'}
+ %endif
+ </div>
+ ## Debit
+ <div class="act_as_cell amount">
+ %if amount[0] == 'debit':
+ <%
+ debit_amount = amount[1]
+ total_debit += debit_amount
+ %>
+ ${ formatLang(debit_amount or 0.0) }
+ %else:
+ ${'0.0'}
+ %endif
+ %if amount[2] != None and amount[0] == 'debit':
+ ${' ('}${ formatLang(amount[2]) }${')'}
+ %endif
+ </div>
+ ## Manual move
+ <div class="act_as_cell amount">
+ %if amount[0] == 'manual':
+ <%
+ MM_amount = amount[1]
+ total_manual_move += MM_amount
+ %>
+ ${ formatLang(MM_amount or 0.0) }
+ %else:
+ ${'0.0'}
+ %endif
+ %if amount[2] != None and amount[0] == 'manual':
+ ${' ('}${ formatLang(amount[2]) }${')'}
+ %endif
+ </div>
+ ## balance cumulated
+ <%
+ accumulated_balance = (invoice_amount+payment_amount+credit_amount+debit_amount+MM_amount) or 0.0
+ total_accumulated_balance += accumulated_balance
+ %>
+ <div class="act_as_cell amount" style="padding-right: 1px;">${formatLang(total_accumulated_balance) }</div>
+ %if amount_currency(data):
+ ## currency balance
+ <div class="act_as_cell sep_left amount">${formatLang(line.get('amount_currency') or 0.0) }</div>
+ ## curency code
+ <div class="act_as_cell" style="text-align: right; ">${line.get('currency_code') or ''}</div>
+ %endif
+ </div>
+ %endfor
+ <div class="act_as_row lines labels">
+ ## date
+ <div class="act_as_cell first_column"></div>
+ ## period
+ <div class="act_as_cell"></div>
+ ## move
+ <div class="act_as_cell"></div>
+ ## journal
+ <div class="act_as_cell"></div>
+ ## partner
+ <div class="act_as_cell"></div>
+ ## label
+ <div class="act_as_cell">${_('Saldo')}</div>
+ ## reconcile
+ <!--div class="act_as_cell"></div-->
+ %if currency[0] != 'CRC':
+ ## invoice
+ <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_invoice) }</div>
+ ## payment
+ <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_payment) }</div>
+ ## credit
+ <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_credit) }</div>
+ ## debit
+ <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_debit) }</div>
+ ## manual move
+ <div class="act_as_cell amount">${currency_symbol} ${formatLang(total_manual_move) }</div>
+ ## balance cumulated
+ <div class="act_as_cell amount" style="padding-right: 1px;">${currency_symbol} ${formatLang(total_accumulated_balance) }</div>
+ %else:
+ ## invoice
+ <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_invoice) }</div>
+ ## payment
+ <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_payment) }</div>
+ ## credit
+ <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_credit) }</div>
+ ## debit
+ <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_debit) }</div>
+ ## manual move
+ <div class="act_as_cell amount">${company.currency_id.symbol} ${formatLang(total_manual_move) }</div>
+ ## balance cumulated
+ <div class="act_as_cell amount" style="padding-right: 1px;">${company.currency_id.symbol} ${formatLang(total_accumulated_balance) }</div>
+ %endif
+ %if amount_currency(data):
+ ## currency balance
+ %if account.report_currency_id:
+ <!--div class="act_as_cell amount sep_left">${formatLang(accumulated_balance_curr) | amount }</div-->
+ %else:
+ <div class="act_as_cell sep_left amount">${ u'-' }</div>
+ %endif
+ ## currency code
+ <div class="act_as_cell" style="text-align: right; padding-right: 1px;">${ account.report_currency_id.name if account.report_currency_id else u'' }</div>
+ %endif
+ </div>
+ </div>
+ </div>
+ <%
+ account_total_invoice += total_invoice
+ account_total_payment += total_payment
+ account_total_debit += total_debit
+ account_total_credit += total_credit
+ account_total_manual_move += total_manual_move
+ account_balance_accumulated += total_accumulated_balance
+ account_balance_accumulated_curr += account_balance_accumulated
+
+ currency_total_invoice += total_invoice
+ currency_total_payment += total_payment
+ currency_total_debit += total_debit
+ currency_total_credit += total_credit
+ currency_total_manual_move += total_manual_move
+ currency_balance_accumulated += total_accumulated_balance
+ %>
+ %endfor
+
+ <div class="act_as_table list_table" style="margin-top:5px;">
+ <div class="act_as_row labels" style="font-weight: bold; font-size: 12px;">
+ <div class="act_as_cell first_column" style="width: 300px;">${account.code} - ${account.name}</div>
+ ## label
+ <div class="act_as_cell" style="width: 302px;">${_("Saldo")}</div>
+ %if currency[0] != 'CRC':
+ ## invoice
+ <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_invoice) }</div>
+ ## payment
+ <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_payment) }</div>
+ ## credit
+ <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_credit) }</div>
+ ## debit
+ <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(account_total_debit) }</div>
+ ## manual move
+ <div class="act_as_cell amount" style="width: 115px;">${currency_symbol} ${ formatLang(account_total_manual_move) }</div>
+ ## balance cumulated
+ <div class="act_as_cell amount" style="width: 115px; padding-right: 1px;">${currency_symbol} ${ formatLang(account_balance_accumulated) }</div>
+ %else:
+ ## invoice
+ <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_invoice) }</div>
+ ## payment
+ <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_payment) }</div>
+ ## credit
+ <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_credit) }</div>
+ ## debit
+ <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(account_total_debit) }</div>
+ ## manual move
+ <div class="act_as_cell amount" style="width: 115px;">${company.currency_id.symbol} ${ formatLang(account_total_manual_move) }</div>
+ ## balance cumulated
+ <div class="act_as_cell amount" style="width: 115px; padding-right: 1px;">${company.currency_id.symbol} ${ formatLang(account_balance_accumulated) }</div>
+ %endif
+ %if amount_currency(data):
+ ## currency balance
+ %if account.report_currency_id:
+ <!--div class="act_as_cell amount sep_left" style="width: 80px;">${ formatLang(account_balance_accumulated_curr) | amount }</div-->
+ %else:
+ <div class="act_as_cell amount sep_left" style="width: 80px;">${ u'-' }</div>
+ %endif
+ ## curency code
+ <div class="act_as_cell amount" style="width: 30px; text-align: right; padding-right: 1px;">${ account.report_currency_id.name if account.report_currency_id else u'' }</div>
+ %endif
+ </div>
+ </div>
+ </div>
+ %endif
+ %endfor
+ <div class="act_as_table list_table" style="margin-top:5px;">
+ <div class="act_as_row labels" style="font-weight: bold; font-size: 12px;">
+ %if currency[0] != 'CRC':
+ <div class="act_as_cell first_column" style="width: 300px;">${_('Total for Accounts in ')} ${currency[0]}</div>
+ %else:
+ <div class="act_as_cell first_column" style="width: 300px;">${_('Total for Accounts in ')} ${company.currency_id.name}</div>
+ %endif
+ ## label
+ <div class="act_as_cell" style="width: 302px;"></div>
+ %if currency[0] != 'CRC':
+ ## invoice
+ <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(currency_total_invoice) }</div>
+ ## payment
+ <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(currency_total_payment) }</div>
+ ## credit
+ <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(currency_total_credit) }</div>
+ ## debit
+ <div class="act_as_cell amount" style="width: 100px;">${currency_symbol} ${ formatLang(currency_total_debit) }</div>
+ ## manual move
+ <div class="act_as_cell amount" style="width: 115px;">${currency_symbol} ${ formatLang(currency_total_manual_move) }</div>
+ ## balance cumulated
+ <div class="act_as_cell amount" style="width: 115px; padding-right: 1px;">${currency_symbol} ${ formatLang(currency_balance_accumulated) }</div>
+ %else:
+ ## invoice
+ <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(currency_total_invoice) }</div>
+ ## payment
+ <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(currency_total_payment) }</div>
+ ## credit
+ <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(currency_total_credit) }</div>
+ ## debit
+ <div class="act_as_cell amount" style="width: 100px;">${company.currency_id.symbol} ${ formatLang(currency_total_debit) }</div>
+ ## manual move
+ <div class="act_as_cell amount" style="width: 115px;">${company.currency_id.symbol} ${ formatLang(currency_total_manual_move) }</div>
+ ## balance cumulated
+ <div class="act_as_cell amount" style="width: 115px; padding-right: 1px;">${company.currency_id.symbol} ${ formatLang(currency_balance_accumulated) }</div>
+ %endif
+ </div>
+ </div>
+ %endfor
+</body>
+</html>
=== added file 'l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.py'
--- l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,183 @@
+# -*- 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 collections import defaultdict
+from report import report_sxw
+from osv import osv
+from tools.translate import _
+from datetime import datetime
+
+from openerp.addons.account_financial_report_webkit.report.partners_ledger import PartnersLedgerWebkit
+from report import report_sxw
+
+class l10n_cr_PartnersLedgerWebkit(PartnersLedgerWebkit):
+
+ def __init__(self, cursor, uid, name, context):
+ super(l10n_cr_PartnersLedgerWebkit, self).__init__(cursor, uid, name, context=context)
+ self.pool = pooler.get_pool(self.cr.dbname)
+ self.cursor = self.cr
+
+ self.localcontext.update({
+ 'get_amount': self.get_amount,
+ 'get_partner_name': self.get_partner_name,
+ 'get_accounts_by_curr': self.get_accounts_by_curr,
+ 'get_currency_symbol': self.get_currency_symbol,
+ 'get_initial_balance': self.get_initial_balance,
+ })
+
+ def get_accounts_by_curr(self, cr, uid, objects):
+ currency_names_list = []
+ accounts_curr_list = []
+ accounts_by_curr = []
+
+ for account in objects:
+ currency_name = account.report_currency_id.name
+ if currency_name not in currency_names_list:
+ currency_names_list.append(currency_name)
+
+ for currency_name in currency_names_list:
+ account_by_curr = []
+ for account in objects:
+ if account.report_currency_id.name == currency_name:
+ account_by_curr.append(account)
+ accounts_curr_list.append(account_by_curr)
+
+ i = 0
+ for currency_name in currency_names_list:
+ temp_tup = (currency_name, accounts_curr_list[i])
+ accounts_by_curr.append(temp_tup)
+ i += 1
+
+ return accounts_by_curr
+
+ 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'])
+
+ obj_invoice = self.pool.get('account.invoice')
+ invoice_search = obj_invoice.search(cr,uid,[('move_id','=',account_move_line['move_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'])])
+
+ 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 != 'CRC':
+ 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)
+ # Manual Move
+ else:
+ res = ('manual', 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_partner_name(self,cr,uid,partner_name, p_id, p_ref, p_name):
+
+ res = ''
+ if p_ref != None and p_name != None:
+ res = res+p_ref+' '+p_name
+ else:
+ res = partner_name
+
+
+ return res
+
+ def get_currency_symbol(self, cr, uid, currency_name, context=None):
+ currency_obj = self.pool.get('res.currency')
+
+ currency_id = currency_obj.search(cr, uid, [('name', '=', currency_name)], context=context)[0]
+ currency = currency_obj.browse(cr, uid, currency_id)
+
+ return currency.symbol
+
+ def get_initial_balance(self, cr, uid, partner, account, filter_type, filter_data, fiscal_year, currency, context=None):
+ date_start = ''
+ initial_balance = 0.0
+
+ if filter_type == '':
+ date_start = fiscal_year.date_start
+ move_lines_id = self.pool.get('account.move.line').search(cr, uid, [('account_id', '=', account.id), ('partner_id', '=', partner), ('period_id.fiscalyear_id.date_start', '<', date_start), ('reconcile_id', '=', False)], context=context)
+ else:
+ if filter_type == 'filter_period':
+ date_start = filter_data[0].date_start
+ move_lines_id = self.pool.get('account.move.line').search(cr, uid, [('account_id', '=', account.id), ('partner_id', '=', partner), ('period_id.date_start', '<', date_start), ('reconcile_id', '=', False)], context=context)
+ elif filter_type == 'filter_date':
+ date_start = filter_data[0]
+ move_lines_id = self.pool.get('account.move.line').search(cr, uid, [('account_id', '=', account.id), ('partner_id', '=', partner), ('date', '<', date_start), ('reconcile_id', '=', False)], context=context)
+
+ move_lines = self.pool.get('account.move.line').browse(cr, uid, move_lines_id)
+
+ amount = 0.0
+ for move_line in move_lines:
+ if currency != 'CRC':
+ amount = move_line.amount_currency
+ else:
+ if move_line.debit != 0.0 :
+ amount = move_line.debit
+ elif move_line.credit != 0.0 :
+ amount = move_line.credit * -1
+ initial_balance += amount
+
+ return initial_balance
+
+report_sxw.report_sxw('report.account_financial_report_partners_ledger_webkit',
+ 'account.account',
+ 'addons/l10n_cr_account_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako',
+ parser=l10n_cr_PartnersLedgerWebkit)
\ No newline at end of file
=== added file 'l10n_cr_account_financial_report_partner_ledger/report/report.xml'
--- l10n_cr_account_financial_report_partner_ledger/report/report.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_partner_ledger/report/report.xml 2013-08-20 07:28:14 +0000
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <report auto="False"
+ id="account_financial_report_webkit.account_report_partners_ledger_webkit"
+ model="account.account"
+ name="account_financial_report_partners_ledger_webkit"
+ file="l10n_cr_account_financial_report_partner_ledger/report/l10n_cr_account_report_partners_ledger.mako"
+ string="Partner Ledger"
+ report_type="webkit" />
+
+ </data>
+</openerp>
=== added file 'l10n_cr_account_financial_report_partner_ledger/report_menus.xml'
--- l10n_cr_account_financial_report_partner_ledger/report_menus.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_partner_ledger/report_menus.xml 2013-08-20 07:28:14 +0000
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+ <menuitem icon="STOCK_PRINT" name="Partner Ledger"
+ parent="account.next_id_22" action="action_account_partners_ledger_menu_webkit"
+ groups="account.group_account_manager,account.group_account_user" id="account.menu_account_partner_ledger"/>
+
+ </data>
+</openerp>
=== added directory 'l10n_cr_account_financial_report_partner_ledger/wizard'
=== added file 'l10n_cr_account_financial_report_partner_ledger/wizard/__init__.py'
--- l10n_cr_account_financial_report_partner_ledger/wizard/__init__.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_partner_ledger/wizard/__init__.py 2013-08-20 07:28:14 +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_partners_ledger_wizard
\ No newline at end of file
=== added file 'l10n_cr_account_financial_report_partner_ledger/wizard/l10n_cr_partners_ledger_wizard.py'
--- l10n_cr_account_financial_report_partner_ledger/wizard/l10n_cr_partners_ledger_wizard.py 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_partner_ledger/wizard/l10n_cr_partners_ledger_wizard.py 2013-08-20 07:28:14 +0000
@@ -0,0 +1,43 @@
+# -*- 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_AccountReportPartnersLedgerWizard(osv.osv_memory):
+ """Will launch partner ledger report and pass required args"""
+
+ _inherit = "partners.ledger.webkit"
+ _name = "partners.ledger.webkit"
+ _description = "Partner Ledger Report"
+
+
+ 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_partners_ledger_webkit',
+ 'datas': data}
+
=== added file 'l10n_cr_account_financial_report_partner_ledger/wizard/l10n_cr_partners_ledger_wizard_view.xml'
--- l10n_cr_account_financial_report_partner_ledger/wizard/l10n_cr_partners_ledger_wizard_view.xml 1970-01-01 00:00:00 +0000
+++ l10n_cr_account_financial_report_partner_ledger/wizard/l10n_cr_partners_ledger_wizard_view.xml 2013-08-20 07:28:14 +0000
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+ <data>
+
+ <record id="l10n_cr_account_partner_ledger_view_webkit" model="ir.ui.view">
+ <field name="name">Partner Ledger</field>
+ <field name="model">partners.ledger.webkit</field>
+ <field name="type">form</field>
+ <field name="inherit_id" ref="account_financial_report_webkit.account_partner_ledger_view_webkit"/>
+ <field name="arch" type="xml">
+ <data>
+ <page string="Layout Options" name="layout_options" position = "replace">
+ <field name="amount_currency" invisible = "True"/>
+ </page>
+ <field name="period_from" position="attributes">
+ <attribute name="domain">[('fiscalyear_id', '=', fiscalyear_id)]</attribute>
+ </field>
+ <field name="period_to" position="attributes">
+ <attribute name="domain">[('fiscalyear_id', '=', fiscalyear_id)]</attribute>
+ </field>
+ <field name="fiscalyear_id" position="attributes">
+ <attribute name="required">True</attribute>
+ </field>
+ </data>
+ </field>
+ </record>
+
+ <record id="action_account_partners_ledger_menu_webkit" model="ir.actions.act_window">
+ <field name="name">Partner Ledger</field>
+ <field name="type">ir.actions.act_window</field>
+ <field name="res_model">partners.ledger.webkit</field>
+ <field name="view_type">form</field>
+ <field name="view_mode">form</field>
+ <field name="view_id" ref="l10n_cr_account_partner_ledger_view_webkit"/>
+ <field name="target">new</field>
+ </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-04-24 16:35:34 +0000
+++ l10n_cr_account_voucher_check_bcr/l10n_cr_account_voucher_check_bcr_view.xml 2013-08-20 07:28:14 +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">
<field name="name">Check Payment</field>
@@ -40,8 +41,36 @@
</field>
</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>
+
+>>>>>>> MERGE-SOURCE
<menuitem action="action_check_payment" icon="STOCK_JUSTIFY_FILL" sequence="12"
id="menu_action_vendor_payment" parent="account.menu_finance_payables"/>
- </data>
+
+ </data>
</openerp>
=== added directory 'l10n_cr_exchange_rates'
=== 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-08-20 07:28:14 +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-08-20 07:28:14 +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-08-20 07:28:14 +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-08-20 07:28:14 +0000
@@ -0,0 +1,186 @@
+# -*- 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, id, context):
+ cr.execute( 'SELECT SUM(debit-credit) '\
+ 'FROM account_move_line '\
+ 'WHERE move_id = %s ', (id,))
+ result = cr.fetchall()
+ return result[0][0] or 0.00
+
+ def generate_adjustment_move(self, cr, uid, reference, journal, period, context=None):
+ move_line_obj = self.pool.get('account.move.line')
+ res_currency_obj = self.pool.get('res.currency')
+ res_currency_rate_obj = self.pool.get('res.currency.rate')
+
+ res_user = self.pool.get('res.users').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)
+
+ total_credit = 0.00
+ total_debit = 0.00
+ exchange_rate_end_period = res_currency_obj._current_rate(cr, uid, [company_currency.id], period.date_stop, arg=None, context=context)[company_currency.id]
+
+ account_ids = self.pool.get('account.account').search(cr, uid, [('exchange_rate_adjustment', '=', True)], context=context)
+ line_ids = move_line_obj.search(cr, uid, [('currency_id','!=',None), ('period_id','=',period.id), ('amount_currency','!=',0), ('account_id','in',account_ids), ('adjustment','=',None)], context=context)
+ lines = move_line_obj.browse(cr, uid, line_ids, context=context)
+
+
+ for line in lines:
+ 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
+ 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
+ else:
+ credit = sign * line_difference
+ 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_created_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,
+ }
+ line_created_id = move_line_obj.create(cr, uid, move_line)
+ move_line_obj.write(cr, uid, [line.id], {'adjustment' : line_created_id})
+
+ amount = self.get_balance_amount(cr, uid, move_created_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_created_id,
+ 'period_id': period.id,
+ 'journal_id': journal.id,
+ 'currency_id': False,
+ 'amount_currency': 0.00,
+ 'state': 'valid',
+ 'company_id': res_user.company_id.id,
+ }
+ line_created_id = move_line_obj.create(cr, uid, move_line)
+ 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-08-20 07:28:14 +0000
@@ -0,0 +1,61 @@
+<?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="type">form</field>
+ <field name="arch" type="xml">
+ <field name="currency_mode" position="after">
+ <field name="exchange_rate_adjustment" groups="base.group_extended"/>
+ </field>
+ </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-08-20 07:28:14 +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-08-20 07:28:14 +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-08-20 07:28:14 +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>
=== modified file 'l10n_cr_hr_payroll/l10n_cr_hr_payroll.py'
--- l10n_cr_hr_payroll/l10n_cr_hr_payroll.py 2013-06-03 21:42:37 +0000
+++ l10n_cr_hr_payroll/l10n_cr_hr_payroll.py 2013-08-20 07:28:14 +0000
@@ -35,6 +35,7 @@
_inherit = 'hr.contract'
_description = 'Employee Contract'
_columns = {
+ 'working_hours': fields.many2one('resource.calendar','Working Schedule', required=True),
'schedule_pay': fields.selection([
('fortnightly', 'Fortnightly'),
('monthly', 'Monthly'),
@@ -92,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)
@@ -100,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):
=== modified file 'l10n_cr_hr_payroll/report/payroll_report.py'
--- l10n_cr_hr_payroll/report/payroll_report.py 2013-01-10 22:07:39 +0000
+++ l10n_cr_hr_payroll/report/payroll_report.py 2013-08-20 07:28:14 +0000
@@ -64,20 +64,22 @@
return res
def get_hn(self,line_ids):
- code = 'HN'
- res = 0
+ code1 = 'HN'
+ code2 = 'HNM'
+ res = 0.00
for line in line_ids:
- if line.code == code:
- res += line.number_of_hours
-
+ if line.code == code1:
+ res += line.number_of_hours
+ elif line.code == code2:
+ res += line.number_of_hours
return res
def get_he(self,line_ids):
code = 'HE'
- res = 0
+ res = 0.00
for line in line_ids:
if line.code == code:
- res += line.number_of_hours
+ res += line.number_of_hours
return res
=== modified file 'l10n_cr_hr_payroll/report/payroll_report_for_month.py'
--- l10n_cr_hr_payroll/report/payroll_report_for_month.py 2013-05-06 15:32:33 +0000
+++ l10n_cr_hr_payroll/report/payroll_report_for_month.py 2013-08-20 07:28:14 +0000
@@ -131,11 +131,14 @@
return res
def get_hn(self, cr, uid, payslips):
- code = 'HN'
+ code1 = 'HN'
+ code2 = 'HNM'
res = 0.00
for payslip in payslips:
- for line in payslip.line_ids:
- if line.code == code:
+ for line in payslip.worked_days_line_ids:
+ if line.code == code1:
+ res += line.number_of_hours
+ elif line.code == code2:
res += line.number_of_hours
return res
@@ -143,7 +146,7 @@
code = 'HE'
res = 0.00
for payslip in payslips:
- for line in payslip.line_ids:
+ for line in payslip.worked_days_line_ids:
if line.code == code:
res += line.number_of_hours
return res
Follow ups