From 9fa87035716855697f8cf82bf7b64b6289bf6679 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 20 Jul 2021 00:22:17 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 8 +++- .../work-order-item-scheduled-users.vue | 41 +++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 07ed18aa..4504af8c 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -456,10 +456,14 @@ CURRENTLY DOING: more misc stuff below to complete workorder!!! CASES TODO: Some initial workorder cases to do - 583 1: add unit address fields to viz populate but only show them when reportdata selected as UI doesn't consume them - sb under the unit I guess as unit address *viz + 1362 2: convert scheduled user to labor (case is to do en-masse but also I need to implement this individually as well) + need transkey: "WorkOrderConvertAllScheduledUsersToLabor" + + + + 1467 2: text1,text2 etc to show in "Warranty" area of Unit display info (however I have not coded or even thought of / decided on any v7 style warranty info section yet so double case here) 1908 1: set new durationtocompleted field on wo header upon setting to a closed status, also show it in the main data list diff --git a/ayanova/src/components/work-order-item-scheduled-users.vue b/ayanova/src/components/work-order-item-scheduled-users.vue index 4bd85b8a..77036adf 100644 --- a/ayanova/src/components/work-order-item-scheduled-users.vue +++ b/ayanova/src/components/work-order-item-scheduled-users.vue @@ -32,6 +32,17 @@ $ay.t("WorkOrderConvertScheduledUserToLabor") }} + + + $ayiHammer + + {{ + $ay.t("WorkOrderConvertAllScheduledUsersToLabor") + }} + $ayiTrashRestoreAlt @@ -349,6 +360,33 @@ export default { } }, methods: { + convertAllToLabor() { + todo:code this efficiently in conjunction with below + const s = this.value.items[this.activeWoItemIndex].scheduledUsers[ + this.activeItemIndex + ]; + this.value.items[this.activeWoItemIndex].labors.push({ + id: 0, + concurrency: 0, + userId: s.userId, + serviceStartDate: s.startDate, + serviceStopDate: s.stopDate, + serviceRateId: s.serviceRateId, + serviceDetails: null, + serviceRateQuantity: s.estimatedQuantity, + noChargeQuantity: 0, + taxCodeSaleId: null, + price: 0, + priceOverride: null, + isDirty: true, + workOrderItemId: this.value.items[this.activeWoItemIndex].id, + uid: Date.now(), + userViz: s.userViz, + serviceRateViz: s.serviceRateViz, + taxCodeViz: null + }); + this.$emit("change"); + }, convertToLabor() { const s = this.value.items[this.activeWoItemIndex].scheduledUsers[ this.activeItemIndex @@ -681,6 +719,9 @@ export default { }, canDeleteAll: function() { return this.pvm.rights.change && !this.value.userIsRestrictedType; + }, + hasMultipleItems: function() { + return this.value.items[this.activeWoItemIndex].scheduledUsers.length > 1; } } };