From 534e0a039828fbc94e9474433923b8c70d2b4c61 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 18 Aug 2020 16:43:04 -0700 Subject: [PATCH] Minor fixed + refactored job details screens based on review. --- .../components/auth-provider/auth-provider.js | 7 - bodyshop_translations.babel | 212 ++++++--- client/src/App/App.jsx | 2 +- .../allocations-assignment.component.test.js | 3 +- .../allocations-bulk-assignment.component.jsx | 21 +- ...ntract-license-decode-button.component.jsx | 5 +- .../dashboard-grid.component.jsx | 18 +- .../email-overlay/email-overlay.container.jsx | 1 - .../form-fields-changed-alert.component.jsx | 1 - .../invoice-enter-modal.container.jsx | 7 - .../invoice-export-all-button.component.jsx | 4 +- .../invoice-export-button.component.jsx | 4 +- .../invoice-form/invoice-form.component.jsx | 1 - .../invoices-list-table.component.jsx | 7 - .../job-costing-modal.component.jsx | 5 - .../job-detail-cards.parts.component.jsx | 3 - .../job-detail-lines/job-lines.component.jsx | 1 - .../job-employee-assignments.component.jsx | 121 ++--- .../job-intake-form.component.jsx | 2 - .../job-reconciliation-modal.component.jsx | 5 - .../job-totals-table.component.jsx | 440 ++++++++++-------- .../job-totals-table.styles.scss | 46 +- .../jobs-available-supplement.container.jsx | 6 +- .../jobs-detail-claims.component.jsx | 66 --- .../jobs-detail-financial.component.jsx | 215 --------- .../jobs-detail-general.component.jsx} | 103 +++- ...bs-detail-header-actions.duplicate.util.js | 2 - .../jobs-detail-header.component.jsx | 87 +--- .../jobs-detail-rates.component.jsx | 139 ++++++ .../jobs-detail-totals.component.jsx | 81 ++++ .../jobs-export-all-button.component.jsx | 1 - .../parts-order-modal.container.jsx | 1 - .../parts-status-pie.component.jsx | 1 - .../payment-form/payment-form.component.jsx | 1 - .../payment-modal/payment-modal.container.jsx | 9 +- .../payments-export-all-button.component.jsx | 1 - .../production-board-kanban.component.jsx | 6 +- .../production-board-kanban.utils.js | 1 - ...tion-list-save-config-button.component.jsx | 1 - .../schedule-job-modal.component.jsx | 2 - .../scoreboard-display.component.jsx | 2 - .../shop-employees.container.jsx | 3 +- ...-template-editor-save-button.component.jsx | 1 - .../shop-template-editor.component.jsx | 5 +- .../time-ticket-modal.component.jsx | 7 +- .../time-ticket-shift-form.container.jsx | 10 +- ...me-tickets-summary-employees.component.jsx | 4 - .../vehicle-tag-popover.component.jsx | 36 +- client/src/graphql/jobs.queries.js | 5 +- .../jobs-detail.page.component.jsx | 56 ++- .../src/pages/manage/manage.page.styles.scss | 1 + .../production-board.container.jsx | 2 +- .../production-list.container.jsx | 2 +- client/src/redux/user/user.sagas.js | 2 +- client/src/translations/en_us/common.json | 56 +-- client/src/translations/es/common.json | 16 +- client/src/translations/fr/common.json | 16 +- .../down.yaml | 5 + .../up.yaml | 5 + .../down.yaml | 257 ++++++++++ .../up.yaml | 258 ++++++++++ .../down.yaml | 258 ++++++++++ .../up.yaml | 259 +++++++++++ .../down.yaml | 257 ++++++++++ .../up.yaml | 258 ++++++++++ .../down.yaml | 5 + .../up.yaml | 5 + .../down.yaml | 5 + .../up.yaml | 5 + .../down.yaml | 258 ++++++++++ .../up.yaml | 260 +++++++++++ .../down.yaml | 259 +++++++++++ .../up.yaml | 261 +++++++++++ .../down.yaml | 258 ++++++++++ .../up.yaml | 260 +++++++++++ hasura/migrations/metadata.yaml | 9 + server/firebase/firebase-handler.js | 9 +- server/stripe/payment.js | 6 +- server/tech/tech.js | 8 - 79 files changed, 4119 insertions(+), 909 deletions(-) delete mode 100644 client/src/components/jobs-detail-claims/jobs-detail-claims.component.jsx delete mode 100644 client/src/components/jobs-detail-financial/jobs-detail-financial.component.jsx rename client/src/components/{jobs-detail-insurance/jobs-detail-insurance.component.jsx => jobs-detail-general/jobs-detail-general.component.jsx} (60%) create mode 100644 client/src/components/jobs-detail-rates/jobs-detail-rates.component.jsx create mode 100644 client/src/components/jobs-detail-totals/jobs-detail-totals.component.jsx create mode 100644 hasura/migrations/1597777830351_alter_table_public_jobs_add_column_tax_registration_number/down.yaml create mode 100644 hasura/migrations/1597777830351_alter_table_public_jobs_add_column_tax_registration_number/up.yaml create mode 100644 hasura/migrations/1597777848218_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1597777848218_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1597777863211_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1597777863211_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1597777876008_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1597777876008_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1597779262877_alter_table_public_jobs_add_column_class/down.yaml create mode 100644 hasura/migrations/1597779262877_alter_table_public_jobs_add_column_class/up.yaml create mode 100644 hasura/migrations/1597779499987_alter_table_public_jobs_add_column_category/down.yaml create mode 100644 hasura/migrations/1597779499987_alter_table_public_jobs_add_column_category/up.yaml create mode 100644 hasura/migrations/1597779720123_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1597779720123_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1597779769450_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1597779769450_update_permission_user_public_table_jobs/up.yaml create mode 100644 hasura/migrations/1597779780370_update_permission_user_public_table_jobs/down.yaml create mode 100644 hasura/migrations/1597779780370_update_permission_user_public_table_jobs/up.yaml diff --git a/admin/src/components/auth-provider/auth-provider.js b/admin/src/components/auth-provider/auth-provider.js index 23eef0952..2adf29d50 100644 --- a/admin/src/components/auth-provider/auth-provider.js +++ b/admin/src/components/auth-provider/auth-provider.js @@ -9,7 +9,6 @@ const authProvider = { password ); const token = await user.getIdToken(true); - console.log("token", token); localStorage.setItem("token", token); return Promise.resolve(); } catch (error) { @@ -23,23 +22,17 @@ const authProvider = { return Promise.resolve(); }, checkAuth: async (params) => { - console.log("Check Auth", params); const user = await getCurrentUser(); if (!!user) { - console.log("AuthProvider => checkAuth => Authorized"); return Promise.resolve(); } else { - console.log("AuthProvider => checkAuth => Unauthorized"); - return Promise.reject(); } }, checkError: (error) => { - console.log("Check error"); return Promise.resolve(); }, getPermissions: (params) => { - console.log("get permissions", params); return Promise.resolve(); }, }; diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index fbdb90c09..4ed4779f1 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -10625,6 +10625,27 @@ + + category + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + ccc false @@ -10772,6 +10793,27 @@ + + class + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + clm_no false @@ -13129,6 +13171,27 @@ + + tax_registration_number + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + towing_payable false @@ -13302,27 +13365,6 @@ - - dedinfo - false - - - - - - en-US - false - - - es-MX - false - - - fr-CA - false - - - estdates false @@ -13344,27 +13386,6 @@ - - inscoinfo - false - - - - - - en-US - false - - - es-MX - false - - - fr-CA - false - - - laborrates false @@ -13407,6 +13428,27 @@ + + other + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + repairdates false @@ -14372,6 +14414,27 @@ + + labortotals + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + lines false @@ -16172,28 +16235,7 @@ - financials - false - - - - - - en-US - false - - - es-MX - false - - - fr-CA - false - - - - - insurance + general false @@ -16255,6 +16297,27 @@ + + rates + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + repairdata false @@ -16276,6 +16339,27 @@ + + totals + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + diff --git a/client/src/App/App.jsx b/client/src/App/App.jsx index 1ce5d674c..8f9d0f40e 100644 --- a/client/src/App/App.jsx +++ b/client/src/App/App.jsx @@ -41,7 +41,7 @@ export function App({ checkUserSession, currentUser }) { }, [checkUserSession]); const b = Grid.useBreakpoint(); - console.log("Breakpoints:", b); + // console.log("Breakpoints:", b); const { t } = useTranslation(); diff --git a/client/src/components/allocations-assignment/allocations-assignment.component.test.js b/client/src/components/allocations-assignment/allocations-assignment.component.test.js index abb5aa466..495f7e1e1 100644 --- a/client/src/components/allocations-assignment/allocations-assignment.component.test.js +++ b/client/src/components/allocations-assignment/allocations-assignment.component.test.js @@ -15,7 +15,7 @@ describe("AllocationsAssignmentComponent component", () => { assignment: {}, setAssignment: jest.fn(), visibilityState: [false, jest.fn()], - maxHours: 4 + maxHours: 4, }; wrapper = mount(); @@ -27,7 +27,6 @@ describe("AllocationsAssignmentComponent component", () => { it("should render a list of employees", () => { const empList = wrapper.find("#employeeSelector"); - console.log(empList.debug()); expect(empList.children()).to.have.lengthOf(2); }); diff --git a/client/src/components/allocations-bulk-assignment/allocations-bulk-assignment.component.jsx b/client/src/components/allocations-bulk-assignment/allocations-bulk-assignment.component.jsx index 4682320d2..9c0bef386 100644 --- a/client/src/components/allocations-bulk-assignment/allocations-bulk-assignment.component.jsx +++ b/client/src/components/allocations-bulk-assignment/allocations-bulk-assignment.component.jsx @@ -6,7 +6,7 @@ import { createStructuredSelector } from "reselect"; import { selectBodyshop } from "../../redux/user/user.selectors"; const mapStateToProps = createStructuredSelector({ - bodyshop: selectBodyshop + bodyshop: selectBodyshop, }); export default connect( @@ -18,12 +18,11 @@ export default connect( handleAssignment, assignment, setAssignment, - visibilityState + visibilityState, }) { const { t } = useTranslation(); - const onChange = e => { - console.log("e", e); + const onChange = (e) => { setAssignment({ ...assignment, employeeid: e }); }; @@ -34,13 +33,14 @@ export default connect( diff --git a/client/src/components/contract-license-decode-button/contract-license-decode-button.component.jsx b/client/src/components/contract-license-decode-button/contract-license-decode-button.component.jsx index 96b8b05f9..90e7fbaa4 100644 --- a/client/src/components/contract-license-decode-button/contract-license-decode-button.component.jsx +++ b/client/src/components/contract-license-decode-button/contract-license-decode-button.component.jsx @@ -12,13 +12,11 @@ export default function ContractLicenseDecodeButton({ form }) { const [modalVisible, setModalVisible] = useState(false); const [loading, setLoading] = useState(false); const [decodedBarcode, setDecodedBarcode] = useState(null); - console.log("form", form); const handleDecode = (e) => { logImEXEvent("contract_license_decode"); setLoading(true); const aamvaParse = aamva.parse(e.currentTarget.value); - console.log("AAMVA", aamvaParse); setDecodedBarcode(aamvaParse); setLoading(false); }; @@ -61,7 +59,8 @@ export default function ContractLicenseDecodeButton({ form }) { okText={t("contracts.actions.senddltoform")} onOk={handleInsertForm} okButtonProps={{ disabled: !!!decodedBarcode }} - onCancel={handleCancel}> + onCancel={handleCancel} + >
({ export function DashboardGridComponent({ currentUser, bodyshop }) { const { loading, error, data } = useQuery(QUERY_DASHBOARD_DETAILS); - console.log("DashboardGridComponent -> data", data) const { t } = useTranslation(); const [state, setState] = useState({ layout: bodyshop.associations[0].user.dashboardlayout || [ @@ -70,7 +69,6 @@ export function DashboardGridComponent({ currentUser, bodyshop }) { const idxToRemove = state.layout.findIndex((i) => i.i === key); const newLayout = state.layout; newLayout.splice(idxToRemove, 1); - console.log(newLayout); handleLayoutChange(newLayout); }; @@ -100,14 +98,15 @@ export function DashboardGridComponent({ currentUser, bodyshop }) { + disabled={existingLayoutKeys.includes(key)} + > {componentList[key].label} ))} ); - if (error) return ; + if (error) return ; return (
@@ -115,12 +114,13 @@ export function DashboardGridComponent({ currentUser, bodyshop }) { + onBreakpointChange={onBreakpointChange} + > {state.layout.map((item, index) => { const TheComponent = componentList[item.i].component; return ( @@ -139,8 +139,8 @@ export function DashboardGridComponent({ currentUser, bodyshop }) { onClick={() => handleRemoveComponent(item.i)} /> diff --git a/client/src/components/email-overlay/email-overlay.container.jsx b/client/src/components/email-overlay/email-overlay.container.jsx index 46b82f493..9432380c5 100644 --- a/client/src/components/email-overlay/email-overlay.container.jsx +++ b/client/src/components/email-overlay/email-overlay.container.jsx @@ -62,7 +62,6 @@ export function EmailOverlayContainer({ }; attachments.push(t); }); - console.log("messageOptions", messageOptions); setSending(true); try { diff --git a/client/src/components/form-fields-changed-alert/form-fields-changed-alert.component.jsx b/client/src/components/form-fields-changed-alert/form-fields-changed-alert.component.jsx index 04c4415db..b040db770 100644 --- a/client/src/components/form-fields-changed-alert/form-fields-changed-alert.component.jsx +++ b/client/src/components/form-fields-changed-alert/form-fields-changed-alert.component.jsx @@ -21,7 +21,6 @@ export default function FormsFieldChanged({ form }) { { - //console.log("location", location); if (loc.pathname === location.pathname) return false; return t("general.messages.unsavedchangespopup"); }} diff --git a/client/src/components/invoice-enter-modal/invoice-enter-modal.container.jsx b/client/src/components/invoice-enter-modal/invoice-enter-modal.container.jsx index bbe5e49a7..5078a0029 100644 --- a/client/src/components/invoice-enter-modal/invoice-enter-modal.container.jsx +++ b/client/src/components/invoice-enter-modal/invoice-enter-modal.container.jsx @@ -38,8 +38,6 @@ function InvoiceEnterModalContainer({ const [loading, setLoading] = useState(false); const handleFinish = (values) => { - console.log("handleFinish -> values", values); - setLoading(true); const { upload, ...remainingValues } = values; insertInvoice({ @@ -48,11 +46,6 @@ function InvoiceEnterModalContainer({ Object.assign({}, remainingValues, { invoicelines: { data: remainingValues.invoicelines.map((i) => { - console.log( - "Initial insert value", - i.joblineid, - i.joblineid === "noline" - ); return { ...i, joblineid: i.joblineid === "noline" ? null : i.joblineid, diff --git a/client/src/components/invoice-export-all-button/invoice-export-all-button.component.jsx b/client/src/components/invoice-export-all-button/invoice-export-all-button.component.jsx index afcfe25c2..2c2c1f5cc 100644 --- a/client/src/components/invoice-export-all-button/invoice-export-all-button.component.jsx +++ b/client/src/components/invoice-export-all-button/invoice-export-all-button.component.jsx @@ -42,7 +42,6 @@ export function InvoiceExportAllButton({ }, } ); - console.log("handle -> XML", QbXmlResponse); } catch (error) { console.log("Error getting QBXML from Server.", error); notification["error"]({ @@ -121,7 +120,8 @@ export function InvoiceExportAllButton({ onClick={handleQbxml} loading={loading} disabled={disabled} - type='dashed'> + type="dashed" + > {t("jobs.actions.exportselected")} ); diff --git a/client/src/components/invoice-export-button/invoice-export-button.component.jsx b/client/src/components/invoice-export-button/invoice-export-button.component.jsx index 974d147f0..24a241724 100644 --- a/client/src/components/invoice-export-button/invoice-export-button.component.jsx +++ b/client/src/components/invoice-export-button/invoice-export-button.component.jsx @@ -41,7 +41,6 @@ export function InvoiceExportButton({ }, } ); - console.log("handle -> XML", QbXmlResponse); } catch (error) { console.log("Error getting QBXML from Server.", error); notification["error"]({ @@ -118,7 +117,8 @@ export function InvoiceExportButton({ onClick={handleQbxml} loading={loading} disabled={disabled} - type='dashed'> + type="dashed" + > {t("jobs.actions.export")} ); diff --git a/client/src/components/invoice-form/invoice-form.component.jsx b/client/src/components/invoice-form/invoice-form.component.jsx index 33747887b..b57764fda 100644 --- a/client/src/components/invoice-form/invoice-form.component.jsx +++ b/client/src/components/invoice-form/invoice-form.component.jsx @@ -159,7 +159,6 @@ export default function InvoiceFormComponent({ style={{ display: invoiceEdit ? "none" : null }} valuePropName="fileList" getValueFromEvent={(e) => { - console.log("Upload event:", e); if (Array.isArray(e)) { return e; } diff --git a/client/src/components/invoices-list-table/invoices-list-table.component.jsx b/client/src/components/invoices-list-table/invoices-list-table.component.jsx index fe9bf37ad..324fc81ab 100644 --- a/client/src/components/invoices-list-table/invoices-list-table.component.jsx +++ b/client/src/components/invoices-list-table/invoices-list-table.component.jsx @@ -208,19 +208,12 @@ export function InvoicesListTableComponent({ ]; const handleOnInvoiceRowclick = (selectedRows) => { - console.log("selectedRows", selectedRows); - console.log("record.id", record.id); setSelectedInvoiceLinesByInvoice({ ...selectedInvoiceLinesByInvoice, [record.id]: selectedRows.map((r) => r.id), }); }; - console.log( - "selectedInvoiceLinesByInvoice[record.id]", - selectedInvoiceLinesByInvoice[record.id] - ); - return (
{`${t("invoices.fields.invoice_number")} ${ diff --git a/client/src/components/job-costing-modal/job-costing-modal.component.jsx b/client/src/components/job-costing-modal/job-costing-modal.component.jsx index d0c673f3a..1bd3d802a 100644 --- a/client/src/components/job-costing-modal/job-costing-modal.component.jsx +++ b/client/src/components/job-costing-modal/job-costing-modal.component.jsx @@ -20,11 +20,6 @@ export function JobCostingModalComponent({ bodyshop, job }) { const jobLineTotalsByProfitCenter = job.joblines.reduce( (acc, val) => { const laborProfitCenter = defaultProfits[val.mod_lbr_ty] || "?"; - // if (!!!laborProfitCenter) - // console.log( - // "Unknown cost/profit center mapping for labor.", - // val.mod_lbr_ty - // ); const rateName = `rate_${(val.mod_lbr_ty || "").toLowerCase()}`; const laborAmount = Dinero({ diff --git a/client/src/components/job-detail-cards/job-detail-cards.parts.component.jsx b/client/src/components/job-detail-cards/job-detail-cards.parts.component.jsx index 302fa1ee3..368213170 100644 --- a/client/src/components/job-detail-cards/job-detail-cards.parts.component.jsx +++ b/client/src/components/job-detail-cards/job-detail-cards.parts.component.jsx @@ -15,7 +15,6 @@ export default function JobDetailCardsPartsComponent({ loading, data }) { joblines_status, ]); - console.log("memoizedData :>> ", memoizedData); const [state, setState] = useState({ activeIndex: 0 }); const onPieEnter = (data, index) => { @@ -47,8 +46,6 @@ export default function JobDetailCardsPartsComponent({ loading, data }) { } const Calculatedata = (data) => { - console.log("calculating data", data); - if (data.length > 0) { const statusMapping = {}; data.map((i) => { 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 61d22dbb1..1815dc005 100644 --- a/client/src/components/job-detail-lines/job-lines.component.jsx +++ b/client/src/components/job-detail-lines/job-lines.component.jsx @@ -267,7 +267,6 @@ export function JobLinesComponent({ ]; const handleTableChange = (pagination, filters, sorter) => { - console.log("filters", filters); setState({ ...state, filteredInfo: filters, sortedInfo: sorter }); }; diff --git a/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx b/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx index f28801ff7..0cffe85a8 100644 --- a/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx +++ b/client/src/components/job-employee-assignments/job-employee-assignments.component.jsx @@ -67,62 +67,77 @@ export function JobEmployeeAssignments({ return (
- - {body ? ( -
- {`${body.first_name || ""} ${body.last_name || ""}`} - handleRemove("body")} +
+ + {body ? ( +
+ {`${body.first_name || ""} ${ + body.last_name || "" + }`} + handleRemove("body")} + /> +
+ ) : ( + { + setAssignment({ operation: "body" }); + setVisibility(true); + }} /> -
- ) : ( - { - setAssignment({ operation: "body" }); - setVisibility(true); - }} - /> - )} - - - {prep ? ( -
- {`${prep.first_name || ""} ${prep.last_name || ""}`} - handleRemove("prep")} + )} + + + {prep ? ( +
+ {`${prep.first_name || ""} ${ + prep.last_name || "" + }`} + handleRemove("prep")} + /> +
+ ) : ( + { + setAssignment({ operation: "prep" }); + setVisibility(true); + }} /> -
- ) : ( - { - setAssignment({ operation: "prep" }); - setVisibility(true); - }} - /> - )} -
- - {refinish ? ( -
- {`${refinish.first_name || ""} ${ - refinish.last_name || "" - }`} - handleRemove("refinish")} + )} + + + {refinish ? ( +
+ {`${refinish.first_name || ""} ${ + refinish.last_name || "" + }`} + handleRemove("refinish")} + /> +
+ ) : ( + { + setAssignment({ operation: "refinish" }); + setVisibility(true); + }} /> -
- ) : ( - { - setAssignment({ operation: "refinish" }); - setVisibility(true); - }} - /> - )} -
+ )} + +
); diff --git a/client/src/components/job-intake/components/job-intake-form/job-intake-form.component.jsx b/client/src/components/job-intake/components/job-intake-form/job-intake-form.component.jsx index 0f404c3b1..07a3b52f1 100644 --- a/client/src/components/job-intake/components/job-intake-form/job-intake-form.component.jsx +++ b/client/src/components/job-intake/components/job-intake-form/job-intake-form.component.jsx @@ -30,7 +30,6 @@ export function JobIntakeForm({ formItems, bodyshop }) { const search = queryString.parse(useLocation().search); const handleFinish = async (values) => { - console.log("values", values); setLoading(true); logImEXEvent("job_complete_intake"); @@ -71,7 +70,6 @@ export function JobIntakeForm({ formItems, bodyshop }) { }), }); } - console.log("handleFinish -> result", result); setLoading(false); }; diff --git a/client/src/components/job-reconciliation-modal/job-reconciliation-modal.component.jsx b/client/src/components/job-reconciliation-modal/job-reconciliation-modal.component.jsx index 36cb1dd21..83ba63f83 100644 --- a/client/src/components/job-reconciliation-modal/job-reconciliation-modal.component.jsx +++ b/client/src/components/job-reconciliation-modal/job-reconciliation-modal.component.jsx @@ -16,11 +16,6 @@ export default function JobReconciliationModalComponent({ job, invoices }) { ) .flat() || []; - console.log( - "JobReconciliationModalComponent -> invoiceLineData", - invoiceLineData - ); - const jobLineData = job.joblines.filter((j) => j.part_type !== null); return ( diff --git a/client/src/components/job-totals-table/job-totals-table.component.jsx b/client/src/components/job-totals-table/job-totals-table.component.jsx index 37426d850..b8655de2b 100644 --- a/client/src/components/job-totals-table/job-totals-table.component.jsx +++ b/client/src/components/job-totals-table/job-totals-table.component.jsx @@ -1,4 +1,4 @@ -import { Statistic } from "antd"; +import { Statistic, Typography, Row, Col } from "antd"; import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; import { connect } from "react-redux"; @@ -13,6 +13,11 @@ const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, }); +const colSpan = { + md: { span: 24 }, + lg: { span: 12 }, +}; + export function JobsTotalsTableComponent({ bodyshop, job }) { const { t } = useTranslation(); const [totals, setTotals] = useState(null); @@ -26,194 +31,251 @@ export function JobsTotalsTableComponent({ bodyshop, job }) { } return ( -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{t("jobs.labels.rates")}$
{t("jobs.fields.rate_laa")}{totals.rates.laa.total.toFormat()}{`(${totals.rates.laa.hours.toFixed(2)} @ ${ - totals.rates.laa.rate - })`}
{t("jobs.fields.rate_lab")}{totals.rates.lab.total.toFormat()}{`(${totals.rates.lab.hours.toFixed(2)} @ ${ - totals.rates.lab.rate - })`}
{t("jobs.fields.rate_lad")}{totals.rates.lad.total.toFormat()}{`(${totals.rates.lad.hours.toFixed(2)} @ ${ - totals.rates.lad.rate - })`}
{t("jobs.fields.rate_lae")}{totals.rates.lae.total.toFormat()}{`(${totals.rates.lae.hours.toFixed(2)} @ ${ - totals.rates.lae.rate - })`}
{t("jobs.fields.rate_laf")}{totals.rates.laf.total.toFormat()}{`(${totals.rates.laf.hours.toFixed(2)} @ ${ - totals.rates.laf.rate - })`}
{t("jobs.fields.rate_lag")}{totals.rates.lag.total.toFormat()}{`(${totals.rates.lag.hours.toFixed(2)} @ ${ - totals.rates.lag.rate - })`}
{t("jobs.fields.rate_lam")}{totals.rates.lam.total.toFormat()}{`(${totals.rates.lam.hours.toFixed(2)} @ ${ - totals.rates.lam.rate - })`}
{t("jobs.fields.rate_lar")}{totals.rates.lar.total.toFormat()}{`(${totals.rates.lar.hours.toFixed(2)} @ ${ - totals.rates.lar.rate - })`}
{t("jobs.fields.rate_las")}{totals.rates.las.total.toFormat()}{`(${totals.rates.las.hours.toFixed(2)} @ ${ - totals.rates.las.rate - })`}
{t("jobs.fields.rate_lau")}{totals.rates.lau.total.toFormat()}{`(${totals.rates.lau.hours.toFixed(2)} @ ${ - totals.rates.lau.rate - })`}
{t("jobs.fields.rate_la1")}{totals.rates.la1.total.toFormat()}{`(${totals.rates.la1.hours.toFixed(2)} @ ${ - totals.rates.la1.rate - })`}
{t("jobs.fields.rate_la2")}{totals.rates.la2.total.toFormat()}{`(${totals.rates.la2.hours.toFixed(2)} @ ${ - totals.rates.la2.rate - })`}
{t("jobs.fields.rate_la3")}{totals.rates.la3.total.toFormat()}{`(${totals.rates.la3.hours.toFixed(2)} @ ${ - totals.rates.la3.rate - })`}
{t("jobs.fields.rate_la4")}{totals.rates.la4.total.toFormat()}{`(${totals.rates.la4.hours.toFixed(2)} @ ${ - totals.rates.la4.rate - })`}
{t("jobs.fields.rate_atp")}{totals.rates.atp.total.toFormat()}{`(${totals.rates.atp.hours.toFixed(2)} @ ${ - totals.rates.atp.rate - })`}
{t("jobs.labels.mapa")}{totals.rates.mapa.total.toFormat()}{`(${totals.rates.mapa.hours.toFixed(2)} @ ${ - totals.rates.mapa.rate - })`}
{t("jobs.labels.mash")}{totals.rates.mash.total.toFormat()}{`(${totals.rates.mash.hours.toFixed(2)} @ ${ - totals.rates.mash.rate - })`}
{t("jobs.labels.rates_subtotal")}{totals.rates.subtotal.toFormat()}
- - - - - - - - - - - - - -
{t("jobs.labels.partstotal")}{totals.parts.parts.total.toFormat()}{`(${totals.parts.parts.subtotal.toFormat()} ± ${totals.parts.parts.adjustments.toFormat()})`}
{t("jobs.labels.subletstotal")}{totals.parts.sublets.total.toFormat()}{`(${totals.parts.sublets.subtotal.toFormat()} ± ${totals.parts.sublets.adjustments.toFormat()})`}
-
-
{ - if (e.detail === 3) { - try { - console.log("Job", job); - } catch { - console.log("Unable to show job."); - } - } - }}> - - - - - - -
+
+ + +
+ + {t("jobs.labels.labortotals")} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{t("jobs.fields.rate_laa")} + {totals.rates.laa.total.toFormat()} + {`(${totals.rates.laa.hours.toFixed(2)} @ ${ + totals.rates.laa.rate + })`}
{t("jobs.fields.rate_lab")} + {totals.rates.lab.total.toFormat()} + {`(${totals.rates.lab.hours.toFixed(2)} @ ${ + totals.rates.lab.rate + })`}
{t("jobs.fields.rate_lad")} + {totals.rates.lad.total.toFormat()} + {`(${totals.rates.lad.hours.toFixed(2)} @ ${ + totals.rates.lad.rate + })`}
{t("jobs.fields.rate_lae")} + {totals.rates.lae.total.toFormat()} + {`(${totals.rates.lae.hours.toFixed(2)} @ ${ + totals.rates.lae.rate + })`}
{t("jobs.fields.rate_laf")} + {totals.rates.laf.total.toFormat()} + {`(${totals.rates.laf.hours.toFixed(2)} @ ${ + totals.rates.laf.rate + })`}
{t("jobs.fields.rate_lag")} + {totals.rates.lag.total.toFormat()} + {`(${totals.rates.lag.hours.toFixed(2)} @ ${ + totals.rates.lag.rate + })`}
{t("jobs.fields.rate_lam")} + {totals.rates.lam.total.toFormat()} + {`(${totals.rates.lam.hours.toFixed(2)} @ ${ + totals.rates.lam.rate + })`}
{t("jobs.fields.rate_lar")} + {totals.rates.lar.total.toFormat()} + {`(${totals.rates.lar.hours.toFixed(2)} @ ${ + totals.rates.lar.rate + })`}
{t("jobs.fields.rate_las")} + {totals.rates.las.total.toFormat()} + {`(${totals.rates.las.hours.toFixed(2)} @ ${ + totals.rates.las.rate + })`}
{t("jobs.fields.rate_lau")} + {totals.rates.lau.total.toFormat()} + {`(${totals.rates.lau.hours.toFixed(2)} @ ${ + totals.rates.lau.rate + })`}
{t("jobs.fields.rate_la1")} + {totals.rates.la1.total.toFormat()} + {`(${totals.rates.la1.hours.toFixed(2)} @ ${ + totals.rates.la1.rate + })`}
{t("jobs.fields.rate_la2")} + {totals.rates.la2.total.toFormat()} + {`(${totals.rates.la2.hours.toFixed(2)} @ ${ + totals.rates.la2.rate + })`}
{t("jobs.fields.rate_la3")} + {totals.rates.la3.total.toFormat()} + {`(${totals.rates.la3.hours.toFixed(2)} @ ${ + totals.rates.la3.rate + })`}
{t("jobs.fields.rate_la4")} + {totals.rates.la4.total.toFormat()} + {`(${totals.rates.la4.hours.toFixed(2)} @ ${ + totals.rates.la4.rate + })`}
{t("jobs.fields.rate_atp")} + {totals.rates.atp.total.toFormat()} + {`(${totals.rates.atp.hours.toFixed(2)} @ ${ + totals.rates.atp.rate + })`}
{t("jobs.labels.rates_subtotal")}{totals.rates.subtotal.toFormat()}
+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + +
{t("jobs.labels.partstotal")} + {totals.parts.parts.total.toFormat()} + {`(${totals.parts.parts.subtotal.toFormat()} ± ${totals.parts.parts.adjustments.toFormat()})`}
{t("jobs.labels.subletstotal")} + {totals.parts.sublets.total.toFormat()} + {`(${totals.parts.sublets.subtotal.toFormat()} ± ${totals.parts.sublets.adjustments.toFormat()})`}
{t("jobs.labels.mapa")} + {totals.rates.mapa.total.toFormat()} + {`(${totals.rates.mapa.hours.toFixed(2)} @ ${ + totals.rates.mapa.rate + })`}
{t("jobs.labels.mash")} + {totals.rates.mash.total.toFormat()} + {`(${totals.rates.mash.hours.toFixed(2)} @ ${ + totals.rates.mash.rate + })`}
+
{ + if (e.detail === 3) { + try { + console.log("Job", job); + } catch { + console.log("Unable to show job."); + } + } + }} + > + + + +
+
{ + if (e.detail === 3) { + try { + console.log("Job", job); + } catch { + console.log("Unable to show job."); + } + } + }} + > + + + +
+
+ +
); } diff --git a/client/src/components/job-totals-table/job-totals-table.styles.scss b/client/src/components/job-totals-table/job-totals-table.styles.scss index 633d5be07..8a68d651b 100644 --- a/client/src/components/job-totals-table/job-totals-table.styles.scss +++ b/client/src/components/job-totals-table/job-totals-table.styles.scss @@ -1,24 +1,38 @@ -.job-totals-container { - display: flex; - flex-flow: wrap; -} -.job-totals-tables { +.job-totals-half { flex: 1; - display: block; -} + display: flex; + flex-direction: column; + align-items: center; -.job-totals-rates-table, -.job-totals-parts-table { - border: black; - width: 100%; + table { + border: 1px solid #ccc; + border-collapse: collapse; + margin: 0; + padding: 0; + width: 80%; + table-layout: fixed; + } + + table tr { + //background-color: #f8f8f8; + border: 1px solid #ddd; + padding: 0.35em; + } + + table th, + table td { + padding: 0.625em; + //text-align: center; + } + table td.currency { + text-align: right; + } } .job-totals-stats { margin: 1rem; display: flex; - flex-direction: column; - align-content: center; - .ant-statistic { - margin: 0.5rem; - } + width: 100%; + //flex-direction: column; + justify-content: space-evenly; } diff --git a/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx b/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx index 327b488ea..f2cbadd80 100644 --- a/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx +++ b/client/src/components/jobs-available-supplement/jobs-available-supplement.container.jsx @@ -67,7 +67,6 @@ export function JobsAvailableSupplementContainer({ } else { //create upsert job let supp = estData.data.available_jobs_by_pk.est_data; - console.log("supp before", supp); delete supp.owner; delete supp.vehicle; @@ -140,11 +139,12 @@ export function JobsAvailableSupplementContainer({ setSelectedJob(null); }; - if (error) return ; + if (error) return ; return ( + message={t("jobs.labels.creating_new_job")} + > ({ - //setUserLanguage: language => dispatch(setUserLanguage(language)) -}); - -export function JobsDetailClaims({ bodyshop, job }) { - const { t } = useTranslation(); - - return ( -
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
- ); -} -export default connect(mapStateToProps, mapDispatchToProps)(JobsDetailClaims); diff --git a/client/src/components/jobs-detail-financial/jobs-detail-financial.component.jsx b/client/src/components/jobs-detail-financial/jobs-detail-financial.component.jsx deleted file mode 100644 index defe02ec8..000000000 --- a/client/src/components/jobs-detail-financial/jobs-detail-financial.component.jsx +++ /dev/null @@ -1,215 +0,0 @@ -import { Col, Divider, Form, Row, Select } from "antd"; -import React from "react"; -import { useTranslation } from "react-i18next"; -import { connect } from "react-redux"; -import { createStructuredSelector } from "reselect"; -import { selectBodyshop } from "../../redux/user/user.selectors"; -import CurrencyFormatter from "../../utils/CurrencyFormatter"; -import { DateTimeFormatter } from "../../utils/DateFormatter"; -import CurrencyInput from "../form-items-formatted/currency-form-item.component"; -import JobTotalsTable from "../job-totals-table/job-totals-table.component"; -import FormRow from "../layout-form-row/layout-form-row.component"; - -const mapStateToProps = createStructuredSelector({ - bodyshop: selectBodyshop, -}); - -const stripeTestEnv = process.env.REACT_APP_STRIPE_PUBLIC_KEY; //.includes("test"); - -export function JobsDetailFinancials({ job, bodyshop }) { - const { t } = useTranslation(); - - const colSpan = { - sm: { span: 24 }, - lg: { span: 12 }, - }; - - return ( -
- - - - - - - - - - - - - - - - - {job.payments.map((p, idx) => ( - - - - - - - - - - ))} - -
{t("payments.fields.created_at")}{t("payments.fields.payer")}{t("payments.fields.amount")}{t("payments.fields.memo")}{t("payments.fields.type")}{t("payments.fields.transactionid")}{t("payments.fields.stripeid")}
- {p.created_at} - {p.payer} - {p.amount} - {p.memo}{p.type}{p.transactionid} - {p.stripeid ? ( - - {p.stripeid} - - ) : null} -
-
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- ); -} -export default connect(mapStateToProps, null)(JobsDetailFinancials); diff --git a/client/src/components/jobs-detail-insurance/jobs-detail-insurance.component.jsx b/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx similarity index 60% rename from client/src/components/jobs-detail-insurance/jobs-detail-insurance.component.jsx rename to client/src/components/jobs-detail-general/jobs-detail-general.component.jsx index 6c2694a5a..c36d6d9c3 100644 --- a/client/src/components/jobs-detail-insurance/jobs-detail-insurance.component.jsx +++ b/client/src/components/jobs-detail-general/jobs-detail-general.component.jsx @@ -1,19 +1,56 @@ -import { Form, Input } from "antd"; +import { Form, Input, InputNumber, Select, Switch } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectBodyshop } from "../../redux/user/user.selectors"; import FormDatePicker from "../form-date-picker/form-date-picker.component"; +import CurrencyInput from "../form-items-formatted/currency-form-item.component"; import FormItemEmail from "../form-items-formatted/email-form-item.component"; import FormItemPhone from "../form-items-formatted/phone-form-item.component"; import Car from "../job-damage-visual/job-damage-visual.component"; import FormRow from "../layout-form-row/layout-form-row.component"; -export default function JobsDetailInsurance({ job, form }) { +const mapStateToProps = createStructuredSelector({ + //currentUser: selectCurrentUser + bodyshop: selectBodyshop, +}); +const mapDispatchToProps = (dispatch) => ({ + //setUserLanguage: language => dispatch(setUserLanguage(language)) +}); + +export function JobsDetailGeneral({ bodyshop, job, form }) { const { getFieldValue } = form; const { t } = useTranslation(); return (
- + + + + + + + + + + + + + + + + @@ -47,19 +84,21 @@ export default function JobsDetailInsurance({ job, form }) { > - - - - - - - - - - + + - + +
{job.area_of_damage ? ( + + + + + + + + + + + + + + + + + + @@ -103,10 +167,15 @@ export default function JobsDetailInsurance({ job, form }) { - - + + + + + - TODO: Adding servicing/selling dealer contact info?
); } +export default connect(mapStateToProps, mapDispatchToProps)(JobsDetailGeneral); 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 d405da441..08891ade7 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 @@ -39,8 +39,6 @@ export default function DuplicateJob( variables: { job: [existingJob] }, }) .then((res2) => { - console.log("res2", res2); - if (completionCallback) completionCallback(res2.data.insert_jobs.returning[0].id); }); diff --git a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx index 165235fe0..ad97bbea0 100644 --- a/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx +++ b/client/src/components/jobs-detail-header/jobs-detail-header.component.jsx @@ -1,19 +1,8 @@ import { DownCircleFilled, PrinterFilled } from "@ant-design/icons"; -import { - Button, - Checkbox, - Descriptions, - Dropdown, - Menu, - notification, - PageHeader, - Tag, -} from "antd"; +import { Button, Dropdown, Menu, notification, PageHeader, Tag } from "antd"; import React from "react"; import { useTranslation } from "react-i18next"; -import Moment from "react-moment"; import { connect } from "react-redux"; -import { Link } from "react-router-dom"; import { createStructuredSelector } from "reselect"; import { setModalContext } from "../../redux/modals/modals.actions"; import { selectBodyshop } from "../../redux/user/user.selectors"; @@ -21,9 +10,8 @@ import CurrencyFormatter from "../../utils/CurrencyFormatter"; import JobsDetailHeaderActions from "../jobs-detail-header-actions/jobs-detail-header-actions.component"; import OwnerTagPopoverComponent from "../owner-tag-popover/owner-tag-popover.component"; import VehicleTagPopoverComponent from "../vehicle-tag-popover/vehicle-tag-popover.component"; -import JobEmployeeAssignments from "../job-employee-assignments/job-employee-assignments.container"; import "./jobs-detail-header.styles.scss"; -import { DateTimeFormatter } from "../../utils/DateFormatter"; +import JobEmployeeAssignments from "../job-employee-assignments/job-employee-assignments.container"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, @@ -136,67 +124,22 @@ export function JobsDetailHeader({ > {t("jobs.labels.inproduction")} , + + {job.clm_total} + , + + {job.owner_owing} + , ]} extra={menuExtra} > - - - {job.clm_total} - - - - {job.owner_owing} - - - - - - - - {job.scheduled_completion ? ( - {job.scheduled_completion} - ) : null} - - - - {job.cccontracts && - job.cccontracts.map((item) => ( - -
-
{`${item.courtesycar.year} ${item.courtesycar.make} ${item.courtesycar.model} (${item.courtesycar.plate})`}
-
- {item.start} - -- - - {item.scheduledreturn} - -
-
- - ))} -
- - - -
+
+ +
); } diff --git a/client/src/components/jobs-detail-rates/jobs-detail-rates.component.jsx b/client/src/components/jobs-detail-rates/jobs-detail-rates.component.jsx new file mode 100644 index 000000000..c1facb85b --- /dev/null +++ b/client/src/components/jobs-detail-rates/jobs-detail-rates.component.jsx @@ -0,0 +1,139 @@ +import { Col, Divider, Form, Row, Select } from "antd"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +import CurrencyFormatter from "../../utils/CurrencyFormatter"; +import { DateTimeFormatter } from "../../utils/DateFormatter"; +import CurrencyInput from "../form-items-formatted/currency-form-item.component"; +import JobTotalsTable from "../job-totals-table/job-totals-table.component"; +import FormRow from "../layout-form-row/layout-form-row.component"; + +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop, +}); + +const stripeTestEnv = process.env.REACT_APP_STRIPE_PUBLIC_KEY; //.includes("test"); + +export function JobsDetailRates({ job, bodyshop }) { + const { t } = useTranslation(); + + return ( +
+ + + { - console.log("Changed."); - }} - > +