From 7e3a964c052f06caf3a8a003dacab60e63395d11 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 30 Jun 2021 22:30:46 +0000 Subject: [PATCH] --- ayanova/devdocs/todo.txt | 18 ++++++++++++++---- ayanova/src/api/translation.js | 1 + ayanova/src/components/work-order-items.vue | 18 ++++++++++++++++++ ayanova/src/views/svc-workorder.vue | 10 +++++----- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 65065742..04ca74f1 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -423,19 +423,29 @@ todo: many biz objects are not using new PUT methodology CURRENTLY DOING: template replacement additions todo: template replacement changes - Mass delete - change Mark for deletion trans key SoftDelete to "Mark selected for deletion" + Mass delete add trans key SoftDeleteAll "Mark *all* for deletion" add code at every level of workorder where there is a mark all to implement mark all for deletion - Duplicate created reset code add routine to reset all loaner and workorderitemparts cost and listprice to zeros + X Duplicate created reset code add routine to reset all loaner and workorderitemparts cost and listprice to zeros they will be filled in by server on first save, so this way it acts like newly added records Dates + do nothing. for now, up to user to manually remove or reset dates, we don't know what the user will want to duplicate for, maybe it's to replace an identical workorder for some reason so we shouldn't mess with it too much automatically Can always add date related features later but for now TTM + + Close case 3897 after this is done +bugbug: can't delete workorder if there is any of the following items on any of it's woitems + woitempart + woitemexpenese + - +bugbug: missing code to delete all items in woitem where it's children get deleted? + see work-order-items.vue delete item and delete all item and undelete item + it's pencilled in for scheduled users only but perhaps it doesn't need any of that because the server handles it. + or maybe it was intended to show that subitems will also be removed?? + perhaps it can be removed entirely?? todo: how to directly open a workorder quickly when you know the wo number?? should be supported, otherwise you need to scroll around a list to find it which is fucked diff --git a/ayanova/src/api/translation.js b/ayanova/src/api/translation.js index e9b9c9d5..5481179c 100644 --- a/ayanova/src/api/translation.js +++ b/ayanova/src/api/translation.js @@ -211,6 +211,7 @@ export default { "SaveACopy", "Delete", "SoftDelete", + "SoftDeleteAll", "Undelete", "Add", "Replace", diff --git a/ayanova/src/components/work-order-items.vue b/ayanova/src/components/work-order-items.vue index f10ec6a1..2ded131f 100644 --- a/ayanova/src/components/work-order-items.vue +++ b/ayanova/src/components/work-order-items.vue @@ -29,6 +29,14 @@ {{ $ay.t("SoftDelete") }} + + + $ayiTrashAlt + + {{ + $ay.t("SoftDeleteAll") + }} + $ayiTrashRestoreAlt @@ -898,6 +906,16 @@ export default { this.setDefaultView(); this.$emit("change"); }, + deleteAllItem() { + this.value.items.forEach(z => (z.deleted = true)); + // //CHILDREN + // this.value.items[this.activeItemIndex].scheduledUsers.forEach( + // z => (z.deleted = true) + // ); + //todo: other grandchildren + this.setDefaultView(); + this.$emit("change"); + }, setDefaultView: function() { //if only one record left then display it otherwise just let the datatable show what the user can click on if (this.value && this.value.items && this.value.items.length == 1) { diff --git a/ayanova/src/views/svc-workorder.vue b/ayanova/src/views/svc-workorder.vue index 70b269b1..f5acd790 100644 --- a/ayanova/src/views/svc-workorder.vue +++ b/ayanova/src/views/svc-workorder.vue @@ -115,17 +115,17 @@ export default { x.id = 0; x.concurrency = undefined; x.isDirty = true; + x.cost = 0; + x.listPrice = 0; }); z.parts.forEach(x => { x.id = 0; x.concurrency = undefined; x.isDirty = true; + x.cost = 0; + x.listPrice = 0; }); - // z.partRequests.forEach(x => { - // x.id = 0; - // x.concurrency = undefined; - // x.isDirty = true; - // }); + z.scheduledUsers.forEach(x => { x.id = 0; x.concurrency = undefined;