marketplacepos 3.20.8 → 3.21.0
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/{chunk-JB2FBPME.js → chunk-4IZXNPEK.js} +1 -1
- package/Marketplace/chunk-ADFSY63B.js +4 -0
- package/Marketplace/{chunk-H4B5TTCJ.js → chunk-APOJ5YSU.js} +1 -1
- package/Marketplace/{chunk-3SMSJGST.js → chunk-CGJD7L2E.js} +1 -1
- package/Marketplace/{chunk-OEYCEBSD.js → chunk-D7VSFM3W.js} +1 -1
- package/Marketplace/{chunk-SWXW6HCG.js → chunk-DCBHZ5G4.js} +1 -1
- package/Marketplace/{chunk-3YVIB6CC.js → chunk-DLQ7QONG.js} +1 -1
- package/Marketplace/chunk-DY2P6RVD.js +1 -0
- package/Marketplace/{chunk-RI5C7LLN.js → chunk-E4V3PNLT.js} +1 -1
- package/Marketplace/{chunk-I7KCIWCN.js → chunk-EOKKINSN.js} +1 -1
- package/Marketplace/{chunk-HZJNPCBI.js → chunk-EWZOTAHJ.js} +1 -1
- package/Marketplace/{chunk-34PP6HJW.js → chunk-F73VWTUR.js} +2 -2
- package/Marketplace/{chunk-JF52POHG.js → chunk-GWZAJ4RW.js} +1 -1
- package/Marketplace/{chunk-AR5SSAIO.js → chunk-HTU4LKJI.js} +1 -1
- package/Marketplace/chunk-JMFQ7W36.js +9 -0
- package/Marketplace/{chunk-EDIHKCTJ.js → chunk-JVADUVCL.js} +1 -1
- package/Marketplace/chunk-MGDHSVIA.js +1 -0
- package/Marketplace/{chunk-R2NELHIC.js → chunk-N5G4HSJE.js} +1 -1
- package/Marketplace/{chunk-AHIWTEG3.js → chunk-NFJC3CTO.js} +1 -1
- package/Marketplace/{chunk-55NJCTT3.js → chunk-OBLPQZ24.js} +1 -1
- package/Marketplace/{chunk-AM55EQMX.js → chunk-OJ24ELQJ.js} +1 -1
- package/Marketplace/chunk-OM4DN7NQ.js +52 -0
- package/Marketplace/{chunk-5OIZQ4HS.js → chunk-PYG26JYB.js} +1 -1
- package/Marketplace/{chunk-GLBXDNQB.js → chunk-SV6PGF5O.js} +1 -1
- package/Marketplace/{chunk-5K4WRBCE.js → chunk-UQPDNQEW.js} +1 -1
- package/Marketplace/{chunk-EKA76B4K.js → chunk-UVQ3L5YK.js} +1 -1
- package/Marketplace/{chunk-EGYILQWG.js → chunk-VBVDUIP3.js} +1 -1
- package/Marketplace/{chunk-H3XVRLMZ.js → chunk-W567C7KU.js} +1 -1
- package/Marketplace/{chunk-QE2GPS45.js → chunk-WHMAZRKV.js} +1 -1
- package/Marketplace/{chunk-NREK5LA6.js → chunk-YLFH7OEU.js} +1 -1
- package/Marketplace/{chunk-7RXTYW3B.js → chunk-ZFPRY5TH.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-KXAPH4VR.js → main-HJC4G3LK.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-5FOPZ5IX.js +0 -4
- package/Marketplace/chunk-5ZUIIYSQ.js +0 -3
- package/Marketplace/chunk-PTFQX4VB.js +0 -1
- package/Marketplace/chunk-SQTY2CZY.js +0 -1
- package/Marketplace/chunk-U2KZLYTH.js +0 -52
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ee}from"./chunk-HHIG3XFB.js";import"./chunk-6U6JR5K6.js";import{a as $t,d as Zt,e as Xt}from"./chunk-YVTEU2IF.js";import{a as ht}from"./chunk-BVIRHZTZ.js";import{a as le,b as pe,c as vt}from"./chunk-33L2SBIN.js";import{a as se}from"./chunk-BGWVHGAY.js";import{b as Rt}from"./chunk-ULELZXI5.js";import"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import{a as Bt,b as zt,c as Gt,d as jt,e as Ht,f as Ut,g as Yt}from"./chunk-L4BFVIW5.js";import"./chunk-GNY5TY3R.js";import{a as Dt,b as Et}from"./chunk-7YWHTN3X.js";import"./chunk-CJILX5R7.js";import{i as qt}from"./chunk-2FRMUOJY.js";import{a as Jt,b as Kt}from"./chunk-C6QIBOCB.js";import{a as me,b as Tt}from"./chunk-47PEHCOU.js";import{f as kt,g as Lt,h as Vt,i as Ft,j as At}from"./chunk-KZ6AD6KW.js";import{a as Ot}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as Q}from"./chunk-WTMUHE4V.js";import{b as Wt}from"./chunk-MKJON4UM.js";import{b as Mt}from"./chunk-WKSTGJK5.js";import{a as Pt,b as It,c as Nt}from"./chunk-GQG2K3LS.js";import{a as ge}from"./chunk-
|
|
1
|
+
import{a as ee}from"./chunk-HHIG3XFB.js";import"./chunk-6U6JR5K6.js";import{a as $t,d as Zt,e as Xt}from"./chunk-YVTEU2IF.js";import{a as ht}from"./chunk-BVIRHZTZ.js";import{a as le,b as pe,c as vt}from"./chunk-33L2SBIN.js";import{a as se}from"./chunk-BGWVHGAY.js";import{b as Rt}from"./chunk-ULELZXI5.js";import"./chunk-E5BOLHDG.js";import"./chunk-A37OKNC2.js";import{a as Bt,b as zt,c as Gt,d as jt,e as Ht,f as Ut,g as Yt}from"./chunk-L4BFVIW5.js";import"./chunk-GNY5TY3R.js";import{a as Dt,b as Et}from"./chunk-7YWHTN3X.js";import"./chunk-CJILX5R7.js";import{i as qt}from"./chunk-2FRMUOJY.js";import{a as Jt,b as Kt}from"./chunk-C6QIBOCB.js";import{a as me,b as Tt}from"./chunk-47PEHCOU.js";import{f as kt,g as Lt,h as Vt,i as Ft,j as At}from"./chunk-KZ6AD6KW.js";import{a as Ot}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as Q}from"./chunk-WTMUHE4V.js";import{b as Wt}from"./chunk-MKJON4UM.js";import{b as Mt}from"./chunk-WKSTGJK5.js";import{a as Pt,b as It,c as Nt}from"./chunk-GQG2K3LS.js";import{a as ge}from"./chunk-UVQ3L5YK.js";import"./chunk-BTY6PS53.js";import"./chunk-EIBGI6U2.js";import{a as re,b as oe,c as gt,d as X,e as _t}from"./chunk-PYD2YWAN.js";import{f as ce,i as Z}from"./chunk-ADFSY63B.js";import{b as Te,e as A}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{b as Ct,d as De,e as yt,f as wt,g as xt,m as Y,n as bt}from"./chunk-4CEFDQPI.js";import{t as ft,u as St}from"./chunk-2SC3HO66.js";import{P as ut}from"./chunk-DQIP7MCZ.js";import{b as He,c as $,h as z,m as G,o as ae,y as Ue}from"./chunk-2E5AKA74.js";import{b as N,c as M}from"./chunk-FTHTFVHH.js";import{$ as fe,$c as je,Ab as mt,B as at,Bb as st,Bc as ve,Cc as F,Ec as K,Fc as Se,Ha as V,Ib as O,Ja as p,Jb as m,Ka as v,Kb as S,Lb as T,Nb as w,Ob as x,Pb as b,Q as ye,Qb as dt,Rb as We,Sb as J,T as rt,Tb as Be,Ub as ie,Va as pt,Wc as Ge,X as be,Xc as ct,Zc as ne,_a as u,aa as Ae,ab as d,ac as P,bc as k,ca as de,cc as R,dc as U,ga as L,ha as Re,hb as Qe,mb as n,na as ot,nb as r,oa as g,ob as C,pa as _,pb as D,q as j,qa as Ze,qb as E,ra as Xe,sb as I,vb as y,vc as ze,w as nt,xb as c,xc as W,yc as B,za as lt}from"./chunk-ZIZWZZ4E.js";import{a as tt,b as it}from"./chunk-GNOSNGXM.js";var Qt=(()=>{let l=class l{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:[ht.downloadOrder]}]}ngOnInit(){}};l.\u0275fac=function(t){return new(t||l)},l.\u0275cmp=L({type:l,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(t,i){t&1&&(n(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),r()()(),C(4,"router-outlet")),t&2&&(p(3),d("Tabs",i.ObjectOrderTabs)("usePermissions",!0))},dependencies:[Dt,ct]});let a=l;return a})();var ei=(()=>{let l=class l{constructor(){}convertToCSV(e,t){let i;if(typeof e=="string")i=e;else{var h=typeof e=="object"?e:JSON.parse(e);i=this.transformToCSVStringFormat(h)}this.downloadCSV(i,t)}transformToCSVStringFormat(e){if(!e||!e.length)return;let t=",",i=Object.keys(e[0]);return e.map(f=>i.map(s=>{let q=f[s]===null||f[s]===void 0?"":f[s];return q=q instanceof Date?q.toLocaleString():q.toString().replace(/"/g,'""'),q.search(/("|,|\n)/g)>=0&&(q=`"${q}"`),q}).join(t)).join(`
|
|
2
2
|
`)}downloadCSV(e,t){var i=new Blob([e],{type:"text/csv;charset=utf8;"}),h=document.createElement("a");h.setAttribute("href",window.URL.createObjectURL(i)),h.setAttribute("download",t),document.body.appendChild(h),h.click(),document.body.removeChild(h)}};l.\u0275fac=function(t){return new(t||l)},l.\u0275prov=fe({token:l,factory:l.\u0275fac,providedIn:"root"});let a=l;return a})();var Ee=(()=>{let l=class l{constructor(e,t){this.http=e,this.exportService=t}loadInitialPage(){return this.http.post("/api/ordersLoader/GetOrder",{})}getNewOrders(e){return this.http.post("/api/orders/GetNewOrder",e).pipe(j(t=>t.Data))}getTotalNewOrders(e,t,i){let h={ListChannelID:e,From:t,To:i};return this.http.post("/api/orders/GetCountNewOrder",h).pipe(j(f=>f.Count))}exportOrders(e,t){return this.http.post("api/Orders/ExportOrder",e).pipe(be(i=>{this.exportService.convertToCSV(i,t)}))}};l.\u0275fac=function(t){return new(t||l)(de(A),de(ei))},l.\u0275prov=fe({token:l,factory:l.\u0275fac});let a=l;return a})();var Ye=(()=>{let l=class l{constructor(e,t){this.http=e,this.toastr=t}acceptTokopediaOrders(e){return this.http.post("/api/Orders/AcceptOrderTokopedia",e).pipe(be(t=>{this.tokopediaAcceptOrderHandler(t)}))}tokopediaAcceptOrderHandler(e){let t=e.filter(h=>h.Status==!1),i=e.filter(h=>h.Status==!0);if(t.length==0&&i.length>0){let h=`<ol>${this.generateSuccessMessage(i)}</ol>`;this.toastr.success(h,"Success",{enableHtml:!0})}else if(t.length>0&&i.length>0){let h=`<ol>
|
|
3
3
|
${this.generateSuccessMessage(i)}
|
|
4
4
|
${this.generateErrorMessage(t)}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{e as Y}from"./chunk-JHYIHRQH.js";import{a as He,b as de,c as We,d as $e,e as he,f as ze,g as pe,h as Ke,i as U,j as fe,k as T}from"./chunk-KCDL7SWP.js";import{b as ue,c as $,d as Ge}from"./chunk-FTHTFVHH.js";import{$ as A,A as De,B as xe,Ca as H,Fc as Be,Gc as Ne,Hc as Fe,I as se,N as Re,Q as ae,Qa as W,T as x,U as ce,X as G,Yc as Le,aa as F,b as g,ba as C,c as X,ca as h,da as _e,ea as je,ec as Oe,fc as Me,g as Te,h as Ee,ha as L,k as B,kc as le,l as N,m as R,n as K,q as y,r as Pe}from"./chunk-ZIZWZZ4E.js";import{a as ie,i as I}from"./chunk-GNOSNGXM.js";var Ue={production:!0,version:"3.21.0",firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:omni&sort=sortOrder:asc"};var mt="firebase",wt="10.12.1";U(mt,wt,"app");var V=new Oe("ANGULARFIRE2_VERSION");var St=(r,o)=>{let t=o?[o]:Ke(),e=[];return t.forEach(n=>{n.container.getProvider(r).instances.forEach(s=>{e.includes(s)||e.push(s)})}),e},q=class{constructor(){return St(vt)}},vt="app-check";function ge(){}var Q=class{zone;delegate;constructor(o,t=Ee){this.zone=o,this.delegate=t}now(){return this.delegate.now()}schedule(o,t,e){let n=this.zone,i=function(s){n.runGuarded(()=>{o.apply(this,[s])})};return this.delegate.schedule(i,t,e)}},me=class{zone;task=null;constructor(o){this.zone=o}call(o,t){let e=this.unscheduleTask.bind(this);return this.task=this.zone.run(()=>Zone.current.scheduleMacroTask("firebaseZoneBlock",ge,{},ge,ge)),t.pipe(G({next:e,complete:e,error:e})).subscribe(o).add(e)}unscheduleTask(){setTimeout(()=>{this.task!=null&&this.task.state==="scheduled"&&(this.task.invoke(),this.task=null)},10)}},qe=(()=>{class r{ngZone;outsideAngular;insideAngular;constructor(t){this.ngZone=t,this.outsideAngular=t.runOutsideAngular(()=>new Q(Zone.current)),this.insideAngular=t.run(()=>new Q(Zone.current,Te)),globalThis.\u0275AngularFireScheduler||=this}static \u0275fac=function(e){return new(e||r)(h(W))};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();function kt(){let r=globalThis.\u0275AngularFireScheduler;if(!r)throw new Error(`Either AngularFireModule has not been provided in your AppModule (this can be done manually or implictly using
|
|
2
|
+
provideFirebaseApp) or you're calling an AngularFire method outside of an NgModule (which is not supported).`);return r}function Ve(r){return At(kt())(r)}function At(r){return function(t){return t=t.lift(new me(r.ngZone)),t.pipe(N(r.outsideAngular),B(r.insideAngular))}}var Je=(()=>{let o=class o{constructor(){}getParseToken(){let e=JSON.parse(window.localStorage.getItem("user"));return this.ParseToken(e.Token.access_token)}GetRoles(){let n=this.getParseToken()["http://schemas.microsoft.com/ws/2008/06/identity/claims/role"];return n||[]}ParseToken(e){try{let i=e.split(".")[0].replace("-","+").replace("_","/"),s=JSON.parse(window.atob(i)),c=e.split(".")[1].replace("-","+").replace("_","/"),l=JSON.parse(window.atob(c));return l.header=s,l}catch{return!1}}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var yt=new Map,Ct={activated:!1,tokenObservers:[]},Tt={initialized:!1,enabled:!1};function E(r){return yt.get(r)||Object.assign({},Ct)}function et(){return Tt}var Et="https://content-firebaseappcheck.googleapis.com/v1";var Pt="exchangeDebugToken",Ze={OFFSET_DURATION:5*60*1e3,RETRIAL_MIN_WAIT:30*1e3,RETRIAL_MAX_WAIT:16*60*1e3},Ao=24*60*60*1e3;var Se=class{constructor(o,t,e,n,i){if(this.operation=o,this.retryPolicy=t,this.getWaitDuration=e,this.lowerBound=n,this.upperBound=i,this.pending=null,this.nextErrorWaitInterval=n,n>i)throw new Error("Proactive refresh lower bound greater than upper bound!")}start(){this.nextErrorWaitInterval=this.lowerBound,this.process(!0).catch(()=>{})}stop(){this.pending&&(this.pending.reject("cancelled"),this.pending=null)}isRunning(){return!!this.pending}process(o){return I(this,null,function*(){this.stop();try{this.pending=new de,this.pending.promise.catch(t=>{}),yield Dt(this.getNextRun(o)),this.pending.resolve(),yield this.pending.promise,this.pending=new de,this.pending.promise.catch(t=>{}),yield this.operation(),this.pending.resolve(),yield this.pending.promise,this.process(!0).catch(()=>{})}catch(t){this.retryPolicy(t)?this.process(!1).catch(()=>{}):this.stop()}})}getNextRun(o){if(o)return this.nextErrorWaitInterval=this.lowerBound,this.getWaitDuration();{let t=this.nextErrorWaitInterval;return this.nextErrorWaitInterval*=2,this.nextErrorWaitInterval>this.upperBound&&(this.nextErrorWaitInterval=this.upperBound),t}}};function Dt(r){return new Promise(o=>{setTimeout(o,r)})}var xt={"already-initialized":"You have already called initializeAppCheck() for FirebaseApp {$appName} with different options. To avoid this error, call initializeAppCheck() with the same options as when it was originally called. This will return the already initialized instance.","use-before-activation":"App Check is being used before initializeAppCheck() is called for FirebaseApp {$appName}. Call initializeAppCheck() before instantiating other Firebase services.","fetch-network-error":"Fetch failed to connect to a network. Check Internet connection. Original error: {$originalErrorMessage}.","fetch-parse-error":"Fetch client could not parse response. Original error: {$originalErrorMessage}.","fetch-status-error":"Fetch server returned an HTTP error status. HTTP status: {$httpStatus}.","storage-open":"Error thrown when opening storage. Original error: {$originalErrorMessage}.","storage-get":"Error thrown when reading from storage. Original error: {$originalErrorMessage}.","storage-set":"Error thrown when writing to storage. Original error: {$originalErrorMessage}.","recaptcha-error":"ReCAPTCHA error.",throttled:"Requests throttled due to {$httpStatus} error. Attempts allowed again after {$time}"},j=new $e("appCheck","AppCheck",xt);function tt(r){if(!E(r).activated)throw j.create("use-before-activation",{appName:r.name})}function nt(e,n){return I(this,arguments,function*({url:r,body:o},t){let i={"Content-Type":"application/json"},s=t.getImmediate({optional:!0});if(s){let f=yield s.getHeartbeatsHeader();f&&(i["X-Firebase-Client"]=f)}let a={method:"POST",body:JSON.stringify(o),headers:i},c;try{c=yield fetch(r,a)}catch(f){throw j.create("fetch-network-error",{originalErrorMessage:f?.message})}if(c.status!==200)throw j.create("fetch-status-error",{httpStatus:c.status});let l;try{l=yield c.json()}catch(f){throw j.create("fetch-parse-error",{originalErrorMessage:f?.message})}let d=l.ttl.match(/^([\d.]+)(s)$/);if(!d||!d[2]||isNaN(Number(d[1])))throw j.create("fetch-parse-error",{originalErrorMessage:`ttl field (timeToLive) is not in standard Protobuf Duration format: ${l.ttl}`});let u=Number(d[1])*1e3,p=Date.now();return{token:l.token,expireTimeMillis:p+u,issuedAtTimeMillis:p}})}function rt(r,o){let{projectId:t,appId:e,apiKey:n}=r.options;return{url:`${Et}/projects/${t}/apps/${e}:${Pt}?key=${n}`,body:{debug_token:o}}}var Rt="firebase-app-check-database",_t=1,ve="firebase-app-check-store";var ee=null;function jt(){return ee||(ee=new Promise((r,o)=>{try{let t=indexedDB.open(Rt,_t);t.onsuccess=e=>{r(e.target.result)},t.onerror=e=>{var n;o(j.create("storage-open",{originalErrorMessage:(n=e.target.error)===null||n===void 0?void 0:n.message}))},t.onupgradeneeded=e=>{let n=e.target.result;switch(e.oldVersion){case 0:n.createObjectStore(ve,{keyPath:"compositeKey"})}}}catch(t){o(j.create("storage-open",{originalErrorMessage:t?.message}))}}),ee)}function Ot(r,o){return Mt(Bt(r),o)}function Mt(r,o){return I(this,null,function*(){let e=(yield jt()).transaction(ve,"readwrite"),i=e.objectStore(ve).put({compositeKey:r,value:o});return new Promise((s,a)=>{i.onsuccess=c=>{s()},e.onerror=c=>{var l;a(j.create("storage-set",{originalErrorMessage:(l=c.target.error)===null||l===void 0?void 0:l.message}))}})})}function Bt(r){return`${r.options.appId}-${r.name}`}var ke=new ze("@firebase/app-check");function we(r,o){return We()?Ot(r,o).catch(t=>{ke.warn(`Failed to write token to IndexedDB. Error: ${t}`)}):Promise.resolve()}function ot(){return et().enabled}function it(){return I(this,null,function*(){let r=et();if(r.enabled&&r.token)return r.token.promise;throw Error(`
|
|
3
|
+
Can't get debug token in production mode.
|
|
4
|
+
`)})}var Nt={error:"UNKNOWN_ERROR"};function Ft(r){return He.encodeString(JSON.stringify(r),!1)}function Ae(r,o=!1){return I(this,null,function*(){let t=r.app;tt(t);let e=E(t),n=e.token,i;if(n&&!J(n)&&(e.token=void 0,n=void 0),!n){let c=yield e.cachedTokenPromise;c&&(J(c)?n=c:yield we(t,void 0))}if(!o&&n&&J(n))return{token:n.token};let s=!1;if(ot()){e.exchangeTokenPromise||(e.exchangeTokenPromise=nt(rt(t,yield it()),r.heartbeatServiceProvider).finally(()=>{e.exchangeTokenPromise=void 0}),s=!0);let c=yield e.exchangeTokenPromise;return yield we(t,c),e.token=c,{token:c.token}}try{e.exchangeTokenPromise||(e.exchangeTokenPromise=e.provider.getToken().finally(()=>{e.exchangeTokenPromise=void 0}),s=!0),n=yield E(t).exchangeTokenPromise}catch(c){c.code==="appCheck/throttled"?ke.warn(c.message):ke.error(c),i=c}let a;return n?i?J(n)?a={token:n.token,internalError:i}:a=Ye(i):(a={token:n.token},e.token=n,yield we(t,n)):a=Ye(i),s&&$t(t,a),a})}function Lt(r){return I(this,null,function*(){let o=r.app;tt(o);let{provider:t}=E(o);if(ot()){let e=yield it(),{token:n}=yield nt(rt(o,e),r.heartbeatServiceProvider);return{token:n}}else{let{token:e}=yield t.getToken();return{token:e}}})}function Ht(r,o,t,e){let{app:n}=r,i=E(n),s={next:t,error:e,type:o};if(i.tokenObservers=[...i.tokenObservers,s],i.token&&J(i.token)){let a=i.token;Promise.resolve().then(()=>{t({token:a.token}),Xe(r)}).catch(()=>{})}i.cachedTokenPromise.then(()=>Xe(r))}function st(r,o){let t=E(r),e=t.tokenObservers.filter(n=>n.next!==o);e.length===0&&t.tokenRefresher&&t.tokenRefresher.isRunning()&&t.tokenRefresher.stop(),t.tokenObservers=e}function Xe(r){let{app:o}=r,t=E(o),e=t.tokenRefresher;e||(e=Wt(r),t.tokenRefresher=e),!e.isRunning()&&t.isTokenAutoRefreshEnabled&&e.start()}function Wt(r){let{app:o}=r;return new Se(()=>I(this,null,function*(){let t=E(o),e;if(t.token?e=yield Ae(r,!0):e=yield Ae(r),e.error)throw e.error;if(e.internalError)throw e.internalError}),()=>!0,()=>{let t=E(o);if(t.token){let e=t.token.issuedAtTimeMillis+(t.token.expireTimeMillis-t.token.issuedAtTimeMillis)*.5+3e5,n=t.token.expireTimeMillis-5*60*1e3;return e=Math.min(e,n),Math.max(0,e-Date.now())}else return 0},Ze.RETRIAL_MIN_WAIT,Ze.RETRIAL_MAX_WAIT)}function $t(r,o){let t=E(r).tokenObservers;for(let e of t)try{e.type==="EXTERNAL"&&o.error!=null?e.error(o.error):e.next(o)}catch{}}function J(r){return r.expireTimeMillis-Date.now()>0}function Ye(r){return{token:Ft(Nt),error:r}}var be=class{constructor(o,t){this.app=o,this.heartbeatServiceProvider=t}_delete(){let{tokenObservers:o}=E(this.app);for(let t of o)st(this.app,t.next);return Promise.resolve()}};function zt(r,o){return new be(r,o)}function Kt(r){return{getToken:o=>Ae(r,o),getLimitedUseToken:()=>Lt(r),addTokenListener:o=>Ht(r,"INTERNAL",o),removeTokenListener:o=>st(r.app,o)}}var Gt="@firebase/app-check",Ut="0.8.4";var qt="app-check",Qe="app-check-internal";function Vt(){pe(new he(qt,r=>{let o=r.getProvider("app").getImmediate(),t=r.getProvider("heartbeat");return zt(o,t)},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((r,o,t)=>{r.getProvider(Qe).initialize()})),pe(new he(Qe,r=>{let o=r.getProvider("app-check").getImmediate();return Kt(o)},"PUBLIC").setInstantiationMode("EXPLICIT")),U(Gt,Ut)}Vt();var Jt=["localhost","0.0.0.0","127.0.0.1"],jo=typeof window<"u"&&Jt.includes(window.location.hostname);var Xt="firebase",Yt="10.12.1";T.registerVersion(Xt,Yt,"app-compat");var Qt=["ngOnDestroy"],ct=(r,o,t,e={})=>new Proxy(r,{get:(n,i)=>t.runOutsideAngular(()=>{if(r[i])return e?.spy?.get&&e.spy.get(i,r[i]),r[i];if(Qt.indexOf(i)>-1)return()=>{};let s=o.toPromise().then(a=>{let c=a?.[i];return typeof c=="function"?c.bind(a):c?.then?c.then(l=>t.run(()=>l)):t.run(()=>c)});return new Proxy(()=>{},{get:(a,c)=>s[c],apply:(a,c,l)=>s.then(d=>{let u=d?.(...l);return e?.spy?.apply&&e.spy.apply(i,l,u),u})})})});var te=class{constructor(o){return o}},ne=new C("angularfire2.app.options"),re=new C("angularfire2.app.name");function Ie(r,o,t){let e=typeof t=="string"&&t||"[DEFAULT]",n=typeof t=="object"&&t||{};n.name=n.name||e;let s=T.apps.filter(a=>a&&a.name===n.name)[0]||o.runOutsideAngular(()=>T.initializeApp(r,n));try{if(JSON.stringify(r)!==JSON.stringify(s.options)){let a=!!module.hot;en("error",`${s.name} Firebase App already initialized with different options${a?", you may need to reload as Firebase is not HMR aware.":"."}`)}}catch{}return new te(s)}var en=(r,...o)=>{le()&&typeof console<"u"&&console[r](...o)},tn={provide:te,useFactory:Ie,deps:[ne,W,[new je,re]]},Ko=(()=>{class r{static initializeApp(t,e){return{ngModule:r,providers:[{provide:ne,useValue:t},{provide:re,useValue:e}]}}constructor(t){T.registerVersion("angularfire",V.full,"core"),T.registerVersion("angularfire",V.full,"app-compat"),T.registerVersion("angular",Me.full,t.toString())}static \u0275fac=function(e){return new(e||r)(h(H))};static \u0275mod=L({type:r});static \u0275inj=F({providers:[tn]})}return r})();function lt(r,o,t,e,n){let[,i,s]=globalThis.\u0275AngularfireInstanceCache.find(a=>a[0]===r)||[];if(i)return nn(n,s)||(at("error",`${o} was already initialized on the ${t} Firebase App with different settings.${rn?" You may need to reload as Firebase is not HMR aware.":""}`),at("warn",{is:n,was:s})),i;{let a=e();return globalThis.\u0275AngularfireInstanceCache.push([r,a,n]),a}}function nn(r,o){try{return r.toString()===o.toString()}catch{return r===o}}var rn=typeof module<"u"&&!!module.hot,at=(r,...o)=>{le()&&typeof console<"u"&&console[r](...o)};globalThis.\u0275AngularfireInstanceCache||=[];var on=new C("angularfire2.auth.use-emulator"),sn=new C("angularfire2.auth.settings"),an=new C("angularfire2.auth.tenant-id"),cn=new C("angularfire2.auth.langugage-code"),ln=new C("angularfire2.auth.use-device-language"),un=new C("angularfire.auth.persistence"),dn=(r,o,t,e,n,i,s,a)=>lt(`${r.name}.auth`,"AngularFireAuth",r.name,()=>{let c=o.runOutsideAngular(()=>r.auth());if(t&&c.useEmulator(...t),e&&(c.tenantId=e),c.languageCode=n,i&&c.useDeviceLanguage(),s)for(let[l,d]of Object.entries(s))c.settings[l]=d;return a&&c.setPersistence(a),c},[t,e,n,i,s,a]),ye=(()=>{class r{authState;idToken;user;idTokenResult;credential;constructor(t,e,n,i,s,a,c,l,d,u,p,f){let z=new X,O=K(void 0).pipe(B(s.outsideAngular),x(()=>i.runOutsideAngular(()=>import("./chunk-F4WIW6HA.js"))),y(()=>Ie(t,i,e)),y(P=>dn(P,i,a,l,d,u,c,p)),ae({bufferSize:1,refCount:!1}));if(Fe(n))this.authState=this.user=this.idToken=this.idTokenResult=this.credential=K(null);else{O.pipe(Re()).subscribe();let P=O.pipe(x(w=>w.getRedirectResult().then(D=>D,()=>null)),Ve,ae({bufferSize:1,refCount:!1})),Z=O.pipe(x(w=>new g(D=>({unsubscribe:i.runOutsideAngular(()=>w.onAuthStateChanged(M=>D.next(M),M=>D.error(M),()=>D.complete()))})))),oe=O.pipe(x(w=>new g(D=>({unsubscribe:i.runOutsideAngular(()=>w.onIdTokenChanged(M=>D.next(M),M=>D.error(M),()=>D.complete()))}))));this.authState=P.pipe(ce(Z),N(s.outsideAngular),B(s.insideAngular)),this.user=P.pipe(ce(oe),N(s.outsideAngular),B(s.insideAngular)),this.idToken=this.user.pipe(x(w=>w?R(w.getIdToken()):K(null))),this.idTokenResult=this.user.pipe(x(w=>w?R(w.getIdTokenResult()):K(null))),this.credential=De(P,z,this.authState.pipe(xe(w=>!w))).pipe(y(w=>w?.user?w:null),N(s.outsideAngular),B(s.insideAngular))}return ct(this,O,i,{spy:{apply:(P,Z,oe)=>{(P.startsWith("signIn")||P.startsWith("createUser"))&&oe.then(w=>z.next(w))}}})}static \u0275fac=function(e){return new(e||r)(h(ne),h(re,8),h(H),h(W),h(qe),h(on,8),h(sn,8),h(an,8),h(cn,8),h(ln,8),h(un,8),h(q,8))};static \u0275prov=A({token:r,factory:r.\u0275fac,providedIn:"any"})}return r})(),ii=(()=>{class r{constructor(){T.registerVersion("angularfire",V.full,"auth-compat")}static \u0275fac=function(e){return new(e||r)};static \u0275mod=L({type:r});static \u0275inj=F({providers:[ye]})}return r})();function m(r,o,t,e){return new Promise((n,i)=>{r||i("IndexedDB not available");let s=r.open(o,t),a;s.onsuccess=c=>{a=s.result,n(a)},s.onerror=c=>{i(`IndexedDB error: ${s.error}`)},typeof e=="function"&&(s.onupgradeneeded=c=>{e(c,a)})})}function ut(r,o,t,e,n){if(!r)return;let i=r.open(o,t);i.onupgradeneeded=s=>{let a=s.target.result;e.forEach(l=>{if(!a.objectStoreNames.contains(l.store)){let d=a.createObjectStore(l.store,l.storeConfig);l.storeSchema.forEach(u=>{d.createIndex(u.name,u.keypath,u.options)})}});let c=n&&n();c&&Object.keys(c).map(l=>parseInt(l,10)).filter(l=>l>s.oldVersion).sort((l,d)=>l-d).forEach(l=>{c[l](a,i.transaction)}),a.close()},i.onsuccess=s=>{s.target.result.close()}}function pn(r,o,t){if(!r||!o||!t)throw Error('Params: "dbName", "version", "storeName" are mandatory.');return new g(e=>{try{let n=o+1,i=indexedDB.open(r,n);i.onupgradeneeded=s=>{let a=s.target.result;a.deleteObjectStore(t),a.close(),console.log("onupgradeneeded"),e.next(!0),e.complete()},i.onerror=s=>e.error(s)}catch(n){e.error(n)}})}function fn(r,o){return r.objectStoreNames.contains(o)}function b(r,o,t){r||t("You need to use the openDatabase function to create a database before you query it!"),fn(r,o)||t(`objectStore does not exists: ${o}`)}function v(r,o){let t=r.transaction(o.storeName,o.dbMode);return t.onerror=o.error,t.onabort=o.abort,t}function k(r,o,t,e){return{storeName:o,dbMode:r,error:n=>{t(n)},abort:n=>{t(n)}}}var S=function(r){return r.readonly="readonly",r.readwrite="readwrite",r}(S||{}),dt=new C(null),Ce=(()=>{class r{constructor(t,e){if(this.dbConfig=t,this.platformId=e,!t.name)throw new Error("NgxIndexedDB: Please, provide the dbName in the configuration");if(!t.version)throw new Error("NgxIndexedDB: Please, provide the db version in the configuration");this.isBrowser=Ne(this.platformId),this.isBrowser&&(this.indexedDB=window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB,ut(this.indexedDB,t.name,t.version,t.objectStoresMeta,t.migrationFactory),m(this.indexedDB,t.name).then(n=>{n.version!==t.version&&(this.dbConfig.version=n.version)}))}createObjectStore(t,e){let n=[t];ut(this.indexedDB,this.dbConfig.name,++this.dbConfig.version,n,e)}add(t,e,n){return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{let c=v(s,k(S.readwrite,t,d=>i.error(d))).objectStore(t),l=n?c.add(e,n):c.add(e);l.onsuccess=d=>I(this,null,function*(){let u=d.target.result,p=c.get(u);p.onsuccess=f=>{i.next(f.target.result),i.complete()}})}).catch(s=>i.error(s))})}bulkAdd(t,e){let n=new Promise((i,s)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{let l=v(a,k(S.readwrite,t,i,s)).objectStore(t),d=e.map(u=>new Promise((p,f)=>{let z=u.key;delete u.key;let O=z?l.add(u,z):l.add(u);O.onsuccess=P=>{let Z=P.target.result;p(Z)}}));i(Promise.all(d))}).catch(a=>s(a))});return R(n)}bulkDelete(t,e){let n=e.map(i=>new Promise((s,a)=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(c=>{let l=v(c,k(S.readwrite,t,a,s));l.objectStore(t).delete(i),l.oncomplete=()=>{this.getAll(t).pipe(se(1)).subscribe(u=>{s(u)})}}).catch(c=>a(c))}));return R(Promise.all(n))}getByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{let c=v(i,k(S.readonly,t,n.error)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result),n.complete()},c.onerror=l=>{n.error(l)}}).catch(i=>n.error(i))})}bulkGet(t,e){let n=e.map(i=>this.getByKey(t,i));return new g(i=>{Pe(n).subscribe(s=>{i.next(s),i.complete()})})}getByID(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,l=>n.error(l));let c=v(i,k(S.readonly,t,n.error,n.next)).objectStore(t).get(e);c.onsuccess=l=>{n.next(l.target.result)}}).catch(i=>n.error(i))})}getByIndex(t,e,n){return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{b(s,t,u=>i.error(u));let d=v(s,k(S.readonly,t,i.error)).objectStore(t).index(e).get(n);d.onsuccess=u=>{i.next(u.target.result),i.complete()}}).catch(s=>i.error(s))})}getAll(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{b(n,t,c=>e.error(c));let a=v(n,k(S.readonly,t,e.error,e.next)).objectStore(t).getAll();a.onerror=c=>{e.error(c)},a.onsuccess=({target:{result:c}})=>{e.next(c),e.complete()}}).catch(n=>e.error(n))})}update(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,l=>n.error(l));let a=v(i,k(S.readwrite,t,l=>n.error(l))).objectStore(t),c=a.put(e);c.onsuccess=l=>I(this,null,function*(){let d=l.target.result,u=a.get(d);u.onsuccess=p=>{n.next(p.target.result),n.complete()}})}).catch(i=>n.error(i))})}delete(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,c=>n.error(c));let s=v(i,k(S.readwrite,t,c=>n.error(c)));s.objectStore(t).delete(e),s.oncomplete=()=>{this.getAll(t).pipe(se(1)).subscribe(c=>{n.next(c),n.complete()})}}).catch(i=>n.error(i))})}deleteByKey(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,c=>n.error(c));let s=v(i,k(S.readwrite,t,c=>n.error(c))),a=s.objectStore(t);s.oncomplete=()=>{n.next(!0),n.complete()},a.delete(e)}).catch(i=>n.error(i))})}clear(t){return new g(e=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(n=>{b(n,t,a=>e.error(a));let i=v(n,k(S.readwrite,t,a=>e.error(a)));i.objectStore(t).clear(),i.oncomplete=()=>{e.next(!0),e.complete()}}).catch(n=>e.error(n))})}deleteDatabase(){return new g(t=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(e=>I(this,null,function*(){yield e.close();let n=this.indexedDB.deleteDatabase(this.dbConfig.name);n.onsuccess=()=>{t.next(!0),t.complete()},n.onerror=i=>t.error(i),n.onblocked=()=>{throw new Error("Unable to delete database because it's blocked")}})).catch(e=>t.error(e))})}openCursor(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,l=>n.error(l));let a=v(i,k(S.readonly,t,n.error)).objectStore(t),c=e===void 0?a.openCursor():a.openCursor(e);c.onsuccess=l=>{n.next(l),n.complete()}}).catch(i=>n.error(i))})}openCursorByIndex(t,e,n,i=S.readonly){let s=new X;return m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{b(a,t,p=>{s.error(p)});let u=v(a,k(i,t,p=>{s.error(p)},()=>{s.next()})).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{s.next(p)}}).catch(a=>s.error(a)),s}getAllByIndex(t,e,n){let i=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{b(a,t,p=>s.error(p));let u=v(a,k(S.readonly,t,s.error)).objectStore(t).index(e).openCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(i.push(f.value),f.continue()):(s.next(i),s.complete())}}).catch(a=>s.error(a))})}getAllKeysByIndex(t,e,n){let i=[];return new g(s=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(a=>{b(a,t,p=>s.error(p));let u=v(a,k(S.readonly,t,s.error)).objectStore(t).index(e).openKeyCursor(n);u.onsuccess=p=>{let f=p.target.result;f?(i.push({primaryKey:f.primaryKey,key:f.key}),f.continue()):(s.next(i),s.complete())}}).catch(a=>s.error(a))})}count(t,e){return new g(n=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(i=>{b(i,t,l=>n.error(l));let c=v(i,k(S.readonly,t,n.error)).objectStore(t).count(e);c.onerror=l=>n.error(l),c.onsuccess=l=>{n.next(l.target.result),n.complete()}}).catch(i=>n.error(i))})}countByIndex(t,e,n){return new g(i=>{m(this.indexedDB,this.dbConfig.name,this.dbConfig.version).then(s=>{b(s,t,u=>i.error(u));let d=v(s,k(S.readonly,t,i.error)).objectStore(t).index(e).count(n);d.onerror=u=>i.error(u),d.onsuccess=u=>{i.next(u.target.result),i.complete()}}).catch(s=>i.error(s))})}deleteObjectStore(t){return pn(this.dbConfig.name,++this.dbConfig.version,t)}}return r.\u0275fac=function(t){return new(t||r)(h(dt),h(H))},r.\u0275prov=A({token:r,factory:r.\u0275fac}),r})(),pi=(()=>{class r{static forRoot(t){return{ngModule:r,providers:[Ce,{provide:dt,useValue:t}]}}}return r.\u0275fac=function(t){return new(t||r)},r.\u0275mod=L({type:r}),r.\u0275inj=F({imports:[[Be]]}),r})();var ht=(()=>{let o=class o{constructor(e){this.db=e,this.DATABASE="Categories"}saveCategoriesByChannelType(e,n){let i=this.getKey(n);return this.db.add(this.DATABASE,e,i).pipe(y(s=>e))}getCategoriesByChannelType(e){let n=this.getKey(e);return this.db.getByKey(this.DATABASE,n)}getKey(e){let n="";switch(e){case ue.Lazada:n="Lazada";break;case ue.Tokopedia:n="Tokopedia";break}return n}clearDatabase(){this.db.clear(this.DATABASE)}getHostName(){let e=localStorage.getItem("Authorization");return this.hostName=JSON.parse(e)?.Host,this.hostName}};o.\u0275fac=function(n){return new(n||o)(h(Ce))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var pt=(()=>{let o=class o{constructor(){}inititalizeIntercom(){let e=this.getFromLocalStorage();e?.Enabled&&window.Intercom("boot",{app_id:"xv1oomgl",name:e.Name,email:e.Email,created_at:e.Created,user_hash:e.Hash})}shutdown(){this.getFromLocalStorage()?.Enabled&&(window.Intercom("shutdown"),this.clearStorage())}clearStorage(){localStorage.removeItem("Intercom")}updateLocalStorage(e){let n={Enabled:!0};e&&(n=ie(ie({},n),e)),localStorage.setItem("Intercom",JSON.stringify(n))}getFromLocalStorage(){let e=localStorage.getItem("Intercom");return JSON.parse(e)}hideLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!0}),e.hide_default_launcher=!0,this.updateLocalStorage(e))}showLauncher(){let e=this.getFromLocalStorage();e?.Enabled&&(window.Intercom("update",{app_id:"xv1oomgl",hide_default_launcher:!1}),e.hide_default_launcher=!1,this.updateLocalStorage(e))}isHideLauncher(){let e=this.getFromLocalStorage();return $.IsEmpty(e?.hide_default_launcher)?!1:e?.hide_default_launcher}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var ft=(()=>{let o=class o{};o.SubmitConfig="/api/Channel/SubmitConfig",o.PosAccountTest="/api/POSAccount/Test",o.PosAccountRemove="/api/POSAccount/Remove",o.PosAccountGetConfig="/api/ChannelLoader/GetConfig",o.ChannelGetLastSyncByID="/api/Channel/GetLastSyncByID",o.GetChannel="/api/Channel/GetChannel",o.GetChannelLoader="/api/ChannelLoader/GetChannelLoader",o.TestShopID="/api/Channel/TestShopID",o.UpdateChannelIndex="/api/Channel/UpdateChannelIndex",o.DeleteChannel="/api/Channel/DeleteChannel",o.GetRegisterByOutletName="/api/Channel/GetRegistersByOutletOrder",o.GetChannelRowCount="/api/Channel/GetCountChannel",o.GetChannelWarehouse="/api/Channel/GetChannelWarehouseLocation",o.UnSynchronizedWarehouse="/api/Channel/UnSynchronizedWarehouse";let r=o;return r})();var gt=(()=>{let o=class o{constructor(){this.httpService=_e(Y)}update(e){if(e)this.updateLocalStorage(e);else{let n={RowCount:500,PageNumber:1};this.httpService.post(ft.GetChannel,n).pipe(y(i=>i?.Data)).subscribe(i=>{this.updateLocalStorage(i)})}}getChannels(){let e=localStorage.getItem("channels");return e?JSON.parse(e):[]}updateLocalStorage(e){let n=this.mappingChannelLocalStorage(e);localStorage.setItem("channels",JSON.stringify(n))}mappingChannelLocalStorage(e){return e.map(i=>({ID:i.ID,Name:i.Name,TypeID:i.TypeID,Img:$.getChannelLogoByTypeId(i.TypeID)}))}clearLocalStorage(){localStorage.removeItem("channels")}};o.\u0275fac=function(n){return new(n||o)},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();var ji=(()=>{let o=class o{constructor(e,n,i,s,a,c,l,d){this.httpService=e,this.tokenDecodeService=n,this.afAuth=i,this.ngxPermission=s,this.localDataService=a,this.router=c,this.intercomService=l,this.updateChannelStorageService=d}login(e){return this.httpService.post("/api/token/Login",e).pipe(G(n=>{this.setLocalStorage(n,e.Host,e.Username),this.loadPermissions()}))}getNews(){return this.httpService.get(Ue.news).pipe(y(e=>e?.items?.map(n=>n?.properties)))}loginWithGoogle(e,n){e.preventDefault();let i=new fe;return i.setCustomParameters({prompt:"select_account"}),R(this.afAuth.signInWithPopup(i)).pipe(y(s=>s.credential),y(s=>s.idToken),x(s=>this.httpService.post("/api/token/LoginWithSocialProvider",JSON.stringify({IDToken:s,Host:n}))),G(s=>{this.setLocalStorage(s,n,null),this.loadPermissions()}))}setLocalStorage(e,n,i){localStorage.setItem("user",JSON.stringify(e)),localStorage.setItem("Authorization",JSON.stringify({Host:n,username:i})),this.updateChannelStorageService.update(e.Channels),this.intercomService.updateLocalStorage(e.IntercomWidget),this.intercomService.inititalizeIntercom()}loadPermissions(){this.ngxPermission.loadPermissions([]);let e=localStorage.getItem("user");if($.IsNotEmpty(e)){let n=this.tokenDecodeService.GetRoles();this.ngxPermission.loadPermissions(n)}}getChannels(){return this.updateChannelStorageService.getChannels()}logout(){this.clearLocalStorage(),this.ngxPermission.flushPermissions()}isActiveToken(){let e=JSON.parse(window.localStorage.getItem("user")),n=new Date;if(e!=null){let i=new Date(e.Token.expiredAt);return n<i?!0:(this.clearLocalStorage(),!1)}else return!1}getDomain(){if(!this.domain){let e=localStorage.getItem("Authorization");this.domain="https://"+JSON.parse(e).Host}return this.domain}clearLocalStorage(){this.domain=null,localStorage.removeItem("user"),this.updateChannelStorageService.clearLocalStorage(),this.intercomService.shutdown(),this.localDataService.clearDatabase(),this.router.navigate([""])}};o.\u0275fac=function(n){return new(n||o)(h(Y),h(Je),h(ye),h(Ge),h(ht),h(Le),h(pt),h(gt))},o.\u0275prov=A({token:o,factory:o.\u0275fac,providedIn:"root"});let r=o;return r})();export{Ue as a,Je as b,Ko as c,ii as d,pi as e,ht as f,ft as g,gt as h,ji as i};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as re}from"./chunk-BGWVHGAY.js";import{b as le}from"./chunk-47PEHCOU.js";import{a as pe,b as me}from"./chunk-MKJON4UM.js";import{a as ee,b as te,d as ne,e as ie}from"./chunk-PYD2YWAN.js";import{
|
|
1
|
+
import{a as re}from"./chunk-BGWVHGAY.js";import{b as le}from"./chunk-47PEHCOU.js";import{a as pe,b as me}from"./chunk-MKJON4UM.js";import{a as ee,b as te,d as ne,e as ie}from"./chunk-PYD2YWAN.js";import{i as Z}from"./chunk-ADFSY63B.js";import{e as Y}from"./chunk-JHYIHRQH.js";import{m as ae,n as oe}from"./chunk-4CEFDQPI.js";import{h as G,m as K,y as Q}from"./chunk-2E5AKA74.js";import{c as X}from"./chunk-FTHTFVHH.js";import{$ as E,Bc as W,Cc as k,Dc as H,Fc as U,Ha as v,Ja as p,Jb as s,Kb as C,Lb as b,Nb as O,Ob as q,Pb as z,Q as D,Qb as A,Rb as V,T as w,_a as u,ab as h,ac as c,bc as d,cc as J,d as I,da as g,ga as N,hb as B,ib as T,kb as $,lb as F,mb as a,nb as o,oa as P,ob as f,pa as R,q as M,sb as j,vb as x,xb as y}from"./chunk-ZIZWZZ4E.js";import{a as S}from"./chunk-GNOSNGXM.js";var L=(()=>{let t=class t{constructor(){this.httpService=g(Y),this._pageination=new I({PageNumber:1,RowCount:100,ChannelID:null}),this.filter$=this._pageination.asObservable(),this.log$=this.filter$.pipe(w(n=>this.getLogs$(n).pipe()))}getLogs$(n){return this.httpService.post("/api/Channel/GetChannelLogPaged",n)}onPaginationChange(n){let e=this._pageination.value;e.PageNumber=n.pageIndex+1,this._pageination.next(e)}onFilter(n){let e=this._pageination.value;e.PageNumber=1,e=S(S({},e),n),this._pageination.next(e)}};t.\u0275fac=function(e){return new(e||t)},t.\u0275prov=E({token:t,factory:t.\u0275fac});let i=t;return i})();function ce(i,t){if(i&1&&(a(0,"span",10),f(1,"img",11),o(),s(2)),i&2){let l=t.item;p(),h("src",l.Img,v)("alt",l.Name),p(),b(" ",l.Name," ")}}function de(i,t){if(i&1&&(a(0,"tr")(1,"td"),f(2,"img",17),a(3,"span"),s(4),o()(),a(5,"td"),s(6),c(7,"json"),o(),a(8,"td"),s(9),c(10,"json"),o(),a(11,"td"),s(12),c(13,"date"),o()()),i&2){let l=t.$implicit;p(2),h("src",l.Img,v),p(2),b(" ",l.ChannelName," "),p(2),C(d(7,5,l.Request)),p(3),C(d(10,7,l.Response)),p(3),C(J(13,9,l.Created,"dd-MM-yyyy hh:mm:ss"))}}function he(i,t){if(i&1){let l=j();a(0,"div",8)(1,"table",12)(2,"thead")(3,"tr",13)(4,"th",14),s(5,"Channel"),o(),a(6,"th"),s(7,"Request"),o(),a(8,"th"),s(9,"Response"),o(),a(10,"th",15),s(11,"Created"),o()()(),a(12,"tbody"),$(13,de,14,12,"tr",null,T),c(15,"async"),o()(),a(16,"mat-paginator",16),c(17,"async"),c(18,"async"),c(19,"async"),c(20,"async"),x("page",function(e){P(l);let r=y();return R(r.channelLogService.onPaginationChange(e))}),o()()}if(i&2){let l,n,e,r,m=y();p(13),F((l=d(15,3,m.channelLogs$))==null?null:l.Data),p(3),h("length",(n=d(17,5,m.channelLogs$))==null?null:n.Count)("pageSize",(e=d(18,7,m.filter$))==null?null:e.RowCount)("pageIndex",(r=d(19,9,m.filter$))!=null&&r.PageNumber?0:((r=d(20,11,m.filter$))==null?null:r.PageNumber)-1)}}function ge(i,t){i&1&&(a(0,"div",9),f(1,"app-empty-state"),o())}var ze=(()=>{let t=class t{constructor(){this.channelLogService=g(L),this.authService=g(Z),this.channelOptions=this.authService.getChannels(),this.channelLogs$=this.channelLogService.log$.pipe(M(n=>(n.Data?n.Data=n.Data.map(e=>(e.Response=e.Response?JSON.parse(e.Response):"",e.Request=e.Request?JSON.parse(e.Request):"",e.Img=X.getChannelLogoByTypeId(e.TypeID),e)):n.Data=[],n)),D(1)),this.filter$=this.channelLogService.filter$}onSubmitFilter(){this.channelLogService.onFilter({ChannelID:this.channelID})}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=N({type:t,selectors:[["app-channel-log"]],standalone:!0,features:[A([L]),V],decls:15,vars:7,consts:[["headerTitle","Authorization Log",3,"onSubmit","hideSearchBox"],["container",""],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[1,"table","table-hover"],[1,"table-light"],[2,"width","250px"],[2,"width","150px"],[3,"page","length","pageSize","pageIndex"],[1,"me-2",2,"width","25px",3,"src"]],template:function(e,r){if(e&1&&(a(0,"mainpanel",0),x("onSubmit",function(){return r.onSubmitFilter()}),a(1,"filters")(2,"div",1)(3,"div")(4,"label",2),s(5,"Channel"),o(),a(6,"ng-select",3),z("ngModelChange",function(_){return q(r.channelID,_)||(r.channelID=_),_}),u(7,ce,3,3,"ng-template",4),o()()()(),a(8,"content")(9,"div",5)(10,"div",6)(11,"div",7),u(12,he,21,13,"div",8),c(13,"async"),u(14,ge,2,0,"div",9),o()()()()()),e&2){let m;h("hideSearchBox",!0),p(6),h("clearable",!0)("items",r.channelOptions),O("ngModel",r.channelID),p(6),B(((m=d(13,5,r.channelLogs$))==null||m.Data==null?null:m.Data.length)>0?12:14)}},dependencies:[U,W,H,k,oe,ae,re,me,pe,le,ie,ne,ee,te,Q,G,K]});let i=t;return i})();export{ze as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-L4BFVIW5.js";import{b as ie}from"./chunk-GNY5TY3R.js";import{a as ee,b as te}from"./chunk-7YWHTN3X.js";import{a as X}from"./chunk-
|
|
1
|
+
import{a as ne,b as oe,c as re,d as ae,e as le,f as pe,g as se}from"./chunk-L4BFVIW5.js";import{b as ie}from"./chunk-GNY5TY3R.js";import{a as ee,b as te}from"./chunk-7YWHTN3X.js";import{a as X}from"./chunk-UVQ3L5YK.js";import{i as Q}from"./chunk-ADFSY63B.js";import{e as J}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{m as Y,n as Z}from"./chunk-4CEFDQPI.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{c as G,h as z,m as K,y as q}from"./chunk-2E5AKA74.js";import"./chunk-FTHTFVHH.js";import{$ as D,$c as $,Fc as H,Ga as k,Ib as v,Ja as p,Jb as m,Ka as I,Kb as O,Lb as B,Nb as L,Ob as F,Pb as R,Qb as P,Tb as x,Xc as W,Zc as j,_a as c,aa as T,ab as s,ca as U,ga as C,ha as N,mb as o,nb as r,oa as g,ob as d,pa as h,pb as f,qb as _,sb as S,vb as y,xb as u,xc as w,yc as V,za as M,zc as A}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var ge=e=>[e];function he(e,t){if(e&1&&(f(0),o(1,"a",9),m(2),r(),_()),e&2){let a=t.$implicit;p(),s("routerLink",x(2,ge,a.url)),p(),B(" ",a.title,"")}}var ce=(()=>{let t=class t{constructor(){this.tabs=[{Title:"Download By Url",Url:"/menu/products/download/by-url",Description:"Download products information by product URL as a parameter"}],this.moreMenu=[{title:"Sold In Channel",url:"/menu/products/status/sold-in-channel"},{title:"In POS",url:"/menu/products/status/in-pos"},{title:"Not In Channel",url:"/menu/products/status/not-in-channel"},{title:"Duplicate SKU",url:"/menu/products/status/duplicate-sku"}]}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,selectors:[["app-download"]],decls:12,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid","d-flex","align-items-center","justify-content-between"],[3,"Tabs"],[1,"dropdown","me-6"],["role","button","data-bs-toggle","dropdown","aria-expanded","false",1,"text-dark"],[1,"fa-solid","fa-bars","fa-lg"],[1,"dropdown-menu","dropdown-menu-end","row"],[1,"d-block"],[4,"ngFor","ngForOf"],[1,"dropdown-item",3,"routerLink"]],template:function(i,l){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),d(3,"nav-tab",2),r()(),o(4,"div")(5,"div",3)(6,"a",4),d(7,"i",5),r(),o(8,"div",6)(9,"div",7),c(10,he,3,4,"ng-container",8),r()()()()(),d(11,"router-outlet")),i&2&&(p(3),s("Tabs",l.tabs),p(7),s("ngForOf",l.moreMenu))},dependencies:[w,ee,W,j]});let e=t;return e})();var E=(()=>{let t=class t{constructor(n){this.httpService=n}download(n){return this.httpService.post("/api/Product/downloadurl",n)}};t.\u0275fac=function(i){return new(i||t)(U(J))},t.\u0275prov=D({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var Ce=e=>({"background-color":e});function ye(e,t){if(e&1&&(o(0,"th"),m(1),r()),e&2){let a=t.$implicit;p(),O(a.column)}}function ve(e,t){if(e&1&&(f(0),o(1,"td"),d(2,"span",6),r(),_()),e&2){let a=t.$implicit,n=u().$implicit;p(2),s("innerHTML",n[a.prop],k)}}function xe(e,t){if(e&1&&(o(0,"tr",5),c(1,ve,3,1,"ng-container",3),r()),e&2){let a=t.$implicit,n=u();s("ngStyle",x(2,Ce,a.Status>200?"#F4D6D5":"#DEE9C9")),p(),s("ngForOf",n.configs)}}var de=(()=>{let t=class t{constructor(){this.eventClose=new M}ngOnInit(){}onClose(){this.eventClose.emit()}};t.\u0275fac=function(i){return new(i||t)},t.\u0275cmp=C({type:t,selectors:[["app-response-api-list"]],inputs:{configs:"configs",data:"data",status:"status"},outputs:{eventClose:"onClose"},decls:7,vars:2,consts:[[1,"table-responsive"],[1,"table"],[1,"thead-light"],[4,"ngFor","ngForOf"],[3,"ngStyle",4,"ngFor","ngForOf"],[3,"ngStyle"],[3,"innerHTML"]],template:function(i,l){i&1&&(o(0,"div",0)(1,"table",1)(2,"thead",2)(3,"tr"),c(4,ye,2,1,"th",3),r()(),o(5,"tbody"),c(6,xe,2,4,"tr",4),r()()()),i&2&&(p(4),s("ngForOf",l.configs),p(2),s("ngForOf",l.data))},dependencies:[w,A]});let e=t;return e})();function be(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onNewStepperState(l))}),d(2,"i",16),m(3," New "),r(),_()}}function Ee(e,t){if(e&1){let a=S();f(0),o(1,"button",15),y("click",function(){g(a),u();let i=v(11);return h(i.previous())}),m(2," Back "),r(),_()}}function Ie(e,t){if(e&1){let a=S();f(0),o(1,"button",17),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onStepperNext(l))}),m(2," Next "),r(),_()}}function De(e,t){if(e&1){let a=S();f(0),o(1,"button",18),y("click",function(){g(a);let i=u(),l=v(11);return h(i.onSubmit(l))}),m(2,"Download"),r(),_()}if(e&2){let a=u();p(),s("disabled",!a.urls)}}function Te(e,t){e&1&&(d(0,"i",19),o(1,"span"),m(2,"Instruction"),r())}function Ue(e,t){e&1&&(o(0,"div",20)(1,"div",21)(2,"div",22)(3,"h4",23),m(4,"Note"),r()(),o(5,"div",24)(6,"ol",25)(7,"li"),m(8," Use this form to Download Products from Tokopedia using product URL "),r(),o(9,"li"),m(10," Copy Product URL from "),o(11,"a",26),m(12,"https://seller.tokopedia.com/ "),r(),m(13," and paste in this form "),r(),o(14,"li"),m(15," Use New Line when you want to input several product URLs "),r()()()()())}function Ne(e,t){e&1&&(d(0,"i",27),o(1,"span"),m(2,"Download"),r())}function Me(e,t){if(e&1){let a=S();o(0,"div",20)(1,"textarea",28),R("ngModelChange",function(i){g(a);let l=u();return F(l.urls,i)||(l.urls=i),h(i)}),r()()}if(e&2){let a=u();p(),s("placeholder",a.urlPlaceholder),L("ngModel",a.urls)}}function ke(e,t){e&1&&(d(0,"i",29),o(1,"span"),m(2,"Finish"),r())}function Oe(e,t){if(e&1&&(o(0,"div",20),d(1,"app-response-api-list",30),r()),e&2){let a=u();p(),s("data",a.downloadResponses)("configs",a.configs)}}function Be(e,t){e&1&&(o(0,"h6"),m(1,"1"),r())}function Le(e,t){e&1&&(o(0,"h6"),m(1,"2"),r())}function Fe(e,t){e&1&&(o(0,"h6"),m(1,"3"),r())}var ue=(()=>{let t=class t{constructor(n,i){this.downloadService=n,this.authService=i,this.configs=[{column:"Url",prop:"URL"},{column:"POS",prop:"Name"},{column:"Exception",prop:"Message"}],this.downloadResponses=[],this.stepperState="DOWNLOAD",this.urlPlaceholder=`https://tokopedia.com/tokoriyanadi/kaos-polos-biru
|
|
2
2
|
https://tokopedia.com/tokoriyanadi/Celana-Chinos-Coklat`,this.currentDomain=this.authService.getDomain()}onStepperChange(n){this.stepperState=n.selectedStep.state}onSubmit(n){let i=this.urls.split(/\r?\n/);this.downloadService.download(i).subscribe(l=>{this.downloadResponses=l,this.mappingLinkToProduct(),this.onStepperNext(n)})}mappingLinkToProduct(){this.downloadResponses=this.downloadResponses.map(n=>(n.Name=n?.Name?`<a href="${this.currentDomain}/menu/Products/Catalog/Products/Info?ID=${n.ID}" target="_blank">
|
|
3
3
|
${n?.Name}
|
|
4
4
|
</a>`:"-",n))}onNewStepperState(n){this.downloadResponses=[],this.urls=null,this.stepperState="DOWNLOAD",n.reset(),this.onStepperNext(n)}onStepperNext(n){n.selected.completed=!0,n.next()}};t.\u0275fac=function(i){return new(i||t)(I(E),I(Q))},t.\u0275cmp=C({type:t,selectors:[["app-by-url"]],features:[P([{provide:ne,useValue:{displayDefaultIndicatorType:!1}}])],decls:24,vars:11,consts:[["stepper",""],["headerTitle","Tokopedia - Product Download By Url",3,"hideSearchBox","hideSearchDropdown"],[4,"ngIf"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-12"],["linear","",1,"stepper-downloadByUrl",3,"selectionChange","selectedIndex"],["state","GUIDE",3,"editable","completed"],["matStepLabel",""],["matStepContent",""],["state","DOWNLOAD",3,"editable","completed"],["state","FINISH"],["matStepperIcon","GUIDE"],["matStepperIcon","DOWNLOAD"],["matStepperIcon","FINISH"],[1,"btn","btn-outline-secondary","btn-fill","btn-lg",3,"click"],["aria-hidden","true",1,"fa","fa-file-alt","me-2"],["type","button",1,"btn","btn-outline-secondary","btn-fill","btn-lg","ms-3",3,"click"],["role","button",1,"btn","btn-success","btn-fill","btn-lg","text-white","ms-3",3,"click","disabled"],[1,"fa-solid","fa-info","me-3"],[1,"mt-8"],[1,"card","border","w-50"],[1,"card-header","py-6"],[1,"text-primary"],[1,"card-body",2,"padding-left","0px"],[1,"mt-6"],["href","https://seller.tokopedia.com","target","_blank"],[1,"fa-solid","fa-download","me-3"],["name","url","cols","30","rows","25",1,"form-control",3,"ngModelChange","placeholder","ngModel"],[1,"fa-sharp","fa-solid","fa-flag","me-3"],["status","error",3,"data","configs"]],template:function(i,l){if(i&1){let fe=S();o(0,"mainpanel",1)(1,"actions"),c(2,be,4,0,"ng-container",2)(3,Ee,3,0,"ng-container",2)(4,Ie,3,0,"ng-container",2)(5,De,3,1,"ng-container",2),r(),o(6,"content")(7,"div",3)(8,"div",4)(9,"div",5)(10,"mat-stepper",6,0),y("selectionChange",function(_e){return g(fe),h(l.onStepperChange(_e))}),o(12,"mat-step",7),c(13,Te,3,0,"ng-template",8)(14,Ue,16,0,"ng-template",9),r(),o(15,"mat-step",10),c(16,Ne,3,0,"ng-template",8)(17,Me,2,2,"ng-template",9),r(),o(18,"mat-step",11),c(19,ke,3,0,"ng-template",8)(20,Oe,2,2,"ng-template",9),r(),c(21,Be,2,0,"ng-template",12)(22,Le,2,0,"ng-template",13)(23,Fe,2,0,"ng-template",14),r()()()()()()}i&2&&(s("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),s("ngIf",l.stepperState=="FINISH"),p(),s("ngIf",l.stepperState=="DOWNLOAD"),p(),s("ngIf",l.stepperState=="GUIDE"),p(),s("ngIf",l.stepperState=="DOWNLOAD"),p(5),s("selectedIndex",1),p(2),s("editable",l.stepperState!="FINISH")("completed",!0),p(3),s("editable",l.stepperState!="FINISH")("completed",!1))},dependencies:[V,G,z,K,Y,le,oe,pe,re,ae,de],styles:[`@import"https://fonts.googleapis.com/icon?family=Material+Icons";.card-header{background-color:#00000008}mat-stepper.stepper-downloadByUrl>div.mat-horizontal-stepper-wrapper>div.mat-horizontal-stepper-header-container{position:relative;width:60%;left:18%}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b}from"./chunk-7YWHTN3X.js";import{a as r}from"./chunk-
|
|
1
|
+
import{a as v,b}from"./chunk-7YWHTN3X.js";import{a as r}from"./chunk-UVQ3L5YK.js";import"./chunk-ADFSY63B.js";import"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import"./chunk-FTHTFVHH.js";import{$c as i,Fc as o,Ja as s,Rb as f,Xc as h,aa as l,ab as u,ga as m,ha as c,mb as d,nb as C,ob as a}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var T=(()=>{let e=class e{constructor(){this.priceTabs=[{Title:"Single Channel Comparison",Url:"/menu/price/SingleChannel"},{Title:"Multi Channel Comparison",Url:"/menu/price/pos"},{Title:"Custom Channel Price",Url:"/menu/price/OutletPrice"}]}};e.\u0275fac=function(n){return new(n||e)},e.\u0275cmp=m({type:e,selectors:[["app-price"]],standalone:!0,features:[f],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(n,g){n&1&&(d(0,"nav",0)(1,"div",1)(2,"div"),a(3,"nav-tab",2),C()()(),a(4,"router-outlet")),n&2&&(s(3),u("Tabs",g.priceTabs))},dependencies:[o,b,v,i,h],encapsulation:2});let t=e;return t})();var P=[{path:"",component:T,children:[{path:"",redirectTo:"SingleChannel",pathMatch:"full"},{path:"pos",loadComponent(){return import("./chunk-W567C7KU.js").then(t=>t.PricePosChannelComponent)},canActivate:[r],data:{title:"Global Price Comparison"}},{path:"OutletPrice",loadComponent(){return import("./chunk-YLFH7OEU.js").then(t=>t.CustomChannelPriceComponent)},canActivate:[r],data:{title:"Outlet Price Comparison"}},{path:"SingleChannel",loadComponent(){return import("./chunk-DCBHZ5G4.js").then(t=>t.PriceSingleChannelComponent)},canActivate:[r],data:{title:"Price Single Channel Comparison"}}]}],D=(()=>{let e=class e{};e.\u0275fac=function(n){return new(n||e)},e.\u0275mod=c({type:e}),e.\u0275inj=l({imports:[o,i.forChild(P)]});let t=e;return t})();export{D as PriceRoutingModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as N}from"./chunk-QYY5XVLP.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-MZNSPLFO.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-ULELZXI5.js";import{a as De}from"./chunk-E5BOLHDG.js";import{a as Ve,b as Te}from"./chunk-A37OKNC2.js";import{a as be}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as Fe}from"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{a as fe,b as xe,d as Se,e as Pe}from"./chunk-PYD2YWAN.js";import{g as ue}from"./chunk-5FOPZ5IX.js";import{b as de,e as ge}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as we,m as ye,n as ve}from"./chunk-4CEFDQPI.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{b as oe,c as re,h as le,m as ce,o as se,y as pe}from"./chunk-2E5AKA74.js";import{c as me,e as he,f as Ce}from"./chunk-FTHTFVHH.js";import{Ab as H,B as A,Bc as ne,Ec as E,Fc as ie,Ha as D,Ib as J,Ic as ae,Ja as l,Jb as d,Ka as f,Kb as B,Lb as F,Nb as I,Ob as w,Pb as y,Q as $,Qb as Z,Rb as Q,Tb as V,X as j,_a as h,ab as p,ac as v,bc as T,cc as X,da as z,dc as Y,ga as G,hb as S,ib as k,kb as L,lb as R,mb as o,nb as c,oa as _,ob as P,pa as m,pb as q,qb as K,sb as x,vb as u,vc as ee,xb as r,yc as te}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Ue=i=>({"text-decoration-line-through":i}),Oe=i=>({"bg-gradient-warning":i}),We=i=>({"ms-10":i});function Ae(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),p("src",t==null?null:t.Img,D),l(),F(" ",t.Name," ")}}function $e(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){_(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function je(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,$e,3,0,"button",13),o(3,"button",14),u("click",function(){_(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),p("ngIf",e.productService.hasSelectionVariant(t))}}function ze(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){_(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function Ge(i,s){if(i&1){let t=x();o(0,"input",51),y("ngModelChange",function(n){_(t);let a=r(4).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){_(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function qe(i,s){if(i&1&&h(0,Ge,1,1,"ng-template",26),i&2){let t=r(6);p("ngxPermissionsOnly",V(1,O,t.rolePriceEdit))}}function Ke(i,s){if(i&1){let t=x();q(0),o(1,"img",52),u("click",function(n){_(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,D)}}function He(i,s){i&1&&P(0,"img",53)}function Je(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),F("(",t.Category,")")}}function Ze(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,qe,1,3,null,26),o(3,"div",46),h(4,Ke,2,1,"ng-container",47)(5,He,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Je,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;p("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),p("ngClass",V(8,We,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),p("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Qe(i,s){if(i&1){let t=x();o(0,"input",56),y("ngModelChange",function(n){_(t);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Xe(i,s){if(i&1&&(o(0,"td",54),h(1,Qe,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Ye(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function et(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.UnitPrice)," ")}}function tt(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),D)}}function nt(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){_(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function it(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,Ze,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Xe,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ye,2,0,"div",36)(11,et,3,3,"div")(12,tt,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,nt,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=_(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),p("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,Ue,t.Discontinued)),l(),F(" ",t.Code," "),l(),p("ngxPermissionsOnly",V(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),p("ngClass",V(16,Oe,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),p("href",t.Channel[0]==null?null:t.Channel[0].Url,D)}}function at(i,s){if(i&1&&L(0,it,22,18,"tr",33,k),i&2){let t=s.$implicit;R(t.Variants)}}function ot(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){_(t);let a=r(2);return w(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){_(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,ze,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){_(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",V(16,O,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),l(2),F(" ",X(24,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),l(3),R(t),l(2),p("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",T(29,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function rt(i,s){if(i&1){let t=x();o(0,"mainpanel",2),y("textChange",function(n){_(t);let a=r();return w(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){_(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ae,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),v(16,"async"),h(17,ot,30,18,"content",9),v(18,"async"),c()}if(i&2){let t=r();p("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),p("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),p("ngIf",T(16,9,t.data$)),l(2),p("ngIf",T(18,11,t.data$))}}var zt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,Le,Re,Be){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=Le,this.exportService=Re,this.decimalPipe=Be,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=_e.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>me.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(ge),f(de),f(Ie),f(be),f(Fe),f(N),f(ue),f(we),f(Ee),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([U,N,ae("https://res.cloudinary.com/"),E]),Q],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,rt,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,ve,ye,Pe,Se,fe,xe,pe,re,se,oe,le,ce,De,ke,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{zt as PriceSingleChannelComponent};
|
|
1
|
+
import{a as N}from"./chunk-QYY5XVLP.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-MZNSPLFO.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-ULELZXI5.js";import{a as De}from"./chunk-E5BOLHDG.js";import{a as Ve,b as Te}from"./chunk-A37OKNC2.js";import{a as be}from"./chunk-7VKIP3Z6.js";import"./chunk-DYLT6RRK.js";import{a as Fe}from"./chunk-D76K4RZ7.js";import"./chunk-EIBGI6U2.js";import{a as fe,b as xe,d as Se,e as Pe}from"./chunk-PYD2YWAN.js";import{i as ue}from"./chunk-ADFSY63B.js";import{b as de,e as ge}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as we,m as ye,n as ve}from"./chunk-4CEFDQPI.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{b as oe,c as re,h as le,m as ce,o as se,y as pe}from"./chunk-2E5AKA74.js";import{c as me,e as he,f as Ce}from"./chunk-FTHTFVHH.js";import{Ab as H,B as A,Bc as ne,Ec as E,Fc as ie,Ha as D,Ib as J,Ic as ae,Ja as l,Jb as d,Ka as f,Kb as B,Lb as F,Nb as I,Ob as w,Pb as y,Q as $,Qb as Z,Rb as Q,Tb as V,X as j,_a as h,ab as p,ac as v,bc as T,cc as X,da as z,dc as Y,ga as G,hb as S,ib as k,kb as L,lb as R,mb as o,nb as c,oa as _,ob as P,pa as m,pb as q,qb as K,sb as x,vb as u,vc as ee,xb as r,yc as te}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var O=i=>[i],Ue=i=>({"text-decoration-line-through":i}),Oe=i=>({"bg-gradient-warning":i}),We=i=>({"ms-10":i});function Ae(i,s){if(i&1&&(o(0,"span",10),P(1,"img",11),c(),d(2)),i&2){let t=s.item;l(),p("src",t==null?null:t.Img,D),l(),F(" ",t.Name," ")}}function $e(i,s){if(i&1){let t=x();o(0,"button",16),u("click",function(){_(t);let n=r().ngIf,a=r(2);return m(a.updateStock(n))}),P(1,"i",17),d(2," Update "),c()}}function je(i,s){if(i&1){let t=x();o(0,"actions")(1,"div",12),h(2,$e,3,0,"button",13),o(3,"button",14),u("click",function(){_(t);let n=r(2);return m(n.openExportDialog())}),P(4,"i",15),o(5,"span"),d(6,"Export"),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(2),p("ngIf",e.productService.hasSelectionVariant(t))}}function ze(i,s){if(i&1){let t=x();o(0,"th")(1,"input",32),u("change",function(n){_(t);let a=r().ngIf,g=r(2);return m(g.onSelectAllSKU(n.target.checked,a))}),c()()}}function Ge(i,s){if(i&1){let t=x();o(0,"input",51),y("ngModelChange",function(n){_(t);let a=r(4).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),u("ngModelChange",function(){_(t);let n=r(4).$implicit,a=r(3);return m(a.onCheckboxStateProduct(n))}),c()}if(i&2){let t=r(4).$implicit;I("ngModel",t.selected)}}function qe(i,s){if(i&1&&h(0,Ge,1,1,"ng-template",26),i&2){let t=r(6);p("ngxPermissionsOnly",V(1,O,t.rolePriceEdit))}}function Ke(i,s){if(i&1){let t=x();q(0),o(1,"img",52),u("click",function(n){_(t);let a=r(3).$implicit,g=r(3);return m(g.onZoomImage(n,a==null?null:a.ImageUrl))}),c(),K()}if(i&2){let t=r(3).$implicit;l(),H("src",t.ThumbnailUrl,D)}}function He(i,s){i&1&&P(0,"img",53)}function Je(i,s){if(i&1&&(o(0,"small",50),d(1),c()),i&2){let t=r(3).$implicit;l(),F("(",t.Category,")")}}function Ze(i,s){if(i&1&&(o(0,"td",44)(1,"div",45),h(2,qe,1,3,null,26),o(3,"div",46),h(4,Ke,2,1,"ng-container",47)(5,He,1,0,"ng-template",null,0,Y),c()()(),o(7,"td",48)(8,"span",49),d(9),c(),h(10,Je,2,1,"small",50),c()),i&2){let t=J(6),e=r(2).$implicit;p("rowSpan",e.Variants.length),l(2),S((e.Variants==null?null:e.Variants.length)>1?2:-1),l(),p("ngClass",V(8,We,(e.Variants==null?null:e.Variants.length)<=1)),l(),p("ngIf",e.ThumbnailUrl)("ngIfElse",t),l(3),p("rowSpan",e.Variants.length),l(2),B(e.Name),l(),S(e.Category?10:-1)}}function Qe(i,s){if(i&1){let t=x();o(0,"input",56),y("ngModelChange",function(n){_(t);let a=r(2).$implicit;return w(a.selected,n)||(a.selected=n),m(n)}),c()}if(i&2){let t=r(2).$implicit;I("ngModel",t.selected)}}function Xe(i,s){if(i&1&&(o(0,"td",54),h(1,Qe,1,1,"input",55),c()),i&2){let t=r().$implicit;l(),S(t.UnitPrice>=0?1:-1)}}function Ye(i,s){i&1&&(o(0,"div",36),d(1," Not Found "),c())}function et(i,s){if(i&1&&(o(0,"div"),d(1),v(2,"number"),c()),i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.UnitPrice)," ")}}function tt(i,s){if(i&1&&(o(0,"div",37)(1,"a",40),P(2,"i",57),c()()),i&2){let t=r().$implicit,e=r(4);l(),p("href",e.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(t==null?null:t.ID),D)}}function nt(i,s){if(i&1){let t=x();o(0,"div",58),u("click",function(){_(t);let n=r().$implicit,a=r().$implicit,g=r(2).ngIf,C=r();return m(C.openTableDialog(n,a,g))}),d(1),v(2,"number"),c()}if(i&2){let t=r().$implicit;l(),F(" ",T(2,1,t.Channel[0]==null?null:t.Channel[0].Price)," ")}}function it(i,s){if(i&1){let t=x();o(0,"tr",33),h(1,Ze,11,10),o(2,"td",24),d(3),c(),o(4,"td",27)(5,"span",34),d(6),c()(),h(7,Xe,2,1,"ng-template",26),o(8,"td",27)(9,"div",35),h(10,Ye,2,0,"div",36)(11,et,3,3,"div")(12,tt,3,1,"div",37),c()(),o(13,"td",38)(14,"div",35),h(15,nt,3,3,"div",39),o(16,"div",37)(17,"a",40),P(18,"i",41),c()(),o(19,"div",37)(20,"div",42),u("click",function(){let n=_(t).$implicit,a=r(4);return m(a.refreshPrice(n))}),P(21,"i",43),c()()()()()}if(i&2){let t=s.$implicit,e=s.$index,n=r(4);l(),S(e==0?1:-1),l(2),B(t.Model),l(2),p("matTooltip",t.Discontinued?n.discontinuedVariantMsg:"")("ngClass",V(12,Ue,t.Discontinued)),l(),F(" ",t.Code," "),l(),p("ngxPermissionsOnly",V(14,O,n.rolePriceEdit)),l(3),S((t.Channel[0]==null?null:t.Channel[0].Description)!=null?10:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?11:-1),l(),S((t.Channel[0]==null?null:t.Channel[0].Description)==null?12:-1),l(),p("ngClass",V(16,Oe,t.UnitPrice!=(t.Channel[0]==null?null:t.Channel[0].Price))),l(2),S(t.Channel.length>0?15:-1),l(2),p("href",t.Channel[0]==null?null:t.Channel[0].Url,D)}}function at(i,s){if(i&1&&L(0,it,22,18,"tr",33,k),i&2){let t=s.$implicit;R(t.Variants)}}function ot(i,s){if(i&1){let t=x();o(0,"content")(1,"div",18)(2,"div",19)(3,"table",20)(4,"thead",21)(5,"tr")(6,"th",22),d(7," Product "),o(8,"div")(9,"mat-slide-toggle",23),y("ngModelChange",function(n){_(t);let a=r(2);return w(a.toggleDifferentInventory,n)||(a.toggleDifferentInventory=n),m(n)}),u("toggleChange",function(){_(t);let n=r(2);return m(n.onToggleDifferentInventory())}),o(10,"small",7),d(11,"FILTER DIFFERENT PRICE"),c()()()(),o(12,"th",24),d(13,"Variant"),c(),o(14,"th",25),d(15,"SKU"),c(),h(16,ze,2,0,"ng-template",26),o(17,"th",27),d(18,"POS"),c(),o(19,"th",27)(20,"div",28),u("click",function(){_(t);let n=r(2);return m(n.openModalFilter())}),P(21,"img",29),o(22,"span",30),d(23),v(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),v(29,"async"),u("onNextPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(t);let n=r(2);return m(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(t);let n=r(2);return m(n.infinitePagination.getRowCount(n.searchFilter))}),c()()()()}if(i&2){let t=s.ngIf,e=r(2);l(9),I("ngModel",e.toggleDifferentInventory),l(7),p("ngxPermissionsOnly",V(16,O,e.rolePriceEdit)),l(4),p("matTooltip",(e.selectedChannel==null||e.selectedChannel.Name==null?null:e.selectedChannel.Name.length)>=20?e.selectedChannel==null?null:e.selectedChannel.Name:""),l(),p("src",e.selectedChannel==null?null:e.selectedChannel.Img,D),l(2),F(" ",X(24,11,e.selectedChannel==null?null:e.selectedChannel.Name,20)," "),l(3),R(t),l(2),p("totalData",e.infinitePagination.totalData())("hideCount",e.infinitePagination.hideCount())("rowCount",T(29,14,e.infinitePagination.totalRowCount$))("pageNumber",e.infinitePagination.pageNumber())("disableNextButton",e.infinitePagination.disableNextButton())("goToLastPage",e.infinitePagination.isLastPage())}}function rt(i,s){if(i&1){let t=x();o(0,"mainpanel",2),y("textChange",function(n){_(t);let a=r();return w(a.searchFilter.text,n)||(a.searchFilter.text=n),m(n)}),u("onSubmit",function(){_(t);let n=r();return m(n.onSearch())}),o(1,"filters")(2,"div")(3,"label",3),d(4,"Channel"),c(),o(5,"ng-select",4),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.ChannelID,n)||(a.searchFilter.ChannelID=n),m(n)}),h(6,Ae,3,2,"ng-template",5),c()(),o(7,"div",6)(8,"label",7),d(9,"Page Number"),c(),o(10,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.PageNumber,n)||(a.searchFilter.PageNumber=n),m(n)}),c()(),o(11,"div",6)(12,"label",7),d(13,"Page Size"),c(),o(14,"input",8),y("ngModelChange",function(n){_(t);let a=r();return w(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),v(16,"async"),h(17,ot,30,18,"content",9),v(18,"async"),c()}if(i&2){let t=r();p("headerTitle",t.pageTitle),I("text",t.searchFilter.text),l(5),p("clearable",!1)("items",t.channelOptions),I("ngModel",t.searchFilter.ChannelID),l(5),I("ngModel",t.searchFilter.PageNumber),l(4),I("ngModel",t.searchFilter.RowCount),l(),p("ngIf",T(16,9,t.data$)),l(2),p("ngIf",T(18,11,t.data$))}}var zt=(()=>{let s=class s{constructor(e,n,a,g,C,b,W,Le,Re,Be){this.http=e,this.toastr=n,this.dialog=a,this.productService=g,this.biggerPictureService=C,this.inventoryService=b,this.authService=W,this.mainPanelService=Le,this.exportService=Re,this.decimalPipe=Be,this.infinitePagination=z(U),this.pageTitle="Price Single Channel Comparison",this.toggleDifferentInventory=!1,this.loaderEndpoint="PriceLoader/Load",this.dataEndpoint="Price/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.rolePriceEdit=_e.price,this.discontinuedVariantMsg="This Variant is discontinued from POS, you must Non Active manually at the seller center so that it is not sold again on the channel.",this.hostName=this.authService.getDomain(),this.data$=this.infinitePagination.data$.pipe($(1)),this.channelOptions=W.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.dataEndpoint,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`).pipe(j(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=M.ALL,this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}))}onToggleDifferentInventory(){this.toggleDifferentInventory?this.searchFilter.filterModel=M.ALL:this.searchFilter.filterModel=M.DIFFERENCE,this.onSearch()}onCheckboxStateProduct(e){e.Variants=e.Variants.map(n=>(n.selected=e.selected,n))}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let a=this.productService.selectedVariantProduct(e).map(C=>({ID:C.ID,ChannelID:C.Channel[0].ChannelID,Code:C.Code,Price:C.UnitPrice})),g={ListChannelID:[this.searchFilter.ChannelID],ListPrice:a};this.http.post("/api/Price/UpdateChannel",g).subscribe(C=>{this.onSearch(),this.handlingUpdateStock(C.Response)})}handlingUpdateStock(e){if(e.success_list?.length>0||e.failure_list?.length>0){let n=e.failure_list,a=e.success_list;this.inventoryService.showToastrUpdateInventory("Price",a,n)}else this.toastr.error(e[0]?.Exception,"Error")}refreshPrice(e){let n={ChannelItemID:e?.Channel[0].ChannelItemID,ChannelVariationID:e?.Channel[0]?.ChannelVariationID,ChannelID:e?.Channel[0]?.ChannelID,VariantID:e.ID};this.http.post("/api/Price/RefreshPriceChannel",n).subscribe(a=>{this.toastr.success("Successfully updated","Success"),this.onSearch()})}onSearch(){this.infinitePagination.reloadPagination(this.searchFilter),this.initSelectedChannel()}openTableDialog(e,n,a){let g=JSON.parse(JSON.stringify(e));this.dialog.open(Ne,{data:{Name:n.Name,Variant:g,ChannelID:g?.Channel[0]?.ChannelID,Table:"price",ChannelItemID:g?.Channel[0]?.ChannelItemID}}).afterClosed().pipe(A(b=>me.IsNotEmpty(b))).subscribe(b=>{this.updateItemAfterDialog(b,e)})}updateItemAfterDialog(e,n){let a={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,Price:parseFloat(e.Price),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Price/UpdatePriceByID",a).subscribe(g=>{let C=this.productService.findChannelById(a.ID,this.channelOptions),b=a.Price?this.decimalPipe.transform(a.Price):a.Price;this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) price in ${C.Name} to ${b}`,"Success"),n.Channel[0]&&(n.Channel[0].Price=a.Price),this.infinitePagination.reloadPagination(this.searchFilter)})}initSelectedChannel(){this.selectedChannel=this.channelOptions.find(e=>e.ID==this.searchFilter.ChannelID)}onSelectAllSKU(e,n){n=n.map(a=>(a.Variants=a.Variants.map(g=>(g.selected=e,g)),a))}onZoomImage(e,n){this.biggerPictureService.openBiggerPicture(e,n)}openExportDialog(){this.dialog.open(Me,{data:{title:"Export Price Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,exportApi:"price/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}};s.\u0275fac=function(n){return new(n||s)(f(ge),f(de),f(Ie),f(be),f(Fe),f(N),f(ue),f(we),f(Ee),f(E))},s.\u0275cmp=G({type:s,selectors:[["app-price-single-channel"]],standalone:!0,features:[Z([U,N,ae("https://res.cloudinary.com/"),E]),Q],decls:2,vars:3,consts:[["elsePic",""],["class","single-price",3,"headerTitle","text","textChange","onSubmit",4,"ngIf"],[1,"single-price",3,"textChange","onSubmit","headerTitle","text"],[1,"fw-bold","mb-2"],["bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel","appendTo","body",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"mt-5"],[1,"fw-bold"],["type","number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src"],[1,"d-flex"],["class","btn btn-success",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],[1,"container-fluid","mt-5"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],["colspan","2",1,"text-center","ps-12",2,"width","36%"],["name","differentInventory",3,"ngModelChange","toggleChange","ngModel"],[1,"text-start"],[1,"text-end",2,"width","20%"],[3,"ngxPermissionsOnly"],[1,"text-end"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["type","checkbox",1,"me-3",3,"change"],[1,"w-100"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],[1,"ms-3"],[1,"text-end",3,"ngClass"],[2,"cursor","pointer"],["target","_blank",3,"href"],[1,"fas","external-link-custom","fa-solid","fa-arrow-up-right-from-square"],["matTooltip","Refresh Unit Price according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","external-link-custom","fa-sync","fa-lg"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"d-flex","align-items-center","justify-content-start"],[3,"ngClass"],[4,"ngIf","ngIfElse"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[1,"d-block"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],["loading","lazy",1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png","loading","lazy",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,rt,19,13,"mainpanel",1),v(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,ve,ye,Pe,Se,fe,xe,pe,re,se,oe,le,ce,De,ke,Ce,he,Te,Ve],styles:[".w-img[_ngcontent-%COMP%]{width:40px;height:40px}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}i.fas.custom-size[_ngcontent-%COMP%]{font-size:13px}.item-name[_ngcontent-%COMP%]{font-size:larger}"],changeDetection:0});let i=s;return i})();export{zt as PriceSingleChannelComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as T}from"./chunk-BZPMSXEO.js";import{a as w}from"./chunk-7VKIP3Z6.js";import{
|
|
1
|
+
import{a as T}from"./chunk-BZPMSXEO.js";import{a as w}from"./chunk-7VKIP3Z6.js";import{i as j}from"./chunk-ADFSY63B.js";import{b as D,e as d}from"./chunk-JHYIHRQH.js";import{b as a,c as g}from"./chunk-FTHTFVHH.js";import{$ as s,B as C,E as l,Va as I,Yc as U,d as P,da as c,n as u,q as b,w as A}from"./chunk-ZIZWZZ4E.js";var E=(()=>{let o=class o{constructor(){this.httpService=c(d)}getAttributes(t,e){return this.httpService.get("api/product/shopee/GetAttributesTree",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/shopee/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/shopee/AddProduct",t).pipe(l(r=>u(null)))}generateAttribute(t){return t.map(e=>({attribute_id:e.attribute_id,attribute_value_list:e.attribute_value_list.map(r=>({value_id:r.value_id,name:r.name}))})),t}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var F=(()=>{let o=class o{constructor(){this.httpService=c(d)}getCategories(t){return this.httpService.get("api/product/tiktok/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tiktok/AddProduct",t).pipe(l(r=>u(null)))}generateAttribute(t){let e;return t.map(r=>(r.type=="PRODUCT_PROPERTY"?e={id:r.id,name:r.name,type:r.type,values:r.values}:e={id:r.id,name:r.values[0].id,type:r.type},e))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var x=(()=>{let o=class o{constructor(){this.httpService=c(d)}getAttributes(t,e){return this.httpService.get("api/product/lazada/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/lazada/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/lazada/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var H=(()=>{let o=class o{constructor(){this.httpService=c(d)}getAttributes(t,e){return this.httpService.get("api/product/woo/GetAttributes",[{key:"ID",value:t},{key:"CategoryID",value:e}])}getCategories(t){return this.httpService.get("api/product/woo/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/woo/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var v=class{};var S=class{};var z=(()=>{let o=class o{constructor(){this.httpService=c(d)}getCategories(t){return this.httpService.get("api/product/tokopedia/GetCategories",[{key:"ID",value:t}])}uploadProduct(t){return this.httpService.post("api/product/tokopedia/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var R=(()=>{let o=class o{constructor(){this.httpService=c(d)}uploadProduct(t){return this.httpService.post("api/product/shopify/AddProduct",t).pipe(l(r=>u(null)))}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();var Ht=(()=>{let o=class o{constructor(){this.authService=c(j),this.productService=c(w),this.shoppeUploadService=c(E),this.tiktokUploadService=c(F),this.lazadaUploadService=c(x),this.tokopediaUploadService=c(z),this.wooUploadService=c(H),this.shopifyUploadService=c(R),this.toastrHandlingService=c(T),this.toastr=c(D),this.router=c(U),this.httpService=c(d),this._selectedProduct=new P(this.getStoredProducts()),this.selectedProduct$=this._selectedProduct.asObservable().pipe(C(t=>t&&t.length>0))}getStoredProducts(){let t=localStorage.getItem("productsUpload");if(t){let e=JSON.parse(t);return e&&e.length>0?e:[]}else return[]}setSelectedProduct(t){localStorage.setItem("productsUpload",JSON.stringify(t)),this._selectedProduct.next(t)}clearSelectedProduct(){localStorage.removeItem("productsUpload"),this._selectedProduct.next([])}getUnselectedChannels(){let t=this.authService.getChannels(),e=this._selectedProduct.getValue();return this.productService.filterUnselectedChannel(e,t)}getDefaultCategory(){return this.httpService.get("api/v1/Channel/ProductCategory/Default")}get channelProductUpload(){let t=this.getUnselectedChannels();return I(t.map(r=>{let p=new v;return p.id=r.ID,p.name=r.Name,p.type=r.TypeID,p.categoryId=null,p.attributes=[],p.selected=!1,p}))}onUploadProduct(t){let e=t.filter(r=>r.selected&&g.IsNotEmpty(r.categoryId)||r.selected&&r.type==a.Shopify);if(e.length>0){let r=this.generateDataForUpload(e);this.uploadProduct(r)}else this.toastr.warning("Please select a channel and category to upload the product.","Warning!")}uploadProduct(t){let e=this.generateObservableForUpload(t);A(e).pipe(b(r=>{let p=[];return r.forEach(m=>{p=[...p,...m]}),p})).subscribe({next:(r=[])=>{g.IsNotEmpty(r)&&this.toastrHandlingService.showToastrUploadMultiple(r),this.hasSuccessRes(r)&&this.onSuccessUpload()}})}hasSuccessRes(t){let e=!1;return t.forEach(r=>{r?.Response.Success_list?.length>0&&g.IsNotEmpty(r)&&(e=!0)}),e}onSuccessUpload(){this.router.navigate(["/menu/products/status/sold-in-channel"]),this.clearSelectedProduct()}generateObservableForUpload(t){let e=[],r=[],p=[],m=[],y=[],k=[];t.forEach(n=>{switch(n.ChannelType){case a.Shopee:r.push(n);break;case a.Tiktok:e.push(n);break;case a.Lazada:p.push(n);break;case a.Tokopedia:m.push(n);break;case a.WooCommerce:y.push(n);break;case a.Shopify:k.push(n);break}});let h=[];return[{type:a.Shopee,data:r},{type:a.Tiktok,data:e},{type:a.Lazada,data:p},{type:a.Tokopedia,data:m},{type:a.WooCommerce,data:y},{type:a.Shopify,data:k}].filter(n=>n.data.length>0).forEach(n=>{switch(n.type){case a.Shopee:h.push(this.shoppeUploadService.uploadProduct(r));break;case a.Tiktok:h.push(this.tiktokUploadService.uploadProduct(e));break;case a.Lazada:h.push(this.lazadaUploadService.uploadProduct(p));break;case a.Tokopedia:h.push(this.tokopediaUploadService.uploadProduct(m));break;case a.WooCommerce:h.push(this.wooUploadService.uploadProduct(y));break;case a.Shopify:h.push(this.shopifyUploadService.uploadProduct(k));break}}),h}generateDataForUpload(t){let e=[];return t.forEach(r=>{let p=new S;p.ChannelID=r.id,p.ChannelType=r.type,p.Products=this._selectedProduct.getValue(),r.type==a.Shopify?delete p.CategoryID:p.CategoryID=r.categoryId,r.type==a.WooCommerce||r.type==a.Shopify?p.Attribute=r.attributes[0]:p.Attributes=this.formatAttributes(r.type,r.attributes),e.push(p)}),e}formatAttributes(t,e){let r;switch(t){case a.Shopee:r=this.shoppeUploadService.generateAttribute(e);break;case a.Tiktok:r=this.tiktokUploadService.generateAttribute(e);break;case a.WooCommerce:r=this.tiktokUploadService.generateAttribute(e);break;case a.Tokopedia:r=e;break;case a.Shopify:r=e;break;default:r=[];break}return r}};o.\u0275fac=function(e){return new(e||o)},o.\u0275prov=s({token:o,factory:o.\u0275fac,providedIn:"root"});let i=o;return i})();export{E as a,F as b,x as c,H as d,Ht as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as me,e as se}from"./chunk-JHYIHRQH.js";import{b as M,c as A,h as de,i as _,j as S}from"./chunk-4CEFDQPI.js";import{c as w,e as N,h as R,i as ee,j as te,l as K,m as W,n as ne,p as oe,r as ie,v as re,w as le}from"./chunk-2E5AKA74.js";import{b as Y,c as ae}from"./chunk-FTHTFVHH.js";import{Ga as Q,Ha as B,Ib as F,Ja as m,Jb as s,Ka as C,Kb as P,Lb as H,Nb as D,Ob as G,Pb as O,Tb as k,_a as h,ab as u,ga as y,hb as T,mb as i,nb as r,oa as c,ob as b,pa as g,sb as U,vb as v,vc as q,xb as E,xc as X,yc as $}from"./chunk-ZIZWZZ4E.js";function ue(t,o){if(t&1&&(i(0,"tr")(1,"td")(2,"a",11),b(3,"img",12),i(4,"span"),s(5),r()()(),i(6,"td"),s(7),r(),i(8,"td"),s(9),r()()),t&2){let f=o.$implicit;m(2),u("href","/menu/channel/marketplace/view?ID="+f.Key.ID,B),m(),u("src",f.Logo,B),m(2),P(f.Key.Name),m(2),P(f.Value.Out),m(2),P(f.Value.Tg)}}var Ge=(()=>{let o=class o{constructor(l,n){this.dialogRef=l,this.data=n,this.generateChannelName(),this.channels=this.setChannelLogo(n.channels)}ngOnInit(){this.modalConfig=new _,this.modalConfig.title="Channel - New Order Configuration is not Unique!",this.modalConfig.headerType=de.Warning,this.modalConfig.hideOk=!0,this.modalConfig.cancelText="Close",this.modalConfig.customWidth="500px",this.modalConfig.bodyScrollable=!0,this.modalConfig.hideClose=!0}setChannelLogo(l){return l.map(n=>(n.Logo=ae.getChannelLogoByTypeId(n.Key.TypeID),n))}generateChannelName(){this.channelNames="";let l=this.data.channels;l.forEach((n,e)=>{this.channelNames+=`${n.Key} ${e!=l.length-1?" + ":""}`})}onClose(){this.dialogRef.close()}};o.\u0275fac=function(n){return new(n||o)(C(M),C(A))},o.\u0275cmp=y({type:o,selectors:[["app-modal-channel-warning"]],decls:24,vars:2,consts:[[3,"onCancel","onClose","config"],["content","",1,"pt-2","px-4"],[1,"row"],[1,"col-12"],[1,"lh-base","fs-5"],[1,"mb-4"],[1,"table","table-bordered"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"fs-5","mt-4"],["href","https://support.dealpos.com/en/articles/8281096-setup-multiple-channel-marketplace-to-one-warehouse-outlet","target","_blank"],["target","_blank",3,"href"],[1,"me-3",2,"width","24px",3,"src"]],template:function(n,e){n&1&&(i(0,"modal-material",0),v("onCancel",function(){return e.onClose()})("onClose",function(){return e.onClose()}),i(1,"div",1)(2,"div",2)(3,"div",3)(4,"p",4),s(5,"When your order configuration is not unique, your Dashboard Sales Report will be invalid. You can use either Outlet or Order Tag to differentiate Channel Order. "),r(),i(6,"h5",5),s(7,"Your duplicate Channels are"),r(),i(8,"table",6)(9,"thead")(10,"tr",7)(11,"th"),s(12,"Channel"),r(),i(13,"th"),s(14,"Outlet"),r(),i(15,"th"),s(16,"Tag"),r()()(),i(17,"tbody"),h(18,ue,10,5,"tr",8),r()(),i(19,"p",9),s(20," Please refer to this "),i(21,"a",10),s(22,"article"),r(),s(23," for more information "),r()()()()()),n&2&&(u("config",e.modalConfig),m(18),u("ngForOf",e.channels))},dependencies:[X,S]});let t=o;return t})();var Ue=(()=>{let o=class o{constructor(l,n,e){this.dialogRef=l,this.httpService=n,this.toastr=e,this.modalConfig=new _,this.modalConfig.title="Write Off Reason"}onSubmit(){let l={Name:this.reason};this.subscription=this.httpService.post("/api/channel/AddWriteoffOption",l).subscribe(n=>{this.toastr.success(n.Message,"Success"),this.dialogRef.close(l)})}onClose(){this.dialogRef.close(!1)}ngOnDestroy(){this.subscription.unsubscribe()}};o.\u0275fac=function(n){return new(n||o)(C(M),C(se),C(me))},o.\u0275cmp=y({type:o,selectors:[["app-dialog-writeOff-reason"]],decls:7,vars:3,consts:[["name","ngModel"],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"form-label-group"],["type","text","id","writeOffReason","placeholder","Write Off Reason","name","writeOffReason",1,"form-control",3,"ngModelChange","ngModel"],["for","shopid"]],template:function(n,e){if(n&1){let a=U();i(0,"modal-material",1),v("onClose",function(){return c(a),g(e.onClose())})("onCancel",function(){return c(a),g(e.onClose())})("onOk",function(){return c(a),g(e.onSubmit())}),i(1,"div",2)(2,"div",3)(3,"input",4,0),O("ngModelChange",function(p){return c(a),G(e.reason,p)||(e.reason=p),g(p)}),r(),i(5,"label",5),s(6,"Reason"),r()()()()}n&2&&(u("dynamicValidated",e.reason)("config",e.modalConfig),m(3),D("ngModel",e.reason))},dependencies:[w,R,W,S],styles:[".mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}"]});let t=o;return t})();var fe=t=>({invalid:t});function ce(t,o){t&1&&(i(0,"small"),s(1," URL is required "),r())}function ge(t,o){if(t&1&&(i(0,"div",13),h(1,ce,2,0,"small",14),r()),t&2){E();let f=F(10);m(),u("ngIf",f.errors.required)}}function Ce(t,o){t&1&&(i(0,"small"),s(1," Email is required "),r())}function he(t,o){t&1&&(i(0,"small"),s(1," Email is not valid "),r())}function _e(t,o){if(t&1&&(i(0,"div",13),h(1,Ce,2,0,"small",14)(2,he,2,0,"small",14),r()),t&2){E();let f=F(16);m(),u("ngIf",f.errors.required),m(),u("ngIf",f.errors.pattern)}}var We=(()=>{let o=class o{constructor(l){this.dialogRef=l}ngOnInit(){this.formData={URL:"",Email:""},this.initModalConfig()}initModalConfig(){this.modalConfig=new _,this.modalConfig.title="Fill data for Customer Support"}onSubmit(l){l!="Enter"&&this.dialogRef.close(this.formData)}onClose(){this.dialogRef.close()}};o.\u0275fac=function(n){return new(n||o)(C(M))},o.\u0275cmp=y({type:o,selectors:[["app-contact-support"]],decls:18,vars:9,consts:[["url","ngModel"],["email","ngModel"],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"mx-4"],["for","customerURL"],[1,"input-group","mb-2"],[1,"input-group-prepend"],["id","tokopediaUrl",1,"border-start-0","rounded-start","input-group-text","pointer-default","bg-light",2,"height","58px",3,"ngClass"],["required","","type","text","id","customerURL","name","customerURL","title","customerURL",1,"form-control","border-start-0","customerUrl",3,"ngModelChange","ngModel"],["class","text-danger",4,"ngIf"],["for","customerEmail"],["required","","type","text","id","customerEmail","name","customerEmail","title","customerEmail","pattern","\\b[\\w\\.-]+@[\\w\\.-]+\\.\\w{2,4}\\b",1,"form-control",3,"ngModelChange","ngModel"],[1,"text-danger"],[4,"ngIf"]],template:function(n,e){if(n&1){let a=U();i(0,"modal-material",2),v("onClose",function(){return c(a),g(e.onClose())})("onCancel",function(){return c(a),g(e.onClose())})("onOk",function(p){return c(a),g(e.onSubmit(p))}),i(1,"div",3)(2,"div",4)(3,"label",5),s(4,"Tokopedia URL"),r(),i(5,"div",6)(6,"div",7)(7,"span",8),s(8,"https://tokopedia.com/"),r()(),i(9,"input",9,0),O("ngModelChange",function(p){return c(a),G(e.formData.URL,p)||(e.formData.URL=p),g(p)}),r()(),h(11,ge,2,1,"div",10),i(12,"label",11),s(13,"Requester's Email"),r(),i(14,"div",6)(15,"input",12,1),O("ngModelChange",function(p){return c(a),G(e.formData.Email,p)||(e.formData.Email=p),g(p)}),r()(),h(17,_e,3,2,"div",10),r()()()}if(n&2){let a=F(10),d=F(16);u("dynamicValidated",!a.invalid&&!d.invalid)("config",e.modalConfig),m(7),u("ngClass",k(7,fe,a.invalid&&(a.dirty||a.touched))),m(2),D("ngModel",e.formData.URL),m(2),u("ngIf",a.invalid&&(a.dirty||a.touched)),m(4),D("ngModel",e.formData.Email),m(2),u("ngIf",d.invalid&&(d.dirty||d.touched))}},dependencies:[q,$,w,R,re,le,W,S],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.input-group[_ngcontent-%COMP%] > input[_ngcontent-%COMP%]{height:3.625rem;padding:.75rem;color:#343434;font-size:.875rem;border-radius:.25rem!important;border-color:#c8d3df}.input-group[_ngcontent-%COMP%] > input.ng-invalid.ng-touched[_ngcontent-%COMP%]{border-color:#fb404b}.input-group[_ngcontent-%COMP%] > input.customerUrl[_ngcontent-%COMP%]{border-top-left-radius:0!important;border-bottom-left-radius:0!important}.invalid[_ngcontent-%COMP%]{border-color:#fb404b}.pointer-default[_ngcontent-%COMP%]{cursor:default}"]});let t=o;return t})();var Pe=(()=>{let o=class o{constructor(l,n){this.dialogRef=l,this.data=n}ngOnInit(){this.initModalConfig()}initModalConfig(){this.modalConfig=new _,this.modalConfig.title=this.data?.title,this.modalConfig.okText="SAVE"}onSubmit(){this.dialogRef.close(this.shopID)}onClose(){this.dialogRef.close()}};o.\u0275fac=function(n){return new(n||o)(C(M),C(A))},o.\u0275cmp=y({type:o,selectors:[["app-modal-dialog-tokopedia"]],decls:7,vars:3,consts:[["name","ngModel"],[3,"onClose","onCancel","onOk","dynamicValidated","config"],["content",""],[1,"form-label-group"],["type","text","id","shopid","placeholder","Shop ID","name","ShopID","data-toggle","tooltip","title","Channel Name",1,"form-control",3,"ngModelChange","ngModel"],["for","shopid"]],template:function(n,e){if(n&1){let a=U();i(0,"modal-material",1),v("onClose",function(){return c(a),g(e.onClose())})("onCancel",function(){return c(a),g(e.onClose())})("onOk",function(){return c(a),g(e.onSubmit())}),i(1,"div",2)(2,"div",3)(3,"input",4,0),O("ngModelChange",function(p){return c(a),G(e.shopID,p)||(e.shopID=p),g(p)}),r(),i(5,"label",5),s(6,"Shop ID"),r()()()()}n&2&&(u("dynamicValidated",e.shopID)("config",e.modalConfig),m(3),D("ngModel",e.shopID))},dependencies:[w,R,W,S],styles:["mat-form-field[_ngcontent-%COMP%]{width:100%;height:100%}.mat-dialog-title[_ngcontent-%COMP%]{margin-bottom:0%;margin-left:24px}.vertical-radio[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin:15px 0}"]});let t=o;return t})();var J=t=>({"is-invalid":t});function ye(t,o){t&1&&(i(0,"div"),s(1,"Please input with shopify domain. example mystore.myshopify.com"),r())}function ve(t,o){if(t&1&&(i(0,"div"),s(1),r()),t&2){let f=E(2);m(),H("",f.data==null?null:f.data.title," url is required")}}function Me(t,o){if(t&1&&(i(0,"div",6),h(1,ye,2,0,"div")(2,ve,2,1,"div"),r()),t&2){let f,l,n=E();m(),T(!(n.formGroup==null||(f=n.formGroup.get("URL"))==null)&&f.getError("pattern")?1:-1),m(),T(!(n.formGroup==null||(l=n.formGroup.get("URL"))==null)&&l.getError("required")?2:-1)}}function Se(t,o){t&1&&(i(0,"div",6),s(1," Consumer Key is required "),r())}function we(t,o){t&1&&(i(0,"div",6),s(1," Consumer Secret is required "),r())}function Re(t,o){if(t&1&&b(0,"div",11),t&2){let f=E();u("innerHTML",f.data.article,Q)}}var He=(()=>{let o=class o{constructor(l,n){this.dialogRef=l,this.data=n,this.modalConfig=new _,this.shopifyRegex=new RegExp("^[a-zA-Z0-9-]+.myshopify.com/?$"),this.urlCtrl=new K(null,N.pattern(this.shopifyRegex)),this.channelType=Y}ngOnInit(){this.initModalConfig(),this.initFormGroup()}initFormGroup(){let l=[N.required];this.data.channelType===Y.Shopify&&l.push(N.pattern(this.shopifyRegex)),this.formGroup=new te({URL:new K(null,l),ConsumerKey:new K(null,[N.required]),ConsumerSecret:new K(null,[N.required])})}initModalConfig(){this.modalConfig=new _,this.modalConfig.title=this.data.title,this.modalConfig.okText="SAVE"}onClose(){this.dialogRef.close()}onSubmit(){this.formGroup.markAllAsTouched();let l=this.formGroup?.get("URL")?.getError("pattern"),n=this.formGroup?.get("ConsumerKey")?.valid,e=this.formGroup?.get("ConsumerSecret")?.valid;(this.formGroup?.valid||l&&n&&e)&&this.dialogRef.close(this.formGroup.value)}};o.\u0275fac=function(n){return new(n||o)(C(M),C(A))},o.\u0275cmp=y({type:o,selectors:[["app-modal-register-channel"]],decls:19,vars:17,consts:[[3,"onClose","onCancel","onOk","config"],["content",""],[3,"formGroup"],[1,"form-label-group","has-validation"],["type","text","id","shopid","name","URL","title","URL","formControlName","URL",1,"form-control",3,"placeholder","ngClass"],["for","shopid"],[1,"invalid-feedback"],["type","text","id","ConsumerKey","placeholder","Consumer Key","name","ConsumerKey","title","ConsumerKey","formControlName","ConsumerKey",1,"form-control",3,"ngClass"],["for","ConsumerKey"],["type","text","id","ConsumerSecret","placeholder","Consumer Secret","name","ConsumerSecret","title","ConsumerSecret","formControlName","ConsumerSecret",1,"form-control",3,"ngClass"],["for","ConsumerSecret"],[3,"innerHTML"]],template:function(n,e){if(n&1&&(i(0,"modal-material",0),v("onClose",function(){return e.onClose()})("onCancel",function(){return e.onClose()})("onOk",function(){return e.onSubmit()}),i(1,"div",1)(2,"form",2)(3,"div",3),b(4,"input",4),i(5,"label",5),s(6),r(),h(7,Me,3,2,"div",6),r(),i(8,"div",3),b(9,"input",7),i(10,"label",8),s(11,"Consumer Key"),r(),h(12,Se,2,0,"div",6),r(),i(13,"div",3),b(14,"input",9),i(15,"label",10),s(16,"Consumer Secret"),r(),h(17,we,2,0,"div",6),r()(),h(18,Re,1,1,"div",11),r()()),n&2){let a,d,p,V,I,L;u("config",e.modalConfig),m(2),u("formGroup",e.formGroup),m(2),u("placeholder",(e.data==null?null:e.data.channelType)==e.channelType.Shopify?"Default Url Shopify":"Url")("ngClass",k(11,J,(e.formGroup==null||(a=e.formGroup.get("URL"))==null?null:a.invalid)&&((e.formGroup==null||(a=e.formGroup.get("URL"))==null?null:a.dirty)||(e.formGroup==null||(a=e.formGroup.get("URL"))==null?null:a.touched)))),m(2),H(" ",(e.data==null?null:e.data.channelType)==e.channelType.Shopify?"Default Url Shopify":"Url"," "),m(),T(!(e.formGroup==null||(d=e.formGroup.get("URL"))==null)&&d.invalid&&(!(e.formGroup==null||(d=e.formGroup.get("URL"))==null)&&d.dirty||!(e.formGroup==null||(d=e.formGroup.get("URL"))==null)&&d.touched)?7:-1),m(2),u("ngClass",k(13,J,(e.formGroup==null||(p=e.formGroup.get("ConsumerKey"))==null?null:p.invalid)&&((e.formGroup==null||(p=e.formGroup.get("ConsumerKey"))==null?null:p.dirty)||(e.formGroup==null||(p=e.formGroup.get("ConsumerKey"))==null?null:p.touched)))),m(3),T(!(e.formGroup==null||(V=e.formGroup.get("ConsumerKey"))==null)&&V.getError("required")&&(!(e.formGroup==null||(V=e.formGroup.get("ConsumerKey"))==null)&&V.dirty||!(e.formGroup==null||(V=e.formGroup.get("ConsumerKey"))==null)&&V.touched)?12:-1),m(2),u("ngClass",k(15,J,(e.formGroup==null||(I=e.formGroup.get("ConsumerSecret"))==null?null:I.invalid)&&((e.formGroup==null||(I=e.formGroup.get("ConsumerSecret"))==null?null:I.dirty)||(e.formGroup==null||(I=e.formGroup.get("ConsumerSecret"))==null?null:I.touched)))),m(3),T(!(e.formGroup==null||(L=e.formGroup.get("ConsumerSecret"))==null)&&L.getError("required")&&(!(e.formGroup==null||(L=e.formGroup.get("ConsumerSecret"))==null)&&L.dirty||!(e.formGroup==null||(L=e.formGroup.get("ConsumerSecret"))==null)&&L.touched)?17:-1),m(),T(e.data.article?18:-1)}},dependencies:[q,ne,w,R,ee,S,oe,ie]});let t=o;return t})();export{Ge as a,Ue as b,We as c,Pe as d,He as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as u}from"./chunk-7YWHTN3X.js";import{a as f}from"./chunk-
|
|
1
|
+
import{b as u}from"./chunk-7YWHTN3X.js";import{a as f}from"./chunk-UVQ3L5YK.js";import"./chunk-ADFSY63B.js";import"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{n as l}from"./chunk-4CEFDQPI.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{y as d}from"./chunk-2E5AKA74.js";import"./chunk-FTHTFVHH.js";import{$c as m,Fc as n,Xc as c,aa as r,ga as s,ha as i,ob as a}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var M=(()=>{let t=class t{constructor(){}};t.\u0275fac=function(e){return new(e||t)},t.\u0275cmp=s({type:t,selectors:[["app-report"]],decls:1,vars:0,template:function(e,O){e&1&&a(0,"router-outlet")},dependencies:[c],styles:["ul[_ngcontent-%COMP%] > li.dropdown-item[_ngcontent-%COMP%]{font-size:.6875rem!important}"]});let o=t;return o})();var y=[{path:"",component:M,children:[{path:"",redirectTo:"order",pathMatch:"full"},{path:"order",loadChildren:()=>import("./chunk-EOKKINSN.js").then(o=>o.OrderModule),canActivate:[f]}]}],C=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i({type:t}),t.\u0275inj=r({imports:[n,m.forChild(y)]});let o=t;return o})();var b=(()=>{let t=class t{};t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=i({type:t}),t.\u0275inj=r({imports:[n,u,C,d,l,m]});let o=t;return o})();export{b as ReportModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _}from"./chunk-HHIG3XFB.js";import"./chunk-6U6JR5K6.js";import{a as de,b as ce}from"./chunk-7YWHTN3X.js";import"./chunk-CJILX5R7.js";import"./chunk-KZ6AD6KW.js";import"./chunk-DYLT6RRK.js";import{a as R}from"./chunk-EKA76B4K.js";import"./chunk-BTY6PS53.js";import"./chunk-EIBGI6U2.js";import"./chunk-5FOPZ5IX.js";import{e as se}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{m as D,n as pe}from"./chunk-4CEFDQPI.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{y as me}from"./chunk-2E5AKA74.js";import{c as f}from"./chunk-FTHTFVHH.js";import{$ as J,$c as le,Ab as U,Bc as ie,Cc as w,Ec as re,Fc as ne,Ha as G,Ja as m,Jb as c,Ka as h,Kb as N,Lb as Z,Nb as u,Ob as y,Pb as g,Q as V,Sb as $,X as H,Xb as ee,Xc as oe,Zc as ae,_a as v,aa as Q,ab as p,ac as A,bc as j,ca as K,eb as X,ga as S,ha as z,mb as o,na as q,nb as a,ob as C,rb as Y,vb as b,xb as T,xc as te,yc as P}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var fe=(()=>{let r=class r{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/order/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/order/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/order/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/order/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/order/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/order/void-invoice"},{Title:"All",Url:"/menu/sync-log/order/all"}]}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=S({type:r,selectors:[["app-order"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(i,t){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),a()()(),C(4,"router-outlet")),i&2&&(m(3),p("Tabs",t.reportTabs))},dependencies:[de,oe],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]});let n=r;return n})();var F=class{};var I=(()=>{let r=class r{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((i,t)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/CreateInvoice",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncVoidInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/Void",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncConvertInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/ConvertToInvoice",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncDelivery(e){return new Promise((i,t)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncPayment(e){return new Promise((i,t)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(d=>{i(d)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}};r.\u0275fac=function(i){return new(i||r)(K(se))},r.\u0275prov=J({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var L=function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n}(L||{});var _e=()=>["/menu/log/order"],Fe=(n,r,s,e,i)=>({responseCode:n,From:r,to:s,actionType:e,ChannelID:i});function be(n,r){if(n&1&&(o(0,"th",9)(1,"div",10)(2,"h4"),c(3),a(),o(4,"small",11),c(5),a()()()),n&2){let s=r.$implicit,e=T();m(3),N(s),m(),X(e.getTextBgColor(s)),m(),N(e.getHeaderStatusDesc(s))}}function Pe(n,r){if(n&1&&(o(0,"td",14)(1,"a",15),c(2),a()()),n&2){let s=r.$implicit,e=T().$implicit,i=T();m(),p("routerLink",$(3,_e))("queryParams",ee(4,Fe,s.Key,i.fromQueryParam,i.toQueryParam,i.type,e.ChannelID)),m(),Z(" ",s.Value," ")}}function we(n,r){if(n&1&&(o(0,"tr")(1,"td")(2,"a",12),C(3,"img",13),a()(),o(4,"td")(5,"div")(6,"a",12),c(7),a()(),o(8,"div"),c(9),a()(),v(10,Pe,3,10,"td",8),a()),n&2){let s=r.$implicit,e=T();m(2),U("href",s.Url,G),m(),p("src",e.getChannelLogo(s.Type),G),m(3),U("href",s.Url,G),m(),N(s.Name),m(2),N(s.Url),m(),p("ngForOf",s.list)}}function De(n,r){if(n&1&&(o(0,"td",14)(1,"div",16),c(2),A(3,"number"),a()()),n&2){let s=r.$implicit;m(2),N(j(3,1,s.total))}}var E=(()=>{let r=class r{constructor(){this.type=null,this.headerStatus=L,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}ngOnChanges(e){e.result&&this.calculateStatusCode()}getHeaderStatusDesc(e){let i=null;switch(e){case L.BAD_REQUEST:i="BAD REQUEST";break;case L.CONFLICT:i="CONFLICT";break;case L.INTERNAL_SERVER_ERROR:i="INTERNAL SERVER ERROR";break;case L.NOT_FOUND:i="NOT FOUND";break;default:i="OK";break}return i}getTextBgColor(e){let i=null;switch(e){case L.OK:i="bg-success";break;case L.INTERNAL_SERVER_ERROR:i="bg-danger";break;default:i="bg-warning";break}return i}getChannelLogo(e){return f.getChannelLogoByTypeId(e)}calculateStatusCode(){if(this.listCalculationStatusCode=[],this.result){let e,i;this.concatStatusCode().forEach(t=>{e=this.listCalculationStatusCode.findIndex(d=>d.status==t.Key),i=e!==-1,i?this.listCalculationStatusCode[e].total+=t.Value:this.listCalculationStatusCode=[...this.listCalculationStatusCode,{status:t.Key,total:t.Value}]})}}concatStatusCode(){return this.result.map(e=>e.list).reduce((e,i)=>[...e,...i])}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=S({type:r,selectors:[["app-table-report"]],inputs:{header:"header",result:"result",from:"from",to:"to",type:"type"},features:[q],decls:15,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%;",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(i,t){i&1&&(o(0,"table",0)(1,"thead",1)(2,"tr"),C(3,"th",2),o(4,"th",3),c(5,"Channel"),a(),v(6,be,6,4,"th",4),a()(),o(7,"tbody"),v(8,we,11,6,"tr",5),a(),o(9,"tfoot")(10,"tr")(11,"td",6)(12,"div",7),c(13,"Total"),a()(),v(14,De,4,3,"td",8),a()()()),i&2&&(m(6),p("ngForOf",t.header),m(2),p("ngForOf",t.result),m(6),p("ngForOf",t.listCalculationStatusCode))},dependencies:[te,ae,re],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]});let n=r;return n})();function Ie(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",0)}}var he=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.pageTitle="New Order";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-sales-order"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.getChannelLogs()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Ie,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.pageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Ee(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",1)}}var ue=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-invoice"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Ee,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Oe(n,r){if(n&1&&(o(0,"div",8)(1,"div",9),C(2,"app-table-report",10),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",3)}}var ye=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F;let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-delivery"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"filterDate"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div",1)(3,"label",2),c(4,"From/To"),a(),o(5,"div",3)(6,"datepicker",4),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",5),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",6),v(11,Oe,3,5,"div",7),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Le(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",4)}}var ge=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Completed";let t=new Date;this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-payment"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Le,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Re(n,r){n&1&&Y(0)}function Me(n,r){if(n&1&&(o(0,"div",8)(1,"div",9),C(2,"app-table-report",10),a()()),n&2){let s=r.ngIf,e=T();m(2),p("result",s.Body)("header",s.Header)("from",e.filter==null?null:e.filter.From)("to",e.filter==null?null:e.filter.To)}}var ve=(()=>{let r=class r{constructor(e,i){this.reportOrderService=e,this.datePipe=i,this.filter=new F}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":i+"-"} ${t})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe(H(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(V())}onFilter(){this.updatePageTitle(),this.initData()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-all"]],decls:15,vars:10,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Re,1,0,"ng-container",6),A(12,"async"),v(13,Me,3,4,"div",7),A(14,"async"),a()()()),i&2&&(p("headerTitle",t.pageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",j(12,6,t.pageLoader$)),m(2),p("ngIf",j(14,8,t.reportData$)))},dependencies:[P,D,_,E,ie]});let n=r;return n})();function ke(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",1)}}var Ce=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Convert Sales Order To Invoice";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Convert Sales Order To Invoice (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-convert-invoice"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,ke,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function xe(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",1)}}var Te=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-void-invoice"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,xe,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();var Ne=[{path:"",component:fe,children:[{path:"",redirectTo:"sync-order",pathMatch:"full"},{path:"sync-order",component:he,canActivate:[R],data:{title:"Sync Order"}},{path:"convert-to-invoice",component:Ce,canActivate:[R],data:{title:"Sync Convert to Invoice"}},{path:"invoice",component:ue,canActivate:[R],data:{title:"Sync Invoice"}},{path:"delivery",component:ye,canActivate:[R],data:{title:"Sync Delivery"}},{path:"payment",component:ge,canActivate:[R],data:{title:"Sync Payment"}},{path:"void-invoice",component:Te,canActivate:[R],data:{title:"Sync void invoice"}},{path:"all",component:ve,canActivate:[R],data:{title:"All Report"}}]}],Et=(()=>{let r=class r{};r.\u0275fac=function(i){return new(i||r)},r.\u0275mod=z({type:r}),r.\u0275inj=Q({imports:[ne,ce,me,pe,_,le.forChild(Ne)]});let n=r;return n})();export{Et as OrderModule};
|
|
1
|
+
import{a as _}from"./chunk-HHIG3XFB.js";import"./chunk-6U6JR5K6.js";import{a as de,b as ce}from"./chunk-7YWHTN3X.js";import"./chunk-CJILX5R7.js";import"./chunk-KZ6AD6KW.js";import"./chunk-DYLT6RRK.js";import{a as R}from"./chunk-UVQ3L5YK.js";import"./chunk-BTY6PS53.js";import"./chunk-EIBGI6U2.js";import"./chunk-ADFSY63B.js";import{e as se}from"./chunk-JHYIHRQH.js";import"./chunk-KCDL7SWP.js";import{m as D,n as pe}from"./chunk-4CEFDQPI.js";import"./chunk-2SC3HO66.js";import"./chunk-DQIP7MCZ.js";import{y as me}from"./chunk-2E5AKA74.js";import{c as f}from"./chunk-FTHTFVHH.js";import{$ as J,$c as le,Ab as U,Bc as ie,Cc as w,Ec as re,Fc as ne,Ha as G,Ja as m,Jb as c,Ka as h,Kb as N,Lb as Z,Nb as u,Ob as y,Pb as g,Q as V,Sb as $,X as H,Xb as ee,Xc as oe,Zc as ae,_a as v,aa as Q,ab as p,ac as A,bc as j,ca as K,eb as X,ga as S,ha as z,mb as o,na as q,nb as a,ob as C,rb as Y,vb as b,xb as T,xc as te,yc as P}from"./chunk-ZIZWZZ4E.js";import"./chunk-GNOSNGXM.js";var fe=(()=>{let r=class r{constructor(){this.reportTabs=[{Title:"1.Create Order",Url:"/menu/sync-log/order/sync-order"},{Title:"2.Convert Order To Invoice",Url:"/menu/sync-log/order/convert-to-invoice"},{Title:"3.Create Invoice",Url:"/menu/sync-log/order/invoice"},{Title:"4.Create Outbound Logistic",Url:"/menu/sync-log/order/delivery"},{Title:"5.Add Payment",Url:"/menu/sync-log/order/payment"},{Title:"6.Void Invoice",Url:"/menu/sync-log/order/void-invoice"},{Title:"All",Url:"/menu/sync-log/order/all"}]}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=S({type:r,selectors:[["app-order"]],decls:5,vars:1,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs"]],template:function(i,t){i&1&&(o(0,"nav",0)(1,"div",1)(2,"div"),C(3,"nav-tab",2),a()()(),C(4,"router-outlet")),i&2&&(m(3),p("Tabs",t.reportTabs))},dependencies:[de,oe],styles:[".dropdown[_ngcontent-%COMP%] .dropdown-menu.report.show[_ngcontent-%COMP%]{top:100%!important;transform:none!important;z-index:10000;cursor:pointer;right:-50%}"]});let n=r;return n})();var F=class{};var I=(()=>{let r=class r{constructor(e){this.http=e}GetLoader(){return this.http.post("/api/Report/GetLoader",{})}GetSyncOrder(e){return new Promise((i,t)=>{this.http.post("/api/Report/Salesorder",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/CreateInvoice",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncVoidInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/Void",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncConvertInvoice(e){return new Promise((i,t)=>{this.http.post("/api/Report/ConvertToInvoice",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncDelivery(e){return new Promise((i,t)=>{this.http.post("/api/Report/Delivery",JSON.stringify(e)).subscribe(d=>{i(d)})})}GetSyncPayment(e){return new Promise((i,t)=>{this.http.post("/api/Report/Payment",JSON.stringify(e)).subscribe(d=>{i(d)})})}getAllReport(e){return this.http.post("/api/Report/all",JSON.stringify(e))}};r.\u0275fac=function(i){return new(i||r)(K(se))},r.\u0275prov=J({token:r,factory:r.\u0275fac,providedIn:"root"});let n=r;return n})();var L=function(n){return n[n.OK=200]="OK",n[n.BAD_REQUEST=400]="BAD_REQUEST",n[n.CONFLICT=409]="CONFLICT",n[n.NOT_FOUND=404]="NOT_FOUND",n[n.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",n}(L||{});var _e=()=>["/menu/log/order"],Fe=(n,r,s,e,i)=>({responseCode:n,From:r,to:s,actionType:e,ChannelID:i});function be(n,r){if(n&1&&(o(0,"th",9)(1,"div",10)(2,"h4"),c(3),a(),o(4,"small",11),c(5),a()()()),n&2){let s=r.$implicit,e=T();m(3),N(s),m(),X(e.getTextBgColor(s)),m(),N(e.getHeaderStatusDesc(s))}}function Pe(n,r){if(n&1&&(o(0,"td",14)(1,"a",15),c(2),a()()),n&2){let s=r.$implicit,e=T().$implicit,i=T();m(),p("routerLink",$(3,_e))("queryParams",ee(4,Fe,s.Key,i.fromQueryParam,i.toQueryParam,i.type,e.ChannelID)),m(),Z(" ",s.Value," ")}}function we(n,r){if(n&1&&(o(0,"tr")(1,"td")(2,"a",12),C(3,"img",13),a()(),o(4,"td")(5,"div")(6,"a",12),c(7),a()(),o(8,"div"),c(9),a()(),v(10,Pe,3,10,"td",8),a()),n&2){let s=r.$implicit,e=T();m(2),U("href",s.Url,G),m(),p("src",e.getChannelLogo(s.Type),G),m(3),U("href",s.Url,G),m(),N(s.Name),m(2),N(s.Url),m(),p("ngForOf",s.list)}}function De(n,r){if(n&1&&(o(0,"td",14)(1,"div",16),c(2),A(3,"number"),a()()),n&2){let s=r.$implicit;m(2),N(j(3,1,s.total))}}var E=(()=>{let r=class r{constructor(){this.type=null,this.headerStatus=L,this.listCalculationStatusCode=[]}set from(e){e&&(this.fromQueryParam=new Date(e).toJSON().toString())}set to(e){e&&(this.toQueryParam=new Date(e).toJSON().toString())}ngOnChanges(e){e.result&&this.calculateStatusCode()}getHeaderStatusDesc(e){let i=null;switch(e){case L.BAD_REQUEST:i="BAD REQUEST";break;case L.CONFLICT:i="CONFLICT";break;case L.INTERNAL_SERVER_ERROR:i="INTERNAL SERVER ERROR";break;case L.NOT_FOUND:i="NOT FOUND";break;default:i="OK";break}return i}getTextBgColor(e){let i=null;switch(e){case L.OK:i="bg-success";break;case L.INTERNAL_SERVER_ERROR:i="bg-danger";break;default:i="bg-warning";break}return i}getChannelLogo(e){return f.getChannelLogoByTypeId(e)}calculateStatusCode(){if(this.listCalculationStatusCode=[],this.result){let e,i;this.concatStatusCode().forEach(t=>{e=this.listCalculationStatusCode.findIndex(d=>d.status==t.Key),i=e!==-1,i?this.listCalculationStatusCode[e].total+=t.Value:this.listCalculationStatusCode=[...this.listCalculationStatusCode,{status:t.Key,total:t.Value}]})}}concatStatusCode(){return this.result.map(e=>e.list).reduce((e,i)=>[...e,...i])}};r.\u0275fac=function(i){return new(i||r)},r.\u0275cmp=S({type:r,selectors:[["app-table-report"]],inputs:{header:"header",result:"result",from:"from",to:"to",type:"type"},features:[q],decls:15,vars:3,consts:[[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","0%"],[2,"width","5%"],["class","text-start","style","width: 10%;",4,"ngFor","ngForOf"],[4,"ngFor","ngForOf"],["colspan","2"],[1,"text-center","h3","fw-bold"],["class","text-start",4,"ngFor","ngForOf"],[1,"text-start",2,"width","10%"],[1,"d-block"],[1,"text-white","p-1","rounded","response-desc"],["target","_blank",3,"href"],[2,"width","24px","height","24px",3,"src"],[1,"text-start"],[1,"h3","text-primary","fw-bold","ms-1",3,"routerLink","queryParams"],[1,"d-inline-block","h3","text-primary","fw-bold","ms-1"]],template:function(i,t){i&1&&(o(0,"table",0)(1,"thead",1)(2,"tr"),C(3,"th",2),o(4,"th",3),c(5,"Channel"),a(),v(6,be,6,4,"th",4),a()(),o(7,"tbody"),v(8,we,11,6,"tr",5),a(),o(9,"tfoot")(10,"tr")(11,"td",6)(12,"div",7),c(13,"Total"),a()(),v(14,De,4,3,"td",8),a()()()),i&2&&(m(6),p("ngForOf",t.header),m(2),p("ngForOf",t.result),m(6),p("ngForOf",t.listCalculationStatusCode))},dependencies:[te,ae,re],styles:[".response-desc[_ngcontent-%COMP%]{font-size:12px}"]});let n=r;return n})();function Ie(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",0)}}var he=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.pageTitle="New Order";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`New Order (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncOrder(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-sales-order"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.getChannelLogs()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Ie,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.pageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Ee(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",1)}}var ue=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-invoice"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Ee,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Oe(n,r){if(n&1&&(o(0,"div",8)(1,"div",9),C(2,"app-table-report",10),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",3)}}var ye=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F;let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Shipped (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncDelivery(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-delivery"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"filterDate"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div",1)(3,"label",2),c(4,"From/To"),a(),o(5,"div",3)(6,"datepicker",4),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",5),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",6),v(11,Oe,3,5,"div",7),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Le(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",4)}}var ge=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Completed";let t=new Date;this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Completed (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncPayment(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-payment"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Le,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function Re(n,r){n&1&&Y(0)}function Me(n,r){if(n&1&&(o(0,"div",8)(1,"div",9),C(2,"app-table-report",10),a()()),n&2){let s=r.ngIf,e=T();m(2),p("result",s.Body)("header",s.Header)("from",e.filter==null?null:e.filter.From)("to",e.filter==null?null:e.filter.To)}}var ve=(()=>{let r=class r{constructor(e,i){this.reportOrderService=e,this.datePipe=i,this.filter=new F}ngOnInit(){this.initFilter(),this.initLoader()}initFilter(){let e=new Date;this.minDate=f.addDays(e,6),this.filter.From=e,this.filter.To=e,this.updatePageTitle()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.pageTitle=`All (${e==null?"":i+"-"} ${t})`}initLoader(){this.pageLoader$=this.reportOrderService.GetLoader().pipe(H(e=>{this.filter=e,this.updatePageTitle(),this.initData()}))}initData(){this.reportData$=this.reportOrderService.getAllReport(this.filter).pipe(V())}onFilter(){this.updatePageTitle(),this.initData()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-all"]],decls:15,vars:10,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],[4,"ngIf"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,Re,1,0,"ng-container",6),A(12,"async"),v(13,Me,3,4,"div",7),A(14,"async"),a()()()),i&2&&(p("headerTitle",t.pageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",j(12,6,t.pageLoader$)),m(2),p("ngIf",j(14,8,t.reportData$)))},dependencies:[P,D,_,E,ie]});let n=r;return n})();function ke(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",1)}}var Ce=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Convert Sales Order To Invoice";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Convert Sales Order To Invoice (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-convert-invoice"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,ke,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();function xe(n,r){if(n&1&&(o(0,"div",7)(1,"div",8),C(2,"app-table-report",9),a()()),n&2){let s=T();m(2),p("result",s.result)("header",s.header)("from",s.filter.From)("to",s.filter.To)("type",1)}}var Te=(()=>{let r=class r{constructor(e,i){this.http=e,this.datePipe=i,this.filter=new F,this.PageTitle="Ready to Ship";let t=new Date;this.maxDate=t,this.minDate=f.addDays(t,6),this.filter.From=t,this.filter.To=t,this.updatePageTitle()}ngOnInit(){this.initPageLoader()}updatePageTitle(){let e=f.formatTitleFromDate(this.filter.From,this.filter.To),i=this.datePipe.transform(this.filter.From,e),t=this.datePipe.transform(this.filter.To,"dd MMM yyyy");this.PageTitle=`Ready to Ship (${e==null?"":i+"-"} ${t})`}initPageLoader(){this.http.GetLoader().subscribe(e=>{this.filter=e,this.getChannelLogs()})}getChannelLogs(){this.updatePageTitle(),this.http.GetSyncInvoice(this.filter).then(e=>{this.header=e.Header,this.result=e.Body})}onFilter(){this.getChannelLogs()}};r.\u0275fac=function(i){return new(i||r)(h(I),h(w))},r.\u0275cmp=S({type:r,selectors:[["app-void-invoice"]],decls:12,vars:5,consts:[[3,"onSubmit","headerTitle","hideSearchBox"],[1,"fw-bold","mb-1"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"container-fluid"],["class","row mt-4",4,"ngIf"],[1,"row","mt-4"],[1,"col-md-12"],[3,"result","header","from","to","type"]],template:function(i,t){i&1&&(o(0,"mainpanel",0),b("onSubmit",function(){return t.onFilter()}),o(1,"filters")(2,"div")(3,"label",1),c(4,"From/To"),a(),o(5,"div",2)(6,"datepicker",3),g("dateChange",function(l){return y(t.filter.From,l)||(t.filter.From=l),l}),a()(),o(7,"div")(8,"datepicker",4),g("dateChange",function(l){return y(t.filter.To,l)||(t.filter.To=l),l}),a()()()(),o(9,"content")(10,"div",5),v(11,xe,3,5,"div",6),a()()()),i&2&&(p("headerTitle",t.PageTitle)("hideSearchBox",!0),m(6),u("date",t.filter.From),m(2),u("date",t.filter.To),m(3),p("ngIf",t.result))},dependencies:[P,D,_,E]});let n=r;return n})();var Ne=[{path:"",component:fe,children:[{path:"",redirectTo:"sync-order",pathMatch:"full"},{path:"sync-order",component:he,canActivate:[R],data:{title:"Sync Order"}},{path:"convert-to-invoice",component:Ce,canActivate:[R],data:{title:"Sync Convert to Invoice"}},{path:"invoice",component:ue,canActivate:[R],data:{title:"Sync Invoice"}},{path:"delivery",component:ye,canActivate:[R],data:{title:"Sync Delivery"}},{path:"payment",component:ge,canActivate:[R],data:{title:"Sync Payment"}},{path:"void-invoice",component:Te,canActivate:[R],data:{title:"Sync void invoice"}},{path:"all",component:ve,canActivate:[R],data:{title:"All Report"}}]}],Et=(()=>{let r=class r{};r.\u0275fac=function(i){return new(i||r)},r.\u0275mod=z({type:r}),r.\u0275inj=Q({imports:[ne,ce,me,pe,_,le.forChild(Ne)]});let n=r;return n})();export{Et as OrderModule};
|