-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IMP] Improvements on boleto serialization (tests with Banco do Brasil)
- Loading branch information
Showing
16 changed files
with
173 additions
and
210 deletions.
There are no files selected for viewing
87 changes: 0 additions & 87 deletions
87
__unported__/l10n_br_account_payment_boleto/model/payment_mode.py
This file was deleted.
Oops, something went wrong.
23 changes: 0 additions & 23 deletions
23
__unported__/l10n_br_account_payment_boleto/view/account_move_line.xml
This file was deleted.
Oops, something went wrong.
56 changes: 0 additions & 56 deletions
56
__unported__/l10n_br_account_payment_boleto/view/payment_mode.xml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# -*- encoding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Account Payment Partner module for OpenERP | ||
# Copyright (C) 2014 KMEE (http://www.kmee.com.br) | ||
# Account Payment Boleto module for Odoo | ||
# Copyright (C) 2012-2015 KMEE (http://www.kmee.com.br) | ||
# @author Luis Felipe Miléo <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
|
@@ -20,6 +20,6 @@ | |
# | ||
############################################################################## | ||
|
||
from . import report | ||
from . import reports | ||
from . import boleto | ||
from . import model | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# -*- encoding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Account Payment Partner module for OpenERP | ||
# Copyright (C) 2014 KMEE (http://www.kmee.com.br) | ||
# Account Payment Boleto module for Odoo | ||
# Copyright (C) 2012-2015 KMEE (http://www.kmee.com.br) | ||
# @author Luis Felipe Miléo <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
|
@@ -22,19 +22,21 @@ | |
|
||
|
||
{ | ||
'name': 'Account Payment Boleto on Move Line', | ||
'name': 'Odoo Brasil Account Payment Boleto', | ||
'version': '0.1', | ||
'category': 'Banking addons', | ||
'license': 'AGPL-3', | ||
'summary': 'Adds payment mode boleto on move lines', | ||
'description': """ """, | ||
'author': 'KMEE', | ||
'website': 'http://www.kmee.com.br', | ||
'depends': ['account_payment_move_line'], | ||
'depends': [ | ||
'l10n_br_account_payment_mode' | ||
], | ||
'data': [ | ||
'view/payment_mode.xml', | ||
'view/account_move_line.xml', | ||
'report_print_button_view.xml', | ||
'views/payment_mode.xml', | ||
'views/account_move_line.xml', | ||
'reports/report_print_button_view.xml', | ||
], | ||
'demo': [ | ||
], | ||
|
4 changes: 2 additions & 2 deletions
4
...account_payment_boleto/boleto/__init__.py → ...account_payment_boleto/boleto/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# -*- encoding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Account Payment Partner module for OpenERP | ||
# Copyright (C) 2012 KMEE (http://www.kmee.com.br) | ||
# Account Payment Boleto module for Odoo | ||
# Copyright (C) 2012-2015 KMEE (http://www.kmee.com.br) | ||
# @author Luis Felipe Miléo <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# -*- encoding: utf-8 -*- | ||
# ############################################################################# | ||
############################################################################## | ||
# | ||
# Account Payment Partner module for OpenERP | ||
# Copyright (C) 2012 KMEE (http://www.kmee.com.br) | ||
# Account Payment Boleto module for Odoo | ||
# Copyright (C) 2012-2015 KMEE (http://www.kmee.com.br) | ||
# @author Luis Felipe Miléo <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
|
@@ -61,15 +61,20 @@ def __init__(self, move_line): | |
self.boleto = bank.get_class_for_codigo(bank_code) | ||
self.create(move_line) | ||
|
||
|
||
def create(self, move_line): | ||
self.boleto.nosso_numero = move_line.ref.encode('utf-8') | ||
self.boleto.numero_documento = move_line.name.encode('utf-8') | ||
self.boleto.data_vencimento = datetime.date(datetime.strptime(move_line.date_maturity, '%Y-%m-%d')) | ||
self.boleto.data_documento = datetime.date(datetime.strptime(move_line.invoice.date_invoice, '%Y-%m-%d')) | ||
self.boleto.data_vencimento = datetime.date(datetime.strptime( | ||
move_line.date_maturity, '%Y-%m-%d')) | ||
self.boleto.data_documento = datetime.date(datetime.strptime( | ||
move_line.invoice.date_invoice, '%Y-%m-%d')) | ||
self.boleto.data_processamento = date.today() | ||
self.boleto.valor_documento = move_line.debit | ||
|
||
self.boleto.valor = str("%.2f" % move_line.debit or move_line.credit) | ||
self.boleto.valor_documento = str("%.2f" % move_line.debit or | ||
move_line.credit) | ||
self.boleto.especie = \ | ||
move_line.currency_id and move_line.currency_id.symbol or 'R$' | ||
self.boleto.quantidade = '' #str("%.2f" % move_line.amount_currency) | ||
self.instrucoes(move_line.payment_mode_id) | ||
self.payment_mode(move_line.payment_mode_id) | ||
self.cedente(move_line.company_id) | ||
|
@@ -114,7 +119,9 @@ def payment_mode(self, payment_mode_id): | |
:return: | ||
""" | ||
self.boleto.convenio = payment_mode_id.boleto_convenio.encode('utf-8') | ||
self.boleto.especie_documento = payment_mode_id.boleto_modalidade.encode('utf-8') | ||
self.boleto.especie_documento = \ | ||
payment_mode_id.boleto_modalidade.encode('utf-8') | ||
self.boleto.aceite = payment_mode_id.boleto_aceite | ||
self.boleto.carteira = payment_mode_id.boleto_carteira.encode('utf-8') | ||
self.boleto.agencia_cedente = payment_mode_id.bank_id.bra_number.encode('utf-8') | ||
self.boleto.conta_cedente = str( | ||
|
@@ -141,13 +148,19 @@ def sacado(self, partner): | |
:param partner: | ||
:return: | ||
''' | ||
self.boleto.sacado_endereco = partner.street + ', ' + partner.number | ||
self.boleto.sacado_cidade = partner.city | ||
self.boleto.sacado_bairro = partner.district | ||
self.boleto.sacado_uf = partner.state_id.code | ||
self.boleto.sacado_cep = partner.zip | ||
self.boleto.sacado_nome = partner.legal_name | ||
self.boleto.sacado_documento = partner.cnpj_cpf | ||
self.boleto.sacado = \ | ||
[ | ||
"{0} - CNPJ/CPF: {1}".format(partner.legal_name, partner.cnpj_cpf), | ||
"{0}, {1}".format(partner.street, partner.number), | ||
# "{2}".format(fname, lname, age), | ||
] | ||
# self.boleto.sacado_endereco = partner.street + ', ' + | ||
# self.boleto.sacado_cidade = partner.city | ||
# self.boleto.sacado_bairro = partner.district | ||
# self.boleto.sacado_uf = partner.state_id.code | ||
# self.boleto.sacado_cep = partner.zip | ||
# self.boleto.sacado_nome = partner.legal_name | ||
# self.boleto.sacado_documento = partner.cnpj_cpf | ||
|
||
@classmethod | ||
def get_pdfs(cls, boletoList): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- encoding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Account Payment Boleto module for Odoo | ||
# Copyright (C) 2012-2015 KMEE (http://www.kmee.com.br) | ||
# @author Luis Felipe Miléo <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
|
||
from openerp import models, fields, api | ||
|
||
class PaymentMode(models.Model): | ||
_inherit = 'payment.mode' | ||
|
||
boleto_carteira = fields.Char('Carteira', size=2) | ||
boleto_modalidade = fields.Char('Modalidade', size=2) | ||
boleto_convenio = fields.Char(u'Codigo convênio', size=10) | ||
boleto_variacao = fields.Char(u'Variação', size=2) | ||
boleto_cnab_code = fields.Char('Codigo Cnab', size=20) | ||
boleto_aceite = fields.Selection( | ||
[('S', 'Sim'), ('N', 'Não')], string='Aceite', default='N') |
4 changes: 2 additions & 2 deletions
4
...account_payment_boleto/report/__init__.py → ...ccount_payment_boleto/reports/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
# -*- encoding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Account Payment Partner module for OpenERP | ||
# Copyright (C) 2012 KMEE (http://www.kmee.com.br) | ||
# Account Payment Boleto module for Odoo | ||
# Copyright (C) 2012-2015 KMEE (http://www.kmee.com.br) | ||
# @author Luis Felipe Miléo <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
|
Oops, something went wrong.