This commit is contained in:
@@ -187,7 +187,7 @@ export default {
|
|||||||
}
|
}
|
||||||
let wasNegative = number < 0;
|
let wasNegative = number < 0;
|
||||||
if (wasNegative) {
|
if (wasNegative) {
|
||||||
number = Match.abs(number); //make sure it's positive because rounding negative numbers is weird in JS
|
number = Math.abs(number); //make sure it's positive because rounding negative numbers is weird in JS
|
||||||
}
|
}
|
||||||
number = Number(
|
number = Number(
|
||||||
Math.round(number + "e" + decimalPlaces) + "e-" + decimalPlaces
|
Math.round(number + "e" + decimalPlaces) + "e-" + decimalPlaces
|
||||||
|
|||||||
@@ -402,10 +402,10 @@ export default {
|
|||||||
const dStop = this.value.items[this.activeWoItemIndex].scheduledUsers[
|
const dStop = this.value.items[this.activeWoItemIndex].scheduledUsers[
|
||||||
this.activeItemIndex
|
this.activeItemIndex
|
||||||
].stopDate;
|
].stopDate;
|
||||||
if (ref.includes("startDate")) {
|
if (ref.includes("startDate") && dStart != null) {
|
||||||
this.handleStartDateChange(isNew, dStart, dStop);
|
this.handleStartDateChange(isNew, dStart, dStop);
|
||||||
}
|
}
|
||||||
if (ref.includes("stopDate")) {
|
if (ref.includes("stopDate") && dStop != null) {
|
||||||
this.handleStopDateChange(isNew, dStart, dStop);
|
this.handleStopDateChange(isNew, dStart, dStop);
|
||||||
}
|
}
|
||||||
if (ref.includes("estimatedQuantity")) {
|
if (ref.includes("estimatedQuantity")) {
|
||||||
@@ -414,27 +414,33 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleStartDateChange: function(isNew, dStart, dStop) {
|
handleStartDateChange: function(isNew, dStart, dStop) {
|
||||||
if (isNew) {
|
const globalMinutes =
|
||||||
// (ONLY IF GLOBAL DEFAULT QTY) enter start date when stop date is null then it will add global default to start and set stop and qty
|
window.$gz.store.state.globalSettings.workLaborScheduleDefaultMinutes;
|
||||||
|
|
||||||
// If no global default then it acts like existing and updates qty or stop date when qty changes (if there are dates to go on)
|
if (isNew && dStop == null) {
|
||||||
|
if (globalMinutes != 0) {
|
||||||
|
//set stop date based on start date and global minutes
|
||||||
|
this.value.items[this.activeWoItemIndex].scheduledUsers[
|
||||||
|
this.activeItemIndex
|
||||||
|
].stopDate = window.$gz.locale.addMinutesToUTC8601String(
|
||||||
|
dStart,
|
||||||
|
globalMinutes
|
||||||
|
);
|
||||||
|
|
||||||
const globalMinutes =
|
this.value.items[this.activeWoItemIndex].scheduledUsers[
|
||||||
window.$gz.store.state.globalSettings.workLaborScheduleDefaultMinutes;
|
this.activeItemIndex
|
||||||
if (globalMinutes == 0) {
|
].estimatedQuantity = globalMinutes;
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
let d = window.$gz.locale.addMinutesToUTC8601String(dStart);
|
|
||||||
} else {
|
} else {
|
||||||
// Existing
|
//Existing record or both dates filled, just update quantity
|
||||||
// update quantity when dates change or update stop date when quantity changes to match
|
if (dStop != null) {
|
||||||
// no consideration for global default, once it's made that shit doesn't apply
|
this.value.items[this.activeWoItemIndex].scheduledUsers[
|
||||||
this.value.items[this.activeWoItemIndex].scheduledUsers[
|
this.activeItemIndex
|
||||||
this.activeItemIndex
|
].estimatedQuantity = window.$gz.locale.diffHoursFromUTC8601String(
|
||||||
].estimatedQuantity = window.$gz.locale.diffHoursFromUTC8601String(
|
dStart,
|
||||||
dStart,
|
dStop
|
||||||
dStop
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleStopDateChange: function(isNew, dStart, dStop) {
|
handleStopDateChange: function(isNew, dStart, dStop) {
|
||||||
|
|||||||
Reference in New Issue
Block a user