IO-233 CDK WIP customer changes.

This commit is contained in:
Patrick Fic
2021-09-13 09:43:41 -07:00
parent fe993cba73
commit 7e3f496ea1
13 changed files with 141 additions and 35 deletions

View File

@@ -19467,6 +19467,27 @@
</translation>
</translations>
</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>
<name>journal</name>
<definition_loaded>false</definition_loaded>
@@ -19682,6 +19703,27 @@
</translation>
</translations>
</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>
</folder_node>
<concept_node>

View File

@@ -8,7 +8,25 @@ import { alphaSort } from "../../utils/sorters";
import JobExportButton from "../jobs-close-export-button/jobs-close-export-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 [selectedJobs, setSelectedJobs] = useState([]);
const [transInProgress, setTransInProgress] = useState(false);
@@ -180,12 +198,14 @@ export default function AccountingReceivablesTableComponent({ loading, jobs }) {
<Card
extra={
<Space wrap>
<JobsExportAllButton
jobIds={selectedJobs}
disabled={transInProgress || selectedJobs.length === 0}
loadingCallback={setTransInProgress}
completedCallback={setSelectedJobs}
/>
{!bodyshop.cdk_dealerid && (
<JobsExportAllButton
jobIds={selectedJobs}
disabled={transInProgress || selectedJobs.length === 0}
loadingCallback={setTransInProgress}
completedCallback={setSelectedJobs}
/>
)}
<Input.Search
value={state.search}
onChange={handleSearch}

View File

@@ -21,7 +21,7 @@ export default connect(
mapDispatchToProps
)(DmsAllocationsSummary);
export function DmsAllocationsSummary({ socket, bodyshop, jobId, ro_number }) {
export function DmsAllocationsSummary({ socket, bodyshop, jobId, title }) {
const { t } = useTranslation();
const [allocationsSummary, setAllocationsSummary] = useState([]);
@@ -77,7 +77,7 @@ export function DmsAllocationsSummary({ socket, bodyshop, jobId, ro_number }) {
return (
<Card
title={ro_number}
title={title}
extra={
<Button
onClick={() => {

View File

@@ -47,10 +47,6 @@ export function DmsCdkVehicles({ bodyshop, form, socket, job }) {
},
];
console.log(
"🚀 ~ file: dms-cdk-makes.component.jsx ~ line 95 ~ selectedModel",
selectedModel
);
return (
<div>
<Modal

View File

@@ -1,4 +1,4 @@
import { Button, Table, Col } from "antd";
import { Button, Table, Col , Checkbox} from "antd";
import React, { useState } from "react";
import { useTranslation } from "react-i18next";
import { connect } from "react-redux";
@@ -51,6 +51,17 @@ export function DmsCustomerSelector({ bodyshop }) {
};
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"),
dataIndex: ["name1", "fullName"],

View File

@@ -69,7 +69,7 @@ export function DmsPostForm({ bodyshop, socket, job }) {
story: t("jobs.labels.dms.defaultstory", {
ro_number: job.ro_number,
area_of_damage: job.area_of_damage && job.area_of_damage.impact1,
}).substr(0, 249),
}).substr(0, 239),
}}
>
<LayoutFormRow grow>
@@ -153,7 +153,7 @@ export function DmsPostForm({ bodyshop, socket, job }) {
},
]}
>
<Input.TextArea maxLength={250} />
<Input.TextArea maxLength={240} />
</Form.Item>
<Divider />
<Form.List name={["payers"]}>

View File

@@ -1887,8 +1887,13 @@ export const QUERY_JOB_EXPORT_DMS = gql`
po_number
clm_no
job_totals
ownr_fn
ownr_ln
ownr_co_nm
kmin
kmout
v_make_desc
v_model_yr
v_model_desc
area_of_damage
}

View File

@@ -71,6 +71,10 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
document.title = t("titles.dms");
setSelectedHeader("dms");
setBreadcrumbs([
{
link: "/manage/accounting/receivables",
label: t("titles.bc.accounting-receivables"),
},
{
link: "/manage/dms",
label: t("titles.bc.dms"),
@@ -122,7 +126,13 @@ export function DmsContainer({ bodyshop, setBreadcrumbs, setSelectedHeader }) {
<Row gutter={[16, 16]}>
<Col span={10}>
<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}
jobId={jobId}
/>

View File

@@ -1193,6 +1193,7 @@
"dms_make": "DMS Make",
"dms_model": "DMS Model",
"dms_wip_acctnumber": "Cost WIP DMS Acct #",
"id": "DMS ID",
"journal": "Journal #",
"name1": "Customer Name",
"payer": {
@@ -1204,7 +1205,8 @@
},
"sale": "Sale",
"sale_dms_acctnumber": "Sale DMS Acct #",
"story": "Story"
"story": "Story",
"vinowner": "VIN Owner"
},
"driveable": "Driveable",
"employee_body": "Body",

View File

@@ -1193,6 +1193,7 @@
"dms_make": "",
"dms_model": "",
"dms_wip_acctnumber": "",
"id": "",
"journal": "",
"name1": "",
"payer": {
@@ -1204,7 +1205,8 @@
},
"sale": "",
"sale_dms_acctnumber": "",
"story": ""
"story": "",
"vinowner": ""
},
"driveable": "",
"employee_body": "",

View File

@@ -1193,6 +1193,7 @@
"dms_make": "",
"dms_model": "",
"dms_wip_acctnumber": "",
"id": "",
"journal": "",
"name1": "",
"payer": {
@@ -1204,7 +1205,8 @@
},
"sale": "",
"sale_dms_acctnumber": "",
"story": ""
"story": "",
"vinowner": ""
},
"driveable": "",
"employee_body": "",

View File

@@ -75,7 +75,9 @@ exports.default = async function (socket, { txEnvelope, jobid }) {
socket.DMSCustList = await QueryDmsCustomerByName(socket, JobData);
socket.emit("cdk-select-customer", [
...(socket.DMSVehCustomer ? [socket.DMSVehCustomer] : []),
...(socket.DMSVehCustomer
? [{ ...socket.DMSVehCustomer, vinOwner: true }]
: []),
...socket.DMSCustList,
]);
} catch (error) {
@@ -140,30 +142,24 @@ async function CdkSelectedCustomer(socket, selectedCustomerId) {
);
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(
socket,
"DEBUG",
`{6} Creating Transaction header with Dms Start WIP`
`{5} Creating Transaction header with Dms Start WIP`
);
socket.DMSTransHeader = await InsertDmsStartWip(socket);
CdkBase.createLogEvent(
socket,
"DEBUG",
`{6.1} Creating Transaction with ID ${socket.DMSTransHeader.transID}`
`{5.1} Creating Transaction with ID ${socket.DMSTransHeader.transID}`
);
socket.DMSBatchTxn = await InsertDmsBatchWip(socket);
CdkBase.createLogEvent(
socket,
"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);
if (socket.DmsBatchTxnPost.code === "success") {
@@ -171,25 +167,31 @@ async function CdkSelectedCustomer(socket, selectedCustomerId) {
CdkBase.createLogEvent(
socket,
"DEBUG",
`{8} Successfully posted sransaction to DMS.`
`{6} Successfully posted sransaction to DMS.`
);
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);
} else {
//Get the error code
CdkBase.createLogEvent(
socket,
"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);
//Delete the transaction
CdkBase.createLogEvent(
socket,
"DEBUG",
`{7.2} Deleting Transaction ID ${socket.DMSTransHeader.transID}`
`{6.2} Deleting Transaction ID ${socket.DMSTransHeader.transID}`
);
socket.DmsBatchTxnPost = await DeleteDmsWip(socket);
//Emit the error in a nice way .
@@ -203,7 +205,7 @@ async function CdkSelectedCustomer(socket, selectedCustomerId) {
CdkBase.createLogEvent(
socket,
"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,
city: socket.JobData.ownr_city,
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,
},
contactInfo: {
@@ -583,6 +590,10 @@ async function InsertDmsCustomer(socket, newCustomerNumber) {
main: true,
value: socket.JobData.ownr_ph1,
},
email: {
desc: socket.JobData.ownr_ea ? "Other" : "CustomerDeclined",
value: socket.JobData.ownr_ea ? "Other" : null,
},
},
demographics: null,
name1: {
@@ -595,6 +606,10 @@ async function InsertDmsCustomer(socket, newCustomerNumber) {
suffix: null,
title: null,
},
//TODO - REMOVE THIS AFTER TESTING.
...(process.env.NODE_ENV !== "production"
? { arStatus: { dealerField1: "Testing" } }
: {}),
},
},

View File

@@ -140,6 +140,7 @@ query QUERY_JOBS_FOR_CDK_EXPORT($id: uuid!) {
ownr_zip
ownr_city
ownr_st
ownr_ea
ins_co_nm
job_totals
rate_la1