From 06f266a2922366e88c30543e78d016a0a892efb5 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 14 Feb 2022 10:27:41 -0800 Subject: [PATCH 01/20] IO-1700 Add name to cc list. --- .../courtesy-cars-list/courtesy-cars-list.component.jsx | 4 +++- client/src/graphql/courtesy-car.queries.js | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx b/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx index 000f56a3a..a720968b9 100644 --- a/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx +++ b/client/src/components/courtesy-cars-list/courtesy-cars-list.component.jsx @@ -97,7 +97,9 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) { render: (text, record) => record.cccontracts.length === 1 ? ( - {record.cccontracts[0].job.ro_number} + {`${record.cccontracts[0].job.ro_number} - ${ + record.cccontracts[0].job.ownr_fn || "" + } ${record.cccontracts[0].job.ownr_ln || ""} ${record.cccontracts[0].job.ownr_co_nm || ""}`} ) : null, }, diff --git a/client/src/graphql/courtesy-car.queries.js b/client/src/graphql/courtesy-car.queries.js index ddf4e41e7..efb24b2c1 100644 --- a/client/src/graphql/courtesy-car.queries.js +++ b/client/src/graphql/courtesy-car.queries.js @@ -89,6 +89,9 @@ export const QUERY_ALL_CC = gql` job { id ro_number + ownr_fn + ownr_ln + ownr_co_nm } } } From b3aeee4f45ba03c18cddb460ac33da90991a24cd Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 14 Feb 2022 10:33:21 -0800 Subject: [PATCH 02/20] IO-1667 Add print center to production detail drawer. --- .../production-list-detail.component.jsx | 49 ++++++++++++++++--- 1 file changed, 42 insertions(+), 7 deletions(-) diff --git a/client/src/components/production-list-detail/production-list-detail.component.jsx b/client/src/components/production-list-detail/production-list-detail.component.jsx index 1ea6c49d0..9494d5fb2 100644 --- a/client/src/components/production-list-detail/production-list-detail.component.jsx +++ b/client/src/components/production-list-detail/production-list-detail.component.jsx @@ -1,5 +1,5 @@ import { useQuery } from "@apollo/client"; -import { Descriptions, Drawer, Space } from "antd"; +import { Descriptions, Drawer, Space, PageHeader, Button } from "antd"; import queryString from "query-string"; import React from "react"; import { useTranslation } from "react-i18next"; @@ -16,8 +16,25 @@ import JobEmployeeAssignments from "../job-employee-assignments/job-employee-ass import LoadingSkeleton from "../loading-skeleton/loading-skeleton.component"; import ProductionRemoveButton from "../production-remove-button/production-remove-button.component"; import JobAtChange from "../job-at-change/job-at-change.component"; +import { PrinterFilled } from "@ant-design/icons"; -export default function ProductionListDetail({ jobs }) { +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { setModalContext } from "../../redux/modals/modals.actions"; + +const mapStateToProps = createStructuredSelector({ + //currentUser: selectCurrentUser +}); +const mapDispatchToProps = (dispatch) => ({ + setPrintCenterContext: (context) => + dispatch(setModalContext({ context: context, modal: "printCenter" })), +}); +export default connect( + mapStateToProps, + mapDispatchToProps +)(ProductionListDetail); + +export function ProductionListDetail({ jobs, setPrintCenterContext }) { const search = queryString.parse(useLocation().search); const history = useHistory(); const { selected } = search; @@ -39,11 +56,29 @@ export default function ProductionListDetail({ jobs }) { return ( - {t("production.labels.jobdetail")} - {theJob.ro_number} - - + + {" "} + + + } + /> } placement="right" width={"33%"} From b84935efdc007edfae550cc197fbb053ea410ef8 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 14 Feb 2022 10:38:58 -0800 Subject: [PATCH 03/20] IO-1707 Add employee filtering to time ticket list. --- .../time-ticket-list.component.jsx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/client/src/components/time-ticket-list/time-ticket-list.component.jsx b/client/src/components/time-ticket-list/time-ticket-list.component.jsx index 46e9462c3..40af8ca48 100644 --- a/client/src/components/time-ticket-list/time-ticket-list.component.jsx +++ b/client/src/components/time-ticket-list/time-ticket-list.component.jsx @@ -76,6 +76,21 @@ export function TimeTicketList({ state.sortedInfo.columnKey === "employee" && state.sortedInfo.order, render: (text, record) => `${record.employee.first_name} ${record.employee.last_name}`, + filters: + timetickets + .map((l) => l.employeeid) + .filter(onlyUnique) + .map((s) => { + return { + text: (() => { + const emp = bodyshop.employees.find((e) => e.id === s); + + return `${emp.first_name} ${emp.last_name}`; + })(), // + value: [s], + }; + }) || [], + onFilter: (value, record) => value.includes(record.employeeid), }, { title: t("timetickets.fields.cost_center"), From f884d2e23f749399352f190bb895046c36bfe3c0 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 14 Feb 2022 10:41:09 -0800 Subject: [PATCH 04/20] IO-1721 Update time ticket time fields to be in 5 minute increments. --- .../form-date-time-picker.component.jsx | 34 +++++++++---------- .../time-ticket-modal.component.jsx | 2 ++ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx b/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx index 34131d479..0337a038b 100644 --- a/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx +++ b/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx @@ -19,26 +19,26 @@ const DateTimePicker = ( return (
moment().subtract(1, "day").isAfter(d), - })} - value={value} - onBlur={onBlur} - onChange={onChange} + {...(onlyFuture && { + disabledDate: (d) => moment().subtract(1, "day").isAfter(d), + })} + value={value} + onBlur={onBlur} + onChange={onChange} + {...restProps} /> moment().isAfter(d), - })} - onChange={onChange} - showSecond={false} - minuteStep={15} - onBlur={onBlur} - format="hh:mm a" + value={value ? moment(value) : null} + {...(onlyFuture && { + disabledDate: (d) => moment().isAfter(d), + })} + onChange={onChange} + showSecond={false} + minuteStep={15} + onBlur={onBlur} + format="hh:mm a" + {...restProps} />
); diff --git a/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx b/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx index cc12ce503..cbd68ad5a 100644 --- a/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx +++ b/client/src/components/time-ticket-modal/time-ticket-modal.component.jsx @@ -212,6 +212,7 @@ export function TimeTicketModalComponent({ <> Date: Mon, 14 Feb 2022 10:43:11 -0800 Subject: [PATCH 05/20] IO-1724 Update cancel appointment label. --- client/src/translations/en_us/common.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 4377750a0..fac0475fa 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -21,7 +21,7 @@ "actions": { "block": "Block Day", "calculate": "Calculate SMART Dates", - "cancel": "Cancel", + "cancel": "Cancel Appointment", "intake": "Intake", "new": "New Appointment", "preview": "Preview", From dc77930950d0dfe498bfb18e038deb9d0ee969fd Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 14 Feb 2022 13:02:54 -0800 Subject: [PATCH 06/20] Resolve bill update error. --- .../components/bill-detail-edit/bill-detail-edit.container.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/bill-detail-edit/bill-detail-edit.container.jsx b/client/src/components/bill-detail-edit/bill-detail-edit.container.jsx index b3fc0504a..aad7403df 100644 --- a/client/src/components/bill-detail-edit/bill-detail-edit.container.jsx +++ b/client/src/components/bill-detail-edit/bill-detail-edit.container.jsx @@ -108,7 +108,7 @@ export function BillDetailEditcontainer({ ); billlines.forEach((billline) => { - const { deductedfromlbr, ...il } = billline; + const { deductedfromlbr, jobline, ...il } = billline; delete il.__typename; if (il.id) { From a3e8f5672824bab7e4ef546cd8e712f839026664 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 15 Feb 2022 09:30:17 -0800 Subject: [PATCH 07/20] Resolve Date Picker Issues. --- .../production-list-columns.data.js | 4 +++- .../production-list-columns.date.component.jsx | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/src/components/production-list-columns/production-list-columns.data.js b/client/src/components/production-list-columns/production-list-columns.data.js index 240d8074b..cda6fd57a 100644 --- a/client/src/components/production-list-columns/production-list-columns.data.js +++ b/client/src/components/production-list-columns/production-list-columns.data.js @@ -96,7 +96,7 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => { sortOrder: state.sortedInfo.columnKey === "actual_in" && state.sortedInfo.order, render: (text, record) => ( - + ), }, { @@ -114,6 +114,7 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => { record={record} field="scheduled_completion" pastIndicator + time /> ), }, @@ -165,6 +166,7 @@ const r = ({ technician, state, activeStatuses, bodyshop }) => { record={record} field="scheduled_delivery" pastIndicator + time /> ), }, diff --git a/client/src/components/production-list-columns/production-list-columns.date.component.jsx b/client/src/components/production-list-columns/production-list-columns.date.component.jsx index 94ca00c88..0e060d834 100644 --- a/client/src/components/production-list-columns/production-list-columns.date.component.jsx +++ b/client/src/components/production-list-columns/production-list-columns.date.component.jsx @@ -20,9 +20,9 @@ export default function ProductionListDate({ const handleChange = (date) => { logImEXEvent("product_toggle_date", { field }); - if (date.isSame(record[field] && moment(record[field]))) { - return; - } + // if (date.isSame(record[field] && moment(record[field]))) { + // return; + // } //e.stopPropagation(); updateAlert({ @@ -67,6 +67,7 @@ export default function ProductionListDate({ value={(record[field] && moment(record[field])) || null} onChange={handleChange} format="MM/DD/YYYY" + isDateOnly={!time} /> {time && ( Date: Tue, 15 Feb 2022 13:41:35 -0800 Subject: [PATCH 08/20] IO-1738 Remove PVRT from subtotal. --- server/job/job-totals.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/server/job/job-totals.js b/server/job/job-totals.js index 57fe94c87..b0a9cfed1 100644 --- a/server/job/job-totals.js +++ b/server/job/job-totals.js @@ -452,7 +452,8 @@ function CalculateTaxesTotals(job, otherTotals) { const subtotal = otherTotals.parts.parts.subtotal .add(otherTotals.parts.sublets.subtotal) .add(otherTotals.rates.subtotal) //No longer using just rates subtotal to include mapa/mash. - .add(otherTotals.additional.total); + .add(otherTotals.additional.total) + .subtract(otherTotals.additional.pvrt); // .add(Dinero({ amount: (job.towing_payable || 0) * 100 })) // .add(Dinero({ amount: (job.storage_payable || 0) * 100 })); @@ -522,7 +523,13 @@ function CalculateTaxesTotals(job, otherTotals) { let ret = { subtotal: subtotal, - federal_tax: subtotal.percentage((job.federal_tax_rate || 0) * 100), + federal_tax: subtotal + .percentage((job.federal_tax_rate || 0) * 100) + .add( + otherTotals.additional.pvrt.percentage( + (job.federal_tax_rate || 0) * 100 + ) + ), statePartsTax, state_tax: statePartsTax .add( @@ -539,7 +546,8 @@ function CalculateTaxesTotals(job, otherTotals) { .add( otherTotals.additional.storage.percentage((job.tax_str_rt || 0) * 100) ) - .add(additionalItemsTax), + .add(additionalItemsTax) + .add(otherTotals.additional.pvrt), local_tax: subtotal.percentage((job.local_tax_rate || 0) * 100), }; ret.total_repairs = ret.subtotal From 996863fcb738cc38181d47dbf3106ce5c1458f21 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 14 Feb 2022 19:31:26 -0800 Subject: [PATCH 09/20] Potential resolution to date time issues post 4pm. --- .../form-date-picker/form-date-picker.component.jsx | 8 +++++--- .../form-date-time-picker.component.jsx | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/src/components/form-date-picker/form-date-picker.component.jsx b/client/src/components/form-date-picker/form-date-picker.component.jsx index 3a9fe2553..e9ace8082 100644 --- a/client/src/components/form-date-picker/form-date-picker.component.jsx +++ b/client/src/components/form-date-picker/form-date-picker.component.jsx @@ -23,20 +23,21 @@ export function FormDatePicker({ onChange, onBlur, onlyFuture, + isDateOnly = true, ...restProps }) { const ref = useRef(); const handleChange = (newDate) => { if (value !== newDate && onChange) { - onChange(newDate); + onChange(isDateOnly ? newDate && newDate.format("YYYY-MM-DD") : newDate); } }; const handleKeyDown = (e) => { if (e.key.toLowerCase() === "t") { if (onChange) { - onChange(moment()); + onChange(isDateOnly ? moment().format("YYYY-MM-DD") : moment()); // if (ref.current && ref.current.blur) ref.current.blur(); } } else if (e.key.toLowerCase() === "enter") { @@ -64,7 +65,8 @@ export function FormDatePicker({ }); } - if (_a.isValid() && onChange) onChange(_a); + if (_a.isValid() && onChange) + onChange(isDateOnly ? _a.format("YYYY-MM-DD") : _a); }; return ( diff --git a/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx b/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx index 34131d479..cc4e53eb0 100644 --- a/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx +++ b/client/src/components/form-date-time-picker/form-date-time-picker.component.jsx @@ -26,6 +26,7 @@ const DateTimePicker = ( value={value} onBlur={onBlur} onChange={onChange} + isDateOnly={false} /> Date: Wed, 16 Feb 2022 14:22:39 -0800 Subject: [PATCH 10/20] IO-1706 Payroll Table --- bodyshop_translations.babel | 23 ++++++++++- .../time-tickets-payroll-table.component.jsx | 41 +++++++++++++++++++ .../time-tickets/time-tickets.container.jsx | 10 ++++- client/src/translations/en_us/common.json | 3 +- client/src/translations/es/common.json | 3 +- client/src/translations/fr/common.json | 3 +- client/src/utils/RenderTemplate.js | 9 +++- client/src/utils/TemplateConstants.js | 7 ++++ 8 files changed, 91 insertions(+), 8 deletions(-) create mode 100644 client/src/components/time-tickets-payroll-table/time-tickets-payroll-table.component.jsx diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index a77e7e73f..33bada3c1 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -1,4 +1,4 @@ - +