This commit is contained in:
2021-02-27 01:49:13 +00:00
parent 3250ccfe09
commit 9d4fbb70d7
8 changed files with 251 additions and 30 deletions

View File

@@ -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/

View File

@@ -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({

View File

@@ -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;

View File

@@ -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");

View File

@@ -0,0 +1,145 @@
<template>
<v-expansion-panel v-if="available() == true">
<v-expansion-panel-header
disable-icon-rotate
expand-icon="$ayiTruckLoading"
>{{ $ay.t("Order restock items") }}</v-expansion-panel-header
>
<v-expansion-panel-content>
<v-row>
<v-col cols="12">
PurchaseOrderUICopyToPurchaseOrder po selector (variant open ones only
or maybe they type the number???) or create new here
{{ dataListSelection }}
</v-col>
</v-row>
<v-btn icon @click="goHelp()"><v-icon>$ayiQuestionCircle</v-icon></v-btn>
<v-btn
:disabled="!canDoAction()"
color="blue darken-1"
text
@click="doAction()"
:loading="jobActive"
>{{ $ay.t("StartJob") }}</v-btn
>
</v-expansion-panel-content>
</v-expansion-panel>
</template>
<script>
export default {
async created() {
let vm = this;
await fetchTranslatedText(vm);
if (vm.dataListSelection.ObjectType != 0) {
vm.rights = window.$gz.role.getRights(vm.dataListSelection.ObjectType);
}
},
data: () => ({
jobActive: false,
rights: window.$gz.role.defaultRightsObject()
}),
methods: {
goHelp() {
window.open(this.$store.state.helpUrl + "ay-ex-restock-po", "_blank");
},
available() {
return (
this.dataListSelection.ObjectType ==
window.$gz.type.PartInventoryRestock
);
},
canDoAction() {
return true;
},
async doAction() {
let vm = this;
//probably dont' need a prompt, can always delete off po anyway to reverse this
// let dialogResult = await window.$gz.dialog.confirmGeneric(
// "EraseMultipleObjectsWarning",
// "error"
// );
// if (dialogResult == false) {
// return;
// }
//Clear any possible prior errors
vm.$emit("ext-show-job-log", "clear");
//do the batch action
let url = "purchase-order/batch-add-restock";
let body = this.dataListSelection;
try {
//call api route
let jobId = await window.$gz.api.upsert(url, body);
if (jobId.error) {
//throw new Error(jobId.error);
throw new Error(window.$gz.errorHandler.errorToString(jobId, vm));
}
jobId = jobId.jobId; //it's in a sub key
//indicate loading by setting on button
vm.jobActive = true;
/* /// <summary>
/// Job status for opsjobs
/// </summary>
public enum JobStatus : int
{
Absent=0,
Sleeping = 1,
Running = 2,
Completed = 3,
Failed = 4
} */
let jobStatus = 1;
//get status
while (vm.jobActive == true) {
await window.$gz.util.sleepAsync(1000);
//check if done
jobStatus = await window.$gz.api.get(
`job-operations/status/${jobId}`
);
if (jobStatus.error) {
throw new Error(
window.$gz.errorHandler.errorToString(jobStatus, vm)
);
}
jobStatus = jobStatus.data;
if (jobStatus == 4 || jobStatus == 0) {
if (jobStatus == 4) {
//emit job id and event to parent for log viewing
vm.$emit("ext-show-job-log", jobId);
}
throw new Error("Job failed");
}
if (jobStatus == 3) {
vm.jobActive = false;
}
}
//Here if it's completed successfully
window.$gz.eventBus.$emit("notify-success", vm.$ay.t("JobCompleted"));
vm.$emit("ext-close-refresh");
} catch (error) {
vm.jobActive = false;
//window.$gz.errorHandler.handleFormError(error, vm);
window.$gz.eventBus.$emit("notify-error", vm.$ay.t("JobFailed"));
}
}
},
props: {
dataListSelection: { type: Object, default: null }
}
};
//////////////////////////////////////////////////////////
//
// Ensures UI translated text is available
//
async function fetchTranslatedText(vm) {
await window.$gz.translation.cacheTranslations([
"PurchaseOrderUICopyToPurchaseOrder"
]);
}
</script>

View File

@@ -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;

View File

@@ -28,6 +28,7 @@
@ext-show-job-log="handleError($event)"
:data-list-selection="dataListSelection"
/>
<ExtensionRestockPo :data-list-selection="dataListSelection" />
</v-expansion-panels>
</v-card-text>
<v-card-actions>
@@ -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);

View File

@@ -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"