From 91e70750d6e67bf56719d4d98a481c3da6cef65d Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Tue, 14 Dec 2021 09:48:11 -0800
Subject: [PATCH] IO-244 IOU Bug Fixes
---
.../job-create-iou/job-create-iou.component.jsx | 15 ++++++---------
.../job-detail-lines/job-lines.component.jsx | 2 +-
.../jobs-detail-header-actions.duplicate.util.js | 5 +++--
3 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/client/src/components/job-create-iou/job-create-iou.component.jsx b/client/src/components/job-create-iou/job-create-iou.component.jsx
index cc09a76b9..9a7995077 100644
--- a/client/src/components/job-create-iou/job-create-iou.component.jsx
+++ b/client/src/components/job-create-iou/job-create-iou.component.jsx
@@ -21,12 +21,7 @@ const mapDispatchToProps = (dispatch) => ({
});
export default connect(mapStateToProps, mapDispatchToProps)(JobCreateIOU);
-export function JobCreateIOU({
- bodyshop,
- currentUser,
- jobid,
- selectedJobLines,
-}) {
+export function JobCreateIOU({ bodyshop, currentUser, job, selectedJobLines }) {
const { t } = useTranslation();
const [loading, setLoading] = useState(false);
const client = useApolloClient();
@@ -44,7 +39,7 @@ export function JobCreateIOU({
//Query all of the job details to recreate.
const iouId = await CreateIouForJob(
client,
- jobid,
+ job.id,
{
status: bodyshop.md_ro_statuses.default_open,
bodyshopid: bodyshop.id,
@@ -63,7 +58,7 @@ export function JobCreateIOU({
variables: { ids: selectedJobLinesIds },
update(cache) {
cache.modify({
- id: cache.identify(jobid),
+ id: cache.identify(job.id),
fields: {
joblines(existingJobLines, { readField }) {
return existingJobLines.map((a) => {
@@ -86,7 +81,9 @@ export function JobCreateIOU({
>
diff --git a/client/src/components/job-detail-lines/job-lines.component.jsx b/client/src/components/job-detail-lines/job-lines.component.jsx
index 3e1501e54..d23e1d090 100644
--- a/client/src/components/job-detail-lines/job-lines.component.jsx
+++ b/client/src/components/job-detail-lines/job-lines.component.jsx
@@ -428,7 +428,7 @@ export function JobLinesComponent({
>
{t("joblines.actions.new")}
-
+
{
diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js
index 1ddf4f87c..b4e6e1384 100644
--- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js
+++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js
@@ -108,8 +108,9 @@ export async function CreateIouForJob(
_tempLines.forEach((line) => {
delete line.id;
delete line.__typename;
- line.oem_partno = `line.oem_partno - IOU Price $${line.act_price}`
- delete line.act_price;
+ line.oem_partno = `${line.oem_partno} - IOU $${line.act_price}/${line.mod_lb_hrs}hrs`;
+ line.act_price = 0;
+ line.mod_lb_hrs = 0;
line.manual_line = true;
});