appraisermetrics_report_service 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a25e1b4880b271a5b79ec518e4901e42017f9846
4
- data.tar.gz: 47ca61fadb95626416ea6551943a94f05c4c86f2
3
+ metadata.gz: f9385e6a2d1ca85fcc7fa5e78ee053a2cac6e50d
4
+ data.tar.gz: 9eee868cddc4cd210c87ae7cdbc5e2393c2d9184
5
5
  SHA512:
6
- metadata.gz: a2005fde48459b5b3dbec14c845c1354542a3fe601212ccef4834fed37fb62c535dac70043605de015d34195cafe51335c0c74fabb164d92ab676462c4c50d55
7
- data.tar.gz: 7e85c79ae62d3b7249c9c9954e7c314586c8ccf909b26fc0c70f2db11673b0770454bfa8e5a8ad85f19ac9781b03fc5b935b2ee07aea58cc667a6d36b88a6bb1
6
+ metadata.gz: 3f5ab83e829fa41988cda92e0e3d68c69f532f36b858140a16a7e3e9b7425c66313d7956f7cf16a68315be82b1db6842f1cce02e2407ac0a26c80e3ed0071bab
7
+ data.tar.gz: 8b94ddabc8645c7780126766d767963ef13b5d56afc8761b1104e725df43c46e7f14f01fc0328cda8fef0b69923fb811971071873d8ee948947d16a93f42f343
@@ -1,3 +1,3 @@
1
1
  module AppraisermetricsReportService
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
data/lib/eval_report.rb CHANGED
@@ -17,6 +17,7 @@ class EvalReport < Prawn::Document
17
17
  @comps = comparables
18
18
  @comps ||= [] # avoid calling methods on nil
19
19
  @docs = docs
20
+ @docs ||= {}
20
21
  @text_blocks = static_strings # Hash of text blocks loaded from .yml
21
22
  @recon_primary_per_acre = [] # used for reconciliation for comparables
22
23
  @recon_secondary_per_acre = [] # ""
@@ -44,7 +45,6 @@ class EvalReport < Prawn::Document
44
45
  ag_sales_map
45
46
  val_method_and_recon
46
47
  assumptions_and_conditions
47
- addenda_contents
48
48
  addendum_a
49
49
  addendum_b
50
50
  additional_docs
@@ -151,10 +151,10 @@ class EvalReport < Prawn::Document
151
151
  def subject_images
152
152
  header("SUBJECT PHOTOGRAPHS")
153
153
  move_down 10
154
- if @docs && @docs[:subjectphotos]
155
- if @docs[:subjectphotos][0]
154
+ if @docs[:photos] && @docs[:photos].any?
155
+ if @docs[:photos][0]
156
156
  image_cap("")
157
- image "#{@docs[:subjectphotos][0]}", width: 300, position: :center
157
+ image "#{@docs[:photos][0]}", width: 300, position: :center
158
158
  move_down 2
159
159
  text "Subject Property - Representative Image", align: :center
160
160
  move_down 25
@@ -163,9 +163,9 @@ class EvalReport < Prawn::Document
163
163
  move_cursor_to 350
164
164
  end
165
165
 
166
- if @docs[:subjectphotos][1]
166
+ if @docs[:photos][1]
167
167
  image_cap("")
168
- image "#{@docs[:subjectphotos][1]}", width: 300, position: :center
168
+ image "#{@docs[:photos][1]}", width: 300, position: :center
169
169
  move_down 2
170
170
  text "Subject Property - Representative Image", align: :center
171
171
  move_down 25
@@ -178,9 +178,9 @@ class EvalReport < Prawn::Document
178
178
  start_new_page
179
179
  header("SUBJECT PHOTOGRAPHS")
180
180
  move_down 10
181
- if @docs[:subjectphotos][2]
181
+ if @docs[:photos][2]
182
182
  image_cap("")
183
- image "#{@docs[:subjectphotos][2]}", width: 300, position: :center
183
+ image "#{@docs[:photos][2]}", width: 300, position: :center
184
184
  move_down 2
185
185
  text "Subject Property - Representative Image", align: :center
186
186
  move_down 25
@@ -189,9 +189,9 @@ class EvalReport < Prawn::Document
189
189
  move_cursor_to 350
190
190
  end
191
191
 
192
- if @docs[:subjectphotos][3]
192
+ if @docs[:photos][3]
193
193
  image_cap("")
194
- image "#{@docs[:subjectphotos][3]}", width: 300, position: :center
194
+ image "#{@docs[:photos][3]}", width: 300, position: :center
195
195
  move_down 2
196
196
  text "Subject Property - Representative Image", align: :center
197
197
  move_down 25
@@ -315,19 +315,19 @@ class EvalReport < Prawn::Document
315
315
  header("REGIONAL MAPS")
316
316
  move_down 25
317
317
  text "REGIONAL MAPS", size: 14, align: :center
318
- if @docs && @docs[:statemap]
319
- if @docs[:statemap]
318
+ if @docs[:statemap] && @docs[:statemap].any?
319
+ if @docs[:statemap][0]
320
320
  image_cap("STATE MAP")
321
- image "#{@docs[:statemap]}", width: 300, position: :center
321
+ image "#{@docs[:statemap][0]}", width: 300, position: :center
322
322
  move_down 25
323
323
  else
324
324
  text 'No Image', align: :center
325
325
  move_cursor_to 350
326
326
  end
327
327
 
328
- if @docs[:countymap]
328
+ if @docs[:countymap] && @docs[:countymap].any?
329
329
  image_cap("COUNTY MAP")
330
- image "#{@docs[:countymap]}", width: 300, position: :center
330
+ image "#{@docs[:countymap][0]}", width: 300, position: :center
331
331
  else
332
332
  text 'No Image', align: :center
333
333
  move_cursor_to 350
@@ -346,10 +346,10 @@ class EvalReport < Prawn::Document
346
346
  move_down 25
347
347
  text "MAPS", size: 14, align: :center
348
348
 
349
- if @docs && @docs[:topomap]
350
- if @docs[:topomap]
349
+ if @docs[:topomap] && @docs[:topomap].any?
350
+ if @docs[:topomap][0]
351
351
  image_cap("TOPOGRAPHICAL MAP")
352
- image "#{@docs[:topomap]}", width: 300, position: :center
352
+ image "#{@docs[:topomap][0]}", width: 300, position: :center
353
353
  move_down 25
354
354
  else
355
355
  text 'No Image', align: :center
@@ -357,9 +357,9 @@ class EvalReport < Prawn::Document
357
357
  end
358
358
 
359
359
 
360
- if @docs[:aerialmap]
360
+ if @docs[:aerialmap] && @docs[:aerialmap][0]
361
361
  image_cap("AERIAL FSA MAP")
362
- image "#{@docs[:aerialmap]}", width: 300, position: :center
362
+ image "#{@docs[:aerialmap][0]}", width: 300, position: :center
363
363
  else
364
364
  text 'No Image', align: :center
365
365
  end
@@ -829,8 +829,8 @@ class EvalReport < Prawn::Document
829
829
  def ag_sales_map
830
830
  header("AGRICULTURE SALES LOCATION MAP")
831
831
  move_down 50
832
- if @docs && @docs[:agsalesmap]
833
- image "#{@docs[:agsalesmap]}", width: 500, position: :center
832
+ if @docs[:agsalesmap] && @docs[:agsalesmap].any?
833
+ image "#{@docs[:agsalesmap][0]}", width: 500, position: :center
834
834
  else
835
835
  text 'No Image'
836
836
  end
@@ -945,16 +945,10 @@ class EvalReport < Prawn::Document
945
945
  start_new_page
946
946
  end
947
947
 
948
- def addenda_contents
949
- header("ADDENDA CONTENTS")
950
- move_down 25
951
- text "ADDENDA CONTENTS", size: 14, style: :bold
952
- end
953
-
954
948
  def addendum_a
955
949
  # if an engagement letter is present, use it as a template for this page
956
- if @docs && @docs[:engagementletter]
957
- start_new_page(template: @docs[:engagementletter])
950
+ if @docs[:engagementletter] && @docs[:engagementletter].any?
951
+ start_new_page(template: @docs[:engagementletter][0])
958
952
  header("ENGAGEMENT LETTER")
959
953
  else
960
954
  start_new_page
@@ -966,8 +960,8 @@ class EvalReport < Prawn::Document
966
960
 
967
961
  def addendum_b
968
962
 
969
- if @docs && @docs[:legaldescription]
970
- start_new_page(template: @docs[:legaldescription])
963
+ if @docs[:legaldescription] && @docs[:legaldescription].any?
964
+ start_new_page(template: @docs[:legaldescription][0])
971
965
  header("LEGAL DESCRIPTION")
972
966
  else
973
967
  start_new_page
@@ -980,8 +974,8 @@ class EvalReport < Prawn::Document
980
974
 
981
975
  def additional_docs
982
976
  pdf_doc_proc = Proc.new do |doc_key, title|
983
- if @docs[doc_key]
984
- start_new_page(template: @docs[doc_key])
977
+ if @docs[doc_key] && @docs[doc_key].any?
978
+ start_new_page(template: @docs[doc_key][0])
985
979
  header(title)
986
980
  end
987
981
  end
@@ -1005,7 +999,6 @@ class EvalReport < Prawn::Document
1005
999
  pdf_doc_proc.call(:cropinsurancehistory, "CROP INSURANCE HISTORY")
1006
1000
  pdf_doc_proc.call(:timbercruise, "TIMBER CRUISE")
1007
1001
  pdf_doc_proc.call(:notes, "NOTES")
1008
- pdf_doc_proc.call(:photos, "PHOTOS")
1009
1002
  end
1010
1003
 
1011
1004
  def prepare_comps_for_calc
@@ -488,7 +488,7 @@ describe 'eval report class' do
488
488
  it 'renders static content' do
489
489
  @pdf = EvalReport.new do
490
490
  @sub = Sampler.get_eval1
491
- @docs = {engagementletter: './spec/test_data/pdfs/engagement_letter.pdf'}
491
+ @docs = {engagementletter: ['./spec/test_data/pdfs/engagement_letter.pdf']}
492
492
  addendum_a
493
493
  end
494
494
 
@@ -499,7 +499,7 @@ describe 'eval report class' do
499
499
  it 'renders dynamic content from keys' do
500
500
  @pdf = EvalReport.new do
501
501
  @sub = Sampler.get_eval1
502
- @docs = {engagementletter: './spec/test_data/pdfs/engagement_letter.pdf'}
502
+ @docs = {engagementletter: ['./spec/test_data/pdfs/engagement_letter.pdf']}
503
503
  addendum_a
504
504
  end
505
505
 
@@ -527,7 +527,7 @@ describe 'eval report class' do
527
527
  it 'renders static content' do
528
528
  @pdf = EvalReport.new do
529
529
  @sub = {}
530
- @docs = {legaldescription: './spec/test_data/pdfs/legal_description.pdf'}
530
+ @docs = {legaldescription: ['./spec/test_data/pdfs/legal_description.pdf']}
531
531
  addendum_b
532
532
  end
533
533
 
@@ -538,7 +538,7 @@ describe 'eval report class' do
538
538
  it 'renders inserts dynamic content from pdf' do
539
539
  @pdf = EvalReport.new do
540
540
  @sub = Sampler.get_eval1
541
- @docs = {legaldescription: './spec/test_data/pdfs/legal_description.pdf'}
541
+ @docs = {legaldescription: ['./spec/test_data/pdfs/legal_description.pdf']}
542
542
  addendum_b
543
543
  end
544
544
 
@@ -40,39 +40,38 @@ class Sampler
40
40
 
41
41
  def self.sample_eval_docs
42
42
  docs = {
43
- subjectphotos: [
43
+ photos: [
44
44
  './spec/test_data/images/subject1.jpg',
45
45
  './spec/test_data/images/subject2.jpg',
46
46
  './spec/test_data/images/subject3.jpg',
47
47
  './spec/test_data/images/subject4.jpg'
48
48
  ],
49
- engagementletter: './spec/test_data/pdfs/engagement_letter.pdf',
50
- legaldescription: './spec/test_data/pdfs/legal_description.pdf',
51
- statemap: './spec/test_data/images/regional1.jpg',
52
- countymap: './spec/test_data/images/regional2.jpg',
53
- topomap: './spec/test_data/images/topo1.jpg',
54
- aerialmap: './spec/test_data/images/topo2.jpg',
55
- agsalesmap: './spec/test_data/images/ag_sales.jpg',
56
- warrantydeed: './spec/test_data/pdfs/optional_doc.pdf',
57
- titleinsurancepolicy: './spec/test_data/pdfs/optional_doc.pdf',
58
- lease: './spec/test_data/pdfs/optional_doc.pdf',
59
- purchaseandsaleagreement: './spec/test_data/pdfs/optional_doc.pdf',
60
- fsamap: './spec/test_data/pdfs/optional_doc.pdf',
61
- fsa156: './spec/test_data/pdfs/optional_doc.pdf',
62
- addendum: './spec/test_data/pdfs/optional_doc.pdf',
63
- crpcontracts: './spec/test_data/pdfs/optional_doc.pdf',
64
- floodmap: './spec/test_data/pdfs/optional_doc.pdf',
65
- platmap: './spec/test_data/pdfs/optional_doc.pdf',
66
- surveymap: './spec/test_data/pdfs/optional_doc.pdf',
67
- othermap: './spec/test_data/pdfs/optional_doc.pdf',
68
- buildingschematics: './spec/test_data/pdfs/optional_doc.pdf',
69
- irrigationschematics: './spec/test_data/pdfs/optional_doc.pdf',
70
- irrigationequipment: './spec/test_data/pdfs/optional_doc.pdf',
71
- cropcontracts: './spec/test_data/pdfs/optional_doc.pdf',
72
- cropinsurancehistory: './spec/test_data/pdfs/optional_doc.pdf',
73
- timbercruise: './spec/test_data/pdfs/optional_doc.pdf',
74
- notes: './spec/test_data/pdfs/optional_doc.pdf',
75
- photos: './spec/test_data/pdfs/optional_doc.pdf'
49
+ engagementletter: ['./spec/test_data/pdfs/engagement_letter.pdf'],
50
+ legaldescription: ['./spec/test_data/pdfs/legal_description.pdf'],
51
+ statemap: ['./spec/test_data/images/regional1.jpg'],
52
+ countymap: ['./spec/test_data/images/regional2.jpg'],
53
+ topomap: ['./spec/test_data/images/topo1.jpg'],
54
+ aerialmap: ['./spec/test_data/images/topo2.jpg'],
55
+ agsalesmap: ['./spec/test_data/images/ag_sales.jpg'],
56
+ warrantydeed: ['./spec/test_data/pdfs/optional_doc.pdf'],
57
+ titleinsurancepolicy: ['./spec/test_data/pdfs/optional_doc.pdf'],
58
+ lease: ['./spec/test_data/pdfs/optional_doc.pdf'],
59
+ purchaseandsaleagreement: ['./spec/test_data/pdfs/optional_doc.pdf'],
60
+ fsamap: ['./spec/test_data/pdfs/optional_doc.pdf'],
61
+ fsa156: ['./spec/test_data/pdfs/optional_doc.pdf'],
62
+ addendum: ['./spec/test_data/pdfs/optional_doc.pdf'],
63
+ crpcontracts: ['./spec/test_data/pdfs/optional_doc.pdf'],
64
+ floodmap: ['./spec/test_data/pdfs/optional_doc.pdf'],
65
+ platmap: ['./spec/test_data/pdfs/optional_doc.pdf'],
66
+ surveymap: ['./spec/test_data/pdfs/optional_doc.pdf'],
67
+ othermap: ['./spec/test_data/pdfs/optional_doc.pdf'],
68
+ buildingschematics: ['./spec/test_data/pdfs/optional_doc.pdf'],
69
+ irrigationschematics: ['./spec/test_data/pdfs/optional_doc.pdf'],
70
+ irrigationequipment: ['./spec/test_data/pdfs/optional_doc.pdf'],
71
+ cropcontracts: ['./spec/test_data/pdfs/optional_doc.pdf'],
72
+ cropinsurancehistory: ['./spec/test_data/pdfs/optional_doc.pdf'],
73
+ timbercruise: ['./spec/test_data/pdfs/optional_doc.pdf'],
74
+ notes: ['./spec/test_data/pdfs/optional_doc.pdf'],
76
75
  }
77
76
  end
78
77
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: appraisermetrics_report_service
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - StackPoint
@@ -210,7 +210,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
210
  version: '0'
211
211
  requirements: []
212
212
  rubyforge_project:
213
- rubygems_version: 2.2.2
213
+ rubygems_version: 2.4.5
214
214
  signing_key:
215
215
  specification_version: 4
216
216
  summary: '["A service to generate pdf reports"]'