diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 5169f8147..0911111b4 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -15815,6 +15815,137 @@ + + parts_tax_rates + + + prt_discp + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + prt_mktyp + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + prt_mkupp + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + prt_tax_in + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + prt_tax_rt + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + prt_type + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + pas false @@ -18449,6 +18580,27 @@ + + parts_tax_rates + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + partsfilter 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 d21c666ab..a6aa98d07 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 @@ -8,8 +8,9 @@ import FormDatePicker from "../form-date-picker/form-date-picker.component"; import InputNumberCalculator from "../form-input-number-calculator/form-input-number-calculator.component"; import FormItemEmail from "../form-items-formatted/email-form-item.component"; import FormItemPhone, { - PhoneItemFormatterValidation + PhoneItemFormatterValidation, } from "../form-items-formatted/phone-form-item.component"; +import { JobsDetailRatesParts } from "../jobs-detail-rates/jobs-detail-rates.parts.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; const mapStateToProps = createStructuredSelector({ @@ -25,6 +26,11 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) { const { getFieldValue } = form; return (
+ + +
); } diff --git a/client/src/components/jobs-detail-rates/jobs-detail-rates.parts.component.jsx b/client/src/components/jobs-detail-rates/jobs-detail-rates.parts.component.jsx new file mode 100644 index 000000000..985662da5 --- /dev/null +++ b/client/src/components/jobs-detail-rates/jobs-detail-rates.parts.component.jsx @@ -0,0 +1,303 @@ +import { Collapse, Form, InputNumber, Select, Switch } 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 LayoutFormRow from "../layout-form-row/layout-form-row.component"; + +const mapStateToProps = createStructuredSelector({ + jobRO: selectJobReadOnly, +}); + +export function JobsDetailRatesParts({ jobRO, expanded, required = true }) { + const { t } = useTranslation(); + + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +} +export default connect(mapStateToProps, null)(JobsDetailRatesParts); diff --git a/client/src/pages/jobs-create/jobs-create.container.jsx b/client/src/pages/jobs-create/jobs-create.container.jsx index 47016b457..857b0a7af 100644 --- a/client/src/pages/jobs-create/jobs-create.container.jsx +++ b/client/src/pages/jobs-create/jobs-create.container.jsx @@ -1,4 +1,4 @@ -import _ from 'lodash'; +import _ from "lodash"; import { useLazyQuery, useMutation } from "@apollo/react-hooks"; import { Form, notification } from "antd"; import React, { useEffect, useState } from "react"; @@ -80,7 +80,6 @@ function JobsCreateContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) { }; const handleFinish = (values) => { - console.log("handleFinish -> values", values); let job = Object.assign( {}, values, @@ -142,6 +141,66 @@ function JobsCreateContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) { onFinish={handleFinish} layout="vertical" autoComplete={"off"} + initialValues={{ + 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, + }, + 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, + }, + }, + }} > diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 8862b058b..bf238bd2c 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -983,6 +983,14 @@ "pao": "Other", "pap": "EOM Partial", "par": "Re-cored", + "parts_tax_rates": { + "prt_discp": "Discount %", + "prt_mktyp": "Markup Type", + "prt_mkupp": "Markup %", + "prt_tax_in": "Tax Indicator", + "prt_tax_rt": "Part Tax Rate", + "prt_type": "Part Type" + }, "pas": "Sublet", "pay_date": "Pay Date", "phoneshort": "PH", @@ -1119,6 +1127,7 @@ "override_header": "Override estimate header on import?", "ownerassociation": "Owner Association", "parts": "Parts", + "parts_tax_rates": "Parts Tax rates", "partsfilter": "Parts Only", "partssubletstotal": "Parts & Sublets Total", "partstotal": "Parts Total (ex. Taxes)", diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index 983522933..a0783e7ab 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -983,6 +983,14 @@ "pao": "", "pap": "", "par": "", + "parts_tax_rates": { + "prt_discp": "", + "prt_mktyp": "", + "prt_mkupp": "", + "prt_tax_in": "", + "prt_tax_rt": "", + "prt_type": "" + }, "pas": "", "pay_date": "Fecha de Pay", "phoneshort": "PH", @@ -1119,6 +1127,7 @@ "override_header": "¿Anular encabezado estimado al importar?", "ownerassociation": "", "parts": "Partes", + "parts_tax_rates": "", "partsfilter": "", "partssubletstotal": "", "partstotal": "", diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index d45dbbbae..b3fc7527d 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -983,6 +983,14 @@ "pao": "", "pap": "", "par": "", + "parts_tax_rates": { + "prt_discp": "", + "prt_mktyp": "", + "prt_mkupp": "", + "prt_tax_in": "", + "prt_tax_rt": "", + "prt_type": "" + }, "pas": "", "pay_date": "Date d'Pay", "phoneshort": "PH", @@ -1119,6 +1127,7 @@ "override_header": "Remplacer l'en-tête d'estimation à l'importation?", "ownerassociation": "", "parts": "les pièces", + "parts_tax_rates": "", "partsfilter": "", "partssubletstotal": "", "partstotal": "",