feature/Reynolds-and-Reynolds-DMS-API-Integration - Add dealer id / merge fortellis

This commit is contained in:
Dave
2025-09-12 14:59:42 -04:00
parent 2fec9fd16e
commit 7c8260685e
37 changed files with 124 additions and 83 deletions

View File

@@ -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,10 +378,9 @@ export function DmsPostForm({ bodyshop, socket, job, logsRef }) {
let totalAllocated = Dinero();
const payers = form.getFieldValue("payers");
payers &&
payers.forEach((payer) => {
totalAllocated = totalAllocated.add(Dinero({ amount: Math.round((payer?.amount || 0) * 100) }));
});
payers?.forEach((payer) => {
totalAllocated = totalAllocated.add(Dinero({ amount: Math.round((payer?.amount || 0) * 100) }));
});
const totals =
socket.allocationsSummary &&