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