IO-2141 Add detail only line for autohous exports.

This commit is contained in:
Patrick Fic
2023-01-19 11:04:40 -08:00
parent 32de0ddeb6
commit 42b4534d21
15 changed files with 170 additions and 43093 deletions

View File

@@ -40,6 +40,11 @@ export function JobLinesUpsertModalComponent({
{},
bodyshop.imexshopid
);
const { Autohouse_Detail_line } = useTreatments(
["Autohouse_Detail_line"],
{},
bodyshop.imexshopid
);
return (
<Modal
@@ -155,6 +160,40 @@ export function JobLinesUpsertModalComponent({
>
<InputNumber precision={1} />
</Form.Item>
{Autohouse_Detail_line.treatment === "on" && (
<Form.Item
label={t("joblines.fields.ah_detail_line")}
name="ah_detail_line"
valuePropName="checked"
dependencies={["mod_lbr_ty"]}
rules={[
({ getFieldValue }) => ({
validator(rule, value) {
console.log(
value === true,
["LA1", "LA2", "LA3", "LA4", "LAU"].includes(
getFieldValue("mod_lbr_ty")
)
);
if (value === false) return Promise.resolve();
if (
value === true &&
["LA1", "LA2", "LA3", "LA4", "LAU"].includes(
getFieldValue("mod_lbr_ty")
)
) {
return Promise.resolve();
}
return Promise.reject(
t("joblines.validations.ahdetailonlyonuserdefinedtypes")
);
},
}),
]}
>
<Switch />
</Form.Item>
)}
</LayoutFormRow>
<LayoutFormRow>
<Form.Item label={t("joblines.fields.part_type")} name="part_type">
@@ -218,7 +257,6 @@ export function JobLinesUpsertModalComponent({
rules={[
({ getFieldValue }) => ({
validator(rule, value) {
console.log(value);
if (!value || getFieldValue("part_type") !== "PAE") {
return Promise.resolve();
}
@@ -229,7 +267,6 @@ export function JobLinesUpsertModalComponent({
}),
({ getFieldValue }) => ({
validator(rule, value) {
console.log(value, !!value);
if (
!!getFieldValue("part_type") === (!!value || value === 0)
) {

View File

@@ -1344,7 +1344,14 @@ export default function ShopInfoGeneral({ form }) {
>
<InputNumber precision={0} min={0} max={100} />
</Form.Item>
<Form.Item
label={t("joblines.fields.ah_detail_line")}
key={`${index}ah_detail_line`}
name={[field.name, "ah_detail_line"]}
valuePropName="checked"
>
<Switch />
</Form.Item>
<Space wrap>
<DeleteFilled
onClick={() => {

View File

@@ -720,6 +720,7 @@ export const GET_JOB_BY_PK = gql`
prt_dsmk_m
ioucreated
convertedtolbr
ah_detail_line
billlines(limit: 1, order_by: { bill: { date: desc } }) {
id
quantity

View File

@@ -1142,6 +1142,7 @@
},
"fields": {
"act_price": "Retail Price",
"ah_detail_line": "Mark as Detail Labor Line (Autohouse Only)",
"db_price": "List Price",
"lbr_types": {
"LA1": "LA1",
@@ -1214,6 +1215,7 @@
"updated": "Job line updated successfully."
},
"validations": {
"ahdetailonlyonuserdefinedtypes": "Detail line indicator can only be set for LA1, LA2, LA3, LA4, and LAU labor types.",
"hrsrequirediflbrtyp": "Labor hours are required if a labor type is selected. Clear the labor type if there are no labor hours.",
"requiredifparttype": "Required if a part type has been specified.",
"zeropriceexistingpart": "This line cannot have any price since it uses an existing part."
@@ -1694,6 +1696,7 @@
"partstotal": "This is the total of all parts and sublet amounts on the vehicle (some of these may require an in-house invoice).<br/>\nItems such as shop and paint materials, labor online lines, etc. are not included in this total.",
"totalreturns": "The total <b>retail</b> amount of returns created for this job."
},
"profileadjustments": "",
"prt_dsmk_total": "Line Item Adjustment",
"rates": "Rates",
"rates_subtotal": "All Rates Subtotal",

View File

@@ -1142,6 +1142,7 @@
},
"fields": {
"act_price": "Precio actual",
"ah_detail_line": "",
"db_price": "Precio de base de datos",
"lbr_types": {
"LA1": "",
@@ -1214,6 +1215,7 @@
"updated": ""
},
"validations": {
"ahdetailonlyonuserdefinedtypes": "",
"hrsrequirediflbrtyp": "",
"requiredifparttype": "",
"zeropriceexistingpart": ""
@@ -1694,6 +1696,7 @@
"partstotal": "",
"totalreturns": ""
},
"profileadjustments": "",
"prt_dsmk_total": "",
"rates": "Tarifas",
"rates_subtotal": "",

View File

@@ -1142,6 +1142,7 @@
},
"fields": {
"act_price": "Prix actuel",
"ah_detail_line": "",
"db_price": "Prix de la base de données",
"lbr_types": {
"LA1": "",
@@ -1214,6 +1215,7 @@
"updated": ""
},
"validations": {
"ahdetailonlyonuserdefinedtypes": "",
"hrsrequirediflbrtyp": "",
"requiredifparttype": "",
"zeropriceexistingpart": ""
@@ -1694,6 +1696,7 @@
"partstotal": "",
"totalreturns": ""
},
"profileadjustments": "",
"prt_dsmk_total": "",
"rates": "Les taux",
"rates_subtotal": "",