Skip to content

Commit

Permalink
[IMP] l10n_br_account_payment_cobranca: add seg. R details
Browse files Browse the repository at this point in the history
  • Loading branch information
DiegoParadeda committed Feb 18, 2025
1 parent da77f08 commit 659e77e
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions l10n_br_account_payment_brcobranca/models/account_payment_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,39 @@ def _prepare_bank_line_santander(self, cnab_config, linhas_pagamentos):
linhas_pagamentos["dias_baixa"] = str(
cnab_config.write_off_devolution_number_of_days
)
# Os dados de multa, mora, desconto e protesto também são obrigatórios na
# baixa e abatimento Santander 240
if self.instruction_move_code_id.code in [
cnab_config.write_off_code_id.code,
cnab_config.grant_rebate_code_id.code,
]:
if cnab_config.boleto_fee_perc:
linhas_pagamentos["codigo_multa"] = cnab_config.boleto_fee_code
linhas_pagamentos["percentual_multa"] = cnab_config.boleto_fee_perc

Check warning on line 120 in l10n_br_account_payment_brcobranca/models/account_payment_line.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account_payment_brcobranca/models/account_payment_line.py#L119-L120

Added lines #L119 - L120 were not covered by tests
if cnab_config.boleto_interest_perc:
linhas_pagamentos["tipo_mora"] = cnab_config.boleto_interest_code

Check warning on line 122 in l10n_br_account_payment_brcobranca/models/account_payment_line.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account_payment_brcobranca/models/account_payment_line.py#L122

Added line #L122 was not covered by tests
if cnab_config.boleto_interest_code == "1":
linhas_pagamentos[

Check warning on line 124 in l10n_br_account_payment_brcobranca/models/account_payment_line.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account_payment_brcobranca/models/account_payment_line.py#L124

Added line #L124 was not covered by tests
"valor_mora"
] = self.company_currency_id.round(
self.amount_currency
* ((cnab_config.boleto_interest_perc / 100) / 30),
)
if cnab_config.boleto_interest_code == "2":
linhas_pagamentos[

Check warning on line 131 in l10n_br_account_payment_brcobranca/models/account_payment_line.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account_payment_brcobranca/models/account_payment_line.py#L131

Added line #L131 was not covered by tests
"valor_mora"
] = cnab_config.boleto_interest_perc
if self.discount_value:
linhas_pagamentos["data_desconto"] = self.date.strftime("%Y/%m/%d")
linhas_pagamentos["valor_desconto"] = self.discount_value

Check warning on line 136 in l10n_br_account_payment_brcobranca/models/account_payment_line.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account_payment_brcobranca/models/account_payment_line.py#L135-L136

Added lines #L135 - L136 were not covered by tests
if cnab_config.boleto_protest_code:
linhas_pagamentos[

Check warning on line 138 in l10n_br_account_payment_brcobranca/models/account_payment_line.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account_payment_brcobranca/models/account_payment_line.py#L138

Added line #L138 was not covered by tests
"codigo_protesto"
] = cnab_config.boleto_protest_code
if cnab_config.boleto_days_protest:
linhas_pagamentos[

Check warning on line 142 in l10n_br_account_payment_brcobranca/models/account_payment_line.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account_payment_brcobranca/models/account_payment_line.py#L142

Added line #L142 was not covered by tests
"dias_protesto"
] = cnab_config.boleto_days_protest

def prepare_bank_payment_line(self, bank_name_brcobranca):
cnab_config = self.order_id.payment_mode_id.cnab_config_id
Expand Down

0 comments on commit 659e77e

Please sign in to comment.