appraisermetrics_report_service 0.1.6 → 0.1.7

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: 3fd92e7b4a236becc82495be48c555dafac68eaa
4
- data.tar.gz: 2ac74975fbae9952a9e97436f5df0d5d4e57a681
3
+ metadata.gz: 2470ef58844451b904f67492255e8cfcdea82328
4
+ data.tar.gz: a6a1540cdb8b8812b373aa8190bdaab6f0fbf145
5
5
  SHA512:
6
- metadata.gz: 90e7a35b0f564082348ad340479e51b92617e57962f11380aa55da8b1f81624e52f614de75965f85bea8d4c9bce01b6f3206ae06fad64c8bd493b80915dd81cc
7
- data.tar.gz: c2fa64a42ed4de775070624d9b28c04e04bd9f5ebef53f272f984ec5356ed825dcaeed8288c1eb6be8261ba40fb23238d6b934dece8b5451c474e521159eb834
6
+ metadata.gz: 362d720e74c6852e3908ca0370bae2d528a7cb77d6b8459e83fd5230bcee33acd848200d51b15bf9baca030d5831b5259c16fa573e933e15ec6983371bcd7812
7
+ data.tar.gz: b52f962220829d673c4380e8c7959d8b26b2ae65bfc0874dee3313609c1990b3f742eb2e749a99e88b558267bad3a88e380c5f9aa32a8eb9fa02cb519b48f852
@@ -1,3 +1,3 @@
1
1
  module AppraisermetricsReportService
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
data/lib/closed_sale.rb CHANGED
@@ -610,15 +610,20 @@ class ClosedSale < Prawn::Document
610
610
  def water_rights
611
611
  water_rights_data = [
612
612
  [{content: "Water Rights", colspan: 8}],
613
- ["Water Right No.", "Water Right", "Water Source", "Priority Date", "Beneficial Use", "No. Acres Irrigated", "Annual Volume Ac-Ft", "Period of Use"]
613
+ ["Water Right No.", "Water Right", "Water Source", "Priority Date", "Beneficial Use", "No. Acres Irrigated", "Annual Volume Ac-Ft", "Ac-Ft per Acre"]
614
614
  ]
615
615
 
616
616
  rights = @rep[:waterrights]
617
617
  if rights # node could be nil
618
618
  rights.each do |r|
619
619
  if r # array could be empty
620
+ if !r[:numIrrAcres] || r[:numIrrAcres] == 0
621
+ ac_ft_per = 0
622
+ else
623
+ ac_ft_per = (no_nil_number(r[:annVolume]).to_f / r[:numIrrAcres].to_f).round(1)
624
+ end
620
625
  water_rights_data.push(
621
- ["#{r[:waterrightNum]}", "#{r[:waterRight]}", "#{r[:waterSrc]}", datemaker(r[:priorityDate]), "#{r[:purpose]}", "#{r[:numIrrAcres]}", "#{r[:annVolume]}"]
626
+ ["#{r[:waterrightNum]}", "#{r[:waterRight]}", "#{r[:waterSrc]}", datemaker(r[:priorityDate]), "#{r[:purpose]}", "#{r[:numIrrAcres]}", "#{r[:annVolume]}", "#{ac_ft_per}"]
622
627
  )
623
628
  end
624
629
  end
data/lib/eval_report.rb CHANGED
@@ -1206,15 +1206,20 @@ class EvalReport < Prawn::Document
1206
1206
  def water_rights
1207
1207
  water_rights_data = [
1208
1208
  [{content: "Water Rights", colspan: 8}],
1209
- ["Water Right No.", "Water Right", "Water Source", "Priority Date", "Beneficial Use", "No. Acres Irrigated", "Annual Volume Ac-Ft", "Period of Use"]
1209
+ ["Water Right No.", "Water Right", "Water Source", "Priority Date", "Beneficial Use", "No. Acres Irrigated", "Annual Volume Ac-Ft", "Ac-Ft per Acre"]
1210
1210
  ]
1211
1211
 
1212
1212
  rights = @sub[:waterrights]
1213
1213
  if rights # node could be nil
1214
1214
  rights.each do |r|
1215
1215
  if r # array could be empty
1216
+ if !r[:numIrrAcres] || r[:numIrrAcres] == 0
1217
+ ac_ft_per = 0
1218
+ else
1219
+ ac_ft_per = (no_nil_number(r[:annVolume]).to_f / r[:numIrrAcres].to_f).round(1)
1220
+ end
1216
1221
  water_rights_data.push(
1217
- ["#{r[:waterrightNum]}", "#{r[:waterRight]}", "#{r[:waterSrc]}", datemaker(r[:priorityDate]), "#{r[:purpose]}", "#{r[:numIrrAcres]}", "#{r[:annVolume]}"]
1222
+ ["#{r[:waterrightNum]}", "#{r[:waterRight]}", "#{r[:waterSrc]}", datemaker(r[:priorityDate]), "#{r[:purpose]}", "#{r[:numIrrAcres]}", "#{r[:annVolume]}", "#{ac_ft_per}"]
1218
1223
  )
1219
1224
  end
1220
1225
  end
@@ -1,6 +1,16 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe 'closed_sale class' do
4
+
5
+ describe 'write_content' do
6
+ it 'should render without breaking' do # check for syntax errors
7
+ @pdf = ClosedSale.new do
8
+ @rep = Sampler.get_comp2
9
+ write_content(Sampler.get_comp2, Sampler.sample_closed_sale_images, Sampler.sample_logo)
10
+ end
11
+ end
12
+ end
13
+
4
14
  describe 'meta data table' do # meta data
5
15
  context 'keys present' do
6
16
  before :each do
@@ -2,6 +2,16 @@ require 'spec_helper'
2
2
 
3
3
  describe 'eval report class' do
4
4
 
5
+ describe '#write_content' do
6
+ it 'contains no obvious syntax errors' do
7
+ r = EvalReport.new do
8
+ comps = []
9
+ 8.times {|c| comps << Sampler.get_comp2}
10
+ write_content(Sampler.get_eval1, comps, Sampler.sample_logo, Sampler.sample_eval_docs)
11
+ end
12
+ end
13
+ end
14
+
5
15
  describe '#meta_data' do
6
16
  context 'with keys' do
7
17
  it 'renders static content' do
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.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - StackPoint
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-05 00:00:00.000000000 Z
11
+ date: 2015-03-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ttfunk