toolhound-ruby 1.0.21 → 1.0.22

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: e76e663130ee7811082da1112a94dae4c98a6714
4
- data.tar.gz: 8c3bbd5edadc51130fe2b84ec085a88301f3896a
3
+ metadata.gz: 3ac12c439640a4d377f3e99d31eea0d39565008b
4
+ data.tar.gz: 44328718e7c6552d5963cfbd28bb4e281907d2f1
5
5
  SHA512:
6
- metadata.gz: 72bd1f983b5abb00f7fee1fffb56926ae41d4ceb6ce19f0984372e4e301eeb41cf394f0db88c9d5590f197978fac2f537d01795431ed27a2f37a22801a6915c9
7
- data.tar.gz: 9253c072551fe87bc20ff7f25d98e58725222954f499f012106698efe2c3dd57ee9f21efe1eef3b7198b6f5a11fb7920dbe0324816da2fb7e2a14651bb82a2bd
6
+ metadata.gz: 5ffd9081ce59942944a1adf51cabbabf12bb09e312cb1f0f391001fc5b8f8a6ed775ac7f77db371562db2a04a57f2b53037d53fbc63203ee85df5213640c057e
7
+ data.tar.gz: 528b7821fc1a2c360d99ccb02640432940716a28c716dfcca7d70ad67fa7bd862aff906c8f8bcc911e7f6d2d98538f1860f7d9db6effee31b32eec095584a705
@@ -48,7 +48,7 @@ module Toolhound
48
48
 
49
49
  def for_entity_over_period(options)
50
50
  options = (options || {}).dup
51
-
51
+
52
52
  entity_id = options.delete :entity_id
53
53
  from = options.delete :from
54
54
  to = options.delete :to
@@ -60,15 +60,21 @@ module Toolhound
60
60
  joins << "INNER JOIN tblInventoryID ON tblInventoryID.intInventoryIdID = tblRentalCharge.intInventoryIDID"
61
61
  joins << "INNER JOIN tblInventory ON tblInventoryID.intInventoryID = tblInventory.intInventoryID"
62
62
  joins << "INNER JOIN tblInventoryText ON tblInventory.intInventoryID = tblInventoryText.intInventoryID"
63
+ joins << "INNER JOIN tblLocation ON tblLocation.intEntityID = tblRentalCharge.intEntityID"
64
+ joins << "LEFT OUTER JOIN (
65
+ SELECT intLocationID, MAX(tblTax.dteCreatedDate) AS max_date FROM tblTax GROUP BY intLocationID
66
+ ) as taxQuery ON taxQuery.intLocationID = tblLocation.intLocationID"
67
+ joins << "LEFT OUTER JOIN tblTax ON tblTax.intLocationID = taxQuery.intLocationID AND tblTax.dteCreatedDate = taxQuery.max_date"
68
+ joins << "LEFT OUTER JOIN tblTaxText ON tblTaxText.intTaxID = tblTax.intTaxID AND tblTaxText.varLocaleID = '#{locale}'"
63
69
 
64
70
  wheres = [
65
- {"inventory.bol_deleted" => 0},
66
- {"inventory.bol_is_active" => 1},
71
+ {"inventory.bol_deleted" => 0},
72
+ {"inventory.bol_is_active" => 1},
67
73
  {"inventory_text.var_locale_id" => locale},
68
74
  ]
69
75
 
70
- wheres << {"rental_charge.int_entity_id" => entity_id} if entity_id.present?
71
- wheres << {dte_end_date: {value: [parse_time(from), parse_time(to)], op: :between} } if from.present? && to.present?
76
+ wheres << {"rental_charge.int_entity_id" => entity_id} if entity_id
77
+ wheres << {dte_end_date: {value: [parse_time(from), parse_time(to)], op: :between} } if from && to
72
78
 
73
79
 
74
80
  selects = {
@@ -83,6 +89,8 @@ module Toolhound
83
89
  :var_part_no, :var_description, {var_user_field1: :gl_revenue}, {var_user_field2: :gl_cogs_code},
84
90
  {var_user_field3: :phase_code}
85
91
  ],
92
+ tax: [{dec_tax1_rate: :tax_rate}],
93
+ tax_text: [{var_tax1_description: :tax_label}],
86
94
  rental: [:var_rental_number]
87
95
  }
88
96
 
@@ -1,3 +1,3 @@
1
1
  module Toolhound
2
- VERSION = "1.0.21"
2
+ VERSION = "1.0.22"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toolhound-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.21
4
+ version: 1.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Klooth
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-02 00:00:00.000000000 Z
11
+ date: 2016-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tiny_tds