ci_power 0.0.23 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -122,6 +122,21 @@ module CiPower
122
122
  records
123
123
  end
124
124
 
125
+ ##
126
+ # Adds a single record or an array of records as a new line to the file and increments the group number
127
+ def export_to_file(file, records)
128
+ if records.is_a?(Array)
129
+ records.each do |record|
130
+ raise "Export class must be sub class of CiPower::Record" unless record.kind_of? CiPower::Record
131
+ file.puts record.to_cip
132
+ end
133
+ else
134
+ raise "Export class must be sub class of CiPower::Record" unless records.kind_of? CiPower::Record
135
+ file.puts records.to_cip
136
+ end
137
+ increment_group_no
138
+ end
139
+
125
140
  ##
126
141
  # Converts a date or time into a string with the defined date_format
127
142
  def convert_date(date)
@@ -146,5 +161,6 @@ module CiPower
146
161
  def increment_group_no
147
162
  @group_no = group_no + 1
148
163
  end
164
+
149
165
  end
150
166
  end
@@ -0,0 +1,109 @@
1
+ module CiPower
2
+ class ProcessData < Record
3
+ attr_accessor :enforcement_date,
4
+ :enforcement_demand_action,
5
+ :delivery_date,
6
+ :continue_date,
7
+ :enforcement_no,
8
+ :enforcement_on,
9
+ :enforcement_bureau,
10
+ :comment,
11
+ :processes_to_date,
12
+ :execution_date,
13
+ :reclamation_from_date,
14
+ :reclamation_to_date,
15
+ :is_income_variable,
16
+ :is_third_party_claim,
17
+ :is_real_estate,
18
+ :execution_amount,
19
+ :income,
20
+ :quote,
21
+ :living_wage,
22
+ :execution_type,
23
+ :enforcement_group,
24
+ :third_party_claim,
25
+ :real_estate,
26
+ :reclamation_objects,
27
+ :unpaid_debts_certificate_date,
28
+ :is_continuable_after_6months,
29
+ :unpaid_debts_amount,
30
+ :gain,
31
+ :loss,
32
+ :unpaid_debts_type,
33
+ :gain_dropdown,
34
+ :unpaid_debts_certificate_no,
35
+ :claim_petition_date,
36
+ :opening_of_bankruptcy_date,
37
+ :opening_of_bankruptcy_process,
38
+ :opening_of_bankruptcy_process_no,
39
+ :directive_date,
40
+ :decision_date,
41
+ :judicial_vitiation_date,
42
+ :legal_effect_date,
43
+ :case_no_directive,
44
+ :case_no_decision,
45
+ :cip_dossier_no,
46
+ :unpaid_debts_certificate_transfer_application_date
47
+
48
+ def initialize(attributes = {})
49
+ if attributes.is_a? Hash
50
+ attributes.merge! :record_type => '19'
51
+ attributes.each do |key, value|
52
+ self.send("#{key}=".to_sym, value) if self.respond_to?("#{key}=")
53
+ end
54
+ end
55
+ end
56
+
57
+ def to_cip(with_line_terminator = true)
58
+ cip_default_data << fill_up(
59
+ {
60
+ :enforcement_date => 10,
61
+ :enforcement_demand_action => 10,
62
+ :delivery_date => 10,
63
+ :continue_date => 10,
64
+ :enforcement_no => 32,
65
+ :enforcement_on => 32,
66
+ :enforcement_bureau => 120,
67
+ :comment => 120,
68
+ :processes_to_date => 10,
69
+ :execution_date => 10,
70
+ :reclamation_from_date => 10,
71
+ :reclamation_to_date => 10,
72
+ :is_income_variable => 1,
73
+ :is_third_party_claim => 1,
74
+ :is_real_estate => 1,
75
+ :execution_amount => 15,
76
+ :income => 15,
77
+ :quote => 15,
78
+ :living_wage => 15,
79
+ :execution_type => 32,
80
+ :enforcement_group => 32,
81
+ :third_party_claim => 64,
82
+ :real_estate => 64,
83
+ :reclamation_objects => 240,
84
+ :unpaid_debts_certificate_date => 10,
85
+ :is_continuable_after_6months => 1,
86
+ :unpaid_debts_amount => 15,
87
+ :gain => 15,
88
+ :loss => 15,
89
+ :unpaid_debts_type => 32,
90
+ :gain_dropdown => 32,
91
+ :unpaid_debts_certificate_no => 32,
92
+ :claim_petition_date => 10,
93
+ :opening_of_bankruptcy_date => 10,
94
+ :opening_of_bankruptcy_process => 32,
95
+ :opening_of_bankruptcy_process_no => 32,
96
+ :directive_date => 10,
97
+ :decision_date => 10,
98
+ :judicial_vitiation_date => 10,
99
+ :legal_effect_date => 10,
100
+ :case_no_directive => 32,
101
+ :case_no_decision => 32,
102
+ :cip_dossier_no => 9,
103
+ :unpaid_debts_certificate_transfer_application_date => 10
104
+ }, with_line_terminator
105
+ )
106
+ end
107
+
108
+ end
109
+ end
@@ -1,3 +1,3 @@
1
1
  module CiPower
2
- VERSION = "0.0.23"
2
+ VERSION = "0.0.24"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: ci_power
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.23
5
+ version: 0.0.24
6
6
  platform: ruby
7
7
  authors:
8
8
  - Maik Duff
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-08-30 00:00:00 +02:00
13
+ date: 2012-09-13 00:00:00 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
@@ -66,6 +66,7 @@ files:
66
66
  - lib/ci_power/export.rb
67
67
  - lib/ci_power/installment_plan.rb
68
68
  - lib/ci_power/open_appointment.rb
69
+ - lib/ci_power/process_data.rb
69
70
  - lib/ci_power/record.rb
70
71
  - lib/ci_power/version.rb
71
72
  - lib/generators/ci_power/ci_power_generator.rb