Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FORWARD-PORT][l10n_br_account_payment_brcobranca] - Santander CNAB 400 #2848

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@
"instrucao1": move_line.payment_mode_id.instructions or "",
}

# No Santander a carteira impressa no boleto é diferente da remessa.
if bank_account_id.bank_id.code_bc in ("033"):
boleto_cnab_api_data.update(

Check warning on line 91 in l10n_br_account_payment_brcobranca/models/account_move_line.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account_payment_brcobranca/models/account_move_line.py#L91

Added line #L91 was not covered by tests
{
"carteira": str(move_line.payment_mode_id.boleto_wallet2),
}
)

# Instrução de Juros
if move_line.payment_mode_id.boleto_interest_perc > 0.0:
valor_juros = move_line.currency_id.round(
Expand Down
11 changes: 11 additions & 0 deletions l10n_br_account_payment_brcobranca/models/account_payment_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,17 @@
}
)

def _prepare_remessa_santander_400(self, remessa_values):
remessa_values.update(

Check warning on line 40 in l10n_br_account_payment_brcobranca/models/account_payment_order.py

View check run for this annotation

Codecov / codecov/patch

l10n_br_account_payment_brcobranca/models/account_payment_order.py#L40

Added line #L40 was not covered by tests
{
"codigo_carteira": str(self.payment_mode_id.boleto_wallet),
"codigo_transmissao": self.payment_mode_id.transmission_code,
"conta_corrente": misc.punctuation_rm(
self.journal_id.bank_account_id.acc_number
),
}
)

def _prepare_remessa_caixa_240(self, remessa_values):
remessa_values.update(
{
Expand Down
15 changes: 15 additions & 0 deletions l10n_br_account_payment_order/models/l10n_br_cnab_boleto_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ class L10nBrCNABBoletoFields(models.AbstractModel):
tracking=True,
)

boleto_wallet2 = fields.Char(
kaynnan marked this conversation as resolved.
Show resolved Hide resolved
string="Carteira Boleto",
help="Código da carteira para ser impresso no boleto, "
"quando o mesmo for diferente do impresso na remessa.",
size=3,
track_visibility="always",
)

transmission_code = fields.Char(
kaynnan marked this conversation as resolved.
Show resolved Hide resolved
string="Código de Transmissão",
help="Informação cedida pelo banco que identifica o arquivo remessa do cliente",
size=20,
track_visibility="always",
)

boleto_modality = fields.Char(
string="Modalidade",
size=2,
Expand Down
2 changes: 2 additions & 0 deletions l10n_br_account_payment_order/views/account_payment_mode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@
attrs="{'required': [('payment_method_code', 'in', ('240', '400', '500')), ('payment_type', '==', 'inbound')]}"
/>
<field name="boleto_wallet" />
<field name="boleto_wallet2" />
kaynnan marked this conversation as resolved.
Show resolved Hide resolved
<field name="boleto_modality" />
<field name="boleto_variation" />
<field name="transmission_code" />
<field name="boleto_accept" />
<field name="boleto_species" />
<field name="payment_method_code" invisible="1" />
Expand Down
Loading