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("WorkOrderItemPartRealizeSuggested")
+ }}
+
+
{{ $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") }}
-
+
0 &&
!this.value.userIsRestrictedType
);
+ },
+ showRealizeSuggestedPartsInItem: function() {
+ return (
+ this.activeItemIndex != null &&
+ this.canAddPart &&
+ this.hasData &&
+ this.value.items[this.activeItemIndex].parts.length > 0 &&
+ this.value.items[this.activeItemIndex].parts.some(z => {
+ return z.suggestedQuantity > 0;
+ })
+ );
}
},
watch: {