This commit is contained in:
2021-05-27 00:01:46 +00:00
parent 9c2b25930b
commit 5dd024b0b2
2 changed files with 161 additions and 144 deletions

View File

@@ -346,6 +346,7 @@ CURRENTLY DOING: loaners
ORDER: loans, units, outside service, then post and test remotely all devices, then back to refinement todo's below and cases ORDER: loans, units, outside service, then post and test remotely all devices, then back to refinement todo's below and cases
todo: seeder stock data / translations: loanunit "Units" have extraneous "rate" in them, i.e. "Hourly rate", sb just "Hourly"
todo: LoanUnit edit form add "*Cost" fields to UI todo: LoanUnit edit form add "*Cost" fields to UI
todo: part request todo: part request
link to open po, delete button in grid? both? link to open po, delete button in grid? both?

View File

@@ -6,7 +6,7 @@
<template v-slot:activator="{ on, attrs }"> <template v-slot:activator="{ on, attrs }">
<div class="text-h6"> <div class="text-h6">
<v-icon large color="primary" class="mr-2">$ayiBoxes</v-icon> <v-icon large color="primary" class="mr-2">$ayiBoxes</v-icon>
{{ $ay.t("WorkOrderItemPartList") }} {{ $ay.t("WorkOrderItemLoanList") }}
<v-btn v-if="!parentDeleted" large icon v-bind="attrs" v-on="on"> <v-btn v-if="!parentDeleted" large icon v-bind="attrs" v-on="on">
<v-icon small color="primary">$ayiEllipsisV</v-icon> <v-icon small color="primary">$ayiEllipsisV</v-icon>
</v-btn> </v-btn>
@@ -48,7 +48,7 @@
disable-filtering disable-filtering
disable-sort disable-sort
hide-default-footer hide-default-footer
data-cy="partsTable" data-cy="loansTable"
dense dense
:item-class="itemRowClasses" :item-class="itemRowClasses"
@click:row="handleRowClick" @click:row="handleRowClick"
@@ -69,7 +69,7 @@
> >
<v-col <v-col
v-if="form().showMe(this, 'WorkOrderItemPartQuantity')" v-if="form().showMe(this, 'WorkOrderItemLoanQuantity')"
cols="12" cols="12"
sm="6" sm="6"
lg="4" lg="4"
@@ -77,33 +77,33 @@
> >
<gz-decimal <gz-decimal
v-model=" v-model="
value.items[activeWoItemIndex].parts[activeItemIndex].quantity value.items[activeWoItemIndex].loans[activeItemIndex].quantity
" "
:readonly="formState.readOnly || isDeleted" :readonly="formState.readOnly || isDeleted"
:disabled="isDeleted" :disabled="isDeleted"
:label="$ay.t('WorkOrderItemPartQuantity')" :label="$ay.t('WorkOrderItemLoanQuantity')"
:ref=" :ref="
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].quantity` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].quantity`
" "
data-cy="partQuantity" data-cy="loanQuantity"
:error-messages=" :error-messages="
form().serverErrors( form().serverErrors(
this, this,
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].quantity` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].quantity`
) )
" "
:rules="[ :rules="[
form().decimalValid( form().decimalValid(
this, this,
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].quantity` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].quantity`
), ),
form().required( form().required(
this, this,
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].quantity` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].quantity`
) )
]" ]"
@input=" @input="
fieldValueChanged(`Items[${activeWoItemIndex}].parts[ fieldValueChanged(`Items[${activeWoItemIndex}].loans[
${activeItemIndex} ${activeItemIndex}
].quantity`) ].quantity`)
" "
@@ -111,70 +111,70 @@
</v-col> </v-col>
<v-col <v-col
v-if="form().showMe(this, 'WorkOrderItemPartPartID')" v-if="form().showMe(this, 'WorkOrderItemLoanLoanID')"
cols="12" cols="12"
sm="6" sm="6"
lg="4" lg="4"
xl="3" xl="3"
> >
<gz-pick-list <gz-pick-list
:aya-type="$ay.ayt().Part" :aya-type="$ay.ayt().Loan"
:show-edit-icon="true" :show-edit-icon="true"
v-model=" v-model="
value.items[activeWoItemIndex].parts[activeItemIndex].partId value.items[activeWoItemIndex].loans[activeItemIndex].loanId
" "
:readonly="formState.readOnly || isDeleted" :readonly="formState.readOnly || isDeleted"
:disabled="isDeleted" :disabled="isDeleted"
:label="$ay.t('WorkOrderItemPartPartID')" :label="$ay.t('WorkOrderItemLoanLoanID')"
:ref=" :ref="
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].partId` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanId`
" "
data-cy="parts.partId" data-cy="loans.loanId"
:error-messages=" :error-messages="
form().serverErrors( form().serverErrors(
this, this,
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].partId` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanId`
) )
" "
@input=" @input="
fieldValueChanged( fieldValueChanged(
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].partId` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanId`
) )
" "
@update:name="partChange" @update:name="loanChange"
></gz-pick-list> ></gz-pick-list>
</v-col> </v-col>
<v-col <v-col
v-if="form().showMe(this, 'WorkOrderItemPartPartWarehouseID')" v-if="form().showMe(this, 'WorkOrderItemLoanLoanWarehouseID')"
cols="12" cols="12"
sm="6" sm="6"
lg="4" lg="4"
xl="3" xl="3"
> >
<gz-pick-list <gz-pick-list
:aya-type="$ay.ayt().PartWarehouse" :aya-type="$ay.ayt().LoanWarehouse"
:show-edit-icon="true" :show-edit-icon="true"
v-model=" v-model="
value.items[activeWoItemIndex].parts[activeItemIndex] value.items[activeWoItemIndex].loans[activeItemIndex]
.partWarehouseId .loanWarehouseId
" "
:readonly="formState.readOnly || isDeleted" :readonly="formState.readOnly || isDeleted"
:disabled="isDeleted" :disabled="isDeleted"
:label="$ay.t('WorkOrderItemPartPartWarehouseID')" :label="$ay.t('WorkOrderItemLoanLoanWarehouseID')"
:ref=" :ref="
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].partWarehouseId` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanWarehouseId`
" "
data-cy="parts.partWarehouseId" data-cy="loans.loanWarehouseId"
:error-messages=" :error-messages="
form().serverErrors( form().serverErrors(
this, this,
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].partWarehouseId` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanWarehouseId`
) )
" "
@input=" @input="
fieldValueChanged( fieldValueChanged(
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].partWarehouseId` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].loanWarehouseId`
) )
" "
@update:name="warehouseChange" @update:name="warehouseChange"
@@ -182,7 +182,7 @@
</v-col> </v-col>
<v-col <v-col
v-if="form().showMe(this, 'WorkOrderItemPartDescription')" v-if="form().showMe(this, 'WorkOrderItemLoanDescription')"
cols="12" cols="12"
sm="6" sm="6"
lg="4" lg="4"
@@ -190,23 +190,23 @@
> >
<v-text-field <v-text-field
v-model=" v-model="
value.items[activeWoItemIndex].parts[activeItemIndex].description value.items[activeWoItemIndex].loans[activeItemIndex].description
" "
:readonly="formState.readOnly || isDeleted" :readonly="formState.readOnly || isDeleted"
:disabled="isDeleted" :disabled="isDeleted"
:label="$ay.t('WorkOrderItemPartDescription')" :label="$ay.t('WorkOrderItemLoanDescription')"
:ref=" :ref="
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].description` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].description`
" "
data-cy="partQuantity" data-cy="loanQuantity"
:error-messages=" :error-messages="
form().serverErrors( form().serverErrors(
this, this,
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].description` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].description`
) )
" "
@input=" @input="
fieldValueChanged(`Items[${activeWoItemIndex}].parts[ fieldValueChanged(`Items[${activeWoItemIndex}].loans[
${activeItemIndex} ${activeItemIndex}
].description`) ].description`)
" "
@@ -214,7 +214,7 @@
</v-col> </v-col>
<v-col <v-col
v-if="form().showMe(this, 'WorkOrderItemPartTaxPartSaleID')" v-if="form().showMe(this, 'WorkOrderItemLoanTaxLoanSaleID')"
cols="12" cols="12"
sm="6" sm="6"
lg="4" lg="4"
@@ -224,25 +224,25 @@
:aya-type="$ay.ayt().TaxCode" :aya-type="$ay.ayt().TaxCode"
:show-edit-icon="true" :show-edit-icon="true"
v-model=" v-model="
value.items[activeWoItemIndex].parts[activeItemIndex] value.items[activeWoItemIndex].loans[activeItemIndex]
.taxPartSaleId .taxLoanSaleId
" "
:readonly="formState.readOnly || isDeleted" :readonly="formState.readOnly || isDeleted"
:disabled="isDeleted" :disabled="isDeleted"
:label="$ay.t('WorkOrderItemPartTaxPartSaleID')" :label="$ay.t('WorkOrderItemLoanTaxLoanSaleID')"
:ref=" :ref="
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].taxPartSaleId` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].taxLoanSaleId`
" "
data-cy="partTaxCodeSaleId" data-cy="loanTaxCodeSaleId"
:error-messages=" :error-messages="
form().serverErrors( form().serverErrors(
this, this,
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].taxPartSaleId` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].taxLoanSaleId`
) )
" "
@input=" @input="
fieldValueChanged( fieldValueChanged(
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].taxPartSaleId` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].taxLoanSaleId`
) )
" "
@update:name="taxCodeChange" @update:name="taxCodeChange"
@@ -250,7 +250,7 @@
</v-col> </v-col>
<v-col <v-col
v-if="form().showMe(this, 'PartPriceOverride')" v-if="form().showMe(this, 'LoanPriceOverride')"
cols="12" cols="12"
sm="6" sm="6"
lg="4" lg="4"
@@ -258,7 +258,7 @@
> >
<gz-currency <gz-currency
v-model=" v-model="
value.items[activeWoItemIndex].parts[activeItemIndex] value.items[activeWoItemIndex].loans[activeItemIndex]
.priceOverride .priceOverride
" "
can-clear can-clear
@@ -266,33 +266,33 @@
:disabled="isDeleted" :disabled="isDeleted"
:label="$ay.t('PriceOverride')" :label="$ay.t('PriceOverride')"
:ref=" :ref="
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].priceOverride` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].priceOverride`
" "
data-cy="partpriceoverride" data-cy="loanpriceoverride"
:error-messages=" :error-messages="
form().serverErrors( form().serverErrors(
this, this,
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].priceOverride` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].priceOverride`
) )
" "
:rules="[ :rules="[
form().decimalValid( form().decimalValid(
this, this,
`Items[${activeWoItemIndex}].parts[${activeItemIndex}].priceOverride` `Items[${activeWoItemIndex}].loans[${activeItemIndex}].priceOverride`
) )
]" ]"
@input=" @input="
fieldValueChanged(`Items[${activeWoItemIndex}].parts[ fieldValueChanged(`Items[${activeWoItemIndex}].loans[
${activeItemIndex} ${activeItemIndex}
].priceOverride`) ].priceOverride`)
" "
></gz-currency> ></gz-currency>
</v-col> </v-col>
<v-col v-if="form().showMe(this, 'WorkOrderItemPartSerials')" cols="12"> <v-col v-if="form().showMe(this, 'WorkOrderItemLoanSerials')" cols="12">
<v-textarea <v-textarea
v-model=" v-model="
value.items[activeWoItemIndex].parts[activeItemIndex].serials value.items[activeWoItemIndex].loans[activeItemIndex].serials
" "
:readonly="formState.readOnly" :readonly="formState.readOnly"
:disabled="isDeleted" :disabled="isDeleted"
@@ -300,19 +300,19 @@
:error-messages=" :error-messages="
form().serverErrors( form().serverErrors(
this, this,
`Items[${activeWoItemIndex}].parts[ `Items[${activeWoItemIndex}].loans[
${activeItemIndex} ${activeItemIndex}
].serials` ].serials`
) )
" "
:ref=" :ref="
`Items[${activeWoItemIndex}].parts[ `Items[${activeWoItemIndex}].loans[
${activeItemIndex} ${activeItemIndex}
].serials` ].serials`
" "
data-cy="partSerials" data-cy="loanSerials"
@input=" @input="
fieldValueChanged(`Items[${activeWoItemIndex}].parts[ fieldValueChanged(`Items[${activeWoItemIndex}].loans[
${activeItemIndex} ${activeItemIndex}
].serials`) ].serials`)
" "
@@ -348,7 +348,7 @@ l.Add(new FormField { TKey = "TaxAAmt", FieldKey = "LoanTaxAViz", TKeySection =
l.Add(new FormField { TKey = "TaxBAmt", FieldKey = "LoanTaxBViz", TKeySection = "WorkOrderItemLoans" }); l.Add(new FormField { TKey = "TaxBAmt", FieldKey = "LoanTaxBViz", TKeySection = "WorkOrderItemLoans" });
l.Add(new FormField { TKey = "LineTotal", FieldKey = "LoanLineTotalViz", TKeySection = "WorkOrderItemLoans" }); l.Add(new FormField { TKey = "LineTotal", FieldKey = "LoanLineTotalViz", TKeySection = "WorkOrderItemLoans" });
{ {
"0": { "0": {## Item, rate, quantity, loaned,due, returned,notes, $$$ FIELDS
"id": 31, "id": 31,
"concurrency": 8125060, "concurrency": 8125060,
"notes": null, "notes": null,
@@ -408,33 +408,33 @@ export default {
}, },
methods: { methods: {
warehouseChange(newName) { warehouseChange(newName) {
this.value.items[this.activeWoItemIndex].parts[ this.value.items[this.activeWoItemIndex].loans[
this.activeItemIndex this.activeItemIndex
].partWarehouseViz = newName; ].loanWarehouseViz = newName;
}, },
partChange(newName) { loanChange(newName) {
this.value.items[this.activeWoItemIndex].parts[ this.value.items[this.activeWoItemIndex].loans[
this.activeItemIndex this.activeItemIndex
].partViz = newName; ].loanViz = newName;
}, },
taxCodeChange(newName) { taxCodeChange(newName) {
this.value.items[this.activeWoItemIndex].parts[ this.value.items[this.activeWoItemIndex].loans[
this.activeItemIndex this.activeItemIndex
].taxPartSaleViz = newName; ].taxLoanSaleViz = newName;
}, },
newItem() { newItem() {
let newIndex = this.value.items[this.activeWoItemIndex].parts.length; let newIndex = this.value.items[this.activeWoItemIndex].loans.length;
this.value.items[this.activeWoItemIndex].parts.push({ this.value.items[this.activeWoItemIndex].loans.push({
id: 0, id: 0,
concurrency: 0, concurrency: 0,
userId: null, userId: null,
description: null, description: null,
serials: null, serials: null,
partId: null, loanId: null,
partWarehouseId: null, loanWarehouseId: null,
quantity: 1, quantity: 1,
taxPartSaleId: null, taxLoanSaleId: null,
price: 0, price: 0,
priceOverride: null, priceOverride: null,
cost: 0, cost: 0,
@@ -448,13 +448,13 @@ export default {
this.activeItemIndex = newIndex; this.activeItemIndex = newIndex;
}, },
unDeleteItem() { unDeleteItem() {
this.value.items[this.activeWoItemIndex].parts[ this.value.items[this.activeWoItemIndex].loans[
this.activeItemIndex this.activeItemIndex
].deleted = false; ].deleted = false;
this.setDefaultView(); this.setDefaultView();
}, },
deleteItem() { deleteItem() {
this.value.items[this.activeWoItemIndex].parts[ this.value.items[this.activeWoItemIndex].loans[
this.activeItemIndex this.activeItemIndex
].deleted = true; ].deleted = true;
this.setDefaultView(); this.setDefaultView();
@@ -462,7 +462,7 @@ export default {
}, },
setDefaultView: function() { setDefaultView: function() {
//if only one record left then display it otherwise just let the datatable show what the user can click on //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) { if (this.value.items[this.activeWoItemIndex].loans.length == 1) {
this.selectedRow = [{ index: 0 }]; this.selectedRow = [{ index: 0 }];
this.activeItemIndex = 0; this.activeItemIndex = 0;
} else { } else {
@@ -480,7 +480,7 @@ export default {
fieldValueChanged(ref) { fieldValueChanged(ref) {
if (!this.formState.loading && !this.formState.readonly) { if (!this.formState.loading && !this.formState.readonly) {
//flag this record dirty so it gets picked up by save //flag this record dirty so it gets picked up by save
this.value.items[this.activeWoItemIndex].parts[ this.value.items[this.activeWoItemIndex].loans[
this.activeItemIndex this.activeItemIndex
].isDirty = true; ].isDirty = true;
window.$gz.form.fieldValueChanged(this.pvm, ref); window.$gz.form.fieldValueChanged(this.pvm, ref);
@@ -489,12 +489,12 @@ export default {
itemRowClasses: function(item) { itemRowClasses: function(item) {
let ret = ""; let ret = "";
const isDeleted = const isDeleted =
this.value.items[this.activeWoItemIndex].parts[item.index].deleted === this.value.items[this.activeWoItemIndex].loans[item.index].deleted ===
true; true;
const hasError = this.form().childRowHasError( const hasError = this.form().childRowHasError(
this, this,
`Items[${this.activeWoItemIndex}].Parts[${item.index}].` `Items[${this.activeWoItemIndex}].Loans[${item.index}].`
); );
if (isDeleted) { if (isDeleted) {
@@ -510,14 +510,14 @@ export default {
computed: { computed: {
isDeleted: function() { isDeleted: function() {
if ( if (
this.value.items[this.activeWoItemIndex].parts[this.activeItemIndex] == this.value.items[this.activeWoItemIndex].loans[this.activeItemIndex] ==
null null
) { ) {
this.setDefaultView(); this.setDefaultView();
return true; return true;
} }
return ( return (
this.value.items[this.activeWoItemIndex].parts[this.activeItemIndex] this.value.items[this.activeWoItemIndex].loans[this.activeItemIndex]
.deleted === true .deleted === true
); );
}, },
@@ -532,63 +532,63 @@ export default {
*/ */
let headers = []; let headers = [];
if (this.form().showMe(this, "WorkOrderItemPartPartID")) { if (this.form().showMe(this, "WorkOrderItemLoanUnit")) {
headers.push({ headers.push({
text: this.$ay.t("WorkOrderItemPartPartID"), text: this.$ay.t("WorkOrderItemLoanUnit"),
align: "left", align: "left",
value: "partViz" value: "loanUnitViz"
}); });
} }
if (this.form().showMe(this, "WorkOrderItemPartPartWarehouseID")) { if (this.form().showMe(this, "WorkOrderItemLoanRate")) {
headers.push({ headers.push({
text: this.$ay.t("WorkOrderItemPartPartWarehouseID"), text: this.$ay.t("WorkOrderItemLoanRate"),
align: "left",
value: "partWarehouseViz"
});
}
if (this.form().showMe(this, "WorkOrderItemPartQuantity")) {
headers.push({
text: this.$ay.t("WorkOrderItemPartQuantity"),
align: "right",
value: "quantity"
});
}
if (this.form().showMe(this, "PartUPC")) {
headers.push({
text: this.$ay.t("PartUPC"),
align: "left",
value: "upcViz"
});
}
if (this.form().showMe(this, "WorkOrderItemPartDescription")) {
headers.push({
text: this.$ay.t("WorkOrderItemPartDescription"),
align: "left",
value: "description"
});
}
if (this.form().showMe(this, "WorkOrderItemPartSerials")) {
headers.push({
text: this.$ay.t("PurchaseOrderItemSerialNumbers"),
align: "left",
value: "serials"
});
}
if (this.form().showMe(this, "PartUnitOfMeasureViz")) {
headers.push({
text: this.$ay.t("UnitOfMeasure"),
align: "left", align: "left",
value: "unitOfMeasureViz" value: "unitOfMeasureViz"
}); });
} }
if (this.form().showMe(this, "PartCost")) { if (this.form().showMe(this, "WorkOrderItemLoanQuantity")) {
headers.push({
text: this.$ay.t("WorkOrderItemLoanQuantity"),
align: "right",
value: "quantity"
});
}
if (this.form().showMe(this, "WorkOrderItemLoanOutDate")) {
headers.push({
text: this.$ay.t("WorkOrderItemLoanOutDate"),
align: "right",
value: "outDate"
});
}
if (this.form().showMe(this, "WorkOrderItemLoanDueDate")) {
headers.push({
text: this.$ay.t("WorkOrderItemLoanDueDate"),
align: "right",
value: "dueDate"
});
}
if (this.form().showMe(this, "WorkOrderItemLoanReturnDate")) {
headers.push({
text: this.$ay.t("WorkOrderItemLoanReturnDate"),
align: "right",
value: "returnDate"
});
}
if (this.form().showMe(this, "WorkOrderItemLoanNotes")) {
headers.push({
text: this.$ay.t("WorkOrderItemLoanNotes"),
align: "left",
value: "notes"
});
}
if (this.form().showMe(this, "LoanCost")) {
headers.push({ headers.push({
text: this.$ay.t("Cost"), text: this.$ay.t("Cost"),
align: "right", align: "right",
@@ -596,7 +596,7 @@ export default {
}); });
} }
if (this.form().showMe(this, "PartListPrice")) { if (this.form().showMe(this, "LoanListPrice")) {
headers.push({ headers.push({
text: this.$ay.t("ListPrice"), text: this.$ay.t("ListPrice"),
align: "right", align: "right",
@@ -604,7 +604,7 @@ export default {
}); });
} }
if (this.form().showMe(this, "PartPriceOverride")) { if (this.form().showMe(this, "LoanPriceOverride")) {
headers.push({ headers.push({
text: this.$ay.t("PriceOverride"), text: this.$ay.t("PriceOverride"),
align: "right", align: "right",
@@ -612,7 +612,7 @@ export default {
}); });
} }
if (this.form().showMe(this, "PartPriceViz")) { if (this.form().showMe(this, "LoanPriceViz")) {
headers.push({ headers.push({
text: this.$ay.t("Price"), text: this.$ay.t("Price"),
align: "right", align: "right",
@@ -620,15 +620,15 @@ export default {
}); });
} }
if (this.form().showMe(this, "WorkOrderItemPartTaxPartSaleID")) { if (this.form().showMe(this, "WorkOrderItemLoanTaxCodeID")) {
headers.push({ headers.push({
text: this.$ay.t("Tax"), text: this.$ay.t("Tax"),
align: "left", align: "left",
value: "taxPartSaleViz" value: "taxCodeViz"
}); });
} }
if (this.form().showMe(this, "PartNetViz")) { if (this.form().showMe(this, "LoanNetViz")) {
headers.push({ headers.push({
text: this.$ay.t("NetPrice"), text: this.$ay.t("NetPrice"),
align: "right", align: "right",
@@ -636,7 +636,7 @@ export default {
}); });
} }
if (this.form().showMe(this, "PartTaxAViz")) { if (this.form().showMe(this, "LoanTaxAViz")) {
headers.push({ headers.push({
text: this.$ay.t("TaxAAmt"), text: this.$ay.t("TaxAAmt"),
align: "right", align: "right",
@@ -644,7 +644,7 @@ export default {
}); });
} }
if (this.form().showMe(this, "PartTaxBViz")) { if (this.form().showMe(this, "LoanTaxBViz")) {
headers.push({ headers.push({
text: this.$ay.t("TaxBAmt"), text: this.$ay.t("TaxBAmt"),
align: "right", align: "right",
@@ -652,7 +652,7 @@ export default {
}); });
} }
if (this.form().showMe(this, "PartLineTotalViz")) { if (this.form().showMe(this, "LoanLineTotalViz")) {
headers.push({ headers.push({
text: this.$ay.t("LineTotal"), text: this.$ay.t("LineTotal"),
align: "right", align: "right",
@@ -662,20 +662,36 @@ export default {
return headers; return headers;
}, },
itemList: function() { itemList: function() {
return this.value.items[this.activeWoItemIndex].parts.map((x, i) => { return this.value.items[this.activeWoItemIndex].loans.map((x, i) => {
return { return {
index: i, index: i,
id: x.id, id: x.id,
partViz: x.partViz, loanUnitViz: x.loanUnitViz,
partWarehouseViz: x.partWarehouseViz, unitOfMeasureViz: x.unitOfMeasureViz,
quantity: window.$gz.locale.decimalLocalized( quantity: window.$gz.locale.decimalLocalized(
x.quantity, x.quantity,
this.pvm.languageName this.pvm.languageName
), ),
upcViz: x.upcViz, outDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
description: x.description, x.outDate,
serials: window.$gz.util.truncateString(x.serials, 50), this.pvm.timeZoneName,
unitOfMeasureViz: x.unitOfMeasureViz, this.pvm.languageName,
this.pvm.hour12
),
dueDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
x.dueDate,
this.pvm.timeZoneName,
this.pvm.languageName,
this.pvm.hour12
),
returnDate: window.$gz.locale.utcDateToShortDateAndTimeLocalized(
x.returnDate,
this.pvm.timeZoneName,
this.pvm.languageName,
this.pvm.hour12
),
notes: window.$gz.util.truncateString(x.notes, 50),
cost: window.$gz.locale.currencyLocalized( cost: window.$gz.locale.currencyLocalized(
x.cost, x.cost,
this.pvm.languageName, this.pvm.languageName,
@@ -691,7 +707,7 @@ export default {
this.pvm.languageName, this.pvm.languageName,
this.pvm.currencyName this.pvm.currencyName
), ),
taxPartSaleViz: x.taxPartSaleViz, taxCodeViz: x.taxCodeViz,
priceOverride: window.$gz.locale.currencyLocalized( priceOverride: window.$gz.locale.currencyLocalized(
x.priceOverride, x.priceOverride,
this.pvm.languageName, this.pvm.languageName,
@@ -727,16 +743,16 @@ export default {
return this.pvm.formCustomTemplateKey; return this.pvm.formCustomTemplateKey;
}, },
showTable: function() { showTable: function() {
return this.value.items[this.activeWoItemIndex].parts.length > 1; return this.value.items[this.activeWoItemIndex].loans.length > 1;
}, },
canAdd: function() { canAdd: function() {
return this.pvm.rights.change && this.pvm.subRights.parts.create; return this.pvm.rights.change && this.pvm.subRights.loans.create;
}, },
canDelete: function() { canDelete: function() {
return ( return (
this.activeItemIndex != null && this.activeItemIndex != null &&
this.pvm.rights.change && this.pvm.rights.change &&
this.pvm.subRights.parts.delete this.pvm.subRights.loans.delete
); );
} }
//---- //----