toolhound-ruby 1.0.16 → 1.0.17
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/base.rb +4 -0
- data/lib/toolhound-ruby/rental_charge.rb +10 -3
- data/lib/toolhound-ruby/transaction.rb +1 -1
- 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: 53126038ede3803fb0ae8de7c4ad8a0f8664bba8
|
4
|
+
data.tar.gz: 2e9847e4abe3aa0986cfd4253e52a098feca87ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9b9406b193741830c11e7d68d11975eda1958b4a9d4a8f74c4987dcb0fdd4e60150e781db3c5ec65a1c27beb2e27da4289696107d65e4d852b0a4df4e90df24
|
7
|
+
data.tar.gz: bfe4e05305086edc36c6ae96c48fd4140e11ac53635e3748cd3542e4b606389b5addeea619093615c7764743e45e44bf32c702a2173467aeb35b96b5c58df642
|
data/lib/toolhound-ruby/base.rb
CHANGED
@@ -46,7 +46,11 @@ module Toolhound
|
|
46
46
|
all(where: [{"rental_detail.int_rental_id" => id}])
|
47
47
|
end
|
48
48
|
|
49
|
-
def for_entity_over_period(
|
49
|
+
def for_entity_over_period(options)
|
50
|
+
entity_id = options.delete :entity_id
|
51
|
+
from = options.delete :from
|
52
|
+
to = options.delete :to
|
53
|
+
|
50
54
|
joins = []
|
51
55
|
joins << "LEFT OUTER JOIN tblRentalItem ON tblRentalItem.intRentalItemID = tblRentalCharge.intRentalItemID"
|
52
56
|
joins << "LEFT OUTER JOIN tblRentalDetail ON tblRentalDetail.intRentalDetailID = tblRentalItem.intRentalDetailID"
|
@@ -56,12 +60,15 @@ module Toolhound
|
|
56
60
|
joins << "INNER JOIN tblInventoryText ON tblInventory.intInventoryID = tblInventoryText.intInventoryID"
|
57
61
|
|
58
62
|
wheres = [
|
59
|
-
{"rental_charge.int_entity_id" => entity_id},
|
60
63
|
{"inventory.bol_deleted" => 0},
|
61
64
|
{"inventory.bol_is_active" => 1},
|
62
65
|
{"inventory_text.var_locale_id" => locale},
|
63
|
-
{dte_end_date: {value: [from, to], op: :between} }
|
64
66
|
]
|
67
|
+
|
68
|
+
wheres << {"rental_charge.int_entity_id" => entity_id} if entity_id.present?
|
69
|
+
wheres << {dte_end_date: {value: [parse_time(from), parse_time(to)], op: :between} } if from.present? && to.present?
|
70
|
+
|
71
|
+
|
65
72
|
selects = {
|
66
73
|
rental_charge: [
|
67
74
|
:int_rental_charge_id, :int_entity_id, :int_qty, :dec_total, :var_type, :int_inventory_id_id,
|
@@ -93,7 +93,7 @@ module Toolhound
|
|
93
93
|
wheres = []
|
94
94
|
wheres << {"transaction_type.bol_return" => 'true'}
|
95
95
|
|
96
|
-
wheres << {"transaction.int_entity_id" => entity_id} if entity_id
|
96
|
+
wheres << {"transaction.int_entity_id" => entity_id} if entity_id.present?
|
97
97
|
wheres << "tblTransaction.dteTransactionDate BETWEEN '#{parse_time(from_date)}' AND '#{parse_time(to_date)}'" if from_date && to_date
|
98
98
|
wheres << "(tblReturnStatus.bolCreateWO = 1 OR tblReturnStatus.bolRetire = 1)" if damaged_only == true
|
99
99
|
|
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.17
|
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-02-
|
11
|
+
date: 2016-02-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tiny_tds
|