feature/Reynolds-and-Reynolds-DMS-API-Integration - Add dealer id / merge fortellis
This commit is contained in:
@@ -171,7 +171,7 @@ export function AccountingReceivablesTableComponent({ bodyshop, loading, jobs, r
|
||||
<Card
|
||||
extra={
|
||||
<Space wrap>
|
||||
{!bodyshop.cdk_dealerid && !bodyshop.pbs_serialnumber && (
|
||||
{!bodyshop.cdk_dealerid && !bodyshop.pbs_serialnumber && !bodyshop.rr_dealerid && (
|
||||
<>
|
||||
<JobMarkSelectedExported
|
||||
jobIds={selectedJobs}
|
||||
@@ -189,7 +189,7 @@ export function AccountingReceivablesTableComponent({ bodyshop, loading, jobs, r
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
{bodyshop.accountingconfig && bodyshop.accountingconfig.qbo && <QboAuthorizeComponent />}
|
||||
{bodyshop.accountingconfig?.qbo && <QboAuthorizeComponent />}
|
||||
<Input.Search
|
||||
value={state.search}
|
||||
onChange={handleSearch}
|
||||
|
||||
@@ -44,7 +44,7 @@ export function BillFormItemsExtendedFormItem({
|
||||
quantity: record.part_qty || 1,
|
||||
actual_price: record.act_price,
|
||||
cost_center: record.part_type
|
||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid || bodyshop.rr_dealerid
|
||||
? record.part_type
|
||||
: responsibilityCenters.defaults && (responsibilityCenters.defaults.costs[record.part_type] || null)
|
||||
: null
|
||||
@@ -100,7 +100,7 @@ export function BillFormItemsExtendedFormItem({
|
||||
</Form.Item>
|
||||
<Form.Item label={t("billlines.fields.cost_center")} name={["billlineskeys", record.id, "cost_center"]}>
|
||||
<Select showSearch style={{ minWidth: "3rem" }} disabled={disabled}>
|
||||
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
||||
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid
|
||||
? CiecaSelect(true, false)
|
||||
: responsibilityCenters.costs.map((item) => <Select.Option key={item.name}>{item.name}</Select.Option>)}
|
||||
</Select>
|
||||
|
||||
@@ -354,7 +354,7 @@ export function BillFormComponent({
|
||||
<Form.Item span={3} label={t("bills.fields.local_tax_rate")} name="local_tax_rate">
|
||||
<CurrencyInput min={0} />
|
||||
</Form.Item>
|
||||
{bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid ? (
|
||||
{bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid || bodyshop.rr_dealerid ? (
|
||||
<Form.Item span={2} label={t("bills.labels.federal_tax_exempt")} name="federal_tax_exempt">
|
||||
<Switch onChange={handleFederalTaxExemptSwitchToggle} />
|
||||
</Form.Item>
|
||||
|
||||
@@ -90,7 +90,7 @@ export function BillEnterModalLinesComponent({
|
||||
actual_price: opt.cost,
|
||||
original_actual_price: opt.cost,
|
||||
cost_center: opt.part_type
|
||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid || bodyshop.rr_dealerid
|
||||
? opt.part_type !== "PAE"
|
||||
? opt.part_type
|
||||
: null
|
||||
@@ -322,7 +322,7 @@ export function BillEnterModalLinesComponent({
|
||||
},
|
||||
formInput: () => (
|
||||
<Select showSearch style={{ minWidth: "3rem" }} disabled={disabled}>
|
||||
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
||||
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid
|
||||
? CiecaSelect(true, false)
|
||||
: responsibilityCenters.costs.map((item) => <Select.Option key={item.name}>{item.name}</Select.Option>)}
|
||||
</Select>
|
||||
|
||||
@@ -17,7 +17,7 @@ import Dinero from "dinero.js";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { connect } from "react-redux";
|
||||
import { createStructuredSelector } from "reselect";
|
||||
import { determineDmsType } from "../../pages/dms/dms.container";
|
||||
import { determineDmsType } from "../../utils/determineDMSType";
|
||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||
import i18n from "../../translations/i18n";
|
||||
import dayjs from "../../utils/day";
|
||||
@@ -257,8 +257,7 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
|
||||
]}
|
||||
>
|
||||
<Select style={{ minWidth: "15rem" }} onSelect={(value) => handlePayerSelect(value, index)}>
|
||||
{bodyshop.cdk_configuration &&
|
||||
bodyshop.cdk_configuration.payers &&
|
||||
{bodyshop.cdk_configuration?.payers &&
|
||||
bodyshop.cdk_configuration.payers.map((payer) => (
|
||||
<Select.Option key={payer.name}>{payer.name}</Select.Option>
|
||||
))}
|
||||
@@ -335,7 +334,7 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
|
||||
{() => {
|
||||
const payers = form.getFieldValue("payers");
|
||||
|
||||
const row = payers && payers[index];
|
||||
const row = payers?.[index];
|
||||
|
||||
const cdkPayer =
|
||||
bodyshop.cdk_configuration.payers &&
|
||||
@@ -379,8 +378,7 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
|
||||
let totalAllocated = Dinero();
|
||||
|
||||
const payers = form.getFieldValue("payers");
|
||||
payers &&
|
||||
payers.forEach((payer) => {
|
||||
payers?.forEach((payer) => {
|
||||
totalAllocated = totalAllocated.add(Dinero({ amount: Math.round((payer?.amount || 0) * 100) }));
|
||||
});
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ const buildAccountingChildren = ({
|
||||
</Link>
|
||||
)
|
||||
},
|
||||
...(!((bodyshop && bodyshop.cdk_dealerid) || (bodyshop && bodyshop.pbs_serialnumber)) || DmsAp.treatment === "on"
|
||||
...(!(bodyshop?.cdk_dealerid || bodyshop?.pbs_serialnumber || bodyshop?.rr_dealerid) || DmsAp.treatment === "on"
|
||||
? [
|
||||
{
|
||||
key: "payables",
|
||||
@@ -156,7 +156,7 @@ const buildAccountingChildren = ({
|
||||
}
|
||||
]
|
||||
: []),
|
||||
...(!((bodyshop && bodyshop.cdk_dealerid) || (bodyshop && bodyshop.pbs_serialnumber))
|
||||
...(!(bodyshop?.cdk_dealerid || bodyshop?.pbs_serialnumber || bodyshop?.rr_dealerid) || DmsAp.treatment === "on"
|
||||
? [
|
||||
{
|
||||
key: "payments",
|
||||
|
||||
@@ -65,7 +65,7 @@ export function JobsCloseAutoAllocate({ bodyshop, joblines, form, disabled }) {
|
||||
};
|
||||
|
||||
const menu =
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid
|
||||
? {
|
||||
items: bodyshop.md_responsibility_centers.dms_defaults.map((mapping) => ({
|
||||
key: mapping.name,
|
||||
@@ -78,7 +78,7 @@ export function JobsCloseAutoAllocate({ bodyshop, joblines, form, disabled }) {
|
||||
items: []
|
||||
};
|
||||
|
||||
return bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber ? (
|
||||
return bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid ? (
|
||||
<Dropdown menu={menu}>
|
||||
<Button disabled={disabled}>{t("jobs.actions.dmsautoallocate")}</Button>
|
||||
</Dropdown>
|
||||
|
||||
@@ -45,7 +45,7 @@ export function JobsCloseExportButton({ bodyshop, currentUser, jobId, disabled,
|
||||
|
||||
const handleQbxml = async () => {
|
||||
//Check if it's a CDK setup.
|
||||
if (bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) {
|
||||
if (bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) {
|
||||
history(`/manage/dms?jobId=${jobId}`);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ export function JobsDetailHeader({ job, bodyshop, disabled, insertAuditTrail, is
|
||||
</DataLabel>
|
||||
<DataLabel key="4" label={t("vehicles.fields.v_vin")}>
|
||||
<VehicleVinDisplay>{`${job.v_vin || t("general.labels.na")}`}</VehicleVinDisplay>
|
||||
{bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid ? (
|
||||
{bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid || bodyshop.rr_dealerid ? (
|
||||
job.v_vin?.length !== 17 ? (
|
||||
<WarningFilled style={{ color: "tomato", marginLeft: ".3rem" }} />
|
||||
) : null
|
||||
|
||||
@@ -15,7 +15,7 @@ export const CalculateAllocationsTotals = (bodyshop, joblines, timetickets, adju
|
||||
const r = {
|
||||
opcode: value,
|
||||
cost_center:
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid
|
||||
? i18next.t(`joblines.fields.lbr_types.${value && value.toUpperCase()}`)
|
||||
: responsibilitycenters.defaults.costs[value],
|
||||
mod_lbr_ty: value,
|
||||
|
||||
@@ -44,6 +44,7 @@ export async function checkPartnerStatus(bodyshop) {
|
||||
// bodyshop &&
|
||||
// (bodyshop.cdk_dealerid ||
|
||||
// bodyshop.pbs_serialnumber ||
|
||||
// bodyshop.rr_dealerid ||
|
||||
// bodyshop.accountingconfig.qbo)
|
||||
// )
|
||||
// ) {
|
||||
|
||||
@@ -196,7 +196,7 @@ export function PartsOrderListTableDrawerComponent({
|
||||
quantity: pol.quantity,
|
||||
actual_price: pol.act_price,
|
||||
cost_center: pol.jobline?.part_type
|
||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid || bodyshop.rr_dealerid
|
||||
? pol.jobline.part_type !== "PAE"
|
||||
? pol.jobline.part_type
|
||||
: null
|
||||
|
||||
@@ -172,7 +172,7 @@ export function PartsOrderListTableComponent({
|
||||
actual_price: pol.act_price,
|
||||
|
||||
cost_center: pol.jobline?.part_type
|
||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid || bodyshop.rr_dealerid
|
||||
? pol.jobline.part_type !== "PAE"
|
||||
? pol.jobline.part_type
|
||||
: null
|
||||
|
||||
@@ -331,7 +331,10 @@ export function ShopEmployeesFormComponent({ bodyshop }) {
|
||||
{t("timetickets.labels.shift")}
|
||||
</Select.Option>
|
||||
|
||||
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === "on"
|
||||
{bodyshop.cdk_dealerid ||
|
||||
bodyshop.pbs_serialnumber ||
|
||||
bodyshop.rr_dealerid ||
|
||||
Enhanced_Payroll.treatment === "on"
|
||||
? CiecaSelect(false, true)
|
||||
: bodyshop.md_responsibility_centers.costs.map((c) => (
|
||||
<Select.Option key={c.name} value={c.name}>
|
||||
|
||||
@@ -61,7 +61,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
return (
|
||||
<div>
|
||||
<RbacWrapper action="shop:responsibilitycenter">
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (
|
||||
<>
|
||||
{bodyshop.cdk_dealerid && (
|
||||
<DataLabel label={t("bodyshop.labels.dms.cdk_dealerid")}>{form.getFieldValue("cdk_dealerid")}</DataLabel>
|
||||
@@ -384,7 +384,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
>
|
||||
<Input onBlur={handleBlur} />
|
||||
</Form.Item> */}
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.dms.dms_acctnumber")}
|
||||
key={`${index}dms_acctnumber`}
|
||||
@@ -398,7 +398,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
<Input onBlur={handleBlur} />
|
||||
</Form.Item>
|
||||
)}
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.dms.dms_wip_acctnumber")}
|
||||
key={`${index}dms_wip_acctnumber`}
|
||||
@@ -525,7 +525,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
>
|
||||
<Input onBlur={handleBlur} />
|
||||
</Form.Item>
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.dms.dms_acctnumber")}
|
||||
key={`${index}dms_acctnumber`}
|
||||
@@ -576,7 +576,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
</Form.List>
|
||||
</LayoutFormRow>
|
||||
<SelectorDiv>
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (
|
||||
<>
|
||||
<LayoutFormRow id="mappingname" header={t("bodyshop.labels.dms.dms_allocations")}>
|
||||
<Form.List name={["md_responsibility_centers", "dms_defaults"]}>
|
||||
@@ -3790,7 +3790,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.dms.dms_acctnumber")}
|
||||
rules={[
|
||||
@@ -3889,7 +3889,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.dms.dms_acctnumber")}
|
||||
rules={[
|
||||
@@ -3985,7 +3985,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.dms.dms_acctnumber")}
|
||||
rules={[
|
||||
@@ -4113,7 +4113,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
{/* >*/}
|
||||
{/* <Input />*/}
|
||||
{/* </Form.Item>*/}
|
||||
{/* {(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (*/}
|
||||
{/* {(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (*/}
|
||||
{/* <Form.Item*/}
|
||||
{/* label={t("bodyshop.fields.dms.dms_acctnumber")}*/}
|
||||
{/* rules={[*/}
|
||||
@@ -4336,7 +4336,7 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
||||
{InstanceRenderManager({
|
||||
rome: (
|
||||
<LayoutFormRow header={<div>Adjustments</div>} id="refund">
|
||||
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber ? (
|
||||
{bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid ? (
|
||||
<>
|
||||
<Form.Item
|
||||
label={t("bodyshop.labels.responsibilitycenters.ttl_adjustment")}
|
||||
|
||||
@@ -2126,7 +2126,7 @@ function TaxFormItems({ typeNum, typeNumIterator, rootElements, bodyshop }) {
|
||||
>
|
||||
<Input />
|
||||
</Form.Item>
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (
|
||||
<Form.Item
|
||||
label={t("bodyshop.fields.dms.dms_acctnumber")}
|
||||
rules={[
|
||||
|
||||
@@ -63,7 +63,10 @@ export function TechClockInComponent({ form, bodyshop, technician }) {
|
||||
<Select.Option key={item.cost_center} value={item.cost_center}>
|
||||
{item.cost_center === "timetickets.labels.shift"
|
||||
? t(item.cost_center)
|
||||
: bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === "on"
|
||||
: bodyshop.cdk_dealerid ||
|
||||
bodyshop.pbs_serialnumber ||
|
||||
bodyshop.rr_dealerid ||
|
||||
Enhanced_Payroll.treatment === "on"
|
||||
? t(`joblines.fields.lbr_types.${item.cost_center.toUpperCase()}`)
|
||||
: item.cost_center}
|
||||
</Select.Option>
|
||||
|
||||
@@ -75,7 +75,10 @@ export function TechClockInContainer({ setTimeTicketContext, technician, bodysho
|
||||
jobid: values.jobid,
|
||||
cost_center: values.cost_center,
|
||||
ciecacode:
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === "on"
|
||||
bodyshop.cdk_dealerid ||
|
||||
bodyshop.pbs_serialnumber ||
|
||||
bodyshop.rr_dealerid ||
|
||||
Enhanced_Payroll.treatment === "on"
|
||||
? values.cost_center
|
||||
: Object.keys(bodyshop.md_responsibility_centers.defaults.costs).find((key) => {
|
||||
return bodyshop.md_responsibility_centers.defaults.costs[key] === values.cost_center;
|
||||
|
||||
@@ -69,7 +69,10 @@ export function TechClockOffButton({
|
||||
rate: emps && emps.rates.filter((r) => r.cost_center === values.cost_center)[0]?.rate,
|
||||
flat_rate: emps && emps.flat_rate,
|
||||
ciecacode:
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === "on"
|
||||
bodyshop.cdk_dealerid ||
|
||||
bodyshop.pbs_serialnumber ||
|
||||
bodyshop.rr_dealerid ||
|
||||
Enhanced_Payroll.treatment === "on"
|
||||
? values.cost_center
|
||||
: Object.keys(bodyshop.md_responsibility_centers.defaults.costs).find((key) => {
|
||||
return bodyshop.md_responsibility_centers.defaults.costs[key] === values.cost_center;
|
||||
@@ -165,7 +168,9 @@ export function TechClockOffButton({
|
||||
);
|
||||
|
||||
const fieldTypeToCheck =
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber ? "mod_lbr_ty" : "cost_center";
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid
|
||||
? "mod_lbr_ty"
|
||||
: "cost_center";
|
||||
|
||||
const costCenterDiff =
|
||||
Math.round(
|
||||
@@ -205,7 +210,7 @@ export function TechClockOffButton({
|
||||
<Select.Option key={item.cost_center}>
|
||||
{item.cost_center === "timetickets.labels.shift"
|
||||
? t(item.cost_center)
|
||||
: bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber
|
||||
: bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid
|
||||
? t(`joblines.fields.lbr_types.${item.cost_center.toUpperCase()}`)
|
||||
: item.cost_center}
|
||||
</Select.Option>
|
||||
|
||||
@@ -60,7 +60,10 @@ export function TimeTicketModalComponent({
|
||||
<Select.Option key={item.cost_center} value={item.cost_center}>
|
||||
{item.cost_center === "timetickets.labels.shift"
|
||||
? t(item.cost_center)
|
||||
: bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === "on"
|
||||
: bodyshop.cdk_dealerid ||
|
||||
bodyshop.pbs_serialnumber ||
|
||||
bodyshop.rr_dealerid ||
|
||||
Enhanced_Payroll.treatment === "on"
|
||||
? t(`joblines.fields.lbr_types.${item.cost_center.toUpperCase()}`)
|
||||
: item.cost_center}
|
||||
</Select.Option>
|
||||
@@ -187,7 +190,9 @@ export function TimeTicketModalComponent({
|
||||
);
|
||||
|
||||
const fieldTypeToCheck =
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber ? "mod_lbr_ty" : "cost_center";
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid
|
||||
? "mod_lbr_ty"
|
||||
: "cost_center";
|
||||
|
||||
const costCenterDiff =
|
||||
Math.round(
|
||||
|
||||
@@ -137,7 +137,10 @@ export function TimeTicketModalContainer({ timeTicketModal, toggleModalVisible,
|
||||
if (!!changedFields.cost_center && !!EmployeeAutoCompleteData) {
|
||||
form.setFieldsValue({
|
||||
ciecacode:
|
||||
bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || Enhanced_Payroll.treatment === "on"
|
||||
bodyshop.cdk_dealerid ||
|
||||
bodyshop.pbs_serialnumber ||
|
||||
bodyshop.rr_dealerid ||
|
||||
Enhanced_Payroll.treatment === "on"
|
||||
? changedFields.cost_center
|
||||
: Object.keys(bodyshop.md_responsibility_centers.defaults.costs).find(
|
||||
(key) => bodyshop.md_responsibility_centers.defaults.costs[key] === changedFields.cost_center
|
||||
|
||||
@@ -111,6 +111,7 @@ export const QUERY_BODYSHOP = gql`
|
||||
jc_hourly_rates
|
||||
md_jobline_presets
|
||||
cdk_dealerid
|
||||
rr_dealerid
|
||||
features
|
||||
attach_pdf_to_email
|
||||
tt_allow_post_to_invoiced
|
||||
@@ -245,6 +246,7 @@ export const UPDATE_SHOP = gql`
|
||||
jc_hourly_rates
|
||||
md_jobline_presets
|
||||
cdk_dealerid
|
||||
rr_dealerid
|
||||
attach_pdf_to_email
|
||||
tt_allow_post_to_invoiced
|
||||
cdk_configuration
|
||||
|
||||
@@ -55,7 +55,10 @@ export function AccountingPayablesContainer({ bodyshop, setBreadcrumbs, setSelec
|
||||
|
||||
const noPath =
|
||||
!partnerVersion?.qbpath &&
|
||||
!(bodyshop && (bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.accountingconfig.qbo));
|
||||
!(
|
||||
bodyshop &&
|
||||
(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid || bodyshop.accountingconfig.qbo)
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -54,7 +54,10 @@ export function AccountingPaymentsContainer({ bodyshop, setBreadcrumbs, setSelec
|
||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||
const noPath =
|
||||
!partnerVersion?.qbpath &&
|
||||
!(bodyshop && (bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.accountingconfig.qbo));
|
||||
!(
|
||||
bodyshop &&
|
||||
(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid || bodyshop.accountingconfig.qbo)
|
||||
);
|
||||
return (
|
||||
<div>
|
||||
<FeatureWrapperComponent
|
||||
|
||||
@@ -58,7 +58,10 @@ export function AccountingReceivablesContainer({ bodyshop, setBreadcrumbs, setSe
|
||||
|
||||
const noPath =
|
||||
!partnerVersion?.qbpath &&
|
||||
!(bodyshop && (bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.accountingconfig.qbo));
|
||||
!(
|
||||
bodyshop &&
|
||||
(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid || bodyshop.accountingconfig.qbo)
|
||||
);
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
@@ -146,10 +146,3 @@ export function DmsContainer({ setBreadcrumbs, setSelectedHeader }) {
|
||||
</Row>
|
||||
);
|
||||
}
|
||||
|
||||
export const determineDmsType = (bodyshop) => {
|
||||
if (bodyshop.cdk_dealerid) return "cdk";
|
||||
else {
|
||||
return "pbs";
|
||||
}
|
||||
};
|
||||
|
||||
@@ -168,7 +168,7 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader, inse
|
||||
if (loading) return <LoadingSpinner />;
|
||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||
|
||||
if (!jobId || !(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) || !(data && data.jobs_by_pk))
|
||||
if (!jobId || !(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) || bodyshop.rr_dealerid || !data?.jobs_by_pk)
|
||||
return <Result status="404" title={t("general.errors.notfound")} />;
|
||||
|
||||
if (data.jobs_by_pk && data.jobs_by_pk.date_exported)
|
||||
@@ -242,10 +242,3 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader, inse
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export const determineDmsType = (bodyshop) => {
|
||||
if (bodyshop.cdk_dealerid) return "cdk";
|
||||
else {
|
||||
return "pbs";
|
||||
}
|
||||
};
|
||||
|
||||
@@ -189,7 +189,7 @@ export function JobsCloseComponent({ job, bodyshop, jobRO, insertAuditTrail, set
|
||||
{t("general.actions.close")}
|
||||
</Button>
|
||||
</Popconfirm>
|
||||
{(bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid) && (
|
||||
{(bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid || bodyshop.rr_dealerid) && (
|
||||
<Link to={`/manage/dms?jobId=${job.id}`}>
|
||||
<Button disabled={job.date_exported || !jobRO}>{t("jobs.actions.sendtodms")}</Button>
|
||||
</Link>
|
||||
@@ -309,7 +309,7 @@ export function JobsCloseComponent({ job, bodyshop, jobRO, insertAuditTrail, set
|
||||
<Switch />
|
||||
</Form.Item>
|
||||
)}
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (
|
||||
<Form.Item
|
||||
label={t("jobs.fields.kmin")}
|
||||
name="kmin"
|
||||
@@ -322,7 +322,7 @@ export function JobsCloseComponent({ job, bodyshop, jobRO, insertAuditTrail, set
|
||||
<InputNumber precision={0} disabled={jobRO} />
|
||||
</Form.Item>
|
||||
)}
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (
|
||||
<Form.Item
|
||||
label={t("jobs.fields.kmout")}
|
||||
name="kmout"
|
||||
@@ -346,7 +346,7 @@ export function JobsCloseComponent({ job, bodyshop, jobRO, insertAuditTrail, set
|
||||
<InputNumber precision={0} disabled={jobRO} />
|
||||
</Form.Item>
|
||||
)}
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber) && (
|
||||
{(bodyshop.cdk_dealerid || bodyshop.pbs_serialnumber || bodyshop.rr_dealerid) && (
|
||||
<Form.Item
|
||||
label={t("jobs.fields.dms_allocation")}
|
||||
name="dms_allocation"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
export const determineDmsType = (bodyshop) => {
|
||||
const dmsMapping = {
|
||||
cdk_dealerid: "cdk",
|
||||
pbs_serialnumber: "pbs",
|
||||
rr_dealerid: "rr"
|
||||
};
|
||||
|
||||
return Object.keys(dmsMapping).find((key) => bodyshop[key])
|
||||
? dmsMapping[Object.keys(dmsMapping).find((key) => bodyshop[key])]
|
||||
: "pbs";
|
||||
};
|
||||
|
||||
27
package-lock.json
generated
27
package-lock.json
generated
@@ -9,20 +9,21 @@
|
||||
"version": "0.2.0",
|
||||
"license": "UNLICENSED",
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-cloudwatch-logs": "^3.887.0",
|
||||
"@aws-sdk/client-elasticache": "^3.887.0",
|
||||
"@aws-sdk/client-s3": "^3.887.0",
|
||||
"@aws-sdk/client-secrets-manager": "^3.887.0",
|
||||
"@aws-sdk/client-ses": "^3.887.0",
|
||||
"@aws-sdk/credential-provider-node": "^3.887.0",
|
||||
"@aws-sdk/lib-storage": "^3.887.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.887.0",
|
||||
"@aws-sdk/client-cloudwatch-logs": "^3.882.0",
|
||||
"@aws-sdk/client-elasticache": "^3.882.0",
|
||||
"@aws-sdk/client-s3": "^3.882.0",
|
||||
"@aws-sdk/client-secrets-manager": "^3.882.0",
|
||||
"@aws-sdk/client-ses": "^3.882.0",
|
||||
"@aws-sdk/credential-provider-node": "^3.882.0",
|
||||
"@aws-sdk/lib-storage": "^3.882.0",
|
||||
"@aws-sdk/s3-request-presigner": "^3.882.0",
|
||||
"@opensearch-project/opensearch": "^2.13.0",
|
||||
"@socket.io/admin-ui": "^0.5.1",
|
||||
"@socket.io/redis-adapter": "^8.3.0",
|
||||
"archiver": "^7.0.1",
|
||||
"aws4": "^1.13.2",
|
||||
"axios": "^1.12.1",
|
||||
"axios": "^1.11.0",
|
||||
"axios-curlirize": "^2.0.0",
|
||||
"better-queue": "^3.8.12",
|
||||
"bullmq": "^5.58.5",
|
||||
"chart.js": "^4.5.0",
|
||||
@@ -31,7 +32,7 @@
|
||||
"cookie-parser": "^1.4.7",
|
||||
"cors": "^2.8.5",
|
||||
"crisp-status-reporter": "^1.2.2",
|
||||
"dd-trace": "^5.67.0",
|
||||
"dd-trace": "^5.65.0",
|
||||
"dinero.js": "^1.9.1",
|
||||
"dotenv": "^17.2.2",
|
||||
"express": "^4.21.1",
|
||||
@@ -3783,6 +3784,12 @@
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/axios-curlirize": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/axios-curlirize/-/axios-curlirize-2.0.0.tgz",
|
||||
"integrity": "sha512-TrQBa8MfIwaYsrCoYhfCr7NDRXLuGm+Rqh/PtAuO64b8PCCOJWn37BWQvpN4/mzzig3uHb4qXzvpxJmALHaiwA==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/axios-ntlm": {
|
||||
"version": "1.4.4",
|
||||
"resolved": "https://registry.npmjs.org/axios-ntlm/-/axios-ntlm-1.4.4.tgz",
|
||||
|
||||
@@ -325,7 +325,7 @@ const applySocketIO = async ({ server, app }) => {
|
||||
});
|
||||
|
||||
// Legacy Socket Events
|
||||
SetLegacyWebsocketHandlers(io)
|
||||
SetLegacyWebsocketHandlers(io);
|
||||
|
||||
const api = {
|
||||
pubClient,
|
||||
@@ -390,7 +390,6 @@ const main = async () => {
|
||||
const redisHelpers = applyRedisHelpers({ pubClient, app, logger });
|
||||
const ioHelpers = applyIOHelpers({ app, redisHelpers, ioRedis, logger });
|
||||
|
||||
|
||||
// Initialize Queues
|
||||
await loadQueues({ pubClient: pubClient, logger, redisHelpers, ioRedis });
|
||||
|
||||
|
||||
@@ -736,7 +736,7 @@ const CreateCosts = (job) => {
|
||||
PASL: "PASL"
|
||||
};
|
||||
const defaultCosts =
|
||||
job.bodyshop.cdk_dealerid || job.bodyshop.pbs_serialnumber
|
||||
job.bodyshop.cdk_dealerid || job.bodyshop.pbs_serialnumber || job.bodyshop.rr_dealerid
|
||||
? ciecaObj
|
||||
: job.bodyshop.md_responsibility_centers.defaults.costs;
|
||||
|
||||
|
||||
@@ -591,7 +591,7 @@ const CreateCosts = (job) => {
|
||||
PASL: "PASL"
|
||||
};
|
||||
const defaultCosts =
|
||||
job.bodyshop.cdk_dealerid || job.bodyshop.pbs_serialnumber
|
||||
job.bodyshop.cdk_dealerid || job.bodyshop.pbs_serialnumber || job.bodyshop.rr_dealerid
|
||||
? ciecaObj
|
||||
: job.bodyshop.md_responsibility_centers.defaults.costs;
|
||||
|
||||
|
||||
@@ -557,7 +557,7 @@ const CreateCosts = (job) => {
|
||||
PASL: "PASL"
|
||||
};
|
||||
const defaultCosts =
|
||||
job.bodyshop.cdk_dealerid || job.bodyshop.pbs_serialnumber
|
||||
job.bodyshop.cdk_dealerid || job.bodyshop.pbs_serialnumber || job.bodyshop.rr_dealerid
|
||||
? ciecaObj
|
||||
: job.bodyshop.md_responsibility_centers.defaults.costs;
|
||||
|
||||
|
||||
@@ -695,6 +695,7 @@ exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshop
|
||||
jc_hourly_rates
|
||||
cdk_dealerid
|
||||
pbs_serialnumber
|
||||
rr_dealerid
|
||||
use_paint_scale_data
|
||||
timezone
|
||||
}
|
||||
@@ -932,6 +933,7 @@ exports.CLAIMSCORP_QUERY = `query CLAIMSCORP_EXPORT($start: timestamptz, $bodysh
|
||||
jc_hourly_rates
|
||||
cdk_dealerid
|
||||
pbs_serialnumber
|
||||
rr_dealerid
|
||||
use_paint_scale_data
|
||||
timezone
|
||||
}
|
||||
@@ -1193,6 +1195,7 @@ exports.KAIZEN_QUERY = `query KAIZEN_EXPORT($start: timestamptz, $bodyshopid: uu
|
||||
jc_hourly_rates
|
||||
cdk_dealerid
|
||||
pbs_serialnumber
|
||||
rr_dealerid
|
||||
use_paint_scale_data
|
||||
timezone
|
||||
}
|
||||
@@ -1695,6 +1698,7 @@ query QUERY_JOB_COSTING_DETAILS($id: uuid!) {
|
||||
jc_hourly_rates
|
||||
cdk_dealerid
|
||||
pbs_serialnumber
|
||||
rr_dealerid
|
||||
use_paint_scale_data
|
||||
}
|
||||
}
|
||||
@@ -1811,6 +1815,7 @@ exports.QUERY_JOB_COSTING_DETAILS_MULTI = ` query QUERY_JOB_COSTING_DETAILS_MULT
|
||||
jc_hourly_rates
|
||||
cdk_dealerid
|
||||
pbs_serialnumber
|
||||
rr_dealerid
|
||||
use_paint_scale_data
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1224,6 +1224,7 @@
|
||||
}
|
||||
],
|
||||
"cdk_dealerid": null,
|
||||
"rr_dealerid": null,
|
||||
"features": {
|
||||
"allAccess": true,
|
||||
"singleDeviceOnly": false
|
||||
|
||||
@@ -601,7 +601,7 @@ function GenerateCostingData(job) {
|
||||
//At the bill level.
|
||||
bill_val.billlines.map((line_val) => {
|
||||
//At the bill line level.
|
||||
if (job.bodyshop.pbs_serialnumber || job.bodyshop.cdk_dealerid) {
|
||||
if (job.bodyshop.pbs_serialnumber || job.bodyshop.cdk_dealerid || job.bodyshop.rr_dealerid) {
|
||||
if (!bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]])
|
||||
bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]] = Dinero();
|
||||
|
||||
@@ -716,7 +716,7 @@ function GenerateCostingData(job) {
|
||||
const ticketTotalsByCostCenter = job.timetickets.reduce((ticket_acc, ticket_val) => {
|
||||
//At the invoice level.
|
||||
|
||||
if (job.bodyshop.pbs_serialnumber || job.bodyshop.cdk_dealerid) {
|
||||
if (job.bodyshop.pbs_serialnumber || job.bodyshop.cdk_dealerid || job.bodyshop.rr_dealerid) {
|
||||
if (!ticket_acc[selectedDmsAllocationConfig.costs[ticket_val.ciecacode]])
|
||||
ticket_acc[selectedDmsAllocationConfig.costs[ticket_val.ciecacode]] = Dinero();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user