IO-233 CDK WIP customer changes.
This commit is contained in:
@@ -19467,6 +19467,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>id</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>journal</name>
|
<name>journal</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -19682,6 +19703,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>vinowner</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
</children>
|
</children>
|
||||||
</folder_node>
|
</folder_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
|
|||||||
@@ -8,7 +8,25 @@ import { alphaSort } from "../../utils/sorters";
|
|||||||
import JobExportButton from "../jobs-close-export-button/jobs-close-export-button.component";
|
import JobExportButton from "../jobs-close-export-button/jobs-close-export-button.component";
|
||||||
import JobsExportAllButton from "../jobs-export-all-button/jobs-export-all-button.component";
|
import JobsExportAllButton from "../jobs-export-all-button/jobs-export-all-button.component";
|
||||||
|
|
||||||
export default function AccountingReceivablesTableComponent({ loading, jobs }) {
|
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
|
||||||
|
)(AccountingReceivablesTableComponent);
|
||||||
|
|
||||||
|
export function AccountingReceivablesTableComponent({
|
||||||
|
bodyshop,
|
||||||
|
loading,
|
||||||
|
jobs,
|
||||||
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [selectedJobs, setSelectedJobs] = useState([]);
|
const [selectedJobs, setSelectedJobs] = useState([]);
|
||||||
const [transInProgress, setTransInProgress] = useState(false);
|
const [transInProgress, setTransInProgress] = useState(false);
|
||||||
@@ -180,12 +198,14 @@ export default function AccountingReceivablesTableComponent({ loading, jobs }) {
|
|||||||
<Card
|
<Card
|
||||||
extra={
|
extra={
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
<JobsExportAllButton
|
{!bodyshop.cdk_dealerid && (
|
||||||
jobIds={selectedJobs}
|
<JobsExportAllButton
|
||||||
disabled={transInProgress || selectedJobs.length === 0}
|
jobIds={selectedJobs}
|
||||||
loadingCallback={setTransInProgress}
|
disabled={transInProgress || selectedJobs.length === 0}
|
||||||
completedCallback={setSelectedJobs}
|
loadingCallback={setTransInProgress}
|
||||||
/>
|
completedCallback={setSelectedJobs}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<Input.Search
|
<Input.Search
|
||||||
value={state.search}
|
value={state.search}
|
||||||
onChange={handleSearch}
|
onChange={handleSearch}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export default connect(
|
|||||||
mapDispatchToProps
|
mapDispatchToProps
|
||||||
)(DmsAllocationsSummary);
|
)(DmsAllocationsSummary);
|
||||||
|
|
||||||
export function DmsAllocationsSummary({ socket, bodyshop, jobId, ro_number }) {
|
export function DmsAllocationsSummary({ socket, bodyshop, jobId, title }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [allocationsSummary, setAllocationsSummary] = useState([]);
|
const [allocationsSummary, setAllocationsSummary] = useState([]);
|
||||||
|
|
||||||
@@ -77,7 +77,7 @@ export function DmsAllocationsSummary({ socket, bodyshop, jobId, ro_number }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
title={ro_number}
|
title={title}
|
||||||
extra={
|
extra={
|
||||||
<Button
|
<Button
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -47,10 +47,6 @@ export function DmsCdkVehicles({ bodyshop, form, socket, job }) {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
console.log(
|
|
||||||
"🚀 ~ file: dms-cdk-makes.component.jsx ~ line 95 ~ selectedModel",
|
|
||||||
selectedModel
|
|
||||||
);
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<Modal
|
<Modal
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Button, Table, Col } from "antd";
|
import { Button, Table, Col , Checkbox} from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -51,6 +51,17 @@ export function DmsCustomerSelector({ bodyshop }) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.dms.id"),
|
||||||
|
dataIndex: ["id", "value"],
|
||||||
|
key: "id",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.dms.vinowner"),
|
||||||
|
dataIndex: "vinOwner",
|
||||||
|
key: "vinOwner",
|
||||||
|
render: (text, record) => <Checkbox disabled checked={record.vinOwner}/>
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.dms.name1"),
|
title: t("jobs.fields.dms.name1"),
|
||||||
dataIndex: ["name1", "fullName"],
|
dataIndex: ["name1", "fullName"],
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ export function DmsPostForm({ bodyshop, socket, job }) {
|
|||||||
story: t("jobs.labels.dms.defaultstory", {
|
story: t("jobs.labels.dms.defaultstory", {
|
||||||
ro_number: job.ro_number,
|
ro_number: job.ro_number,
|
||||||
area_of_damage: job.area_of_damage && job.area_of_damage.impact1,
|
area_of_damage: job.area_of_damage && job.area_of_damage.impact1,
|
||||||
}).substr(0, 249),
|
}).substr(0, 239),
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<LayoutFormRow grow>
|
<LayoutFormRow grow>
|
||||||
@@ -153,7 +153,7 @@ export function DmsPostForm({ bodyshop, socket, job }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Input.TextArea maxLength={250} />
|
<Input.TextArea maxLength={240} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Form.List name={["payers"]}>
|
<Form.List name={["payers"]}>
|
||||||
|
|||||||
@@ -1887,8 +1887,13 @@ export const QUERY_JOB_EXPORT_DMS = gql`
|
|||||||
po_number
|
po_number
|
||||||
clm_no
|
clm_no
|
||||||
job_totals
|
job_totals
|
||||||
|
ownr_fn
|
||||||
|
ownr_ln
|
||||||
|
ownr_co_nm
|
||||||
kmin
|
kmin
|
||||||
kmout
|
kmout
|
||||||
|
v_make_desc
|
||||||
|
v_model_yr
|
||||||
v_model_desc
|
v_model_desc
|
||||||
area_of_damage
|
area_of_damage
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,6 +71,10 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
|
|||||||
document.title = t("titles.dms");
|
document.title = t("titles.dms");
|
||||||
setSelectedHeader("dms");
|
setSelectedHeader("dms");
|
||||||
setBreadcrumbs([
|
setBreadcrumbs([
|
||||||
|
{
|
||||||
|
link: "/manage/accounting/receivables",
|
||||||
|
label: t("titles.bc.accounting-receivables"),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
link: "/manage/dms",
|
link: "/manage/dms",
|
||||||
label: t("titles.bc.dms"),
|
label: t("titles.bc.dms"),
|
||||||
@@ -122,7 +126,13 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
|
|||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col span={10}>
|
<Col span={10}>
|
||||||
<DmsAllocationsSummary
|
<DmsAllocationsSummary
|
||||||
ro_number={data && data.jobs_by_pk && data.jobs_by_pk.ro_number}
|
title={`${data && data.jobs_by_pk && data.jobs_by_pk.ro_number} | ${
|
||||||
|
data.jobs_by_pk.ownr_fn || ""
|
||||||
|
} ${data.jobs_by_pk.ownr_ln || ""} ${
|
||||||
|
data.jobs_by_pk.ownr_co_nm || ""
|
||||||
|
} | ${data.jobs_by_pk.v_model_yr || ""} ${
|
||||||
|
data.jobs_by_pk.v_make_desc || ""
|
||||||
|
} ${data.jobs_by_pk.v_model_desc || ""}`}
|
||||||
socket={socket}
|
socket={socket}
|
||||||
jobId={jobId}
|
jobId={jobId}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -1193,6 +1193,7 @@
|
|||||||
"dms_make": "DMS Make",
|
"dms_make": "DMS Make",
|
||||||
"dms_model": "DMS Model",
|
"dms_model": "DMS Model",
|
||||||
"dms_wip_acctnumber": "Cost WIP DMS Acct #",
|
"dms_wip_acctnumber": "Cost WIP DMS Acct #",
|
||||||
|
"id": "DMS ID",
|
||||||
"journal": "Journal #",
|
"journal": "Journal #",
|
||||||
"name1": "Customer Name",
|
"name1": "Customer Name",
|
||||||
"payer": {
|
"payer": {
|
||||||
@@ -1204,7 +1205,8 @@
|
|||||||
},
|
},
|
||||||
"sale": "Sale",
|
"sale": "Sale",
|
||||||
"sale_dms_acctnumber": "Sale DMS Acct #",
|
"sale_dms_acctnumber": "Sale DMS Acct #",
|
||||||
"story": "Story"
|
"story": "Story",
|
||||||
|
"vinowner": "VIN Owner"
|
||||||
},
|
},
|
||||||
"driveable": "Driveable",
|
"driveable": "Driveable",
|
||||||
"employee_body": "Body",
|
"employee_body": "Body",
|
||||||
|
|||||||
@@ -1193,6 +1193,7 @@
|
|||||||
"dms_make": "",
|
"dms_make": "",
|
||||||
"dms_model": "",
|
"dms_model": "",
|
||||||
"dms_wip_acctnumber": "",
|
"dms_wip_acctnumber": "",
|
||||||
|
"id": "",
|
||||||
"journal": "",
|
"journal": "",
|
||||||
"name1": "",
|
"name1": "",
|
||||||
"payer": {
|
"payer": {
|
||||||
@@ -1204,7 +1205,8 @@
|
|||||||
},
|
},
|
||||||
"sale": "",
|
"sale": "",
|
||||||
"sale_dms_acctnumber": "",
|
"sale_dms_acctnumber": "",
|
||||||
"story": ""
|
"story": "",
|
||||||
|
"vinowner": ""
|
||||||
},
|
},
|
||||||
"driveable": "",
|
"driveable": "",
|
||||||
"employee_body": "",
|
"employee_body": "",
|
||||||
|
|||||||
@@ -1193,6 +1193,7 @@
|
|||||||
"dms_make": "",
|
"dms_make": "",
|
||||||
"dms_model": "",
|
"dms_model": "",
|
||||||
"dms_wip_acctnumber": "",
|
"dms_wip_acctnumber": "",
|
||||||
|
"id": "",
|
||||||
"journal": "",
|
"journal": "",
|
||||||
"name1": "",
|
"name1": "",
|
||||||
"payer": {
|
"payer": {
|
||||||
@@ -1204,7 +1205,8 @@
|
|||||||
},
|
},
|
||||||
"sale": "",
|
"sale": "",
|
||||||
"sale_dms_acctnumber": "",
|
"sale_dms_acctnumber": "",
|
||||||
"story": ""
|
"story": "",
|
||||||
|
"vinowner": ""
|
||||||
},
|
},
|
||||||
"driveable": "",
|
"driveable": "",
|
||||||
"employee_body": "",
|
"employee_body": "",
|
||||||
|
|||||||
@@ -75,7 +75,9 @@ exports.default = async function (socket, { txEnvelope, jobid }) {
|
|||||||
socket.DMSCustList = await QueryDmsCustomerByName(socket, JobData);
|
socket.DMSCustList = await QueryDmsCustomerByName(socket, JobData);
|
||||||
|
|
||||||
socket.emit("cdk-select-customer", [
|
socket.emit("cdk-select-customer", [
|
||||||
...(socket.DMSVehCustomer ? [socket.DMSVehCustomer] : []),
|
...(socket.DMSVehCustomer
|
||||||
|
? [{ ...socket.DMSVehCustomer, vinOwner: true }]
|
||||||
|
: []),
|
||||||
...socket.DMSCustList,
|
...socket.DMSCustList,
|
||||||
]);
|
]);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -140,30 +142,24 @@ async function CdkSelectedCustomer(socket, selectedCustomerId) {
|
|||||||
);
|
);
|
||||||
socket.DMSVeh = await UpdateDmsVehicle(socket);
|
socket.DMSVeh = await UpdateDmsVehicle(socket);
|
||||||
}
|
}
|
||||||
CdkBase.createLogEvent(
|
|
||||||
socket,
|
|
||||||
"DEBUG",
|
|
||||||
`{5} Updating Service Vehicle History. ***SKIPPING FOR NOW TO PRESERVE RO NUMBERS ***`
|
|
||||||
);
|
|
||||||
//socket.DMSVehHistory = await InsertServiceVehicleHistory(socket);
|
|
||||||
|
|
||||||
CdkBase.createLogEvent(
|
CdkBase.createLogEvent(
|
||||||
socket,
|
socket,
|
||||||
"DEBUG",
|
"DEBUG",
|
||||||
`{6} Creating Transaction header with Dms Start WIP`
|
`{5} Creating Transaction header with Dms Start WIP`
|
||||||
);
|
);
|
||||||
socket.DMSTransHeader = await InsertDmsStartWip(socket);
|
socket.DMSTransHeader = await InsertDmsStartWip(socket);
|
||||||
CdkBase.createLogEvent(
|
CdkBase.createLogEvent(
|
||||||
socket,
|
socket,
|
||||||
"DEBUG",
|
"DEBUG",
|
||||||
`{6.1} Creating Transaction with ID ${socket.DMSTransHeader.transID}`
|
`{5.1} Creating Transaction with ID ${socket.DMSTransHeader.transID}`
|
||||||
);
|
);
|
||||||
|
|
||||||
socket.DMSBatchTxn = await InsertDmsBatchWip(socket);
|
socket.DMSBatchTxn = await InsertDmsBatchWip(socket);
|
||||||
CdkBase.createLogEvent(
|
CdkBase.createLogEvent(
|
||||||
socket,
|
socket,
|
||||||
"DEBUG",
|
"DEBUG",
|
||||||
`{7} Attempting to post Transaction with ID ${socket.DMSTransHeader.transID}`
|
`{6} Attempting to post Transaction with ID ${socket.DMSTransHeader.transID}`
|
||||||
);
|
);
|
||||||
socket.DmsBatchTxnPost = await PostDmsBatchWip(socket);
|
socket.DmsBatchTxnPost = await PostDmsBatchWip(socket);
|
||||||
if (socket.DmsBatchTxnPost.code === "success") {
|
if (socket.DmsBatchTxnPost.code === "success") {
|
||||||
@@ -171,25 +167,31 @@ async function CdkSelectedCustomer(socket, selectedCustomerId) {
|
|||||||
CdkBase.createLogEvent(
|
CdkBase.createLogEvent(
|
||||||
socket,
|
socket,
|
||||||
"DEBUG",
|
"DEBUG",
|
||||||
`{8} Successfully posted sransaction to DMS.`
|
`{6} Successfully posted sransaction to DMS.`
|
||||||
);
|
);
|
||||||
|
|
||||||
await MarkJobExported(socket, socket.JobData.id);
|
await MarkJobExported(socket, socket.JobData.id);
|
||||||
|
|
||||||
|
CdkBase.createLogEvent(
|
||||||
|
socket,
|
||||||
|
"DEBUG",
|
||||||
|
`{5} Updating Service Vehicle History. ***SKIPPING FOR NOW TO PRESERVE RO NUMBERS ***`
|
||||||
|
);
|
||||||
|
//socket.DMSVehHistory = await InsertServiceVehicleHistory(socket);
|
||||||
socket.emit("export-success", socket.JobData.id);
|
socket.emit("export-success", socket.JobData.id);
|
||||||
} else {
|
} else {
|
||||||
//Get the error code
|
//Get the error code
|
||||||
CdkBase.createLogEvent(
|
CdkBase.createLogEvent(
|
||||||
socket,
|
socket,
|
||||||
"DEBUG",
|
"DEBUG",
|
||||||
`{7.1} Getting errors for Transaction ID ${socket.DMSTransHeader.transID}`
|
`{6.1} Getting errors for Transaction ID ${socket.DMSTransHeader.transID}`
|
||||||
);
|
);
|
||||||
socket.DmsError = await QueryDmsErrWip(socket);
|
socket.DmsError = await QueryDmsErrWip(socket);
|
||||||
//Delete the transaction
|
//Delete the transaction
|
||||||
CdkBase.createLogEvent(
|
CdkBase.createLogEvent(
|
||||||
socket,
|
socket,
|
||||||
"DEBUG",
|
"DEBUG",
|
||||||
`{7.2} Deleting Transaction ID ${socket.DMSTransHeader.transID}`
|
`{6.2} Deleting Transaction ID ${socket.DMSTransHeader.transID}`
|
||||||
);
|
);
|
||||||
socket.DmsBatchTxnPost = await DeleteDmsWip(socket);
|
socket.DmsBatchTxnPost = await DeleteDmsWip(socket);
|
||||||
//Emit the error in a nice way .
|
//Emit the error in a nice way .
|
||||||
@@ -203,7 +205,7 @@ async function CdkSelectedCustomer(socket, selectedCustomerId) {
|
|||||||
CdkBase.createLogEvent(
|
CdkBase.createLogEvent(
|
||||||
socket,
|
socket,
|
||||||
"ERROR",
|
"ERROR",
|
||||||
r`Error(s) encountered in posting transaction. ${e}`
|
`Error(s) encountered in posting transaction. ${e}`
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -575,7 +577,12 @@ async function InsertDmsCustomer(socket, newCustomerNumber) {
|
|||||||
addressLine: socket.JobData.ownr_addr1,
|
addressLine: socket.JobData.ownr_addr1,
|
||||||
city: socket.JobData.ownr_city,
|
city: socket.JobData.ownr_city,
|
||||||
country: null,
|
country: null,
|
||||||
postalCode: socket.JobData.ownr_zip,
|
postalCode:
|
||||||
|
socket.JobData.ownr_zip &&
|
||||||
|
socket.JobData.ownr_zip //TODO Need to remove for US Based customers.
|
||||||
|
.toUpperCase()
|
||||||
|
.replace(/\W/g, "")
|
||||||
|
.replace(/(...)/, "$1 "),
|
||||||
stateOrProvince: socket.JobData.ownr_st,
|
stateOrProvince: socket.JobData.ownr_st,
|
||||||
},
|
},
|
||||||
contactInfo: {
|
contactInfo: {
|
||||||
@@ -583,6 +590,10 @@ async function InsertDmsCustomer(socket, newCustomerNumber) {
|
|||||||
main: true,
|
main: true,
|
||||||
value: socket.JobData.ownr_ph1,
|
value: socket.JobData.ownr_ph1,
|
||||||
},
|
},
|
||||||
|
email: {
|
||||||
|
desc: socket.JobData.ownr_ea ? "Other" : "CustomerDeclined",
|
||||||
|
value: socket.JobData.ownr_ea ? "Other" : null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
demographics: null,
|
demographics: null,
|
||||||
name1: {
|
name1: {
|
||||||
@@ -595,6 +606,10 @@ async function InsertDmsCustomer(socket, newCustomerNumber) {
|
|||||||
suffix: null,
|
suffix: null,
|
||||||
title: null,
|
title: null,
|
||||||
},
|
},
|
||||||
|
//TODO - REMOVE THIS AFTER TESTING.
|
||||||
|
...(process.env.NODE_ENV !== "production"
|
||||||
|
? { arStatus: { dealerField1: "Testing" } }
|
||||||
|
: {}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -140,6 +140,7 @@ query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) {
|
|||||||
ownr_zip
|
ownr_zip
|
||||||
ownr_city
|
ownr_city
|
||||||
ownr_st
|
ownr_st
|
||||||
|
ownr_ea
|
||||||
ins_co_nm
|
ins_co_nm
|
||||||
job_totals
|
job_totals
|
||||||
rate_la1
|
rate_la1
|
||||||
|
|||||||
Reference in New Issue
Block a user