This commit is contained in:
2021-05-13 18:58:18 +00:00
parent d1f49b1ab4
commit 7799862e38

View File

@@ -336,46 +336,45 @@
</v-col>
<v-col
v-if="form().showMe(this, 'WorkOrderItemLaborManualDiscountPct')"
v-if="form().showMe(this, 'LaborPrice')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-percent
<gz-currency
v-model="
value.items[activeWoItemIndex].labors[activeItemIndex]
.manualDiscountPct
value.items[activeWoItemIndex].labors[activeItemIndex].price
"
:readonly="formState.readOnly || isDeleted"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemLaborManualDiscountPct')"
:label="$ay.t('Price')"
:ref="
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].manualDiscountPct`
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].price`
"
data-cy="laborManualDiscountPct"
data-cy="laborprice"
:error-messages="
form().serverErrors(
this,
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].manualDiscountPct`
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].price`
)
"
:rules="[
form().decimalValid(
this,
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].manualDiscountPct`
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].price`
),
form().required(
this,
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].manualDiscountPct`
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].price`
)
]"
@input="
fieldValueChanged(`Items[${activeWoItemIndex}].labors[
${activeItemIndex}
].manualDiscountPct`)
].price`)
"
></gz-percent>
></gz-currency>
</v-col>
<!-- <v-col
@@ -420,47 +419,7 @@
></gz-currency>
</v-col>
<v-col
v-if="form().showMe(this, 'WorkOrderItemLaborPrice')"
cols="12"
sm="6"
lg="4"
xl="3"
>
<gz-currency
v-model="
value.items[activeWoItemIndex].labors[activeItemIndex].price
"
:readonly="formState.readOnly || isDeleted"
:disabled="isDeleted"
:label="$ay.t('WorkOrderItemLaborPrice')"
:ref="
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].price`
"
data-cy="laborprice"
:error-messages="
form().serverErrors(
this,
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].price`
)
"
:rules="[
form().decimalValid(
this,
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].price`
),
form().required(
this,
`Items[${activeWoItemIndex}].labors[${activeItemIndex}].price`
)
]"
@input="
fieldValueChanged(`Items[${activeWoItemIndex}].labors[
${activeItemIndex}
].price`)
"
></gz-currency>
</v-col> -->
-->
<v-col
v-if="form().showMe(this, 'WorkOrderItemLaborServiceDetails')"
@@ -505,66 +464,28 @@
/* XXXeslint-disable */
////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
public long? UserId { get; set; }
[NotMapped]
public string UserViz { get; set; }
public DateTime? ServiceStartDate { get; set; }
public DateTime? ServiceStopDate { get; set; }
public long? ServiceRateId { get; set; }
[NotMapped]
public string ServiceRateViz { get; set; }
public string ServiceDetails { get; set; }
public decimal ServiceRateQuantity { get; set; }
public decimal NoChargeQuantity { get; set; }
public long? ServiceBankId { get; set; }
public long? TaxCodeSaleId { get; set; }
[NotMapped]
public string TaxCodeSaleViz { get; set; }
public decimal BasePrice { get; set; }//Rate price per unit at time of entry
public decimal Price { get; set; }//contract adjusted price or a copy of BasePrice if no contract
public decimal ManualDiscountPct { get; set; }// (V7 "Discount") ad-hoc / % off of the contractprice (which is always set regardless if contract or not) entered manually
l.Add(new FormField { TKey = "WorkOrderItemLaborServiceStartDate", FieldKey = "WorkOrderItemLaborServiceStartDate", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "WorkOrderItemLaborServiceStopDate", FieldKey = "WorkOrderItemLaborServiceStopDate", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "WorkOrderItemLaborServiceRateQuantity", FieldKey = "WorkOrderItemLaborServiceRateQuantity", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "WorkOrderItemLaborServiceRateID", FieldKey = "WorkOrderItemLaborServiceRateID", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "WorkOrderItemLaborServiceDetails", FieldKey = "WorkOrderItemLaborServiceDetails", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "WorkOrderItemLaborUserID", FieldKey = "WorkOrderItemLaborUserID", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "WorkOrderItemLaborNoChargeQuantity", FieldKey = "WorkOrderItemLaborNoChargeQuantity", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "WorkOrderItemLaborTaxRateSaleID", FieldKey = "WorkOrderItemLaborTaxRateSaleID", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "WorkOrderItemLaborManualDiscountPct", FieldKey = "WorkOrderItemLaborManualDiscountPct", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "WorkOrderItemLaborBasePrice", FieldKey = "WorkOrderItemLaborBasePrice", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "WorkOrderItemLaborPrice", FieldKey = "WorkOrderItemLaborPrice", TKeySection = "WorkOrderItemLabors" });
"WorkOrderItemLaborBanked": "Banked",
"WorkOrderItemLaborRateCharge": "Rate Charge",
"WorkOrderItemLaborList": "Labors",
"WorkOrderItemLaborNoChargeQuantity": "No Charge Quantity",
"WorkOrderItemLaborServiceDetails": "Service Details",
"WorkOrderItemLaborServiceRateID": "Service Rate",
"WorkOrderItemLaborServiceRateQuantity": "Service Rate Quantity",
"WorkOrderItemLaborServiceStartDate": "Service Start Date Time",
"WorkOrderItemLaborServiceStopDate": "Service Stop Date Time",
"WorkOrderItemLaborTaxCodeID": "Tax Code",
"WorkOrderItemLaborTaxRateSaleID": "Sales tax",
"WorkOrderItemLaborUIBankWarning": "Are you sure you want to Bank this record?\r\n(Once this record is banked it will be locked and can no longer be edited)",
"WorkOrderItemLaborUIReBankWarning": "This item is already banked",
"WorkOrderItemLaborUserID": "User",
WorkOrderItemLaborManualDiscountPct
WorkOrderItemLaborBasePrice
WorkOrderItemLaborPrice
"CREATE TABLE aworkorderitemlabor (id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, workorderitemid BIGINT NOT NULL REFERENCES aworkorderitem (id), "
+ "userid BIGINT REFERENCES auser, servicestartdate TIMESTAMP, servicestopdate TIMESTAMP, servicerateid BIGINT REFERENCES aservicerate, servicedetails text, "
+ "serviceratequantity DECIMAL(19,5) NOT NULL default 0, nochargequantity DECIMAL(19,5) NOT NULL default 0, servicebankid BIGINT REFERENCES aservicebank, "
+ "taxcodesaleid BIGINT REFERENCES ataxcode, baseprice DECIMAL(38,18) NOT NULL default 0, price DECIMAL(38,18) NOT NULL default 0, "
+ "manualdiscountpct DECIMAL(8,5) NOT NULL default 0 "
"cost": 0,
"listPrice": 0,
"price": 0,
"taxName": null,
"taxAPct": 0,
"taxBPct": 0,
"taxOnTax": false,
"taxAViz": 0,
"taxBViz": 0,
"lineTotalViz": 0,
l.Add(new FormField { TKey = "Cost", FieldKey = "LaborCost", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "ListPrice", FieldKey = "LaborListPrice", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "Price", FieldKey = "LaborPrice", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "Tax", FieldKey = "LaborTaxName", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxCodeTaxA", FieldKey = "LaborTaxAPct", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxCodeTaxB", FieldKey = "LaborTaxBPct", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxCodeTaxOnTax", FieldKey = "LaborTaxOnTax", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxAAmt", FieldKey = "LaborTaxAViz", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxBAmt", FieldKey = "LaborTaxBViz", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "LineTotal", FieldKey = "LaborLineTotalViz", TKeySection = "WorkOrderItemLabors" });
*/
export default {
created() {
@@ -762,14 +683,13 @@ export default {
});
}
//executive decision not to show long form fields in grids
// if (this.form().showMe(this, "WorkOrderItemLaborServiceDetails")) {
// headers.push({
// text: this.$ay.t("WorkOrderItemLaborServiceDetails"),
// align: "left",
// value: "serviceDetails"
// });
// }
if (this.form().showMe(this, "WorkOrderItemLaborServiceDetails")) {
headers.push({
text: this.$ay.t("WorkOrderItemLaborServiceDetails"),
align: "left",
value: "serviceDetails"
});
}
if (this.form().showMe(this, "WorkOrderItemLaborUserID")) {
headers.push({
@@ -787,38 +707,85 @@ export default {
});
}
if (this.form().showMe(this, "WorkOrderItemLaborTaxRateSaleID")) {
if (this.form().showMe(this, "LaborCost")) {
headers.push({
text: this.$ay.t("WorkOrderItemLaborTaxRateSaleID"),
align: "left",
value: "taxCodeSaleViz"
});
}
if (this.form().showMe(this, "WorkOrderItemLaborManualDiscountPct")) {
headers.push({
text: this.$ay.t("WorkOrderItemLaborManualDiscountPct"),
text: this.$ay.t("Cost"),
align: "right",
value: "manualDiscountPct"
value: "cost"
});
}
if (this.form().showMe(this, "WorkOrderItemLaborBasePrice")) {
if (this.form().showMe(this, "LaborListPrice")) {
headers.push({
text: this.$ay.t("WorkOrderItemLaborBasePrice"),
text: this.$ay.t("ListPrice"),
align: "right",
value: "basePrice"
value: "listPrice"
});
}
if (this.form().showMe(this, "WorkOrderItemLaborPrice")) {
if (this.form().showMe(this, "LaborPrice")) {
headers.push({
text: this.$ay.t("WorkOrderItemLaborPrice"),
text: this.$ay.t("Price"),
align: "right",
value: "price"
});
}
if (this.form().showMe(this, "LaborTaxName")) {
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, "LaborTaxAViz")) {
headers.push({
text: this.$ay.t("TaxAAmt"),
align: "right",
value: "taxAViz"
});
}
if (this.form().showMe(this, "LaborTaxBViz")) {
headers.push({
text: this.$ay.t("TaxBAmt"),
align: "right",
value: "taxBViz"
});
}
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({
text: this.$ay.t("LineTotal"),
align: "right",
value: "lineTotalViz"
});
}
return headers;
},
itemList: function() {
@@ -849,36 +816,13 @@ export default {
x.noChargeQuantity,
this.pvm.languageName
),
taxCodeSaleViz: x.taxCodeSaleViz,
/*
"cost": 0,
"listPrice": 0,
"price": 0,
"taxName": null,
"taxAPct": 0,
"taxBPct": 0,
"taxOnTax": false,
"taxAViz": 0,
"taxBViz": 0,
"lineTotalViz": 0,
l.Add(new FormField { TKey = "Tax", FieldKey = "LaborTaxName", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxCodeTaxA", FieldKey = "LaborTaxAPct", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxCodeTaxB", FieldKey = "LaborTaxBPct", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxCodeTaxOnTax", FieldKey = "LaborTaxOnTax", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxAAmt", FieldKey = "LaborTaxAViz", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "TaxBAmt", FieldKey = "LaborTaxBViz", TKeySection = "WorkOrderItemLabors" });
l.Add(new FormField { TKey = "LineTotal", FieldKey = "LaborLineTotalViz", TKeySection = "WorkOrderItemLabors" });
*/
manualDiscountPct:
window.$gz.locale.decimalLocalized(
x.manualDiscountPct,
this.pvm.languageName
) + "%",
basePrice: window.$gz.locale.currencyLocalized(
x.basePrice,
cost: window.$gz.locale.currencyLocalized(
x.cost,
this.pvm.languageName,
this.pvm.currencyName
),
listPrice: window.$gz.locale.currencyLocalized(
x.listPrice,
this.pvm.languageName,
this.pvm.currencyName
),
@@ -886,6 +830,33 @@ export default {
x.price,
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,
this.pvm.currencyName
),
taxBViz: window.$gz.locale.currencyLocalized(
x.taxBViz,
this.pvm.languageName,
this.pvm.currencyName
),
lineTotalViz: window.$gz.locale.currencyLocalized(
x.lineTotalViz,
this.pvm.languageName,
this.pvm.currencyName
)
};
});