From 213b84cbf32c6d7474f6c1de14a493d09fbbb5aa Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 25 Jan 2022 19:42:24 +0000 Subject: [PATCH] case 4087 --- ayanova/devdocs/todo.txt | 4 +++- ayanova/src/components/pm-item-labors.vue | 24 ++++++++----------- .../components/pm-item-scheduled-users.vue | 24 ++++++++----------- ayanova/src/components/pm-item-travels.vue | 22 ++++++++--------- ayanova/src/components/quote-item-labors.vue | 24 ++++++++----------- .../components/quote-item-scheduled-users.vue | 24 ++++++++----------- ayanova/src/components/quote-item-travels.vue | 22 ++++++++--------- .../work-order-item-scheduled-users.vue | 24 ++++++++----------- 8 files changed, 73 insertions(+), 95 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index e1dad843..b278edc2 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -269,7 +269,9 @@ I've done the *Orders but nothing else other than a quick check of customer, so - 1 todo: Search limited to a type is *not* working, it just returns all results, search from a Customer for example and you will see all object results - +- 1 todo: window.$gz.locale.diffHoursFromUTC8601String is often calculated a total of 1.99 due to some rounding even though the two times look identical + must be seconds or something, needs a round up in those cases, that's weird. To recreate try a start time of 11:21 and end time of 1:21pm which should be two hours but is 1.99 hours + sometimes it just works, I'm guessing it's a milliseconds issue or something, round first maybe to remove ms then calc? - 1 todo: time control in native browser format isn't showing a title at all, check date as well. Date and time is ok - 1 todo: help about does it show user has native date time input use browser override? diff --git a/ayanova/src/components/pm-item-labors.vue b/ayanova/src/components/pm-item-labors.vue index 4c90cb78..c85ca581 100644 --- a/ayanova/src/components/pm-item-labors.vue +++ b/ayanova/src/components/pm-item-labors.vue @@ -910,19 +910,17 @@ export default { if (isNew) { if (globalMinutes != 0) { - //set stop date based on start date and global minutes - this.value.items[this.activeWoItemIndex].labors[ - this.activeItemIndex - ].serviceStopDate = window.$gz.locale.addMinutesToUTC8601String( + dStop = window.$gz.locale.addMinutesToUTC8601String( dStart, globalMinutes ); - + //set stop date based on start date and global minutes this.value.items[this.activeWoItemIndex].labors[ this.activeItemIndex - ].serviceRateQuantity = globalMinutes; + ].serviceStopDate = dStop; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStop != null) { this.value.items[this.activeWoItemIndex].labors[ @@ -940,19 +938,17 @@ export default { if (isNew && dStart == null) { if (globalMinutes != 0) { - //set start date based on stop date and global minutes - this.value.items[this.activeWoItemIndex].labors[ - this.activeItemIndex - ].serviceStartDate = window.$gz.locale.addMinutesToUTC8601String( + dStart = window.$gz.locale.addMinutesToUTC8601String( dStop, 0 - globalMinutes ); - + //set start date based on stop date and global minutes this.value.items[this.activeWoItemIndex].labors[ this.activeItemIndex - ].serviceRateQuantity = globalMinutes; + ].serviceStartDate = dStart; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStart != null) { this.value.items[this.activeWoItemIndex].labors[ diff --git a/ayanova/src/components/pm-item-scheduled-users.vue b/ayanova/src/components/pm-item-scheduled-users.vue index 6f31cdc9..6d853424 100644 --- a/ayanova/src/components/pm-item-scheduled-users.vue +++ b/ayanova/src/components/pm-item-scheduled-users.vue @@ -625,19 +625,17 @@ export default { if (isNew) { if (globalMinutes != 0) { - //set stop date based on start date and global minutes - this.value.items[this.activeWoItemIndex].scheduledUsers[ - this.activeItemIndex - ].stopDate = window.$gz.locale.addMinutesToUTC8601String( + dStop = window.$gz.locale.addMinutesToUTC8601String( dStart, globalMinutes ); - + //set stop date based on start date and global minutes this.value.items[this.activeWoItemIndex].scheduledUsers[ this.activeItemIndex - ].estimatedQuantity = globalMinutes; + ].stopDate = dStop; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStop != null) { this.value.items[this.activeWoItemIndex].scheduledUsers[ @@ -655,19 +653,17 @@ export default { if (isNew && dStart == null) { if (globalMinutes != 0) { - //set start date based on stop date and global minutes - this.value.items[this.activeWoItemIndex].scheduledUsers[ - this.activeItemIndex - ].startDate = window.$gz.locale.addMinutesToUTC8601String( + dStart = window.$gz.locale.addMinutesToUTC8601String( dStop, 0 - globalMinutes ); - + //set start date based on stop date and global minutes this.value.items[this.activeWoItemIndex].scheduledUsers[ this.activeItemIndex - ].estimatedQuantity = globalMinutes; + ].startDate = dStart; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStart != null) { this.value.items[this.activeWoItemIndex].scheduledUsers[ diff --git a/ayanova/src/components/pm-item-travels.vue b/ayanova/src/components/pm-item-travels.vue index 12b8ef19..10fac062 100644 --- a/ayanova/src/components/pm-item-travels.vue +++ b/ayanova/src/components/pm-item-travels.vue @@ -941,19 +941,18 @@ export default { if (isNew) { if (globalMinutes != 0) { - //set stop date based on start date and global minutes - this.value.items[this.activeWoItemIndex].travels[ - this.activeItemIndex - ].travelStopDate = window.$gz.locale.addMinutesToUTC8601String( + dStop = window.$gz.locale.addMinutesToUTC8601String( dStart, globalMinutes ); + //set stop date based on start date and global minutes this.value.items[this.activeWoItemIndex].travels[ this.activeItemIndex - ].travelRateQuantity = globalMinutes; + ].travelStopDate = dStop; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStop != null) { this.value.items[this.activeWoItemIndex].travels[ @@ -971,19 +970,18 @@ export default { if (isNew && dStart == null) { if (globalMinutes != 0) { - //set start date based on stop date and global minutes - this.value.items[this.activeWoItemIndex].travels[ - this.activeItemIndex - ].travelStartDate = window.$gz.locale.addMinutesToUTC8601String( + dStart = window.$gz.locale.addMinutesToUTC8601String( dStop, 0 - globalMinutes ); + //set start date based on stop date and global minutes this.value.items[this.activeWoItemIndex].travels[ this.activeItemIndex - ].travelRateQuantity = globalMinutes; + ].travelStartDate = dStart; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStart != null) { this.value.items[this.activeWoItemIndex].travels[ diff --git a/ayanova/src/components/quote-item-labors.vue b/ayanova/src/components/quote-item-labors.vue index 333be871..23c27a43 100644 --- a/ayanova/src/components/quote-item-labors.vue +++ b/ayanova/src/components/quote-item-labors.vue @@ -911,19 +911,17 @@ export default { if (isNew) { if (globalMinutes != 0) { - //set stop date based on start date and global minutes - this.value.items[this.activeWoItemIndex].labors[ - this.activeItemIndex - ].serviceStopDate = window.$gz.locale.addMinutesToUTC8601String( + dStop = window.$gz.locale.addMinutesToUTC8601String( dStart, globalMinutes ); - + //set stop date based on start date and global minutes this.value.items[this.activeWoItemIndex].labors[ this.activeItemIndex - ].serviceRateQuantity = globalMinutes; + ].serviceStopDate = dStop; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStop != null) { this.value.items[this.activeWoItemIndex].labors[ @@ -941,19 +939,17 @@ export default { if (isNew && dStart == null) { if (globalMinutes != 0) { - //set start date based on stop date and global minutes - this.value.items[this.activeWoItemIndex].labors[ - this.activeItemIndex - ].serviceStartDate = window.$gz.locale.addMinutesToUTC8601String( + dStart = window.$gz.locale.addMinutesToUTC8601String( dStop, 0 - globalMinutes ); - + //set start date based on stop date and global minutes this.value.items[this.activeWoItemIndex].labors[ this.activeItemIndex - ].serviceRateQuantity = globalMinutes; + ].serviceStartDate = dStart; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStart != null) { this.value.items[this.activeWoItemIndex].labors[ diff --git a/ayanova/src/components/quote-item-scheduled-users.vue b/ayanova/src/components/quote-item-scheduled-users.vue index 1b43b53e..35923115 100644 --- a/ayanova/src/components/quote-item-scheduled-users.vue +++ b/ayanova/src/components/quote-item-scheduled-users.vue @@ -625,19 +625,17 @@ export default { if (isNew) { if (globalMinutes != 0) { - //set stop date based on start date and global minutes - this.value.items[this.activeWoItemIndex].scheduledUsers[ - this.activeItemIndex - ].stopDate = window.$gz.locale.addMinutesToUTC8601String( + dStop = window.$gz.locale.addMinutesToUTC8601String( dStart, globalMinutes ); - + //set stop date based on start date and global minutes this.value.items[this.activeWoItemIndex].scheduledUsers[ this.activeItemIndex - ].estimatedQuantity = globalMinutes; + ].stopDate = dStop; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStop != null) { this.value.items[this.activeWoItemIndex].scheduledUsers[ @@ -655,19 +653,17 @@ export default { if (isNew && dStart == null) { if (globalMinutes != 0) { - //set start date based on stop date and global minutes - this.value.items[this.activeWoItemIndex].scheduledUsers[ - this.activeItemIndex - ].startDate = window.$gz.locale.addMinutesToUTC8601String( + dStart = window.$gz.locale.addMinutesToUTC8601String( dStop, 0 - globalMinutes ); - + //set start date based on stop date and global minutes this.value.items[this.activeWoItemIndex].scheduledUsers[ this.activeItemIndex - ].estimatedQuantity = globalMinutes; + ].startDate = dStart; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStart != null) { this.value.items[this.activeWoItemIndex].scheduledUsers[ diff --git a/ayanova/src/components/quote-item-travels.vue b/ayanova/src/components/quote-item-travels.vue index 8de65ebc..b15b962b 100644 --- a/ayanova/src/components/quote-item-travels.vue +++ b/ayanova/src/components/quote-item-travels.vue @@ -941,19 +941,18 @@ export default { if (isNew) { if (globalMinutes != 0) { - //set stop date based on start date and global minutes - this.value.items[this.activeWoItemIndex].travels[ - this.activeItemIndex - ].travelStopDate = window.$gz.locale.addMinutesToUTC8601String( + dStop = window.$gz.locale.addMinutesToUTC8601String( dStart, globalMinutes ); + //set stop date based on start date and global minutes this.value.items[this.activeWoItemIndex].travels[ this.activeItemIndex - ].travelRateQuantity = globalMinutes; + ].travelStopDate = dStop; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStop != null) { this.value.items[this.activeWoItemIndex].travels[ @@ -971,19 +970,18 @@ export default { if (isNew && dStart == null) { if (globalMinutes != 0) { - //set start date based on stop date and global minutes - this.value.items[this.activeWoItemIndex].travels[ - this.activeItemIndex - ].travelStartDate = window.$gz.locale.addMinutesToUTC8601String( + dStart = window.$gz.locale.addMinutesToUTC8601String( dStop, 0 - globalMinutes ); + //set start date based on stop date and global minutes this.value.items[this.activeWoItemIndex].travels[ this.activeItemIndex - ].travelRateQuantity = globalMinutes; + ].travelStartDate = dStart; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStart != null) { this.value.items[this.activeWoItemIndex].travels[ diff --git a/ayanova/src/components/work-order-item-scheduled-users.vue b/ayanova/src/components/work-order-item-scheduled-users.vue index 5c3861eb..033ad4b6 100644 --- a/ayanova/src/components/work-order-item-scheduled-users.vue +++ b/ayanova/src/components/work-order-item-scheduled-users.vue @@ -614,19 +614,17 @@ export default { if (isNew) { if (globalMinutes != 0) { - //set stop date based on start date and global minutes - this.value.items[this.activeWoItemIndex].scheduledUsers[ - this.activeItemIndex - ].stopDate = window.$gz.locale.addMinutesToUTC8601String( + dStop = window.$gz.locale.addMinutesToUTC8601String( dStart, globalMinutes ); - + //set stop date based on start date and global minutes this.value.items[this.activeWoItemIndex].scheduledUsers[ this.activeItemIndex - ].estimatedQuantity = globalMinutes; + ].stopDate = dStop; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStop != null) { this.value.items[this.activeWoItemIndex].scheduledUsers[ @@ -644,19 +642,17 @@ export default { if (isNew && dStart == null) { if (globalMinutes != 0) { - //set start date based on stop date and global minutes - this.value.items[this.activeWoItemIndex].scheduledUsers[ - this.activeItemIndex - ].startDate = window.$gz.locale.addMinutesToUTC8601String( + dStart = window.$gz.locale.addMinutesToUTC8601String( dStop, 0 - globalMinutes ); - + //set start date based on stop date and global minutes this.value.items[this.activeWoItemIndex].scheduledUsers[ this.activeItemIndex - ].estimatedQuantity = globalMinutes; + ].startDate = dStart; } - } else { + } + { //Existing record or both dates filled, just update quantity if (dStart != null) { this.value.items[this.activeWoItemIndex].scheduledUsers[