SuggestedQuantity field added to pm and wo item parts

This commit is contained in:
2021-11-09 18:24:12 +00:00
parent 2bcb576cc2
commit 540643f544
2 changed files with 25 additions and 0 deletions

View File

@@ -22,6 +22,19 @@
<v-list-item-title>{{ $ay.t("New") }}</v-list-item-title>
</v-list-item>
<v-list-item
v-if="hasData && canAdd"
@click="realizeSuggestedParts"
data-cy="woItemRealizeSuggestedParts"
>
<!-- <v-list-item-icon>
<v-icon>$ayiPlus</v-icon>
</v-list-item-icon> -->
<v-list-item-title>{{
$ay.t("WorkOrderItemPartRealizeSuggested")
}}</v-list-item-title>
</v-list-item>
<v-list-item
v-if="hasData && hasSelection && canAdd"
@click="copyItemDialog = true"
@@ -1058,6 +1071,17 @@ export default {
this.setDefaultView();
this.$emit("change");
},
realizeSuggestedParts() {
this.value.items.forEach(z => {
z.parts.forEach(part => {
if (part.quantity == 0 && part.suggestedQuantity > 0) {
part.quantity = part.suggestedQuantity;
part.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 && this.value.items && this.value.items.length == 1) {

View File

@@ -2300,6 +2300,7 @@ async function fetchTranslatedText(vm) {
"WorkOrderItemPartPartWarehouseID",
"WorkOrderItemPartQuantity",
"WorkOrderItemPartSuggestedQuantity",
"WorkOrderItemPartRealizeSuggested",
"WorkOrderItemPartTaxPartSaleID",
"WorkOrderItemPartPartID",
"WorkOrderItemPartRequestList",