Class: BrBoleto::Remessa::Cnab240::Santander

Inherits:
Base show all
Defined in:
lib/br_boleto/remessa/cnab240/santander.rb

Instance Attribute Summary

Attributes inherited from Base

#lotes, #mensagem_1, #mensagem_2

Attributes inherited from Base

#data_hora_arquivo, #sequencial_remessa

Instance Method Summary collapse

Methods inherited from Base

class_for_lote, #codigo_convenio, #dados_do_arquivo, #monta_lote, #pagamento_valid_distribuicao_boleto_length, #pagamento_valid_emissao_boleto_length, #usa_segmento_R?, #usa_segmento_S?

Methods included from Helper::TrailerArquivo

#monta_trailer_arquivo, #trailer_arquivo_posicao_001_a_003, #trailer_arquivo_posicao_004_a_007, #trailer_arquivo_posicao_008_a_008, #trailer_arquivo_posicao_009_a_017, #trailer_arquivo_posicao_018_a_023, #trailer_arquivo_posicao_024_a_029, #trailer_arquivo_posicao_036_a_240

Methods included from Helper::TrailerLote

#monta_trailer_lote, #trailer_lote_posicao_001_a_003, #trailer_lote_posicao_004_a_007, #trailer_lote_posicao_008_a_008, #trailer_lote_posicao_009_a_017, #trailer_lote_posicao_018_a_023, #trailer_lote_posicao_024_a_240

Methods included from Helper::SegmentoS

#monta_segmento_s, #segmento_s_posicao_001_a_003, #segmento_s_posicao_004_a_007, #segmento_s_posicao_008_a_008, #segmento_s_posicao_009_a_013, #segmento_s_posicao_014_a_014, #segmento_s_posicao_015_a_015, #segmento_s_posicao_016_a_017, #segmento_s_posicao_018_a_018, #segmento_s_posicao_019_a_020_tipo_impressao_1_ou_2, #segmento_s_posicao_019_a_058_tipo_impressao_3, #segmento_s_posicao_059_a_098_tipo_impressao_3, #segmento_s_posicao_099_a_138_tipo_impressao_3, #segmento_s_posicao_139_a_178_tipo_impressao_3, #segmento_s_posicao_179_a_218_tipo_impressao_3, #segmento_s_posicao_219_a_240_tipo_impressao_3, #segmento_s_tipo_impressao_1_ou_2, #segmento_s_tipo_impressao_3

Methods included from Helper::SegmentoR

#monta_segmento_r, #segmento_r_posicao_001_a_003, #segmento_r_posicao_004_a_007, #segmento_r_posicao_008_a_008, #segmento_r_posicao_009_a_013, #segmento_r_posicao_014_a_014, #segmento_r_posicao_015_a_015, #segmento_r_posicao_016_a_017, #segmento_r_posicao_018_a_018, #segmento_r_posicao_019_a_026, #segmento_r_posicao_027_a_041, #segmento_r_posicao_066_a_066, #segmento_r_posicao_067_a_074, #segmento_r_posicao_075_a_089, #segmento_r_posicao_090_a_099, #segmento_r_posicao_100_a_139, #segmento_r_posicao_140_a_179

Methods included from Helper::SegmentoQ

#monta_segmento_q, #segmento_q_posicao_001_a_003, #segmento_q_posicao_004_a_007, #segmento_q_posicao_008_a_008, #segmento_q_posicao_009_a_013, #segmento_q_posicao_014_a_014, #segmento_q_posicao_015_a_015, #segmento_q_posicao_016_a_017, #segmento_q_posicao_018_a_018, #segmento_q_posicao_019_a_033, #segmento_q_posicao_034_a_073, #segmento_q_posicao_074_a_113, #segmento_q_posicao_114_a_128, #segmento_q_posicao_129_a_133, #segmento_q_posicao_134_a_136, #segmento_q_posicao_137_a_151, #segmento_q_posicao_152_a_153, #segmento_q_posicao_154_a_154, #segmento_q_posicao_155_a_169, #segmento_q_posicao_170_a_209, #segmento_q_posicao_210_a_212, #segmento_q_posicao_213_a_232, #segmento_q_posicao_233_a_240

Methods included from Helper::SegmentoP

#monta_segmento_p, #segmento_p_posicao_001_a_003, #segmento_p_posicao_004_a_007, #segmento_p_posicao_008_a_008, #segmento_p_posicao_009_a_013, #segmento_p_posicao_014_a_014, #segmento_p_posicao_015_a_015, #segmento_p_posicao_016_a_017, #segmento_p_posicao_024_a_057, #segmento_p_posicao_058_a_058, #segmento_p_posicao_059_a_059, #segmento_p_posicao_060_a_060, #segmento_p_posicao_063_a_077, #segmento_p_posicao_078_a_085, #segmento_p_posicao_086_a_100, #segmento_p_posicao_101_a_105, #segmento_p_posicao_106_a_106, #segmento_p_posicao_107_a_108, #segmento_p_posicao_109_a_109, #segmento_p_posicao_110_a_117, #segmento_p_posicao_118_a_118, #segmento_p_posicao_119_a_126, #segmento_p_posicao_127_a_141, #segmento_p_posicao_142_a_142, #segmento_p_posicao_143_a_150, #segmento_p_posicao_151_a_165, #segmento_p_posicao_166_a_180, #segmento_p_posicao_181_a_195, #segmento_p_posicao_196_a_220, #segmento_p_posicao_221_a_221, #segmento_p_posicao_222_a_223, #segmento_p_posicao_224_a_224, #segmento_p_posicao_225_a_227, #segmento_p_posicao_228_a_229, #segmento_p_posicao_240_a_240

Methods included from Helper::HeaderLote

#header_lote_posicao_001_a_003, #header_lote_posicao_004_a_007, #header_lote_posicao_008_a_008, #header_lote_posicao_009_a_009, #header_lote_posicao_010_a_011, #header_lote_posicao_014_a_016, #header_lote_posicao_017_a_017, #header_lote_posicao_018_a_018, #header_lote_posicao_019_a_033, #header_lote_posicao_034_a_053, #header_lote_posicao_074_a_103, #header_lote_posicao_104_a_143, #header_lote_posicao_144_a_183, #header_lote_posicao_184_a_191, #header_lote_posicao_192_a_199, #monta_header_lote

Methods included from Helper::HeaderArquivo

#header_arquivo_posicao_001_a_003, #header_arquivo_posicao_004_a_007, #header_arquivo_posicao_008_a_008, #header_arquivo_posicao_009_a_017, #header_arquivo_posicao_018_a_018, #header_arquivo_posicao_019_a_032, #header_arquivo_posicao_053_a_072, #header_arquivo_posicao_073_a_102, #header_arquivo_posicao_103_a_132, #header_arquivo_posicao_133_a_142, #header_arquivo_posicao_143_a_143, #header_arquivo_posicao_144_a_151, #header_arquivo_posicao_158_a_163, #header_arquivo_posicao_164_a_166, #header_arquivo_posicao_212_a_240, #monta_header_arquivo

Methods inherited from Base

#data_geracao, #hora_geracao, #pagamento_valid_cod_desconto_length, #pagamento_valid_distribuicao_boleto_length, #pagamento_valid_emissao_boleto_length, #pagamento_valid_tipo_impressao_required, #persisted?

Methods included from HaveConta

#conta, #conta=

Methods inherited from ActiveModelBase

#assign_attributes, #default_values, #initialize

Constructor Details

This class inherits a constructor from BrBoleto::ActiveModelBase

Instance Method Details

#complemento_header_arquivoObject



55
56
57
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 55

def complemento_header_arquivo
	''
end

#complemento_p(pagamento) ⇒ Object

segmento_p_posicao_023_a_057 DESCRIÇÃO TAMANHO POSIÇÃO


Número da Conta Corrente 09 023 - 031 DV da Conta 01 032 – 032 Conta cobrança 09 033 - 041

DV da conta cobrança 01 042 - 042

Reservado (uso Banco) 02 043 - 044

Nosso Número 13 045 - 057

TOTAL = 35 posições



127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 127

def complemento_p(pagamento)
	complemento = ''
	complemento << "#{conta.conta_corrente}".adjust_size_to(9, '0', :right)
	complemento << "#{conta.conta_corrente_dv}".adjust_size_to(1)   

	complemento << ''.adjust_size_to(9, '0', :right)
	complemento << ''.adjust_size_to(1, '0', :right)  

	complemento << ''.adjust_size_to(2)
	complemento << "#{pagamento.nosso_numero}".adjust_size_to(13, '0', :right)
	complemento
end

#complemento_trailer_lote(lote, nr_lote) ⇒ Object

trailer_lote_posicao_024_a_240(lote, nr_lote) DESCRIÇÃO TAMANHO POSIÇÃO


Reservado (uso Banco) 217 024 - 240

TOTAL = 217 posições



254
255
256
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 254

def complemento_trailer_lote(lote, nr_lote)
	''.adjust_size_to(217)
end

#conta_classObject



6
7
8
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 6

def conta_class
	BrBoleto::Conta::Santander
end

#convenio_lote(lote) ⇒ Object

Reservado (uso Banco) TOTAL = 20 posições



69
70
71
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 69

def convenio_lote(lote)
	''.adjust_size_to(20)
end

#header_arquivo_posicao_033_a_052Object



20
21
22
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 20

def header_arquivo_posicao_033_a_052
	header_arquivo_posicao_033_a_47
end

#header_arquivo_posicao_033_a_47Object

DESCRIÇÃO TAMANHO POSIÇÃO


Cód. de Transmissão 15 33-47

TOTAL = 15 posições



17
18
19
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 17

def header_arquivo_posicao_033_a_47
	"#{conta.codigo_transmissao}".adjust_size_to(15, '0', :right)
end

#header_arquivo_posicao_152_a_157Object

Reservado (uso Banco) Para o Santander esse espaço deve ter ‘Brancos’



36
37
38
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 36

def header_arquivo_posicao_152_a_157
	''.adjust_size_to(6)
end

#header_arquivo_posicao_167_a_171Object



46
47
48
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 46

def header_arquivo_posicao_167_a_171
	header_arquivo_posicao_167_a_240
end

#header_arquivo_posicao_167_a_240Object

Posição 167 a 240 do Header do Arquivo Para o Santander esse espaço deve ter ‘Brancos’ TOTAL = 74 posições



43
44
45
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 43

def header_arquivo_posicao_167_a_240
	''.adjust_size_to(74)
end

#header_arquivo_posicao_172_a_191Object



49
50
51
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 49

def header_arquivo_posicao_172_a_191
	''
end

#header_arquivo_posicao_192_a_211Object



52
53
54
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 52

def header_arquivo_posicao_192_a_211
	''
end

#header_lote_posicao_012_a_013Object

Reservado (uso Banco) 2 posições



63
64
65
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 63

def header_lote_posicao_012_a_013
	''.adjust_size_to(2)
end

#header_lote_posicao_054_a_073Object

header_lote_posicao_054_a_073 DESCRIÇÃO TAMANHO POSIÇÃO


Cód. de Transmissão 15 54-68 Reservado uso Banco (Brancos) 05 69-73

TOTAL = 20 posições



80
81
82
83
84
85
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 80

def header_lote_posicao_054_a_073
	info = ''
	info << "#{conta.codigo_transmissao}".adjust_size_to(15, '0', :right)
	info << ''.adjust_size_to(5)
	info
end

#header_lote_posicao_200_a_207Object



92
93
94
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 92

def header_lote_posicao_200_a_207
	header_lote_posicao_200_a_240
end

#header_lote_posicao_200_a_240Object

Reservado (uso Banco) TOTAL = 41 posições



89
90
91
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 89

def header_lote_posicao_200_a_240
	''.adjust_size_to(41)
end

#header_lote_posicao_208_a_240Object



95
96
97
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 95

def header_lote_posicao_208_a_240
	''
end

#informacoes_da_contaObject

Informação da conta DESCRIÇÃO TAMANHO POSIÇÃO


Reservado (uso Banco) 25 48-72

TOTAL = 25 posições



30
31
32
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 30

def informacoes_da_conta
	''.adjust_size_to(25)
end

#segmento_p_numero_do_documento(pagamento) ⇒ Object

segmento_p_posicao_063_a_077 DESCRIÇÃO TAMANHO POSIÇÃO


Número Doc. 15 63 - 77 TOTAL = 15 posições



157
158
159
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 157

def segmento_p_numero_do_documento(pagamento)
	"#{pagamento.numero_documento}".adjust_size_to(15, '0', :right)
end

#segmento_p_posicao_018_a_022Object

O padrão da FEBRABAN é Posição 18-22 = Número da Agência Posição 23-23 = DV Agência

Porém para o Santander a posição 23 já começa o complemento do segmento P com o número da conta. Padrão do Santander é: Posição 18-21 = Agência (4 dígitos) Posição 22-22 = DV Agência (1 dígito)



110
111
112
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 110

def segmento_p_posicao_018_a_022
"#{conta.agencia}#{conta.agencia_dv}".adjust_size_to(5, '0', :right)
end

#segmento_p_posicao_023_a_023Object



113
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 113

def segmento_p_posicao_023_a_023; '' end

#segmento_p_posicao_061_a_061(pagamento) ⇒ Object

Reservado (uso Banco) TOTAL = 1 posição



142
143
144
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 142

def segmento_p_posicao_061_a_061(pagamento)
	" "
end

#segmento_p_posicao_062_a_062(pagamento) ⇒ Object

Reservado (uso Banco) TOTAL = 1 posição



148
149
150
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 148

def segmento_p_posicao_062_a_062(pagamento)
	" "
end

#segmento_p_posicao_230_a_239Object

Nº do Contrato da Operação de Crédito (Uso do banco) TOTAL = 10 posições



163
164
165
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 163

def segmento_p_posicao_230_a_239
	''.adjust_size_to(10)
end

#segmento_r_posicao_042_a_042(pagamento) ⇒ Object



173
174
175
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 173

def segmento_r_posicao_042_a_042(pagamento)
	segmento_r_posicao_042_a_065
end

#segmento_r_posicao_042_a_065Object

Reservado (uso Banco)



170
171
172
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 170

def segmento_r_posicao_042_a_065
	''.adjust_size_to(24)
end

#segmento_r_posicao_043_a_050(pagamento) ⇒ Object



176
177
178
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 176

def segmento_r_posicao_043_a_050(pagamento)
	''
end

#segmento_r_posicao_051_a_065(pagamento) ⇒ Object



179
180
181
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 179

def segmento_r_posicao_051_a_065(pagamento)
	''
end

#segmento_r_posicao_180_a_199Object



187
188
189
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 187

def segmento_r_posicao_180_a_199
	segmento_r_posicao_180_a_240
end

#segmento_r_posicao_180_a_240Object

Reservado



184
185
186
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 184

def segmento_r_posicao_180_a_240
	''.adjust_size_to(61)
end

#segmento_r_posicao_200_a_207Object



190
191
192
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 190

def segmento_r_posicao_200_a_207
	''
end

#segmento_r_posicao_208_a_210Object



193
194
195
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 193

def segmento_r_posicao_208_a_210
	''
end

#segmento_r_posicao_211_a_215Object



196
197
198
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 196

def segmento_r_posicao_211_a_215
	''
end

#segmento_r_posicao_216_a_216Object



199
200
201
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 199

def segmento_r_posicao_216_a_216
	''
end

#segmento_r_posicao_217_a_228Object



202
203
204
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 202

def segmento_r_posicao_217_a_228
	''
end

#segmento_r_posicao_229_a_229Object



205
206
207
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 205

def segmento_r_posicao_229_a_229
	''
end

#segmento_r_posicao_230_a_230Object



208
209
210
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 208

def segmento_r_posicao_230_a_230
	''
end

#segmento_r_posicao_231_a_231Object



211
212
213
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 211

def segmento_r_posicao_231_a_231
	''
end

#segmento_r_posicao_232_a_240Object



214
215
216
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 214

def segmento_r_posicao_232_a_240
	''
end

#segmento_s_posicao_021_a_160_tipo_impressao_1_ou_2(pagamento) ⇒ Object



236
237
238
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 236

def segmento_s_posicao_021_a_160_tipo_impressao_1_ou_2(pagamento)
	segmento_s_posicao_021_a_240_tipo_impressao_1_ou_2
end

#segmento_s_posicao_021_a_240_tipo_impressao_1_ou_2Object

segmento_s_posicao_021_a_240_tipo_impressao_1_ou_2 DESCRIÇÃO TAMANHO POSIÇÃO


Mensagem para recibo do sacado 001 021 - 021 Mensagem a ser impressa 100 022 - 121 Reservado (uso Banco) 119 122 - 240

TOTAL = 120 posições



229
230
231
232
233
234
235
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 229

def segmento_s_posicao_021_a_240_tipo_impressao_1_ou_2
	segmento = ''
	segmento << '4'
	segmento << ''.adjust_size_to(100)
	segmento << ''.adjust_size_to(119)
	segmento
end

#segmento_s_posicao_161_a_162_tipo_impressao_1_ou_2(pagamento) ⇒ Object



239
240
241
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 239

def segmento_s_posicao_161_a_162_tipo_impressao_1_ou_2(pagamento)
	''
end

#segmento_s_posicao_163_a_240_tipo_impressao_1_ou_2Object



242
243
244
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 242

def segmento_s_posicao_163_a_240_tipo_impressao_1_ou_2
	''
end

#trailer_arquivo_posicao_030_a_035Object

Reservado (uso Banco)



261
262
263
# File 'lib/br_boleto/remessa/cnab240/santander.rb', line 261

def trailer_arquivo_posicao_030_a_035
	''.adjust_size_to(6)
end