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

@@ -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": "",