From f5dfd1ade40a999794bec5c03ad4e27b30043446 Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Thu, 25 Mar 2021 08:08:46 -0700
Subject: [PATCH 1/5] IO-808 Handling payment totals for no job totals.
---
.../payment-form.totalpayments.component.jsx | 21 ++++++++++++-------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/client/src/components/payment-form/payment-form.totalpayments.component.jsx b/client/src/components/payment-form/payment-form.totalpayments.component.jsx
index 94729ecc3..abc476880 100644
--- a/client/src/components/payment-form/payment-form.totalpayments.component.jsx
+++ b/client/src/components/payment-form/payment-form.totalpayments.component.jsx
@@ -23,9 +23,11 @@ export default function PaymentFormTotalPayments({ jobid }) {
return acc.add(Dinero({ amount: (val.amount || 0) * 100 }));
}, Dinero());
- const balance = Dinero(
- data.jobs_by_pk.job_totals.totals.total_repairs
- ).subtract(totalPayments);
+ const balance =
+ data.jobs_by_pk.job_totals &&
+ Dinero(data.jobs_by_pk.job_totals.totals.total_repairs).subtract(
+ totalPayments
+ );
return (
@@ -33,11 +35,14 @@ export default function PaymentFormTotalPayments({ jobid }) {
title={t("payments.labels.totalpayments")}
value={totalPayments.toFormat()}
/>
-
+ {balance && (
+
+ )}
+ {!balance &&
{t("jobs.errors.nofinancial")}
}
);
}
From 1eda8f8c3182e93f0a8fe8280d57983b9339496c Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Thu, 25 Mar 2021 08:41:36 -0700
Subject: [PATCH 2/5] IO-809 Disable reconciliation on removed joblines.
---
.../job-reconciliation-parts-table.component.jsx | 3 +++
.../job-reconciliation-totals.utility.js | 4 ++--
client/src/graphql/jobs.queries.js | 4 ++++
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/client/src/components/job-reconciliation-parts-table/job-reconciliation-parts-table.component.jsx b/client/src/components/job-reconciliation-parts-table/job-reconciliation-parts-table.component.jsx
index 4c35fdd94..ceb5df6eb 100644
--- a/client/src/components/job-reconciliation-parts-table/job-reconciliation-parts-table.component.jsx
+++ b/client/src/components/job-reconciliation-parts-table/job-reconciliation-parts-table.component.jsx
@@ -113,6 +113,9 @@ export default function JobReconcilitionPartsTable({
onChange={handleTableChange}
rowSelection={{
onChange: handleOnRowClick,
+ getCheckboxProps: (record) => ({
+ disabled: record.removed,
+ }),
selectedRowKeys: selectedLines,
}}
rowClassName={(record) => record.removed && "text-strikethrough"}
diff --git a/client/src/components/job-reconciliation-totals/job-reconciliation-totals.utility.js b/client/src/components/job-reconciliation-totals/job-reconciliation-totals.utility.js
index cb4b9fc82..b3f2771cc 100644
--- a/client/src/components/job-reconciliation-totals/job-reconciliation-totals.utility.js
+++ b/client/src/components/job-reconciliation-totals/job-reconciliation-totals.utility.js
@@ -11,7 +11,7 @@ export const reconcileByAssocLine = (
const [selectedJobLines, setSelectedJobLines] = jobLineState;
const allJoblinesFromBills = billLines
- .filter((bl) => !!bl.joblineid)
+ .filter((bl) => bl.joblineid && !(bl.jobline && bl.jobline.removed))
.map((bl) => bl.joblineid);
const duplicatedJobLinesbyInvoiceId = _.filter(
@@ -73,7 +73,7 @@ export const reconcileByPrice = (
jobLines.forEach((jl) => {
const matchingBillLineIds = billLines
- .filter((bl) => bl.actual_price === jl.act_price)
+ .filter((bl) => bl.actual_price === jl.act_price && !jl.removed)
.map((bl) => bl.id);
if (matchingBillLineIds.length > 1) {
diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js
index 2cef839a5..17aa2c0a9 100644
--- a/client/src/graphql/jobs.queries.js
+++ b/client/src/graphql/jobs.queries.js
@@ -608,6 +608,10 @@ export const GET_JOB_RECONCILIATION_BY_PK = gql`
line_desc
applicable_taxes
deductedfromlbr
+ jobline {
+ id
+ removed
+ }
}
}
jobs_by_pk(id: $id) {
From 743ce25a72785ee9b07677bc45ff4af30545b3cb Mon Sep 17 00:00:00 2001
From: Patrick Fic <>
Date: Thu, 25 Mar 2021 09:19:09 -0700
Subject: [PATCH 3/5] IO-273 Submit SD ticket from error boundary
---
.../error-boundary.component.jsx | 46 +++++++++++++++----
1 file changed, 38 insertions(+), 8 deletions(-)
diff --git a/client/src/components/error-boundary/error-boundary.component.jsx b/client/src/components/error-boundary/error-boundary.component.jsx
index 96211cc00..cef01e299 100644
--- a/client/src/components/error-boundary/error-boundary.component.jsx
+++ b/client/src/components/error-boundary/error-boundary.component.jsx
@@ -3,6 +3,16 @@ import React from "react";
import { withTranslation } from "react-i18next";
import { logImEXEvent } from "../../firebase/firebase.utils";
+import { connect } from "react-redux";
+import { createStructuredSelector } from "reselect";
+import { selectCurrentUser } from "../../redux/user/user.selectors";
+const mapStateToProps = createStructuredSelector({
+ currentUser: selectCurrentUser,
+});
+const mapDispatchToProps = (dispatch) => ({
+ //setUserLanguage: language => dispatch(setUserLanguage(language))
+});
+
class ErrorBoundary extends React.Component {
constructor() {
super();
@@ -23,6 +33,24 @@ class ErrorBoundary extends React.Component {
this.setState({ ...this.state, error, info });
}
+ handleErrorSubmit = () => {
+ const errorDescription = `**Please add relevant details about what you were doing before you encountered this issue**
+
+----
+System Generated Log:
+${this.state.error.message}
+${this.state.error.stack}
+ `;
+
+ const URL = `https://bodyshop.atlassian.net/servicedesk/customer/portal/3/group/8/create/26?summary=123&description=${encodeURI(
+ errorDescription
+ )}&customfield_10049=${window.location}&email=${
+ this.props.currentUser.email
+ }`;
+ console.log(`URL`, URL);
+ window.open(URL, "_blank");
+ };
+
render() {
const { t } = this.props;
const { error, info } = this.state;
@@ -32,22 +60,20 @@ class ErrorBoundary extends React.Component {
return (
-