From 0f9fdd748560370f786c78d6d384c8ec5aa5aca5 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Fri, 11 Feb 2022 01:23:05 +0000 Subject: [PATCH] case 4112 --- ayanova/devdocs/todo.txt | 1 + .../src/components/work-order-item-parts.vue | 31 +++++++++++++++++++ ayanova/src/components/work-order-items.vue | 13 +++++++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 64106195..35c2b89a 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -907,6 +907,7 @@ BUILD 8.0.0-beta.0.14 CHANGES OF NOTE - case 4108 fixed - case 4109 closed - case 4110 bumped +- Restricted workorder users no longer offered "Realize suggested part quantities" diff --git a/ayanova/src/components/work-order-item-parts.vue b/ayanova/src/components/work-order-item-parts.vue index a25ee653..17d9c1d5 100644 --- a/ayanova/src/components/work-order-item-parts.vue +++ b/ayanova/src/components/work-order-item-parts.vue @@ -28,6 +28,16 @@ {{ $ay.t("New") }} + {{ $ay.t("PartAssembly") }} + $ayiTrashRestoreAlt @@ -830,6 +841,15 @@ export default { }, canDeleteAll: function() { return this.pvm.rights.change && !this.value.userIsRestrictedType; + }, + showRealizeSuggestedPartsInParts: function() { + return ( + this.activeItemIndex != null && + this.hasData && + this.canAdd && + this.value.items[this.activeWoItemIndex].parts[this.activeItemIndex] + .suggestedQuantity > 0 + ); } //---- @@ -1115,6 +1135,17 @@ export default { this.setDefaultView(); this.$emit("change"); }, + realizeSuggestedParts() { + let p = this.value.items[this.activeWoItemIndex].parts[ + this.activeItemIndex + ]; + if (p.quantity == 0 && p.suggestedQuantity > 0) { + p.quantity = p.suggestedQuantity; + p.isDirty = true; + } + + this.$emit("change"); + }, setDefaultView: function() { //if only one record left then display it otherwise just let the datatable show what the user can click on if (this.value.items[this.activeWoItemIndex].parts.length == 1) { diff --git a/ayanova/src/components/work-order-items.vue b/ayanova/src/components/work-order-items.vue index d5c676b8..1250cafe 100644 --- a/ayanova/src/components/work-order-items.vue +++ b/ayanova/src/components/work-order-items.vue @@ -55,7 +55,7 @@ {{ $ay.t("Undelete") }} -