appraisermetrics_report_service 0.0.4 → 0.0.5

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8eaea4b3783b9d12df2a7b0035cd65095f026af6
4
- data.tar.gz: b02ebed32be3b8aab7ebe198d095804554a76a96
3
+ metadata.gz: 76209e93e69b409b9e9c24ceca2dac133599adfd
4
+ data.tar.gz: 6183ca92a72da04e99b70000f7591fb37160407d
5
5
  SHA512:
6
- metadata.gz: b7d20fac048b0393d089904eb65e3f5a828d3084e0051de6f5cd6187ab3aed0df878b0bba27d8bd5f4256ada62bc2f37fe543cb401c36a3a0b795c6f71a63e71
7
- data.tar.gz: 4f1702adde2eef2f9eb7f632bd8bd82f550491fe907c5efc2d9cd8e437b6e2b8a29960908acf5a71737b6680ec0a6c1b20ee9088c3d1b3a106992e1f0b87be8d
6
+ metadata.gz: 58082fe0e600d82681f7db4f2614f9ba4fb4f5f0833fa383607b61fb467150996a6f1eaa390324d194569198d28799f77d291651af7dbc67294f99bf1562531b
7
+ data.tar.gz: ece0f82c35142dad2dc552e91e322cd03c957baafbac720aaa1a61a7f4cbdbd2d7702083262595e2c75a189e5304d239c729d601f9adf29972c19bb2aab3fb81
@@ -1,3 +1,3 @@
1
1
  module AppraisermetricsReportService
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/closed_sale.rb CHANGED
@@ -18,37 +18,133 @@ class ClosedSale < Prawn::Document
18
18
  ## page 1 ##
19
19
 
20
20
  # render office logo image if present
21
+ stroke_bounds
21
22
  render_logo
22
23
 
23
- # rendering bounding boxes and tables
24
- meta_data
25
- property_class
26
- profile_image
27
- property_type_and_address
28
- transaction_summary
29
- land_classification
30
- physical_overview
31
- cash_flow
32
- income_expense
24
+ # rendering tables
25
+ float do
26
+ meta_data
27
+ end
28
+
29
+ indent(270) do
30
+ property_class
31
+ end
32
+
33
+ move_down 45
34
+ stroke_horizontal_rule
35
+ move_down 5
36
+ float do
37
+ profile_image
38
+ end
39
+
40
+ indent(270) do
41
+ property_type_and_address
42
+ transaction_summary
43
+ end
44
+
45
+ move_down 45
46
+ stroke_horizontal_rule
47
+ move_down 5
48
+ float do
49
+ land_classification
50
+ end
51
+
52
+ indent(270) do
53
+ physical_overview
54
+ end
55
+
56
+ move_down 45
57
+ stroke_horizontal_rule
58
+ move_down 5
59
+ float do
60
+ cash_flow
61
+ end
62
+
63
+ indent(270) do
64
+ income_expense
65
+ end
66
+ cursor_pos = cursor
67
+ stroke_line [270, 720], [270, cursor_pos]
33
68
 
34
69
  start_new_page
35
70
 
36
71
  ## page 2 ##
37
- comments
38
- legal_transaction
72
+ stroke_horizontal_rule
73
+ stroke_bounds
74
+ move_down 5
75
+ float do
76
+ comments
77
+ end
78
+
79
+ indent(270) do
80
+ legal_transaction
81
+ end
82
+ move_down 45
83
+ stroke_horizontal_rule
84
+ move_down 5
39
85
  # move to full width table
40
- transaction_history
41
- utilities
42
- improvements
43
- water_rights
86
+ if @rep[:transactions] && @rep[:transactions].any?
87
+ transaction_history
88
+ move_down 45
89
+ stroke_horizontal_rule
90
+ move_down 5
91
+ end
44
92
 
45
- start_new_page
46
- ## page 3 ##
47
- water_distribution
48
- crop_yield
49
- estimated_productivity
50
- perm_plantings
93
+ if @rep[:utilities] && @rep[:utilities].any?
94
+ utilities
95
+ move_down 45
96
+ stroke_horizontal_rule
97
+ move_down 5
98
+ end
99
+
100
+ if @rep[:improvements] && @rep[:improvements].any?
101
+ improvements
102
+ move_down 45
103
+ stroke_horizontal_rule
104
+ move_down 5
105
+ end
106
+
107
+ if @rep[:waterrights] && @rep[:waterrights].any?
108
+ water_rights
109
+ move_down 45
110
+ stroke_horizontal_rule
111
+ move_down 5
112
+ end
113
+
114
+ if @rep[:waterdistributions] && @rep[:waterdistributions].any?
115
+ water_distribution
116
+ move_down 45
117
+ stroke_horizontal_rule
118
+ move_down 5
119
+ end
120
+
121
+ if @rep[:crops] && @rep[:crops].any?
122
+ crop_yield
123
+ move_down 45
124
+ stroke_horizontal_rule
125
+ move_down 5
126
+ end
127
+
128
+ if @rep[:estimatedproductivity] && @rep[:estimatedproductivity].any?
129
+ estimated_productivity
130
+ move_down 45
131
+ stroke_horizontal_rule
132
+ move_down 5
133
+ end
134
+
135
+ # stroke bounds again for third page
136
+
137
+
138
+ if @rep[:plantings] && @rep[:plantings].any?
139
+ perm_plantings
140
+ move_down 45
141
+ stroke_horizontal_rule
142
+ move_down 5
143
+ end
144
+
145
+ stroke_bounds
51
146
  externalities
147
+
52
148
  ## page 4 ##
53
149
  additional_images
54
150
 
@@ -63,603 +159,531 @@ class ClosedSale < Prawn::Document
63
159
 
64
160
 
65
161
  def meta_data
66
- bounding_box([0, 690], width: 270, height: 55) do
67
- meta_data = [
68
- ["Record Number:", "#{@rep[:sequence]}"],
69
- ["Record Created By:", "#{@rep[:record_created_by]}"],
70
- ["Date Created or Last Modified:", datemaker(@rep[:record_edited])]
71
- ]
72
-
73
- table(meta_data) do # record meta data table with image
74
- columns(0..1).width = 135
75
- columns([0]).style(font_style: :bold)
76
- cells.style(border_width: 0)
77
- cells.padding = [1, 2.5]
78
- end
79
- stroke_bounds
162
+ meta_data = [
163
+ ["Record Number:", "#{@rep[:sequence]}"],
164
+ ["Record Created By:", "#{@rep[:record_created_by]}"],
165
+ ["Date Created or Last Modified:", datemaker(@rep[:record_edited])]
166
+ ]
167
+
168
+ table(meta_data) do # record meta data table with image
169
+ columns(0..1).width = 135
170
+ columns([0]).style(font_style: :bold)
171
+ cells.style(border_width: 0)
172
+ cells.padding = [1, 2.5]
80
173
  end
81
174
  end
82
175
 
83
176
  def profile_image
84
- bounding_box([0, 635], width: 270, height: 275) do
85
- if @property_images && @property_images.any?
86
- image "#{@property_images.first}", width: 265
87
- else
88
- text "No Image"
89
- end
90
- stroke_bounds
177
+ if @property_images && @property_images.any?
178
+ image "#{@property_images.first}", width: 265
179
+ else
180
+ text "No Image"
91
181
  end
92
182
  end
93
183
 
94
184
  def land_classification
95
- bounding_box([0, 360], width: 270, height: 180) do
96
- classification_data = [
97
- [{content: "Land Classification Breakdown", colspan: 4}],
98
- ["Land Class:", "Acres:", "$/Acre:", "Total:"],
99
- ]
100
-
101
- land_classes = @rep[:landclassifications]
102
- if land_classes # node could be nil
103
-
104
- total_acres = 0 # value to add to in loop
105
- total_dollar = 0
106
-
107
- land_classes.each do |l|
108
- if l # array could be empty
109
- if l[:priceperacre] # priceperacre could be nil, avoid nomethod errors below by checking
110
- m = Money.new(l[:priceperacre][:cents], l[:priceperacre][:currency_iso])
111
- per_acre_string = m.format(no_cents: true)
112
- total_string = (m * l[:numacres]).format(no_cents: true)
113
-
114
- total_acres += no_nil_number(l[:numacres]) # add to total
115
- total_dollar += m.to_f * l[:numacres]
116
-
117
- classification_data.push(
118
- [
119
- "#{l[:landclass]}",
120
- '%.2f' % no_nil_number(l[:numacres]), # => adds .00 to acres
121
- per_acre_string,
122
- total_string
123
- ]
124
- )
125
- end
126
- end
127
- end # end block
128
-
129
- total_dollar_string = Money.new(total_dollar * 100, 'USD').format(no_cents: true)
130
- total_per_acre = Money.new((total_dollar / total_acres) * 100, 'USD')
131
- total_per_acre_string = total_per_acre.format(no_cents: true)
132
-
133
- # push totals into table
134
- classification_data.push(
135
- ["", "", "", ""], # line space
136
- ["Totals", '%.2f' % total_acres, total_per_acre_string, total_dollar_string]
137
- )
185
+ classification_data = [
186
+ [{content: "Land Classification Breakdown", colspan: 4}],
187
+ ["Land Class:", "Acres:", "$/Acre:", "Total:"],
188
+ ]
138
189
 
139
- if @rep[:imprv_unitprice]
140
- improv_alloc = Money.new(@rep[:imprv_unitprice][:cents], 'USD')
141
- else
142
- improv_alloc = Money.new(0, 'USD')
143
- end
144
-
145
- classification_data.push([
146
- "Total $ to Imprv", moneymaker(@rep[:total_imprv_budget], true),
147
- "Imprv $/AC Alloc", improv_alloc.format(no_cents: :true)],
148
- [{content: "Total Land and Improvement $/AC", colspan: 3}, (total_per_acre + improv_alloc).format(no_cents: :true)])
149
- end
190
+ land_classes = @rep[:landclassifications]
191
+ if land_classes # node could be nil
150
192
 
151
- table(classification_data) do # land classification breakdown table
152
- columns(0..1).width = 68
153
- columns(2..3).width = 67
154
- columns(1..3).style(align: :right)
155
- cells.style(border_width: 0)
156
- cells.padding = [1, 2.5]
157
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
158
- row(1).style(align: :right, font_style: :bold, border_bottom_width: 0.5)
159
- row(-3).style(border_bottom_width: 0.5, font_style: :bold)
160
- end
161
- stroke_bounds
162
- end
163
- end
193
+ total_acres = 0 # value to add to in loop
194
+ total_dollar = 0
164
195
 
165
- def cash_flow
166
- bounding_box([0, 180], width: 270, height: 180) do
167
- cash_flow_data = [
168
- [{content: "Cash Flow - Production Analysis", colspan: 4}],
169
- ["Income Source", "Stable $/Unit", "Stablilized Yield/Unit", "No. of Source, i.e. AC"]
170
- ]
196
+ land_classes.each do |l|
197
+ if l # array could be empty
198
+ if l[:priceperacre] # priceperacre could be nil, avoid nomethod errors below by checking
199
+ m = Money.new(l[:priceperacre][:cents], l[:priceperacre][:currency_iso])
200
+ per_acre_string = m.format(no_cents: true)
201
+ total_string = (m * l[:numacres]).format(no_cents: true)
171
202
 
172
- incomes = @rep[:incomes]
203
+ total_acres += no_nil_number(l[:numacres]) # add to total
204
+ total_dollar += m.to_f * l[:numacres]
173
205
 
174
- if incomes # node could be nil
175
- incomes.each do |i|
176
- if i # array could be nil
177
- cash_flow_data.push(
206
+ classification_data.push(
178
207
  [
179
- i[:incomesrc],
180
- moneymaker(i[:stabcashperunit], false),
181
- '%.2f' % no_nil_number(i[:stabilizedyield]),
182
- '%.2f' % no_nil_number(i[:totalunits])
208
+ "#{l[:landclass]}",
209
+ '%.2f' % no_nil_number(l[:numacres]), # => adds .00 to acres
210
+ per_acre_string,
211
+ total_string
183
212
  ]
184
213
  )
185
214
  end
186
215
  end
216
+ end # end block
217
+
218
+ total_dollar_string = Money.new(total_dollar * 100, 'USD').format(no_cents: true)
219
+ total_per_acre = Money.new((total_dollar / total_acres) * 100, 'USD')
220
+ total_per_acre_string = total_per_acre.format(no_cents: true)
221
+
222
+ # push totals into table
223
+ classification_data.push(
224
+ ["", "", "", ""], # line space
225
+ ["Totals", '%.2f' % total_acres, total_per_acre_string, total_dollar_string]
226
+ )
227
+
228
+ if @rep[:imprv_unitprice]
229
+ improv_alloc = Money.new(@rep[:imprv_unitprice][:cents], 'USD')
230
+ else
231
+ improv_alloc = Money.new(0, 'USD')
187
232
  end
188
233
 
189
- table(cash_flow_data) do
190
- columns(0..1).width = 68
191
- columns(2..3).width = 67
192
- columns(1..3).style(align: :right, font_style: :bold)
193
- column(0).style(align: :left, font_style: :bold)
194
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8)
195
- cells.style(border_width: 0)
196
- row(1).style(border_bottom_width: 0.5, align: :center, font_style: nil)
197
- cells.padding = [1, 2.5]
234
+ classification_data.push([
235
+ "Total $ to Imprv", moneymaker(@rep[:total_imprv_budget], true),
236
+ "Imprv $/AC Alloc", improv_alloc.format(no_cents: :true)],
237
+ [{content: "Total Land and Improvement $/AC", colspan: 3}, (total_per_acre + improv_alloc).format(no_cents: :true)])
238
+ end
239
+
240
+ table(classification_data) do # land classification breakdown table
241
+ columns(0..1).width = 68
242
+ columns(2..3).width = 67
243
+ columns(1..3).style(align: :right)
244
+ cells.style(border_width: 0)
245
+ cells.padding = [1, 2.5]
246
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
247
+ row(1).style(align: :right, font_style: :bold, border_bottom_width: 0.5)
248
+ row(-3).style(border_bottom_width: 0.5, font_style: :bold)
249
+ end
250
+ end
251
+
252
+ def cash_flow
253
+ cash_flow_data = [
254
+ [{content: "Cash Flow - Production Analysis", colspan: 4}],
255
+ ["Income Source", "Stable $/Unit", "Stablilized Yield/Unit", "No. of Source, i.e. AC"]
256
+ ]
257
+
258
+ incomes = @rep[:incomes]
259
+
260
+ if incomes # node could be nil
261
+ incomes.each do |i|
262
+ if i # array could be nil
263
+ cash_flow_data.push(
264
+ [
265
+ i[:incomesrc],
266
+ moneymaker(i[:stabcashperunit], false),
267
+ '%.2f' % no_nil_number(i[:stabilizedyield]),
268
+ '%.2f' % no_nil_number(i[:totalunits])
269
+ ]
270
+ )
271
+ end
198
272
  end
199
- stroke_bounds
273
+ end
274
+
275
+ table(cash_flow_data) do
276
+ columns(0..1).width = 68
277
+ columns(2..3).width = 67
278
+ columns(1..3).style(align: :right, font_style: :bold)
279
+ column(0).style(align: :left, font_style: :bold)
280
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, border_top_width: 0.5)
281
+ cells.style(border_width: 0)
282
+ row(1).style(border_bottom_width: 0.5, align: :center, font_style: nil)
283
+ cells.padding = [1, 2.5]
200
284
  end
201
285
  end
202
286
 
203
287
  def comments
204
- bounding_box([0, 690], width: 270, height: 125) do
205
- comments_data = [
206
- ["Comments"],
207
- ["#{@rep[:general_comments]}"]
208
- ]
209
-
210
- table(comments_data) do
211
- row(0).style align: :center
212
- column(0).width = 270
213
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
214
- cells.padding = [1, 2.5]
215
- cells.style(border_width: 0)
216
- end
217
- stroke_bounds
288
+ comments_data = [
289
+ ["Comments"],
290
+ ["#{@rep[:general_comments]}"]
291
+ ]
292
+
293
+ table(comments_data) do
294
+ row(0).style align: :center
295
+ column(0).width = 270
296
+ cells.padding = [1, 2.5]
297
+ cells.style(border_width: 0)
298
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
218
299
  end
219
300
  end
220
301
 
221
302
  def property_class
222
- bounding_box([270, 690], width: 270, height: 55) do
223
- property_data = [
224
- ["Property Classification:", "#{@rep[:land_use_zone]}"],
225
- ["Transaction Type:", "#{@rep[:type_of_transaction]}"],
226
- ["Property Name:", "#{@rep[:property_name]}"]
227
- ]
228
-
229
- table(property_data) do
230
- column(0).style(align: :right)
231
- column([1]).style(font_style: :bold)
232
- columns(0..1).width = 135
233
- cells.style(border_width: 0)
234
- cells.padding = [1, 2.5]
235
- end
236
- stroke_bounds
303
+ property_data = [
304
+ ["Property Classification:", "#{@rep[:land_use_zone]}"],
305
+ ["Transaction Type:", "#{@rep[:type_of_transaction]}"],
306
+ ["Property Name:", "#{@rep[:property_name]}"]
307
+ ]
308
+
309
+ table(property_data) do
310
+ column(0).style(align: :right)
311
+ column([1]).style(font_style: :bold)
312
+ columns(0..1).width = 135
313
+ cells.style(border_width: 0)
314
+ cells.padding = [1, 2.5]
237
315
  end
238
316
  end
239
317
 
240
318
  def property_type_and_address
241
- bounding_box([270, 635], height: 145, width: 270) do
242
- pos = @rep[:position] # lat and long
243
- if pos
244
- lat, long = pos[0], pos[1]
245
- else
246
- lat, long = " ", " "
247
- end
248
-
249
- property_inclusions = no_nil_array(@rep[:property_inclusions]).join(" ")
250
- type_and_address_data = [
251
- [{content: "Property Type and Address", colspan: 4}],
252
- ["Property Name:", "#{@rep[:property_name]}", "Primary Land Use:", "#{@rep[:primary_ag_use]}"],
253
- ["What does this property include?",
254
- {content: property_inclusions, colspan: 3}],
255
- ["Address:", {content: "#{@rep[:property_address_number]}" + " #{@rep[:street_or_road_name]}", colspan: 3}],
256
- ["City:", "#{@rep[:city]}", "County:", "#{@rep[:ordinance_authority]}"],
257
- ["State:", "#{@rep[:county_state]}".strip.split('').last(2).join(""), "Zip Code:", "#{@rep[:zip_code]}"],
258
- ["Township/Range:","#{@rep[:townshipINT]}" + "#{@rep[:rangeINT]}", "Section(s):", "#{@rep[:legal_description]}"],
259
- ["Latitude:", lat, "Longitude:", long],
260
- [{content: "Property Location and Directions:" + "#{@rep[:directions_or_ownership_comments]}", colspan: 4}]
261
- ]
319
+ pos = @rep[:position] # lat and long
320
+ if pos
321
+ lat, long = pos[0], pos[1]
322
+ else
323
+ lat, long = " ", " "
324
+ end
262
325
 
263
- table(type_and_address_data) do
264
- columns(0..1).width = 68
265
- columns(2..3).width = 67
266
- columns([0, 2]).style(align: :right)
267
- columns([1, 3]).style(font_style: :bold)
268
- cells.padding = [1, 2.5]
269
- cells.style(border_width: 0)
270
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
271
- end
272
- stroke_bounds
326
+ property_inclusions = no_nil_array(@rep[:property_inclusions]).join(" ")
327
+ type_and_address_data = [
328
+ [{content: "Property Type and Address", colspan: 4}],
329
+ ["Property Name:", "#{@rep[:property_name]}", "Primary Land Use:", "#{@rep[:primary_ag_use]}"],
330
+ ["What does this property include?",
331
+ {content: property_inclusions, colspan: 3}],
332
+ ["Address:", {content: "#{@rep[:property_address_number]}" + " #{@rep[:street_or_road_name]}", colspan: 3}],
333
+ ["City:", "#{@rep[:city]}", "County:", "#{@rep[:ordinance_authority]}"],
334
+ ["State:", "#{@rep[:county_state]}".strip.split('').last(2).join(""), "Zip Code:", "#{@rep[:zip_code]}"],
335
+ ["Township/Range:","#{@rep[:townshipINT]}" + "#{@rep[:rangeINT]}", "Section(s):", "#{@rep[:legal_description]}"],
336
+ ["Latitude:", lat, "Longitude:", long],
337
+ [{content: "Property Location and Directions:" + "#{@rep[:directions_or_ownership_comments]}", colspan: 4}]
338
+ ]
339
+
340
+ table(type_and_address_data) do
341
+ columns(0..1).width = 68
342
+ columns(2..3).width = 67
343
+ columns([0, 2]).style(align: :right)
344
+ columns([1, 3]).style(font_style: :bold)
345
+ cells.padding = [1, 2.5]
346
+ cells.style(border_width: 0)
347
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
273
348
  end
274
349
  end
275
350
 
276
351
  def transaction_summary
277
- bounding_box([270, 490], height: 130, width: 270) do
278
- price = moneymaker(@rep[:sale_price], true)
279
- adjustment = moneymaker(@rep[:sale_adjustment], true)
280
- ce_sale_price = moneymaker(@rep[:cesaleprice], true)
281
- transaction_data = [
282
- [{content: "Transaction Summary", colspan: 4}],
283
- ["Sale Price $:", price, "Sale Date:", datemaker(@rep[:sale_date])],
284
- ["Cond. Adjust $:", '(' + adjustment +')', "Adj. CE Sale $:", ce_sale_price],
285
- ["Unit Description:", "#{@rep[:unit]}", "No. of Units:", '%.2f' % no_nil_number(@rep[:num_of_units])],
286
- ["Instrument No.:", "#{@rep[:public_rec_ref_numer]}", "$/Unit:", moneymaker(@rep[:cesaleunitprice], true)],
287
- ["Seller:", "#{@rep[:grantor]}", "Buyer:", "#{@rep[:grantee]}"],
288
- ["Extent of Verification:", {content: no_nil_array(@rep[:verifications]).join(', '), colspan: 3}],
289
- [{content: "#{@rep[:grantor]}" + " #{@rep[:information_source_contact]}",
290
- colspan: 2}, "Date Inspected:", datemaker(@rep[:date_inspected])
291
- ]
352
+ price = moneymaker(@rep[:sale_price], true)
353
+ adjustment = moneymaker(@rep[:sale_adjustment], true)
354
+ ce_sale_price = moneymaker(@rep[:cesaleprice], true)
355
+ transaction_data = [
356
+ [{content: "Transaction Summary", colspan: 4}],
357
+ ["Sale Price $:", price, "Sale Date:", datemaker(@rep[:sale_date])],
358
+ ["Cond. Adjust $:", '(' + adjustment +')', "Adj. CE Sale $:", ce_sale_price],
359
+ ["Unit Description:", "#{@rep[:unit]}", "No. of Units:", '%.2f' % no_nil_number(@rep[:num_of_units])],
360
+ ["Instrument No.:", "#{@rep[:public_rec_ref_numer]}", "$/Unit:", moneymaker(@rep[:cesaleunitprice], true)],
361
+ ["Seller:", "#{@rep[:grantor]}", "Buyer:", "#{@rep[:grantee]}"],
362
+ ["Extent of Verification:", {content: no_nil_array(@rep[:verifications]).join(', '), colspan: 3}],
363
+ [{content: "#{@rep[:grantor]}" + " #{@rep[:information_source_contact]}",
364
+ colspan: 2}, "Date Inspected:", datemaker(@rep[:date_inspected])
292
365
  ]
293
-
294
- table(transaction_data) do
295
- columns(0..1).width = 68
296
- columns(2..3).width = 67
297
- columns([0, 2]).style align: :right
298
- cells.padding = [1, 2.5]
299
- cells.style(border_width: 0)
300
- columns([1, 3]).style(font_style: :bold)
301
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
302
- end
303
- stroke_bounds
366
+ ]
367
+
368
+ table(transaction_data) do
369
+ columns(0..1).width = 68
370
+ columns(2..3).width = 67
371
+ columns([0, 2]).style align: :right
372
+ cells.padding = [1, 2.5]
373
+ cells.style(border_width: 0)
374
+ columns([1, 3]).style(font_style: :bold)
375
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
304
376
  end
305
377
  end
306
378
 
307
379
  def physical_overview
308
- bounding_box([270, 360], height: 180, width: 270) do
309
- overview_data = [
310
- [{content: "Physical Overview", colspan: 4}],
311
- ["Farming Practice:", "#{@rep[:farming_practices]}", {content: "Predominant Soil Type and Description:", colspan: 2}],
312
- ["Ann. Rainfall-Inches:", "#{@rep[:avg_precipitation]}", {content: "#{@rep[:soils]}", colspan: 2, rowspan: 3}],
313
- ["Avg Frost Free Days:", "#{@rep[:growing_season]}"],
314
- ["Elevation(Range):", "#{@rep[:elevation]}"],
315
- ["Predom Top Slope:", "#{@rep[:topography]}", "Legal Access:", {content: "#{@rep[:legal_access]}", rowspan: 2}],
316
- ["Corn Suitability Rating:", @rep[:CSR2]],
317
- ["Land Use Zone:", "#{@rep[:land_use_zone]}", "Physical Access:", "#{@rep[:physical_access]}"],
318
- ["Flood Zone:", no_nil_array(@rep[:flood_zone]).join(", "), "Wetlands:", "#{@rep[:wetlands]}"],
319
- [{content: "Land Development Potential, Change or Use, or Limitations Comments:", colspan: 4}],
320
- [{content: "#{@rep[:development_potential]}" , colspan: 4}]
321
- ]
322
-
323
- table(overview_data) do
324
- columns(0..1).width = 68
325
- columns(2..3).width = 67
326
- columns([0, 2]).style(align: :right)
327
- columns([1, 3]).style(font_style: :bold)
328
- cells.padding = [1, 2.5]
329
- cells.style(border_width: 0)
330
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
331
- row(9).style(align: :left)
332
- end
333
- stroke_bounds
380
+ overview_data = [
381
+ [{content: "Physical Overview", colspan: 4}],
382
+ ["Farming Practice:", "#{@rep[:farming_practices]}", {content: "Predominant Soil Type and Description:", colspan: 2}],
383
+ ["Ann. Rainfall-Inches:", "#{@rep[:avg_precipitation]}", {content: "#{@rep[:soils]}", colspan: 2, rowspan: 3}],
384
+ ["Avg Frost Free Days:", "#{@rep[:growing_season]}"],
385
+ ["Elevation(Range):", "#{@rep[:elevation]}"],
386
+ ["Predom Top Slope:", "#{@rep[:topography]}", "Legal Access:", {content: "#{@rep[:legal_access]}", rowspan: 2}],
387
+ ["Corn Suitability Rating:", @rep[:CSR2]],
388
+ ["Land Use Zone:", "#{@rep[:land_use_zone]}", "Physical Access:", "#{@rep[:physical_access]}"],
389
+ ["Flood Zone:", no_nil_array(@rep[:flood_zone]).join(", "), "Wetlands:", "#{@rep[:wetlands]}"],
390
+ [{content: "Land Development Potential, Change or Use, or Limitations Comments:", colspan: 4}],
391
+ [{content: "#{@rep[:development_potential]}" , colspan: 4}]
392
+ ]
393
+
394
+ table(overview_data) do
395
+ columns(0..1).width = 68
396
+ columns(2..3).width = 67
397
+ columns([0, 2]).style(align: :right)
398
+ columns([1, 3]).style(font_style: :bold)
399
+ cells.padding = [1, 2.5]
400
+ cells.style(border_width: 0)
401
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
402
+ row(9).style(align: :left)
334
403
  end
335
404
  end
336
405
 
337
406
  def income_expense
338
- bounding_box([270, 180], height: 180, width: 270) do
339
-
340
- income = Money.new(no_nil_number(@rep[:eff_gross_income]) * 100, 'USD')
341
- expense = Money.new(no_nil_number(@rep[:total_expenses]) * 100, 'USD')
342
- noi = income - expense
343
- noi_string = noi.format(no_cents: :true)
344
- expense_ratio = "#{((expense / income) * 100).round(2)}" + "%"
345
-
346
- income_expense_data = [
347
- [{content: "Income/Expense Information", colspan: 4}],
348
- ["Total Farm Income:", income.format(no_cents: true), "Total Income to LL:", income.format(no_cents: true)],
349
- ["Total Farm Expenses:", expense.format(no_cents: true), "Total Exp pd by LL:", expense.format(no_cents: true)],
350
- ["NOI:", noi_string, "Expense Ratio:", expense_ratio],
351
- ["Cap Rate or OAR", "#{@rep[:overall_capitalization_rate]}%", " ", " "],
352
- [{content: "Cash Flow Comments:", colspan: 4}],
353
- [{content: @rep[:income_comments], colspan: 4}],
354
- ["Annual Water $/Acre:", moneymaker(@rep[:irrig_cost_per_acre], true)],
355
- ["Annual Pumping $/Acre:", moneymaker(@rep[:pumping_cost_per_acre], true)]
356
- ]
357
-
358
- table(income_expense_data) do
359
- columns(0..1).width = 68
360
- columns(2..3).width = 67
361
- columns(0..3).style(align: :right)
362
- cells.padding = [1, 2.5]
363
- cells.style(border_width: 0)
364
- columns([1, 3]).style(font_style: :bold)
365
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
366
- row([5, 6]).style(align: :left)
367
- end
368
- stroke_bounds
407
+ income = Money.new(no_nil_number(@rep[:eff_gross_income]) * 100, 'USD')
408
+ expense = Money.new(no_nil_number(@rep[:total_expenses]) * 100, 'USD')
409
+ noi = income - expense
410
+ noi_string = noi.format(no_cents: :true)
411
+ expense_ratio = "#{((expense / income) * 100).round(2)}" + "%"
412
+
413
+ income_expense_data = [
414
+ [{content: "Income/Expense Information", colspan: 4}],
415
+ ["Total Farm Income:", income.format(no_cents: true), "Total Income to LL:", income.format(no_cents: true)],
416
+ ["Total Farm Expenses:", expense.format(no_cents: true), "Total Exp pd by LL:", expense.format(no_cents: true)],
417
+ ["NOI:", noi_string, "Expense Ratio:", expense_ratio],
418
+ ["Cap Rate or OAR", "#{@rep[:overall_capitalization_rate]}%", " ", " "],
419
+ [{content: "Cash Flow Comments:", colspan: 4}],
420
+ [{content: @rep[:income_comments], colspan: 4}],
421
+ ["Annual Water $/Acre:", moneymaker(@rep[:irrig_cost_per_acre], true)],
422
+ ["Annual Pumping $/Acre:", moneymaker(@rep[:pumping_cost_per_acre], true)]
423
+ ]
424
+
425
+ table(income_expense_data) do
426
+ columns(0..1).width = 68
427
+ columns(2..3).width = 67
428
+ columns(0..3).style(align: :right)
429
+ cells.padding = [1, 2.5]
430
+ cells.style(border_width: 0)
431
+ columns([1, 3]).style(font_style: :bold)
432
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
433
+ row([5, 6]).style(align: :left)
369
434
  end
370
435
  end
371
436
 
372
437
  def legal_transaction
373
- bounding_box([270, 690], height: 125, width: 270) do
374
-
375
- taxes = @rep[:taxes]
376
- if taxes # node could be nil
377
- if taxes[0] # array could be empty
378
- tax_parcel_no = taxes[0][:tax_parcel_no]
379
- assessed_value = moneymaker(taxes[0][:assessed_value], true)
380
- real_estate_taxes = moneymaker(taxes[0][:RET], true)
381
- end
382
- else # deal with nil values to avoid no method errors
383
- tax_parcel_no, assessed_value, real_estate_taxes = "", "", ""
384
- end
385
-
386
- legal_transaction_data = [
387
- [{content: "Legal/Transaction Detail", colspan: 4}],
388
- ["Tax Parcel ID(s)", tax_parcel_no, " ", " "],
389
- [" ", " ", " ", " "],
390
- ["Year of Assessment:", "#{@rep[:year_of_assessment]}", "Year of RE Taxes:", "#{@rep[:year_of_real_estate_taxes]}"],
391
- ["Assessed Value:", assessed_value, "RE Taxes", real_estate_taxes],
392
- ["Financing:", "#{@rep[:financing_type]}", "Property Rights:", "#{@rep[:property_rights]}"],
393
- ["At Market Trans?:", "#{@rep[:atmarket_trans]}", "Days on Market:", "#{@rep[:exposure_period]}"],
394
- [{content: "Transaction History Comments:", colspan: 4}],
395
- [{content: "#{@rep[:listing_comments]}", colspan: 4}]
396
- ]
438
+ taxes = @rep[:taxes]
439
+ if taxes # node could be nil
440
+ if taxes[0] # array could be empty
441
+ tax_parcel_no = taxes[0][:tax_parcel_no]
442
+ assessed_value = moneymaker(taxes[0][:assessed_value], true)
443
+ real_estate_taxes = moneymaker(taxes[0][:RET], true)
444
+ end
445
+ else # deal with nil values to avoid no method errors
446
+ tax_parcel_no, assessed_value, real_estate_taxes = "", "", ""
447
+ end
397
448
 
398
- table(legal_transaction_data) do
399
- columns(0..1).width = 68
400
- columns(2..3).width = 67
401
- columns([1, 3]).style(font_style: :bold)
402
- cells.padding = [1, 2.5]
403
- cells.style(border_width: 0)
404
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
405
- end
406
- stroke_bounds
449
+ legal_transaction_data = [
450
+ [{content: "Legal/Transaction Detail", colspan: 4}],
451
+ ["Tax Parcel ID(s)", tax_parcel_no, " ", " "],
452
+ [" ", " ", " ", " "],
453
+ ["Year of Assessment:", "#{@rep[:year_of_assessment]}", "Year of RE Taxes:", "#{@rep[:year_of_real_estate_taxes]}"],
454
+ ["Assessed Value:", assessed_value, "RE Taxes", real_estate_taxes],
455
+ ["Financing:", "#{@rep[:financing_type]}", "Property Rights:", "#{@rep[:property_rights]}"],
456
+ ["At Market Trans?:", "#{@rep[:atmarket_trans]}", "Days on Market:", "#{@rep[:exposure_period]}"],
457
+ [{content: "Transaction History Comments:", colspan: 4}],
458
+ [{content: "#{@rep[:listing_comments]}", colspan: 4}]
459
+ ]
460
+
461
+ table(legal_transaction_data) do
462
+ columns(0..1).width = 68
463
+ columns(2..3).width = 67
464
+ columns([1, 3]).style(font_style: :bold)
465
+ cells.padding = [1, 2.5]
466
+ cells.style(border_width: 0)
467
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
407
468
  end
408
469
  end
409
470
 
410
471
  def transaction_history
411
- bounding_box([0, 565], height: 125, width: 540) do
412
- transaction_history_data = [
413
- [{content: "Transaction History", colspan: 4}],
414
- ["Historic Transaction Type", "Transaction Description", "Date", "Sale Price, List Price, or List Price"]
415
- ]
416
-
417
- transactions = @rep[:historyrecords]
418
-
419
- if transactions # node could be nil
420
- transactions.each do |t|
421
- if t # array could be nil
422
- transaction_history_data.push(
423
- ["#{t[:transType]}", "#{t[:transDescr]}", datemaker(t[:transDate]), moneymaker(t[:price], true)]
424
- )
425
- end
472
+ transaction_history_data = [
473
+ [{content: "Transaction History", colspan: 4}],
474
+ ["Historic Transaction Type", "Transaction Description", "Date", "Sale Price, List Price, or List Price"]
475
+ ]
476
+
477
+ transactions = @rep[:historyrecords]
478
+
479
+ if transactions # node could be nil
480
+ transactions.each do |t|
481
+ if t # array could be nil
482
+ transaction_history_data.push(
483
+ ["#{t[:transType]}", "#{t[:transDescr]}", datemaker(t[:transDate]), moneymaker(t[:price], true)]
484
+ )
426
485
  end
427
486
  end
487
+ end
428
488
 
429
- table(transaction_history_data) do
430
- columns(0..3).width = 135
431
- columns(0..3).style(align: :right, font_style: :bold)
432
- cells.padding = [1, 2.5]
433
- cells.style(border_width: 0)
434
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
435
- row(1).style(border_bottom_width: 0.5, font_style: nil)
436
- end
437
- stroke_bounds
489
+ table(transaction_history_data) do
490
+ columns(0..3).width = 135
491
+ columns(0..3).style(align: :right, font_style: :bold)
492
+ cells.padding = [1, 2.5]
493
+ cells.style(border_width: 0)
494
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
495
+ row(1).style(border_bottom_width: 0.5, font_style: nil)
438
496
  end
439
497
  end
440
498
 
441
499
  def utilities
442
- bounding_box([0, 440], height: 125, width: 540) do
443
- utilities_data = [
444
- [{content: "Description of Utilities", colspan: 4}],
445
- ["Utility Description", "Service Availability", "Service Provider", "Comments"]
446
- ]
447
-
448
- utilities = @rep[:utilities]
449
- if utilities # node could be nil
450
- utilities.each do |u|
451
- if u # array could be empty
452
- utilities_data.push(
453
- ["#{u[:description]}", "#{u[:availability]}", "#{u[:provider]}", "#{u[:comments]}"]
454
- )
455
- end
500
+ utilities_data = [
501
+ [{content: "Description of Utilities", colspan: 4}],
502
+ ["Utility Description", "Service Availability", "Service Provider", "Comments"]
503
+ ]
504
+
505
+ utilities = @rep[:utilities]
506
+ if utilities # node could be nil
507
+ utilities.each do |u|
508
+ if u # array could be empty
509
+ utilities_data.push(
510
+ ["#{u[:description]}", "#{u[:availability]}", "#{u[:provider]}", "#{u[:comments]}"]
511
+ )
456
512
  end
457
513
  end
514
+ end
458
515
 
459
- table(utilities_data) do
460
- columns(0..3).width = 135
461
- columns(0..3).style(align: :right, font_style: :bold)
462
- cells.padding = [1, 2.5]
463
- cells.style(border_width: 0)
464
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
465
- row(1).style(border_bottom_width: 0.5, font_style: nil)
466
- end
467
- stroke_bounds
516
+ table(utilities_data) do
517
+ columns(0..3).width = 135
518
+ columns(0..3).style(align: :right, font_style: :bold)
519
+ cells.padding = [1, 2.5]
520
+ cells.style(border_width: 0)
521
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
522
+ row(1).style(border_bottom_width: 0.5, font_style: nil)
468
523
  end
469
524
  end
470
525
 
471
526
  def improvements
472
- bounding_box([0, 315], height: 220, width: 540) do
473
-
474
- improvements_array = @rep[:improvements]
475
-
476
- sorted_array = flip_improvements_array(improvements_array)
477
-
478
- table(sorted_array) do
479
- columns(0..7).width = 67.5
480
- columns(1..7).style(font_style: :bold)
481
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
482
- cells.padding = [1, 2.5]
483
- cells.style(border_width: 0)
484
- row(1).style(border_bottom_width: 0.5, font_style: nil)
485
- end
486
- stroke_bounds
487
- end
527
+ improvements_array = @rep[:improvements]
528
+
529
+ sorted_array = flip_improvements_array(improvements_array)
530
+
531
+ table(sorted_array) do
532
+ columns(0..7).width = 67.5
533
+ columns(1..7).style(font_style: :bold)
534
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
535
+ cells.padding = [1, 2.5]
536
+ cells.style(border_width: 0)
537
+ row(1).style(border_bottom_width: 0.5, font_style: nil)
538
+ end
488
539
  end
489
540
 
490
541
  def water_rights
491
- bounding_box([0, 95], height: 95, width: 540) do
492
-
493
- water_rights_data = [
494
- [{content: "Water Rights", colspan: 8}],
495
- ["Water Right No.", "Water Right", "Water Source", "Priority Date", "Beneficial Use", "No. Acres Irrigated", "Annual Volume Ac-Ft", "Period of Use"]
496
- ]
497
-
498
- rights = @rep[:waterrights]
499
- if rights # node could be nil
500
- rights.each do |r|
501
- if r # array could be empty
502
- water_rights_data.push(
503
- ["#{r[:waterrightNum]}", "#{r[:waterRight]}", "#{r[:waterSrc]}", datemaker(r[:priorityDate]), "#{r[:purpose]}", "#{r[:numIrrAcres]}", "#{r[:annVolume]}"]
504
- )
505
- end
542
+ water_rights_data = [
543
+ [{content: "Water Rights", colspan: 8}],
544
+ ["Water Right No.", "Water Right", "Water Source", "Priority Date", "Beneficial Use", "No. Acres Irrigated", "Annual Volume Ac-Ft", "Period of Use"]
545
+ ]
546
+
547
+ rights = @rep[:waterrights]
548
+ if rights # node could be nil
549
+ rights.each do |r|
550
+ if r # array could be empty
551
+ water_rights_data.push(
552
+ ["#{r[:waterrightNum]}", "#{r[:waterRight]}", "#{r[:waterSrc]}", datemaker(r[:priorityDate]), "#{r[:purpose]}", "#{r[:numIrrAcres]}", "#{r[:annVolume]}"]
553
+ )
506
554
  end
507
555
  end
556
+ end
508
557
 
509
- table(water_rights_data) do
510
- columns(0..7).width = 67.5
511
- columns(0..7).style(font_style: :bold)
512
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
513
- cells.padding = [1, 2.5]
514
- cells.style(border_width: 0)
515
- row(1).style(border_bottom_width: 0.5, font_style: nil)
516
- end
517
-
518
- stroke_bounds
558
+ table(water_rights_data) do
559
+ columns(0..7).width = 67.5
560
+ columns(0..7).style(font_style: :bold)
561
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
562
+ cells.padding = [1, 2.5]
563
+ cells.style(border_width: 0)
564
+ row(1).style(border_bottom_width: 0.5, font_style: nil)
519
565
  end
520
566
  end
521
567
 
522
568
  def water_distribution
523
- bounding_box([0, 690], height: 100, width: 540) do
524
-
525
- distribution_data = [
526
- [{content: "Water Distribution System", colspan: 8}],
527
- ["Water Distrib. Equip.", "Manuf.", "Make/Brand", "Type", "Description", "Yr. Manufactured", "Remaining Ec. Life", "No. Acres Irrigated"]
528
- ]
529
-
530
- distributions = @rep[:waterdistributions]
531
-
532
- if distributions # node could be nil
533
- distributions.each do |d|
534
- if d # array could be empty
535
- distribution_data.push(
536
- ["#{d[:waterdistrEq]}", "#{d[:manufacturer]}", "#{d[:brand]}", "#{d[:eqType]}", "#{d[:descr]}", "#{d[:yearManuf]}", "#{d[:remainingEcLife]}", "#{d[:irrAcres]}"]
537
- )
538
- end
569
+ distribution_data = [
570
+ [{content: "Water Distribution System", colspan: 8}],
571
+ ["Water Distrib. Equip.", "Manuf.", "Make/Brand", "Type", "Description", "Yr. Manufactured", "Remaining Ec. Life", "No. Acres Irrigated"]
572
+ ]
573
+
574
+ distributions = @rep[:waterdistributions]
575
+
576
+ if distributions # node could be nil
577
+ distributions.each do |d|
578
+ if d # array could be empty
579
+ distribution_data.push(
580
+ ["#{d[:waterdistrEq]}", "#{d[:manufacturer]}", "#{d[:brand]}", "#{d[:eqType]}", "#{d[:descr]}", "#{d[:yearManuf]}", "#{d[:remainingEcLife]}", "#{d[:irrAcres]}"]
581
+ )
539
582
  end
540
583
  end
584
+ end
541
585
 
542
- table(distribution_data) do
543
- columns(0..7).width = 67.5
544
- columns(0..7).style(font_style: :bold)
545
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
546
- cells.padding = [1, 2.5]
547
- cells.style(border_width: 0)
548
- row(1).style(border_bottom_width: 0.5, font_style: nil)
549
- end
550
-
551
- stroke_bounds
586
+ table(distribution_data) do
587
+ columns(0..7).width = 67.5
588
+ columns(0..7).style(font_style: :bold)
589
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
590
+ cells.padding = [1, 2.5]
591
+ cells.style(border_width: 0)
592
+ row(1).style(border_bottom_width: 0.5, font_style: nil)
552
593
  end
553
594
  end
554
595
 
555
596
  def crop_yield
556
- bounding_box([0, 590], height: 135, width: 540) do
557
-
558
- crops = @rep[:crops]
559
-
560
- crop_data = [
561
- [{content: "Crop Yield Summary", colspan: 7}],
562
- ["Crop Year", "Commodity Identified", "Unit of Measure", "Average Yield", " ", " ", ", "]
563
- ]
564
-
565
- if crops # node could be nil
566
- crops.each do |c|
567
- if c # array could be empty
568
- crop_data.push(
569
- ["#{c[:year]}", "#{c[:commodity]}", "#{c[:unit]}", "#{c[:avgyield]}"]
570
- )
571
- end
597
+ crops = @rep[:crops]
598
+
599
+ crop_data = [
600
+ [{content: "Crop Yield Summary", colspan: 7}],
601
+ ["Crop Year", "Commodity Identified", "Unit of Measure", "Average Yield", " ", " ", ", "]
602
+ ]
603
+
604
+ if crops # node could be nil
605
+ crops.each do |c|
606
+ if c # array could be empty
607
+ crop_data.push(
608
+ ["#{c[:year]}", "#{c[:commodity]}", "#{c[:unit]}", "#{c[:avgyield]}"]
609
+ )
572
610
  end
573
611
  end
612
+ end
574
613
 
575
- table(crop_data) do
576
- column(0).width = 135
577
- columns(1..6).width = 67.5
578
- columns(0..6).style(font_style: :bold)
579
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
580
- cells.padding = [1, 2.5]
581
- cells.style(border_width: 0)
582
- row(1).style(border_bottom_width: 0.5, font_style: nil)
583
- end
584
- stroke_bounds
614
+ table(crop_data) do
615
+ column(0).width = 135
616
+ columns(1..6).width = 67.5
617
+ columns(0..6).style(font_style: :bold)
618
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
619
+ cells.padding = [1, 2.5]
620
+ cells.style(border_width: 0)
621
+ row(1).style(border_bottom_width: 0.5, font_style: nil)
585
622
  end
586
623
  end
587
624
 
588
625
  def estimated_productivity
589
- bounding_box([0, 455], height: 120, width: 540) do
590
- estimatedproductivity = @rep[:estimatedproductivity]
591
-
592
- production_data = [
593
- [{content: "Estimated Productivity", colspan: 4}],
594
- ["Commodity Identification", "Unit Measure", "Estimated Yield", " "]
595
- ]
626
+ estimatedproductivity = @rep[:estimatedproductivity]
596
627
 
597
- if estimatedproductivity && estimatedproductivity.any?
598
- estimatedproductivity.each do |p|
599
- production_data.push(
600
- ["#{p[:commodity]}", "#{p[:unit]}", "#{p[:estmtdyield]}"]
601
- )
602
- end
603
- end
628
+ production_data = [
629
+ [{content: "Estimated Productivity", colspan: 4}],
630
+ ["Commodity Identification", "Unit Measure", "Estimated Yield", " "]
631
+ ]
604
632
 
605
- table(production_data) do
606
- columns(0..3).width = 135
607
- columns(0..3).style(font_style: :bold)
608
- cells.padding = [1, 2.5]
609
- cells.style(border_width: 0)
610
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
611
- row(1).style(border_bottom_width: 0.5, font_style: nil)
633
+ if estimatedproductivity && estimatedproductivity.any?
634
+ estimatedproductivity.each do |p|
635
+ production_data.push(
636
+ ["#{p[:commodity]}", "#{p[:unit]}", "#{p[:estmtdyield]}"]
637
+ )
612
638
  end
639
+ end
613
640
 
614
- stroke_bounds
641
+ table(production_data) do
642
+ columns(0..3).width = 135
643
+ columns(0..3).style(font_style: :bold)
644
+ cells.padding = [1, 2.5]
645
+ cells.style(border_width: 0)
646
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
647
+ row(1).style(border_bottom_width: 0.5, font_style: nil)
615
648
  end
616
649
  end
617
650
 
618
651
  def perm_plantings
619
- bounding_box([0, 335], height: 135, width: 540) do
620
- planting_data = [
621
- [{content: "Permanent Plantings", colspan: 8}],
622
- ["Planting", "Variety", "Ac. Type", "No. of Acres", "Average Age", "Plants/Acre", "Unit Description", "Average Yield"]
623
- ]
624
-
625
- plantings = @rep[:plantings]
626
-
627
- if plantings # node could be nil
628
- plantings.each do |p|
629
- if p # array could be empty
630
- planting_data.push(
631
- ["#{p[:planting]}", "#{p[:variety]}", "#{p[:acres]}", "#{p[:numacres]}", "#{p[:avgage]}", "#{p[:plantsacre]}", "#{p[:unitdescr1]}", "#{p[:avgproduction]}"]
632
- )
633
- end
652
+ planting_data = [
653
+ [{content: "Permanent Plantings", colspan: 8}],
654
+ ["Planting", "Variety", "Ac. Type", "No. of Acres", "Average Age", "Plants/Acre", "Unit Description", "Average Yield"]
655
+ ]
656
+
657
+ plantings = @rep[:plantings]
658
+
659
+ if plantings # node could be nil
660
+ plantings.each do |p|
661
+ if p # array could be empty
662
+ planting_data.push(
663
+ ["#{p[:planting]}", "#{p[:variety]}", "#{p[:acres]}", "#{p[:numacres]}", "#{p[:avgage]}", "#{p[:plantsacre]}", "#{p[:unitdescr1]}", "#{p[:avgproduction]}"]
664
+ )
634
665
  end
635
666
  end
667
+ end
636
668
 
637
- table(planting_data) do
638
- columns(0..7).width = 67.5
639
- columns(0..7).style(font_style: :bold)
640
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
641
- cells.padding = [1, 2.5]
642
- cells.style(border_width: 0)
643
- row(1).style(border_bottom_width: 0.5, font_style: nil)
644
- end
645
-
646
- stroke_bounds
669
+ table(planting_data) do
670
+ columns(0..7).width = 67.5
671
+ columns(0..7).style(font_style: :bold)
672
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
673
+ cells.padding = [1, 2.5]
674
+ cells.style(border_width: 0)
675
+ row(1).style(border_bottom_width: 0.5, font_style: nil)
647
676
  end
648
677
  end
649
678
 
650
679
  def externalities
651
- bounding_box([0, 200], height: 200, width: 540) do
652
-
653
- extern_data = ReportUtils.conditional_externs_array(@rep) # instance method to populate dynamic array
654
- table(extern_data) do
655
- columns(0..3).width = 135
656
- columns([1, 3]).style(font_style: :bold)
657
- row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
658
- cells.padding = [1, 2.5]
659
- cells.style(border_width: 0)
660
- end
661
-
662
- stroke_bounds
680
+ extern_data = ReportUtils.conditional_externs_array(@rep) # instance method to populate dynamic array
681
+ table(extern_data) do
682
+ columns(0..3).width = 135
683
+ columns([1, 3]).style(font_style: :bold)
684
+ row(0).style(align: :center, background_color: 'd7d7d7', font_size: 8, font_style: :bold)
685
+ cells.padding = [1, 2.5]
686
+ cells.style(border_width: 0)
663
687
  end
664
688
  end
665
689
 
@@ -469,7 +469,7 @@ describe 'closed_sale class' do
469
469
  water_distribution
470
470
  end
471
471
  page1 = PDF::Reader.new(StringIO.new(@pdf.render)).page(1).to_s
472
- page2 = PDF::Reader.new(StringIO.new(@pdf.render)).page(2).to_s
472
+ page2 = PDF::Reader.new(StringIO.new(@pdf.render)).page(1).to_s
473
473
  @water_distribution_content = page1 + page2
474
474
  end
475
475
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appraisermetrics_report_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - StackPoint
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-05 00:00:00.000000000 Z
11
+ date: 2015-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ttfunk