diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index b4ef3cc78..4bf60547c 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -22414,6 +22414,48 @@ + + taxprofileoverride + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + taxprofileoverride_confirm + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + uninvoice false @@ -29618,6 +29660,27 @@ + + cieca_pft + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + closeconfirm false diff --git a/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx b/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx index 679c85283..31fa53a23 100644 --- a/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx +++ b/client/src/components/jobs-create-jobs-info/jobs-create-jobs-info.component.jsx @@ -12,6 +12,12 @@ import FormItemPhone, { } from "../form-items-formatted/phone-form-item.component"; import JobsDetailRatesChangeButton from "../jobs-detail-rates-change-button/jobs-detail-rates-change-button.component"; import JobsDetailRatesParts from "../jobs-detail-rates/jobs-detail-rates.parts.component"; + +import JobsDetailRatesLabor from "../jobs-detail-rates/jobs-detail-rates.labor.component"; +import JobsDetailRatesMaterials from "../jobs-detail-rates/jobs-detail-rates.materials.component"; +import JobsDetailRatesOther from "../jobs-detail-rates/jobs-detail-rates.other.component"; +import JobsDetailRatesTaxes from "../jobs-detail-rates/jobs-detail-rates.taxes.component"; + import JobsMarkPstExempt from "../jobs-mark-pst-exempt/jobs-mark-pst-exempt.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; const mapStateToProps = createStructuredSelector({ @@ -358,6 +364,10 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) { required={selected && true} form={form} /> + + + + ); } 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 index eaf9e8d49..d66b30b41 100644 --- a/client/src/components/jobs-detail-rates/jobs-detail-rates.component.jsx +++ b/client/src/components/jobs-detail-rates/jobs-detail-rates.component.jsx @@ -14,6 +14,8 @@ import JobsDetailRatesLabor from "./jobs-detail-rates.labor.component"; import JobsDetailRatesMaterials from "./jobs-detail-rates.materials.component"; import JobsDetailRatesOther from "./jobs-detail-rates.other.component"; import JobsDetailRatesParts from "./jobs-detail-rates.parts.component"; +import JobsDetailRatesTaxes from "./jobs-detail-rates.taxes.component"; +import JobsDetailRatesProfileOVerride from "./jobs-detail-rates.profile-override.component"; const mapStateToProps = createStructuredSelector({ jobRO: selectJobReadOnly, @@ -195,10 +197,15 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) { + Tax Profile + + + + ); } diff --git a/client/src/components/jobs-detail-rates/jobs-detail-rates.labor.component.jsx b/client/src/components/jobs-detail-rates/jobs-detail-rates.labor.component.jsx index d6311db4b..75e80d4a1 100644 --- a/client/src/components/jobs-detail-rates/jobs-detail-rates.labor.component.jsx +++ b/client/src/components/jobs-detail-rates/jobs-detail-rates.labor.component.jsx @@ -30,42 +30,42 @@ export function JobsDetailRatesLabor({ name={["cieca_pfl", "LAB", "lbr_tax_in"]} valuePropName="checked" > - + - + - + - + - + - + @@ -74,42 +74,42 @@ export function JobsDetailRatesLabor({ name={["cieca_pfl", "LAD", "lbr_tax_in"]} valuePropName="checked" > - + - + - + - + - + - + @@ -118,42 +118,42 @@ export function JobsDetailRatesLabor({ name={["cieca_pfl", "LAE", "lbr_tax_in"]} valuePropName="checked" > - + - + - + - + - + - + @@ -162,42 +162,42 @@ export function JobsDetailRatesLabor({ name={["cieca_pfl", "LAF", "lbr_tax_in"]} valuePropName="checked" > - + - + - + - + - + - + @@ -206,42 +206,42 @@ export function JobsDetailRatesLabor({ name={["cieca_pfl", "LAG", "lbr_tax_in"]} valuePropName="checked" > - + - + - + - + - + - + @@ -250,42 +250,42 @@ export function JobsDetailRatesLabor({ name={["cieca_pfl", "LAM", "lbr_tax_in"]} valuePropName="checked" > - + - + - + - + - + - + @@ -294,42 +294,42 @@ export function JobsDetailRatesLabor({ name={["cieca_pfl", "LAR", "lbr_tax_in"]} valuePropName="checked" > - + - + - + - + - + - + @@ -338,42 +338,42 @@ export function JobsDetailRatesLabor({ name={["cieca_pfl", "LAS", "lbr_tax_in"]} valuePropName="checked" > - + - + - + - + - + - + @@ -382,42 +382,42 @@ export function JobsDetailRatesLabor({ name={["cieca_pfl", "LAU", "lbr_tax_in"]} valuePropName="checked" > - + - + - + - + - + - + diff --git a/client/src/components/jobs-detail-rates/jobs-detail-rates.profile-override.component.jsx b/client/src/components/jobs-detail-rates/jobs-detail-rates.profile-override.component.jsx new file mode 100644 index 000000000..e046a4afa --- /dev/null +++ b/client/src/components/jobs-detail-rates/jobs-detail-rates.profile-override.component.jsx @@ -0,0 +1,42 @@ +import { Button, Popconfirm } 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"; +const mapStateToProps = createStructuredSelector({ + bodyshop: selectBodyshop, +}); +const mapDispatchToProps = (dispatch) => ({ + //setUserLanguage: language => dispatch(setUserLanguage(language)) +}); +export default connect( + mapStateToProps, + mapDispatchToProps +)(JobsDetailRatesProfileOVerride); + +export function JobsDetailRatesProfileOVerride({ bodyshop, form }) { + const { t } = useTranslation(); + return ( + { + form.setFieldsValue({ + cieca_pft: { + ...bodyshop.md_responsibility_centers.taxes.tax_ty1, + ...bodyshop.md_responsibility_centers.taxes.tax_ty2, + ...bodyshop.md_responsibility_centers.taxes.tax_ty3, + ...bodyshop.md_responsibility_centers.taxes.tax_ty4, + ...bodyshop.md_responsibility_centers.taxes.tax_ty5, + }, + materials: bodyshop.md_responsibility_centers.cieca_pfm, + cieca_pfl: bodyshop.md_responsibility_centers.cieca_pfl, + parts_tax_rates: bodyshop.md_responsibility_centers.parts_tax_rates, + }); + }} + title={t("jobs.actions.taxprofileoverride_confirm")} + > + + + ); +} diff --git a/client/src/components/jobs-detail-rates/jobs-detail-rates.taxes.component.jsx b/client/src/components/jobs-detail-rates/jobs-detail-rates.taxes.component.jsx new file mode 100644 index 000000000..83c14f7bc --- /dev/null +++ b/client/src/components/jobs-detail-rates/jobs-detail-rates.taxes.component.jsx @@ -0,0 +1,155 @@ +import { Collapse, Divider, Form, Input, InputNumber, Space } from "antd"; +import React from "react"; +import { useTranslation } from "react-i18next"; +import { connect } from "react-redux"; +import { createStructuredSelector } from "reselect"; +import { selectJobReadOnly } from "../../redux/application/application.selectors"; +import { selectBodyshop } from "../../redux/user/user.selectors"; +const mapStateToProps = createStructuredSelector({ + jobRO: selectJobReadOnly, + bodyshop: selectBodyshop, +}); + +export function JobsDetailRatesTaxes({ + jobRO, + expanded, + bodyshop, + required = true, + form, +}) { + const { t } = useTranslation(); + const formItems = []; + for (let tyCounter = 1; tyCounter <= 5; tyCounter++) { + const section = []; + + section.push( + TaxFormItems({ + typeNum: tyCounter, + rootElements: true, + bodyshop, + jobRO, + }) + ); + + for (let iterator = 1; iterator <= 5; iterator++) { + section.push( + TaxFormItems({ + typeNum: tyCounter, + typeNumIterator: iterator, + rootElements: false, + jobRO, + }) + ); + } + formItems.push(Space({ children: section, wrap: true })); + formItems.push(); + } + return ( + + + {formItems} + + + ); +} +export default connect(mapStateToProps, null)(JobsDetailRatesTaxes); + +function TaxFormItems({ + typeNum, + typeNumIterator, + rootElements, + bodyshopjobRO, + jobRO, +}) { + const { t } = useTranslation(); + + if (rootElements) + return ( + <> + + + + + ); + + return ( + <> + + + + + + + + + + + + + + ); +} diff --git a/client/src/components/shop-info/shop-info.general.component.jsx b/client/src/components/shop-info/shop-info.general.component.jsx index a0de6fcea..712c47b05 100644 --- a/client/src/components/shop-info/shop-info.general.component.jsx +++ b/client/src/components/shop-info/shop-info.general.component.jsx @@ -188,20 +188,22 @@ export function ShopInfoGeneral({ form, bodyshop }) { - - {() => ( - - - - )} - + { + // + // {() => ( + // + // + // + // )} + // + } // } - + ); } - return formItems; + return ( + <> + + {t("jobs.labels.cieca_pft")} + + {formItems} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {() => { + return ( + + + + ); + }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); } function TaxFormItems({ typeNum, typeNumIterator, rootElements, bodyshop }) { diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index ff30c41f6..4d656858f 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -781,6 +781,7 @@ export const GET_JOB_BY_PK = gql` cieca_ttl cieca_pfo cieca_pfl + cieca_pft materials csiinvites { id diff --git a/client/src/pages/jobs-create/jobs-create.container.jsx b/client/src/pages/jobs-create/jobs-create.container.jsx index 15af524ed..08f0b294f 100644 --- a/client/src/pages/jobs-create/jobs-create.container.jsx +++ b/client/src/pages/jobs-create/jobs-create.container.jsx @@ -169,96 +169,16 @@ function JobsCreateContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) { federal_tax_rate: bodyshop.bill_tax_rates.federal_tax_rate / 100, state_tax_rate: bodyshop.bill_tax_rates.state_tax_rate / 100, local_tax_rate: bodyshop.bill_tax_rates.local_tax_rate / 100, - parts_tax_rates: { - PAA: { - prt_type: "PAA", - prt_discp: 0, - prt_mktyp: false, - prt_mkupp: 0, - prt_tax_in: true, - prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100, - }, - PAC: { - prt_type: "PAC", - prt_discp: 0, - prt_mktyp: false, - prt_mkupp: 0, - prt_tax_in: true, - prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100, - }, - PAG: { - prt_type: "PAG", - prt_discp: 0, - prt_mktyp: false, - prt_mkupp: 0, - prt_tax_in: true, - prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100, - }, - PAL: { - prt_type: "PAL", - prt_discp: 0, - prt_mktyp: false, - prt_mkupp: 0, - prt_tax_in: true, - prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100, - }, - PAM: { - prt_type: "PAM", - prt_discp: 0, - prt_mktyp: false, - prt_mkupp: 0, - prt_tax_in: true, - prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100, - }, - PAN: { - prt_type: "PAN", - prt_discp: 0, - prt_mktyp: false, - prt_mkupp: 0, - prt_tax_in: true, - prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100, - }, - PAR: { - prt_type: "PAR", - prt_discp: 0, - prt_mktyp: false, - prt_mkupp: 0, - prt_tax_in: true, - prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100, - }, - PAS: { - prt_type: "PAS", - prt_discp: 0, - prt_mktyp: false, - prt_mkupp: 0, - prt_tax_in: true, - prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100, - }, - PASL: { - prt_type: "PASL", - prt_discp: 0, - prt_mktyp: false, - prt_mkupp: 0, - prt_tax_in: true, - prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100, - }, - PAP: { - prt_type: "PAP", - prt_discp: 0, - prt_mktyp: false, - prt_mkupp: 0, - prt_tax_in: true, - prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100, - }, - PAO: { - prt_type: "PAO", - prt_discp: 0, - prt_mktyp: false, - prt_mkupp: 0, - prt_tax_in: true, - prt_tax_rt: bodyshop.bill_tax_rates.state_tax_rate / 100, - }, + cieca_pft: { + ...bodyshop.md_responsibility_centers.taxes.tax_ty1, + ...bodyshop.md_responsibility_centers.taxes.tax_ty2, + ...bodyshop.md_responsibility_centers.taxes.tax_ty3, + ...bodyshop.md_responsibility_centers.taxes.tax_ty4, + ...bodyshop.md_responsibility_centers.taxes.tax_ty5, }, + materials: bodyshop.md_responsibility_centers.cieca_pfm, + cieca_pfl: bodyshop.md_responsibility_centers.cieca_pfl, + parts_tax_rates: bodyshop.md_responsibility_centers.parts_tax_rates, }} > diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index d8a0143bf..09dc5ca55 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -1373,6 +1373,8 @@ "sendpartspricechange": "Send Parts Price Change", "sendtodms": "Send to DMS", "sync": "Sync", + "taxprofileoverride": "Override Tax Profile with Shop Configuration", + "taxprofileoverride_confirm": "Are you sure you want to override the tax profile information? This cannot be undone without re-importing the job. ", "uninvoice": "Uninvoice", "unvoid": "Unvoid Job", "viewchecklist": "View Checklists", @@ -1746,6 +1748,7 @@ "checklists": "Checklists", "cieca_pfl": "Profile - Labor", "cieca_pfo": "Profile - Other", + "cieca_pft": "Profile - Taxes", "closeconfirm": "Are you sure you want to close this job? This cannot be easily undone.", "closejob": "Close Job {{ro_number}}", "closingperiod": "This Invoice Date is outside of the Closing Period.", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index bd006c556..da24bf91a 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -1373,6 +1373,8 @@ "sendpartspricechange": "", "sendtodms": "", "sync": "", + "taxprofileoverride": "", + "taxprofileoverride_confirm": "", "uninvoice": "", "unvoid": "", "viewchecklist": "", @@ -1746,6 +1748,7 @@ "checklists": "", "cieca_pfl": "", "cieca_pfo": "", + "cieca_pft": "", "closeconfirm": "", "closejob": "", "closingperiod": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 44c2c36b9..bd2ad0891 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -1373,6 +1373,8 @@ "sendpartspricechange": "", "sendtodms": "", "sync": "", + "taxprofileoverride": "", + "taxprofileoverride_confirm": "", "uninvoice": "", "unvoid": "", "viewchecklist": "", @@ -1746,6 +1748,7 @@ "checklists": "", "cieca_pfl": "", "cieca_pfo": "", + "cieca_pft": "", "closeconfirm": "", "closejob": "", "closingperiod": "", diff --git a/job-totals-testing-util.js b/job-totals-testing-util.js index 9269048b5..7e6391a8a 100644 --- a/job-totals-testing-util.js +++ b/job-totals-testing-util.js @@ -19,8 +19,8 @@ require("dotenv").config({ }); async function RunTheTest() { - const bodyshopids = ["a7ee1503-ee05-4a02-b80e-bdb11d1cc8ac"]; - const bearerToken = `Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjlhNTE5MDc0NmU5M2JhZTI0OWIyYWE3YzJhYTRlMzA2M2UzNDFlYzciLCJ0eXAiOiJKV1QifQ.eyJu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MMyezmKNMwknGvuoLwEeh9HYM4O0gDbtLYosFb5zsMRSPdrq4wjECge_psxF6QJ5p2JpKFAVyoYjK6lavM4QXZhTx05ssOj7pRz13NbYYX9of2pabhWjDSw`; const { jobs } = await client.request( gql` query GET_JOBS($bodyshopids: [uuid!]!) { diff --git a/server/accounting/qbo/qbo-receivables.js b/server/accounting/qbo/qbo-receivables.js index 8471f80be..04be93cb9 100644 --- a/server/accounting/qbo/qbo-receivables.js +++ b/server/accounting/qbo/qbo-receivables.js @@ -242,6 +242,11 @@ exports.default = async (req, res) => { (error && error.authResponse && error.authResponse.body) || (error && error.message), }); + console.log(error); + logger.log("qbo-receivable-create-error", "ERROR", req.user.email, { + error: error.message, + stack: error.stack, + }); //Add the export log error. if (elgen) { const result = await client diff --git a/server/job/job-totals.js b/server/job/job-totals.js index be0c70c1b..cc350e88a 100644 --- a/server/job/job-totals.js +++ b/server/job/job-totals.js @@ -440,8 +440,8 @@ async function CalculateRatesTotals({ job, client }) { } //Materials Scrubbing as required by CCC. - let matTotalLine = job.cieca_stl.data.find((l) => l.ttl_typecd === "MAT"); - let shopMatLine = job.cieca_stl.data.find((l) => l.ttl_typecd === "MASH"); + let matTotalLine = job.cieca_stl?.data?.find((l) => l.ttl_typecd === "MAT"); + let shopMatLine = job.cieca_stl?.data?.find((l) => l.ttl_typecd === "MASH"); if (matTotalLine && shopMatLine) { //Check to see if theyre different