This commit is contained in:
2021-02-23 18:23:14 +00:00
parent c4c444d582
commit fe9bbc4018
3 changed files with 102 additions and 35 deletions

View File

@@ -175,7 +175,8 @@ todo: lots of stuff, but next maybe is the most fundamental stuff like child col
PO UI for items:
NEW ITEM button in po list header
NEW ITEM button in po item edit form (so can just keep entering)
Edit mode ideally will not navigate but will open an edit dialog in place which will act on things from within the same form
Receive all PO form menu item if applicable that just receives the entire PO as is for a shortcut
@@ -191,11 +192,14 @@ todo: test default tax codes are set
todo: test form customization hide child collection items
todo: test required rule and server errors display correctly / clear in both poitems table row and in edit form for poitem when opened
make up fake rules if necessary just to confirm the new child collection error handling works
todo: test new from scratch po
todo: test read only form of PO
todo: test reports, tagging etc
todo: can edit po number but if I set an existing po number 4 to 23 for example and the last autogenerated is 22 it will happily make another 23 so there are now two
what I want to happen is it skips existing numbers
not many serialized objects, maybe a utility to do wahtever, renumbering with them could be done for just that purpose entirely
(along with resetting the autoid number)
Does this require a special role?

View File

@@ -33,7 +33,7 @@ async function dealWithError(msg, vm) {
// eslint-disable-next-line no-console
console.error(errMsg);
//debugger;
debugger;
}
//If a form instance was provided (vue instance)

View File

@@ -246,7 +246,7 @@
<template v-slot:top>
<v-col cols="12">
<v-menu offset-y v-if="rights.change && obj.hasUnreceived">
<v-menu offset-y v-if="rights.change">
<template v-slot:activator="{ on, attrs }">
<span class="text-h6">
{{ $ay.t("PurchaseOrderItemList") }}</span
@@ -255,7 +255,19 @@
</v-btn>
</template>
<v-list>
<v-list-item @click="receiveAll">
<v-list-item @click="newPOItem">
<v-list-item-icon>
<v-icon>$ayiPlus</v-icon>
</v-list-item-icon>
<v-list-item-title>{{
$ay.t("New")
}}</v-list-item-title>
</v-list-item>
<v-divider></v-divider>
<v-list-item
@click="receiveAll"
:disabled="!obj.hasUnreceived"
>
<v-list-item-icon>
<v-icon>$ayiBoxOpen</v-icon>
</v-list-item-icon>
@@ -450,6 +462,10 @@
form().decimalValid(this, 'Items.ReceivedCost'),
form().required(this, 'Items.ReceivedCost')
]"
:error-messages="
form().serverErrors(this, 'Items.ReceivedCost')
"
@input="fieldValueChanged('Items.ReceivedCost')"
></gz-currency>
</v-col>
@@ -801,36 +817,6 @@ export default {
},
itemList: function() {
let vm = this;
/*
"items": [
{
"id": 1,
"concurrency": 7281388,
"purchaseOrderId": 1,
"partId": 18,
"partWarehouseId": 2,
"quantityOrdered": 28,
"quantityReceived": 28,
"purchaseOrderCost": 10.8204,
"receivedCost": 10,
"receivedDate": "2021-01-16T13:49:59.346006Z",
"partRequestedById": null,
"workorderItemPartRequestId": null,
"purchaseTaxCodeId": 3,
"vendorPartNumber": null,
"displayPartNumber": "733980",
"displayWarehouse": "WHS- Carlotta Hollow",
"displayRequestUser": null,
"displayRequestWorkorder": null,
"displayTaxCode": "Sales & Goods",
"displayNetTotal": 302.9712,
"displayTaxA": 21.207984,
"displayTaxB": 21.207984,
"displayLineTotal": 345.387168
},
*/
return vm.obj.items.map((x, i) => {
return {
index: i,
@@ -902,11 +888,34 @@ export default {
receiveAll: function() {
let vm = this;
this.obj.items.forEach(item => receiveItem(item, vm));
//set status to all received fwiw
this.obj.status = 5;
},
editItem: function(item) {
this.editPoItemIndex = item.index;
this.editPoItemDialog = true;
},
newPOItem: function() {
this.obj.items.push({
id: 0,
purchaseOrderId: 0,
partId: null,
partWarehouseId: 1,
quantityOrdered: 1,
quantityReceived: 0,
purchaseOrderCost: 0,
receivedCost: 0.0,
receivedDate: null,
partRequestedById: null,
workorderItemPartRequestId: null,
purchaseTaxCodeId:
window.$gz.store.state.globalSettings.defaultTaxPartPurchaseId,
vendorPartNumber: null
});
this.editPoItemIndex = this.obj.items.length - 1;
this.editPoItemDialog = true;
},
canSave: function() {
return this.formState.valid && this.formState.dirty;
},
@@ -1344,4 +1353,58 @@ async function fetchTranslatedText(vm) {
"PurchaseOrderCustom16"
]);
}
/* {
data: {
id: 4,
concurrency: 7343586,
serial: 4,
notes: "Eius tenetur magnam nostrum qui doloribus velit.",
wiki: null,
customFields: null,
tags: ["black", "green", "zebra", "zone0"],
vendorMemo: "Et quis eaque repellat.",
dropShipToCustomerId: null,
referenceNumber: "578929",
vendorId: 2,
orderedDate: "2020-05-03T07:57:42.014786Z",
expectedReceiveDate: "2020-05-08T07:57:42.014786Z",
status: 2,
projectId: null,
text1: "Natus pariatur.",
text2: "Provident repudiandae nobis et.",
items: [
{
id: 15,
concurrency: 7343586,
purchaseOrderId: 4,
partId: 13,
partWarehouseId: 2,
quantityOrdered: 65.0,
quantityReceived: 0.0,
purchaseOrderCost: 15.6812,
receivedCost: 0.0,
receivedDate: null,
partRequestedById: null,
workorderItemPartRequestId: null,
purchaseTaxCodeId: 3,
vendorPartNumber: "man-695831",
displayPartNumber: "695831",
displayWarehouse: "WHS- Lera Brook",
displayRequestUser: null,
displayRequestWorkorder: null,
displayTaxCode: "Sales & Goods",
displayNetTotal: 1019.278,
displayTaxA: 71.34946,
displayTaxB: 71.34946,
displayLineTotal: 1161.97692
}
],
hasSelectableWarehouses: true,
hasPartRequest: false,
hasTaxes: true,
hasReceipt: false,
hasVendorNumber: true,
hasUnreceived: true
}
};*/
</script>