Merged in release/2021-10-08 (pull request #243)
release/2021-10-08 Approved-by: Patrick Fic
This commit is contained in:
@@ -42,7 +42,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_lab")}
|
label={t("jobs.fields.rate_lab")}
|
||||||
@@ -55,7 +55,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_lad")}
|
label={t("jobs.fields.rate_lad")}
|
||||||
@@ -68,7 +68,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_lae")}
|
label={t("jobs.fields.rate_lae")}
|
||||||
@@ -81,7 +81,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_laf")}
|
label={t("jobs.fields.rate_laf")}
|
||||||
@@ -94,7 +94,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_lag")}
|
label={t("jobs.fields.rate_lag")}
|
||||||
@@ -107,7 +107,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_lam")}
|
label={t("jobs.fields.rate_lam")}
|
||||||
@@ -120,7 +120,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_lar")}
|
label={t("jobs.fields.rate_lar")}
|
||||||
@@ -133,7 +133,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_las")}
|
label={t("jobs.fields.rate_las")}
|
||||||
@@ -146,7 +146,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_la1")}
|
label={t("jobs.fields.rate_la1")}
|
||||||
@@ -159,7 +159,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_la2")}
|
label={t("jobs.fields.rate_la2")}
|
||||||
@@ -172,7 +172,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_la3")}
|
label={t("jobs.fields.rate_la3")}
|
||||||
@@ -185,7 +185,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_la4")}
|
label={t("jobs.fields.rate_la4")}
|
||||||
@@ -198,7 +198,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_mash")}
|
label={t("jobs.fields.rate_mash")}
|
||||||
@@ -211,7 +211,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_mapa")}
|
label={t("jobs.fields.rate_mapa")}
|
||||||
@@ -224,7 +224,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_ma2s")}
|
label={t("jobs.fields.rate_ma2s")}
|
||||||
@@ -237,7 +237,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_ma3s")}
|
label={t("jobs.fields.rate_ma3s")}
|
||||||
@@ -250,7 +250,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{
|
{
|
||||||
// <Form.Item
|
// <Form.Item
|
||||||
@@ -264,7 +264,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
// },
|
// },
|
||||||
// ]}
|
// ]}
|
||||||
// >
|
// >
|
||||||
// <CurrencyInput />
|
// <CurrencyInput min={0} />
|
||||||
// </Form.Item>
|
// </Form.Item>
|
||||||
// <Form.Item
|
// <Form.Item
|
||||||
// label={t("jobs.fields.rate_macs")}
|
// label={t("jobs.fields.rate_macs")}
|
||||||
@@ -277,7 +277,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
// },
|
// },
|
||||||
// ]}
|
// ]}
|
||||||
// >
|
// >
|
||||||
// <CurrencyInput />
|
// <CurrencyInput min={0} />
|
||||||
// </Form.Item>
|
// </Form.Item>
|
||||||
}
|
}
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -291,7 +291,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.rate_mahw")}
|
label={t("jobs.fields.rate_mahw")}
|
||||||
@@ -304,7 +304,7 @@ export default function ShopInfoLaborRates({ form }) {
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<CurrencyInput />
|
<CurrencyInput min={0} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<DeleteFilled
|
<DeleteFilled
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
|||||||
@@ -180,6 +180,85 @@ exports.default = async function (socket, jobid) {
|
|||||||
// console.log("NO MASH ACCOUNT FOUND!!");
|
// console.log("NO MASH ACCOUNT FOUND!!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
const { ca_bc_pvrt } = job;
|
||||||
|
if (ca_bc_pvrt) {
|
||||||
|
// const pvrtAccount = bodyshop.md_responsibility_centers.profits.find(
|
||||||
|
// (c) => c.name === mashAccountName
|
||||||
|
// );
|
||||||
|
|
||||||
|
taxAllocations.state.sale = taxAllocations.state.sale.add(
|
||||||
|
Dinero({ amount: (ca_bc_pvrt || 0) * 100 })
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (job.towing_payable && job.towing_payable !== 0) {
|
||||||
|
const towAccountName =
|
||||||
|
bodyshop.md_responsibility_centers.defaults.profits.TOW;
|
||||||
|
|
||||||
|
const towAccount = bodyshop.md_responsibility_centers.profits.find(
|
||||||
|
(c) => c.name === towAccountName
|
||||||
|
);
|
||||||
|
|
||||||
|
if (towAccount) {
|
||||||
|
if (!profitCenterHash[towAccountName])
|
||||||
|
profitCenterHash[towAccountName] = Dinero();
|
||||||
|
|
||||||
|
profitCenterHash[towAccountName] = profitCenterHash[towAccountName].add(
|
||||||
|
Dinero({
|
||||||
|
amount: Math.round((job.towing_payable || 0) * 100),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// console.log("NO MASH ACCOUNT FOUND!!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (job.storage_payable && job.storage_payable !== 0) {
|
||||||
|
const storageAccountName =
|
||||||
|
bodyshop.md_responsibility_centers.defaults.profits.TOW;
|
||||||
|
|
||||||
|
const towAccount = bodyshop.md_responsibility_centers.profits.find(
|
||||||
|
(c) => c.name === storageAccountName
|
||||||
|
);
|
||||||
|
|
||||||
|
if (towAccount) {
|
||||||
|
if (!profitCenterHash[storageAccountName])
|
||||||
|
profitCenterHash[storageAccountName] = Dinero();
|
||||||
|
|
||||||
|
profitCenterHash[storageAccountName] = profitCenterHash[
|
||||||
|
storageAccountName
|
||||||
|
].add(
|
||||||
|
Dinero({
|
||||||
|
amount: Math.round((job.storage_payable || 0) * 100),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// console.log("NO MASH ACCOUNT FOUND!!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (job.adjustment_bottom_line && job.adjustment_bottom_line !== 0) {
|
||||||
|
const otherAccountName =
|
||||||
|
bodyshop.md_responsibility_centers.defaults.profits.PAO;
|
||||||
|
|
||||||
|
const otherAccount = bodyshop.md_responsibility_centers.profits.find(
|
||||||
|
(c) => c.name === otherAccountName
|
||||||
|
);
|
||||||
|
|
||||||
|
if (otherAccount) {
|
||||||
|
if (!profitCenterHash[otherAccountName])
|
||||||
|
profitCenterHash[otherAccountName] = Dinero();
|
||||||
|
|
||||||
|
profitCenterHash[otherAccountName] = profitCenterHash[
|
||||||
|
otherAccountName
|
||||||
|
].add(
|
||||||
|
Dinero({
|
||||||
|
amount: Math.round((job.adjustment_bottom_line || 0) * 100),
|
||||||
|
})
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
// console.log("NO MASH ACCOUNT FOUND!!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const jobAllocations = _.union(
|
const jobAllocations = _.union(
|
||||||
Object.keys(profitCenterHash),
|
Object.keys(profitCenterHash),
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ const CalcualteAllocations = require("./cdk-calculate-allocations").default;
|
|||||||
|
|
||||||
const moment = require("moment");
|
const moment = require("moment");
|
||||||
|
|
||||||
|
const replaceSpecialRegex = `[^a-zA-Z0-9 .,\n #]+`;
|
||||||
|
|
||||||
exports.default = async function (socket, { txEnvelope, jobid }) {
|
exports.default = async function (socket, { txEnvelope, jobid }) {
|
||||||
socket.logEvents = [];
|
socket.logEvents = [];
|
||||||
socket.recordid = jobid;
|
socket.recordid = jobid;
|
||||||
@@ -175,9 +177,9 @@ async function CdkSelectedCustomer(socket, selectedCustomerId) {
|
|||||||
CdkBase.createLogEvent(
|
CdkBase.createLogEvent(
|
||||||
socket,
|
socket,
|
||||||
"DEBUG",
|
"DEBUG",
|
||||||
`{5} Updating Service Vehicle History. ***SKIPPING FOR NOW TO PRESERVE RO NUMBERS ***`
|
`{5} Updating Service Vehicle History.`
|
||||||
);
|
);
|
||||||
//socket.DMSVehHistory = await InsertServiceVehicleHistory(socket);
|
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
|
||||||
@@ -437,7 +439,7 @@ async function QueryDmsCustomerByName(socket, JobData) {
|
|||||||
arg1: { dealerId: JobData.bodyshop.cdk_dealerid }, //TODO: Verify why this does not follow the other standards.
|
arg1: { dealerId: JobData.bodyshop.cdk_dealerid }, //TODO: Verify why this does not follow the other standards.
|
||||||
arg2: {
|
arg2: {
|
||||||
verb: "EXACT",
|
verb: "EXACT",
|
||||||
key: ownerName,
|
key: ownerName.replaceAll(replaceSpecialRegex, ""),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -574,8 +576,14 @@ async function InsertDmsCustomer(socket, newCustomerNumber) {
|
|||||||
//TODO: Verify whether we need to bring more information in.
|
//TODO: Verify whether we need to bring more information in.
|
||||||
id: { value: newCustomerNumber },
|
id: { value: newCustomerNumber },
|
||||||
address: {
|
address: {
|
||||||
addressLine: socket.JobData.ownr_addr1,
|
addressLine: socket.JobData.ownr_addr1.replaceAll(
|
||||||
city: socket.JobData.ownr_city,
|
replaceSpecialRegex,
|
||||||
|
""
|
||||||
|
),
|
||||||
|
city: socket.JobData.ownr_city.replaceAll(
|
||||||
|
replaceSpecialRegex,
|
||||||
|
""
|
||||||
|
),
|
||||||
country: null,
|
country: null,
|
||||||
postalCode:
|
postalCode:
|
||||||
socket.JobData.ownr_zip &&
|
socket.JobData.ownr_zip &&
|
||||||
@@ -597,19 +605,24 @@ async function InsertDmsCustomer(socket, newCustomerNumber) {
|
|||||||
},
|
},
|
||||||
demographics: null,
|
demographics: null,
|
||||||
name1: {
|
name1: {
|
||||||
companyname: socket.JobData.ownr_co_nm,
|
companyname: socket.JobData.ownr_co_nm.replaceAll(
|
||||||
firstName: socket.JobData.ownr_fn,
|
replaceSpecialRegex,
|
||||||
|
""
|
||||||
|
),
|
||||||
|
firstName: socket.JobData.ownr_fn.replaceAll(
|
||||||
|
replaceSpecialRegex,
|
||||||
|
""
|
||||||
|
),
|
||||||
fullname: null,
|
fullname: null,
|
||||||
lastName: socket.JobData.ownr_ln,
|
lastName: socket.JobData.ownr_ln.replaceAll(
|
||||||
|
replaceSpecialRegex,
|
||||||
|
""
|
||||||
|
),
|
||||||
middleName: null,
|
middleName: null,
|
||||||
nameType: "Person",
|
nameType: "Person",
|
||||||
suffix: null,
|
suffix: null,
|
||||||
title: null,
|
title: null,
|
||||||
},
|
},
|
||||||
//TODO - REMOVE THIS AFTER TESTING.
|
|
||||||
...(process.env.NODE_ENV !== "production"
|
|
||||||
? { arStatus: { dealerField1: "Testing" } }
|
|
||||||
: {}),
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -873,7 +886,7 @@ async function InsertDmsStartWip(socket) {
|
|||||||
arg2: {
|
arg2: {
|
||||||
acctgDate: moment().format("YYYY-MM-DD"),
|
acctgDate: moment().format("YYYY-MM-DD"),
|
||||||
//socket.JobData.invoice_date
|
//socket.JobData.invoice_date
|
||||||
desc: socket.txEnvelope.story,
|
desc: socket.txEnvelope.story.replaceAll(replaceSpecialRegex, ""),
|
||||||
docType: 10 || 7, //Need to check what this usually would be? Apparently it is almost always 10 or 7.
|
docType: 10 || 7, //Need to check what this usually would be? Apparently it is almost always 10 or 7.
|
||||||
//1 Cash Receipt , 2 Check, 3 Journal Voucher, 4 Parts invoice, 5 Payable Invoice, 6 Recurring Entry, 7 Repair Order Invoice, 8 Vehicle Purchase Invoice, 9 Vehicle Sale Invoice, 10 Other, 11 Payroll, 12 Finance Charge, 13 FMLR Invoice, 14 Parts Credit Memo, 15 Manufacturer Document, 16 FMLR Credit Memo
|
//1 Cash Receipt , 2 Check, 3 Journal Voucher, 4 Parts invoice, 5 Payable Invoice, 6 Recurring Entry, 7 Repair Order Invoice, 8 Vehicle Purchase Invoice, 9 Vehicle Sale Invoice, 10 Other, 11 Payroll, 12 Finance Charge, 13 FMLR Invoice, 14 Parts Credit Memo, 15 Manufacturer Document, 16 FMLR Credit Memo
|
||||||
m13Flag: 0,
|
m13Flag: 0,
|
||||||
|
|||||||
Reference in New Issue
Block a user