This commit is contained in:
2021-05-21 17:26:32 +00:00
parent 20f75ffd24
commit 3d1d18d8f2

View File

@@ -306,7 +306,7 @@
></gz-decimal> ></gz-decimal>
</v-col> </v-col>
<v-col <!-- <v-col
v-if="form().showMe(this, 'WorkOrderItemLaborTaxRateSaleID')" v-if="form().showMe(this, 'WorkOrderItemLaborTaxRateSaleID')"
cols="12" cols="12"
sm="6" sm="6"
@@ -342,9 +342,9 @@
" "
@update:name="taxCodeChange" @update:name="taxCodeChange"
></gz-tax-picker> ></gz-tax-picker>
</v-col> </v-col> -->
<!-- <v-col <v-col
v-if="form().showMe(this, 'WorkOrderItemLaborTaxRateSaleID')" v-if="form().showMe(this, 'WorkOrderItemLaborTaxRateSaleID')"
cols="12" cols="12"
sm="6" sm="6"
@@ -378,10 +378,10 @@
" "
@update:name="taxCodeChange" @update:name="taxCodeChange"
></gz-pick-list> ></gz-pick-list>
</v-col> --> </v-col>
<v-col <v-col
v-if="form().showMe(this, 'LaborPrice')" v-if="form().showMe(this, 'LaborPriceOverride')"
cols="12" cols="12"
sm="6" sm="6"
lg="4" lg="4"
@@ -389,35 +389,36 @@
> >
<gz-currency <gz-currency
v-model=" v-model="
value.items[activeWoItemIndex].labors[activeItemIndex].price value.items[activeWoItemIndex].labors[activeItemIndex]
.priceOverride
" "
:readonly="formState.readOnly || isDeleted" :readonly="formState.readOnly || isDeleted"
:disabled="isDeleted" :disabled="isDeleted"
:label="$ay.t('Price')" :label="$ay.t('PriceOverride')"
:ref=" :ref="
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].price` `Items[${activeWoItemIndex}].labors[${activeItemIndex}].priceOverride`
" "
data-cy="laborprice" data-cy="laborpriceoverride"
:error-messages=" :error-messages="
form().serverErrors( form().serverErrors(
this, this,
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].price` `Items[${activeWoItemIndex}].labors[${activeItemIndex}].priceOverride`
) )
" "
:rules="[ :rules="[
form().decimalValid( form().decimalValid(
this, this,
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].price` `Items[${activeWoItemIndex}].labors[${activeItemIndex}].priceOverride`
), ),
form().required( form().required(
this, this,
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].price` `Items[${activeWoItemIndex}].labors[${activeItemIndex}].priceOverride`
) )
]" ]"
@input=" @input="
fieldValueChanged(`Items[${activeWoItemIndex}].labors[ fieldValueChanged(`Items[${activeWoItemIndex}].labors[
${activeItemIndex} ${activeItemIndex}
].price`) ].priceOverride`)
" "
></gz-currency> ></gz-currency>
</v-col> </v-col>
@@ -464,35 +465,35 @@
///////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* XXXeslint-disable */ /* XXXeslint-disable */
//////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////
import GzTaxPicker from "./tax-picker.vue"; //import GzTaxPicker from "./tax-picker.vue";
/* /*
+ public decimal? PriceOverride { get; set; }//user entered manually overridden price, if null then ignored in calcs otherwise this *is* the price even if zero + public decimal? PriceOverride { get; set; }//user entered manually overridden price, if null then ignored in calcs otherwise this *is* the price even if zero
l.Add(new FormField { TKey = "PriceOverride", FieldKey = "LaborPriceOverride", TKeySection = "WorkOrderItemLabors" }); l.Add(new FormField { TKey = "PriceOverride", FieldKey = "LaborPriceOverride", TKeySection = "WorkOrderItemLabors" });
[NotMapped] [NotMapped]
public decimal CostViz { get; set; }//cost from source record (e.g. serviceRate) or zero if no cost entered public decimal CostViz { get; set; }//cost from source record (e.g. serviceRate) or zero if no cost entered
[NotMapped] [NotMapped]
public decimal ListPriceViz { get; set; }//List price from source record (e.g. serviceRate) or zero if no cost entered public decimal ListPriceViz { get; set; }//List price from source record (e.g. serviceRate) or zero if no cost entered
[NotMapped] [NotMapped]
+ public string UnitOfMeasureViz { get; set; }//"each", "hour" etc + public string UnitOfMeasureViz { get; set; }//"each", "hour" etc
l.Add(new FormField { TKey = "UnitOfMeasure", FieldKey = "LaborUnitOfMeasureViz", TKeySection = "WorkOrderItemLabors" }); l.Add(new FormField { TKey = "UnitOfMeasure", FieldKey = "LaborUnitOfMeasureViz", TKeySection = "WorkOrderItemLabors" });
[NotMapped] [NotMapped]
public decimal PriceViz { get; set; }//per unit price used in calcs after discounts or manual price if non-null or just ListPrice if no discount or manual override public decimal PriceViz { get; set; }//per unit price used in calcs after discounts or manual price if non-null or just ListPrice if no discount or manual override
[NotMapped] [NotMapped]
+ public decimal NetViz { get; set; }//quantity * price (before taxes line total essentially) + public decimal NetViz { get; set; }//quantity * price (before taxes line total essentially)
l.Add(new FormField { TKey = "NetPrice", FieldKey = "LaborNetViz", TKeySection = "WorkOrderItemLabors" }); l.Add(new FormField { TKey = "NetPrice", FieldKey = "LaborNetViz", TKeySection = "WorkOrderItemLabors" });
[NotMapped] [NotMapped]
public decimal TaxAViz { get; set; }//total amount of taxA public decimal TaxAViz { get; set; }//total amount of taxA
[NotMapped] [NotMapped]
public decimal TaxBViz { get; set; }//total amount of taxB public decimal TaxBViz { get; set; }//total amount of taxB
[NotMapped] [NotMapped]
public decimal LineTotalViz { get; set; }//line total netViz + taxes public decimal LineTotalViz { get; set; }//line total netViz + taxes
*/ */
export default { export default {
components: { // components: {
GzTaxPicker // GzTaxPicker
}, // },
created() { created() {
this.setDefaultView(); this.setDefaultView();
}, },
@@ -546,7 +547,7 @@ export default {
id: 0, id: 0,
concurrency: 0, concurrency: 0,
userId: null, userId: null,
userViz: null, //userViz: null,
serviceStartDate: window.$gz.locale.nowUTC8601String(), serviceStartDate: window.$gz.locale.nowUTC8601String(),
serviceStopDate: window.$gz.locale.nowUTC8601String(), //TODO:sb now plus one hour to match v7 serviceStopDate: window.$gz.locale.nowUTC8601String(), //TODO:sb now plus one hour to match v7
serviceRateId: null, serviceRateId: null,
@@ -557,14 +558,13 @@ export default {
taxCodeSaleId: null, taxCodeSaleId: null,
taxName: null, taxName: null,
price: 0, price: 0,
cost: 0, priceOverride: null,
listPrice: 0, //costViz: 0,
taxAPct: 0, // listPriceViz: 0,
taxBPct: 0, //taxAViz: 0,
taxOnTax: false, //taxBViz: 0,
taxAViz: 0, //lineTotalViz: 0,
taxBViz: 0, //unitOfMeasureViz:null,
lineTotalViz: 0,
isDirty: true, isDirty: true,
workOrderItemId: this.value.items[this.activeWoItemIndex].id, workOrderItemId: this.value.items[this.activeWoItemIndex].id,
uid: Date.now() //used for error tracking / display uid: Date.now() //used for error tracking / display
@@ -722,7 +722,7 @@ export default {
headers.push({ headers.push({
text: this.$ay.t("Cost"), text: this.$ay.t("Cost"),
align: "right", align: "right",
value: "cost" value: "costViz"
}); });
} }
@@ -730,7 +730,7 @@ export default {
headers.push({ headers.push({
text: this.$ay.t("ListPrice"), text: this.$ay.t("ListPrice"),
align: "right", align: "right",
value: "listPrice" value: "listPriceViz"
}); });
} }
@@ -738,31 +738,47 @@ export default {
headers.push({ headers.push({
text: this.$ay.t("Price"), text: this.$ay.t("Price"),
align: "right", align: "right",
value: "price" value: "priceViz"
}); });
} }
if (this.form().showMe(this, "WorkOrderItemLaborTaxRateSaleID")) { if (this.form().showMe(this, "LaborPrice")) {
headers.push({ headers.push({
text: this.$ay.t("Tax"), text: this.$ay.t("PriceOverride"),
align: "left",
value: "taxName"
});
}
if (this.form().showMe(this, "LaborTaxAPct")) {
headers.push({
text: this.$ay.t("TaxCodeTaxA"),
align: "right", align: "right",
value: "taxAPct" value: "priceOverride"
}); });
} }
if (this.form().showMe(this, "LaborTaxBPct")) { // if (this.form().showMe(this, "WorkOrderItemLaborTaxRateSaleID")) {
// headers.push({
// text: this.$ay.t("Tax"),
// align: "left",
// value: "taxName"
// });
// }
// if (this.form().showMe(this, "LaborTaxAPct")) {
// headers.push({
// text: this.$ay.t("TaxCodeTaxA"),
// align: "right",
// value: "taxAPct"
// });
// }
// if (this.form().showMe(this, "LaborTaxBPct")) {
// headers.push({
// text: this.$ay.t("TaxCodeTaxB"),
// align: "right",
// value: "taxBPct"
// });
// }
if (this.form().showMe(this, "LaborNetViz")) {
headers.push({ headers.push({
text: this.$ay.t("TaxCodeTaxB"), text: this.$ay.t("NetPrice"),
align: "right", align: "right",
value: "taxBPct" value: "netViz"
}); });
} }
@@ -782,13 +798,13 @@ export default {
}); });
} }
if (this.form().showMe(this, "LaborTaxOnTax")) { // if (this.form().showMe(this, "LaborTaxOnTax")) {
headers.push({ // headers.push({
text: this.$ay.t("TaxCodeTaxOnTax"), // text: this.$ay.t("TaxCodeTaxOnTax"),
align: "center", // align: "center",
value: "taxOnTax" // value: "taxOnTax"
}); // });
} // }
if (this.form().showMe(this, "LaborLineTotalViz")) { if (this.form().showMe(this, "LaborLineTotalViz")) {
headers.push({ headers.push({
@@ -827,33 +843,38 @@ export default {
x.noChargeQuantity, x.noChargeQuantity,
this.pvm.languageName this.pvm.languageName
), ),
cost: window.$gz.locale.currencyLocalized( costViz: window.$gz.locale.currencyLocalized(
x.cost, x.costViz,
this.pvm.languageName, this.pvm.languageName,
this.pvm.currencyName this.pvm.currencyName
), ),
listPrice: window.$gz.locale.currencyLocalized( listPriceViz: window.$gz.locale.currencyLocalized(
x.listPrice, x.listPriceViz,
this.pvm.languageName, this.pvm.languageName,
this.pvm.currencyName this.pvm.currencyName
), ),
price: window.$gz.locale.currencyLocalized( priceViz: window.$gz.locale.currencyLocalized(
x.price, x.priceViz,
this.pvm.languageName,
this.pvm.currencyName
),
// taxName: x.taxName,
// taxAPct:
// window.$gz.locale.decimalLocalized(
// x.taxAPct,
// this.pvm.languageName
// ) + "%",
// taxBPct:
// window.$gz.locale.decimalLocalized(
// x.taxBPct,
// this.pvm.languageName
// ) + "%",
// taxOnTax: x.taxOnTax,
priceOverride: window.$gz.locale.currencyLocalized(
x.priceOverride,
this.pvm.languageName, this.pvm.languageName,
this.pvm.currencyName this.pvm.currencyName
), ),
taxName: x.taxName,
taxAPct:
window.$gz.locale.decimalLocalized(
x.taxAPct,
this.pvm.languageName
) + "%",
taxBPct:
window.$gz.locale.decimalLocalized(
x.taxBPct,
this.pvm.languageName
) + "%",
taxOnTax: x.taxOnTax,
taxAViz: window.$gz.locale.currencyLocalized( taxAViz: window.$gz.locale.currencyLocalized(
x.taxAViz, x.taxAViz,
this.pvm.languageName, this.pvm.languageName,