fix(builds): fixed non used variables
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m32s
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 1m32s
This commit is contained in:
@@ -6,7 +6,7 @@ import {
|
||||
sqlQuerySelector,
|
||||
} from "../prodSql/prodSqlQuerySelector.utils.js";
|
||||
import { returnFunc } from "../utils/returnHelper.utils.js";
|
||||
import { sendEmail } from "../utils/sendEmail.utils.js";
|
||||
//import { sendEmail } from "../utils/sendEmail.utils.js";
|
||||
import { tryCatch } from "../utils/trycatch.utils.js";
|
||||
import { postData } from "./logistics.dm.postData.js";
|
||||
|
||||
@@ -83,7 +83,7 @@ export const lorealForecast = async (data: any, user: any) => {
|
||||
|
||||
const article: any = a?.data;
|
||||
|
||||
console.log(article);
|
||||
//console.log(article);
|
||||
|
||||
// process the ebm forcast
|
||||
for (let i = 0; i < ebmForeCastData.length; i++) {
|
||||
@@ -127,31 +127,6 @@ export const lorealForecast = async (data: any, user: any) => {
|
||||
//console.log(ebmForeCastData.length);
|
||||
}
|
||||
|
||||
// petForeCastData.forEach((item: any, index: any) => {
|
||||
// //console.log(`Processing item ${index + 1} of ${forecastData.length}`);
|
||||
|
||||
// // Extract the customer code
|
||||
// const customerCode = item["SOUTH PET BOTTLES"];
|
||||
|
||||
// // Process each date in the current object
|
||||
// for (const [date, qty] of Object.entries(item)) {
|
||||
// // Skip metadata fields
|
||||
// if (petMetadataFields.includes(date)) continue;
|
||||
|
||||
// if (qty === 0) continue;
|
||||
|
||||
// // Create your transformed record
|
||||
// const record = {
|
||||
// customerArticleNo: customerCode,
|
||||
// requirementDate: excelDateStuff(parseInt(date)),
|
||||
// quantity: qty,
|
||||
// };
|
||||
|
||||
// // Do something with this record
|
||||
// petForecastData.push(record);
|
||||
// }
|
||||
// });
|
||||
|
||||
// pet forecast
|
||||
for (let i = 0; i < petForeCastData.length; i++) {
|
||||
// bottle code
|
||||
@@ -200,25 +175,25 @@ export const lorealForecast = async (data: any, user: any) => {
|
||||
//console.log(comForecast);
|
||||
|
||||
// email the for the missing ones
|
||||
const missedGrouped = Object.values(
|
||||
missingSku.reduce((acc: any, item: any) => {
|
||||
const key = item.customerArticleNo;
|
||||
// const missedGrouped = Object.values(
|
||||
// missingSku.reduce((acc: any, item: any) => {
|
||||
// const key = item.customerArticleNo;
|
||||
|
||||
if (!acc[key]) {
|
||||
// first time we see this customer
|
||||
acc[key] = item;
|
||||
} else {
|
||||
// compare dates and keep the earliest
|
||||
if (
|
||||
new Date(item.requirementDate) < new Date(acc[key].requirementDate)
|
||||
) {
|
||||
acc[key] = item;
|
||||
}
|
||||
}
|
||||
// if (!acc[key]) {
|
||||
// // first time we see this customer
|
||||
// acc[key] = item;
|
||||
// } else {
|
||||
// // compare dates and keep the earliest
|
||||
// if (
|
||||
// new Date(item.requirementDate) < new Date(acc[key].requirementDate)
|
||||
// ) {
|
||||
// acc[key] = item;
|
||||
// }
|
||||
// }
|
||||
|
||||
return acc;
|
||||
}, {}),
|
||||
);
|
||||
// return acc;
|
||||
// }, {}),
|
||||
// );
|
||||
|
||||
// TODO: change this to a flagged notification so that he users can subscribe or leave it. this removes the hardcody shit.
|
||||
// const emailSetup = {
|
||||
@@ -248,19 +223,7 @@ export const lorealForecast = async (data: any, user: any) => {
|
||||
|
||||
const updatedPredefinedObject = {
|
||||
...predefinedObject,
|
||||
positions: [
|
||||
...predefinedObject.positions,
|
||||
...ebmForecastData,
|
||||
|
||||
// ...ebmForecastData.filter(
|
||||
// (q: any) =>
|
||||
// q.customerArticleNo != "" && q.customerArticleNo != "Total"
|
||||
// ),
|
||||
// ...petForecastData.filter(
|
||||
// (q: any) =>
|
||||
// q.customerArticleNo != "" && q.customerArticleNo != "Total"
|
||||
// ),
|
||||
],
|
||||
positions: [...predefinedObject.positions, ...ebmForecastData],
|
||||
};
|
||||
// console.log(updatedPredefinedObject);
|
||||
|
||||
|
||||
@@ -113,8 +113,8 @@ export const pNgForecast = async (data: any, user: any) => {
|
||||
// }
|
||||
|
||||
return {
|
||||
customerArticleNo: parseInt(o["Customer Item No."]),
|
||||
requirementDate: excelDateStuff(parseInt(o["Request Date"])),
|
||||
customerArticleNo: parseInt(o["Customer Item No."] ?? "0", 10),
|
||||
requirementDate: excelDateStuff(parseInt(o["Request Date"] ?? "0", 10)),
|
||||
quantity: o["Remaining Qty to be Shipped"],
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user