diff --git a/ayanova/src/components/work-order-item-scheduled-users.vue b/ayanova/src/components/work-order-item-scheduled-users.vue index 77036adf..639f63c9 100644 --- a/ayanova/src/components/work-order-item-scheduled-users.vue +++ b/ayanova/src/components/work-order-item-scheduled-users.vue @@ -33,7 +33,7 @@ }} @@ -360,37 +360,19 @@ 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 + convertAllToLabor() { + this.value.items[this.activeWoItemIndex].scheduledUsers.forEach(z => { + this.doConvertToLabor(z); }); - this.$emit("change"); }, convertToLabor() { - const s = this.value.items[this.activeWoItemIndex].scheduledUsers[ - this.activeItemIndex - ]; + this.doConvertToLabor( + this.value.items[this.activeWoItemIndex].scheduledUsers[ + this.activeItemIndex + ] + ); + }, + doConvertToLabor(s) { this.value.items[this.activeWoItemIndex].labors.push({ id: 0, concurrency: 0,