Skip to content

Commit

Permalink
correct multa in boleto print
Browse files Browse the repository at this point in the history
  • Loading branch information
yk2kus committed Jun 6, 2016
1 parent 8bcd6f0 commit 6aefc96
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions l10n_br_account_payment_boleto/boleto/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def getBranchNumber(self):
return self.branch_number.encode('utf-8')

def _move_line(self, move_line):
multa = move_line.debit * move_line.payment_mode_id.multa * 0.01 or move_line.credit * move_line.payment_mode_id.multa * 0.01
instrucoes = move_line.payment_mode_id.instrucoes or '' + u"\n Após o vencimento cobrar multa de R$ %s e juros de %s%% ao dia." %(multa or '', move_line.payment_mode_id.cnab_percent_interest or '')
self._payment_mode(move_line.payment_mode_id)
self.boleto.data_vencimento = datetime.date(datetime.strptime(
move_line.date_maturity, '%Y-%m-%d'))
Expand All @@ -85,18 +87,19 @@ def _move_line(self, move_line):
move_line.currency_id and move_line.currency_id.symbol or 'R$'
self.boleto.quantidade = '' # str("%.2f" % move_line.amount_currency)
self.boleto.numero_documento = move_line.name.encode('utf-8')
self.boleto.instrucoes = instrucoes or ''

def _payment_mode(self, payment_mode_id):
"""
:param payment_mode:
:return:
"""
instrucoes = payment_mode_id.instrucoes + u"\n Após o vencimento cobrar multa de R$ %s e juros de %s%% ao dia." %(payment_mode_id.multa or '', payment_mode_id.cnab_percent_interest or '')

self.boleto.convenio = payment_mode_id.boleto_convenio
self.boleto.especie_documento = payment_mode_id.boleto_modalidade
self.boleto.aceite = payment_mode_id.boleto_aceite
self.boleto.carteira = payment_mode_id.boleto_carteira
self.boleto.instrucoes = instrucoes or ' '

self.boleto.cnab_percent_interest = payment_mode_id.cnab_percent_interest or ' '
self.boleto.boleto_protesto = payment_mode_id.boleto_protesto or ' '
self.boleto.boleto_protesto_prazo = payment_mode_id.boleto_protesto_prazo or ' '
Expand Down
1 change: 1 addition & 0 deletions l10n_br_account_payment_boleto/views/payment_mode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<field name="boleto_especie"/>
<field name="boleto_protesto"/>
<field name="boleto_protesto_prazo"/>
<field name="instrucoes"/>
</group>
</xpath>
<!--</data>-->
Expand Down
1 change: 0 additions & 1 deletion l10n_br_account_payment_mode/views/payment_mode_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<field name="payment_order_type"/>
<field name="internal_sequence_id"/>
<field name="type_payment"/>
<field name="instrucoes"/>
<field name="invoice_print"/>
</field>
<xpath expr="//form/group[@string='Note']" position="before">
Expand Down

0 comments on commit 6aefc96

Please sign in to comment.