Class: RubyCnab240::Arquivo::Lote::Segment::A
- Inherits:
-
RubyCnab240::Arquivo::Lote::Segment
- Object
- RubyCnab240::Arquivo
- RubyCnab240::Arquivo::Lote
- RubyCnab240::Arquivo::Lote::Segment
- RubyCnab240::Arquivo::Lote::Segment::A
- Defined in:
- lib/rubycnab240/arquivo/lotes/segments/a.rb
Instance Attribute Summary collapse
-
#agencia_mantenedora_da_conta_favorecida ⇒ Object
Returns the value of attribute agencia_mantenedora_da_conta_favorecida.
-
#aviso_ao_favorecido ⇒ Object
Returns the value of attribute aviso_ao_favorecido.
-
#codigo_da_camara_centralizadora ⇒ Object
Returns the value of attribute codigo_da_camara_centralizadora.
-
#codigo_da_instrucao_para_movimento ⇒ Object
Returns the value of attribute codigo_da_instrucao_para_movimento.
-
#codigo_das_ocorrencias_para_retorno ⇒ Object
readonly
Returns the value of attribute codigo_das_ocorrencias_para_retorno.
-
#codigo_do_banco_favorecido ⇒ Object
Returns the value of attribute codigo_do_banco_favorecido.
-
#codigo_do_banco_na_compensacao ⇒ Object
Returns the value of attribute codigo_do_banco_na_compensacao.
-
#codigo_segmento_do_registro_detalhe ⇒ Object
Returns the value of attribute codigo_segmento_do_registro_detalhe.
-
#complemento_finalidade_da_ted ⇒ Object
Returns the value of attribute complemento_finalidade_da_ted.
-
#complemento_finalidade_de_pagamento ⇒ Object
Returns the value of attribute complemento_finalidade_de_pagamento.
-
#complemento_tipo_de_servico ⇒ Object
Returns the value of attribute complemento_tipo_de_servico.
-
#data_do_pagamento ⇒ Object
Returns the value of attribute data_do_pagamento.
-
#data_real_da_efetivacao_do_pagamento ⇒ Object
readonly
Returns the value of attribute data_real_da_efetivacao_do_pagamento.
-
#dec_quantidade_da_moeda ⇒ Object
readonly
Returns the value of attribute dec_quantidade_da_moeda.
-
#dec_valor_real_da_efetivacao_do_pagamento ⇒ Object
readonly
Returns the value of attribute dec_valor_real_da_efetivacao_do_pagamento.
-
#digito_verificador_da_agencia ⇒ Object
Returns the value of attribute digito_verificador_da_agencia.
-
#digito_verificador_da_agencia_e_conta ⇒ Object
Returns the value of attribute digito_verificador_da_agencia_e_conta.
-
#digito_verificador_da_conta ⇒ Object
Returns the value of attribute digito_verificador_da_conta.
-
#lote_do_servico ⇒ Object
Returns the value of attribute lote_do_servico.
-
#nome_do_favorecido ⇒ Object
Returns the value of attribute nome_do_favorecido.
-
#numero_da_conta_corrente ⇒ Object
Returns the value of attribute numero_da_conta_corrente.
-
#numero_do_documento_atribuido_pelo_banco ⇒ Object
readonly
Returns the value of attribute numero_do_documento_atribuido_pelo_banco.
-
#numero_doc_atribuido_para_empresa ⇒ Object
Returns the value of attribute numero_doc_atribuido_para_empresa.
-
#numero_sequencial_de_registro_no_lote ⇒ Object
Returns the value of attribute numero_sequencial_de_registro_no_lote.
-
#outras_informacoes ⇒ Object
Returns the value of attribute outras_informacoes.
-
#quantidade_da_moeda ⇒ Object
Returns the value of attribute quantidade_da_moeda.
-
#tipo_da_moeda ⇒ Object
readonly
Returns the value of attribute tipo_da_moeda.
-
#tipo_de_movimento ⇒ Object
readonly
Returns the value of attribute tipo_de_movimento.
-
#tipo_de_registro ⇒ Object
Returns the value of attribute tipo_de_registro.
-
#uso_exclusivo_febraban ⇒ Object
readonly
Returns the value of attribute uso_exclusivo_febraban.
-
#valor_do_pagamento ⇒ Object
Returns the value of attribute valor_do_pagamento.
-
#valor_real_da_efetivacao_do_pagamento ⇒ Object
readonly
Returns the value of attribute valor_real_da_efetivacao_do_pagamento.
-
#verificacao_retorno ⇒ Object
readonly
Returns the value of attribute verificacao_retorno.
Attributes inherited from RubyCnab240::Arquivo::Lote
#lot_header, #lot_trailer, #lots
Attributes inherited from RubyCnab240::Arquivo
#data_dos_pagamentos, #header, #lot_header, #lot_trailer, #segments, #trailer
Instance Method Summary collapse
-
#initialize(fields = {}) ⇒ A
constructor
A new instance of A.
- #to_string ⇒ Object
Methods inherited from RubyCnab240::Arquivo::Lote
Methods inherited from RubyCnab240::Arquivo
#<<, #number_of_segments, #save_to_file
Constructor Details
#initialize(fields = {}) ⇒ A
Returns a new instance of A.
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 38 def initialize(fields = {}) agencia = fields[:agencia_mantenedora_da_conta_favorecida].to_s[0..4].rjust(5, '0') + fields[:digito_verificador_da_agencia].to_s[0..0].upcase.rjust(1, ' ') conta = fields[:numero_da_conta_corrente].to_s[0..11].rjust(12, '0') + fields[:digito_verificador_da_conta].to_s[0..0].upcase.rjust(1, ' ') @codigo_do_banco_na_compensacao = fields[:codigo_do_banco_na_compensacao].to_s[0..2].rjust(3, '0') #default: 001 @lote_do_servico = fields[:lote_do_servico].to_s[0..3].rjust(4, '0') @tipo_de_registro = fields[:tipo_de_registro].to_s[0..0].rjust(1, '0') @numero_sequencial_de_registro_no_lote = fields[:numero_sequencial_de_registro_no_lote].to_s[0..4].rjust(5, '0') @codigo_segmento_do_registro_detalhe = fields[:codigo_segmento_do_registro_detalhe] = 'A' @tipo_de_movimento = fields[:tipo_de_movimento] = '0' #“0” para inclusão de pagamento ou “9” para exclusão. O pagamento só poderá ser excluido, quando o mesmo já estiver sendo visualizado no Gerenciador Financeiro. @codigo_da_instrucao_para_movimento = fields[:codigo_da_instrucao_para_movimento] = '00' #“00” para inclusão de pagamento ou “99” para exclusão. @codigo_da_camara_centralizadora = fields[:codigo_da_camara_centralizadora].to_s[0..2].rjust(3, '0') #Quando de lançamento no Header do Lote for igual a: '03' (DOC/TED) este campo deverá ser preenchido com '700' para DOC (valor até R$ 4.999,99) ou preencher com '018' para TED (valor igual ou acima de 5 mil reais). Quando a forma de lançamento no Header do Lote for igual a: '41' (TED Outra Titularidade) ou '43' (TED Mesma Titularidade), este campo deverá ser preenchido com '018'. Para crédito no Banco do Brasil informar “000” (zeros). @codigo_do_banco_favorecido = fields[:codigo_do_banco_favorecido].to_s[0..2].rjust(3, '0') @agencia_mantenedora_da_conta_favorecida = agencia[0..-2] @digito_verificador_da_agencia = agencia[-1] @numero_da_conta_corrente = conta[0..-2] @digito_verificador_da_conta = conta[-1] @digito_verificador_da_agencia_e_conta = fields[:digito_verificador_da_agencia_e_conta].to_s[0..0].upcase.rjust(1, ' ') #As contas do Banco do Brasil não possuem o segundo dígito, nesse caso informar 'branco' (espaço). Para favorecidos de outros bancos que possuem contas com dois dígitos verificadores (DV), preencher este campo com o segundo dígito verificador. @nome_do_favorecido = fields[:nome_do_favorecido].to_s[0..29].upcase.ljust(30, ' ') @verificacao_retorno = '0' * 11 @numero_doc_atribuido_para_empresa = fields[:numero_doc_atribuido_para_empresa].to_s[0..8].upcase.rjust(9, '0') #No caso de pagamento de salário, os número colocados nas posições 74 a 79 aparecerão como número do documento no extrato do favorecido, e os números das posições 80 a 85, serão utilizadas como número do documento no extrato do pagador. Obs.: Como os lançamentos ocorridos na conta do pagador são aglutinados num mesmo lote as posições 80 a 85 de todos os detalhes devem ser iguais, caso contrário será considerado apenas o número constante no primeiro registro detalhe de cada lote. As posições 86 a 93 não são tratadas pelo sistema. As informações impostas nessa posição voltarão iguais no arquivo retorno. @data_do_pagamento = fields[:data_do_pagamento].to_s[0..7].rjust(8, ' ') @tipo_da_moeda = fields[:tipo_da_moeda] = 'BRL' @quantidade_da_moeda = fields[:quantidade_da_moeda].to_s[0..9].rjust(10, '0') #Preencher com zeros quando a moeda for Real, no campo 18.3A @dec_quantidade_da_moeda = '00000' @valor_do_pagamento = fields[:valor_do_pagamento].to_s[0..14].upcase.rjust(15, '0') @numero_do_documento_atribuido_pelo_banco = ' ' * 20 @data_real_da_efetivacao_do_pagamento = '0' * 8 @valor_real_da_efetivacao_do_pagamento = '0' * 13 @dec_valor_real_da_efetivacao_do_pagamento = '0' * 2 @outras_informacoes = fields[:outras_informacoes].to_s[0..39].upcase.ljust(40, ' ') #Para Modalidade de Ordem de Pagamento ('10' nas posições 12 e 13 do Header de Lote), poderá ser informado até dois prepostos. Neste caso, informar na posição 178 a 188 o CPF do 1º preposto e na posição 189 a 199 o CPF do 2º preposto e na posição 200 a 217 informar ZEROS. Caso não haja prepostos, preencher os campos com ZEROS. @complemento_tipo_de_servico = fields[:complemento_tipo_de_servico].to_s[0..1].ljust(2, ' ') #Corresponde a Finalidade do DOC. Será repassado para o Banco favorecido conforme informado, sem tratamento. @complemento_finalidade_da_ted = fields[:complemento_finalidade_da_ted].to_s[0..4].ljust(5, ' ') @complemento_finalidade_de_pagamento = fields[:complemento_finalidade_de_pagamento].to_s[0..1].ljust(2, ' ') @uso_exclusivo_febraban = ' ' @aviso_ao_favorecido = ' ' #O ou 5 – o código 5 (com aviso) somente será tratado caso tenha sido negociado com a agência e conste no cadastramento do serviço a emissão de aviso. @codigo_das_ocorrencias_para_retorno = fields[:codigo_das_ocorrencias_para_retorno] = ' ' end |
Instance Attribute Details
#agencia_mantenedora_da_conta_favorecida ⇒ Object
Returns the value of attribute agencia_mantenedora_da_conta_favorecida.
10 11 12 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 10 def agencia_mantenedora_da_conta_favorecida @agencia_mantenedora_da_conta_favorecida end |
#aviso_ao_favorecido ⇒ Object
Returns the value of attribute aviso_ao_favorecido.
24 25 26 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 24 def aviso_ao_favorecido @aviso_ao_favorecido end |
#codigo_da_camara_centralizadora ⇒ Object
Returns the value of attribute codigo_da_camara_centralizadora.
8 9 10 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 8 def codigo_da_camara_centralizadora @codigo_da_camara_centralizadora end |
#codigo_da_instrucao_para_movimento ⇒ Object
Returns the value of attribute codigo_da_instrucao_para_movimento.
7 8 9 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 7 def codigo_da_instrucao_para_movimento @codigo_da_instrucao_para_movimento end |
#codigo_das_ocorrencias_para_retorno ⇒ Object (readonly)
Returns the value of attribute codigo_das_ocorrencias_para_retorno.
36 37 38 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 36 def codigo_das_ocorrencias_para_retorno @codigo_das_ocorrencias_para_retorno end |
#codigo_do_banco_favorecido ⇒ Object
Returns the value of attribute codigo_do_banco_favorecido.
9 10 11 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 9 def codigo_do_banco_favorecido @codigo_do_banco_favorecido end |
#codigo_do_banco_na_compensacao ⇒ Object
Returns the value of attribute codigo_do_banco_na_compensacao.
2 3 4 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 2 def codigo_do_banco_na_compensacao @codigo_do_banco_na_compensacao end |
#codigo_segmento_do_registro_detalhe ⇒ Object
Returns the value of attribute codigo_segmento_do_registro_detalhe.
6 7 8 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 6 def codigo_segmento_do_registro_detalhe @codigo_segmento_do_registro_detalhe end |
#complemento_finalidade_da_ted ⇒ Object
Returns the value of attribute complemento_finalidade_da_ted.
22 23 24 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 22 def complemento_finalidade_da_ted @complemento_finalidade_da_ted end |
#complemento_finalidade_de_pagamento ⇒ Object
Returns the value of attribute complemento_finalidade_de_pagamento.
23 24 25 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 23 def complemento_finalidade_de_pagamento @complemento_finalidade_de_pagamento end |
#complemento_tipo_de_servico ⇒ Object
Returns the value of attribute complemento_tipo_de_servico.
21 22 23 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 21 def complemento_tipo_de_servico @complemento_tipo_de_servico end |
#data_do_pagamento ⇒ Object
Returns the value of attribute data_do_pagamento.
17 18 19 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 17 def data_do_pagamento @data_do_pagamento end |
#data_real_da_efetivacao_do_pagamento ⇒ Object (readonly)
Returns the value of attribute data_real_da_efetivacao_do_pagamento.
32 33 34 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 32 def data_real_da_efetivacao_do_pagamento @data_real_da_efetivacao_do_pagamento end |
#dec_quantidade_da_moeda ⇒ Object (readonly)
Returns the value of attribute dec_quantidade_da_moeda.
30 31 32 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 30 def dec_quantidade_da_moeda @dec_quantidade_da_moeda end |
#dec_valor_real_da_efetivacao_do_pagamento ⇒ Object (readonly)
Returns the value of attribute dec_valor_real_da_efetivacao_do_pagamento.
34 35 36 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 34 def dec_valor_real_da_efetivacao_do_pagamento @dec_valor_real_da_efetivacao_do_pagamento end |
#digito_verificador_da_agencia ⇒ Object
Returns the value of attribute digito_verificador_da_agencia.
11 12 13 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 11 def digito_verificador_da_agencia @digito_verificador_da_agencia end |
#digito_verificador_da_agencia_e_conta ⇒ Object
Returns the value of attribute digito_verificador_da_agencia_e_conta.
14 15 16 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 14 def digito_verificador_da_agencia_e_conta @digito_verificador_da_agencia_e_conta end |
#digito_verificador_da_conta ⇒ Object
Returns the value of attribute digito_verificador_da_conta.
13 14 15 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 13 def digito_verificador_da_conta @digito_verificador_da_conta end |
#lote_do_servico ⇒ Object
Returns the value of attribute lote_do_servico.
3 4 5 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 3 def lote_do_servico @lote_do_servico end |
#nome_do_favorecido ⇒ Object
Returns the value of attribute nome_do_favorecido.
15 16 17 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 15 def nome_do_favorecido @nome_do_favorecido end |
#numero_da_conta_corrente ⇒ Object
Returns the value of attribute numero_da_conta_corrente.
12 13 14 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 12 def numero_da_conta_corrente @numero_da_conta_corrente end |
#numero_do_documento_atribuido_pelo_banco ⇒ Object (readonly)
Returns the value of attribute numero_do_documento_atribuido_pelo_banco.
31 32 33 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 31 def numero_do_documento_atribuido_pelo_banco @numero_do_documento_atribuido_pelo_banco end |
#numero_doc_atribuido_para_empresa ⇒ Object
Returns the value of attribute numero_doc_atribuido_para_empresa.
16 17 18 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 16 def numero_doc_atribuido_para_empresa @numero_doc_atribuido_para_empresa end |
#numero_sequencial_de_registro_no_lote ⇒ Object
Returns the value of attribute numero_sequencial_de_registro_no_lote.
5 6 7 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 5 def numero_sequencial_de_registro_no_lote @numero_sequencial_de_registro_no_lote end |
#outras_informacoes ⇒ Object
Returns the value of attribute outras_informacoes.
20 21 22 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 20 def outras_informacoes @outras_informacoes end |
#quantidade_da_moeda ⇒ Object
Returns the value of attribute quantidade_da_moeda.
18 19 20 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 18 def quantidade_da_moeda @quantidade_da_moeda end |
#tipo_da_moeda ⇒ Object (readonly)
Returns the value of attribute tipo_da_moeda.
29 30 31 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 29 def tipo_da_moeda @tipo_da_moeda end |
#tipo_de_movimento ⇒ Object (readonly)
Returns the value of attribute tipo_de_movimento.
27 28 29 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 27 def tipo_de_movimento @tipo_de_movimento end |
#tipo_de_registro ⇒ Object
Returns the value of attribute tipo_de_registro.
4 5 6 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 4 def tipo_de_registro @tipo_de_registro end |
#uso_exclusivo_febraban ⇒ Object (readonly)
Returns the value of attribute uso_exclusivo_febraban.
35 36 37 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 35 def uso_exclusivo_febraban @uso_exclusivo_febraban end |
#valor_do_pagamento ⇒ Object
Returns the value of attribute valor_do_pagamento.
19 20 21 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 19 def valor_do_pagamento @valor_do_pagamento end |
#valor_real_da_efetivacao_do_pagamento ⇒ Object (readonly)
Returns the value of attribute valor_real_da_efetivacao_do_pagamento.
33 34 35 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 33 def valor_real_da_efetivacao_do_pagamento @valor_real_da_efetivacao_do_pagamento end |
#verificacao_retorno ⇒ Object (readonly)
Returns the value of attribute verificacao_retorno.
28 29 30 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 28 def verificacao_retorno @verificacao_retorno end |
Instance Method Details
#to_string ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 |
# File 'lib/rubycnab240/arquivo/lotes/segments/a.rb', line 77 def to_string segment = String.new segment << self.codigo_do_banco_na_compensacao segment << self.lote_do_servico segment << self.tipo_de_registro segment << self.numero_sequencial_de_registro_no_lote segment << self.codigo_segmento_do_registro_detalhe segment << self.tipo_de_movimento segment << self.codigo_da_instrucao_para_movimento segment << self.codigo_da_camara_centralizadora segment << self.codigo_do_banco_favorecido segment << self.agencia_mantenedora_da_conta_favorecida segment << self.digito_verificador_da_agencia segment << self.numero_da_conta_corrente segment << self.digito_verificador_da_conta segment << self.digito_verificador_da_agencia_e_conta segment << self.nome_do_favorecido segment << self.verificacao_retorno segment << self.numero_doc_atribuido_para_empresa segment << self.data_do_pagamento segment << self.tipo_da_moeda segment << self.quantidade_da_moeda segment << self.dec_quantidade_da_moeda segment << self.valor_do_pagamento segment << self.numero_do_documento_atribuido_pelo_banco segment << self.data_real_da_efetivacao_do_pagamento segment << self.valor_real_da_efetivacao_do_pagamento segment << self.dec_valor_real_da_efetivacao_do_pagamento segment << self.outras_informacoes segment << self.complemento_tipo_de_servico segment << self.complemento_finalidade_da_ted segment << self.complemento_finalidade_de_pagamento segment << self.uso_exclusivo_febraban segment << self.aviso_ao_favorecido segment << self.codigo_das_ocorrencias_para_retorno end |