diff --git a/ayanova/devdocs/todo.txt b/ayanova/devdocs/todo.txt index 63ef4cf8..a94e93f6 100644 --- a/ayanova/devdocs/todo.txt +++ b/ayanova/devdocs/todo.txt @@ -58,11 +58,18 @@ todo: v8 migrate additions ## CLIENT MISC ITEMS - -todo: acc-service-bank is using a decimal control instead of a currency control for currency field todo: partassembly form should use an edit dialog rather than edit in place in the grid as it's ugly and clunky and outside of the standard that will be used in PO and wo etc copy from Contract form and use it's technique for immediate viz value sync event +todo: Parts, fractional values?? should anywhere a quantity of part show be a decimal control and if so then should show no trailing zeros like v7? + The correct thing to do is ensure decimal numbers if entered display localized anywhere so bearing that in mind.... + (in v7 if you enter 1 it displays as 1 not 1.00, if you enter 1.25 then it displays as 1.25) + right now kind of using a mish mash where in some areas quantities are just raw numbers because I'm testing with integer values for things like parts so no seeing this + but if I force to use decimalLocalized then there are always 2 digits even when it's just .00 which is sort of ugly but sort of not ugly if they use that a lot in which case it would visually line up in grids + not sure what is the best way, maybe a setting? I do see there is a minimum digits for this Intl.NumberFormat(languageName, {minimumFractionDigits: 2}).format(value); + so maybe there's a setting to handle this gracefully?? + If so then I need to look back at any place showing fractional values potentially and ensure it's all standardized whatever way + todo: should user required rule (defined in form custom settings) show a variation of the required error message so that it's clear *they* defined it and they can unset it in customize? right now they could set a required rule, forget they set it then email us to bitch that it shouldn't be required todo: reports need duration display helper diff --git a/ayanova/src/main.js b/ayanova/src/main.js index 5f35b8a0..fa68ecde 100644 --- a/ayanova/src/main.js +++ b/ayanova/src/main.js @@ -247,6 +247,9 @@ Vue.prototype.$ay = { cur: function(value) { return locale.currencyLocalized(value); }, + dec: function(value) { + return locale.decimalLocalized(value); + }, util: function() { return gzutil; } diff --git a/ayanova/src/views/inv-part-assembly.vue b/ayanova/src/views/inv-part-assembly.vue index 63ba56fe..a11b8ce1 100644 --- a/ayanova/src/views/inv-part-assembly.vue +++ b/ayanova/src/views/inv-part-assembly.vue @@ -18,69 +18,48 @@ > - - - + + + {{ $ay.t("PartList") }} + $ayiPlus + + + + + + + + @@ -254,7 +351,9 @@ export default { }, rights: window.$gz.role.defaultRightsObject(), ayaType: window.$gz.type.PartAssembly, - selectedPart: null + selectedPart: null, + editItemDialog: false, + editItemIndex: 0 }; }, //WATCHERS @@ -293,45 +392,59 @@ export default { }, methods: { - sortedList: function() { - function compare(a, b) { - if (a.partViz < b.partViz) return -1; - if (a.partViz > b.partViz) return 1; - return 0; - } - - return this.obj.items.slice().sort(compare); - }, addItem: function() { - let vm = this; - let selected = vm.$refs.partId.getFullSelectionValue(); - if (selected == null || selected.id == null) { - return; - } - let index = vm.obj.items.findIndex(z => z.partId == selected.id); - if (index != -1) { - //already in the list - return; - } + this.editItemIndex = + this.obj.items.push({ + id: 0, + partAssemblyId: this.obj.id, + partId: null + }) - 1; - vm.obj.items.push({ - partAssemblyId: vm.obj.id, - partId: selected.id, - partViz: selected.name, - quantity: 1 - }); + this.editItemDialog = true; + this.formState.dirty = true; + }, + editItem: function(index) { + this.editItemIndex = index; + this.editItemDialog = true; + }, + deleteItem: function() { + this.editItemDialog = false; + this.obj.items.splice(this.editItemIndex, 1); + this.editItemIndex = -1; + this.formState.dirty = true; + }, + // editItem: function() {}, + // addItem: function() { + // let vm = this; + // let selected = vm.$refs.partId.getFullSelectionValue(); + // if (selected == null || selected.id == null) { + // return; + // } + // let index = vm.obj.items.findIndex(z => z.partId == selected.id); + // if (index != -1) { + // //already in the list + // return; + // } + + // vm.obj.items.push({ + // partAssemblyId: vm.obj.id, + // partId: selected.id, + // partViz: selected.name, + // quantity: 1 + // }); + + // vm.formState.dirty = true; + // }, + // removeItem: function(item) { + // let vm = this; + // let index = vm.obj.items.findIndex(z => z.partId == item.partId); + // if (index == -1) { + // return; + // } + // vm.obj.items.splice(index, 1); + // vm.formState.dirty = true; + // }, - vm.formState.dirty = true; - }, - removeItem: function(item) { - let vm = this; - let index = vm.obj.items.findIndex(z => z.partId == item.partId); - if (index == -1) { - return; - } - vm.obj.items.splice(index, 1); - vm.formState.dirty = true; - }, openItem: function(item) { window.$gz.eventBus.$emit("openobject", { type: window.$gz.type.Part,