diff --git a/__unported__/account_statement_l10n_br_cnab240_import/__openerp__.py b/__unported__/account_statement_l10n_br_cnab240_import/__openerp__.py
index 8a983dc..4b98065 100644
--- a/__unported__/account_statement_l10n_br_cnab240_import/__openerp__.py
+++ b/__unported__/account_statement_l10n_br_cnab240_import/__openerp__.py
@@ -20,30 +20,30 @@
##############################################################################
{'name': "Bank statement CNAB 240 import",
- 'version': '1.0.0',
- 'author': 'KMEE',
- 'maintainer': 'Luis Felipe Mileo',
- 'category': 'Finance',
- 'complexity': 'normal',
- 'depends': [
- 'account_statement_commission',
- 'account_statement_transactionid_import'
- ],
- 'external_dependencies': {
- 'python': ['cnab240'],
- },
- 'description': """
- Allows to import CNAB 240 (Centro Nacional de Automação Bancária) statement files, using
- *account_statement_base_import* generic inheritance mechanism to import
- statements.
+ 'version': '1.0.0',
+ 'author': 'KMEE',
+ 'maintainer': 'Luis Felipe Mileo',
+ 'category': 'Finance',
+ 'complexity': 'normal',
+ 'depends': [
+ 'account_statement_commission',
+ 'account_statement_transactionid_import'
+ ],
+ 'external_dependencies': {
+ 'python': ['cnab240'],
+ },
+ 'description': """
+ Allows to import CNAB 240 (Centro Nacional de Automação Bancária) statement
+ files, using *account_statement_base_import* generic inheritance
+ mechanism to import statements.
It requires python cnab240 library to work.
""",
- 'website': 'http://www.kmee.com.br',
- 'data': [],
- 'test': [],
- 'installable': True,
- 'images': [],
- 'auto_install': False,
- 'license': 'AGPL-3',
+ 'website': 'http://www.kmee.com.br',
+ 'data': [],
+ 'test': [],
+ 'installable': True,
+ 'images': [],
+ 'auto_install': False,
+ 'license': 'AGPL-3',
}
diff --git a/__unported__/account_statement_l10n_br_cnab240_import/parser/__init__.py b/__unported__/account_statement_l10n_br_cnab240_import/parser/__init__.py
index bf8f8cc..b8818f3 100644
--- a/__unported__/account_statement_l10n_br_cnab240_import/parser/__init__.py
+++ b/__unported__/account_statement_l10n_br_cnab240_import/parser/__init__.py
@@ -18,4 +18,5 @@
# along with this program. If not, see .
#
##############################################################################
+
from . import cnab240_parser
diff --git a/__unported__/account_statement_l10n_br_cnab240_import/parser/cnab240_parser.py b/__unported__/account_statement_l10n_br_cnab240_import/parser/cnab240_parser.py
index 981dc87..43fb3bb 100644
--- a/__unported__/account_statement_l10n_br_cnab240_import/parser/cnab240_parser.py
+++ b/__unported__/account_statement_l10n_br_cnab240_import/parser/cnab240_parser.py
@@ -24,6 +24,7 @@
from openerp.tools.translate import _
from openerp.addons.account_statement_base_import.parser import \
BankStatementImportParser
+
try:
import cnab240
from cnab240.bancos import cef
@@ -57,26 +58,27 @@ def _parse(self, *args, **kwargs):
cnab240_file.seek(0)
cnab240_file.write(self.filebuffer)
cnab240_file.flush()
-
+
ret_file = codecs.open(cnab240_file.name, encoding='ascii')
arquivo = Arquivo(cef, arquivo=ret_file)
cnab240_file.close()
-
+
res = []
for lote in arquivo.lotes:
for evento in lote.eventos:
-
- res.append({
+ res.append({
'name': evento.sacado_nome,
- 'date': datetime.datetime.strptime(str(evento.vencimento_titulo), '%d%m%Y'),
+ 'date': datetime.datetime.strptime(
+ str(evento.vencimento_titulo), '%d%m%Y'),
'amount': evento.valor_titulo,
'ref': evento.numero_documento,
- 'label': evento.sacado_inscricao_numero, #cnpj
- 'transaction_id': evento.nosso_numero_identificacao, #nosso numero
- 'commission_amount':evento.valor_tarifas,
+ 'label': evento.sacado_inscricao_numero, # cnpj
+ 'transaction_id': evento.nosso_numero_identificacao,
+ # nosso numero
+ 'commission_amount': evento.valor_tarifas,
})
-
+
self.result_row_list = res
return True
diff --git a/__unported__/account_statement_l10n_br_cnab240_import/statement.py b/__unported__/account_statement_l10n_br_cnab240_import/statement.py
index e0357e4..ad9d5f7 100644
--- a/__unported__/account_statement_l10n_br_cnab240_import/statement.py
+++ b/__unported__/account_statement_l10n_br_cnab240_import/statement.py
@@ -30,5 +30,6 @@ def _get_import_type_selection(self, cr, uid, context=None):
selection = super(AccountStatementProfil, self
)._get_import_type_selection(cr, uid,
context=context)
- selection.append(('cnab240_so', _(u'CNAB 240 - Centro Nacional de Automação Bancária')))
+ selection.append(('cnab240_so', _(
+ u'CNAB 240 - Centro Nacional de Automação Bancária')))
return selection
diff --git a/l10n_br_account_banking_payment_cnab/README.rst b/l10n_br_account_banking_payment_cnab/README.rst
index 4f21ec5..c867055 100644
--- a/l10n_br_account_banking_payment_cnab/README.rst
+++ b/l10n_br_account_banking_payment_cnab/README.rst
@@ -1,5 +1,5 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
- :alt: License: AGPL-3
+:alt: License: AGPL-3
Account Banking Brazillian - Payments Export Infrastructure
=============================================================
@@ -60,7 +60,7 @@ Maintainer
----------
.. image:: https://brasil.odoo.com/logo.png
- :alt: Odoo Brazil
+:alt: Odoo Brazil
:target: http://brazil.odoo.com
This module is maintained by the Odoo Brazil.
diff --git a/l10n_br_account_banking_payment_cnab/__init__.py b/l10n_br_account_banking_payment_cnab/__init__.py
index 2a266f1..a74946f 100644
--- a/l10n_br_account_banking_payment_cnab/__init__.py
+++ b/l10n_br_account_banking_payment_cnab/__init__.py
@@ -21,4 +21,4 @@
#
##############################################################################
-import wizard
\ No newline at end of file
+import wizard
diff --git a/l10n_br_account_banking_payment_cnab/__openerp__.py b/l10n_br_account_banking_payment_cnab/__openerp__.py
old mode 100644
new mode 100755
index d52f907..7ef1955
--- a/l10n_br_account_banking_payment_cnab/__openerp__.py
+++ b/l10n_br_account_banking_payment_cnab/__openerp__.py
@@ -35,6 +35,7 @@
'depends': [
'l10n_br_account_payment_boleto',
'l10n_br_account_payment_mode',
+ 'account_direct_debit',
],
'data': [
'view/l10n_br_payment_cnab.xml',
diff --git a/l10n_br_account_banking_payment_cnab/febraban/cnab.py b/l10n_br_account_banking_payment_cnab/febraban/cnab.py
index bd45468..3dd72cb 100644
--- a/l10n_br_account_banking_payment_cnab/febraban/cnab.py
+++ b/l10n_br_account_banking_payment_cnab/febraban/cnab.py
@@ -24,7 +24,6 @@
class Cnab(object):
-
def __init__(self):
pass
diff --git a/l10n_br_account_banking_payment_cnab/febraban/cnab_240/bancos/bradesco.py b/l10n_br_account_banking_payment_cnab/febraban/cnab_240/bancos/bradesco.py
index 7117769..f86176e 100644
--- a/l10n_br_account_banking_payment_cnab/febraban/cnab_240/bancos/bradesco.py
+++ b/l10n_br_account_banking_payment_cnab/febraban/cnab_240/bancos/bradesco.py
@@ -26,6 +26,5 @@
class BradescoCnab240(Cnab240):
-
def __init__(self):
super(Cnab240, self).__init__()
diff --git a/l10n_br_account_banking_payment_cnab/febraban/cnab_240/bancos/cef.py b/l10n_br_account_banking_payment_cnab/febraban/cnab_240/bancos/cef.py
index f786f24..a7fc7c9 100644
--- a/l10n_br_account_banking_payment_cnab/febraban/cnab_240/bancos/cef.py
+++ b/l10n_br_account_banking_payment_cnab/febraban/cnab_240/bancos/cef.py
@@ -25,6 +25,5 @@
class Cef240(Cnab240):
-
def __init__(self):
super(Cnab240, self).__init__()
diff --git a/l10n_br_account_banking_payment_cnab/febraban/cnab_240/cnab_240.py b/l10n_br_account_banking_payment_cnab/febraban/cnab_240/cnab_240.py
old mode 100644
new mode 100755
index fe5de22..7d503c0
--- a/l10n_br_account_banking_payment_cnab/febraban/cnab_240/cnab_240.py
+++ b/l10n_br_account_banking_payment_cnab/febraban/cnab_240/cnab_240.py
@@ -23,6 +23,9 @@
from ..cnab import Cnab
from cnab240.tipos import Arquivo
+from cnab240.tipos import Evento
+from cnab240.tipos import Lote
+from cnab240.bancos import banco
from decimal import Decimal
from openerp.addons.l10n_br_base.tools.misc import punctuation_rm
import datetime
@@ -35,6 +38,7 @@ class Cnab240(Cnab):
"""
"""
+
def __init__(self):
super(Cnab, self).__init__()
@@ -66,17 +70,24 @@ def _prepare_header(self):
:param:
:return:
"""
+ data_de_geracao = (self.order.date_created[8:11] +
+ self.order.date_created[5:7] +
+ self.order.date_created[0:4])
+ # hora_de_geracao = (str(datetime.datetime.now().hour-3) +
+ # str(datetime.datetime.now().minute))
+ t = datetime.datetime.now() - datetime.timedelta(hours=3) # FIXME
+ hora_de_geracao = t.strftime("%H%M%S")
return {
- 'arquivo_data_de_geracao': 27062012,
- 'arquivo_hora_de_geracao': 112000,
- 'arquivo_sequencia': 1,
+ 'arquivo_data_de_geracao': int(data_de_geracao),
+ 'arquivo_hora_de_geracao': int(hora_de_geracao),
+ 'arquivo_sequencia': self.order.id,
'cedente_inscricao_tipo': self.inscricao_tipo,
'cedente_inscricao_numero': int(punctuation_rm(
self.order.company_id.cnpj_cpf)),
'cedente_agencia': int(self.order.mode.bank_id.bra_number),
'cedente_conta': int(self.order.mode.bank_id.acc_number),
'cedente_agencia_conta_dv': int(
- self.order.mode.bank_id.bra_number_dig),
+ self.order.mode.bank_id.acc_number_dig),
'cedente_nome': self.order.company_id.legal_name,
'cedente_codigo_agencia_digito': int(
self.order.mode.bank_id.bra_number_dig),
@@ -118,25 +129,38 @@ def _prepare_segmento(self, line):
:return:
"""
carteira, nosso_numero, digito = self.nosso_numero(
- line.move_line_id.transaction_ref) # TODO: Improve!
+ str(line.move_line_id.transaction_ref)) # TODO: Improve!
prefixo, sulfixo = self.cep(line.partner_id.zip)
+ if self.order.mode.boleto_aceite == 'S':
+ aceite = 'A'
+ else:
+ aceite = 'N'
return {
- 'cedente_agencia': 4459, # FIXME
- 'cedente_conta': 17600, # FIXME
- 'cedente_agencia_conta_dv': 6,
+ 'cedente_agencia': int(
+ self.order.mode.bank_id.bra_number), # FIXME
+ 'cedente_conta': int(self.order.mode.bank_id.acc_number), # FIXME
+ 'cedente_agencia_conta_dv': int(
+ self.order.mode.bank_id.acc_number_dig),
'carteira_numero': int(carteira),
'nosso_numero': int(nosso_numero),
'nosso_numero_dv': int(digito),
- 'identificacao_titulo': u'0000000', # TODO
- 'numero_documento': line.name,
+ 'identificacao_titulo': u'%s' % str(line.move_line_id.move_id.id),
+ # u'0000000', TODO
+ 'numero_documento': line.move_line_id.invoice.internal_number,
'vencimento_titulo': self.format_date(
line.ml_maturity_date),
- 'valor_titulo': Decimal('100.00'),
- 'especie_titulo': 8, # TODO:
- 'aceite_titulo': u'A', # TODO:
+ # 'valor_titulo': Decimal(v_t),
+ 'valor_titulo': Decimal("{0:,.2f}".format(
+ line.move_line_id.debit)),
+ # Decimal('100.00'),
+ 'especie_titulo': int(self.order.mode.boleto_especie),
+ 'aceite_titulo': u'%s' % (aceite), # TODO:
'data_emissao_titulo': self.format_date(
line.ml_date_created),
- 'juros_mora_taxa_dia': Decimal('2.00'),
+ # 'juros_mora_taxa_dia': Decimal('2.00'),
+ 'juros_mora_taxa_dia': Decimal(
+ "{0:,.2f}".format(line.move_line_id.debit * 0.00066666667)),
+ # FIXME
'valor_abatimento': Decimal('0.00'),
'sacado_inscricao_tipo': int(
self.sacado_inscricao_tipo(line.partner_id)),
@@ -150,8 +174,8 @@ def _prepare_segmento(self, line):
'sacado_cep_sufixo': int(sulfixo),
'sacado_cidade': line.partner_id.l10n_br_city_id.name,
'sacado_uf': line.partner_id.state_id.code,
- 'codigo_protesto': 3,
- 'prazo_protesto': 0,
+ 'codigo_protesto': int(self.order.mode.boleto_protesto),
+ 'prazo_protesto': int(self.order.mode.boleto_protesto_prazo),
'codigo_baixa': 0,
'prazo_baixa': 0,
}
@@ -164,8 +188,37 @@ def remessa(self, order):
"""
self.order = order
self.arquivo = Arquivo(self.bank, **self._prepare_header())
+ codigo_evento = 1
+ evento = Evento(self.bank, codigo_evento)
+
for line in order.line_ids:
- self.arquivo.incluir_cobranca(**self._prepare_segmento(line))
+ seg = self._prepare_segmento(line)
+ seg_p = banco.registros.SegmentoP(**seg)
+ evento.adicionar_segmento(seg_p)
+
+ seg_q = banco.registros.SegmentoQ(**seg)
+ evento.adicionar_segmento(seg_q)
+
+ lote_cobranca = self.arquivo.encontrar_lote(codigo_evento)
+
+ if lote_cobranca is None:
+ header = banco.registros.HeaderLoteCobranca(
+ **self.arquivo.header.todict())
+ trailer = banco.registros.TrailerLoteCobranca()
+ lote_cobranca = Lote(self.bank, header, trailer)
+ self.arquivo.adicionar_lote(lote_cobranca)
+
+ if header.controlecob_numero is None:
+ header.controlecob_numero = int('{0}{1:02}'.format(
+ self.arquivo.header.arquivo_sequencia,
+ lote_cobranca.codigo))
+
+ if header.controlecob_data_gravacao is None:
+ header.controlecob_data_gravacao = \
+ self.arquivo.header.arquivo_data_de_geracao
+
+ lote_cobranca.adicionar_evento(evento)
+ self.arquivo.trailer.totais_quantidade_registros += len(evento)
remessa = unicode(self.arquivo)
return unicodedata.normalize(
'NFKD', remessa).encode('ascii', 'ignore')
diff --git a/l10n_br_account_banking_payment_cnab/febraban/cnab_400/cnab_400.py b/l10n_br_account_banking_payment_cnab/febraban/cnab_400/cnab_400.py
index 42b4a19..16e2694 100644
--- a/l10n_br_account_banking_payment_cnab/febraban/cnab_400/cnab_400.py
+++ b/l10n_br_account_banking_payment_cnab/febraban/cnab_400/cnab_400.py
@@ -22,7 +22,6 @@
class Cnab400(Cnab):
-
def __init__(self):
super(Cnab, self).__init__()
diff --git a/l10n_br_account_banking_payment_cnab/view/l10n_br_payment_cnab.xml b/l10n_br_account_banking_payment_cnab/view/l10n_br_payment_cnab.xml
index eadaaa2..eec1388 100644
--- a/l10n_br_account_banking_payment_cnab/view/l10n_br_payment_cnab.xml
+++ b/l10n_br_account_banking_payment_cnab/view/l10n_br_payment_cnab.xml
@@ -1,23 +1,26 @@
-
+
- payment.cnab.form
- payment.cnab
-
-
-
+
\ No newline at end of file
diff --git a/l10n_br_account_banking_payment_cnab/wizard/payment_order_create.py b/l10n_br_account_banking_payment_cnab/wizard/payment_order_create.py
index 2e494ed..0712b8c 100644
--- a/l10n_br_account_banking_payment_cnab/wizard/payment_order_create.py
+++ b/l10n_br_account_banking_payment_cnab/wizard/payment_order_create.py
@@ -30,7 +30,6 @@ class PaymentOrderCreate(models.TransientModel):
@api.model
def extend_payment_order_domain(self, payment_order, domain):
-
super(PaymentOrderCreate, self).extend_payment_order_domain(
payment_order, domain)
if payment_order.mode.type.code == 'cnab':
diff --git a/l10n_br_account_payment_boleto/boleto/document.py b/l10n_br_account_payment_boleto/boleto/document.py
index 61d391f..0abd90a 100644
--- a/l10n_br_account_payment_boleto/boleto/document.py
+++ b/l10n_br_account_payment_boleto/boleto/document.py
@@ -30,8 +30,8 @@
from StringIO import StringIO
BoletoException = bank.BoletoException
-class Boleto:
+class Boleto:
boleto = object
account_number = ''
account_digit = ''
@@ -102,6 +102,7 @@ def _cedente(self, company):
:param company:
:return:
"""
+ self.boleto.logo_image = company.logo
self.boleto.cedente = company.partner_id.legal_name.encode('utf-8')
self.boleto.cedente_documento = company.cnpj_cpf.encode('utf-8')
self.boleto.cedente_bairro = company.district
@@ -148,87 +149,84 @@ def get_pdfs(cls, boleto_list):
fbuffer.close()
return boleto_file
-class BoletoBB(Boleto):
- def __init__(self, move_line, nosso_numero): # TODO: size o convenio and nosso numero, replace (7,2)
+class BoletoBB(Boleto):
+ def __init__(self, move_line, nosso_numero):
+ # TODO: size o convenio and nosso numero, replace (7,2)
# Size of convenio 4, 6, 7 or 8
# Nosso Numero format. 1 or 2
# Used only for convenio=6
# 1: Nosso Numero with 5 positions
# 2: Nosso Numero with 17 positions
- self.boleto = Boleto.getBoletoClass(move_line)(7,2)
+ self.boleto = Boleto.getBoletoClass(move_line)(7, 2)
self.account_number = move_line.payment_mode_id.bank_id.acc_number
self.branch_number = move_line.payment_mode_id.bank_id.bra_number
- Boleto.__init__(self, move_line, nosso_numero)
+ Boleto.__init__(self, move_line, nosso_numero)
self.boleto.nosso_numero = self.nosso_numero
class BoletoBarisul(Boleto):
-
def __init__(self, move_line, nosso_numero):
self.boleto = Boleto.getBoletoClass(move_line)()
self.account_number = move_line.payment_mode_id.bank_id.acc_number
self.branch_number = move_line.payment_mode_id.bank_id.bra_number
- Boleto.__init__(self, move_line, nosso_numero)
+ Boleto.__init__(self, move_line, nosso_numero)
self.boleto.nosso_numero = self.nosso_numero
class BoletoBradesco(Boleto):
-
def __init__(self, move_line, nosso_numero):
self.boleto = Boleto.getBoletoClass(move_line)()
self.account_number = move_line.payment_mode_id.bank_id.acc_number
self.branch_number = move_line.payment_mode_id.bank_id.bra_number
- #bank specific
+ # bank specific
self.account_digit = move_line.payment_mode_id.bank_id.acc_number_dig
self.branch_digit = move_line.payment_mode_id.bank_id.bra_number_dig
- #end bank specific
- Boleto.__init__(self, move_line, nosso_numero)
+ # end bank specific
+ Boleto.__init__(self, move_line, nosso_numero)
self.boleto.nosso_numero = self.nosso_numero
-class BoletoCaixa(Boleto):
+class BoletoCaixa(Boleto):
def __init__(self, move_line, nosso_numero):
self.boleto = Boleto.getBoletoClass(move_line)()
self.account_number = move_line.payment_mode_id.bank_id.acc_number
self.branch_number = move_line.payment_mode_id.bank_id.bra_number
- #bank specific
+ # bank specific
self.account_digit = move_line.payment_mode_id.bank_id.acc_number_dig
- #end bank specific
- Boleto.__init__(self, move_line, nosso_numero)
+ # end bank specific
+ Boleto.__init__(self, move_line, nosso_numero)
self.boleto.nosso_numero = self.nosso_numero
-class BoletoHsbc(Boleto):
+class BoletoHsbc(Boleto):
def __init__(self, move_line, nosso_numero):
self.boleto = Boleto.getBoletoClass(move_line)()
self.account_number = move_line.payment_mode_id.bank_id.acc_number
self.branch_number = move_line.payment_mode_id.bank_id.bra_number
- Boleto.__init__(self, move_line, nosso_numero)
+ Boleto.__init__(self, move_line, nosso_numero)
self.boleto.nosso_numero = self.nosso_numero
class BoletoItau157(Boleto):
-
def __init__(self, move_line, nosso_numero):
self.boleto = Boleto.getBoletoClass(move_line)()
self.account_number = move_line.payment_mode_id.bank_id.acc_number
self.branch_number = move_line.payment_mode_id.bank_id.bra_number
- Boleto.__init__(self, move_line, nosso_numero)
+ Boleto.__init__(self, move_line, nosso_numero)
self.boleto.nosso_numero = self.nosso_numero
class BoletoItau(Boleto):
-
def __init__(self, move_line, nosso_numero):
self.boleto = Boleto.getBoletoClass(move_line)()
self.account_number = move_line.payment_mode_id.bank_id.acc_number
self.branch_number = move_line.payment_mode_id.bank_id.bra_number
- Boleto.__init__(self, move_line, nosso_numero)
+ Boleto.__init__(self, move_line, nosso_numero)
self.boleto.nosso_numero = self.nosso_numero
-class BoletoReal(Boleto):
+class BoletoReal(Boleto):
def __init__(self, move_line, nosso_numero):
self.boleto = Boleto.getBoletoClass(move_line)()
self.account_number = move_line.payment_mode_id.bank_id.acc_number
@@ -236,58 +234,67 @@ def __init__(self, move_line, nosso_numero):
Boleto.__init__(self, move_line, nosso_numero)
self.boleto.nosso_numero = self.nosso_numero
-class BoletoSantander101(Boleto):
+class BoletoSantander101(Boleto):
def __init__(self, move_line, nosso_numero):
self.boleto = Boleto.getBoletoClass(move_line)()
self.account_number = move_line.payment_mode_id.bank_id.acc_number
self.branch_number = move_line.payment_mode_id.bank_id.bra_number
- Boleto.__init__(self, move_line, nosso_numero)
+ Boleto.__init__(self, move_line, nosso_numero)
self.boleto.ios = '0'
self.boleto.nosso_numero = self.nosso_numero
class BoletoStatander101201(Boleto):
-
def __init__(self, move_line, nosso_numero):
self.boleto = Boleto.getBoletoClass(move_line)()
self.account_number = move_line.payment_mode_id.bank_id.acc_number
self.branch_number = move_line.payment_mode_id.bank_id.bra_number
- Boleto.__init__(self, move_line, nosso_numero)
+ Boleto.__init__(self, move_line, nosso_numero)
self.boleto.ios = '0'
self.boleto.nosso_numero = self.nosso_numero
class BoletoCaixaSigcb(Boleto):
-
def __init__(self, move_line, nosso_numero):
from pyboleto.bank.caixa_sigcb import BoletoCaixaSigcb
self.boleto = BoletoCaixaSigcb()
self.account_number = move_line.payment_mode_id.bank_id.acc_number
self.branch_number = move_line.payment_mode_id.bank_id.bra_number
- #bank specific
+ # bank specific
self.account_digit = move_line.payment_mode_id.bank_id.acc_number_dig
- #end bank specific
- Boleto.__init__(self, move_line, nosso_numero)
+ # end bank specific
+ Boleto.__init__(self, move_line, nosso_numero)
+ self.boleto.nosso_numero = self.nosso_numero
+
+
+class BoletoSicredi(Boleto):
+ def __init__(self, move_line, nosso_numero):
+ self.boleto = Boleto.getBoletoClass(move_line)()
+ self.account_number = move_line.payment_mode_id.bank_id.acc_number
+ self.branch_number = move_line.payment_mode_id.bank_id.bra_number
+ Boleto.__init__(self, move_line, nosso_numero)
self.boleto.nosso_numero = self.nosso_numero
dict_boleto = {
- '1' : (BoletoBB, 'Banco do Brasil 18'),
- '2' : (BoletoBarisul, 'Barisul x'),
- '3' : (BoletoBradesco, 'Bradesco 06, 03'),
- '4' : (BoletoCaixa, 'Caixa Economica SR'),
- '5' : (BoletoHsbc, 'HSBC CNR CSB'),
- '6' : (BoletoItau157, 'Itau 157'),
- '7' : (BoletoItau, 'Itau 175, 174, 178, 104, 109'),
- '8' : (BoletoReal, 'Real 57'),
- '9' : (BoletoSantander101, 'Santander 102'),
+ '1': (BoletoBB, 'Banco do Brasil 18'),
+ '2': (BoletoBarisul, 'Barisul x'),
+ '3': (BoletoBradesco, 'Bradesco 06, 03'),
+ '4': (BoletoCaixa, 'Caixa Economica SR'),
+ '5': (BoletoHsbc, 'HSBC CNR CSB'),
+ '6': (BoletoItau157, 'Itau 157'),
+ '7': (BoletoItau, 'Itau 175, 174, 178, 104, 109'),
+ '8': (BoletoReal, 'Real 57'),
+ '9': (BoletoSantander101, 'Santander 102'),
'10': (BoletoStatander101201, 'Santander 101, 201'),
'11': (BoletoCaixaSigcb, 'Caixa Sigcb'),
+ '12': (BoletoSicredi, 'Sicredi'),
}
+
def getBoletoSelection():
list = []
for i in dict_boleto:
- list.append((i,dict_boleto[i][1]))
- return list
\ No newline at end of file
+ list.append((i, dict_boleto[i][1]))
+ return list
diff --git a/l10n_br_account_payment_boleto/data/boleto_data.xml b/l10n_br_account_payment_boleto/data/boleto_data.xml
index 5702bc1..7306a41 100644
--- a/l10n_br_account_payment_boleto/data/boleto_data.xml
+++ b/l10n_br_account_payment_boleto/data/boleto_data.xml
@@ -11,7 +11,8 @@
-
+
diff --git a/l10n_br_account_payment_boleto/demo/payment_demo.xml b/l10n_br_account_payment_boleto/demo/payment_demo.xml
index a2334c4..94e0f0c 100644
--- a/l10n_br_account_payment_boleto/demo/payment_demo.xml
+++ b/l10n_br_account_payment_boleto/demo/payment_demo.xml
@@ -1,131 +1,162 @@
-
-
- Boleto sem registro Banco do Brasil
-
-
-
-
-
-
- 00
- Pagavel em qualquer banco ate o vencimento
- 1
- 27
- 18
- DM
- 29
- S
-
+
+
+ Boleto sem registro Banco do Brasil
+
+
+
+
+
+
+ 00
+ Pagavel em qualquer banco ate o
+ vencimento
+
+ 1
+ 27
+ 18
+ DM
+ 29
+ S
+
-
- Boleto sem registro Bradesco
-
-
-
-
-
-
- 00
- Pagavel em qualquer banco ate o vencimento
- 3
- 06
- 03
- DM
- 19
- N
-
+
+ Boleto sem registro Bradesco
+
+
+
+
+
+
+ 00
+ Pagavel em qualquer banco ate o
+ vencimento
+
+ 3
+ 06
+ 03
+ DM
+ 19
+ N
+
-
- Boleto sem registro HSBC
-
-
-
-
-
-
- 00
- Pagavel em qualquer banco ate o vencimento
- 5
-
- CNR
- PD
-
- N
-
+
+ Boleto sem registro HSBC
+
+
+
+
+
+
+ 00
+ Pagavel em qualquer banco ate o
+ vencimento
+
+ 5
+
+ CNR
+ PD
+
+ N
+
-
- Boleto sem registro ITAU
-
-
-
-
-
-
- 00
- Pagavel em qualquer banco ate o vencimento
- 7
- 99999999
- 109
- DM
-
- N
-
+
+ Boleto sem registro ITAU
+
+
+
+
+
+
+ 00
+ Pagavel em qualquer banco ate o
+ vencimento
+
+ 7
+ 99999999
+ 109
+ DM
+
+ N
+
-
- Boleto sem registro Santander
-
-
-
-
-
-
- 00
- Pagavel em qualquer banco ate o vencimento
- 9
-
- 102
- DM
-
- N
-
+
+ Boleto sem registro Santander
+
+
+
+
+
+
+ 00
+ Pagavel em qualquer banco ate o
+ vencimento
+
+ 9
+
+ 102
+ DM
+
+ N
+
-
- Boleto sem registro Caixa Economica SR
-
-
-
-
-
-
- 00
- Pagavel em qualquer banco ate o vencimento
- 4
-
- SR
-
-
- N
-
+
+ Boleto sem registro Caixa Economica SR
+
+
+
+
+
+
+ 00
+ Pagavel em qualquer banco ate o
+ vencimento
+
+ 4
+
+ SR
+
+
+ N
+
-
- Boleto sem registro Caixa Economica SR
-
-
-
-
-
-
- 00
- Pagavel em qualquer banco ate o vencimento
- 11
-
- SR
-
-
- N
-
+
+ Boleto sem registro Caixa Economica SR
+
+
+
+
+
+
+ 00
+ Pagavel em qualquer banco ate o
+ vencimento
+
+ 11
+
+ SR
+
+
+ N
+
-
+
diff --git a/l10n_br_account_payment_boleto/models/account_invoice.py b/l10n_br_account_payment_boleto/models/account_invoice.py
index f218fab..3981264 100644
--- a/l10n_br_account_payment_boleto/models/account_invoice.py
+++ b/l10n_br_account_payment_boleto/models/account_invoice.py
@@ -22,7 +22,7 @@
##############################################################################
import logging
-from openerp import models, fields, api
+from openerp import models, api
_logger = logging.getLogger(__name__)
diff --git a/l10n_br_account_payment_boleto/models/account_move_line.py b/l10n_br_account_payment_boleto/models/account_move_line.py
index 124cf24..941e6c8 100644
--- a/l10n_br_account_payment_boleto/models/account_move_line.py
+++ b/l10n_br_account_payment_boleto/models/account_move_line.py
@@ -54,9 +54,10 @@ def send_payment(self):
nosso_numero = \
move_line.transaction_ref.replace('/', '')
else:
- nosso_numero = self.env['ir.sequence'].next_by_id(
- move_line.payment_mode_id
- .internal_sequence_id.id)
+ nosso_numero = \
+ self.env['ir.sequence'].next_by_id(
+ move_line.payment_mode_id.
+ internal_sequence_id.id)
else:
nosso_numero = move_line.boleto_own_number
diff --git a/l10n_br_account_payment_boleto/models/payment_mode.py b/l10n_br_account_payment_boleto/models/payment_mode.py
old mode 100644
new mode 100755
index a33fc36..46c58a4
--- a/l10n_br_account_payment_boleto/models/payment_mode.py
+++ b/l10n_br_account_payment_boleto/models/payment_mode.py
@@ -39,6 +39,31 @@ class PaymentMode(models.Model):
[('S', 'Sim'), ('N', 'Não')], string='Aceite', default='N')
boleto_type = fields.Selection(
selection, string="Boleto")
+ boleto_especie = fields.Selection([
+ ('01', u'DUPLICATA MERCANTIL'),
+ ('02', u'NOTA PROMISSÓRIA'),
+ ('03', u'NOTA DE SEGURO'),
+ ('04', u'MENSALIDADE ESCOLAR'),
+ ('05', u'RECIBO'),
+ ('06', u'CONTRATO'),
+ ('07', u'COSSEGUROS'),
+ ('08', u'DUPLICATA DE SERVIÇO'),
+ ('09', u'LETRA DE CÂMBIO'),
+ ('13', u'NOTA DE DÉBITOS'),
+ ('15', u'DOCUMENTO DE DÍVIDA'),
+ ('16', u'ENCARGOS CONDOMINIAIS'),
+ ('17', u'CONTA DE PRESTAÇÃO DE SERVIÇOS'),
+ ('99', u'DIVERSOS'),
+ ], string=u'Espécie do Título', default='01')
+ boleto_protesto = fields.Selection([
+ ('0', u'Sem instrução'),
+ ('1', u'Protestar (Dias Corridos)'),
+ ('2', u'Protestar (Dias Úteis)'),
+ ('3', u'Não protestar'),
+ ('7', u'Negativar (Dias Corridos)'),
+ ('8', u'Não Negativar')
+ ], string=u'Códigos de Protesto', default='0')
+ boleto_protesto_prazo = fields.Char(u'Prazo protesto', size=2)
@api.constrains('boleto_type', 'boleto_carteira',
'boleto_modalidade', 'boleto_convenio',
diff --git a/l10n_br_account_payment_boleto/models/res_company.py b/l10n_br_account_payment_boleto/models/res_company.py
index b015683..4801244 100644
--- a/l10n_br_account_payment_boleto/models/res_company.py
+++ b/l10n_br_account_payment_boleto/models/res_company.py
@@ -34,4 +34,4 @@ class ResCompany(models.Model):
own_number_sequence = fields.Many2one('ir.sequence',
string=u'Sequência do Nosso Número')
transaction_id_sequence = fields.Many2one('ir.sequence',
- string=u'Sequência da fatura')
+ string=u'Sequência da fatura')
diff --git a/l10n_br_account_payment_boleto/reports/report.py b/l10n_br_account_payment_boleto/reports/report.py
index 71dd221..834fd99 100644
--- a/l10n_br_account_payment_boleto/reports/report.py
+++ b/l10n_br_account_payment_boleto/reports/report.py
@@ -67,10 +67,12 @@ def create(self, cr, uid, ids, datas, context=False):
if not boleto_list:
raise osv.except_osv(
'Error !', ('Não é possível gerar os boletos\n'
- 'Certifique-se que a fatura esteja confirmada e o forma de pagamento seja duplicatas'))
+ 'Certifique-se que a fatura esteja confirmada'
+ ' e o forma de pagamento seja duplicatas'))
pdf_string = Boleto.get_pdfs(boleto_list)
self.obj = external_pdf(pdf_string)
self.obj.render()
return self.obj.pdf, 'pdf'
+
report_custom('report.l10n_br_account_payment_boleto.report')
diff --git a/l10n_br_account_payment_boleto/views/account_move_line.xml b/l10n_br_account_payment_boleto/views/account_move_line.xml
index 5450cc7..63ac9ce 100644
--- a/l10n_br_account_payment_boleto/views/account_move_line.xml
+++ b/l10n_br_account_payment_boleto/views/account_move_line.xml
@@ -5,18 +5,18 @@
The licence is in the file __openerp__.py
-->
-
-
- Payments
- account.move.line
- partner_id
-
-
+
+
+ Payments
+ account.move.line
+ partner_id
+
+
-
-
-
+
+
+
diff --git a/l10n_br_account_payment_boleto/views/payment_mode.xml b/l10n_br_account_payment_boleto/views/payment_mode.xml
old mode 100644
new mode 100755
index b394dbd..5aec1a5
--- a/l10n_br_account_payment_boleto/views/payment_mode.xml
+++ b/l10n_br_account_payment_boleto/views/payment_mode.xml
@@ -4,19 +4,23 @@
payment.mode.form.inherit
payment.mode
-
+
+ position="inside">
-
+
-
+
+
+
+
diff --git a/l10n_br_account_payment_boleto/views/res_company.xml b/l10n_br_account_payment_boleto/views/res_company.xml
index 0a6e536..f7c818d 100644
--- a/l10n_br_account_payment_boleto/views/res_company.xml
+++ b/l10n_br_account_payment_boleto/views/res_company.xml
@@ -1,21 +1,23 @@
-
-
- l10n_br_account_payment_boleto.res.company.form
- res.company
-
-
+
+
+ l10n_br_account_payment_boleto.res.company.form
+
+ res.company
+
+
-
+
-
-
-
+
+
+
diff --git a/l10n_br_account_payment_mode/__openerp__.py b/l10n_br_account_payment_mode/__openerp__.py
index b2d9938..1463ab3 100644
--- a/l10n_br_account_payment_mode/__openerp__.py
+++ b/l10n_br_account_payment_mode/__openerp__.py
@@ -35,13 +35,13 @@
'l10n_br_data_base',
'account_payment_partner',
'account_due_list',
- ],
+ ],
'data': [
'views/payment_view.xml',
'views/payment_mode_view.xml',
- ],
+ ],
'demo': [
'demo/payment_demo.xml'
- ],
+ ],
'active': False,
}
diff --git a/l10n_br_account_payment_mode/demo/payment_demo.xml b/l10n_br_account_payment_mode/demo/payment_demo.xml
index ed0af77..4b2fe1d 100644
--- a/l10n_br_account_payment_mode/demo/payment_demo.xml
+++ b/l10n_br_account_payment_mode/demo/payment_demo.xml
@@ -1,102 +1,104 @@
-
+
-
- 5384
- 8
- 7030
- 8
- bank
-
-
- BANCO DO BRASIL S.A.
- 001
-
+
+ 5384
+ 8
+ 7030
+ 8
+ bank
+
+
+ BANCO DO BRASIL S.A.
+ 001
+
-
- 5162
- 0
- 0100
- 3
- bank
-
-
- HSBC BANK BRASIL S.A. - BANCO MULTIPLO
- 399
-
+
+ 5162
+ 0
+ 0100
+ 3
+ bank
+
+
+ HSBC BANK BRASIL S.A. - BANCO MULTIPLO
+
+ 399
+
-
- 15016
- 0
- 8515
- 0
- bank
-
-
- BANCO ITAÚ S.A.
- 341
-
+
+ 15016
+ 0
+ 8515
+ 0
+ bank
+
+
+ BANCO ITAÚ S.A.
+ 341
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
- 1333
- 0
- 0707077
- 0
- bank
-
-
- BANCO SANTANDER (BRASIL) S.A.
- 033
-
+
+ 1333
+ 0
+ 0707077
+ 0
+ bank
+
+
+ BANCO SANTANDER (BRASIL) S.A.
+ 033
+
-
- 414
- 3
- 1565
- 1
- bank
-
-
- CAIXA ECONOMICA FEDERAL
- 104
-
+
+ 414
+ 3
+ 1565
+ 1
+ bank
+
+
+ CAIXA ECONOMICA FEDERAL
+ 104
+
-
- 395
- 0
- 1611
- 0
- bank
-
-
- BANCO BRADESCO S.A.
- 237
-
+
+ 395
+ 0
+ 1611
+ 0
+ bank
+
+
+ BANCO BRADESCO S.A.
+ 237
+
-
- Cheque
-
-
-
-
-
-
- 99
-
+
+ Cheque
+
+
+
+
+
+
+ 99
+
-
+
diff --git a/l10n_br_account_payment_mode/models/payment_mode.py b/l10n_br_account_payment_mode/models/payment_mode.py
index 35c285a..1093a42 100644
--- a/l10n_br_account_payment_mode/models/payment_mode.py
+++ b/l10n_br_account_payment_mode/models/payment_mode.py
@@ -24,7 +24,6 @@
class PaymentMode(models.Model):
-
_inherit = 'payment.mode'
type_payment = fields.Selection(
diff --git a/l10n_br_account_payment_mode/views/payment_mode_view.xml b/l10n_br_account_payment_mode/views/payment_mode_view.xml
index e62995a..c5475cf 100644
--- a/l10n_br_account_payment_mode/views/payment_mode_view.xml
+++ b/l10n_br_account_payment_mode/views/payment_mode_view.xml
@@ -4,29 +4,34 @@
payment.mode.form.inherit
payment.mode
-
+
+ string="Localização Brasileira"
+ colspan="2">
-
-
+
+
-
+
-
+
-
+
-
+
-
+
diff --git a/l10n_br_account_payment_mode/views/payment_view.xml b/l10n_br_account_payment_mode/views/payment_view.xml
index 05a70cf..bf2537b 100644
--- a/l10n_br_account_payment_mode/views/payment_view.xml
+++ b/l10n_br_account_payment_mode/views/payment_view.xml
@@ -1,33 +1,35 @@
-
-
-
- Payments
- account.move.line
- partner_id
-
-
-
+
+
+
+ Payments
+ account.move.line
+ partner_id
+
+
+
-
-
-
- Payments Select
- account.move.line
-
-
-
+
+
+
+ Payments Select
+ account.move.line
+
+
+
-
+
-
+
-
-
-
+
+
+