diff --git a/l10n_br_account_payment_brcobranca/models/account_move_line.py b/l10n_br_account_payment_brcobranca/models/account_move_line.py
index c580b8cbe6d6..419632054c12 100644
--- a/l10n_br_account_payment_brcobranca/models/account_move_line.py
+++ b/l10n_br_account_payment_brcobranca/models/account_move_line.py
@@ -86,6 +86,14 @@ def send_payment(self):
"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(
+ {
+ "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(
diff --git a/l10n_br_account_payment_brcobranca/models/account_payment_order.py b/l10n_br_account_payment_brcobranca/models/account_payment_order.py
index e4a8feab28b1..a4e40e73c766 100644
--- a/l10n_br_account_payment_brcobranca/models/account_payment_order.py
+++ b/l10n_br_account_payment_brcobranca/models/account_payment_order.py
@@ -36,6 +36,17 @@ def _prepare_remessa_banco_brasil_400(self, remessa_values):
}
)
+ def _prepare_remessa_santander_400(self, remessa_values):
+ remessa_values.update(
+ {
+ "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(
{
diff --git a/l10n_br_account_payment_order/models/l10n_br_cnab_boleto_fields.py b/l10n_br_account_payment_order/models/l10n_br_cnab_boleto_fields.py
index 9fe9ff9ea5cc..61bcddf158cf 100644
--- a/l10n_br_account_payment_order/models/l10n_br_cnab_boleto_fields.py
+++ b/l10n_br_account_payment_order/models/l10n_br_cnab_boleto_fields.py
@@ -51,6 +51,21 @@ class L10nBrCNABBoletoFields(models.AbstractModel):
tracking=True,
)
+ boleto_wallet2 = fields.Char(
+ 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(
+ 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,
diff --git a/l10n_br_account_payment_order/views/account_payment_mode.xml b/l10n_br_account_payment_order/views/account_payment_mode.xml
index 8e359fae4cda..37da9a2c1ed1 100644
--- a/l10n_br_account_payment_order/views/account_payment_mode.xml
+++ b/l10n_br_account_payment_order/views/account_payment_mode.xml
@@ -52,8 +52,10 @@
attrs="{'required': [('payment_method_code', 'in', ('240', '400', '500')), ('payment_type', '==', 'inbound')]}"
/>
+
+