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

Santander Remessa 240: Adiciona código e dias da baixa/devolução #261

Merged
merged 1 commit into from
Sep 7, 2024
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
8 changes: 6 additions & 2 deletions lib/brcobranca/remessa/cnab240/santander.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ def dv_agencia_cobradora
''.rjust(1, ' ')
end

def dias_baixa(pagamento)
pagamento.dias_baixa.to_s.rjust(2, '0')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

end

def monta_header_arquivo
header_arquivo = '' # CAMPO TAMANHO
header_arquivo += cod_banco # codigo do banco 3
Expand Down Expand Up @@ -182,9 +186,9 @@ def monta_segmento_p(pagamento, nro_lote, sequencial)
segmento_p << formata_documento_ou_numero(pagamento) # identificacao titulo empresa 25
segmento_p << pagamento.codigo_protesto # cod. para protesto 1
segmento_p << pagamento.dias_protesto.to_s.rjust(2, '0') # dias para protesto 2
segmento_p << '3' # cod. para baixa 1
segmento_p << codigo_baixa(pagamento) # cod. para baixa 1
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [113/80]

segmento_p << '0' # zero fixo 1
segmento_p << '00' # dias para baixa 2
segmento_p << dias_baixa(pagamento) # dias para baixa 2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Metrics/LineLength: Line is too long. [113/80]

segmento_p << '00' # cod. da moeda 2
segmento_p << ''.rjust(11, ' ') # uso exclusivo 11
segmento_p
Expand Down
4 changes: 3 additions & 1 deletion spec/brcobranca/remessa/cnab240/santander_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
cep_sacado: '12345678',
cidade_sacado: 'Santa rita de cássia maria da silva',
uf_sacado: 'SP',
numero: '123')
numero: '123',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

codigo_baixa: '3',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

dias_baixa: '0')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style/StringLiterals: Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

end
let(:params) do
{ empresa_mae: 'SOCIEDADE BRASILEIRA DE ZOOLOGIA LTDA',
Expand Down
Loading