Skip to content

Commit

Permalink
[REF] l10n_br_account_payment_brcobranca pre-commit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniospneto authored and rvalyi committed Dec 9, 2024
1 parent 56b1ee5 commit 4d60a42
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions l10n_br_account_payment_brcobranca/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ def send_payment(self):
valor_juros = move_line.currency_id.round(
move_line.debit * ((cnab_config.boleto_interest_perc / 100) / 30),
)
percentual_formatado = (
f"{cnab_config.boleto_interest_perc:.2f}".replace(".", ",")
)
juros_formatado = f"{valor_juros:.2f}".replace(".", ",")
instrucao_juros = (
"APÓS VENCIMENTO COBRAR PERCENTUAL"
+ " DE %s %% AO MÊS ( R$ %s AO DIA )"
% (
("%.2f" % cnab_config.boleto_interest_perc).replace(".", ","),
("%.2f" % valor_juros).replace(".", ","),
)
f"APÓS VENCIMENTO COBRAR PERCENTUAL DE {percentual_formatado}%"
f" AO MÊS (R${juros_formatado} AO DIA)"
)
boleto_cnab_api_data.update(
{
Expand All @@ -120,13 +120,13 @@ def send_payment(self):
valor_multa = move_line.currency_id.round(
move_line.debit * (cnab_config.boleto_fee_perc / 100),
)
percentual_formatado = f"{cnab_config.boleto_fee_perc:.2f}".replace(
".", ","
)
multa_formatado = f"{valor_multa:.2f}".replace(".", ",")
instrucao_multa = (
"APÓS VENCIMENTO COBRAR MULTA"
+ " DE %s %% ( R$ %s )"
% (
("%.2f" % cnab_config.boleto_fee_perc).replace(".", ","),
("%.2f" % valor_multa).replace(".", ","),
)
f"APÓS VENCIMENTO COBRAR MULTA DE {percentual_formatado}%"
f" (R${multa_formatado})"
)
boleto_cnab_api_data.update(
{
Expand All @@ -139,14 +139,15 @@ def send_payment(self):
valor_desconto = move_line.currency_id.round(
move_line.debit * (move_line.boleto_discount_perc / 100),
)
percentual_formatado = f"{move_line.boleto_discount_perc:.2f}".replace(
".", ","
)
desconto_formatado = f"{valor_desconto:.2f}".replace(".", ",")
vencimento_formatado = move_line.date_maturity.strftime("%d/%m/%Y")
instrucao_desconto_vencimento = (
"CONCEDER DESCONTO DE" + " %s %% "
"ATÉ O VENCIMENTO EM %s ( R$ %s )"
% (
("%.2f" % move_line.boleto_discount_perc).replace(".", ","),
move_line.date_maturity.strftime("%d/%m/%Y"),
("%.2f" % valor_desconto).replace(".", ","),
)
f"CONCEDER DESCONTO DE {percentual_formatado}% "
f"ATÉ O VENCIMENTO EM {vencimento_formatado} "
f"(R${desconto_formatado})"
)
boleto_cnab_api_data.update(
{
Expand Down

0 comments on commit 4d60a42

Please sign in to comment.