ci_power 0.0.26 → 0.0.27
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ci_power/action.rb +63 -63
- data/lib/ci_power/address.rb +97 -97
- data/lib/ci_power/communication.rb +18 -18
- data/lib/ci_power/debt_claim.rb +73 -73
- data/lib/ci_power/debtor_data.rb +65 -65
- data/lib/ci_power/dossier_data.rb +93 -93
- data/lib/ci_power/export.rb +171 -171
- data/lib/ci_power/installment_plan.rb +39 -39
- data/lib/ci_power/open_appointment.rb +45 -45
- data/lib/ci_power/process_data.rb +108 -108
- data/lib/ci_power/record.rb +41 -41
- data/lib/ci_power/version.rb +3 -3
- data/lib/ci_power.rb +14 -13
- data/lib/generators/ci_power/ci_power_generator.rb +11 -11
- data/lib/generators/ci_power/templates/cip_export.rb +12 -12
- data/lib/tasks/ci_power.rake +23 -23
- data/spec/ci_power/export_spec.rb +74 -74
- data/spec/ci_power/installment_plan_spec.rb +60 -60
- data/spec/spec_helper.rb +20 -20
- metadata +88 -94
data/lib/ci_power/action.rb
CHANGED
@@ -1,64 +1,64 @@
|
|
1
|
-
module CiPower
|
2
|
-
class Action < Record
|
3
|
-
attr_accessor :action_date,
|
4
|
-
:action,
|
5
|
-
:mkz,
|
6
|
-
:amount,
|
7
|
-
:currency,
|
8
|
-
:exchange_rate,
|
9
|
-
:value_date,
|
10
|
-
:comment_1,
|
11
|
-
:comment_2,
|
12
|
-
:op_no,
|
13
|
-
:op_membership,
|
14
|
-
:cip_dossier_no,
|
15
|
-
:external_dossier_no,
|
16
|
-
:cip_identification,
|
17
|
-
:debt_claim_group,
|
18
|
-
:customer_specific_field_1,
|
19
|
-
:customer_specific_field_2,
|
20
|
-
:customer_specific_field_3,
|
21
|
-
:customer_specific_field_4,
|
22
|
-
:customer_specific_field_5,
|
23
|
-
:customer_specific_field_6,
|
24
|
-
:internal_note
|
25
|
-
|
26
|
-
def initialize(attributes = {})
|
27
|
-
if attributes.is_a? Hash
|
28
|
-
attributes.merge! :record_type => '17'
|
29
|
-
attributes.each do |key, value|
|
30
|
-
self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
def to_cip(with_line_terminator = true)
|
36
|
-
cip_default_data << fill_up(
|
37
|
-
{
|
38
|
-
:action_date => 10,
|
39
|
-
:action => 10,
|
40
|
-
:mkz => 10,
|
41
|
-
:amount => 15,
|
42
|
-
:currency => 10,
|
43
|
-
:exchange_rate => 15,
|
44
|
-
:value_date => 10,
|
45
|
-
:comment_1 => 32,
|
46
|
-
:comment_2 => 32,
|
47
|
-
:op_no => 32,
|
48
|
-
:op_membership => 32,
|
49
|
-
:cip_dossier_no => 25,
|
50
|
-
:external_dossier_no => 32,
|
51
|
-
:cip_identification => 7,
|
52
|
-
:debt_claim_group => 32,
|
53
|
-
:customer_specific_field_1 => 10,
|
54
|
-
:customer_specific_field_2 => 10,
|
55
|
-
:customer_specific_field_3 => 10,
|
56
|
-
:customer_specific_field_4 => 32,
|
57
|
-
:customer_specific_field_5 => 32,
|
58
|
-
:customer_specific_field_6 => 42,
|
59
|
-
:internal_note => 1500
|
60
|
-
}, with_line_terminator
|
61
|
-
)
|
62
|
-
end
|
63
|
-
end
|
1
|
+
module CiPower
|
2
|
+
class Action < Record
|
3
|
+
attr_accessor :action_date,
|
4
|
+
:action,
|
5
|
+
:mkz,
|
6
|
+
:amount,
|
7
|
+
:currency,
|
8
|
+
:exchange_rate,
|
9
|
+
:value_date,
|
10
|
+
:comment_1,
|
11
|
+
:comment_2,
|
12
|
+
:op_no,
|
13
|
+
:op_membership,
|
14
|
+
:cip_dossier_no,
|
15
|
+
:external_dossier_no,
|
16
|
+
:cip_identification,
|
17
|
+
:debt_claim_group,
|
18
|
+
:customer_specific_field_1,
|
19
|
+
:customer_specific_field_2,
|
20
|
+
:customer_specific_field_3,
|
21
|
+
:customer_specific_field_4,
|
22
|
+
:customer_specific_field_5,
|
23
|
+
:customer_specific_field_6,
|
24
|
+
:internal_note
|
25
|
+
|
26
|
+
def initialize(attributes = {})
|
27
|
+
if attributes.is_a? Hash
|
28
|
+
attributes.merge! :record_type => '17'
|
29
|
+
attributes.each do |key, value|
|
30
|
+
self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_cip(with_line_terminator = true)
|
36
|
+
cip_default_data << fill_up(
|
37
|
+
{
|
38
|
+
:action_date => 10,
|
39
|
+
:action => 10,
|
40
|
+
:mkz => 10,
|
41
|
+
:amount => 15,
|
42
|
+
:currency => 10,
|
43
|
+
:exchange_rate => 15,
|
44
|
+
:value_date => 10,
|
45
|
+
:comment_1 => 32,
|
46
|
+
:comment_2 => 32,
|
47
|
+
:op_no => 32,
|
48
|
+
:op_membership => 32,
|
49
|
+
:cip_dossier_no => 25,
|
50
|
+
:external_dossier_no => 32,
|
51
|
+
:cip_identification => 7,
|
52
|
+
:debt_claim_group => 32,
|
53
|
+
:customer_specific_field_1 => 10,
|
54
|
+
:customer_specific_field_2 => 10,
|
55
|
+
:customer_specific_field_3 => 10,
|
56
|
+
:customer_specific_field_4 => 32,
|
57
|
+
:customer_specific_field_5 => 32,
|
58
|
+
:customer_specific_field_6 => 42,
|
59
|
+
:internal_note => 1500
|
60
|
+
}, with_line_terminator
|
61
|
+
)
|
62
|
+
end
|
63
|
+
end
|
64
64
|
end
|
data/lib/ci_power/address.rb
CHANGED
@@ -1,97 +1,97 @@
|
|
1
|
-
module CiPower
|
2
|
-
class Address < Record
|
3
|
-
attr_accessor :new_order_id,
|
4
|
-
:address_type_company,
|
5
|
-
:title,
|
6
|
-
:salutation,
|
7
|
-
:lastname,
|
8
|
-
:firstname,
|
9
|
-
:name_affix,
|
10
|
-
:address,
|
11
|
-
:po_box,
|
12
|
-
:postal_code,
|
13
|
-
:city,
|
14
|
-
:country,
|
15
|
-
:contact_salutation,
|
16
|
-
:contact_lastname,
|
17
|
-
:contact_firstname,
|
18
|
-
:language,
|
19
|
-
:method_of_payment,
|
20
|
-
:account_no,
|
21
|
-
:commercial_register_no,
|
22
|
-
:vat_no,
|
23
|
-
:industry,
|
24
|
-
:region,
|
25
|
-
:reserve_field,
|
26
|
-
:customer_specific_field_1,
|
27
|
-
:customer_specific_field_2,
|
28
|
-
:customer_specific_field_3,
|
29
|
-
:customer_specific_field_4,
|
30
|
-
:customer_specific_field_5,
|
31
|
-
:customer_specific_field_6,
|
32
|
-
:customer_specific_field_7,
|
33
|
-
:customer_specific_field_8,
|
34
|
-
:customer_specific_field_9,
|
35
|
-
:customer_specific_field_10,
|
36
|
-
:customer_specific_field_11,
|
37
|
-
:customer_specific_field_12,
|
38
|
-
:customer_specific_field_13,
|
39
|
-
:customer_specific_field_14,
|
40
|
-
:customer_specific_field_15,
|
41
|
-
:customer_specific_field_16
|
42
|
-
|
43
|
-
def initialize(attributes = {})
|
44
|
-
if attributes.is_a? Hash
|
45
|
-
attributes.merge! :record_type => '01'
|
46
|
-
attributes.each do |key, value|
|
47
|
-
self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
|
52
|
-
def to_cip(with_line_terminator = true)
|
53
|
-
cip_default_data << fill_up(
|
54
|
-
{
|
55
|
-
:address_type_company => 1,
|
56
|
-
:title => 32,
|
57
|
-
:salutation => 10,
|
58
|
-
:lastname => 32,
|
59
|
-
:firstname => 32,
|
60
|
-
:name_affix => 32,
|
61
|
-
:address => 32,
|
62
|
-
:po_box => 32,
|
63
|
-
:postal_code => 10,
|
64
|
-
:city => 32,
|
65
|
-
:country => 10,
|
66
|
-
:contact_salutation => 10,
|
67
|
-
:contact_lastname => 32,
|
68
|
-
:contact_firstname => 32,
|
69
|
-
:language => 10,
|
70
|
-
:method_of_payment => 10,
|
71
|
-
:account_no => 32,
|
72
|
-
:commercial_register_no => 15,
|
73
|
-
:vat_no => 15,
|
74
|
-
:industry => 10,
|
75
|
-
:region => 10,
|
76
|
-
:reserve_field => 10,
|
77
|
-
:customer_specific_field_1 => 10,
|
78
|
-
:customer_specific_field_2 => 10,
|
79
|
-
:customer_specific_field_3 => 10,
|
80
|
-
:customer_specific_field_4 => 32,
|
81
|
-
:customer_specific_field_5 => 32,
|
82
|
-
:customer_specific_field_6 => 64,
|
83
|
-
:customer_specific_field_7 => 64,
|
84
|
-
:customer_specific_field_8 => 64,
|
85
|
-
:customer_specific_field_9 => 64,
|
86
|
-
:customer_specific_field_10 => 64,
|
87
|
-
:customer_specific_field_11 => 64,
|
88
|
-
:customer_specific_field_12 => 64,
|
89
|
-
:customer_specific_field_13 => 64,
|
90
|
-
:customer_specific_field_14 => 64,
|
91
|
-
:customer_specific_field_15 => 64,
|
92
|
-
:customer_specific_field_16 => 64
|
93
|
-
}, with_line_terminator
|
94
|
-
)
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
1
|
+
module CiPower
|
2
|
+
class Address < Record
|
3
|
+
attr_accessor :new_order_id,
|
4
|
+
:address_type_company,
|
5
|
+
:title,
|
6
|
+
:salutation,
|
7
|
+
:lastname,
|
8
|
+
:firstname,
|
9
|
+
:name_affix,
|
10
|
+
:address,
|
11
|
+
:po_box,
|
12
|
+
:postal_code,
|
13
|
+
:city,
|
14
|
+
:country,
|
15
|
+
:contact_salutation,
|
16
|
+
:contact_lastname,
|
17
|
+
:contact_firstname,
|
18
|
+
:language,
|
19
|
+
:method_of_payment,
|
20
|
+
:account_no,
|
21
|
+
:commercial_register_no,
|
22
|
+
:vat_no,
|
23
|
+
:industry,
|
24
|
+
:region,
|
25
|
+
:reserve_field,
|
26
|
+
:customer_specific_field_1,
|
27
|
+
:customer_specific_field_2,
|
28
|
+
:customer_specific_field_3,
|
29
|
+
:customer_specific_field_4,
|
30
|
+
:customer_specific_field_5,
|
31
|
+
:customer_specific_field_6,
|
32
|
+
:customer_specific_field_7,
|
33
|
+
:customer_specific_field_8,
|
34
|
+
:customer_specific_field_9,
|
35
|
+
:customer_specific_field_10,
|
36
|
+
:customer_specific_field_11,
|
37
|
+
:customer_specific_field_12,
|
38
|
+
:customer_specific_field_13,
|
39
|
+
:customer_specific_field_14,
|
40
|
+
:customer_specific_field_15,
|
41
|
+
:customer_specific_field_16
|
42
|
+
|
43
|
+
def initialize(attributes = {})
|
44
|
+
if attributes.is_a? Hash
|
45
|
+
attributes.merge! :record_type => '01'
|
46
|
+
attributes.each do |key, value|
|
47
|
+
self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
def to_cip(with_line_terminator = true)
|
53
|
+
cip_default_data << fill_up(
|
54
|
+
{
|
55
|
+
:address_type_company => 1,
|
56
|
+
:title => 32,
|
57
|
+
:salutation => 10,
|
58
|
+
:lastname => 32,
|
59
|
+
:firstname => 32,
|
60
|
+
:name_affix => 32,
|
61
|
+
:address => 32,
|
62
|
+
:po_box => 32,
|
63
|
+
:postal_code => 10,
|
64
|
+
:city => 32,
|
65
|
+
:country => 10,
|
66
|
+
:contact_salutation => 10,
|
67
|
+
:contact_lastname => 32,
|
68
|
+
:contact_firstname => 32,
|
69
|
+
:language => 10,
|
70
|
+
:method_of_payment => 10,
|
71
|
+
:account_no => 32,
|
72
|
+
:commercial_register_no => 15,
|
73
|
+
:vat_no => 15,
|
74
|
+
:industry => 10,
|
75
|
+
:region => 10,
|
76
|
+
:reserve_field => 10,
|
77
|
+
:customer_specific_field_1 => 10,
|
78
|
+
:customer_specific_field_2 => 10,
|
79
|
+
:customer_specific_field_3 => 10,
|
80
|
+
:customer_specific_field_4 => 32,
|
81
|
+
:customer_specific_field_5 => 32,
|
82
|
+
:customer_specific_field_6 => 64,
|
83
|
+
:customer_specific_field_7 => 64,
|
84
|
+
:customer_specific_field_8 => 64,
|
85
|
+
:customer_specific_field_9 => 64,
|
86
|
+
:customer_specific_field_10 => 64,
|
87
|
+
:customer_specific_field_11 => 64,
|
88
|
+
:customer_specific_field_12 => 64,
|
89
|
+
:customer_specific_field_13 => 64,
|
90
|
+
:customer_specific_field_14 => 64,
|
91
|
+
:customer_specific_field_15 => 64,
|
92
|
+
:customer_specific_field_16 => 64
|
93
|
+
}, with_line_terminator
|
94
|
+
)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
module CiPower
|
2
|
-
class Communication < Record
|
3
|
-
attr_accessor :type,
|
4
|
-
:text
|
5
|
-
|
6
|
-
def initialize(attributes = {})
|
7
|
-
if attributes.is_a? Hash
|
8
|
-
attributes.merge! :record_type => '02'
|
9
|
-
attributes.each do |key, value|
|
10
|
-
self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
def to_cip(with_line_terminator = true)
|
16
|
-
cip_default_data << fill_up({:type => 10, :text => 32}, with_line_terminator)
|
17
|
-
end
|
18
|
-
end
|
1
|
+
module CiPower
|
2
|
+
class Communication < Record
|
3
|
+
attr_accessor :type,
|
4
|
+
:text
|
5
|
+
|
6
|
+
def initialize(attributes = {})
|
7
|
+
if attributes.is_a? Hash
|
8
|
+
attributes.merge! :record_type => '02'
|
9
|
+
attributes.each do |key, value|
|
10
|
+
self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def to_cip(with_line_terminator = true)
|
16
|
+
cip_default_data << fill_up({:type => 10, :text => 32}, with_line_terminator)
|
17
|
+
end
|
18
|
+
end
|
19
19
|
end
|
data/lib/ci_power/debt_claim.rb
CHANGED
@@ -1,74 +1,74 @@
|
|
1
|
-
module CiPower
|
2
|
-
class DebtClaim < Record
|
3
|
-
attr_accessor :op_no,
|
4
|
-
:amount_type,
|
5
|
-
:value_date,
|
6
|
-
:amount,
|
7
|
-
:invoice_date,
|
8
|
-
:invoice_text,
|
9
|
-
:dossier_currency,
|
10
|
-
:exchange_rate,
|
11
|
-
:customer_specific_field_1,
|
12
|
-
:customer_specific_field_2,
|
13
|
-
:customer_specific_field_3,
|
14
|
-
:customer_specific_field_4,
|
15
|
-
:customer_specific_field_5,
|
16
|
-
:customer_specific_field_6,
|
17
|
-
:customer_specific_field_7,
|
18
|
-
:customer_specific_field_8,
|
19
|
-
:customer_specific_field_9,
|
20
|
-
:customer_specific_field_10,
|
21
|
-
:customer_specific_field_11,
|
22
|
-
:customer_specific_field_12,
|
23
|
-
:customer_specific_field_13,
|
24
|
-
:customer_specific_field_14,
|
25
|
-
:customer_specific_field_15
|
26
|
-
|
27
|
-
def initialize(attributes = {})
|
28
|
-
if attributes.is_a? Hash
|
29
|
-
attributes.merge! :record_type => '11'
|
30
|
-
attributes.each do |key, value|
|
31
|
-
self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def amount
|
37
|
-
@amount.abs
|
38
|
-
end
|
39
|
-
|
40
|
-
def amount_type
|
41
|
-
@amount_type ||= @amount < 0 ? 'GU-GL' : 'RG-GL'
|
42
|
-
end
|
43
|
-
|
44
|
-
def to_cip(with_line_terminator = true)
|
45
|
-
cip_default_data << fill_up(
|
46
|
-
{
|
47
|
-
:op_no => 25,
|
48
|
-
:amount_type => 10,
|
49
|
-
:value_date => 10,
|
50
|
-
:amount => 15,
|
51
|
-
:invoice_date => 10,
|
52
|
-
:invoice_text => 32,
|
53
|
-
:customer_specific_field_1 => 32,
|
54
|
-
:customer_specific_field_2 => 32,
|
55
|
-
:dossier_currency => 10,
|
56
|
-
:exchange_rate => 15,
|
57
|
-
:customer_specific_field_3 => 32,
|
58
|
-
:customer_specific_field_4 => 32,
|
59
|
-
:customer_specific_field_5 => 32,
|
60
|
-
:customer_specific_field_6 => 32,
|
61
|
-
:customer_specific_field_7 => 32,
|
62
|
-
:customer_specific_field_8 => 32,
|
63
|
-
:customer_specific_field_9 => 32,
|
64
|
-
:customer_specific_field_10 => 32,
|
65
|
-
:customer_specific_field_11 => 32,
|
66
|
-
:customer_specific_field_12 => 32,
|
67
|
-
:customer_specific_field_13 => 32,
|
68
|
-
:customer_specific_field_14 => 32,
|
69
|
-
:customer_specific_field_15 => 32
|
70
|
-
}, with_line_terminator
|
71
|
-
)
|
72
|
-
end
|
73
|
-
end
|
1
|
+
module CiPower
|
2
|
+
class DebtClaim < Record
|
3
|
+
attr_accessor :op_no,
|
4
|
+
:amount_type,
|
5
|
+
:value_date,
|
6
|
+
:amount,
|
7
|
+
:invoice_date,
|
8
|
+
:invoice_text,
|
9
|
+
:dossier_currency,
|
10
|
+
:exchange_rate,
|
11
|
+
:customer_specific_field_1,
|
12
|
+
:customer_specific_field_2,
|
13
|
+
:customer_specific_field_3,
|
14
|
+
:customer_specific_field_4,
|
15
|
+
:customer_specific_field_5,
|
16
|
+
:customer_specific_field_6,
|
17
|
+
:customer_specific_field_7,
|
18
|
+
:customer_specific_field_8,
|
19
|
+
:customer_specific_field_9,
|
20
|
+
:customer_specific_field_10,
|
21
|
+
:customer_specific_field_11,
|
22
|
+
:customer_specific_field_12,
|
23
|
+
:customer_specific_field_13,
|
24
|
+
:customer_specific_field_14,
|
25
|
+
:customer_specific_field_15
|
26
|
+
|
27
|
+
def initialize(attributes = {})
|
28
|
+
if attributes.is_a? Hash
|
29
|
+
attributes.merge! :record_type => '11'
|
30
|
+
attributes.each do |key, value|
|
31
|
+
self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def amount
|
37
|
+
@amount.abs
|
38
|
+
end
|
39
|
+
|
40
|
+
def amount_type
|
41
|
+
@amount_type ||= @amount < 0 ? 'GU-GL' : 'RG-GL'
|
42
|
+
end
|
43
|
+
|
44
|
+
def to_cip(with_line_terminator = true)
|
45
|
+
cip_default_data << fill_up(
|
46
|
+
{
|
47
|
+
:op_no => 25,
|
48
|
+
:amount_type => 10,
|
49
|
+
:value_date => 10,
|
50
|
+
:amount => 15,
|
51
|
+
:invoice_date => 10,
|
52
|
+
:invoice_text => 32,
|
53
|
+
:customer_specific_field_1 => 32,
|
54
|
+
:customer_specific_field_2 => 32,
|
55
|
+
:dossier_currency => 10,
|
56
|
+
:exchange_rate => 15,
|
57
|
+
:customer_specific_field_3 => 32,
|
58
|
+
:customer_specific_field_4 => 32,
|
59
|
+
:customer_specific_field_5 => 32,
|
60
|
+
:customer_specific_field_6 => 32,
|
61
|
+
:customer_specific_field_7 => 32,
|
62
|
+
:customer_specific_field_8 => 32,
|
63
|
+
:customer_specific_field_9 => 32,
|
64
|
+
:customer_specific_field_10 => 32,
|
65
|
+
:customer_specific_field_11 => 32,
|
66
|
+
:customer_specific_field_12 => 32,
|
67
|
+
:customer_specific_field_13 => 32,
|
68
|
+
:customer_specific_field_14 => 32,
|
69
|
+
:customer_specific_field_15 => 32
|
70
|
+
}, with_line_terminator
|
71
|
+
)
|
72
|
+
end
|
73
|
+
end
|
74
74
|
end
|
data/lib/ci_power/debtor_data.rb
CHANGED
@@ -1,66 +1,66 @@
|
|
1
|
-
module CiPower
|
2
|
-
class DebtorData < Record
|
3
|
-
attr_accessor :birthyear,
|
4
|
-
:birthdate,
|
5
|
-
:birthplace,
|
6
|
-
:civil_status,
|
7
|
-
:occupation,
|
8
|
-
:commercial_register_entry,
|
9
|
-
:address_identification_debtor_representation,
|
10
|
-
:debtor_representation_by_law,
|
11
|
-
:nationality,
|
12
|
-
:notes,
|
13
|
-
:debtor_attribute_1,
|
14
|
-
:debtor_attribute_2,
|
15
|
-
:debtor_attribute_3,
|
16
|
-
:customer_specific_field_1,
|
17
|
-
:customer_specific_field_2,
|
18
|
-
:customer_specific_field_3,
|
19
|
-
:customer_specific_field_4,
|
20
|
-
:customer_specific_field_5,
|
21
|
-
:customer_specific_field_6,
|
22
|
-
:customer_specific_field_7,
|
23
|
-
:customer_specific_field_8,
|
24
|
-
:customer_specific_field_9,
|
25
|
-
:customer_specific_field_10
|
26
|
-
|
27
|
-
def initialize(attributes = {})
|
28
|
-
if attributes.is_a? Hash
|
29
|
-
attributes.merge! :record_type => '05'
|
30
|
-
attributes.each do |key, value|
|
31
|
-
self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def to_cip(with_line_terminator = true)
|
37
|
-
cip_default_data << fill_up(
|
38
|
-
{
|
39
|
-
:birthdate => 10,
|
40
|
-
:birthyear => 4,
|
41
|
-
:birthplace => 32,
|
42
|
-
:civil_status => 10,
|
43
|
-
:occupation => 32,
|
44
|
-
:commercial_register_entry => 1,
|
45
|
-
:address_identification_debtor_representation => 25,
|
46
|
-
:debtor_representation_by_law => 1,
|
47
|
-
:nationality => 10,
|
48
|
-
:notes => 240,
|
49
|
-
:debtor_attribute_1 => 32,
|
50
|
-
:debtor_attribute_2 => 32,
|
51
|
-
:debtor_attribute_3 => 32,
|
52
|
-
:customer_specific_field_1 => 32,
|
53
|
-
:customer_specific_field_2 => 32,
|
54
|
-
:customer_specific_field_3 => 32,
|
55
|
-
:customer_specific_field_4 => 32,
|
56
|
-
:customer_specific_field_5 => 32,
|
57
|
-
:customer_specific_field_6 => 32,
|
58
|
-
:customer_specific_field_7 => 32,
|
59
|
-
:customer_specific_field_8 => 32,
|
60
|
-
:customer_specific_field_9 => 32,
|
61
|
-
:customer_specific_field_10 => 32
|
62
|
-
}, with_line_terminator
|
63
|
-
)
|
64
|
-
end
|
65
|
-
end
|
1
|
+
module CiPower
|
2
|
+
class DebtorData < Record
|
3
|
+
attr_accessor :birthyear,
|
4
|
+
:birthdate,
|
5
|
+
:birthplace,
|
6
|
+
:civil_status,
|
7
|
+
:occupation,
|
8
|
+
:commercial_register_entry,
|
9
|
+
:address_identification_debtor_representation,
|
10
|
+
:debtor_representation_by_law,
|
11
|
+
:nationality,
|
12
|
+
:notes,
|
13
|
+
:debtor_attribute_1,
|
14
|
+
:debtor_attribute_2,
|
15
|
+
:debtor_attribute_3,
|
16
|
+
:customer_specific_field_1,
|
17
|
+
:customer_specific_field_2,
|
18
|
+
:customer_specific_field_3,
|
19
|
+
:customer_specific_field_4,
|
20
|
+
:customer_specific_field_5,
|
21
|
+
:customer_specific_field_6,
|
22
|
+
:customer_specific_field_7,
|
23
|
+
:customer_specific_field_8,
|
24
|
+
:customer_specific_field_9,
|
25
|
+
:customer_specific_field_10
|
26
|
+
|
27
|
+
def initialize(attributes = {})
|
28
|
+
if attributes.is_a? Hash
|
29
|
+
attributes.merge! :record_type => '05'
|
30
|
+
attributes.each do |key, value|
|
31
|
+
self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_cip(with_line_terminator = true)
|
37
|
+
cip_default_data << fill_up(
|
38
|
+
{
|
39
|
+
:birthdate => 10,
|
40
|
+
:birthyear => 4,
|
41
|
+
:birthplace => 32,
|
42
|
+
:civil_status => 10,
|
43
|
+
:occupation => 32,
|
44
|
+
:commercial_register_entry => 1,
|
45
|
+
:address_identification_debtor_representation => 25,
|
46
|
+
:debtor_representation_by_law => 1,
|
47
|
+
:nationality => 10,
|
48
|
+
:notes => 240,
|
49
|
+
:debtor_attribute_1 => 32,
|
50
|
+
:debtor_attribute_2 => 32,
|
51
|
+
:debtor_attribute_3 => 32,
|
52
|
+
:customer_specific_field_1 => 32,
|
53
|
+
:customer_specific_field_2 => 32,
|
54
|
+
:customer_specific_field_3 => 32,
|
55
|
+
:customer_specific_field_4 => 32,
|
56
|
+
:customer_specific_field_5 => 32,
|
57
|
+
:customer_specific_field_6 => 32,
|
58
|
+
:customer_specific_field_7 => 32,
|
59
|
+
:customer_specific_field_8 => 32,
|
60
|
+
:customer_specific_field_9 => 32,
|
61
|
+
:customer_specific_field_10 => 32
|
62
|
+
}, with_line_terminator
|
63
|
+
)
|
64
|
+
end
|
65
|
+
end
|
66
66
|
end
|