projector_pws 0.1.12 → 0.1.13
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 +4 -4
- data/LICENSE.txt +1 -1
- data/lib/projector_pws/version.rb +1 -1
- data/lib/projector_pws.rb +12 -2
- data/projector_pws.gemspec +2 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a71a8759a76f14373d291c3fd0c9e74ef3c46f4
|
4
|
+
data.tar.gz: a261e7110d7b3cb975cddfca78ae1a694a91710b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24ea19fb4d9189d41a97ef9cb99a327f80f75fe3c4f921b5863808ded0dce5130931703a03e30b23365da1a791e3207ae2633fbed453e028d42c527fc88d32ae
|
7
|
+
data.tar.gz: e15a9ea7a6027a982d506f78342f46033c76b92e487b7a1ba7d23f44d63059fe69b03fadf90b07128564943c61f354b670c3319f02476c67664bde6cb3c04306
|
data/LICENSE.txt
CHANGED
data/lib/projector_pws.rb
CHANGED
@@ -269,8 +269,9 @@ module ProjectorPWS
|
|
269
269
|
# Get active hours
|
270
270
|
active_hours = get_resource_active_hours c, ticket, resource, start_date, end_date
|
271
271
|
|
272
|
-
# Compute time off into active hours
|
272
|
+
# Compute time off and holidays into active hours
|
273
273
|
active_hours = active_hours - scheduled_hours[:toff]
|
274
|
+
active_hours = active_hours - scheduled_hours[:hday]
|
274
275
|
|
275
276
|
# Compute free time (active unscheduled time)
|
276
277
|
active_hours - scheduled_hours[:work]
|
@@ -307,6 +308,11 @@ module ProjectorPWS
|
|
307
308
|
time_off = [time_off] unless time_off.is_a? Array
|
308
309
|
time_off.compact!
|
309
310
|
|
311
|
+
# Extract Holidays
|
312
|
+
holidays = sched[:holidays][:pws_schedule_holiday] rescue []
|
313
|
+
holidays = [holidays] unless holidays.is_a? Array
|
314
|
+
holidays.compact!
|
315
|
+
|
310
316
|
# Run through time off { collect total minutes }
|
311
317
|
time_off_minutes = time_off.inject(0) do |a, e|
|
312
318
|
|
@@ -319,6 +325,9 @@ module ProjectorPWS
|
|
319
325
|
a + dates.inject(0) { |da, de| da + time_off_minutes(de[:time_off_minutes].to_i) }
|
320
326
|
end
|
321
327
|
|
328
|
+
# Run through Holidays { collect total minutes }
|
329
|
+
holiday_minutes = holidays.reject { |e| e[:date] < start_date || e[:date] > end_date || e[:date].saturday? || e[:date].sunday? }.inject(0) { |a, e| a + time_off_minutes(e[:time_off_minutes].to_i) }
|
330
|
+
|
322
331
|
# Run through schedule { collect total minutes }
|
323
332
|
scheduled_minutes = sched_work.inject(0) do |a, e|
|
324
333
|
|
@@ -333,7 +342,8 @@ module ProjectorPWS
|
|
333
342
|
|
334
343
|
{
|
335
344
|
work: scheduled_minutes.to_f / MINUTES_PER_HOUR.to_f,
|
336
|
-
toff: time_off_minutes.to_f / MINUTES_PER_HOUR.to_f
|
345
|
+
toff: time_off_minutes.to_f / MINUTES_PER_HOUR.to_f,
|
346
|
+
hday: holiday_minutes.to_f / MINUTES_PER_HOUR.to_f
|
337
347
|
}
|
338
348
|
end
|
339
349
|
|
data/projector_pws.gemspec
CHANGED
@@ -6,8 +6,8 @@ require 'projector_pws/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = 'projector_pws'
|
8
8
|
spec.version = ProjectorPWS::VERSION
|
9
|
-
spec.authors = ['
|
10
|
-
spec.email = ['
|
9
|
+
spec.authors = ['Paul DUNCAN']
|
10
|
+
spec.email = ['pduncan@openwt.com']
|
11
11
|
|
12
12
|
spec.summary = 'Projector PWS Client Library'
|
13
13
|
spec.description = 'Provides access to Projector PSA\'s Web Services (PWS)'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: projector_pws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
-
-
|
7
|
+
- Paul DUNCAN
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-02-
|
11
|
+
date: 2018-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -82,7 +82,7 @@ dependencies:
|
|
82
82
|
version: '0'
|
83
83
|
description: Provides access to Projector PSA's Web Services (PWS)
|
84
84
|
email:
|
85
|
-
-
|
85
|
+
- pduncan@openwt.com
|
86
86
|
executables: []
|
87
87
|
extensions: []
|
88
88
|
extra_rdoc_files: []
|