toolhound-ruby 1.0.8 → 1.0.9

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: e9bb19365bad8211a21cb1236ab9dd44ec5b567e
4
- data.tar.gz: 916ecdf9c5d21387356a34ff121fe61acef0f4f8
3
+ metadata.gz: 1e25f7d284dc16bf2579fc28b625acdfd9b20c6c
4
+ data.tar.gz: 97b1eb6e9957db0a2dc779819b9a604a3e4672c8
5
5
  SHA512:
6
- metadata.gz: a1e885e703b4cef7a1f0a883371bb44aa19f8287f8c3930cf0f6d69d0089f5b40a796056acdc5c62ab2d519ddb7decf0316146f9d78993eb0fb50ee96fcb5d6e
7
- data.tar.gz: cd6fc6df1e56709ddc7f75ab40e7c932f53070c7f4dbbab6ea00f9ae545f2d552f6d3e5f4617dc01cd16c648b3481e77eb9c1ee80947b3e017b736a11c2e255d
6
+ metadata.gz: a99563ca92facb61c3e517025cfbabdcbeec63e24a63e3ff7e500e0b7078928cd9df92fd4cfd41d846cef5c7d1bf0b4dee6f5a74225ec49559288b8261f0900d
7
+ data.tar.gz: c86f5cf485f36bc7011bb9d87f6f3315b5b051921d9c39a080b5b5343f3e8b01c3862d66e5abbd411c2f021e1c9f58e2bf1789b09e193a0cb0425408b98e9384
@@ -13,7 +13,12 @@ module Toolhound
13
13
  {
14
14
  location: [:int_location_id, :dte_created_date, :dte_modified_date],
15
15
  location_text: [:var_location_name],
16
- entity: [:int_entity_id, var_entity_id: :job_no ]
16
+ entity: [:int_entity_id, var_entity_id: :job_no ],
17
+ # tax rates
18
+ tax: [:dec_tax1_rate, :dec_tax2_rate, :dec_tax3_rate, :dec_tax4_rate],
19
+ tax_text: [:var_tax1_description, :var_tax2_description, :var_tax3_description, :var_tax4_description],
20
+ # rental periods
21
+ rental_period: [:dte_min_rental_date, :dte_max_rental_date]
17
22
  }
18
23
  end
19
24
 
@@ -21,7 +26,17 @@ module Toolhound
21
26
  arr = []
22
27
  arr << "INNER JOIN tblEntity ON (tblEntity.intEntityID = tblLocation.intEntityID)"
23
28
  arr << "INNER JOIN tblLocationText ON (tblLocationText.intLocationID = tblLocation.intLocationID)"
24
-
29
+ # tax rates
30
+ arr << "LEFT OUTER JOIN (
31
+ SELECT intLocationID, MAX(tblTax.dteCreatedDate) AS max_date FROM tblTax GROUP BY intLocationID
32
+ ) as taxQuery ON taxQuery.intLocationID = tblLocation.intLocationID"
33
+ arr << "LEFT OUTER JOIN tblTax ON tblTax.intLocationID = taxQuery.intLocationID AND tblTax.dteCreatedDate = taxQuery.max_date"
34
+ arr << "LEFT OUTER JOIN tblTaxText ON tblTaxText.intTaxID = tblTax.intTaxID AND tblTaxText.varLocaleID = '#{locale}'"
35
+
36
+ # rental periods
37
+ arr << "LEFT OUTER JOIN (
38
+ SELECT intEntityID, MIN(dteStartDate) as dteMinRentalDate, MAX(dteStartDate) AS dteMaxRentalDate FROM tblRentalCharge GROUP BY intEntityID
39
+ ) AS tblRentalPeriod ON tblRentalPeriod.intEntityID = tblEntity.intEntityID"
25
40
  arr
26
41
  end
27
42
 
@@ -39,7 +39,7 @@ module Toolhound
39
39
  ]
40
40
  }
41
41
 
42
- build_and_query(selects: selects, where: [{int_entity_id: entity_id}])
42
+ build_and_query(selects: selects, where: [{int_entity_id: entity_id}]).first
43
43
  end
44
44
 
45
45
  def find_by_rental_id(id)
@@ -1,3 +1,3 @@
1
1
  module Toolhound
2
- VERSION = "1.0.8"
2
+ VERSION = "1.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toolhound-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Klooth