Class: CNAB240::BancoABC::Entities::RegisterP

Inherits:
Base
  • Object
show all
Defined in:
lib/cnab240/bancoabc/entities/register_p.rb

Instance Method Summary collapse

Methods inherited from Base

#header?, #trailler?

Instance Method Details

#aceite(data) ⇒ Object



107
108
109
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 107

def aceite(data)
  append_space(data[0], 1)
end

#agencia(data = nil) ⇒ Object



95
96
97
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 95

def agencia(data = nil)
  append_space(data, 5)
end

#cadastramento(data = nil) ⇒ Object



67
68
69
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 67

def cadastramento(data = nil)
  append_space(data, 1)
end

#carteira(data = nil) ⇒ Object



63
64
65
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 63

def carteira(data = nil)
  append_space(data, 1)
end

#cnab(data = nil) ⇒ Object



31
32
33
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 31

def cnab(data = nil)
  append_space(data, 1)
end

#cod_desconto(data = nil) ⇒ Object



127
128
129
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 127

def cod_desconto(data = nil)
  append_space(data, 1)
end

#codigo_baixa_devolucao(data) ⇒ Object



161
162
163
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 161

def codigo_baixa_devolucao(data)
  prepend_zero(data, 1)
end

#codigo_banco(data = nil) ⇒ Object



11
12
13
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 11

def codigo_banco(data = nil)
  append_space(data, 3)
end

#codigo_juros_mora(data = nil) ⇒ Object



115
116
117
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 115

def codigo_juros_mora(data = nil)
  append_space(data, 1)
end

#codigo_moeda(data = nil) ⇒ Object



169
170
171
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 169

def codigo_moeda(data = nil)
  append_space(data, 2)
end

#codigo_movimento(data = nil) ⇒ Object



35
36
37
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 35

def codigo_movimento(data = nil)
  append_space(data, 2)
end

#codigo_protesto(data = nil) ⇒ Object



151
152
153
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 151

def codigo_protesto(data = nil)
  append_space(data, 1)
end

#data_desconto(data = nil) ⇒ Object



131
132
133
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 131

def data_desconto(data = nil)
  append_space(data, 8)
end

#data_emissao(data = nil) ⇒ Object



111
112
113
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 111

def data_emissao(data = nil)
  append_space(data, 8)
end

#data_juros_mora(data = nil) ⇒ Object



119
120
121
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 119

def data_juros_mora(data = nil)
  append_space(data, 8)
end

#data_vencimento(data = nil) ⇒ Object



87
88
89
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 87

def data_vencimento(data = nil)
  append_space(data, 8)
end

#digito_verificador(data = nil) ⇒ Object



99
100
101
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 99

def digito_verificador(data = nil)
  append_space(data, 1)
end

#direcionamento_cobranca(data = nil) ⇒ Object



43
44
45
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 43

def direcionamento_cobranca(data = nil)
  append_space(data, 1)
end

#dist_boleto(data = nil) ⇒ Object



79
80
81
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 79

def dist_boleto(data = nil)
  append_space(data, 1)
end

#documento(data = nil) ⇒ Object



71
72
73
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 71

def documento(data = nil)
  append_space(data, 1)
end

#emissao_boleto(data = nil) ⇒ Object



75
76
77
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 75

def emissao_boleto(data = nil)
  append_space(data, 1)
end

#especie_titulo(data = nil) ⇒ Object



103
104
105
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 103

def especie_titulo(data = nil)
  append_space(data, 2)
end

#identificacao_do_titulo(data = nil) ⇒ Object



59
60
61
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 59

def identificacao_do_titulo(data = nil)
  append_space(data, 11)
end

#identificacao_empresa(data) ⇒ Object



39
40
41
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 39

def identificacao_empresa(data)
  prepend_zero(data, 20)
end

#juros_mora(data = nil) ⇒ Object



123
124
125
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 123

def juros_mora(data = nil)
  prepend_zero(data, 15)
end

#lote_servico(data = nil) ⇒ Object



15
16
17
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 15

def lote_servico(data = nil)
  append_space(data, 4)
end

#modalidade_banco_cedente(data = nil) ⇒ Object



55
56
57
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 55

def modalidade_banco_cedente(data = nil)
  append_space(data, 3)
end

#modalidade_cobranca(data = "0") ⇒ Object



47
48
49
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 47

def modalidade_cobranca(data = "0")
  prepend_zero(data, 3)
end

#numero_contrato(data = nil) ⇒ Object



173
174
175
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 173

def numero_contrato(data = nil)
  append_space(data, 10)
end

#numero_documento(data = nil) ⇒ Object



83
84
85
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 83

def numero_documento(data = nil)
  append_space(data, 15)
end

#numero_registro(data = nil) ⇒ Object



23
24
25
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 23

def numero_registro(data = nil)
  prepend_zero(data, 5)
end

#prazo_baixa_devolucao(data = "0") ⇒ Object



165
166
167
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 165

def prazo_baixa_devolucao(data = "0")
  prepend_zero(data, 3)
end

#prazo_protesto(data, codigo_protesto = 1) ⇒ Object



155
156
157
158
159
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 155

def prazo_protesto(data, codigo_protesto = 1)
  return "00" if codigo_protesto.to_i == 3

  prepend_zero(data, 2)
end

#register?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 7

def register?
  true
end

#segmentoObject



27
28
29
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 27

def segmento
  "P"
end

#tipo_registro(data = nil) ⇒ Object



19
20
21
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 19

def tipo_registro(data = nil)
  append_space(data, 1)
end

#uso_empresa_cedente(data = nil) ⇒ Object



147
148
149
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 147

def uso_empresa_cedente(data = nil)
  append_space(data, 25)
end

#uso_exclusivo_abc(data = nil) ⇒ Object



51
52
53
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 51

def uso_exclusivo_abc(data = nil)
  append_space(data, 2)
end

#uso_livre(data = nil) ⇒ Object



177
178
179
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 177

def uso_livre(data = nil)
  append_space(data, 1)
end

#valor_abatimento(data = nil) ⇒ Object



143
144
145
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 143

def valor_abatimento(data = nil)
  prepend_zero(data, 15)
end

#valor_desconto(data = nil) ⇒ Object



135
136
137
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 135

def valor_desconto(data = nil)
  prepend_zero(data, 15)
end

#valor_iof(data = nil) ⇒ Object



139
140
141
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 139

def valor_iof(data = nil)
  prepend_zero(data, 15)
end

#valor_titulo(data = nil) ⇒ Object



91
92
93
# File 'lib/cnab240/bancoabc/entities/register_p.rb', line 91

def valor_titulo(data = nil)
  prepend_zero(data, 15)
end