This commit is contained in:
@@ -1475,16 +1475,28 @@ async function saveLoans(vm, woItemIndex) {
|
||||
}
|
||||
|
||||
for (let i = 0; i < vm.obj.items[woItemIndex].loans.length; i++) {
|
||||
let o = vm.obj.items[woItemIndex].loans[i];
|
||||
if (o.isDirty) {
|
||||
//const isPost = o.id == 0;
|
||||
let res = await window.$gz.api.upsert(`${API_BASE_URL}items/loans`, o);
|
||||
if (vm.obj.items[woItemIndex].loans[i].isDirty) {
|
||||
const o = vm.obj.items[woItemIndex].loans[i];
|
||||
const uid = o.uid;
|
||||
//strip out viz fields before sending
|
||||
o.isDirty = undefined;
|
||||
o.uid = undefined;
|
||||
o.taxCodeViz = undefined;
|
||||
o.loanUnitViz = undefined;
|
||||
o.unitOfMeasureViz = undefined;
|
||||
o.priceViz = undefined;
|
||||
o.netViz = undefined;
|
||||
o.taxAViz = undefined;
|
||||
o.taxBViz = undefined;
|
||||
o.lineTotalViz = undefined;
|
||||
|
||||
const res = await window.$gz.api.upsert(`${API_BASE_URL}items/loans`, o);
|
||||
if (res.error) {
|
||||
handleSaveError(vm, {
|
||||
error: res.error,
|
||||
itemUid: vm.obj.items[woItemIndex].uid,
|
||||
childKey: "loans",
|
||||
childUid: o.uid
|
||||
childUid: uid
|
||||
});
|
||||
} else {
|
||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||
@@ -1538,10 +1550,24 @@ async function saveOutsideServices(vm, woItemIndex) {
|
||||
}
|
||||
|
||||
for (let i = 0; i < vm.obj.items[woItemIndex].outsideServices.length; i++) {
|
||||
let o = vm.obj.items[woItemIndex].outsideServices[i];
|
||||
if (o.isDirty) {
|
||||
//const isPost = o.id == 0;
|
||||
let res = await window.$gz.api.upsert(
|
||||
if (vm.obj.items[woItemIndex].outsideServices[i].isDirty) {
|
||||
const o = vm.obj.items[woItemIndex].outsideServices[i];
|
||||
const uid = o.uid;
|
||||
//strip out viz fields before sending
|
||||
o.isDirty = undefined;
|
||||
o.uid = undefined;
|
||||
o.unitViz = undefined;
|
||||
o.vendorSentToViz = undefined;
|
||||
o.vendorSentViaViz = undefined;
|
||||
o.taxCodeViz = undefined;
|
||||
o.costViz = undefined;
|
||||
o.priceViz = undefined;
|
||||
o.netViz = undefined;
|
||||
o.taxAViz = undefined;
|
||||
o.taxBViz = undefined;
|
||||
o.lineTotalViz = undefined;
|
||||
|
||||
const res = await window.$gz.api.upsert(
|
||||
`${API_BASE_URL}items/outside-services`,
|
||||
o
|
||||
);
|
||||
@@ -1550,7 +1576,7 @@ async function saveOutsideServices(vm, woItemIndex) {
|
||||
error: res.error,
|
||||
itemUid: vm.obj.items[woItemIndex].uid,
|
||||
childKey: "outsideServices",
|
||||
childUid: o.uid
|
||||
childUid: uid
|
||||
});
|
||||
} else {
|
||||
//Server will update fields on put or post for most workorder graph objecs so need to update entire object here
|
||||
|
||||
Reference in New Issue
Block a user