SuggestedQuantity field added to pm and wo item parts
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -2300,6 +2300,7 @@ async function fetchTranslatedText(vm) {
|
||||
"WorkOrderItemPartPartWarehouseID",
|
||||
"WorkOrderItemPartQuantity",
|
||||
"WorkOrderItemPartSuggestedQuantity",
|
||||
"WorkOrderItemPartRealizeSuggested",
|
||||
"WorkOrderItemPartTaxPartSaleID",
|
||||
"WorkOrderItemPartPartID",
|
||||
"WorkOrderItemPartRequestList",
|
||||
|
||||
Reference in New Issue
Block a user