diff --git a/bodyshop_translations.babel b/bodyshop_translations.babel index 6556d2dc7..61610950f 100644 --- a/bodyshop_translations.babel +++ b/bodyshop_translations.babel @@ -6092,6 +6092,27 @@ + + gst_override + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + la1 false @@ -12170,6 +12191,32 @@ dms + + errors + + + alreadyexported + false + + + + + + en-US + false + + + es-MX + false + + + fr-CA + false + + + + + labels diff --git a/client/src/components/parts-order-modal/parts-order-modal.component.jsx b/client/src/components/parts-order-modal/parts-order-modal.component.jsx index 917b853cd..cd79fe81f 100644 --- a/client/src/components/parts-order-modal/parts-order-modal.component.jsx +++ b/client/src/components/parts-order-modal/parts-order-modal.component.jsx @@ -1,17 +1,17 @@ import { DeleteFilled, WarningFilled } from "@ant-design/icons"; -import { useTreatments, useClient } from "@splitsoftware/splitio-react"; +import { useTreatments } from "@splitsoftware/splitio-react"; import { Divider, Form, Input, InputNumber, Radio, Space, Tag } 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 FormListMoveArrows from "../form-list-move-arrows/form-list-move-arrows.component"; import LayoutFormRow from "../layout-form-row/layout-form-row.component"; import VendorSearchSelect from "../vendor-search-select/vendor-search-select.component"; -import { connect } from "react-redux"; -import { createStructuredSelector } from "reselect"; -import { selectBodyshop } from "../../redux/user/user.selectors"; const mapStateToProps = createStructuredSelector({ bodyshop: selectBodyshop, }); diff --git a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx index c24a12939..e5543bcba 100644 --- a/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx +++ b/client/src/components/shop-info/shop-info.responsibilitycenters.component.jsx @@ -550,6 +550,14 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) { > + + + { remove(field.name); diff --git a/client/src/graphql/jobs.queries.js b/client/src/graphql/jobs.queries.js index 6729a1138..cad9a6a1f 100644 --- a/client/src/graphql/jobs.queries.js +++ b/client/src/graphql/jobs.queries.js @@ -1919,6 +1919,7 @@ export const QUERY_JOB_EXPORT_DMS = gql` v_model_yr v_model_desc area_of_damage + date_exported } } `; diff --git a/client/src/pages/dms/dms.container.jsx b/client/src/pages/dms/dms.container.jsx index ac95b4b58..98493b605 100644 --- a/client/src/pages/dms/dms.container.jsx +++ b/client/src/pages/dms/dms.container.jsx @@ -125,7 +125,10 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) { !(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) || !(data && data.jobs_by_pk) ) - return ; + return ; + + if (data.jobs_by_pk && data.jobs_by_pk.date_exported) + return ; return (
diff --git a/client/src/translations/en_us/common.json b/client/src/translations/en_us/common.json index 51497bf15..a290fe4e7 100644 --- a/client/src/translations/en_us/common.json +++ b/client/src/translations/en_us/common.json @@ -394,6 +394,7 @@ "ar": "Accounts Receivable", "ats": "ATS", "federal_tax": "Federal Tax", + "gst_override": "GST Override Account #", "la1": "LA1", "la2": "LA2", "la3": "LA3", @@ -761,6 +762,9 @@ } }, "dms": { + "errors": { + "alreadyexported": "This job has already been sent to the DMS. If you need to resend it, please use admin permissions to mark the job for re-export." + }, "labels": { "refreshallocations": "Refresh to see DMS Allocataions." } diff --git a/client/src/translations/es/common.json b/client/src/translations/es/common.json index bd1524e12..55aada7d9 100644 --- a/client/src/translations/es/common.json +++ b/client/src/translations/es/common.json @@ -394,6 +394,7 @@ "ar": "", "ats": "", "federal_tax": "", + "gst_override": "", "la1": "", "la2": "", "la3": "", @@ -761,6 +762,9 @@ } }, "dms": { + "errors": { + "alreadyexported": "" + }, "labels": { "refreshallocations": "" } diff --git a/client/src/translations/fr/common.json b/client/src/translations/fr/common.json index 86d79c2d0..5f17415dc 100644 --- a/client/src/translations/fr/common.json +++ b/client/src/translations/fr/common.json @@ -394,6 +394,7 @@ "ar": "", "ats": "", "federal_tax": "", + "gst_override": "", "la1": "", "la2": "", "la3": "", @@ -761,6 +762,9 @@ } }, "dms": { + "errors": { + "alreadyexported": "" + }, "labels": { "refreshallocations": "" } diff --git a/server/cdk/cdk-calculate-allocations.js b/server/cdk/cdk-calculate-allocations.js index f7db405b8..0b7d84912 100644 --- a/server/cdk/cdk-calculate-allocations.js +++ b/server/cdk/cdk-calculate-allocations.js @@ -213,8 +213,7 @@ exports.default = async function (socket, jobid) { } if (job.towing_payable && job.towing_payable !== 0) { - const towAccountName = - selectedDmsAllocationConfig.profits.TOW; + const towAccountName = selectedDmsAllocationConfig.profits.TOW; const towAccount = bodyshop.md_responsibility_centers.profits.find( (c) => c.name === towAccountName @@ -234,8 +233,7 @@ exports.default = async function (socket, jobid) { } } if (job.storage_payable && job.storage_payable !== 0) { - const storageAccountName = - selectedDmsAllocationConfig.profits.TOW; + const storageAccountName = selectedDmsAllocationConfig.profits.TOW; const towAccount = bodyshop.md_responsibility_centers.profits.find( (c) => c.name === storageAccountName @@ -258,8 +256,7 @@ exports.default = async function (socket, jobid) { } if (job.adjustment_bottom_line && job.adjustment_bottom_line !== 0) { - const otherAccountName = - selectedDmsAllocationConfig.profits.PAO; + const otherAccountName = selectedDmsAllocationConfig.profits.PAO; const otherAccount = bodyshop.md_responsibility_centers.profits.find( (c) => c.name === otherAccountName @@ -310,7 +307,20 @@ exports.default = async function (socket, jobid) { taxAllocations[key].cost.getAmount() > 0 ) .map((key) => { - return { ...taxAllocations[key], tax: key }; + if ( + key === "federal" && + selectedDmsAllocationConfig.gst_override && + selectedDmsAllocationConfig.gst_override !== "" + ) { + const ret = { ...taxAllocations[key], tax: key }; + ret.costCenter.dms_acctnumber = + selectedDmsAllocationConfig.gst_override; + ret.profitCenter.dms_acctnumber = + selectedDmsAllocationConfig.gst_override; + return ret; + } else { + return { ...taxAllocations[key], tax: key }; + } }), ]; } catch (error) { diff --git a/server/cdk/cdk-job-export.js b/server/cdk/cdk-job-export.js index 96c7335b9..14e39a3c1 100644 --- a/server/cdk/cdk-job-export.js +++ b/server/cdk/cdk-job-export.js @@ -784,7 +784,7 @@ async function UpdateDmsVehicle(socket) { return { id: { assigningPartyId: - o.id.value === socket.dmsCust.id.value ? "CURRENT" : "PREVIOUS", + o.id.value === socket.DMSCust.id.value ? "CURRENT" : "PREVIOUS", value: o.id.value, }, };