IO-233 Add GST override for CDK.

This commit is contained in:
Patrick Fic
2021-12-03 09:13:24 -08:00
parent a5aee28d42
commit 2f1c168b3e
10 changed files with 94 additions and 13 deletions

View File

@@ -213,8 +213,7 @@ exports.default = async function (socket, jobid) {
}
if (job.towing_payable && job.towing_payable !== 0) {
const towAccountName =
selectedDmsAllocationConfig.profits.TOW;
const towAccountName = selectedDmsAllocationConfig.profits.TOW;
const towAccount = bodyshop.md_responsibility_centers.profits.find(
(c) => c.name === towAccountName
@@ -234,8 +233,7 @@ exports.default = async function (socket, jobid) {
}
}
if (job.storage_payable && job.storage_payable !== 0) {
const storageAccountName =
selectedDmsAllocationConfig.profits.TOW;
const storageAccountName = selectedDmsAllocationConfig.profits.TOW;
const towAccount = bodyshop.md_responsibility_centers.profits.find(
(c) => c.name === storageAccountName
@@ -258,8 +256,7 @@ exports.default = async function (socket, jobid) {
}
if (job.adjustment_bottom_line && job.adjustment_bottom_line !== 0) {
const otherAccountName =
selectedDmsAllocationConfig.profits.PAO;
const otherAccountName = selectedDmsAllocationConfig.profits.PAO;
const otherAccount = bodyshop.md_responsibility_centers.profits.find(
(c) => c.name === otherAccountName
@@ -310,7 +307,20 @@ exports.default = async function (socket, jobid) {
taxAllocations[key].cost.getAmount() > 0
)
.map((key) => {
return { ...taxAllocations[key], tax: key };
if (
key === "federal" &&
selectedDmsAllocationConfig.gst_override &&
selectedDmsAllocationConfig.gst_override !== ""
) {
const ret = { ...taxAllocations[key], tax: key };
ret.costCenter.dms_acctnumber =
selectedDmsAllocationConfig.gst_override;
ret.profitCenter.dms_acctnumber =
selectedDmsAllocationConfig.gst_override;
return ret;
} else {
return { ...taxAllocations[key], tax: key };
}
}),
];
} catch (error) {

View File

@@ -784,7 +784,7 @@ async function UpdateDmsVehicle(socket) {
return {
id: {
assigningPartyId:
o.id.value === socket.dmsCust.id.value ? "CURRENT" : "PREVIOUS",
o.id.value === socket.DMSCust.id.value ? "CURRENT" : "PREVIOUS",
value: o.id.value,
},
};