From 9d4fbb70d75601024d91c300ec9b4b86c8d9d8c3 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Sat, 27 Feb 2021 01:49:13 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 33 ++-- ayanova/src/components/data-table.vue | 72 +++++++-- .../components/extension-delete-control.vue | 5 +- .../components/extension-export-control.vue | 6 +- .../extension-restock-po-control.vue | 145 ++++++++++++++++++ .../src/components/extension-tags-control.vue | 7 +- ayanova/src/components/extensions-control.vue | 5 +- ayanova/src/views/inv-part-restocks.vue | 8 + 8 files changed, 251 insertions(+), 30 deletions(-) create mode 100644 ayanova/src/components/extension-restock-po-control.vue diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 77adb415..fca67acd 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -14,6 +14,9 @@ todo: poitem edit form currency fields when updated by server on save lose curre maybe currency control does not respond to underlying data changes it didn't initiate? seems maybe it's ok in main form but that's maybe just because it doesn't change values automatically +todo: datatable single select mode, is this even a thing? + if not then I should remove that code, it's just taking up space and complicating shit for no reason + todo: acc-service-bank is using a decimal control instead of a currency control for currency field todo: Unit override warranty lifetime active should disable or even hide "override length" field todo: OverrideLifetime is bad text, fix it, key is "UnitOverrideLifeTime" and maybe it just says "Life time warranty" @@ -25,7 +28,7 @@ todo: inconsistent use of browser language and browser languages and some are using the entire array In some cases array will work, in others it requires single need to check into this and be consistent or understand what's happening - I'm guessing we favor languages as it seems to be accepted by whatever is using it and it will work better if the first one is unsupported + I'm guessing I favor languages as it seems to be accepted by whatever is using it and it will work better if the first one is unsupported todo: locale.js look into this: // also for sake of future proofing and edge cases need to have it be manually settable as well @@ -85,11 +88,11 @@ todo: actual Customer report with names populated TODO: for reporting this would be more ideal if it populated the displayName fields //I'm doing that in this object already by fluke, and don't really want to populate them always and in other objects but for reporting maybe //have a report mode get or I guess just do it all here (but then need for export as well, but then again this is the way it gets for export via getreportdata) - //so perhaps we have a REPORT format of a biz object model and that format has display names mirroring all the fields + //so perhaps I have a REPORT format of a biz object model and that format has display names mirroring all the fields //it's fetching it here anyway, might as well do the whole shebang? So, bottom line might be an alternate ReportModel (e.g. Customer / ReportCustomer) with display fields (not the model sent to the client during normal work as that would eat up bandwidth unnecessarily) Stop thinking about efficiency too much, this is a time to waste a few cycles but make a much easier to work with data return for reports / export - All display fields are populated as is done with PO similarly and that is done *in* get report data because that's also the export route use too which fits nicely with what we want + All display fields are populated as is done with PO similarly and that is done *in* get report data because that's also the export route use too which fits nicely with what I want Make it work with Customer then backport to all the extant objects and add to item migrate todo list below as a step so it doesn't get missed in future ones @@ -114,7 +117,7 @@ todo: v8 migrate additions message doesn't clearly say that number was exported already is there a way to still export them? Is it possible to login during migrate to the v8 server? - Need a running count per item, we have the total at the start so it should show what item it is currently processing of that count like 50/1000 or something + Need a running count per item, I have the total at the start so it should show what item it is currently processing of that count like 50/1000 or something @@ -170,13 +173,9 @@ todo: how to add locale keys in future after release without erasing all data? CURRENTLY DOING: PurchaseOrder - restock required -todo: if poitem has woitempartrequest (is a part request) - quantity can not be any different than the requested amount, that entire line item must be dedicated to the part request which makes - restock reports etc much easier to handle - -todo: on order committed must be taken into account - poitem with woitem is entirely for wo - does not go into calcs for restock at all, so need to adjust to filter OUT poitem with woitempartrequest values + +todo: currently working on datatable to emit full row selections since there is no ID to select items in restocklist as it has no id + maybe a materialized view would but I want live data only todo: restock required feature Next step is to create an extension to copy to existing or new workorder for selected items @@ -186,7 +185,9 @@ todo: restock required feature not going to do this inside the po itself same process for part requests as well - +todo: if poitem has woitempartrequest (is a part request) + quantity can not be any different than the requested amount, that entire line item must be dedicated to the part request which makes + restock reports etc much easier to handle @@ -194,7 +195,7 @@ todo: MIGRATE_OUTSTANDING note for part requests feature maybe add UI button etc for it even with no actual list / form or whatever 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 - Research this method and how we can work with it and give it a good think because it maybe a dangerous thing to expose or just fuckery + Research this method and how I can work with it and give it a good think because it maybe a dangerous thing to expose or just fuckery it really only will be of use in rare circumstances and most likely when importing v7 with oddball numbers (Scott?) 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) @@ -764,7 +765,7 @@ todo: ONGOING search for memory leaks @@@@@@@@@@@@@@@ ROADMAP STAGE 7 - EXTENSIONS (was plugins) @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -Step 1: get the current active license count for all extensions so we know what we're dealing with here +Step 1: get the current active license count for all extensions so I know what i'm dealing with here Step 2: which extensions in which order and some can be left off entirely? Plan the order of criticality for extensions @@ -791,7 +792,7 @@ Plan the order of criticality for extensions todo: setup for automated trial testing ability so can just link users Maybe, rather than having seperate servers for testing, have it instead generate a User account on the fly for each user who wants to trial Automatically re-create the data on a cycle of some kind - Needs warning message about being a shared instance of AyaNova so be careful what you type and also you may see things other people typed that we have no control over + Needs warning message about being a shared instance of AyaNova so be careful what you type and also you may see things other people typed that I have no control over todo: WINDOWS INSTALLER Runner harness wrapper thing? @@ -886,7 +887,7 @@ Another payment processor? DONATE Send a tip / buy a coffee link to the graphic designer who made the rabbit logo follow the link from the docs appendix open source acknowledgements page - if we use it in release we should at least send them the small amount they get tipped + if I use it in release I should at least send them the small amount they get tipped Send a tip / donate to teh favicon generator guy https://realfavicongenerator.net/ diff --git a/ayanova/src/components/data-table.vue b/ayanova/src/components/data-table.vue index 0918961a..16ca5142 100644 --- a/ayanova/src/components/data-table.vue +++ b/ayanova/src/components/data-table.vue @@ -451,6 +451,10 @@ export default { type: Boolean, default: false }, + selectReturnColumns: { + type: Array, + default: null + }, reload: { type: Boolean, default: false @@ -655,16 +659,66 @@ export default { }; }, handleSelectChange() { - //due to making own template for items need to handle singleselect which only affects if select all checkbox at top is visible when making own item template - if (this.singleSelect) { - this.selected.splice(0, this.selected.length - 1); - } - //emit event to parent form of selected rows + if ( + this.selectReturnColumns != null && + this.selectReturnColumns.length > 0 + ) { + //todo: here need to check if calling form has asked for a template of certain fields instead of row id's + //and emit that as objects instead + //i.e. restock list provides selectReturnTemplate array of field key names: + // ['PartPartNumber','PartWarehouseName','PartWholesalerID','PartAlternativeWholesalerID','PartManufacturerID','PartByWarehouseInventoryReorderQuantity'] + //select then saves exactly those columns into the selection instead of id's + //returns the id and name values or basically anything in that column ready for ease of use by extensions like partrestock extension which needs display and id values both + //maybe need to rename selectedRowIds if it can fit within that system too. - this.$emit( - "selection-change", - this.selected.map(z => z.id) - ); + console.log("handleselectchange templated", { + selected: this.selected, + headers: this.headers + }); + +//build a map of column numbers that correspond with template fk names +/* +arrays of objects like this, fk corresponds to field template, value columns.cx equals actual column we need, text may be useful too save a translation to send it maybe? +align: "start"​​​ +fk: "PartPartNumber"​​​ +flt: true​​​ +text: "Part Number"​​​ +value: "columns.c0" +*/ +//iterate the selected items which are like below, i is id number of record, t is type maybe useful, v is display value, key is only useless thing, maybe just strip the key and send the rest? +/* +c0: {…}​​​​​ +i: 3​​​​​ +key: "0-0"​​​​​ +t: 4​​​​​ +v: "017368" +*/ + +//return array like this: +/* +todo: work this out, array of arrays I guess?? +[ +{ + fk:"PartPartNumber", + text:"Part number", + i: 3, + t: 4, + v: "01768" +} +*/ + + } else { + //due to making own template for items need to handle singleselect which only affects if select all checkbox at top is visible when making own item template + if (this.singleSelect) { + this.selected.splice(0, this.selected.length - 1); + } + //emit event to parent form of selected rows + + this.$emit( + "selection-change", + this.selected.map(z => z.id) + ); + } }, editColumnView() { this.$router.push({ diff --git a/ayanova/src/components/extension-delete-control.vue b/ayanova/src/components/extension-delete-control.vue index 5ee270ee..76ead0b3 100644 --- a/ayanova/src/components/extension-delete-control.vue +++ b/ayanova/src/components/extension-delete-control.vue @@ -28,7 +28,10 @@ export default { let vm = this; await fetchTranslatedText(vm); //NOTE: if extension doesn't support a particular object add it here to the NoType default - if (vm.dataListSelection.ObjectType != 0) { + if ( + vm.dataListSelection.ObjectType != 0 && + vm.dataListSelection.ObjectType != window.$gz.type.PartInventoryRestock + ) { vm.rights = window.$gz.role.getRights(vm.dataListSelection.ObjectType); } vm.available = vm.rights.change; diff --git a/ayanova/src/components/extension-export-control.vue b/ayanova/src/components/extension-export-control.vue index c00a7bf6..27aeac5e 100644 --- a/ayanova/src/components/extension-export-control.vue +++ b/ayanova/src/components/extension-export-control.vue @@ -26,7 +26,11 @@ export default { }), methods: { available() { - return this.dataListSelection.ObjectType != 0; + return ( + this.dataListSelection.ObjectType != 0 && + this.dataListSelection.ObjectType != + window.$gz.type.PartInventoryRestock + ); }, goHelp() { window.open(this.$store.state.helpUrl + "ay-ex-export", "_blank"); diff --git a/ayanova/src/components/extension-restock-po-control.vue b/ayanova/src/components/extension-restock-po-control.vue new file mode 100644 index 00000000..b7357f21 --- /dev/null +++ b/ayanova/src/components/extension-restock-po-control.vue @@ -0,0 +1,145 @@ + + diff --git a/ayanova/src/components/extension-tags-control.vue b/ayanova/src/components/extension-tags-control.vue index 7e9d20f1..a69a9a08 100644 --- a/ayanova/src/components/extension-tags-control.vue +++ b/ayanova/src/components/extension-tags-control.vue @@ -44,8 +44,11 @@ export default { created() { let vm = this; - //NOTE: if extension doesn't support a particular object add it here to the NoType default - if (vm.dataListSelection.ObjectType != 0) { + + if ( + vm.dataListSelection.ObjectType != 0 && + vm.dataListSelection.ObjectType != window.$gz.type.PartInventoryRestock + ) { vm.rights = window.$gz.role.getRights(vm.dataListSelection.ObjectType); } vm.available = vm.rights.change; diff --git a/ayanova/src/components/extensions-control.vue b/ayanova/src/components/extensions-control.vue index c5ad2e83..013f4410 100644 --- a/ayanova/src/components/extensions-control.vue +++ b/ayanova/src/components/extensions-control.vue @@ -28,6 +28,7 @@ @ext-show-job-log="handleError($event)" :data-list-selection="dataListSelection" /> + @@ -42,11 +43,13 @@ import ExtensionTags from "./extension-tags-control.vue"; import ExtensionExport from "./extension-export-control.vue"; import ExtensionDelete from "./extension-delete-control.vue"; +import ExtensionRestockPo from "./extension-restock-po-control.vue"; export default { components: { ExtensionTags, ExtensionExport, - ExtensionDelete + ExtensionDelete, + ExtensionRestockPo }, async created() { await initForm(this); diff --git a/ayanova/src/views/inv-part-restocks.vue b/ayanova/src/views/inv-part-restocks.vue index 68a00829..bf72b865 100644 --- a/ayanova/src/views/inv-part-restocks.vue +++ b/ayanova/src/views/inv-part-restocks.vue @@ -12,6 +12,14 @@ form-key="part-restocks" data-list-key="PartRestockDataList" :show-select="rights.read" + :select-return-columns="[ + 'PartPartNumber', + 'PartWarehouseName', + 'PartWholesalerID', + 'PartAlternativeWholesalerID', + 'PartManufacturerID', + 'PartByWarehouseInventoryReorderQuantity' + ]" :reload="reload" @selection-change="handleSelected" data-cy="partRestocksTable"