Merged in release/2022-03-11 (pull request #418)

release/2022-03-11

Approved-by: Patrick Fic
This commit is contained in:
Patrick Fic
2022-03-10 19:02:58 +00:00
10 changed files with 60 additions and 19 deletions

View File

@@ -1,4 +1,4 @@
<babeledit_project version="1.2" be_version="2.7.1"> <babeledit_project be_version="2.7.1" version="1.2">
<!-- <!--
BabelEdit project file BabelEdit project file
@@ -43353,6 +43353,27 @@
</translation> </translation>
</translations> </translations>
</concept_node> </concept_node>
<concept_node>
<name>novehinfo</name>
<definition_loaded>false</definition_loaded>
<description></description>
<comment></comment>
<default_text></default_text>
<translations>
<translation>
<language>en-US</language>
<approved>false</approved>
</translation>
<translation>
<language>es-MX</language>
<approved>false</approved>
</translation>
<translation>
<language>fr-CA</language>
<approved>false</approved>
</translation>
</translations>
</concept_node>
<concept_node> <concept_node>
<name>relatedjobs</name> <name>relatedjobs</name>
<definition_loaded>false</definition_loaded> <definition_loaded>false</definition_loaded>

View File

@@ -64,9 +64,9 @@ export default function JobBillsTotalComponent({
}) })
); );
const totalPartsSublet = Dinero(totals.parts.parts.total).add( const totalPartsSublet = Dinero(totals.parts.parts.total)
Dinero(totals.parts.sublets.total) .add(Dinero(totals.parts.sublets.total))
); .add(Dinero(totals.additional.towing));
const discrepancy = totalPartsSublet.subtract(billTotals); const discrepancy = totalPartsSublet.subtract(billTotals);

View File

@@ -462,7 +462,7 @@ export function JobLinesComponent({
}; };
}} }}
rowSelection={{ rowSelection={{
selectedRowKeys: selectedLines.map((item) => item.id), selectedRowKeys: selectedLines.map((item) => item && item.id),
onSelectAll: (selected, selectedRows, changeRows) => { onSelectAll: (selected, selectedRows, changeRows) => {
setSelectedLines(selectedRows); setSelectedLines(selectedRows);
}, },

View File

@@ -18,7 +18,11 @@ export default function JobReconciliationModalComponent({ job, bills }) {
.flat() || []; .flat() || [];
const jobLineData = job.joblines.filter( const jobLineData = job.joblines.filter(
(j) => j.part_type !== null && j.part_type !== "PAE" (j) =>
(j.part_type !== null && j.part_type !== "PAE") ||
(j.line_desc &&
j.line_desc.toLowerCase().includes("towing") &&
j.lbr_op === "OP13")
); );
return ( return (

View File

@@ -60,6 +60,13 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
); );
}, [job.status, bodyshop.md_ro_statuses.post_production_statuses]); }, [job.status, bodyshop.md_ro_statuses.post_production_statuses]);
const vehicleTitle = `${job.v_model_yr || ""} ${job.v_color || ""}
${job.v_make_desc || ""}
${job.v_model_desc || ""}`.trim();
console.log(
"🚀 ~ file: jobs-detail-header.component.jsx ~ line 64 ~ vehicleTitle",
vehicleTitle.length
);
return ( return (
<Row gutter={[16, 16]} style={{ alignItems: "stretch" }}> <Row gutter={[16, 16]} style={{ alignItems: "stretch" }}>
<Col {...colSpan}> <Col {...colSpan}>
@@ -188,9 +195,9 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
: job.vehicle && `/manage/vehicles/${job.vehicle.id}` : job.vehicle && `/manage/vehicles/${job.vehicle.id}`
} }
> >
{`${job.v_model_yr || ""} ${job.v_color || ""} {vehicleTitle.length > 0
${job.v_make_desc || ""} ? vehicleTitle
${job.v_model_desc || ""}`} : t("vehicles.labels.novehinfo")}
</Link> </Link>
) : ( ) : (
<span></span> <span></span>

View File

@@ -2578,6 +2578,7 @@
}, },
"labels": { "labels": {
"fromvehicle": "Historical Vehicle Record", "fromvehicle": "Historical Vehicle Record",
"novehinfo": "No Vehicle Information",
"relatedjobs": "Related Jobs", "relatedjobs": "Related Jobs",
"updatevehicle": "Update Vehicle Information" "updatevehicle": "Update Vehicle Information"
}, },

View File

@@ -2578,6 +2578,7 @@
}, },
"labels": { "labels": {
"fromvehicle": "", "fromvehicle": "",
"novehinfo": "",
"relatedjobs": "", "relatedjobs": "",
"updatevehicle": "" "updatevehicle": ""
}, },

View File

@@ -2578,6 +2578,7 @@
}, },
"labels": { "labels": {
"fromvehicle": "", "fromvehicle": "",
"novehinfo": "",
"relatedjobs": "", "relatedjobs": "",
"updatevehicle": "" "updatevehicle": ""
}, },

View File

@@ -124,12 +124,12 @@ exports.default = async (req, res) => {
} }
} }
for (const xmlObj of allxmlsToUpload) { // for (const xmlObj of allxmlsToUpload) {
fs.writeFileSync(`./logs/${xmlObj.filename}`, xmlObj.xml); // fs.writeFileSync(`./logs/${xmlObj.filename}`, xmlObj.xml);
} // }
res.json(allxmlsToUpload); // res.json(allxmlsToUpload);
return; // return;
let sftp = new Client(); let sftp = new Client();
sftp.on("error", (errors) => sftp.on("error", (errors) =>

View File

@@ -418,21 +418,27 @@ function CalculateAdditional(job) {
pvrt: null, pvrt: null,
total: null, total: null,
}; };
ret.towing = Dinero({
amount: Math.round((job.towing_payable || 0) * 100),
});
ret.additionalCosts = job.joblines ret.additionalCosts = job.joblines
.filter((jl) => !jl.removed && IsAdditionalCost(jl)) .filter((jl) => !jl.removed && IsAdditionalCost(jl))
.reduce((acc, val) => { .reduce((acc, val) => {
const lineValue = Dinero({ const lineValue = Dinero({
amount: Math.round((val.act_price || 0) * 100), amount: Math.round((val.act_price || 0) * 100),
}).multiply(val.part_qty || 1); }).multiply(val.part_qty || 1);
ret.additionalCostItems.push({ key: val.line_desc, total: lineValue });
return acc.add(lineValue); if (val.line_desc.toLowerCase().includes("towing")) {
ret.towing = lineValue;
return acc;
} else {
ret.additionalCostItems.push({ key: val.line_desc, total: lineValue });
return acc.add(lineValue);
}
}, Dinero()); }, Dinero());
ret.adjustments = Dinero({ ret.adjustments = Dinero({
amount: Math.round((job.adjustment_bottom_line || 0) * 100), amount: Math.round((job.adjustment_bottom_line || 0) * 100),
}); });
ret.towing = Dinero({
amount: Math.round((job.towing_payable || 0) * 100),
});
ret.storage = Dinero({ ret.storage = Dinero({
amount: Math.round((job.storage_payable || 0) * 100), amount: Math.round((job.storage_payable || 0) * 100),
}); });