marketplacepos 2.8.9 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Marketplace/{369.4ff6937738161ea5.js → 369.13b6a7572b11e531.js} +1 -1
- package/Marketplace/379.611029ed9b632dca.js +1 -0
- package/Marketplace/512.0859940c411070fd.js +1 -0
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main.3d462cd8c82f950d.js → main.1f87a22d98c0bc91.js} +1 -1
- package/Marketplace/{runtime.babf913cef153dda.js → runtime.15299ec4274348bd.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/379.fd2e5a0bd36c9b00.js +0 -1
- package/Marketplace/512.9a911e4f7d403fab.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e,h={},v={};function r(e){var f=v[e];if(void 0!==f)return f.exports;var t=v[e]={id:e,loaded:!1,exports:{}};return h[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=h,e=[],r.O=(f,t,n,
|
|
1
|
+
(()=>{"use strict";var e,h={},v={};function r(e){var f=v[e];if(void 0!==f)return f.exports;var t=v[e]={id:e,loaded:!1,exports:{}};return h[e].call(t.exports,t,t.exports,r),t.loaded=!0,t.exports}r.m=h,e=[],r.O=(f,t,n,d)=>{if(!t){var a=1/0;for(o=0;o<e.length;o++){for(var[t,n,d]=e[o],p=!0,c=0;c<t.length;c++)(!1&d||a>=d)&&Object.keys(r.O).every(u=>r.O[u](t[c]))?t.splice(c--,1):(p=!1,d<a&&(a=d));if(p){e.splice(o--,1);var s=n();void 0!==s&&(f=s)}}return f}d=d||0;for(var o=e.length;o>0&&e[o-1][2]>d;o--)e[o]=e[o-1];e[o]=[t,n,d]},r.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return r.d(f,{a:f}),f},(()=>{var f,e=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;r.t=function(t,n){if(1&n&&(t=this(t)),8&n||"object"==typeof t&&t&&(4&n&&t.__esModule||16&n&&"function"==typeof t.then))return t;var d=Object.create(null);r.r(d);var o={};f=f||[null,e({}),e([]),e(e)];for(var a=2&n&&t;"object"==typeof a&&!~f.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach(p=>o[p]=()=>t[p]);return o.default=()=>t,r.d(d,o),d}})(),r.d=(e,f)=>{for(var t in f)r.o(f,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:f[t]})},r.f={},r.e=e=>Promise.all(Object.keys(r.f).reduce((f,t)=>(r.f[t](e,f),f),[])),r.u=e=>(592===e?"common":e)+"."+{3:"8bcc67645faedceb",46:"40ebac81bd0fb91b",53:"67fe1f4af3f4c858",72:"d59410fd71caf119",277:"e644e3531765ce65",360:"8279e3b4ceab63e1",369:"13b6a7572b11e531",379:"611029ed9b632dca",392:"f4537160149f627a",397:"f0da2f89a05c5266",408:"c94b4441303091c4",425:"03f8f97da7452806",455:"c9dd08adf08a1b65",481:"64ffd74d20798f93",501:"7645c32a140dd7f8",512:"0859940c411070fd",545:"4809f373cc63f3b4",592:"7ce512ca9d1674b7",610:"20110d808d5bebc9",655:"c3fe092dbd4ce86c",717:"5d253da5bb63552f",739:"0de1f18deac0ed90",859:"3a4d26983bbb5254",874:"5b06431d2b5a1e8f",884:"9ed05a6da06c8cdc",913:"ed49c7c4b613719c",993:"5c22ca4b00b8c459",997:"1e5281aa64540dee"}[e]+".js",r.miniCssF=e=>{},r.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),r.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),(()=>{var e={},f="pos-marketplace:";r.l=(t,n,d,o)=>{if(e[t])e[t].push(n);else{var a,p;if(void 0!==d)for(var c=document.getElementsByTagName("script"),s=0;s<c.length;s++){var i=c[s];if(i.getAttribute("src")==t||i.getAttribute("data-webpack")==f+d){a=i;break}}a||(p=!0,(a=document.createElement("script")).type="module",a.charset="utf-8",a.timeout=120,r.nc&&a.setAttribute("nonce",r.nc),a.setAttribute("data-webpack",f+d),a.src=r.tu(t)),e[t]=[n];var b=(g,u)=>{a.onerror=a.onload=null,clearTimeout(l);var _=e[t];if(delete e[t],a.parentNode&&a.parentNode.removeChild(a),_&&_.forEach(y=>y(u)),g)return g(u)},l=setTimeout(b.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=b.bind(null,a.onerror),a.onload=b.bind(null,a.onload),p&&document.head.appendChild(a)}}})(),r.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;r.tt=()=>(void 0===e&&(e={createScriptURL:f=>f},typeof trustedTypes<"u"&&trustedTypes.createPolicy&&(e=trustedTypes.createPolicy("angular#bundler",e))),e)})(),r.tu=e=>r.tt().createScriptURL(e),r.p="https://cdn.jsdelivr.net/npm/marketplacepos@2.9.1/Marketplace/",(()=>{var e={666:0};r.f.j=(n,d)=>{var o=r.o(e,n)?e[n]:void 0;if(0!==o)if(o)d.push(o[2]);else if(666!=n){var a=new Promise((i,b)=>o=e[n]=[i,b]);d.push(o[2]=a);var p=r.p+r.u(n),c=new Error;r.l(p,i=>{if(r.o(e,n)&&(0!==(o=e[n])&&(e[n]=void 0),o)){var b=i&&("load"===i.type?"missing":i.type),l=i&&i.target&&i.target.src;c.message="Loading chunk "+n+" failed.\n("+b+": "+l+")",c.name="ChunkLoadError",c.type=b,c.request=l,o[1](c)}},"chunk-"+n,n)}else e[n]=0},r.O.j=n=>0===e[n];var f=(n,d)=>{var c,s,[o,a,p]=d,i=0;if(o.some(l=>0!==e[l])){for(c in a)r.o(a,c)&&(r.m[c]=a[c]);if(p)var b=p(r)}for(n&&n(d);i<o.length;i++)r.o(e,s=o[i])&&e[s]&&e[s][0](),e[s]=0;return r.O(b)},t=self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[];t.forEach(f.bind(null,0)),t.push=f.bind(null,t.push.bind(t))})()})();
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"marketplacepos","version":"2.
|
|
1
|
+
{"name":"marketplacepos","version":"2.9.1"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[379],{2379:(te,B,d)=>{d.r(B),d.d(B,{OrdersModule:()=>U});var u=d(6895),f=d(284),k=d(8703),e=d(4650),j=d(2937);class C{constructor(){this.ObjectOrderTabs=[{Title:"1 - New Order",Url:"/menu/Order/new",Permissions:[]},{Title:"2 - Ready to Ship",Url:"/menu/Order/ready_to_ship",Permissions:[]},{Title:"3 - Shipped",Url:"/menu/Order/Shipped",Permissions:[]},{Title:"4 - Completed",Url:"/menu/Order/Delivered",Permissions:[]},{Title:"All",Url:"/menu/Order/All",Permissions:[]},{Title:"99 - Cancelled",Url:"/menu/Order/Cancelled",Permissions:[]},{Title:"Download",Url:"/menu/Order/Download",Permissions:[k.G.downloadOrder]}]}ngOnInit(){}}C.\u0275fac=function(n){return new(n||C)},C.\u0275cmp=e.Xpm({type:C,selectors:[["app-orders"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(n,t){1&n&&(e.TgZ(0,"nav",0)(1,"div",1)(2,"div"),e._UZ(3,"nav-tab",2),e.qZA()()(),e._UZ(4,"router-outlet")),2&n&&(e.xp6(3),e.Q6J("Tabs",t.ObjectOrderTabs)("usePermissions",!0))},dependencies:[j.e,f.lC]});var _=d(1889),l=d(4782),s=d(8505),r=d(9694),p=d(9568),h=d(2428),m=d(5412),g=d(4006),W=d(6709);class J{constructor(n){this.dialogRef=n,this.tandaiSudahDicetak=!1}onCancel(){this.dialogRef.close()}onPrint(){this.dialogRef.close(this.tandaiSudahDicetak?1:0)}}J.\u0275fac=function(n){return new(n||J)(e.Y36(m.so))},J.\u0275cmp=e.Xpm({type:J,selectors:[["app-print-tokopedia"]],decls:17,vars:1,consts:[[1,"container-fluid"],["mat-dialog-title","",1,"text-center","mb-8","fw-bold"],[1,"row"],[1,"col-12"],[1,"fs-5"],[1,"d-flex","align-items-center","text-center","justify-content-center","mb-8"],[1,"me-2",3,"ngModel","ngModelChange"],[1,"fs-5","pt-1"],[1,"d-flex","align-items-center","justify-content-center","mt-6"],[1,"btn","btn-light-blue","text-primary","btn-lg","fw-bold","mx-3",3,"click"],[1,"btn","btn-light-blue","me-6","text-primary","btn-lg","fw-bold","mx-3",3,"click"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0)(1,"h2",1),e._uU(2,"Cetak label pesanan"),e.qZA(),e.TgZ(3,"mat-dialog-content")(4,"div",2)(5,"div",3)(6,"p",4),e._uU(7,"Kamu akan mencetak label yang berisi detail pesanan"),e.qZA(),e.TgZ(8,"div",5)(9,"mat-checkbox",6),e.NdJ("ngModelChange",function(o){return t.tandaiSudahDicetak=o}),e.qZA(),e.TgZ(10,"span",7),e._uU(11,'Pesanan telah ditandai sebagai "Sudah Dicetak"'),e.qZA()()()()(),e.TgZ(12,"mat-dialog-actions",8)(13,"button",9),e.NdJ("click",function(){return t.onCancel()}),e._uU(14,"Cancel"),e.qZA(),e.TgZ(15,"button",10),e.NdJ("click",function(){return t.onPrint()}),e._uU(16,"Cetak Pesanan"),e.qZA()()()),2&n&&(e.xp6(9),e.Q6J("ngModel",t.tandaiSudahDicetak))},dependencies:[g.JJ,g.On,W.oG,m.uh,m.xY,m.H8]});var X=d(4004),ne=d(9300),ae=d(3900),S=d(1318),V=d(7185);class I{constructor(){}convertToCSV(n,t){let i;if("string"==typeof n)i=n;else{var o="object"==typeof n?n:JSON.parse(n);i=this.transformToCSVStringFormat(o)}this.downloadCSV(i,t)}transformToCSVStringFormat(n){if(!n||!n.length)return;const i=Object.keys(n[0]);return n.map(c=>i.map(x=>{let b=null==c[x]?"":c[x];return b=b instanceof Date?b.toLocaleString():b.toString().replace(/"/g,'""'),b.search(/("|,|\n)/g)>=0&&(b=`"${b}"`),b}).join(",")).join("\n")}downloadCSV(n,t){var i=new Blob([n],{type:"text/csv;charset=utf8;"}),o=document.createElement("a");o.setAttribute("href",window.URL.createObjectURL(i)),o.setAttribute("download",t),document.body.appendChild(o),o.click(),document.body.removeChild(o)}}I.\u0275fac=function(n){return new(n||I)},I.\u0275prov=e.Yz7({token:I,factory:I.\u0275fac,providedIn:"root"});class Z{constructor(n,t,i,o){this.http=n,this.dialog=t,this.toastr=i,this.exportService=o}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(n){return this.http.post("/api/orders/GetNewOrder",n).pipe((0,X.U)(t=>t.Data))}getTotalNewOrders(n){return this.http.post("/api/orders/GetCountNewOrder",{ListChannelID:n}).pipe((0,X.U)(i=>i.Count))}printShippingLabelTokopedia(n){const t={OrderNumber:n,Printed:!0};this.dialog.open(J).afterClosed().pipe((0,ne.h)(i=>void 0!==i),(0,ae.w)(i=>(t.Printed=i,this.http.post("api/v1/Shippinglabel/Tokopedia",t)))).subscribe(i=>{const o=window.open("about:blank","_blank");o.document.write(i),o.document.close()})}printShippingLabelTiktok(n,t){this.http.post("api/v1/Shippinglabel/Tiktok",{ShopID:t,OrderNumber:n}).subscribe(o=>{null!=o.data?window.open(o.data.doc_url,"_blank"):this.toastr.error("Cannot Print the Shipping Label,The invoice Number is not set to Pickup","Cannot Print")})}printShippingLabelShopee(n,t){this.http.post("api/v1/Shippinglabel/shopee/DownloadShipping",{ShopID:t,OrderNumber:n}).subscribe(o=>{var c=Uint8Array.from(atob(o),b=>b.charCodeAt(0)),x=new Blob([c],{type:"octet/stream"});_.g.openDownloadFile(x,`${n}.pdf`)})}printShippingLabelLazada(n,t){this.http.post("api/v1/Shippinglabel/Lazada/DownloadShipping",{ShopID:t,OrderNumber:n}).subscribe(o=>{null!=o.result.data?window.open(o.result.data.pdf_url,"_blank"):this.toastr.error(o.message,"Cannot Print")})}exportOrders(n,t){return this.http.post("api/Orders/ExportOrder",n).pipe((0,s.b)(i=>{this.exportService.convertToCSV(i,t)}))}}Z.\u0275fac=function(n){return new(n||Z)(e.LFG(S.O),e.LFG(m.uw),e.LFG(V._W),e.LFG(I))},Z.\u0275prov=e.Yz7({token:Z,factory:Z.\u0275fac});class y{constructor(n,t){this.http=n,this.toastr=t}acceptTokopediaOrders(n){return this.http.post("/api/Orders/AcceptOrderTokopedia",n).pipe((0,s.b)(t=>{this.tokopediaAcceptOrderHandler(t)}))}tokopediaAcceptOrderHandler(n){const t=n.filter(o=>0==o.Status),i=n.filter(o=>1==o.Status);if(0==t.length&&i.length>0){let o=`<ol>${this.generateSuccessMessage(i)}</ol>`;this.toastr.success(o,"Success",{enableHtml:!0})}else if(t.length>0&&i.length>0){let o=`<ol>\n ${this.generateSuccessMessage(i)}\n ${this.generateErrorMessage(t)}\n </ol>`;this.toastr.warning(o,"Warning",{enableHtml:!0})}else{let o=`<ol>${this.generateErrorMessage(t)}</ol>`;this.toastr.error(o,"Error",{enableHtml:!0})}}generateSuccessMessage(n){let t="";return n.forEach(i=>{t+=`<li><b>${i.OrderNumber}</b> was successfully Accept</li>`}),t}generateErrorMessage(n){let t="";return n.forEach(i=>{t+=`<li><b>${i.OrderNumber}</b> ${i.Message}</li>`}),t}}y.\u0275fac=function(n){return new(n||y)(e.LFG(S.O),e.LFG(V._W))},y.\u0275prov=e.Yz7({token:y,factory:y.\u0275fac});var D=d(7481),N=d(2594);class v{constructor(){}set typeId(n){this.channelLogo=_.g.getChannelLogoByTypeId(n),this.initChannelName(n)}initChannelName(n){switch(n){case r.x.Tokopedia:this.channelName="Tokopedia";break;case r.x.Tiktok:this.channelName="Tiktok";break;case r.x.WooCommerce:this.channelName="WooCommerce";break;case r.x.ShopeeV2:this.channelName="Shopee";break;case r.x.Lazada:this.channelName="Lazada";break;case r.x.KalCare:this.channelName="Kalcare"}}}v.\u0275fac=function(n){return new(n||v)},v.\u0275cmp=e.Xpm({type:v,selectors:[["app-channel-logo"]],inputs:{typeId:"typeId"},decls:4,vars:2,consts:[[1,"d-flex","align-items-center"],[2,"width","20px",3,"src"],[1,"ms-3","fw-normal"]],template:function(n,t){1&n&&(e.TgZ(0,"div",0),e._UZ(1,"img",1),e.TgZ(2,"span",2),e._uU(3),e.qZA()()),2&n&&(e.xp6(1),e.Q6J("src",t.channelLogo,e.LSH),e.xp6(2),e.Oqu(t.channelName))}});var q=d(9549),A=d(4385),P=d(3238);function ie(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"button",20),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().ngIf,c=e.oxw();return e.KtG(c.onAcceptOrder(o))}),e._UZ(2,"i",21),e._uU(3," Accept "),e.qZA(),e.BQk()}}function oe(a,n){if(1&a&&(e.ynx(0),e.YNc(1,ie,4,0,"ng-container",1),e.BQk()),2&a){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.isTokopediaAvailable&&t.isTokopediaSelected)}}function re(a,n){if(1&a&&(e.TgZ(0,"mat-option",22),e.NdJ("click",function(i){return i.stopPropagation()}),e.TgZ(1,"span",23),e._UZ(2,"img",24),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&a){const t=n.$implicit;e.Q6J("value",t.ID)("title",t.Name)("title",t.Name),e.xp6(2),e.Q6J("src",t.img,e.LSH),e.xp6(2),e.hij(" ",t.Name," ")}}function le(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"th",25)(2,"input",26),e.NdJ("ngModelChange",function(o){e.CHM(t);const c=e.oxw();return e.KtG(c.isCheckAll=o)})("ngModelChange",function(){const c=e.CHM(t).ngIf,x=e.oxw();return e.KtG(x.onSelectAllOrderData(c))}),e.qZA()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(2),e.Q6J("ngModel",t.isCheckAll)}}function se(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"input",26),e.NdJ("ngModelChange",function(o){e.CHM(t);const c=e.oxw(2).$implicit;return e.KtG(c.selected=o)})("ngModelChange",function(){e.CHM(t);const o=e.oxw(2).ngForOf,c=e.oxw();return e.KtG(c.onSelectOrderData(o))}),e.qZA(),e.BQk()}if(2&a){const t=e.oxw(2).$implicit;e.xp6(1),e.Q6J("ngModel",t.selected)}}function pe(a,n){if(1&a&&(e.ynx(0),e.TgZ(1,"td"),e.YNc(2,se,2,1,"ng-container",1),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.xp6(2),e.Q6J("ngIf",t.Type==i.tokopediaType)}}function ce(a,n){if(1&a&&(e.ynx(0),e.TgZ(1,"span"),e._uU(2),e.qZA(),e.BQk()),2&a){const t=e.oxw().$implicit;e.xp6(2),e.Oqu(t.Number)}}function de(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("href",i.domain+"/menu/Orders/Order/Sales_Order/Info?ID="+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function ue(a,n){if(1&a&&(e.TgZ(0,"tr"),e.YNc(1,pe,3,1,"ng-container",1),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e.YNc(5,ce,3,1,"ng-container",27),e.YNc(6,de,2,2,"ng-template",null,28,e.W1O),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td"),e._uU(11),e.ALo(12,"date"),e.qZA(),e.TgZ(13,"td"),e._UZ(14,"app-channel-logo",29),e.qZA()()),2&a){const t=n.$implicit,i=e.MAs(7),o=e.oxw();e.xp6(1),e.Q6J("ngIf",o.isTokopediaAvailable),e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",t.ID==o.guidEmpty)("ngIfElse",i),e.xp6(4),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.xi3(12,7,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.Type)}}class L{constructor(n,t,i,o,c){this.localDataService=n,this.channelService=t,this.orderService=i,this.toastr=o,this.acceptOrderService=c,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.domain=`https://${this.localDataService.getHostName()}`,this.guidEmpty=_.g.GuidEMpty,this.tokopediaType=r.x.Tokopedia,this.isTokopediaSelected=!1,this.isTokopediaAvailable=!1,this.isCheckAll=!1}ngOnInit(){this.initLoadPage()}initLoadPage(){this.orderService.loadInitialPage().subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.getNewOrders()})}getNewOrders(){this.newOrdersData$=this.orderService.getNewOrders({PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).pipe((0,l.d)(),(0,s.b)(t=>{t.filter(o=>o.Type==r.x.Tokopedia)}))}getPaginatonTotal(){this.paginationTotal$=this.orderService.getTotalNewOrders(this.filter.ListChannelID).pipe((0,l.d)())}onNextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.getNewOrders()}onPreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.getNewOrders()}onSelectOrderData(n){this.isTokopediaSelected=!1,n.filter(i=>i.selected).length>0&&(this.isTokopediaSelected=!0)}onSelectAllOrderData(n){n=n.map(t=>(t.Type==r.x.Tokopedia&&(t.selected=this.isCheckAll),t)),this.onSelectOrderData(n)}onAcceptOrder(n){let t=this.getSelectedTokopediaOrders(n);this.acceptOrderService.acceptTokopediaOrders(t).subscribe(i=>{this.isTokopediaSelected=!1,location.reload()})}getSelectedTokopediaOrders(n){return n.filter(i=>i.selected).map(i=>i.Number)}}function he(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.ALo(5,"number"),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.ALo(8,"number"),e.qZA()()),2&a){const t=n.$implicit;e.xp6(2),e.Oqu(t.Code),e.xp6(2),e.Oqu(e.lcZ(5,3,t.Quantity)),e.xp6(3),e.Oqu(e.lcZ(8,5,t.Price))}}function ge(a,n){if(1&a&&(e.TgZ(0,"div",4)(1,"div",5)(2,"div",6)(3,"div",7)(4,"h3",8),e._uU(5,"Outlet Info"),e.qZA()(),e.TgZ(6,"div",4)(7,"div",9),e._uU(8," Outlet : "),e.qZA(),e.TgZ(9,"div",9),e._uU(10),e.qZA()(),e.TgZ(11,"div",4)(12,"div",9),e._uU(13," Date : "),e.qZA(),e.TgZ(14,"div",9),e._uU(15),e.ALo(16,"date"),e.qZA()(),e.TgZ(17,"div",4)(18,"div",9),e._uU(19," Status : "),e.qZA(),e.TgZ(20,"div",9),e._uU(21),e.qZA()(),e.TgZ(22,"div",4)(23,"div",9),e._uU(24," Tax Type : "),e.qZA(),e.TgZ(25,"div",9),e._uU(26),e.qZA()(),e.TgZ(27,"div",4)(28,"div",9),e._uU(29," Due Date : "),e.qZA(),e.TgZ(30,"div",9),e._uU(31),e.ALo(32,"date"),e.qZA()()(),e.TgZ(33,"div",6)(34,"div",7)(35,"h3",8),e._uU(36,"Customer Info"),e.qZA()(),e.TgZ(37,"div",4)(38,"div",9),e._uU(39," Name : "),e.qZA(),e.TgZ(40,"div",9),e._uU(41),e.qZA()(),e.TgZ(42,"div",4)(43,"div",9),e._uU(44," Email : "),e.qZA(),e.TgZ(45,"div",9),e._uU(46),e.qZA()(),e.TgZ(47,"div",4)(48,"div",9),e._uU(49," Mobile : "),e.qZA(),e.TgZ(50,"div",9),e._uU(51),e.qZA()()()(),e.TgZ(52,"div",10)(53,"h3",11),e._uU(54,"Products Sold"),e.qZA(),e.TgZ(55,"div",12)(56,"table",13)(57,"thead",14)(58,"tr",15)(59,"th"),e._uU(60,"Code"),e.qZA(),e.TgZ(61,"th"),e._uU(62,"Quantity"),e.qZA(),e.TgZ(63,"th"),e._uU(64,"Price"),e.qZA()()(),e.TgZ(65,"tbody"),e.YNc(66,he,9,7,"tr",16),e.qZA()()()()()),2&a){const t=e.oxw();e.xp6(10),e.hij(" ",t.model.Outlet," "),e.xp6(5),e.hij(" ",e.xi3(16,9,t.model.Date,"dd MMM yyyy")," "),e.xp6(6),e.hij(" ",t.model.Delivery," "),e.xp6(5),e.hij(" ",t.model.TaxType," "),e.xp6(5),e.hij(" ",e.xi3(32,12,t.model.DueDate,"dd MMM yyyy")," "),e.xp6(10),e.hij(" ",t.model.Customer.Name," "),e.xp6(5),e.hij(" ",t.model.Customer.Email," "),e.xp6(5),e.hij(" ",t.model.Customer.Mobile," "),e.xp6(15),e.Q6J("ngForOf",t.model.Variants)}}L.\u0275fac=function(n){return new(n||L)(e.Y36(p.T),e.Y36(h.T),e.Y36(Z),e.Y36(V._W),e.Y36(y))},L.\u0275cmp=e.Xpm({type:L,selectors:[["app-new-order"]],decls:46,vars:21,consts:[["headerTitle","1 - New Order","searchBoxPlaceHolder","Search Orders...",3,"hideSearchBox","onSubmit"],[4,"ngIf"],["container",""],["appearance","outline",1,"w-100"],["multiple","","placeholder","Choose channels",3,"ngModel","ngModelChange"],[3,"value","title","click",4,"ngFor","ngForOf"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],["type","button","data-cy","scanInPos",1,"btn","btn-outline-secondary","shadow","rounded","me-3",3,"click"],[1,"fa-solid","fa-check"],[3,"value","title","click"],[1,"me-1"],["alt","",2,"width","18px",3,"src"],[2,"width","5px"],["type","checkbox",3,"ngModel","ngModelChange"],[4,"ngIf","ngIfElse"],["NOT_EMPTY",""],[3,"typeId"],["target","_blank",3,"href"]],template:function(n,t){if(1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(){return t.getNewOrders()}),e.TgZ(1,"actions"),e.YNc(2,oe,2,1,"ng-container",1),e.ALo(3,"async"),e.qZA(),e.TgZ(4,"filters")(5,"div",2)(6,"div")(7,"h6"),e._uU(8,"Channel"),e.qZA(),e.TgZ(9,"mat-form-field",3)(10,"mat-select",4),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(11,re,5,5,"mat-option",5),e.qZA()()(),e.TgZ(12,"div")(13,"h6"),e._uU(14,"Page Number"),e.qZA(),e.TgZ(15,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(16,"div")(17,"h6"),e._uU(18,"Page Size"),e.qZA(),e.TgZ(19,"input",7),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(20,"content")(21,"div",8)(22,"div",9)(23,"div",10)(24,"div",11)(25,"table",12)(26,"thead",13)(27,"tr",14),e.YNc(28,le,3,1,"ng-container",1),e.ALo(29,"async"),e.TgZ(30,"th",15),e._uU(31,"Outlet"),e.qZA(),e.TgZ(32,"th",16),e._uU(33,"Order number"),e.qZA(),e.TgZ(34,"th"),e._uU(35,"Customer"),e.qZA(),e.TgZ(36,"th",17),e._uU(37,"Created On"),e.qZA(),e.TgZ(38,"th",17),e._uU(39,"Channel"),e.qZA()()(),e.TgZ(40,"tbody"),e.YNc(41,ue,15,10,"tr",18),e.ALo(42,"async"),e.qZA()(),e.TgZ(43,"app-mat-paginator-no-count",19),e.NdJ("total",function(){return t.getPaginatonTotal()})("next",function(){return t.onNextPage()})("previous",function(){return t.onPreviousPage()}),e.ALo(44,"async"),e.ALo(45,"async"),e.qZA()()()()()()()),2&n){let i;e.Q6J("hideSearchBox",!0),e.xp6(2),e.Q6J("ngIf",e.lcZ(3,11,t.newOrdersData$)),e.xp6(8),e.Q6J("ngModel",t.filter.ListChannelID),e.xp6(1),e.Q6J("ngForOf",t.channels),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(9),e.Q6J("ngIf",t.isTokopediaAvailable&&e.lcZ(29,13,t.newOrdersData$)),e.xp6(13),e.Q6J("ngForOf",e.lcZ(42,15,t.newOrdersData$)),e.xp6(2),e.Q6J("filter",t.filter)("totaldata",null==(i=e.lcZ(44,17,t.newOrdersData$))?null:i.length)("paginationTotal",e.lcZ(45,19,t.paginationTotal$))}},dependencies:[u.sg,u.O5,g.Fj,g.wV,g.Wl,g.JJ,g.On,D.p,N.n,v,q.KE,A.gD,P.ey,u.Ov,u.uU]});const me=function(){return["/menu/Order"]};class Q{constructor(n,t){this.http=n,this.url=t,this.number=this.url.snapshot.queryParams.Number,this.outlet=this.url.snapshot.queryParams.Outlet}ngOnInit(){this.Load()}Load(){this.http.post("/api/orders/GetInvoiceDetail",{Number:this.number,Outlet:this.outlet}).subscribe(t=>{this.model=t})}}function _e(a,n){if(1&a&&(e.TgZ(0,"mat-option",21),e.NdJ("click",function(i){return i.stopPropagation()}),e.TgZ(1,"span",22),e._UZ(2,"img",23),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&a){const t=n.$implicit;e.Q6J("value",t.ID)("title",t.Name)("title",t.Name),e.xp6(2),e.Q6J("src",t.img,e.LSH),e.xp6(2),e.hij(" ",t.Name," ")}}Q.\u0275fac=function(n){return new(n||Q)(e.Y36(S.O),e.Y36(f.gz))},Q.\u0275cmp=e.Xpm({type:Q,selectors:[["app-detail-order"]],decls:7,vars:6,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button",1,"btn","btn-secondary","btn-fill","btn-lg","me-3",3,"routerLink"],[1,"container"],["class","row",4,"ngIf"],[1,"row"],[1,"col-4"],[1,"border","my-3","py-3","col-12"],[1,"row","m-2"],[1,"text-center"],[1,"col"],[1,"col-8"],[1,"text-center","my-3","py-3"],[1,"table-responsive"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0)(1,"actions")(2,"a",1),e._uU(3,"Back"),e.qZA()(),e.TgZ(4,"content")(5,"div",2),e.YNc(6,ge,67,15,"div",3),e.qZA()()()),2&n&&(e.Q6J("headerTitle","Order #"+t.number)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("routerLink",e.DdM(5,me)),e.xp6(4),e.Q6J("ngIf",t.model))},dependencies:[u.sg,u.O5,D.p,f.rH,u.JJ,u.uU]});const fe=function(){return["/menu/Order/detail"]},Te=function(a,n){return{Number:a,Outlet:n}};function Ce(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,fe))("queryParams",e.WLB(4,Te,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ze(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function ve(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,c=e.oxw();return e.KtG(c.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function be(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ce,2,7,"a",24),e.YNc(5,Ze,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,ve,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok||t.TypeID==i.channelType.Lazada)}}class F{constructor(n,t,i,o,c){this.http=n,this.localDataService=t,this.dialog=i,this.orderService=o,this.channelService=c,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.checkboxState=!1,this.channelType=r.x}ngOnInit(){this.Load()}getChannelLogo(n){return _.g.getChannelLogoByTypeId(n)}hasGuidEmpty(n){return n==_.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetReadyToShip",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t);break;case r.x.Lazada:this.orderService.printShippingLabelLazada(n,t)}}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Unsent",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function Se(a,n){if(1&a&&(e.TgZ(0,"mat-option",21),e.NdJ("click",function(i){return i.stopPropagation()}),e.TgZ(1,"span",22),e._UZ(2,"img",23),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&a){const t=n.$implicit;e.Q6J("value",t.ID)("title",t.Name)("title",t.Name),e.xp6(2),e.Q6J("src",t.img,e.LSH),e.xp6(2),e.hij(" ",t.Name," ")}}F.\u0275fac=function(n){return new(n||F)(e.Y36(S.O),e.Y36(p.T),e.Y36(m.uw),e.Y36(Z),e.Y36(h.T))},F.\u0275cmp=e.Xpm({type:F,selectors:[["app-ready-to-ship"]],decls:41,vars:8,consts:[["headerTitle","2 - Ready to Ship","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["appearance","outline",1,"w-100"],["multiple","","placeholder","Choose channels",3,"ngModel","ngModelChange"],[3,"value","title","click",4,"ngFor","ngForOf"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"value","title","click"],[1,"me-1"],["alt","",2,"width","18px",3,"src"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"mat-form-field",2)(7,"mat-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(8,_e,5,5,"mat-option",4),e.qZA()()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Page Number"),e.qZA(),e.TgZ(12,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Size"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(17,"content")(18,"div",7)(19,"div",8)(20,"div",9)(21,"div",10)(22,"table",11)(23,"thead",12)(24,"tr",13)(25,"th",14),e._uU(26,"Outlet"),e.qZA(),e.TgZ(27,"th",15),e._uU(28,"Order number"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Customer"),e.qZA(),e.TgZ(31,"th",16),e._uU(32,"Amount"),e.qZA(),e.TgZ(33,"th",17),e._uU(34,"Created On"),e.qZA(),e.TgZ(35,"th",17),e._uU(36,"Channel"),e.qZA(),e._UZ(37,"th",18),e.qZA()(),e.TgZ(38,"tbody"),e.YNc(39,be,18,13,"tr",19),e.qZA()(),e.TgZ(40,"app-mat-paginator-no-count",20),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.xp6(7),e.Q6J("ngModel",t.filter.ListChannelID),e.xp6(1),e.Q6J("ngForOf",t.channels),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(23),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal))},dependencies:[u.sg,u.O5,g.Fj,g.wV,g.JJ,g.On,D.p,f.rH,N.n,v,q.KE,A.gD,P.ey,u.JJ,u.uU]});const De=function(){return["/menu/Order/detail"]},xe=function(a,n){return{Number:a,Outlet:n}};function we(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,De))("queryParams",e.WLB(4,xe,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function ye(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ne(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,c=e.oxw();return e.KtG(c.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function Ae(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,we,2,7,"a",24),e.YNc(5,ye,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,Ne,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok||t.TypeID==i.channelType.Lazada)}}class Y{constructor(n,t,i,o){this.http=n,this.localDataService=t,this.orderService=i,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.channelType=r.x}ngOnInit(){this.Load()}getChannelLogo(n){return _.g.getChannelLogoByTypeId(n)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}hasGuidEmpty(n){return n==_.g.GuidEMpty}Get(n){this.http.post("api/orders/GetShipped",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Unpaid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t);break;case r.x.Lazada:this.orderService.printShippingLabelLazada(n,t)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}Y.\u0275fac=function(n){return new(n||Y)(e.Y36(S.O),e.Y36(p.T),e.Y36(Z),e.Y36(h.T))},Y.\u0275cmp=e.Xpm({type:Y,selectors:[["app-shipped"]],decls:41,vars:8,consts:[["headerTitle","3 - Shipped","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["appearance","outline",1,"w-100"],["multiple","","placeholder","Choose channels",3,"ngModel","ngModelChange"],[3,"value","title","click",4,"ngFor","ngForOf"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"value","title","click"],[1,"me-1"],["alt","",2,"width","18px",3,"src"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"mat-form-field",2)(7,"mat-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(8,Se,5,5,"mat-option",4),e.qZA()()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Page Number"),e.qZA(),e.TgZ(12,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Size"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(17,"content")(18,"div",7)(19,"div",8)(20,"div",9)(21,"div",10)(22,"table",11)(23,"thead",12)(24,"tr",13)(25,"th",14),e._uU(26,"Outlet"),e.qZA(),e.TgZ(27,"th",15),e._uU(28,"Order number"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Customer"),e.qZA(),e.TgZ(31,"th",16),e._uU(32,"Amount"),e.qZA(),e.TgZ(33,"th",17),e._uU(34,"Created On"),e.qZA(),e.TgZ(35,"th",17),e._uU(36,"Channel"),e.qZA(),e._UZ(37,"th",18),e.qZA()(),e.TgZ(38,"tbody"),e.YNc(39,Ae,18,13,"tr",19),e.qZA()(),e.TgZ(40,"app-mat-paginator-no-count",20),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.xp6(7),e.Q6J("ngModel",t.filter.ListChannelID),e.xp6(1),e.Q6J("ngForOf",t.channels),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(23),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal))},dependencies:[u.sg,u.O5,g.Fj,g.wV,g.JJ,g.On,D.p,f.rH,N.n,v,q.KE,A.gD,P.ey,u.JJ,u.uU]});var Pe=d(501);function Oe(a,n){if(1&a&&(e.TgZ(0,"mat-option",21),e.NdJ("click",function(i){return i.stopPropagation()}),e.TgZ(1,"span",22),e._UZ(2,"img",23),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&a){const t=n.$implicit;e.Q6J("value",t.ID)("title",t.Name)("title",t.Name),e.xp6(2),e.Q6J("src",t.img,e.LSH),e.xp6(2),e.hij(" ",t.Name," ")}}const Ie=function(){return["/menu/Order/detail"]},qe=function(a,n){return{Number:a,Outlet:n}};function Me(a,n){if(1&a&&(e.TgZ(0,"a",29),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Ie))("queryParams",e.WLB(4,qe,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ue(a,n){if(1&a&&(e.TgZ(0,"a",30),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("href",i.customerInfoUrl+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function ke(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"a",31),e.NdJ("click",function(){e.CHM(t);const o=e.oxw().$implicit,c=e.oxw();return e.KtG(c.onPrintShippingLabel(o.Number,o.ShopID,o.TypeID))}),e._UZ(1,"i",32),e.qZA()}}function Je(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Me,2,7,"a",24),e.YNc(5,Ue,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",26),e.qZA(),e.TgZ(16,"td",27),e.YNc(17,ke,2,0,"a",28),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID),e.xp6(2),e.Q6J("ngIf",t.TypeID==i.channelType.ShopeeV2||t.TypeID==i.channelType.Tokopedia||t.TypeID==i.channelType.Tiktok)}}class E{constructor(n,t,i,o){this.http=n,this.orderService=t,this.authService=i,this.channelService=o,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0,this.channelType=r.x}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==_.g.GuidEMpty}getChannelLogo(n){return _.g.getChannelLogoByTypeId(n)}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.customerInfoUrl=`${this.authService.getDomain()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetDelivered ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"Paid",DeliveryState:"Sent",ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}onPrintShippingLabel(n,t,i){switch(i){case r.x.Tokopedia:this.orderService.printShippingLabelTokopedia(n);break;case r.x.Tiktok:this.orderService.printShippingLabelTiktok(n,t);break;case r.x.ShopeeV2:this.orderService.printShippingLabelShopee(n,t)}}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function Le(a,n){if(1&a&&(e.TgZ(0,"mat-option",21),e.NdJ("click",function(i){return i.stopPropagation()}),e.TgZ(1,"span",22),e._UZ(2,"img",23),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&a){const t=n.$implicit;e.Q6J("value",t.ID)("title",t.Name)("title",t.Name),e.xp6(2),e.Q6J("src",t.img,e.LSH),e.xp6(2),e.hij(" ",t.Name," ")}}E.\u0275fac=function(n){return new(n||E)(e.Y36(S.O),e.Y36(Z),e.Y36(Pe.e),e.Y36(h.T))},E.\u0275cmp=e.Xpm({type:E,selectors:[["app-delivered"]],decls:41,vars:9,consts:[["headerTitle","4 - Completed","searchBoxPlaceHolder","Search ...",3,"hideSearchBox","onSubmit"],["container","",1,""],["appearance","outline",1,"w-100"],["multiple","","placeholder","Choose channels",3,"ngModel","ngModelChange"],[3,"value","title","click",4,"ngFor","ngForOf"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","60px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"value","title","click"],[1,"me-1"],["alt","",2,"width","18px",3,"src"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[1,"text-center","text-primary"],["title","Print shipping label",3,"click",4,"ngIf"],[3,"routerLink","queryParams"],["target","_blank",3,"href"],["title","Print shipping label",3,"click"],[1,"fa-solid","fa-print","fs-3","cursor"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"mat-form-field",2)(7,"mat-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(8,Oe,5,5,"mat-option",4),e.qZA()()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Page Number"),e.qZA(),e.TgZ(12,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Size"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(17,"content")(18,"div",7)(19,"div",8)(20,"div",9)(21,"div",10)(22,"table",11)(23,"thead",12)(24,"tr",13)(25,"th",14),e._uU(26,"Outlet"),e.qZA(),e.TgZ(27,"th",15),e._uU(28,"Order number"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Customer"),e.qZA(),e.TgZ(31,"th",16),e._uU(32,"Amount"),e.qZA(),e.TgZ(33,"th",17),e._uU(34,"Created On"),e.qZA(),e.TgZ(35,"th",17),e._uU(36,"Channel"),e.qZA(),e._UZ(37,"th",18),e.qZA()(),e.TgZ(38,"tbody"),e.YNc(39,Je,18,13,"tr",19),e.qZA()(),e.TgZ(40,"app-mat-paginator-no-count",20),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.Q6J("hideSearchBox",!0),e.xp6(7),e.Q6J("ngModel",t.filter.ListChannelID),e.xp6(1),e.Q6J("ngForOf",t.channels),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(23),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal))},dependencies:[u.sg,u.O5,g.Fj,g.wV,g.JJ,g.On,D.p,f.rH,N.n,v,q.KE,A.gD,P.ey,u.JJ,u.uU]});const Qe=function(){return["/menu/Order/detail"]},Fe=function(a,n){return{Number:a,Outlet:n}};function Ye(a,n){if(1&a&&(e.TgZ(0,"a",27),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,Qe))("queryParams",e.WLB(4,Fe,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Ee(a,n){if(1&a&&(e.TgZ(0,"a",28),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function Ge(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,Ye,2,7,"a",24),e.YNc(5,Ee,2,2,"a",25),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._uU(15),e.qZA(),e.TgZ(16,"td"),e._UZ(17,"app-channel-logo",26),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,8,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,10,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Oqu(t.State),e.xp6(2),e.Q6J("typeId",t.TypeID)}}class G{constructor(n,t,i){this.http=n,this.localDataService=t,this.channelService=i,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==_.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetAll ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter=n,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!1,ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}}function Re(a,n){if(1&a&&(e.TgZ(0,"mat-option",20),e.NdJ("click",function(i){return i.stopPropagation()}),e.TgZ(1,"span",21),e._UZ(2,"img",22),e.qZA(),e.TgZ(3,"span"),e._uU(4),e.qZA()()),2&a){const t=n.$implicit;e.Q6J("value",t.ID)("title",t.Name)("title",t.Name),e.xp6(2),e.Q6J("src",t.img,e.LSH),e.xp6(2),e.hij(" ",t.Name," ")}}G.\u0275fac=function(n){return new(n||G)(e.Y36(S.O),e.Y36(p.T),e.Y36(h.T))},G.\u0275cmp=e.Xpm({type:G,selectors:[["app-all-order"]],decls:42,vars:8,consts:[["headerTitle","All","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container",""],["appearance","outline",1,"w-100"],["multiple","","placeholder","Choose channels",3,"ngModel","ngModelChange"],[3,"value","title","click",4,"ngFor","ngForOf"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[2,"width","135px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"value","title","click"],[1,"me-1"],["alt","",2,"width","18px",3,"src"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"mat-form-field",2)(7,"mat-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(8,Le,5,5,"mat-option",4),e.qZA()()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Page Number"),e.qZA(),e.TgZ(12,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Size"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(17,"content")(18,"div",7)(19,"div",8)(20,"div",9)(21,"div",10)(22,"table",11)(23,"thead",12)(24,"tr",13)(25,"th",14),e._uU(26,"Outlet"),e.qZA(),e.TgZ(27,"th",15),e._uU(28,"Order number"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Customer"),e.qZA(),e.TgZ(31,"th",16),e._uU(32,"Amount"),e.qZA(),e.TgZ(33,"th",17),e._uU(34,"Created On"),e.qZA(),e.TgZ(35,"th",18),e._uU(36,"Status"),e.qZA(),e.TgZ(37,"th",17),e._uU(38,"Channel"),e.qZA()()(),e.TgZ(39,"tbody"),e.YNc(40,Ge,18,13,"tr",19),e.qZA()(),e.TgZ(41,"app-mat-paginator-no-count",20),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.xp6(7),e.Q6J("ngModel",t.filter.ListChannelID),e.xp6(1),e.Q6J("ngForOf",t.channels),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(24),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal))},dependencies:[u.sg,u.O5,g.Fj,g.wV,g.JJ,g.On,D.p,f.rH,N.n,v,q.KE,A.gD,P.ey,u.JJ,u.uU]});const $e=function(){return["/menu/Order/detail"]},ze=function(a,n){return{Number:a,Outlet:n}};function He(a,n){if(1&a&&(e.TgZ(0,"a",26),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.Q6J("routerLink",e.DdM(3,$e))("queryParams",e.WLB(4,ze,t.Number,t.Outlet)),e.xp6(1),e.Oqu(t.Number)}}function Be(a,n){if(1&a&&(e.TgZ(0,"a",27),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit,i=e.oxw();e.Q6J("href",i.domain+t.ID,e.LSH),e.xp6(1),e.Oqu(t.Number)}}function je(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,He,2,7,"a",23),e.YNc(5,Be,2,2,"a",24),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.ALo(10,"number"),e.qZA(),e.TgZ(11,"td"),e._uU(12),e.ALo(13,"date"),e.qZA(),e.TgZ(14,"td"),e._UZ(15,"app-channel-logo",25),e.qZA()()),2&a){const t=n.$implicit,i=e.oxw();e.xp6(2),e.Oqu(t.Outlet),e.xp6(2),e.Q6J("ngIf",i.hasGuidEmpty(t.ID)),e.xp6(1),e.Q6J("ngIf",!i.hasGuidEmpty(t.ID)),e.xp6(2),e.Oqu(t.Customer),e.xp6(2),e.Oqu(e.lcZ(10,7,t.Amount)),e.xp6(3),e.Oqu(e.xi3(13,9,t.Created,"dd MMM yyyy HH:mm")),e.xp6(3),e.Q6J("typeId",t.TypeID)}}class R{constructor(n,t,i){this.http=n,this.localDataService=t,this.channelService=i,this.filter={PageNumber:null,PageSize:null,ListChannelID:[]},this.totaldata=0,this.paginationTotal=0}ngOnInit(){this.Load()}hasGuidEmpty(n){return n==_.g.GuidEMpty}Load(){this.http.post("/api/ordersLoader/GetOrder",{}).subscribe(n=>{this.filter.PageNumber=n.Filter.PageNumber,this.filter.PageSize=n.Filter.RowCount,this.channels=n.Options.Channel,this.channels=this.channelService.mapChannelImage(this.channels),this.domain=`https://${this.localDataService.getHostName()}/menu/Orders/Orders/Customer_Invoice/Info?ID=`,this.Get()})}Get(n){this.http.post("api/orders/GetCancelled ",{Number:n,PageNumber:this.filter.PageNumber,PageSize:this.filter.PageSize,ListChannelID:this.filter.ListChannelID}).subscribe(i=>{this.data=i.Data,this.totaldata=this.data.length})}changePage(n){this.filter.PageNumber=n.pageIndex+1,this.Get()}StoreRowsCountAPIResult(){this.http.post("api/orders/GetRowCount",{PaymentState:"",DeliveryState:"",Bin:!0,ListChannelID:this.filter.ListChannelID}).subscribe(t=>{this.paginationTotal=t.Total})}NextPage(){this.filter.PageNumber=this.filter.PageNumber+1,this.Get()}PreviousPage(){this.filter.PageNumber=this.filter.PageNumber-1,this.Get()}getChannelLogo(n){return _.g.getChannelLogoByTypeId(n)}}R.\u0275fac=function(n){return new(n||R)(e.Y36(S.O),e.Y36(p.T),e.Y36(h.T))},R.\u0275cmp=e.Xpm({type:R,selectors:[["app-cancelled"]],decls:40,vars:8,consts:[["headerTitle","99 - Cancelled","searchBoxPlaceHolder","Search ...",3,"onSubmit"],["container","",1,""],["appearance","outline",1,"w-100"],["multiple","","placeholder","Choose channels",3,"ngModel","ngModelChange"],[3,"value","title","click",4,"ngFor","ngForOf"],["type","number","name","PageNumber",1,"w-100",3,"ngModel","ngModelChange"],["type","number","name","PageSize",1,"w-100",3,"ngModel","ngModelChange"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","120px"],[2,"width","220px"],[2,"width","100px"],[2,"width","130px"],[4,"ngFor","ngForOf"],[3,"filter","totaldata","paginationTotal","total","next","previous"],[3,"value","title","click"],[1,"me-1"],["alt","",2,"width","18px",3,"src"],[3,"routerLink","queryParams",4,"ngIf"],["target","_blank",3,"href",4,"ngIf"],[3,"typeId"],[3,"routerLink","queryParams"],["target","_blank",3,"href"]],template:function(n,t){1&n&&(e.TgZ(0,"mainpanel",0),e.NdJ("onSubmit",function(o){return t.Get(o)}),e.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h6"),e._uU(5,"Channel"),e.qZA(),e.TgZ(6,"mat-form-field",2)(7,"mat-select",3),e.NdJ("ngModelChange",function(o){return t.filter.ListChannelID=o}),e.YNc(8,Re,5,5,"mat-option",4),e.qZA()()(),e.TgZ(9,"div")(10,"h6"),e._uU(11,"Page Number"),e.qZA(),e.TgZ(12,"input",5),e.NdJ("ngModelChange",function(o){return t.filter.PageNumber=o}),e.qZA()(),e.TgZ(13,"div")(14,"h6"),e._uU(15,"Page Size"),e.qZA(),e.TgZ(16,"input",6),e.NdJ("ngModelChange",function(o){return t.filter.PageSize=o}),e.qZA()()()(),e.TgZ(17,"content")(18,"div",7)(19,"div",8)(20,"div",9)(21,"div",10)(22,"table",11)(23,"thead",12)(24,"tr",13)(25,"th",14),e._uU(26,"Outlet"),e.qZA(),e.TgZ(27,"th",15),e._uU(28,"Order number"),e.qZA(),e.TgZ(29,"th"),e._uU(30,"Customer"),e.qZA(),e.TgZ(31,"th",16),e._uU(32,"Amount"),e.qZA(),e.TgZ(33,"th",17),e._uU(34,"Created On"),e.qZA(),e.TgZ(35,"th",17),e._uU(36,"Channel"),e.qZA()()(),e.TgZ(37,"tbody"),e.YNc(38,je,16,12,"tr",18),e.qZA()(),e.TgZ(39,"app-mat-paginator-no-count",19),e.NdJ("total",function(){return t.StoreRowsCountAPIResult()})("next",function(){return t.NextPage()})("previous",function(){return t.PreviousPage()}),e.qZA()()()()()()()),2&n&&(e.xp6(7),e.Q6J("ngModel",t.filter.ListChannelID),e.xp6(1),e.Q6J("ngForOf",t.channels),e.xp6(4),e.Q6J("ngModel",t.filter.PageNumber),e.xp6(4),e.Q6J("ngModel",t.filter.PageSize),e.xp6(22),e.Q6J("ngForOf",t.data),e.xp6(1),e.Q6J("filter",t.filter)("totaldata",t.totaldata)("paginationTotal",t.paginationTotal))},dependencies:[u.sg,u.O5,g.Fj,g.wV,g.JJ,g.On,D.p,f.rH,N.n,v,q.KE,A.gD,P.ey,u.JJ,u.uU]});var Ve=d(2138),O=(()=>{return(a=O||(O={}))[a.DoNothing=0]="DoNothing",a[a.New=1]="New",a[a.Update=2]="Update",O;var a})(),Ke=d(6082),K=d(8796),$=d(9602),z=d(8425),ee=d(266);function We(a,n){if(1&a){const t=e.EpF();e.ynx(0),e.TgZ(1,"div",28)(2,"button",29),e.NdJ("click",function(){e.CHM(t),e.oxw();const o=e.MAs(11);return e.KtG(o.previous())}),e._uU(3," Back "),e.qZA(),e.TgZ(4,"button",30),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),c=e.MAs(11);return e.KtG(o.onNext(c))}),e._uU(5," Next "),e.qZA(),e.TgZ(6,"button",31),e._UZ(7,"b",32),e.qZA(),e.TgZ(8,"ul",33)(9,"li",34)(10,"a",35),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.exportOrders())}),e._uU(11," Export "),e.qZA()()()(),e.BQk()}if(2&a){const t=e.oxw();e.xp6(4),e.Q6J("disabled",t.checkDisabledNextFilter())}}function Xe(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"button",36),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),c=e.MAs(11);return e.KtG(o.onNext(c))}),e._uU(1," Next "),e.qZA()}if(2&a){const t=e.oxw();e.Q6J("disabled",t.checkDisabledNextFilter())}}function et(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw(),c=e.MAs(11);return e.KtG(o.onNew(c))}),e._UZ(1,"i",38),e._uU(2," New "),e.qZA()}}function tt(a,n){1&a&&e._uU(0,"Filter")}function nt(a,n){if(1&a&&(e.TgZ(0,"ng-option",39),e._UZ(1,"img",40),e._uU(2),e.qZA()),2&a){const t=n.$implicit;e.Q6J("value",t.ID),e.xp6(1),e.s9C("src",t.Img,e.LSH),e.xp6(1),e.hij("",t.Name," ")}}function at(a,n){1&a&&e._uU(0,"Preview")}function it(a,n){if(1&a&&(e.TgZ(0,"th",58),e._uU(1),e.qZA()),2&a){const t=e.oxw(2);e.xp6(1),e.Oqu(0==t.getTypeID()?"Last Status Update":"Created Date")}}function ot(a,n){if(1&a&&(e.TgZ(0,"td"),e._uU(1),e.ALo(2,"date"),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",e.xi3(2,1,t.Date,"dd MMM yyyy HH:mm:ss"),"")}}function rt(a,n){if(1&a&&(e.TgZ(0,"span"),e._uU(1),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.hij(" ",t.ActionString," ")}}function lt(a,n){if(1&a&&(e.TgZ(0,"li"),e._uU(1),e.qZA()),2&a){const t=n.$implicit;e.xp6(1),e.hij("",t," ")}}function st(a,n){if(1&a&&(e.TgZ(0,"ul",63),e.YNc(1,lt,2,1,"li",59),e.qZA()),2&a){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("ngForOf",t.ActionString)}}function pt(a,n){if(1&a&&(e.TgZ(0,"span",64),e._UZ(1,"i",65),e.qZA()),2&a){const t=e.oxw().$implicit;e.hYB("title","Delivery : ",t.DeliveryState," \nPayment : ",t.PaymentState,"")}}const ct=function(a,n){return{"over-due-today":a,"over-due":n}};function dt(a,n){if(1&a&&(e.TgZ(0,"tr")(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.YNc(5,ot,3,4,"td",1),e.TgZ(6,"td")(7,"span"),e._uU(8),e.qZA(),e._uU(9),e.qZA(),e.TgZ(10,"td",60)(11,"span"),e._uU(12),e.qZA(),e._uU(13),e.qZA(),e.TgZ(14,"td"),e.YNc(15,rt,2,1,"span",1),e.YNc(16,st,2,1,"ul",61),e.qZA(),e.TgZ(17,"td"),e.YNc(18,pt,2,2,"span",62),e.qZA()()),2&a){const t=n.$implicit,i=n.index,o=e.oxw(3);e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.Number),e.xp6(1),e.Q6J("ngIf",o.getTypeID()!=o.channelType.ShopeeV2),e.xp6(3),e.hij("",t.ChannelStatus," - "),e.xp6(1),e.Oqu(t.ChannelStatusDescription),e.xp6(1),e.Q6J("ngClass",e.WLB(12,ct,(null==t?null:t.Action)==o.actionPreviewOrder.Update,(null==t?null:t.Action)==o.actionPreviewOrder.New))("matTooltip",91==t.POSStatus||"Conflict"==t.POSStatusDescription?"There is a missed status at POS, usually fulfillment has not been recorded but the payment has been recorded":""),e.xp6(2),e.hij("",t.POSStatus," - "),e.xp6(1),e.hij("",t.POSStatusDescription," "),e.xp6(2),e.Q6J("ngIf",1==t.ActionString.length),e.xp6(1),e.Q6J("ngIf",t.ActionString.length>1),e.xp6(2),e.Q6J("ngIf",99!=t.ChannelStatus&&99!=t.POSStatus)}}function ut(a,n){if(1&a&&(e.ynx(0),e.YNc(1,dt,19,15,"tr",59),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.displayedPreviewData)}}function ht(a,n){1&a&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function gt(a,n){if(1&a){const t=e.EpF();e.TgZ(0,"div",41)(1,"div",42)(2,"div",43)(3,"ul",44)(4,"li",45)(5,"button",46),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.ALL))}),e._uU(6),e.qZA()(),e.TgZ(7,"li",45)(8,"button",47),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.SYNC))}),e._uU(9),e.qZA()(),e.TgZ(10,"li",45)(11,"button",48),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.WRONG))}),e._uU(12),e.qZA()(),e.TgZ(13,"li",45)(14,"button",49),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.filterPreviewData(o.previewStatus.UNSYNC))}),e._uU(15),e.qZA()()()(),e.TgZ(16,"table",50)(17,"thead",51)(18,"tr"),e._UZ(19,"th",52),e.TgZ(20,"th",53),e._uU(21,"Number"),e.qZA(),e.YNc(22,it,2,1,"th",54),e.TgZ(23,"th",55),e._uU(24,"Channel Status"),e.qZA(),e.TgZ(25,"th",55),e._uU(26,"POS Status"),e.qZA(),e.TgZ(27,"th"),e._uU(28,"Action"),e.qZA(),e._UZ(29,"th",52),e.qZA()(),e.TgZ(30,"tbody"),e.YNc(31,ut,2,1,"ng-container",56),e.YNc(32,ht,6,0,"ng-template",null,57,e.W1O),e.qZA()()()()}if(2&a){const t=e.MAs(33),i=e.oxw();e.xp6(5),e.Q6J("ngClass","all"==i.pillStatus?"btn-secondary text-white":"btn-outline-dark"),e.xp6(1),e.hij("All (",i.allData,")"),e.xp6(2),e.Q6J("ngClass","sync"==i.pillStatus?"btn-success":"btn-outline-success"),e.xp6(1),e.hij("Existing (",i.syncData,")"),e.xp6(2),e.Q6J("ngClass","wrong"==i.pillStatus?"btn-warning text-white":"btn-outline-warning"),e.xp6(1),e.hij("Wrong Status (",i.wrongData,")"),e.xp6(2),e.Q6J("ngClass","unsync"==i.pillStatus?"btn-danger":"btn-outline-danger"),e.xp6(1),e.hij("Missing (",i.unsyncData,")"),e.xp6(7),e.Q6J("ngIf",i.getTypeID()!=i.channelType.ShopeeV2),e.xp6(9),e.Q6J("ngIf",i.displayedPreviewData.length>0)("ngIfElse",t)}}function mt(a,n){1&a&&e._uU(0,"Finish")}const _t=function(a){return{"over-due":a}};function ft(a,n){if(1&a&&(e.TgZ(0,"tr",73)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e._uU(4),e.qZA(),e.TgZ(5,"td"),e._uU(6),e.qZA(),e.TgZ(7,"td"),e._uU(8),e.qZA()()),2&a){const t=n.$implicit,i=n.index;e.Q6J("ngClass",e.VKq(5,_t,t.Exception)),e.xp6(2),e.Oqu(i+1),e.xp6(2),e.Oqu(t.Number),e.xp6(2),e.Oqu(t.Status),e.xp6(2),e.Oqu(t.Exception)}}function Tt(a,n){if(1&a&&(e.ynx(0),e.YNc(1,ft,9,7,"tr",72),e.BQk()),2&a){const t=e.oxw(2);e.xp6(1),e.Q6J("ngForOf",t.downloadData)}}function Ct(a,n){1&a&&(e.TgZ(0,"tr",66)(1,"td",67)(2,"div",68),e._UZ(3,"i",69),e.qZA(),e.TgZ(4,"h4",70),e._uU(5,"There is no order to processed"),e.qZA()()())}function Zt(a,n){if(1&a&&(e.TgZ(0,"div",41)(1,"div",42)(2,"table",50)(3,"thead",51)(4,"tr"),e._UZ(5,"th",52),e.TgZ(6,"th"),e._uU(7,"Order Number"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Status"),e.qZA(),e.TgZ(10,"th"),e._uU(11,"Exception"),e.qZA()()(),e.TgZ(12,"tbody"),e.YNc(13,Tt,2,1,"ng-container",56),e.YNc(14,Ct,6,0,"ng-template",null,71,e.W1O),e.qZA()()()()),2&a){const t=e.MAs(15),i=e.oxw();e.xp6(13),e.Q6J("ngIf",(null==i.downloadData?null:i.downloadData.length)>0)("ngIfElse",t)}}function vt(a,n){1&a&&e._UZ(0,"i",74)}function bt(a,n){1&a&&e._UZ(0,"i",75)}function St(a,n){1&a&&e._UZ(0,"i",76)}var T=(()=>{return(a=T||(T={})).ALL="all",a.SYNC="sync",a.WRONG="wrong",a.UNSYNC="unsync",T;var a})();class H{constructor(n,t,i,o,c,x){this.http=n,this.toastr=t,this.datePipe=i,this.url=o,this.productService=c,this.orderService=x,this.pageTitle="Download to POS",this.pillStatus="all",this.displayedPreviewData=[],this.previewData=[],this.channelType=r.x,this.previewStatus=T,this.currentState="filter",this.wrongData=0,this.unsyncData=0,this.syncData=0,this.allData=0,this.actionPreviewOrder=O}ngOnInit(){this.initPageLoader(),this.url.queryParams.subscribe(n=>{this.channelID=n.ChannelID,this.startDate=new Date(n.Date),this.endDate=new Date(n.Date)})}initPageLoader(){this.productService.loader().subscribe(n=>{this.channelOptions=n.Options.Channel})}onDownload(n){this.http.post("/api/Orders/Download",{ID:this.channelID,From:this.startDate,To:this.endDate,ListPreview:this.downloadedPreviewData}).subscribe(i=>{this.downloadData=i.Body,this.onStepperNext(n)})}onPreview(n){this.validateDatePreview()&&this.http.post("/api/Orders/Preview",{ID:this.channelID,From:this.startDate,To:this.endDate}).subscribe(i=>{0!=i.length?(this.previewData=i,this.groupingPreviewData(),this.filterPreviewData(T.ALL),this.initLengthStatusData(),this.onStepperNext(n)):this.toastrEmptyPreview()})}toastrEmptyPreview(){this.toastr.info("There is no orders from "+this.datePipe.transform(this.startDate,"dd MMM yyyy")+" to "+this.datePipe.transform(this.endDate,"dd MMM yyyy")+" !","No Orders!")}validateDatePreview(){let n=!0;return _.g.getDaysDiff(this.startDate,this.endDate)>14&&(this.toastr.warning("Dates cannot be more than 14 days apart!","Failed"),n=!1),n}setPageTitle(n){this.pageTitle=`\n ${n} (${this.getDateTitle()})\n `}getDateTitle(){const n=_.g.formatTitleFromDate(new Date(this.startDate),new Date(this.endDate)),t=this.datePipe.transform(this.startDate,n);return`${null==n?"":t+"-"} ${this.datePipe.transform(this.endDate,"dd MMM yyyy")}`}onNew(n){this.channelID=null,this.startDate=null,this.endDate=null,this.pageTitle="Download to POS",n.reset()}groupingPreviewData(){let n=this.filterDataByStatus(T.UNSYNC),t=this.filterDataByStatus(T.WRONG);this.downloadedPreviewData=[...n,...t]}filterDataByStatus(n){let t=[];switch(n){case T.ALL:t=this.previewData;break;case T.SYNC:t=this.previewData.filter(i=>i.Action==O.DoNothing);break;case T.WRONG:t=this.previewData.filter(i=>i.Action==O.Update);break;case T.UNSYNC:t=this.previewData.filter(i=>i.Action==O.New)}return t}filterPreviewData(n){this.pillStatus=n,this.displayedPreviewData=this.filterDataByStatus(n)}initLengthStatusData(){this.wrongData=this.filterDataByStatus(T.WRONG).length,this.allData=this.previewData.length,this.syncData=this.filterDataByStatus(T.SYNC).length,this.unsyncData=this.filterDataByStatus(T.UNSYNC).length}getTypeID(){var n=this.channelOptions.find(t=>t.ID==this.channelID)?.TypeID;return n??0}onStepperChange(n){this.currentState=n.selectedStep.state}onStepperNext(n){n.selected.completed=!0,n.next()}onNext(n){switch(this.currentState){case"filter":this.onPreview(n);break;case"preview":this.onDownload(n)}}stepChange(n){switch(n?.selectedStep?.state){case"filter":this.pageTitle="Download To POS",this.resetPreviewData();break;case"preview":let t=this.productService.findChannelById(this.channelID,this.channelOptions);this.setPageTitle(`Preview ${t?.Name}`);break;case"finish":this.setPageTitle("Download")}}resetPreviewData(){this.displayedPreviewData=[],this.previewData=[],this.initLengthStatusData()}checkDisabledNextFilter(){let n=!_.g.isValidDate(this.startDate)||!_.g.isValidDate(this.endDate),t=_.g.IsEmpty(this.channelID);return n||t}exportOrders(){let n={ID:this.channelID,From:this.startDate,To:this.endDate};const t=`Orders ${this.getDateTitle()}`;this.orderService.exportOrders(n,t).subscribe()}}H.\u0275fac=function(n){return new(n||H)(e.Y36(S.O),e.Y36(V._W),e.Y36(u.uU),e.Y36(f.gz),e.Y36(Ke.M),e.Y36(Z))},H.\u0275cmp=e.Xpm({type:H,selectors:[["app-download"]],features:[e._Bn([{provide:Ve.gx,useValue:{displayDefaultIndicatorType:!1}}])],decls:47,vars:20,consts:[[3,"headerTitle","description","hideSearchBox","hideSearchDropdown"],[4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2","type","button",3,"disabled","click",4,"ngIf"],["class","btn btn-outline-secondary btn-fill btn-lg ms-2",3,"click",4,"ngIf"],[1,"container-fluid","pt-5","mt-5"],[1,"row"],[1,"col-12"],[1,"d-flex","justify-content-center"],["labelPosition","bottom","linear","",1,"w-100","stepper-download",3,"ngClass","selectionChange"],["stepper",""],["state","filter",3,"editable","completed"],["matStepLabel",""],[1,"row","pt-2",2,"width","63%","margin-right","40px"],[1,"col-6"],[1,"text-muted"],["appendTo","body",3,"clearable","ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[1,"row","mt-1rem"],["id","dates",1,"form-control","rounded","dateRange",3,"rangePicker"],["matStartDate","","placeholder","Start date",3,"ngModel","ngModelChange","click"],["matEndDate","","placeholder","End date",3,"ngModel","ngModelChange","click"],["picker",""],["state","preview",3,"editable","completed"],["class","row pt-2",4,"ngIf"],["state","finish"],["matStepperIcon","filter"],["matStepperIcon","preview"],["matStepperIcon","finish"],[1,"btn-group"],[1,"btn","btn-outline-secondary",3,"click"],["type","button",1,"btn","btn-outline-secondary","border-end-0",3,"disabled","click"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end",2,"min-width","85px !important"],[1,"dropdown-item"],[3,"click"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"disabled","click"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-2",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],[3,"value"],[2,"width","18px","margin-right","10px",3,"src"],[1,"row","pt-2"],[1,"col-md-12"],[1,"row","mx-1","mb-5"],[1,"nav","nav-pills"],[1,"nav-item","mx-3"],[1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","All Invoice which is already available in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices that have different status between marketplace and POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],["matTooltip","Invoices which is not exist in POS",1,"btn","btn-sm","rounded-pill",3,"ngClass","click"],[1,"table"],[1,"thead-light"],["width","1%"],["width","25%"],["width","15%",4,"ngIf"],["width","10%"],[4,"ngIf","ngIfElse"],["EMPTY",""],["width","15%"],[4,"ngFor","ngForOf"],["matTooltipClass","custom-width-tooltip",3,"ngClass","matTooltip"],["class","ps-5",4,"ngIf"],[3,"title",4,"ngIf"],[1,"ps-5"],[3,"title"],[1,"fas","fa-info-circle","ms-2"],[1,"text-center"],["colspan","10",1,"border-0"],[2,"margin-top","16vh"],[1,"far","fa-file","text-secondary",2,"font-size","95px"],[1,"text-secondary","mt-6"],["EMPTY_DOWNLOAD",""],[3,"ngClass",4,"ngFor","ngForOf"],[3,"ngClass"],[1,"fa-solid","fa-filter"],[1,"fa-solid","fa-file"],[1,"fa-sharp","fa-solid","fa-flag"]],template:function(n,t){if(1&n){const i=e.EpF();e.TgZ(0,"mainpanel",0)(1,"actions"),e.YNc(2,We,12,1,"ng-container",1),e.YNc(3,Xe,2,1,"button",2),e.YNc(4,et,3,0,"button",3),e.qZA(),e.TgZ(5,"content")(6,"div",4)(7,"div",5)(8,"div",6)(9,"div",7)(10,"mat-stepper",8,9),e.NdJ("selectionChange",function(c){return t.stepChange(c)})("selectionChange",function(c){return t.onStepperChange(c)}),e.TgZ(12,"mat-step",10),e.YNc(13,tt,1,0,"ng-template",11),e.TgZ(14,"div",12)(15,"div",6)(16,"div",5)(17,"div",13)(18,"h5"),e._uU(19,"Select a Channel"),e.qZA(),e.TgZ(20,"p",14),e._uU(21,"Select Channel want to download order"),e.qZA()(),e.TgZ(22,"div",13)(23,"ng-select",15),e.NdJ("ngModelChange",function(c){return t.channelID=c}),e.YNc(24,nt,3,3,"ng-option",16),e.qZA()()(),e.TgZ(25,"div",17)(26,"div",13)(27,"h5"),e._uU(28,"Date Range"),e.qZA(),e.TgZ(29,"p",14),e._uU(30,"Select transaction date of the channel you want to download (Max 2 Weeks)"),e.qZA()(),e.TgZ(31,"div",13)(32,"div",6)(33,"mat-date-range-input",18)(34,"input",19),e.NdJ("ngModelChange",function(c){return t.startDate=c})("click",function(){e.CHM(i);const c=e.MAs(37);return e.KtG(c.open())}),e.qZA(),e.TgZ(35,"input",20),e.NdJ("ngModelChange",function(c){return t.endDate=c})("click",function(){e.CHM(i);const c=e.MAs(37);return e.KtG(c.open())}),e.qZA()(),e._UZ(36,"mat-date-range-picker",null,21),e.qZA()()()()()(),e.TgZ(38,"mat-step",22),e.YNc(39,at,1,0,"ng-template",11),e.YNc(40,gt,34,11,"div",23),e.qZA(),e.TgZ(41,"mat-step",24),e.YNc(42,mt,1,0,"ng-template",11),e.YNc(43,Zt,16,2,"div",23),e.qZA(),e.YNc(44,vt,1,0,"ng-template",25),e.YNc(45,bt,1,0,"ng-template",26),e.YNc(46,St,1,0,"ng-template",27),e.qZA()()()()()()()}if(2&n){const i=e.MAs(11),o=e.MAs(37);e.Q6J("headerTitle",t.pageTitle)("description",t.pageTitle)("hideSearchBox",!0)("hideSearchDropdown",!0),e.xp6(2),e.Q6J("ngIf","preview"==t.currentState),e.xp6(1),e.Q6J("ngIf","filter"==t.currentState),e.xp6(1),e.Q6J("ngIf","finish"==t.currentState),e.xp6(6),e.s9C("ngClass","last-edited-step-"+i.selectedIndex),e.xp6(2),e.Q6J("editable","finish"!=t.currentState)("completed",!1),e.xp6(11),e.Q6J("clearable",!1)("ngModel",t.channelID),e.xp6(1),e.Q6J("ngForOf",t.channelOptions),e.xp6(9),e.Q6J("rangePicker",o),e.xp6(1),e.Q6J("ngModel",t.startDate),e.xp6(1),e.Q6J("ngModel",t.endDate),e.xp6(3),e.Q6J("editable","finish"!=t.currentState)("completed",!1),e.xp6(2),e.Q6J("ngIf","preview"==t.currentState),e.xp6(3),e.Q6J("ngIf","finish"==t.currentState)}},dependencies:[u.mk,u.sg,u.O5,g.Fj,g.JJ,g.On,D.p,K.w9,K.jq,$.wx,$.zY,$.By,$._g,z.C0,z.VY,z.Vq,z.z9,ee.gM,u.uU],styles:[".vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}.mt-1rem[_ngcontent-%COMP%]{margin-top:1rem}.dateRange[_ngcontent-%COMP%]{padding-top:.8rem;padding-bottom:.8rem} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container mat-step-header>div.mat-step-label{padding-top:8px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container>div.mat-horizontal-stepper-content:nth-child(1){display:flex;justify-content:left} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-content-container{margin-top:30px} mat-stepper.stepper-download>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container>mat-step-header.mat-horizontal-stepper-header{pointer-events:none!important}"]});var w=d(8063);const Dt=[{path:"",component:C,children:[{path:"",redirectTo:"new",pathMatch:"full"},{path:"new",component:L,canActivate:[w.a],data:{title:"New Order"}},{path:"detail",component:Q,canActivate:[w.a],data:{title:"Orders detail"}},{path:"ready_to_ship",component:F,canActivate:[w.a],data:{title:"Ready To Ship"}},{path:"Shipped",component:Y,canActivate:[w.a],data:{title:"Shipped"}},{path:"Delivered",component:E,canActivate:[w.a],data:{title:"Delivered"}},{path:"All",component:G,canActivate:[w.a],data:{title:"All Order"}},{path:"Cancelled",component:R,canActivate:[w.a],data:{title:"Cancelled"}},{path:"Download",component:H,canActivate:[w.a],data:{title:"Download"}}]}];class M{}M.\u0275fac=function(n){return new(n||M)},M.\u0275mod=e.oAB({type:M}),M.\u0275inj=e.cJS({imports:[u.ez,f.Bz.forChild(Dt)]});var xt=d(8739),wt=d(1108);class U{}U.\u0275fac=function(n){return new(n||U)},U.\u0275mod=e.oAB({type:U}),U.\u0275inj=e.cJS({providers:[Z,y],imports:[u.ez,g.u5,M,j.Z,D.R,xt.TU,f.Bz,K.A0,$.FA,P.XK,N.n,z.T5,ee.AV,wt.f,W.p9,m.Is,A.LD]})},6082:(te,B,d)=>{d.d(B,{M:()=>C});var u=d(8505),f=d(1889),k=d(4650),e=d(1318),j=d(7185);class C{constructor(l,s){this.httpService=l,this.toastrService=s}loader(l=f.g.GuidEMpty){return this.httpService.post("/api/product/Load",{ID:l})}LoadInPOS(l=f.g.GuidEMpty){return this.httpService.post("/api/product/LoadInPOS",{ID:l})}filterChannelByTypeId(l,s){return l.filter(r=>-1!==s.findIndex(p=>r.TypeID==p))}getProductStatistic(){return this.httpService.post("/api/product/ProductStatistic",{})}getTotalProductLive(l){return this.httpService.post("/api/product/TotalProductLive",{ID:l})}clearCacheChannel(l){return this.httpService.post("/api/Channel/ClearCacheChannel",{ID:l})}uploadSingleProduct(l,s){return this.httpService.post("api/product/UploadMultipleChannel",{Channel:s,Products:l})}uploadMultipleProduct(l,s){return this.httpService.post("api/product/UploadMultipleProductAndMultipleChannel",{Channel:s,Products:l})}scanSingle(l,s){return this.httpService.post("/api/product/ScanSingle",{ID:l,SKU:s})}scanNotInChannel(l){return this.httpService.post("/api/product/ScanNotinChannel",{ID:l})}findAllSoldInChannel(l){return this.httpService.post("/api/product/GetSoldInChannel",l)}scanAll(l,s,r,p=!1){return this.httpService.post("/api/product/ScanOptimized",{ID:l,ScanFull:s,UpdatedProduct:r,Async:p})}scanCompareToPos(l){return this.httpService.post("/api/product/CompareMarketplaceToPOS",l)}getVariantCodesProduct(l){return l.Variants.map(r=>r.Code)}downloadMultipleProduct(l){let s=l.map(r=>({ChannelItemID:r.ChannelItemID,ChannelID:r.ChannelID}));return this.httpService.post("/api/product/DownloadMultipleProductFromChannel",s).pipe((0,u.b)(r=>{this.toastrService.success(`${r.Count} products downloaded to POS`,"Download Complete")}))}downloadProduct(l){return this.httpService.post("/api/product/DownloadProductFromChannel",{ChannelItemID:l.ChannelItemID,ChannelID:l.ChannelID}).pipe((0,u.b)(()=>{this.toastrService.success("Product successfully downloaded to POS","Download Complete")}))}getVariantCodesProducts(l=[]){let s=[];return l.forEach(r=>{r.Variants.forEach(p=>{s=[...s,p.Code]})}),s}filterUnselectedChannel(l,s){let p,r=[];if(l.forEach(h=>{r=[...r,...h.Channel]}),r&&0!=r.length){let h=[];p=s.filter(m=>(h=r.filter(g=>g.ChannelID==m.ID),h.length!==l.length))}else p=s;return p}findChannelById(l,s){return s.find(r=>r.ID==l)}sortChannel(l=[]){return l.sort((s,r)=>s.TypeID<r.TypeID?1:s.TypeID===r.TypeID?0:-1)}hasSelection(l=[]){return this.selectedProduct(l).length>0}selectedProduct(l=[]){return l.filter(s=>s.selected)}hasSelectionVariant(l){return this.selectedVariantProduct(l).length>0}selectedVariantProduct(l){let s=[];return l.forEach(r=>{s=[...s,...null!=r.Variants?r.Variants.filter(p=>p.selected):""]}),s}getChannelProduct(l){const s=l.Variants;let r=[];for(let p of s)if(null!=p.Channel)for(let h of p.Channel)0==r.filter(m=>m.ChannelID==h.ChannelID).length&&r.push(h);return this.sortChannel(r)}successToastrScanAllProduct(l,s,r){if(r){const p=l?.NotInPOS?.Product?l?.NotInPOS?.Product:0,h=l?.InChannel?.Product?l?.InChannel?.Product:0;this.toastrService.success(`\n ${p+h} found in ${s.Name} </br>\n (${h} In POS + ${p} Not In Pos)\n `,"Scan Complete!",{enableHtml:!0})}else this.toastrService.success(`${l.InChannel?l.InChannel.Product:0} product updates in ${s.Name} </br> \n since ${l.LastUpdate}`,"Scan Complete!",{enableHtml:!0})}checkProductHasScanButton(l,s){let r;return l.map(p=>(p.Channel=this.getChannelProduct(p),r=this.filterUnselectedChannel([p],s),p.hasScan=r.length>0,p))}checkProductHasUploadBtn(l,s){let r;return l.map(p=>(p.Channel=this.getChannelProduct(p),r=this.filterUnselectedChannel([p],s),p.hasUpload=r.length>0,p))}showToastrUploadMultiple(l=[]){let s=[],r=[];if(l.forEach(p=>{"string"==typeof p?.Response?r=[...r,`<li>${p.Response}</li>`]:(p?.Response?.Success.forEach(h=>{s=[...s,`<li>Product ${h} was <b>successfully</b> uploaded to ${p.Name}</li>`]}),p?.Response.Fail.forEach(h=>{r=[...r,`<li>${h}</li>`]}))}),r.length>0&&s.length>0){const p=[...s,...r];this.toastrService.warning(this.concatMessage(p),"Warning!",{enableHtml:!0})}else s.length>0&&0==r.length?this.toastrService.success(this.concatMessage(s),"Success",{enableHtml:!0}):this.toastrService.error(this.concatMessage(r),"Error",{enableHtml:!0})}concatMessage(l=[]){let s="";return l.forEach(r=>{s+=r}),`<ol>${s}</ol>`}showToastrSuccessUploadSingle(l,s){let r=l.filter(m=>0==m.Status),p=l.filter(m=>1==m.Status),h=this.generateToastrMessage(r,p,s);this.toastrService.success(h.message,"Success",{enableHtml:!0})}showToastErrorUploadSingle(l,s){let r=l?.error?.Message.filter(m=>0==m.Status),p=l?.error?.Message.filter(m=>1==m.Status),h=this.generateToastrMessage(r,p,s);"WARNING"==h.status?this.toastrService.warning(h.message,"Warning!",{enableHtml:!0}):this.toastrService.error(h.message,`Error - ${l.status}`,{enableHtml:!0})}generateToastrMessage(l,s,r){let h,p="";return 0==l.length&&s.length>0?(h="SUCCESS",p=this.createSuccessResponse(s,r)):l.length>0&&0==s.length?(h="ERROR",p=this.createErrResponse(l,r)):(h="WARNING",p=`${this.createSuccessResponse(s,r)} ${this.createErrResponse(l,r)}`),p=`<ol>${p}</ol>`,{status:h,message:p}}createErrResponse(l,s){let r="";return l.forEach((p,h)=>{r+=`<li><b>${p.Response}</b> for ${s.Name} in ${p.Name}</li>`}),r}createSuccessResponse(l,s){let r="";return l.forEach((p,h)=>{r+=`<li>Product ${s.Name} was <b>successfully</b> uploaded to ${p.Name}</li>`}),r}getHostName(){if(f.g.IsEmpty(this.hostName)){const l=localStorage.getItem("Authorization");this.hostName=JSON.parse(l)?.Host}return this.hostName}}C.\u0275fac=function(l){return new(l||C)(k.LFG(e.O),k.LFG(j._W))},C.\u0275prov=k.Yz7({token:C,factory:C.\u0275fac,providedIn:"root"})}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkpos_marketplace=self.webpackChunkpos_marketplace||[]).push([[512],{5512:(J,u,s)=>{s.r(u),s.d(u,{LogisticModule:()=>c});var g=s(6895),f=s(284),_=s(1889),L=s(4782),t=s(4650),v=s(1318),Z=s(7185),p=s(4006),C=s(7481),m=s(8796),d=s(1948),T=s(266);function S(n,i){if(1&n&&(t.TgZ(0,"span",17),t._UZ(1,"img",18),t.qZA(),t._uU(2)),2&n){const e=i.item,o=t.oxw();t.xp6(1),t.Q6J("src",o.getChannelLogo(e.TypeID),t.LSH),t.xp6(1),t.hij(" ",e.Name," ")}}function M(n,i){if(1&n){const e=t.EpF();t.ynx(0),t.TgZ(1,"input",21),t.NdJ("ngModelChange",function(l){t.CHM(e);const h=t.oxw().$implicit;return t.KtG(h.ProductSKU=l)}),t.qZA(),t.BQk()}if(2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("ngModel",e.ProductSKU)}}function y(n,i){if(1&n&&(t.TgZ(0,"ng-option",24),t._uU(1),t.qZA()),2&n){const e=i.$implicit;t.Q6J("value",e.Code),t.xp6(1),t.Oqu(e.Name)}}function A(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"ng-select",22),t.NdJ("ngModelChange",function(l){t.CHM(e);const h=t.oxw().$implicit;return t.KtG(h.ProductSKU=l)}),t.YNc(1,y,2,2,"ng-option",23),t.ALo(2,"async"),t.qZA()}if(2&n){const e=t.oxw().$implicit,o=t.oxw();t.Q6J("ngModel",e.ProductSKU),t.xp6(1),t.Q6J("ngForOf",t.lcZ(2,2,o.logisticOptions$))}}function N(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"td"),t._uU(2),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.qZA(),t.TgZ(5,"td"),t._uU(6),t.qZA(),t.TgZ(7,"td"),t.YNc(8,M,2,1,"ng-container",19),t.YNc(9,A,3,4,"ng-template",null,20,t.W1O),t.qZA()()),2&n){const e=i.$implicit,o=t.MAs(10),l=t.oxw();t.xp6(2),t.Oqu(e.Name),t.xp6(2),t.Oqu(e.Service),t.xp6(2),t.Oqu(e.TypeString),t.xp6(2),t.Q6J("ngIf",!l.logisticServiceType)("ngIfElse",o)}}class r{constructor(i,e){this.http=i,this.toastr=e,this.filter={ChannelID:""},this.logisticServiceType=!0,this.LoaderChannel()}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe((0,L.d)(1))}Validate(){for(let i of this.list)void 0===this.dataold.find(o=>o.ProductSKU==i.ProductSKU&&o.Name==i.Name)&&(i.IsChange=!0);return Promise.resolve(this.list)}submitLogistics(){this.Validate().then(i=>{this.mappingLogisticType(),this.http.post("/api/Logistic/Submit",this.list).subscribe(e=>{this.toastr.success("Success","Update Complete!",{timeOut:5e3,enableHtml:!0}),this.Get()})})}mappingLogisticType(){this.list=this.list.map(i=>(i.Type=this.logisticServiceType,i))}LoaderChannel(){this.http.post("/api/Logistic/Load",{}).subscribe(i=>{this.Channel=i.Options.Channel,this.filter=i.Filter,this.Name=this.Channel[0].Name,this.initLogisticServiceOptions(),this.Get()})}Get(){this.dataold=[],this.http.post("/api/Logistic/Get",this.filter).subscribe(i=>{let e=this.Channel.find(o=>o.ID==this.filter.ChannelID);null!=e&&(this.Name=e.Name),this.list=i,this.dataold=JSON.parse(JSON.stringify(this.list))})}getChannelLogo(i){return _.g.getChannelLogoByTypeId(i)}}r.\u0275fac=function(i){return new(i||r)(t.Y36(v.O),t.Y36(Z._W))},r.\u0275cmp=t.Xpm({type:r,selectors:[["app-logistic"]],decls:37,vars:9,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"headerTitle","hideSearchDropdown","onSubmit"],["container",""],[1,"mb-3","fw-normal"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"clearable","items","ngModel","ngModelChange"],["ng-option-tmp",""],[3,"ngModel","ngModelChange"],["matTooltip","Select logistics service option from POS",1,"me-5",3,"value"],["matTooltip","Input Product SKU",3,"value"],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],["alt","",2,"width","18px",3,"src"],[4,"ngIf","ngIfElse"],["LOGISTIC_NAME",""],["type","text","placeholder","Product SKU",1,"form-control","w-75",3,"ngModel","ngModelChange"],["placeholder","Logistic Service Code",1,"w-75",3,"ngModel","ngModelChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"]],template:function(i,e){1&i&&(t.TgZ(0,"mainpanel",0),t.NdJ("onSubmit",function(){return e.Get()}),t.TgZ(1,"filters")(2,"div",1)(3,"div")(4,"h5",2),t._uU(5,"Select a Channel"),t.qZA(),t.TgZ(6,"ng-select",3),t.NdJ("ngModelChange",function(l){return e.filter.ChannelID=l}),t.YNc(7,S,3,2,"ng-template",4),t.qZA()(),t.TgZ(8,"div")(9,"h5",2),t._uU(10,"Type"),t.qZA(),t.TgZ(11,"mat-radio-group",5),t.NdJ("ngModelChange",function(l){return e.logisticServiceType=l}),t.TgZ(12,"mat-radio-button",6),t._uU(13," Logistics "),t.qZA(),t.TgZ(14,"mat-radio-button",7),t._uU(15," SKU "),t.qZA()()()()(),t.TgZ(16,"actions")(17,"a",8),t.NdJ("click",function(){return e.submitLogistics()}),t._uU(18,"Submit"),t.qZA()(),t.TgZ(19,"content")(20,"div",9)(21,"div",10)(22,"div",11)(23,"div",12)(24,"table",13)(25,"thead",14)(26,"tr",15)(27,"th"),t._uU(28,"Logistic"),t.qZA(),t.TgZ(29,"th"),t._uU(30,"Service"),t.qZA(),t.TgZ(31,"th"),t._uU(32,"Type"),t.qZA(),t.TgZ(33,"th"),t._uU(34,"Logistic Service"),t.qZA()()(),t.TgZ(35,"tbody"),t.YNc(36,N,11,5,"tr",16),t.qZA()()()()()()()()),2&i&&(t.Q6J("headerTitle","Logistic Courier - "+e.Name)("hideSearchDropdown",!1),t.xp6(6),t.Q6J("clearable",!0)("items",e.Channel)("ngModel",e.filter.ChannelID),t.xp6(5),t.Q6J("ngModel",e.logisticServiceType),t.xp6(1),t.Q6J("value",!0),t.xp6(2),t.Q6J("value",!1),t.xp6(22),t.Q6J("ngForOf",e.list))},dependencies:[g.sg,g.O5,p.Fj,p.JJ,p.On,C.p,m.w9,m.jq,m.ir,d.VQ,d.U0,T.gM,g.Ov]});const U=[{path:"",component:r}];class a{}a.\u0275fac=function(i){return new(i||a)},a.\u0275mod=t.oAB({type:a}),a.\u0275inj=t.cJS({imports:[g.ez,f.Bz.forChild(U)]});var x=s(455);class c{}c.\u0275fac=function(i){return new(i||c)},c.\u0275mod=t.oAB({type:c}),c.\u0275inj=t.cJS({imports:[g.ez,f.Bz,a,p.u5,C.R,m.A0,x.rP,d.Fk,T.AV]})}}]);
|