Merged in release/2022-01-28 (pull request #358)

release/2022-01-28

Approved-by: Patrick Fic
This commit is contained in:
Patrick Fic
2022-01-24 23:57:37 +00:00
2 changed files with 16 additions and 10 deletions

View File

@@ -171,7 +171,7 @@ export function JobChecklistForm({
});
}
};
console.log(job,{
console.log(job, {
removeFromProduction: true,
actual_completion:
job && job.actual_completion && moment(job.actual_completion),
@@ -212,7 +212,8 @@ export function JobChecklistForm({
0) / bodyshop.target_touchtime,
"days"
)),
scheduled_delivery: job && moment(job.scheduled_delivery),
scheduled_delivery:
job.scheduled_delivery && moment(job.scheduled_delivery),
}),
...(type === "deliver" && {
removeFromProduction: true,

View File

@@ -37,12 +37,15 @@ exports.default = async (req, res) => {
//Query for the List of Bodyshop Clients.
logger.log("autohouse-start", "DEBUG", "api", null, null);
const { bodyshops } = await client.request(queries.GET_AUTOHOUSE_SHOPS);
639;
const specificShopIds = req.body.bodyshopIds; // ['uuid]
const start = req.body.start; //YYYY-MM-DD
const allxmlsToUpload = [];
const allErrors = [];
try {
for (const bodyshop of bodyshops) {
for (const bodyshop of specificShopIds
? bodyshops.filter((b) => specificShopIds.includes(b.id))
: bodyshops) {
logger.log("autohouse-start-shop-extract", "DEBUG", "api", bodyshop.id, {
shopname: bodyshop.shopname,
});
@@ -52,7 +55,9 @@ exports.default = async (req, res) => {
queries.AUTOHOUSE_QUERY,
{
bodyshopid: bodyshop.id,
start: moment().subtract(3, "days").startOf("day"),
start: start
? moment(start).startOf("day")
: moment().subtract(3, "days").startOf("day"),
}
);
@@ -118,12 +123,12 @@ exports.default = async (req, res) => {
}
}
for (const xmlObj of allxmlsToUpload) {
fs.writeFileSync(`./logs/${xmlObj.filename}`, xmlObj.xml);
}
// for (const xmlObj of allxmlsToUpload) {
// fs.writeFileSync(`./logs/${xmlObj.filename}`, xmlObj.xml);
// }
res.json(allxmlsToUpload);
return;
// res.json(allxmlsToUpload);
// return;
let sftp = new Client();
sftp.on("error", (errors) =>