This commit is contained in:
2021-02-20 00:31:02 +00:00
parent b218224a0b
commit 827ed22ff1
2 changed files with 46 additions and 21 deletions

View File

@@ -42,13 +42,25 @@ todo: WHEN HAVE WORKORDER FORM customer popup notes need to pop pop pop, forgot
However, I also find that incredibly annoying but I guess that's the point :)
## SERVER MISC ITEMS
todo: In FormFieldReference there are fields that are default Required and can't be hidden, not sure if there is any reason to show them in the customization form
it would be cleaner if they just weren't there at all, definitely in the spirit of more whitespace
investigate if there is any bit of code that relies on them even when not there (maybe datalist grid stuff? not sure)
todo: OOPS, FormFieldReference has a potentially major issue:
RequiredFieldsValidator expects the FieldKey property to be the exact name of the business object property, but I've been just tossing anything in there willy nilly
Go through them all and ensure that the fieldkey is the actual biz property, not made up random nonsense and not the translation key (unless they happen to be identical)
the FieldKey should exactly match the Model definition of that property
todo: child collection items error / rule / customization handling
Currently not supported but should be when get to wo it will be a beast without this
users will need to hide child items, set required on them and see errors from server on them
RESOLUTION:
Add parent collection name to FormFieldReference for child items as a new thing
Update RequiredFieldsValidator to use parent collection name to step through children and flag errors to include parent
Add child collection items to FormFieldReference and set the FieldKey to be in teh form of ParentCollectionName.FieldName
where ParentCollectionName is exactly the same as the Model collection property name and
FieldName is exactly the same as the child collection objects Model property name
Update RequiredFieldsValidator to look for these period seperated items and navigate through teh collection by name / reflection to step through children and flag errors to include parent
e.g in validation error field name could be "poitems.vendorpartnumber:3" to indicate poitems collection 4th row has error in vendorpartnumber
or perhaps it makes sense to add a seperate INDEX property to make client processing easier and not a colon:index scheme in the field name (that actually makes more sense)
Update client form server errors handler to handle indexed child collection like that and report error on row and in popup edit form
Update client form to display error in data table read only display somehow (can't be hover due to mobile so other way)
maybe just red row to indicate has errors with some non color secondary indicator, they open and the edit form shows the exact error on the field
@@ -159,30 +171,27 @@ todo: how to add locale keys in future after release without erasing all data?
CURRENTLY DOING: PurchaseOrder
todo: tax values and totals need to be calced at server and returned with record
put totals in PO header class as nonmapped fields and can calc at server
any update to items or anything really roundtrips to server and back with updated object returned which differs from other objects so need to acct for that.
todo: lots of stuff, but next maybe is the most fundamental stuff like child collection error handling, form customization and required rule handling
if doing that then see up above the SERVER section has the notes on implementation. Think workorder while coding that as the wo will have *many* child collections
PO UI for items:
Use ops-backup form list of backups as concept, it uses a v-data-table
It adapts to mobile view with horizontal card so perfect for that and will work for what I need.
make control column for edit mode and put the delete into the edit mode form as it will be safer there
PO UI for items:
Hidden columns in edit form should also hide in grid display, code it even though there is little to hide here but it could be useful for wo to have that speccd out
Disable sort in addition to filter on the table or take the time to add code to sort correctly because the default sort is pretty shitty and only alphanumeric
Edit mode ideally will not navigate but will open an edit dialog in place which will act on things from within the same form
this gives the impression of having it all at fingertips rather than the delay of navigation
ideally the server should send the text to display along with the items to save triggering multiple round trips
ideally it should display in the displayformat chosen for that picklist type item to mirror functionality, or maybe not to save space just name field etc
Receive all PO form menu item if applicable that just receives the entire PO as is for a shortcut
Receives all outstanding balances to clear them
Receive button on Item edit form to just quickly set received date and quantities
Receive all menu item if applicable that just receives the entire PO now
PO todo
todo: test duplicate route
todo: test inventory affecting ops
reversals, updates, deletes etc
todo: test default tax codes are set
todo: test form customization hide child collection items
also test required rule and server errors display correctly / clear when updated

View File

@@ -373,6 +373,10 @@
v-model="obj.items[editPoItemIndex].receivedDate"
:readonly="formState.readOnly"
ref="receivedDate"
:error-messages="
form().serverErrors(this, 'Items.ReceivedDate')
"
@input="fieldValueChanged('Items.ReceivedDate')"
></gz-date-time-picker>
</v-col>
@@ -414,10 +418,25 @@
:label="$ay.t('TaxCode')"
ref="purchaseTaxCodeId"
data-cy="purchaseTaxCodeId"
:error-messages="
form().serverErrors(this, 'Items.PurchaseTaxCodeId')
"
@input="fieldValueChanged('Items.PurchaseTaxCodeId')"
></gz-pick-list>
</v-col>
<v-col v-if="form().showMe(this, 'PurchaseOrderItemVendorPartNumber')" cols="12" sm="6" lg="4" xl="3">
<v-col
v-if="
form().showMe(
this,
'Items.PurchaseOrderItemVendorPartNumber'
)
"
cols="12"
sm="6"
lg="4"
xl="3"
>
<v-text-field
v-model="obj.items[editPoItemIndex].vendorPartNumber"
:readonly="formState.readOnly"
@@ -426,13 +445,11 @@
:label="$ay.t('PurchaseOrderItemVendorPartNumber')"
ref="vendorPartNumber"
data-cy="vendorPartNumber"
:rules="[form().required(this, 'vendorPartNumber')]"
:error-messages="
form().serverErrors(this, 'Items.VendorPartNumber')
"
@input="fieldValueChanged('Items.VendorPartNumber')"
></v-text-field>
<!-- maybe don't need this in these sub forms as they are all to do with server related errors which isn't currently supportive of indexed collection children :error-messages="
//YAGNI FOR NOW
form().serverErrors(this, 'vendorPartNumber')
" @input="fieldValueChanged('vendorPartNumber')" -->
</v-col>
</v-row>
{{ obj.items[editPoItemIndex] }}
@@ -1214,7 +1231,6 @@ async function fetchTranslatedText(vm) {
"PurchaseOrderReceiptText2",
"PurchaseOrderReceiptItemPurchaseOrderItemID",
"PurchaseOrderItemList",
"PurchaseOrderItemVendorPartNumber",
"PurchaseOrderItemQuantityOrdered",
"PurchaseOrderItemQuantityReceived",
"Part",