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 +4 -4
- data/lib/toolhound-ruby/rental_charge.rb +13 -5
- data/lib/toolhound-ruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ac12c439640a4d377f3e99d31eea0d39565008b
|
4
|
+
data.tar.gz: 44328718e7c6552d5963cfbd28bb4e281907d2f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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"
|
66
|
-
{"inventory.bol_is_active"
|
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
|
71
|
-
wheres << {dte_end_date: {value: [parse_time(from), parse_time(to)], op: :between} } if from
|
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
|
|
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.
|
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-
|
11
|
+
date: 2016-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tiny_tds
|