{"version":3,"sources":["webpack:///./src/views/Dashboard/OrdersDashboard/Tabs/OrdersOverdueTab.vue?8753","webpack:///./src/views/Dashboard/OrdersDashboard/Tabs/OrdersOverdueTab.vue?69bb","webpack:///./src/views/Dashboard/OrdersDashboard/Tabs/OrdersOverdueTab.vue","webpack:///./src/views/Dashboard/OrdersDashboard/Tabs/OrdersOverdueTab.vue?0c3e"],"names":["n","_hoisted_1","class","_hoisted_2","style","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","render","_ctx","_cache","$props","$setup","$data","$options","_component_k_button","_component_k_radio_group","_component_kendo_grid","onClick","refresh","modelValue","filterBy","$event","filterOptions","layout","loading","isLoading","itemsUk","columns","columnsUk","rowRender","noRecordsMessage","headerTemplate","props","title","getColumnTitle","_","itemsDe","columnsDe","itemsUs","columnsUs","daysBefore","daysAfter","orderGroups","web","id","types","prn","frm","mnt","asf","other","warehouseBranches","UK","name","USA","Germany","value","label","shutdownDatesCache","getToday","date","Date","toISOString","split","getNextDate","isBackDirection","result","setDate","getDate","isWorkingDate","warehouseId","dayOfWeek","getDay","find","x","Warehouse","buildColumnsBase","days","Array","from","length","field","className","headerClassName","map","i","headerCell","isOff","components","KRadioGroup","KButton","setup","grid","data","headers","text","cache","todayDateUtc","computed","this","initializeForWarehouse","watch","filterOption","buildData","mounted","generateBackgroundClasses","load","methods","currentDate","d","toLocaleDateString","year","month","day","headerAttributes","columnDate","h","trElement","defaultSlots","isTitle","dataItem","isGroupTitle","isTotal","trProps","filterByOrderOptions","buildDataRows","warehouseData","totalDataRow","Object","entries","forEach","group","orderTypeKey","orderType","push","subGroup","orderSubTypeKey","orderSubType","calculatedDays","keys","reduce","dayFieldName","dayData","itemsPerDay","acc","item","ItemsCount","totalPerDay","objToPush","uk","de","us","styleSheet","document","styleSheets","createElement","ownerNode","head","appendChild","opacity1","toFixed","opacity2","rule","insertRule","cssRules","alert","$","get","then","response","self","getDaysDifferenceNormalized","baseDate","dateToCheck","getTime","isBaseDateOff","nearestBaseDateOn","testDate","daysDifference","getDateId","orderDueDate","dueDate","normalizedDifference","Math","abs","order","warehouse","Branch","webOrderTypes","type","includes","OrderType","subType","ContainsFraming","ContainsMounting","w","t","sub","dateId","DueDate","console","log","__exports__"],"mappings":"yIAAA,W,yDCEM,EAAe,SAAAA,GAAC,OAAK,yBAAa,mBAAmBA,EAAEA,IAAI,0BAAcA,GACzEC,EAAa,CAAEC,MAAO,UACtBC,EAAa,CAAEC,MAAO,CAAC,QAAU,SACjCC,EAA2B,GAAa,kBAAmB,gCAAoB,KAAM,KAAM,MAAO,MAClGC,EAAa,CAAC,SACdC,EAA2B,GAAa,kBAAmB,gCAAoB,KAAM,KAAM,WAAY,MACvGC,EAAa,CAAC,SACdC,EAA2B,GAAa,kBAAmB,gCAAoB,KAAM,KAAM,OAAQ,MACnGC,EAAa,CAAC,SAEd,SAAUC,EAAOC,EAAUC,EAAYC,EAAYC,EAAYC,EAAWC,GAC9E,IAAMC,EAAsB,8BAAkB,YACxCC,EAA2B,8BAAkB,iBAC7CC,EAAwB,8BAAkB,cAEhD,OAAQ,yBAAc,gCAAoB,MAAOnB,EAAY,CAC3D,gCAAoB,MAAOE,EAAY,CACrC,yBAAae,EAAqB,CAChCd,MAAO,CAAC,eAAe,QACvB,aAAc,sBACdiB,QAAS,2BAAeT,EAAKU,QAAS,CAAC,aACtC,KAAM,EAAG,CAAC,YACb,yBAAaH,EAA0B,CACrCI,WAAYX,EAAKY,SACjB,sBAAuBX,EAAO,KAAOA,EAAO,GAAK,SAACY,GAAD,OAAmBb,EAAKY,SAAYC,IACrF,aAAcb,EAAKc,cACnBC,OAAQ,cACP,KAAM,EAAG,CAAC,aAAc,iBAE7BtB,EACA,yBAAae,EAAuB,CAClCQ,QAAShB,EAAKiB,UACd,aAAcjB,EAAKkB,QACnBC,QAASnB,EAAKoB,UACd,aAAcpB,EAAKqB,UACnB/B,MAAO,QACP,aAAcU,EAAKsB,kBAClB,CACDC,eAAgB,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IAAIV,GACtB6I,EAAME,QAAUxI,EAAkBI,QAAQF,KACxCF,EAAkBI,QAAQX,GAAKO,EAAkBC,GAAGR,GAEpDgJ,EAA0B,CAAC,MAAO,QAAS,UAAW,yBAA0B,cAChFC,EAAOD,EAAcE,SAASL,EAAMM,WAAa,MAA2B,aAAnBN,EAAMM,UAA2B,MAAQ,QAClGC,EAAUP,EAAMQ,gBAAkB,MAAQR,EAAMS,iBAAmB,MAAQ,MAE7EC,EAAItG,EAAK6F,GACJ,MAALS,IAAWtG,EAAK6F,GAAaS,EAAI,IAErC,IAAIC,EAAID,EAAEN,GACD,MAALO,IAAWD,EAAEN,GAAQO,EAAI,IAE7B,IAAIC,EAAMD,EAAEJ,GACD,MAAPK,IAAaD,EAAEJ,GAAWK,EAAM,IAEpC,IAAIC,EAASnB,EAAUM,EAAMc,QAASb,GAClC7E,EAAIwF,EAAIC,GACH,MAALzF,IAAWwF,EAAIC,GAAUzF,EAAI,IACjCA,EAAEyB,KAAKmD,MAEnBe,QAAQC,IAAI5G,GACF,EAAKG,MAAQH,EACb,EAAKU,eAhID,uBAmIN,EAAK9E,WAAY,EAnIX,iH,iCCjRd,MAAMiL,EAA2B,IAAgB,EAAQ,CAAC,CAAC,SAASnM,GAAQ,CAAC,YAAY,qBAE1E","file":"js/chunk-0c30d9b1.f489a44c.js","sourcesContent":["export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--12-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--12-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--12-oneOf-1-2!../../../../../node_modules/stylus-loader/index.js??ref--12-oneOf-1-3!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-0!./OrdersOverdueTab.vue?vue&type=style&index=0&id=b6ec3eee&scoped=true&lang=stylus\"","import { resolveComponent as _resolveComponent, withModifiers as _withModifiers, createVNode as _createVNode, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-b6ec3eee\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"splash\" }\nconst _hoisted_2 = { style: {\"display\":\"flex\"} }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"h4\", null, \"UK\", -1))\nconst _hoisted_4 = [\"title\"]\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"h4\", null, \"Germany\", -1))\nconst _hoisted_6 = [\"title\"]\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"h4\", null, \"USA\", -1))\nconst _hoisted_8 = [\"title\"]\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_k_button = _resolveComponent(\"k-button\")!\n const _component_k_radio_group = _resolveComponent(\"k-radio-group\")!\n const _component_kendo_grid = _resolveComponent(\"kendo-grid\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_k_button, {\n style: {\"margin-right\":\"20px\"},\n \"icon-class\": 'k-icon k-i-reset-sm',\n onClick: _withModifiers(_ctx.refresh, [\"prevent\"])\n }, null, 8, [\"onClick\"]),\n _createVNode(_component_k_radio_group, {\n modelValue: _ctx.filterBy,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((_ctx.filterBy) = $event)),\n \"data-items\": _ctx.filterOptions,\n layout: 'horizontal'\n }, null, 8, [\"modelValue\", \"data-items\"])\n ]),\n _hoisted_3,\n _createVNode(_component_kendo_grid, {\n loading: _ctx.isLoading,\n \"data-items\": _ctx.itemsUk,\n columns: _ctx.columnsUk,\n \"row-render\": _ctx.rowRender,\n class: \"stats\",\n \"no-records\": _ctx.noRecordsMessage\n }, {\n headerTemplate: _withCtx(({props}) => [\n _createElementVNode(\"span\", {\n title: _ctx.getColumnTitle(props)\n }, _toDisplayString(props.title), 9, _hoisted_4)\n ]),\n _: 1\n }, 8, [\"loading\", \"data-items\", \"columns\", \"row-render\", \"no-records\"]),\n _hoisted_5,\n _createVNode(_component_kendo_grid, {\n \"data-items\": _ctx.itemsDe,\n columns: _ctx.columnsDe,\n \"row-render\": _ctx.rowRender,\n class: \"stats\",\n \"no-records\": _ctx.noRecordsMessage\n }, {\n headerTemplate: _withCtx(({props}) => [\n _createElementVNode(\"span\", {\n title: _ctx.getColumnTitle(props)\n }, _toDisplayString(props.title), 9, _hoisted_6)\n ]),\n _: 1\n }, 8, [\"data-items\", \"columns\", \"row-render\", \"no-records\"]),\n _hoisted_7,\n _createVNode(_component_kendo_grid, {\n \"data-items\": _ctx.itemsUs,\n columns: _ctx.columnsUs,\n \"row-render\": _ctx.rowRender,\n class: \"stats\",\n \"no-records\": _ctx.noRecordsMessage\n }, {\n headerTemplate: _withCtx(({props}) => [\n _createElementVNode(\"span\", {\n title: _ctx.getColumnTitle(props)\n }, _toDisplayString(props.title), 9, _hoisted_8)\n ]),\n _: 1\n }, 8, [\"data-items\", \"columns\", \"row-render\", \"no-records\"])\n ]))\n}","\r\nimport { defineComponent, ref } from \"vue\";\r\nimport { Input, TextArea, RadioGroup, Checkbox, NumericTextBox} from \"@progress/kendo-vue-inputs\";\r\nimport { ButtonGroup, Button } from \"@progress/kendo-vue-buttons\";\r\nimport { Grid /*, GridColumn*/ } from '@progress/kendo-vue-grid';\r\n\r\ndeclare var $: any;\r\nconst daysBefore = 5;\r\nconst daysAfter = 10;\r\nconst orderGroups = {\r\n web: {\r\n id: \"web\",\r\n title: \"Web Orders\",\r\n types: {\r\n prn: { id: \"prn\", title: \"Print only\" },\r\n frm: { id: \"frm\", title: \"Contains Framing\" },\r\n mnt: { id: \"mnt\", title: \"Contains Mounting\" },\r\n },\r\n },\r\n asf: {\r\n id: \"asf\",\r\n title: \"ASF\",\r\n types: {\r\n prn: { id: \"prn\", title: \"Print only\" },\r\n frm: { id: \"frm\", title: \"Contains ASF Framing\" },\r\n mnt: { id: \"mnt\", title: \"Contains ASF Mounting\" },\r\n },\r\n },\r\n // rather never happens, but jic\r\n other: {\r\n id: \"other\",\r\n title: \"Other\",\r\n types: {\r\n prn: { id: \"prn\", title: \"Print only\" },\r\n frm: { id: \"frm\", title: \"Contains Framing\" },\r\n mnt: { id: \"mnt\", title: \"Contains Mounting\" },\r\n },\r\n },\r\n};\r\nconst warehouseBranches = {\r\n UK: { id: \"uk\", name: \"UK\" },\r\n USA: { id: \"us\", name: \"USA\" },\r\n Germany: { id: \"de\", name: \"Germany\" },\r\n};\r\nconst filterOptions = [\r\n { value: 0, label: \"Orders\" },\r\n { value: 1, label: \"Order Items\" }\r\n];\r\n\r\nlet shutdownDatesCache: any = [];\r\n\r\nfunction getToday() {\r\n const date = new Date(new Date().toISOString().split(\"T\")[0]);\r\n return date;\r\n}\r\nfunction getNextDate(date: Date, isBackDirection = false) {\r\n const result = new Date(date);\r\n result.setDate(result.getDate() + (isBackDirection ? -1 : 1));\r\n return result;\r\n}\r\nfunction isWorkingDate(date: Date, warehouseId: string) {\r\n const dayOfWeek = date.getDay();\r\n return dayOfWeek != 6 && dayOfWeek != 0 // not Sat nor Sun\r\n && !shutdownDatesCache.find((x: any) => x.Warehouse == warehouseId && x.Date == date);\r\n}\r\nfunction buildColumnsBase() {\r\n const days = Array.from({ length: daysAfter + daysBefore + 1 });\r\n const columns = [\r\n {\r\n field: \"title\",\r\n title: \" \",\r\n className: \"order-overdue-title\",\r\n headerClassName: \"order-overdue-title\",\r\n },\r\n ...days.map((_, i) => {\r\n return {\r\n headerCell: 'headerTemplate',\r\n field:\r\n \"d\" + (i < daysBefore ? daysBefore - i + \"m\" : i - daysBefore),\r\n isOff: false,\r\n date: '...',\r\n title:\r\n i < daysBefore\r\n ? -(daysBefore - i) + (i == 0 ? \"+\" : \"\")\r\n : i == daysBefore\r\n ? \"Today\"\r\n : i - daysBefore + (i == days.length - 1 ? \"+\" : \"\"),\r\n //headerAttributes: { title: \"title\" },\r\n //headerCell: headerCellFunction,\r\n className:\r\n \"order-overdue-\" +\r\n (i < daysBefore\r\n ? \"past\"\r\n : i == daysBefore\r\n ? \"today\"\r\n : i - daysBefore + \"days\"),\r\n headerClassName:\r\n \"order-overdue-\" +\r\n (i < daysBefore\r\n ? \"past\"\r\n : i == daysBefore\r\n ? \"today\"\r\n : i - daysBefore + \"days\"),\r\n };\r\n }),\r\n ];\r\n return columns;\r\n}\r\nexport default defineComponent({\r\n name: \"OrdersOverdueTab\",\r\n components: {\r\n KRadioGroup: RadioGroup,\r\n KButton: Button,\r\n \"kendo-grid\": Grid,\r\n },\r\n setup() {\r\n const grid: any = ref(null);\r\n return { grid };\r\n },\r\n data() {\r\n return {\r\n filterOptions: filterOptions,\r\n noRecordsMessage: \"No overdue orders\",\r\n headers: [\r\n { text: 'Name', value: 'name' },\r\n { text: 'Age', value: 'age' },\r\n ],\r\n itemsUk: [] as any[],\r\n itemsDe: [] as any[],\r\n itemsUs: [] as any[],\r\n isLoading: false,\r\n filterBy: filterOptions[0].value,\r\n cache: null as any,\r\n todayDateUtc: getToday()\r\n };\r\n },\r\n computed: {\r\n columnsUk() {\r\n const columns = buildColumnsBase();\r\n this.initializeForWarehouse(columns, warehouseBranches.UK.id);\r\n return columns;\r\n },\r\n columnsDe() {\r\n const columns = buildColumnsBase();\r\n this.initializeForWarehouse(columns, warehouseBranches.Germany.id);\r\n return columns;\r\n },\r\n columnsUs() {\r\n const columns = buildColumnsBase();\r\n this.initializeForWarehouse(columns, warehouseBranches.USA.id);\r\n return columns;\r\n },\r\n },\r\n watch: {\r\n filterBy(filterOption) {\r\n if (this.isLoading) return;\r\n\r\n this.buildData();\r\n },\r\n },\r\n async mounted() {\r\n this.generateBackgroundClasses();\r\n await this.load();\r\n },\r\n methods: {\r\n getColumnTitle(props: any) {\r\n //console.log(props)\r\n return props.date;\r\n },\r\n initializeForWarehouse(columns: any[], warehouseId: string) {\r\n const currentDate = columns[daysBefore + 1]; // +1 because of the row title\r\n currentDate.isOff = !isWorkingDate(this.todayDateUtc, warehouseId);\r\n const d = this.todayDateUtc;\r\n currentDate.date = d.toLocaleDateString(\"en-US\", { year: 'numeric', month: '2-digit', day: '2-digit' });\r\n currentDate.headerAttributes = { title: currentDate.date };\r\n\r\n if (currentDate.isOff) {\r\n currentDate.className += \" is-dayoff\";\r\n currentDate.headerClassName += \" is-dayoff\";\r\n }\r\n\r\n let columnDate = this.todayDateUtc;\r\n for (let i = daysBefore - 1; i >= 0; i--) {\r\n do {\r\n columnDate = getNextDate(columnDate, true);\r\n } while (!isWorkingDate(columnDate, warehouseId));\r\n columns[i + 1].date = columnDate;\r\n }\r\n columnDate = this.todayDateUtc;\r\n for (let i = daysBefore + 1; i <= daysBefore + daysAfter; i++) {\r\n do {\r\n columnDate = getNextDate(columnDate, false);\r\n } while (!isWorkingDate(columnDate, warehouseId));\r\n columns[i + 1].date = columnDate;\r\n }\r\n },\r\n rowRender(h: any, trElement: any, defaultSlots: any, props: any) {\r\n const isTitle = props.dataItem.isGroupTitle;\r\n const isTotal = props.dataItem.isTotal;\r\n\r\n const trProps = {\r\n class: isTitle ? \"order-row-header\" : isTotal ? \"order-row-total\" : null,\r\n };\r\n\r\n //if (isTitle && props.dataItem.date)\r\n // defaultSlots[0].el.title = props.dataItem.date;\r\n\r\n return h(\"tr\", trProps, defaultSlots);\r\n },\r\n buildData() {\r\n const data = this.cache;\r\n\r\n const filterByOrderOptions = this.filterBy == filterOptions[1].value;\r\n\r\n this.itemsUk = buildDataRows(data.uk);\r\n this.itemsDe = buildDataRows(data.de);\r\n this.itemsUs = buildDataRows(data.us);\r\n\r\n function buildDataRows(warehouseData: any): any[] {\r\n const result: any[] = [];\r\n if (!warehouseData) return result;\r\n\r\n const totalDataRow: any = { title: \"Total\", isTotal: true };\r\n\r\n Object.entries(orderGroups).forEach(group => {\r\n const orderTypeKey = group[0];\r\n const orderType = warehouseData[orderTypeKey];\r\n if (orderType) {\r\n result.push({ title: group[1].title, isGroupTitle: true });\r\n\r\n Object.entries(group[1].types).forEach(subGroup => {\r\n const orderSubTypeKey = subGroup[0];\r\n const orderSubType = orderType[orderSubTypeKey];\r\n if (orderSubType) {\r\n const calculatedDays = Object.keys(orderSubType).reduce((days: { [key: string]: { Id: number; Name: string }[] }, dayFieldName: string) => {\r\n const dayData = orderSubType[dayFieldName];\r\n const itemsPerDay = filterByOrderOptions \r\n ? dayData.reduce((acc: number, item: any) => acc + item.ItemsCount, 0)\r\n : dayData.length;\r\n days[dayFieldName] = itemsPerDay;\r\n\r\n let totalPerDay = totalDataRow[dayFieldName] || 0;\r\n totalPerDay += itemsPerDay;\r\n totalDataRow[dayFieldName] = totalPerDay;\r\n\r\n return days;\r\n }, {});\r\n const objToPush = { title: subGroup[1].title, ...calculatedDays };\r\n result.push(objToPush);\r\n }\r\n });\r\n }\r\n }, {});\r\n\r\n result.push(totalDataRow);\r\n return result;\r\n }\r\n\r\n // console.log(this.itemsUk);\r\n // console.log(this.itemsDe);\r\n // console.log(this.itemsUs);\r\n\r\n // console.log(data);\r\n },\r\n generateBackgroundClasses() {\r\n const styleSheet = document.styleSheets[0] || document.createElement(\"style\");\r\n if (!styleSheet.ownerNode) document.head.appendChild(styleSheet.ownerNode!);\r\n\r\n for (let i = 1; i <= daysAfter; i++) {\r\n const opacity1 = (i / daysAfter * 0.1).toFixed(2); // Gradual opacity\r\n const opacity2 = (i / daysAfter * 0.2).toFixed(2); // Gradual opacity\r\n const className = `.order-overdue-${i}days`;\r\n const rule = `${className} { text-align:center!important; padding-left: 0!important; padding-right: 0!important; background: linear-gradient(-45deg, rgba(0,0,0,${opacity1}), rgba(0, 0, 0, ${opacity2})); }`;\r\n styleSheet.insertRule(rule, styleSheet.cssRules.length);\r\n }\r\n },\r\n refresh() {\r\n if (this.isLoading) return;\r\n this.load();\r\n },\r\n async load() {\r\n this.isLoading = true;\r\n\r\n try {\r\n if (!shutdownDatesCache) {\r\n alert('start')\r\n await $.get(\"\").then((response: any) => {\r\n shutdownDatesCache = response;\r\n });\r\n alert(shutdownDatesCache);\r\n }\r\nlet self = this;\r\n\r\n $.get(\"/form/pms/GetOverdueOrdersStats\").then((response: any) => {\r\n //response = [response[response.length - 1]];\r\n this.itemsUk = this.itemsDe = this.itemsUs;\r\n\r\n this.todayDateUtc = getToday();\r\n\r\n function getDaysDifferenceNormalized(baseDate: Date, dateToCheck: Date, warehouseId: string): number {\r\n//console.log(dateToCheck)\r\n//baseDate = new Date(baseDate.getFullYear(), baseDate.getMonth(), baseDate.getDate())\r\n//dateToCheck = new Date(dateToCheck.getFullYear(), dateToCheck.getMonth(), dateToCheck.getDate());\r\n\r\n if (dateToCheck.getTime() === baseDate.getTime()) // displaying \"today\" orders anyways (whether today is day Off or not)\r\n return 0;\r\n\r\n const isBaseDateOff = !isWorkingDate(baseDate, warehouseId);\r\n\r\n if (dateToCheck.getTime() < baseDate.getTime()) {\r\n let nearestBaseDateOn = baseDate; // to obtain the nearest working base date (in case if today is Off)\r\n while (!isWorkingDate(nearestBaseDateOn, warehouseId))\r\n nearestBaseDateOn = getNextDate(nearestBaseDateOn, true);\r\n\r\n let testDate = nearestBaseDateOn;\r\n let daysDifference = isBaseDateOff ? -1 : 0;\r\n while (testDate.getTime() != dateToCheck.getTime() && daysDifference > -15) {\r\n testDate = getNextDate(testDate, true);\r\n if(isWorkingDate(testDate, warehouseId))\r\n daysDifference--;\r\n }\r\n return daysDifference;\r\n } else {\r\n let nearestBaseDateOn = baseDate; // to obtain the nearest working base date (in case if today is Off)\r\n while (!isWorkingDate(nearestBaseDateOn, warehouseId))\r\n nearestBaseDateOn = getNextDate(nearestBaseDateOn, false);\r\n\r\n let testDate = nearestBaseDateOn;\r\n let daysDifference = isBaseDateOff ? 1 : 0;\r\n while (testDate.getTime() != dateToCheck.getTime() && daysDifference < 15) {\r\n testDate = getNextDate(testDate, false);\r\n if(isWorkingDate(testDate, warehouseId))\r\n daysDifference++;\r\n //console.log(testDate.getTime() == dateToCheck.getTime(), testDate, dateToCheck, daysDifference)\r\n }\r\n return daysDifference;\r\n // if(!isDateOn(testDate, warehouseId)) // if the due date was (probably mistakenly) set to a day off, then adding one more delayed business day (if due passed)\r\n // daysDifference++;\r\n\r\n // let isWorkingDay = true;\r\n // do {\r\n // dateToCheck.setDate(dateToCheck.getDate() - 1);\r\n // const dayOfWeek = dateToCheck.getDay();\r\n // isWorkingDay = dayOfWeek != 6 && dayOfWeek != 0 // not Sat nor Sun\r\n // && !shutdownDatesCache.find((x: any) => x.Warehouse == warehouseId && x.Date == dateToCheck);\r\n // } while (!isWorkingDay)\r\n\r\n }\r\n // const differenceInMilliseconds = dateToCheck.getTime() - baseDate.getTime();\r\n // const diff = differenceInMilliseconds / (1000 * 60 * 60 * 24);\r\n\r\n // // console.log(date2 + ' - ' + date1 + ' = ' + diff);\r\n // return diff;\r\n }\r\n\r\n // function convertActualToGridDifference(diff: number, warehouseId: string) {\r\n \r\n // const warehouse = diffsGrid[warehouseId];\r\n\r\n // const gridDiff = warehouse[diff];\r\n // if (gridDiff === undefined) {\r\n // if (diff < 0) \r\n // }\r\n // }\r\n\r\n // const groupedDays = response.Result.reduce((acc: { [key: string]: { Id: number; Name: string }[] }, order: any) => {\r\n function getDateId(orderDueDate: string, warehouseId: string) {\r\n const dueDate = new Date(orderDueDate.split(\"T\")[0]);\r\n const normalizedDifference = getDaysDifferenceNormalized(self.todayDateUtc, dueDate, warehouseId);\r\n //const actualDifference = convertActualToGridDifference(actualDifference, warehouseId);\r\n\r\n const id = \"d\" \r\n + (normalizedDifference < 0 \r\n ? (Math.abs(normalizedDifference) > daysBefore ? daysBefore : (Math.abs(normalizedDifference))) + \"m\"\r\n : normalizedDifference > daysAfter ? daysAfter : normalizedDifference);\r\n\r\n //console.log(normalizedDifference + ' : ' + id)\r\n\r\n return id;\r\n }\r\n\r\n const data: Record = {};\r\n response.forEach((order: any) => {\r\n const warehouse = order.Branch == warehouseBranches.USA.name \r\n ? warehouseBranches.USA.id \r\n : order.Branch == warehouseBranches.Germany.name \r\n ? warehouseBranches.Germany.id : warehouseBranches.UK.id;\r\n\r\n const webOrderTypes: string[] = [\"hub\", \"order\", \"inHouse\", \"IllustrationSamplePack\", \"samplePack\"];\r\n const type = webOrderTypes.includes(order.OrderType) ? \"web\" : order.OrderType == \"ecommerce\" ? \"asf\" : \"other\";\r\n const subType = order.ContainsFraming ? \"frm\" : order.ContainsMounting ? \"mnt\" : \"prn\";\r\n\r\n var w = data[warehouse];\r\n if (w == null) data[warehouse] = w = {};\r\n\r\n var t = w[type];\r\n if (t == null) w[type] = t = {};\r\n\r\n var sub = t[subType];\r\n if (sub == null) t[subType] = sub = {};\r\n\r\n var dateId = getDateId(order.DueDate, warehouse);\r\n var d = sub[dateId];\r\n if (d == null) sub[dateId] = d = [];\r\n d.push(order);\r\n });\r\nconsole.log(data)\r\n this.cache = data;\r\n this.buildData();\r\n });\r\n } finally {\r\n this.isLoading = false;\r\n }\r\n return;\r\n },\r\n // filterChange(event: any) {\r\n // this.items = this.filterData(event.filter);\r\n // },\r\n // filterData(filter: any) {\r\n // const data = this.innerItems.slice();\r\n // return filterBy(data, filter);\r\n },\r\n //},\r\n});\r\n","import { render } from \"./OrdersOverdueTab.vue?vue&type=template&id=b6ec3eee&scoped=true&ts=true\"\nimport script from \"./OrdersOverdueTab.vue?vue&type=script&lang=ts\"\nexport * from \"./OrdersOverdueTab.vue?vue&type=script&lang=ts\"\n\nimport \"./OrdersOverdueTab.vue?vue&type=style&index=0&id=b6ec3eee&scoped=true&lang=stylus\"\n\nimport exportComponent from \"C:\\\\theprintspace\\\\tps\\\\tps.form.ui.vue\\\\node_modules\\\\@vue\\\\cli-service\\\\node_modules\\\\vue-loader-v16\\\\dist\\\\exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-b6ec3eee\"]])\n\nexport default __exports__"],"sourceRoot":""}