marketplacepos 3.16.2 → 3.16.4
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-FNOXM2SS.js → chunk-44ILHEAX.js} +1 -1
- package/Marketplace/{chunk-PTMDFQOD.js → chunk-5WPUUMMO.js} +1 -1
- package/Marketplace/{chunk-56HMEZKJ.js → chunk-7KOJ3DFL.js} +1 -1
- package/Marketplace/{chunk-TD7KGWBY.js → chunk-B6YCFV4S.js} +1 -1
- package/Marketplace/{chunk-HDICR5JJ.js → chunk-BNZ3QXNI.js} +1 -1
- package/Marketplace/{chunk-ZHLEQV6S.js → chunk-BWVM6BFT.js} +1 -1
- package/Marketplace/{chunk-5HK5RDLE.js → chunk-CLF7PUXF.js} +1 -1
- package/Marketplace/{chunk-DJN3BFQ5.js → chunk-DPNIWGU4.js} +1 -1
- package/Marketplace/{chunk-5DUVNRSI.js → chunk-FIKLTG2J.js} +1 -1
- package/Marketplace/{chunk-P2RYEYAK.js → chunk-FXRODXJT.js} +1 -1
- package/Marketplace/{chunk-RRRAZVNG.js → chunk-HZAWDUWT.js} +1 -1
- package/Marketplace/{chunk-GCTFQCQL.js → chunk-K5ONTCUO.js} +1 -1
- package/Marketplace/{chunk-FU3SO6X2.js → chunk-KWJMZUFP.js} +1 -1
- package/Marketplace/{chunk-442UTXWT.js → chunk-MJY3XQ7R.js} +1 -1
- package/Marketplace/{chunk-7MV36WHX.js → chunk-OSUCZSOM.js} +1 -1
- package/Marketplace/{chunk-7KMBT32T.js → chunk-PED3UNE6.js} +1 -1
- package/Marketplace/{chunk-WKKTLYA4.js → chunk-PHFMXSJW.js} +1 -1
- package/Marketplace/{chunk-OUZSNKTY.js → chunk-Q2SEJTHF.js} +1 -1
- package/Marketplace/{chunk-L7OZWIEI.js → chunk-QRSQP67K.js} +1 -1
- package/Marketplace/{chunk-ILLBE7MA.js → chunk-SJZYEO7J.js} +1 -1
- package/Marketplace/{chunk-57IKCVRG.js → chunk-SUKXIUAB.js} +1 -1
- package/Marketplace/{chunk-YNH3VQZY.js → chunk-TF2NEU67.js} +1 -1
- package/Marketplace/{chunk-UDLUDP5I.js → chunk-TS376PJ5.js} +1 -1
- package/Marketplace/{chunk-MAFA6A4E.js → chunk-WIURRHOQ.js} +1 -1
- package/Marketplace/{chunk-SLBTXHYH.js → chunk-Z4BGJOTF.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-B7T4QEWM.js → main-S6TN6MGA.js} +1 -1
- package/package.json +1 -1
|
@@ -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-B42KSOUB.js";import{b as ie}from"./chunk-K66EVMAU.js";import{a as ee,b as te}from"./chunk-OKB4Q376.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-B42KSOUB.js";import{b as ie}from"./chunk-K66EVMAU.js";import{a as ee,b as te}from"./chunk-OKB4Q376.js";import{a as X}from"./chunk-QRSQP67K.js";import{g as Q}from"./chunk-BWVM6BFT.js";import{e as J}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{m as Y,n as Z}from"./chunk-SG42JTLJ.js";import"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A as q,c as G,h as z,m as K}from"./chunk-VFLG2BDB.js";import"./chunk-T4MH7AFK.js";import{$ as D,$a as s,Dc as H,Ga as k,Hb as v,Ia as p,Ib as m,Ja as I,Jb as O,Kb as B,Mb as L,Nb as F,Ob as R,Pb as P,Sb as x,Vc as W,Xc as j,Za as c,Zc as $,aa as T,ca as U,ga as C,ha as N,lb as o,mb as r,nb as d,oa as g,ob as f,pa as h,pb as _,rb as S,ub as y,vc as w,wb as u,wc as V,xc as A,za as M}from"./chunk-IH2NT4RC.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{g as c}from"./chunk-
|
|
1
|
+
import{g as c}from"./chunk-BWVM6BFT.js";import{b as a}from"./chunk-SUL6ZUGT.js";import{$ as s,ca as o}from"./chunk-IH2NT4RC.js";var d=(()=>{let e=class e{constructor(i,t){this.toastr=i,this.authService=t}canActivate(i,t){let n=JSON.parse(window.localStorage.getItem("user")),l=new Date;if(n!=null){let p=new Date(n.Token.expiredAt);return l<p?!0:(this.onTokenExpired(),!1)}else return this.onTokenExpired(),!1}onTokenExpired(){this.toastr.error("Your session has expired. Please login again.","Session Expired").onShown.subscribe(()=>this.authService.logout())}};e.\u0275fac=function(t){return new(t||e)(o(a),o(c))},e.\u0275prov=s({token:e,factory:e.\u0275fac,providedIn:"root"});let r=e;return r})();export{d as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as rt}from"./chunk-V6PMZ6DL.js";import{c as ot}from"./chunk-KSTCUPYX.js";import{a as Q,b as X,d as Y,e as Z}from"./chunk-DDUQ3IZU.js";import{g as J}from"./chunk-
|
|
1
|
+
import{b as rt}from"./chunk-V6PMZ6DL.js";import{c as ot}from"./chunk-KSTCUPYX.js";import{a as Q,b as X,d as Y,e as Z}from"./chunk-DDUQ3IZU.js";import{g as J}from"./chunk-BWVM6BFT.js";import{b as $,e as q}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{m as it,n as nt}from"./chunk-SG42JTLJ.js";import{t as tt,u as et}from"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A as z,h as H,m as A}from"./chunk-VFLG2BDB.js";import{b as v,c as G}from"./chunk-T4MH7AFK.js";import{$a as m,$b as W,Dc as S,Ha as P,Ia as c,Ib as l,Ja as h,Jb as u,Kb as j,Mb as y,Nb as L,Ob as M,Q as T,X as x,Za as g,Zc as C,_b as V,aa as p,ga as E,ha as d,lb as r,mb as a,nb as D,oa as O,ob as U,pa as w,pb as F,q as I,rb as K,ub as _,vc as k,wb as f,wc as R,zc as B}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";function ct(n,e){if(n&1&&(r(0,"span",13),D(1,"img",14),a(),r(2,"span"),l(3),a()),n&2){let s=e.item;c(),m("src",s.Img,P)("alt",s.Name),c(2),j(" ",s.Name," ")}}function mt(n,e){if(n&1){let s=K();U(0),r(1,"ng-select",16),M("ngModelChange",function(i){O(s);let o=f().$implicit;return L(o.ProductSKU,i)||(o.ProductSKU=i),w(i)}),a(),F()}if(n&2){let s=e.ngIf,t=f().$implicit;c(),y("ngModel",t.ProductSKU),m("items",s)}}function pt(n,e){if(n&1&&(r(0,"tr")(1,"td"),l(2),a(),r(3,"td"),l(4),a(),r(5,"td"),l(6),a(),r(7,"td"),g(8,mt,2,2,"ng-container",15),V(9,"async"),a()()),n&2){let s=e.$implicit,t=f();c(2),u(s.Name),c(2),u(s.Service),c(2),u(s.TypeString),c(2),m("ngIf",W(9,4,t.logisticOptions$))}}var st=(()=>{let e=class e{constructor(t,i,o){this.http=t,this.toastr=i,this.authService=o,this.filter={ChannelID:""},this.logisticServiceOptions=[],this.channelOptions=this.authService.getChannels(),this.initUnsupportedChannel(),this.initLoader()}initUnsupportedChannel(){let t=[v.WooCommerce,v.Lazada,v.Shopify];this.channelOptions=this.channelOptions.map(i=>(t.forEach(o=>{i.TypeID===o&&(i.disabled=!0)}),i))}initLoader(){this.http.post("/api/Logistic/Load",{}).subscribe(t=>{this.filter=t.Filter,this.channelName=this.channelOptions[0].Name,this.initLogisticServiceOptions(),this.getLogisticService()})}initLogisticServiceOptions(){this.logisticOptions$=this.http.get("/api/Logistic/OptionLogisticsService").pipe(T(1),x(t=>{this.logisticServiceOptions=t}))}Validate(){for(let t of this.logisticServices)this.datasource.find(o=>o.ProductSKU==t.ProductSKU&&o.Name==t.Name)===void 0&&(t.IsChange=!0);return Promise.resolve(this.logisticServices)}submitLogistics(){this.Validate().then(t=>{this.http.post("/api/Logistic/Submit",this.logisticServices).subscribe(i=>{this.toastr.success("Success","Update Complete!",{timeOut:5e3,enableHtml:!0}),this.getLogisticService()})})}getLogisticService(){this.datasource=[],this.http.post("/api/Logistic/Get",this.filter).pipe(I(t=>t.map(i=>(i.ProductSKU=G.IsEmpty(i.ProductSKU)?null:i.ProductSKU,i)))).subscribe(t=>{this.iniTitle(),this.logisticServices=t,this.datasource=structuredClone(t)})}iniTitle(){let t=this.channelOptions.find(i=>i.ID==this.filter.ChannelID);this.channelName=t?t.Name:null}};e.\u0275fac=function(i){return new(i||e)(h(q),h($),h(J))},e.\u0275cmp=E({type:e,selectors:[["app-logistic"]],decls:28,vars:6,consts:[["hideSearchBox","true","searchBoxPlaceHolder","Enter Number...",3,"onSubmit","headerTitle","hideSearchDropdown"],[1,"mb-2","fw-bold"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],["role","button","data-toggle","tooltip","data-placement","top","matTooltip","enter Logistic for recorded",1,"btn","btn-success","btn-fill","btn-lg","text-white",3,"click"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[4,"ngIf"],["placeholder","Logistic Service Code","bindLabel","Name","bindValue","Code",1,"w-75",3,"ngModelChange","ngModel","items"]],template:function(i,o){i&1&&(r(0,"mainpanel",0),_("onSubmit",function(){return o.getLogisticService()}),r(1,"filters")(2,"div")(3,"label",1),l(4,"Select a Channel"),a(),r(5,"ng-select",2),M("ngModelChange",function(b){return L(o.filter.ChannelID,b)||(o.filter.ChannelID=b),b}),g(6,ct,4,3,"ng-template",3),a()()(),r(7,"actions")(8,"a",4),_("click",function(){return o.submitLogistics()}),l(9,"Submit"),a()(),r(10,"content")(11,"div",5)(12,"div",6)(13,"div",7)(14,"div",8)(15,"table",9)(16,"thead",10)(17,"tr",11)(18,"th"),l(19,"Logistic"),a(),r(20,"th"),l(21,"Service"),a(),r(22,"th"),l(23,"Type"),a(),r(24,"th"),l(25,"Logistic Service"),a()()(),r(26,"tbody"),g(27,pt,10,6,"tr",12),a()()()()()()()()),i&2&&(m("headerTitle","Logistic Courier - "+o.channelName)("hideSearchDropdown",!1),c(5),m("clearable",!1)("items",o.channelOptions),y("ngModel",o.filter.ChannelID),c(22),m("ngForOf",o.logisticServices))},dependencies:[k,R,H,A,it,Y,Q,X,tt,B]});let n=e;return n})();var dt=[{path:"",component:st}],lt=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=d({type:e}),e.\u0275inj=p({imports:[S,C.forChild(dt)]});let n=e;return n})();var kt=(()=>{let e=class e{};e.\u0275fac=function(i){return new(i||e)},e.\u0275mod=d({type:e}),e.\u0275inj=p({imports:[S,C,lt,z,nt,Z,rt,ot,et]});let n=e;return n})();export{kt as LogisticModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _}from"./chunk-FQ72DFEO.js";import"./chunk-6U6JR5K6.js";import{a as de,b as ce}from"./chunk-OKB4Q376.js";import"./chunk-INOCIPFW.js";import"./chunk-ITTQVZJZ.js";import"./chunk-OURZMROU.js";import{a as R}from"./chunk-L7OZWIEI.js";import"./chunk-A3ZMDUMP.js";import"./chunk-X54LLODL.js";import"./chunk-ZHLEQV6S.js";import{e as se}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{m as D,n as pe}from"./chunk-SG42JTLJ.js";import"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A as me}from"./chunk-VFLG2BDB.js";import{c as f}from"./chunk-T4MH7AFK.js";import{$ as J,$a as p,$b as j,Ac as w,Cc as re,Dc as ne,Ha as G,Ia as m,Ib as c,Ja as h,Jb as N,Kb as Z,Mb as u,Nb as y,Ob as g,Q as V,Rb as $,Vc as oe,Wb as ee,X as H,Xc as ae,Za as v,Zc as le,_b as A,aa as Q,ca as K,db as X,ga as S,ha as z,lb as o,mb as a,na as q,nb as C,qb as Y,ub as b,vc as te,wb as T,wc as P,zb as U,zc as ie}from"./chunk-IH2NT4RC.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-FQ72DFEO.js";import"./chunk-6U6JR5K6.js";import{a as de,b as ce}from"./chunk-OKB4Q376.js";import"./chunk-INOCIPFW.js";import"./chunk-ITTQVZJZ.js";import"./chunk-OURZMROU.js";import{a as R}from"./chunk-QRSQP67K.js";import"./chunk-A3ZMDUMP.js";import"./chunk-X54LLODL.js";import"./chunk-BWVM6BFT.js";import{e as se}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{m as D,n as pe}from"./chunk-SG42JTLJ.js";import"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A as me}from"./chunk-VFLG2BDB.js";import{c as f}from"./chunk-T4MH7AFK.js";import{$ as J,$a as p,$b as j,Ac as w,Cc as re,Dc as ne,Ha as G,Ia as m,Ib as c,Ja as h,Jb as N,Kb as Z,Mb as u,Nb as y,Ob as g,Q as V,Rb as $,Vc as oe,Wb as ee,X as H,Xc as ae,Za as v,Zc as le,_b as A,aa as Q,ca as K,db as X,ga as S,ha as z,lb as o,mb as a,na as q,nb as C,qb as Y,ub as b,vc as te,wb as T,wc as P,zb as U,zc as ie}from"./chunk-IH2NT4RC.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 +1 @@
|
|
|
1
|
-
import{a as te}from"./chunk-
|
|
1
|
+
import{a as te}from"./chunk-PHFMXSJW.js";import{a as ee}from"./chunk-VS2ZOTGT.js";import{a as I}from"./chunk-XHAXYWZ7.js";import{b as ne,c as N}from"./chunk-WWRX4VCC.js";import"./chunk-BVIRHZTZ.js";import"./chunk-T3POIC5F.js";import"./chunk-V6PMZ6DL.js";import"./chunk-HPCPVA6F.js";import{a as Z}from"./chunk-UUI7T7NV.js";import"./chunk-OURZMROU.js";import"./chunk-PW6QZKJS.js";import"./chunk-X54LLODL.js";import{g as $}from"./chunk-BWVM6BFT.js";import{b as Q,e as J}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{d as q,m as X,n as Y}from"./chunk-SG42JTLJ.js";import"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A as H,c as j,h as G,m as W,o as z}from"./chunk-VFLG2BDB.js";import{c as K}from"./chunk-T4MH7AFK.js";import{$a as d,$b as S,B as V,Dc as U,Ia as u,Ib as y,Ja as h,Mb as b,Nb as P,Ob as M,Pb as R,Qb as O,X as D,Za as _,_b as f,da as F,ga as T,lb as l,mb as p,nb as E,oa as s,ob as L,pa as c,pb as B,rb as v,ub as C,wb as o,wc as k,zc as A}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";function ie(a,r){if(a&1){let n=v();l(0,"button",14),C("click",function(){s(n);let t=o().ngIf,i=o(2);return c(i.onUpdateItems(t))}),E(1,"i",15),y(2," Update "),p()}}function ae(a,r){if(a&1&&(l(0,"actions")(1,"div",12),_(2,ie,3,0,"button",13),p()()),a&2){let n=r.ngIf,e=o(2);u(2),d("ngIf",e.productService.hasSelectionVariant(n))}}function oe(a,r){if(a&1){let n=v();L(0),l(1,"app-table",16),C("onToggle",function(t){s(n);let i=o(2);return c(i.onShowDifferenceStock(t))})("onSubmit",function(t){s(n);let i=o(2);return c(i.updateStockByVariant(t))}),p(),B()}if(a&2){let n=r.ngIf,e=o(2);u(),d("data",n)("channel",e.channelOptions)("showProductToggle",!0)("filter",e.searchFilter)}}function re(a,r){if(a&1){let n=v();l(0,"mainpanel",1),C("onSubmit",function(t){s(n);let i=o();return c(i.onSearch(t))}),_(1,ae,3,1,"actions",2),f(2,"async"),l(3,"filters")(4,"div")(5,"label",3),y(6,"PageNumber"),p(),l(7,"input",4),M("ngModelChange",function(t){s(n);let i=o();return P(i.searchFilter.PageNumber,t)||(i.searchFilter.PageNumber=t),c(t)}),p()(),l(8,"div",5)(9,"label",6),y(10,"Page Size"),p(),l(11,"input",7),M("ngModelChange",function(t){s(n);let i=o();return P(i.searchFilter.RowCount,t)||(i.searchFilter.RowCount=t),c(t)}),p()()(),l(12,"content")(13,"div",8)(14,"div",9)(15,"div",10),_(16,oe,2,4,"ng-container",2),f(17,"async"),l(18,"infinite-paginator",11),f(19,"async"),C("onNextPage",function(){s(n);let t=o();return c(t.paginationService.onNextPage(t.searchFilter))})("onLastPage",function(){s(n);let t=o();return c(t.paginationService.onLastPage(t.searchFilter))})("onGetRowCount",function(){s(n);let t=o();return c(t.paginationService.getRowCount(t.searchFilter))}),p()()()()()()}if(a&2){let n=o();d("pageData",n.pageData)("hideSearchBox",!1)("textButton","Search"),u(),d("ngIf",S(2,13,n.paginationService.data$)),u(6),b("ngModel",n.searchFilter.PageNumber),u(4),b("ngModel",n.searchFilter.RowCount),u(5),d("ngIf",S(17,15,n.paginationService.data$)),u(2),d("totalData",n.paginationService.totalData())("hideCount",n.paginationService.hideCount())("rowCount",S(19,17,n.paginationService.totalRowCount$))("pageNumber",n.paginationService.pageNumber())("disableNextButton",n.paginationService.disableNextButton())("goToLastPage",n.paginationService.isLastPage())}}var Ve=(()=>{let r=class r{constructor(e,t,i,g,x){this.http=e,this.toastr=t,this.dialog=i,this.productService=g,this.authService=x,this.paginationService=F(N),this.loaderEndpoint="InventoryLoader/GetMultipleInventoryComparison",this.dataEndpoint="Inventory/GetMultipleChannelComparison",this.allDataCountEndpoint="Inventory/GetMultipleChannelComparisonRowCount",this.filterTypeOptions=[{Key:1,Value:"All"},{Key:3,Value:"Difference"}],this.pageData={Title:"Inventory",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory/pos",Active:!0},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!1}]},this.channelOptions=this.authService.getChannels()}ngOnInit(){this.initPageLoader()}initPageLoader(){this.paginationService.fetchDataEndpoint=this.dataEndpoint,this.paginationService.fethRowCountEndpoint=this.allDataCountEndpoint,this.loader$=this.http.post(`/API/${this.loaderEndpoint}`,{}).pipe(D(e=>{e.Filter={PageNumber:e.Filter.PageNumber,filterModel:I.ALL,RowCount:e.Filter.PageSize,HiddenIPOSInventory:e.Filter.HiddenIPOSInventory},this.searchFilter=e.Filter,this.paginationService.reloadPagination(this.searchFilter)}))}onSearch(e){this.searchFilter.text=e,this.paginationService.reloadPagination(this.searchFilter)}updateStock(e,t){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let x=i.map(m=>({ID:m.ID,Code:m.Code,Inventory:m.Inventory}));var g=t.filter(m=>m.selected).map(m=>m.ID);let w={ListChannelID:g,List:x};this.http.post("/api/Inventory/UpdateChannel",w).subscribe(m=>{this.paginationService.reloadPagination(this.searchFilter),this.toastr.success("Successfully updated "+w.List.length+" variants in "+w.ListChannelID.length+" channels","Success")})}}updateStockByVariant(e){let t={ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku};this.http.post("/api/Inventory/UpdateQuantityByItem",t).subscribe(i=>{this.paginationService.reloadPagination(this.searchFilter);let g=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success("Successfully updated "+e.ItemName+"("+e.VarName+") inventory in "+g.Name+" to "+t.NewQuantity,"Success")})}onShowDifferenceStock(e){e?this.searchFilter.filterModel=I.DIFFERENCE:this.searchFilter.filterModel=I.ALL,this.paginationService.reloadPagination(this.searchFilter)}onUpdateItems(e){let t=this.productService.selectedVariantProduct(e);this.dialog.open(ee,{data:{selectedItems:t,channels:JSON.parse(JSON.stringify(this.channelOptions))},width:"600px"}).afterClosed().pipe(V(i=>K.IsNotEmpty(i))).subscribe(i=>{this.updateStock(e,i)})}};r.\u0275fac=function(t){return new(t||r)(h(J),h(Q),h(q),h(Z),h($))},r.\u0275cmp=T({type:r,selectors:[["app-multi-channel-comparison"]],standalone:!0,features:[R([N]),O],decls:2,vars:3,consts:[["headerTitle","Inventory Comparison",3,"pageData","hideSearchBox","textButton","onSubmit",4,"ngIf"],["headerTitle","Inventory Comparison",3,"onSubmit","pageData","hideSearchBox","textButton"],[4,"ngIf"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"mt-5"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"d-flex"],["type","button","class","btn btn-success shadow-sm rounded me-3",3,"click",4,"ngIf"],["type","button",1,"btn","btn-success","shadow-sm","rounded","me-3",3,"click"],[1,"fas","fa-chevron-circle-up"],["table","inventory",3,"onToggle","onSubmit","data","channel","showProductToggle","filter"]],template:function(t,i){t&1&&(_(0,re,20,19,"mainpanel",0),f(1,"async")),t&2&&d("ngIf",S(1,1,i.loader$))},dependencies:[U,k,A,Y,X,te,H,j,z,G,W,ne],styles:[".no-bullet[_ngcontent-%COMP%]{list-style-type:none}"]});let a=r;return a})();export{Ve as MultiChannelComparison};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as N}from"./chunk-CZYGGOZL.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-WWRX4VCC.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-YXUEYLE5.js";import{a as De}from"./chunk-T3POIC5F.js";import{a as Ve,b as Te}from"./chunk-V6PMZ6DL.js";import{a as be}from"./chunk-UUI7T7NV.js";import"./chunk-OURZMROU.js";import{a as Fe}from"./chunk-PW6QZKJS.js";import"./chunk-X54LLODL.js";import{a as xe,b as fe,d as Se,e as Pe}from"./chunk-DDUQ3IZU.js";import{g as ue}from"./chunk-ZHLEQV6S.js";import{b as de,e as ge}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as ye,m as ve,n as we}from"./chunk-SG42JTLJ.js";import"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A as pe,b as oe,c as re,h as le,m as ce,o as se}from"./chunk-VFLG2BDB.js";import{c as me,e as he,f as Ce}from"./chunk-T4MH7AFK.js";import{$a as p,$b as T,B as A,Cc as E,Dc as ie,Gc as ae,Ha as D,Hb as J,Ia as l,Ib as d,Ja as x,Jb as B,Kb as F,Mb as I,Nb as y,Ob as v,Pb as Z,Q as $,Qb as Q,Sb as V,X as j,Za as h,_b as w,ac as X,bc as Y,da as z,ga as G,gb as S,hb as k,jb as L,kb as R,lb as o,mb as c,nb as P,oa as _,ob as K,pa as m,pb as q,rb as f,tc as ee,ub as u,wb as r,wc as te,zb as H,zc as ne}from"./chunk-IH2NT4RC.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=f();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=f();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=f();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=f();o(0,"input",51),v("ngModelChange",function(n){_(t);let a=r(4).$implicit;return y(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 Ke(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 qe(i,s){if(i&1){let t=f();K(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(),q()}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,Ke,1,3,null,26),o(3,"div",46),h(4,qe,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=f();o(0,"input",56),v("ngModelChange",function(n){_(t);let a=r(2).$implicit;return y(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),w(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=f();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),w(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=f();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=f();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),v("ngModelChange",function(n){_(t);let a=r(2);return y(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),w(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),w(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=f();o(0,"mainpanel",2),v("textChange",function(n){_(t);let a=r();return y(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),v("ngModelChange",function(n){_(t);let a=r();return y(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),v("ngModelChange",function(n){_(t);let a=r();return y(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),v("ngModelChange",function(n){_(t);let a=r();return y(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),w(16,"async"),h(17,ot,30,18,"content",9),w(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)(x(ge),x(de),x(Ie),x(be),x(Fe),x(N),x(ue),x(ye),x(Ee),x(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,"fas","external-link-custom","fa-external-link-alt"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,rt,19,13,"mainpanel",1),w(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,we,ve,Pe,Se,xe,fe,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-CZYGGOZL.js";import{a as M}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as ke,c as U}from"./chunk-WWRX4VCC.js";import{a as _e}from"./chunk-BVIRHZTZ.js";import{a as Ee,b as Me}from"./chunk-YXUEYLE5.js";import{a as De}from"./chunk-T3POIC5F.js";import{a as Ve,b as Te}from"./chunk-V6PMZ6DL.js";import{a as be}from"./chunk-UUI7T7NV.js";import"./chunk-OURZMROU.js";import{a as Fe}from"./chunk-PW6QZKJS.js";import"./chunk-X54LLODL.js";import{a as xe,b as fe,d as Se,e as Pe}from"./chunk-DDUQ3IZU.js";import{g as ue}from"./chunk-BWVM6BFT.js";import{b as de,e as ge}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{d as Ie,l as ye,m as ve,n as we}from"./chunk-SG42JTLJ.js";import"./chunk-BZ7SMYI7.js";import"./chunk-DRY23ALE.js";import{A as pe,b as oe,c as re,h as le,m as ce,o as se}from"./chunk-VFLG2BDB.js";import{c as me,e as he,f as Ce}from"./chunk-T4MH7AFK.js";import{$a as p,$b as T,B as A,Cc as E,Dc as ie,Gc as ae,Ha as D,Hb as J,Ia as l,Ib as d,Ja as x,Jb as B,Kb as F,Mb as I,Nb as y,Ob as v,Pb as Z,Q as $,Qb as Q,Sb as V,X as j,Za as h,_b as w,ac as X,bc as Y,da as z,ga as G,gb as S,hb as k,jb as L,kb as R,lb as o,mb as c,nb as P,oa as _,ob as K,pa as m,pb as q,rb as f,tc as ee,ub as u,wb as r,wc as te,zb as H,zc as ne}from"./chunk-IH2NT4RC.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=f();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=f();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=f();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=f();o(0,"input",51),v("ngModelChange",function(n){_(t);let a=r(4).$implicit;return y(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 Ke(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 qe(i,s){if(i&1){let t=f();K(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(),q()}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,Ke,1,3,null,26),o(3,"div",46),h(4,qe,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=f();o(0,"input",56),v("ngModelChange",function(n){_(t);let a=r(2).$implicit;return y(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),w(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=f();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),w(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=f();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=f();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),v("ngModelChange",function(n){_(t);let a=r(2);return y(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),w(24,"stringLimit"),c()()()()(),o(25,"tbody"),L(26,at,2,0,null,null,k),c()(),o(28,"infinite-paginator",31),w(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=f();o(0,"mainpanel",2),v("textChange",function(n){_(t);let a=r();return y(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),v("ngModelChange",function(n){_(t);let a=r();return y(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),v("ngModelChange",function(n){_(t);let a=r();return y(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),v("ngModelChange",function(n){_(t);let a=r();return y(a.searchFilter.RowCount,n)||(a.searchFilter.RowCount=n),m(n)}),c()()(),h(15,je,7,1,"actions",9),w(16,"async"),h(17,ot,30,18,"content",9),w(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)(x(ge),x(de),x(Ie),x(be),x(Fe),x(N),x(ue),x(ye),x(Ee),x(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,"fas","external-link-custom","fa-external-link-alt"],[2,"cursor","pointer",3,"click"]],template:function(n,a){n&1&&(h(0,rt,19,13,"mainpanel",1),w(1,"async")),n&2&&p("ngIf",T(1,1,a.loader$))},dependencies:[ie,ee,te,ne,E,we,ve,Pe,Se,xe,fe,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,2 +1,2 @@
|
|
|
1
|
-
import{a as xt,c as Ft}from"./chunk-3LNROKGQ.js";import"./chunk-F4FACWQU.js";import{a as Tt}from"./chunk-INOCIPFW.js";import{a as It,b as St}from"./chunk-HPCPVA6F.js";import{a as at,b as lt}from"./chunk-3HQCLIMJ.js";import{a as he,b as st,c as dt,d as ge,e as ut}from"./chunk-P2RYEYAK.js";import{a as gt,b as Ct,c as ye,d as bt,e as yt,j as ae}from"./chunk-ITTQVZJZ.js";import{b as vt}from"./chunk-UUI7T7NV.js";import{b as ht,c as be}from"./chunk-OURZMROU.js";import{a as ft}from"./chunk-LIJHEC5V.js";import"./chunk-PW6QZKJS.js";import{b as _t,c as Ce}from"./chunk-A3ZMDUMP.js";import{a as ct,b as mt,f as pt,g as _e}from"./chunk-X54LLODL.js";import{d as H,e as W}from"./chunk-DDUQ3IZU.js";import"./chunk-ZHLEQV6S.js";import{e as re}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{m as ot,n as rt}from"./chunk-SG42JTLJ.js";import{t as it,u as nt}from"./chunk-BZ7SMYI7.js";import{M as et,N as ue,O as tt,P as fe}from"./chunk-DRY23ALE.js";import{A as oe,B as Y,a as Xe,c as se,e as de,h as j,i as z,l as ke,m as ze,n as J,q as Q,r as Je,s as q,t as Qe,u as qe,v as Ze,z as Z}from"./chunk-VFLG2BDB.js";import{b as Ke,c as g}from"./chunk-T4MH7AFK.js";import{$ as N,$a as p,$b as T,Dc as I,H as Le,Hb as Ee,Ia as m,Ib as h,Ja as X,Jb as ne,Kb as K,Mb as je,Nb as Ye,Ob as He,Pb as F,Q as ie,Qb as U,Rb as pe,V as $e,X as L,Za as _,_a as Re,_b as S,aa as ce,ab as Ae,c as Ue,d as Be,da as f,ga as x,gb as k,ha as me,hb as $,jb as R,jc as We,kb as G,lb as s,mb as l,na as O,nb as u,oa as C,ob as D,pa as b,pb as V,q as B,rb as M,ub as y,wb as c,wc as A,xa as Fe,za as w,zb as Ge,zc as E}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";var ee=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(ee||{});var le=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(le||{});var Me=(()=>{let i=class i{constructor(){this.shopeeUploadService=f(he),this.formBuilder=f(Z)}getAttributes(o){return this.shopeeUploadService.getAttributes(o.channelId,o.categoryId).pipe(B(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(o=[]){let t,r;return o=o.map(a=>(t=a?.multi_lang?.find(d=>d.language=="id"),a.attribute_value_list=a?.attribute_value_list?.map(d=>(r=d?.multi_lang?.find(v=>v.language=="id"),d.name=r?.value,d)),a.name=t?.value?t?.value:a.name,a)),o}createFormGroup(o){let t=this.formBuilder.group({}),r=[];return o.forEach(a=>{if(r=[],a.mandatory&&r.push(de.required),a?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&a?.attribute_info?.input_type==ee.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new ke(null),value:new ke(null,r)});t.addControl(JSON.stringify(a.attribute_id),d)}else t.addControl(JSON.stringify(a.attribute_id),this.formBuilder.control(null,r))}),t}getFilteredAttributes(o,t){let r=JSON.parse(JSON.stringify(o)),a=Object.keys(t),d=r.filter(v=>a.findIndex(Te=>parseInt(Te)==v.attribute_id||v.mandatory)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(a=>{switch(a.attribute_info.input_type){case ee.MULTI_COMBO_BOX:g.IsNotEmpty(a.attribute_value_list)?a.attribute_value_list=a.attribute_value_list.filter(d=>t[a.attribute_id]==d.value_id):a.attribute_value_list=[];break;case ee.FREE_TEXT_FILED:a.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?a.attribute_value_list=this.setSelectedQuantitativeAttr(t[a.attribute_id]?.value,t[a.attribute_id]?.unit):g.IsNotEmpty(t[a.attribute_id])&&(a.attribute_value_list=[{value_id:0,name:t[a.attribute_id]}]);break;default:a.attribute_value_list=a.attribute_value_list.filter(d=>d.value_id==t[a.attribute_id])}return a}).filter(a=>a?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(o,t){let r=[];return g.IsNotEmpty(o)&&(r=[{value_id:0,original_value_name:JSON.stringify(o),value_unit:t}]),r}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var ve=(()=>{let i=class i{constructor(){this._calendarHeaderConfig=new Be({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(o){this._calendarHeaderConfig.next(o)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();var Bt=["class","component ts"];function Lt(e,i){if(e&1){let n=M();s(0,"button",3),y("click",function(){C(n);let t=c(2);return b(t.todayClicked())}),u(1,"i",4),l()}}function $t(e,i){if(e&1){let n=M();s(0,"button",5),y("click",function(){C(n);let t=c(2);return b(t.clearClicked())}),u(1,"i",6),l()}}function Rt(e,i){if(e&1&&(D(0),_(1,Lt,2,0,"button",1)(2,$t,2,0,"button",2),V()),e&2){let n=i.ngIf;m(),p("ngIf",!n.hideBtnToday),m(),p("ngIf",!n.hideBtnClear)}}var Et=(()=>{let i=class i{constructor(o,t,r,a,d){this._datePicker=o,this._calendar=t,this._dateAdapter=r,this.calendarService=a,this._destroyed=new Ue,t.stateChanges.pipe($e(this._destroyed)).subscribe(v=>d.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(o){this._calendar.ngOnChanges(o)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};i.\u0275fac=function(t){return new(t||i)(X(ye),X(Ct),X(ue),X(ve),X(We))},i.\u0275cmp=x({type:i,selectors:[["POS-DatepickerHeader",8,"component","ts"]],features:[O],attrs:Bt,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(t,r){t&1&&(s(0,"mat-calendar-header"),_(1,Rt,3,2,"ng-container",0),S(2,"async"),l()),t&2&&(m(),p("ngIf",T(2,1,r.calendarConfig$)))},dependencies:[A,_t,gt,E],encapsulation:2});let e=i;return e})(),kt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=me({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,Ce,fe,ae,_e,be]});let e=i;return e})();function Gt(e,i){if(e&1&&(s(0,"mat-label",6)(1,"span"),h(2),l()()),e&2){let n=c();p("show",n.placeholder),m(2),ne(n.placeholder)}}var jt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Mt=(()=>{let i=class i{set hidelClearBtn(o){this.calendarService.setHeaderConfig({hideBtnClear:o,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(o){let t=null;o&&(t=o.toDate(),t.setHours(0,0,0,0)),this.onChange(t),this.dateChange.emit(t)}constructor(o){this.calendarService=o,this.headerComponent=Et,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new w,this.minDate=g.MinDate,this.onChange=t=>{},this.displayToggle=!0}writeValue(o){this.date=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){this.disabled=o}onOpenDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="inside")}}onCloseDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};i.\u0275fac=function(t){return new(t||i)(X(ve))},i.\u0275cmp=x({type:i,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},features:[F([{provide:ue,useClass:Tt,deps:[et]},{provide:tt,useValue:jt},{provide:Xe,multi:!0,useExisting:i}])],decls:6,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","",3,"for"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(t,r){if(t&1){let a=M();s(0,"mat-form-field",1),_(1,Gt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(v){return C(a),b(r.change(v.value))})("click",function(){C(a);let v=Ee(5);return b(v.open())}),l(),u(3,"mat-datepicker-toggle",4),s(4,"mat-datepicker",5,0),y("opened",function(){return C(a),b(r.onOpenDatepicker())})("closed",function(){return C(a),b(r.onCloseDatepicker())}),l()()}if(t&2){let a=Ee(5);Ae("width",r.width||100,"%"),p("disabled",r.disabled)("appearance",r.appearance),m(),p("ngIf",r.isFloatingLabel&&r.placeholder),m(),Ge("placeholder",r.placeholder||""),p("matDatepicker",a)("min",r.minDateValidation)("max",r.maxDateValidation)("value",r.date==r.minDate?null:r.date)("disabled",r.disabled)("readonly",r.readOnly),Re("data-cy",r.data_cy),m(),Ae("display",r.displayToggle?"unset":"none"),p("for",a),m(),p("calendarHeaderComponent",r.headerComponent)}},dependencies:[A,ye,bt,yt,pt,ct,mt,ht],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
1
|
+
import{a as xt,c as Ft}from"./chunk-3LNROKGQ.js";import"./chunk-F4FACWQU.js";import{a as Tt}from"./chunk-INOCIPFW.js";import{a as It,b as St}from"./chunk-HPCPVA6F.js";import{a as at,b as lt}from"./chunk-3HQCLIMJ.js";import{a as he,b as st,c as dt,d as ge,e as ut}from"./chunk-FXRODXJT.js";import{a as gt,b as Ct,c as ye,d as bt,e as yt,j as ae}from"./chunk-ITTQVZJZ.js";import{b as vt}from"./chunk-UUI7T7NV.js";import{b as ht,c as be}from"./chunk-OURZMROU.js";import{a as ft}from"./chunk-LIJHEC5V.js";import"./chunk-PW6QZKJS.js";import{b as _t,c as Ce}from"./chunk-A3ZMDUMP.js";import{a as ct,b as mt,f as pt,g as _e}from"./chunk-X54LLODL.js";import{d as H,e as W}from"./chunk-DDUQ3IZU.js";import"./chunk-BWVM6BFT.js";import{e as re}from"./chunk-SUL6ZUGT.js";import"./chunk-KCDL7SWP.js";import{m as ot,n as rt}from"./chunk-SG42JTLJ.js";import{t as it,u as nt}from"./chunk-BZ7SMYI7.js";import{M as et,N as ue,O as tt,P as fe}from"./chunk-DRY23ALE.js";import{A as oe,B as Y,a as Xe,c as se,e as de,h as j,i as z,l as ke,m as ze,n as J,q as Q,r as Je,s as q,t as Qe,u as qe,v as Ze,z as Z}from"./chunk-VFLG2BDB.js";import{b as Ke,c as g}from"./chunk-T4MH7AFK.js";import{$ as N,$a as p,$b as T,Dc as I,H as Le,Hb as Ee,Ia as m,Ib as h,Ja as X,Jb as ne,Kb as K,Mb as je,Nb as Ye,Ob as He,Pb as F,Q as ie,Qb as U,Rb as pe,V as $e,X as L,Za as _,_a as Re,_b as S,aa as ce,ab as Ae,c as Ue,d as Be,da as f,ga as x,gb as k,ha as me,hb as $,jb as R,jc as We,kb as G,lb as s,mb as l,na as O,nb as u,oa as C,ob as D,pa as b,pb as V,q as B,rb as M,ub as y,wb as c,wc as A,xa as Fe,za as w,zb as Ge,zc as E}from"./chunk-IH2NT4RC.js";import"./chunk-GNOSNGXM.js";var ee=function(e){return e[e.SINGLE_DROP_DOWN=1]="SINGLE_DROP_DOWN",e[e.SINGLE_COMBO_BOX=2]="SINGLE_COMBO_BOX",e[e.FREE_TEXT_FILED=3]="FREE_TEXT_FILED",e[e.MULTI_DROP_DOWN=4]="MULTI_DROP_DOWN",e[e.MULTI_COMBO_BOX=5]="MULTI_COMBO_BOX",e}(ee||{});var le=function(e){return e[e.FORMAT_NORMAL=1]="FORMAT_NORMAL",e[e.FORMAT_QUANTITATIVE_WITH_UNIT=2]="FORMAT_QUANTITATIVE_WITH_UNIT",e}(le||{});var Me=(()=>{let i=class i{constructor(){this.shopeeUploadService=f(he),this.formBuilder=f(Z)}getAttributes(o){return this.shopeeUploadService.getAttributes(o.channelId,o.categoryId).pipe(B(t=>this.setLabelToIndonesian(t)))}setLabelToIndonesian(o=[]){let t,r;return o=o.map(a=>(t=a?.multi_lang?.find(d=>d.language=="id"),a.attribute_value_list=a?.attribute_value_list?.map(d=>(r=d?.multi_lang?.find(v=>v.language=="id"),d.name=r?.value,d)),a.name=t?.value?t?.value:a.name,a)),o}createFormGroup(o){let t=this.formBuilder.group({}),r=[];return o.forEach(a=>{if(r=[],a.mandatory&&r.push(de.required),a?.attribute_info?.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT&&a?.attribute_info?.input_type==ee.FREE_TEXT_FILED){let d=this.formBuilder.group({unit:new ke(null),value:new ke(null,r)});t.addControl(JSON.stringify(a.attribute_id),d)}else t.addControl(JSON.stringify(a.attribute_id),this.formBuilder.control(null,r))}),t}getFilteredAttributes(o,t){let r=JSON.parse(JSON.stringify(o)),a=Object.keys(t),d=r.filter(v=>a.findIndex(Te=>parseInt(Te)==v.attribute_id||v.mandatory)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(a=>{switch(a.attribute_info.input_type){case ee.MULTI_COMBO_BOX:g.IsNotEmpty(a.attribute_value_list)?a.attribute_value_list=a.attribute_value_list.filter(d=>t[a.attribute_id]==d.value_id):a.attribute_value_list=[];break;case ee.FREE_TEXT_FILED:a.attribute_info.format_type==le.FORMAT_QUANTITATIVE_WITH_UNIT?a.attribute_value_list=this.setSelectedQuantitativeAttr(t[a.attribute_id]?.value,t[a.attribute_id]?.unit):g.IsNotEmpty(t[a.attribute_id])&&(a.attribute_value_list=[{value_id:0,name:t[a.attribute_id]}]);break;default:a.attribute_value_list=a.attribute_value_list.filter(d=>d.value_id==t[a.attribute_id])}return a}).filter(a=>a?.attribute_value_list?.length>0)}setSelectedQuantitativeAttr(o,t){let r=[];return g.IsNotEmpty(o)&&(r=[{value_id:0,original_value_name:JSON.stringify(o),value_unit:t}]),r}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var ve=(()=>{let i=class i{constructor(){this._calendarHeaderConfig=new Be({hideBtnClear:!1,hideBtnToday:!1}),this.calendarConfig=this._calendarHeaderConfig.value}setHeaderConfig(o){this._calendarHeaderConfig.next(o)}getHeaderConfig$(){return this._calendarHeaderConfig.asObservable()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac,providedIn:"root"});let e=i;return e})();var Bt=["class","component ts"];function Lt(e,i){if(e&1){let n=M();s(0,"button",3),y("click",function(){C(n);let t=c(2);return b(t.todayClicked())}),u(1,"i",4),l()}}function $t(e,i){if(e&1){let n=M();s(0,"button",5),y("click",function(){C(n);let t=c(2);return b(t.clearClicked())}),u(1,"i",6),l()}}function Rt(e,i){if(e&1&&(D(0),_(1,Lt,2,0,"button",1)(2,$t,2,0,"button",2),V()),e&2){let n=i.ngIf;m(),p("ngIf",!n.hideBtnToday),m(),p("ngIf",!n.hideBtnClear)}}var Et=(()=>{let i=class i{constructor(o,t,r,a,d){this._datePicker=o,this._calendar=t,this._dateAdapter=r,this.calendarService=a,this._destroyed=new Ue,t.stateChanges.pipe($e(this._destroyed)).subscribe(v=>d.markForCheck()),this.calendarConfig$=this.calendarService.getHeaderConfig$()}todayClicked(){this._calendar.activeDate=this._dateAdapter.today(),this._datePicker.select(this._dateAdapter.today()),this._datePicker.close()}clearClicked(){this._datePicker.select(null),this._datePicker.close()}ngOnChanges(o){this._calendar.ngOnChanges(o)}ngOnDestroy(){this._destroyed.next(),this._destroyed.complete()}};i.\u0275fac=function(t){return new(t||i)(X(ye),X(Ct),X(ue),X(ve),X(We))},i.\u0275cmp=x({type:i,selectors:[["POS-DatepickerHeader",8,"component","ts"]],features:[O],attrs:Bt,decls:3,vars:3,consts:[[4,"ngIf"],["mat-icon-button","","title","Today",3,"click",4,"ngIf"],["mat-icon-button","","title","Clear",3,"click",4,"ngIf"],["mat-icon-button","","title","Today",3,"click"],[1,"far","fa-clock",2,"font-size","18px"],["mat-icon-button","","title","Clear",3,"click"],[1,"far","fa-xmark-circle",2,"font-size","18px"]],template:function(t,r){t&1&&(s(0,"mat-calendar-header"),_(1,Rt,3,2,"ng-container",0),S(2,"async"),l()),t&2&&(m(),p("ngIf",T(2,1,r.calendarConfig$)))},dependencies:[A,_t,gt,E],encapsulation:2});let e=i;return e})(),kt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=me({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,Ce,fe,ae,_e,be]});let e=i;return e})();function Gt(e,i){if(e&1&&(s(0,"mat-label",6)(1,"span"),h(2),l()()),e&2){let n=c();p("show",n.placeholder),m(2),ne(n.placeholder)}}var jt={parse:{dateInput:"DD MMM YYYY"},display:{dateInput:"DD MMM YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}},Mt=(()=>{let i=class i{set hidelClearBtn(o){this.calendarService.setHeaderConfig({hideBtnClear:o,hideBtnToday:this.calendarService.calendarConfig.hideBtnToday})}change(o){let t=null;o&&(t=o.toDate(),t.setHours(0,0,0,0)),this.onChange(t),this.dateChange.emit(t)}constructor(o){this.calendarService=o,this.headerComponent=Et,this.appearance="outline",this.isFloatingLabel=!0,this.disabled=!1,this.readOnly=!1,this.dateChange=new w,this.minDate=g.MinDate,this.onChange=t=>{},this.displayToggle=!0}writeValue(o){this.date=o}registerOnChange(o){this.onChange=o}registerOnTouched(o){}setDisabledState(o){this.disabled=o}onOpenDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="inside")}}onCloseDatepicker(){let o=document.getElementById("dropdown-filter");if(o){var t=new bootstrap.Dropdown(o);t&&(t._config.autoClose="outside")}}ngOnDestroy(){this.calendarService.setHeaderConfig({hideBtnClear:!1,hideBtnToday:!1})}};i.\u0275fac=function(t){return new(t||i)(X(ve))},i.\u0275cmp=x({type:i,selectors:[["datepicker"]],inputs:{data_cy:"data_cy",placeholder:"placeholder",displayToggle:"displayToggle",appearance:"appearance",width:"width",isFloatingLabel:"isFloatingLabel",date:"date",disabled:"disabled",readOnly:"readOnly",minDateValidation:"minDateValidation",maxDateValidation:"maxDateValidation",hidelClearBtn:"hidelClearBtn"},outputs:{dateChange:"dateChange"},features:[F([{provide:ue,useClass:Tt,deps:[et]},{provide:tt,useValue:jt},{provide:Xe,multi:!0,useExisting:i}])],decls:6,vars:17,consts:[["picker1",""],[1,"datepicker",3,"disabled","appearance"],[3,"show",4,"ngIf"],["matInput","",3,"dateChange","click","matDatepicker","min","max","placeholder","value","disabled","readonly"],["matSuffix","",3,"for"],[3,"opened","closed","calendarHeaderComponent"],[3,"show"]],template:function(t,r){if(t&1){let a=M();s(0,"mat-form-field",1),_(1,Gt,3,2,"mat-label",2),s(2,"input",3),y("dateChange",function(v){return C(a),b(r.change(v.value))})("click",function(){C(a);let v=Ee(5);return b(v.open())}),l(),u(3,"mat-datepicker-toggle",4),s(4,"mat-datepicker",5,0),y("opened",function(){return C(a),b(r.onOpenDatepicker())})("closed",function(){return C(a),b(r.onCloseDatepicker())}),l()()}if(t&2){let a=Ee(5);Ae("width",r.width||100,"%"),p("disabled",r.disabled)("appearance",r.appearance),m(),p("ngIf",r.isFloatingLabel&&r.placeholder),m(),Ge("placeholder",r.placeholder||""),p("matDatepicker",a)("min",r.minDateValidation)("max",r.maxDateValidation)("value",r.date==r.minDate?null:r.date)("disabled",r.disabled)("readonly",r.readOnly),Re("data-cy",r.data_cy),m(),Ae("display",r.displayToggle?"unset":"none"),p("for",a),m(),p("calendarHeaderComponent",r.headerComponent)}},dependencies:[A,ye,bt,yt,pt,ct,mt,ht],styles:[`.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline{background-color:#e9ecef!important;opacity:1!important}.mat-mdc-form-field-disabled ::ng-deep .mat-form-field-appearance-outline input{color:#00000061!important}.datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{min-height:33px;padding-top:18px;padding-bottom:13px}.datepicker .mat-mdc-icon-button.mat-mdc-button-base{padding:0}.datepicker .mat-mdc-form-field-subscript-wrapper{display:none}.mat-calendar-controls .mat-mdc-icon-button.mat-mdc-button-base{padding:0!important}.mat-mdc-form-field .mdc-text-field--outlined .mdc-notched-outline--upgraded .mdc-floating-label--float-above{top:28px!important;font-size:16px;color:#9da2a6}.mat-mdc-text-field-wrapper .mat-mdc-form-field-flex .mat-mdc-floating-label{top:23px!important;font-size:.875rem;color:#ccc}.mdc-text-field--filled:not(.mdc-text-field--disabled){background-color:#fff}
|
|
2
2
|
`],encapsulation:2});let e=i;return e})(),Pt=(()=>{let i=class i{};i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=me({type:i}),i.\u0275inj=ce({providers:[ae],imports:[I,Ce,fe,ae,_e,be,kt]});let e=i;return e})();var Pe=function(e){return e[e.VALIDATOR_NO_VALIDATE_TYPE=0]="VALIDATOR_NO_VALIDATE_TYPE",e[e.VALIDATOR_INT_TYPE=1]="VALIDATOR_INT_TYPE",e[e.VALIDATOR_STRING_TYPE=2]="VALIDATOR_STRING_TYPE",e[e.VALIDATOR_FLOAT_TYPE=3]="VALIDATOR_FLOAT_TYPE",e[e.VALIDATOR_DATE_TYPE=4]="VALIDATOR_DATE_TYPE",e}(Pe||{});var Ne=()=>[];function Ht(e,i){e&1&&(s(0,"span",5),h(1,"*"),l())}function Wt(e,i){if(e&1&&u(0,"ng-select",6),e&2){let n=c().$implicit;p("multiple",!0)("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:pe(4,Ne))("placeholder","Pilih "+(n==null?null:n.name))}}function Xt(e,i){if(e&1&&u(0,"input",8),e&2){let n=c(2).$implicit;p("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function zt(e,i){if(e&1&&(s(0,"option",15),h(1),l()),e&2){let n=i.$implicit;p("value",n),m(),ne(n)}}function Jt(e,i){if(e&1&&(s(0,"div",10),u(1,"input",12),s(2,"select",13)(3,"option",14),h(4,"Unit"),l(),R(5,zt,2,2,"option",15,$),l()()),e&2){let n=c(3).$implicit;p("formGroupName",n.attribute_id),m(),p("placeholder","Isi "+(n==null?null:n.name)),m(2),p("value",null),m(2),G(n==null||n.attribute_info==null?null:n.attribute_info.attribute_unit_list)}}function Qt(e,i){if(e&1&&u(0,"input",11),e&2){let n=c(3).$implicit;p("formControlName",n.attribute_id)("placeholder","Isi "+(n==null?null:n.name))}}function qt(e,i){if(e&1&&_(0,Jt,7,3,"div",10)(1,Qt,1,2,"input",11),e&2){let n=c(2).$implicit,o=c(2);k((n==null||n.attribute_info==null?null:n.attribute_info.format_type)==o.formatType.FORMAT_QUANTITATIVE_WITH_UNIT?0:1)}}function Zt(e,i){if(e&1&&u(0,"datepicker",9),e&2){let n=c(2).$implicit;p("formControlName",n.attribute_id)}}function Kt(e,i){if(e&1&&_(0,Xt,1,2,"input",8)(1,qt,2,1)(2,Zt,1,1,"datepicker",9),e&2){let n,o=c().$implicit,t=c(2);k((n=o==null||o.attribute_info==null?null:o.attribute_info.input_validation_type)===t.validationType.VALIDATOR_STRING_TYPE?0:n===t.validationType.VALIDATOR_FLOAT_TYPE?1:n===t.validationType.VALIDATOR_DATE_TYPE?2:-1)}}function ei(e,i){if(e&1&&u(0,"ng-select",7),e&2){let n=c().$implicit;p("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:pe(3,Ne))("placeholder","Pilih "+(n==null?null:n.name))}}function ti(e,i){if(e&1&&u(0,"ng-select",7),e&2){let n=c().$implicit;p("formControlName",n.attribute_id)("items",n.attribute_value_list?n.attribute_value_list:pe(3,Ne))("placeholder","Pilih "+(n==null?null:n.name))}}function ii(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),_(2,Ht,2,0,"span",5),s(3,"span"),h(4),l()(),_(5,Wt,1,5,"ng-select",6)(6,Kt,3,1)(7,ei,1,4,"ng-select",7)(8,ti,1,4,"ng-select",7),l()),e&2){let n,o=i.$implicit,t=c(2);m(2),k(o.mandatory?2:-1),m(2),K(" ",o==null?null:o.name," "),m(),k((n=o==null||o.attribute_info==null?null:o.attribute_info.input_type)===t.inputType.MULTI_COMBO_BOX?5:n===t.inputType.FREE_TEXT_FILED?6:n===t.inputType.SINGLE_COMBO_BOX?7:8)}}function ni(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,ii,9,3,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();m(),p("formGroup",o.form),m(2),G(n)}}var Nt=(()=>{let i=class i{constructor(){this.formCategoryService=f(Me),this.attributesChanges=new w,this.inputType=ee,this.formatType=le,this.validationType=Pe}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.formCategoryService.getAttributes({categoryId:this.categoryId,channelId:this.channelId,channelType:this.channelType}).pipe(L(o=>{this.form=this.formCategoryService.createFormGroup(o),this.listenToFormChange(o)}),ie(1)))}listenToFormChange(o){let t=[];this.formSubscription=this.form.valueChanges.subscribe(r=>{t=this.formCategoryService.getFilteredAttributes(o,r),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["shopee-attribute-form"]],inputs:{channelType:"channelType",categoryId:"categoryId",channelId:"channelId",channelProductUpload:"channelProductUpload"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Me]),O,U],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","value_id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","value_id",3,"formControlName","items","placeholder"],["type","text",1,"form-control",3,"formControlName","placeholder"],[1,"attribute-datepicker",3,"formControlName"],[1,"d-flex","align-items-center",3,"formGroupName"],["type","text","autoNum","",1,"form-control",3,"formControlName","placeholder"],["formControlName","value","type","text","autoNum","",1,"form-control","me-1",2,"width","200px",3,"placeholder"],["name","unit","id","unit","formControlName","unit",1,"form-control"],["disabled","","selected","",3,"value"],[3,"value"]],template:function(t,r){t&1&&(_(0,ni,5,1,"ng-container",0),S(1,"async")),t&2&&p("ngIf",T(1,1,r.attributes$))},dependencies:[I,A,E,W,H,Y,J,qe,Ze,se,Qe,j,z,Q,q,Je,vt,Pt,Mt],styles:["input[_ngcontent-%COMP%], select[_ngcontent-%COMP%]{height:36px;border-radius:4px} datepicker.attribute-datepicker>mat-form-field.mat-mdc-form-field>.mat-mdc-text-field-wrapper{height:36px} datepicker.attribute-datepicker .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:11px!important;padding-bottom:11px!important;height:36px;min-height:36px!important} datepicker.attribute-datepicker mat-datepicker-toggle>button.mat-mdc-icon-button.mat-mdc-button-base{--mdc-icon-button-state-layer-size: 36px}"]});let e=i;return e})();var Oe=(()=>{let i=class i{constructor(){this.httpService=f(re),this.formBuilder=f(Z)}getAttributes(o,t){return this.httpService.get("api/product/tiktok/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}]).pipe(B(a=>(a=this.mappingAttributeSalesProperty(a),a)))}mappingAttributeSalesProperty(o){let t=0;return o.filter(r=>(r.type=="SALES_PROPERTY"&&(t+=1),t>1?(t=0,!1):!0)).map(r=>(r.type=="SALES_PROPERTY"&&(r.name="Jenis Variant",r.is_multiple_selection=!1,r.values=[{id:"Warna",name:"Warna"},{id:"Ukuran",name:"Ukuran"}]),r))}createFormGroup(o){let t=this.formBuilder.group({}),r=[];return o.forEach(a=>{r=[],a.is_required&&r.push(de.required),t.addControl(a.id,this.formBuilder.control(null,r))}),t}getFilteredAttributes(o,t){let r=JSON.parse(JSON.stringify(o)),a=Object.keys(t),d=r.filter(v=>a.findIndex(Te=>parseInt(Te)==v.id)!=-1);return d=this.filterSelectedAttributes(d,t),d}filterSelectedAttributes(o,t){return o.map(a=>(a.is_multiple_selection?a.values=a.values.filter(d=>t[a.id]?.includes(d.id)):a.values=a.values.filter(d=>d.id==t[a.id]),a)).filter(a=>a?.values?.length>0)}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function oi(e,i){e&1&&(s(0,"span",5),h(1,"*"),l())}function ri(e,i){if(e&1&&u(0,"ng-select",6),e&2){let n=c().$implicit;p("multiple",!0)("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function ai(e,i){if(e&1&&u(0,"ng-select",7),e&2){let n=c().$implicit;p("formControlName",n.id)("items",n.values)("placeholder","Pilih "+(n==null?null:n.name))}}function li(e,i){if(e&1&&(s(0,"small",5),h(1),l()),e&2){let n=c().$implicit;m(),K(" ",n==null?null:n.name," is mandatory ")}}function ci(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),_(2,oi,2,0,"span",5),s(3,"span"),h(4),l()(),_(5,ri,1,4,"ng-select",6)(6,ai,1,3,"ng-select",7)(7,li,2,1,"small",5),l()),e&2){let n=i.$implicit;m(2),k(n.is_required?2:-1),m(2),K(" ",n==null?null:n.name," "),m(),k(n.is_multiple_selection?5:6),m(2),k(n.is_required?7:-1)}}function mi(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,ci,8,4,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();m(),p("formGroup",o.form),m(2),G(n)}}var Ot=(()=>{let i=class i{constructor(){this.tiktokAttributeFormService=f(Oe),this.attributesChanges=new w}ngOnChanges(){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tiktokAttributeFormService.getAttributes(this.channelId,this.categoryId).pipe(B(o=>o.filter(t=>!(t.type=="PRODUCT_PROPERTY"&&(g.IsEmpty(t.values)||t.values?.length==0)))),L(o=>{this.form=this.tiktokAttributeFormService.createFormGroup(o),this.listenToFormChange(o)}),ie(1)))}listenToFormChange(o){let t=[];this.formSubscription=this.form.valueChanges.subscribe(r=>{t=this.tiktokAttributeFormService.getFilteredAttributes(o,r),this.attributesChanges.emit(t)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["tiktok-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Oe]),O,U],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],[1,"text-danger"],["bindLabel","name","bindValue","id",3,"multiple","formControlName","items","placeholder"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(t,r){t&1&&(_(0,mi,5,1,"ng-container",0),S(1,"async")),t&2&&p("ngIf",T(1,1,r.attributes$))},dependencies:[I,A,E,W,H,Y,J,j,z,Q,q,oe]});let e=i;return e})();var we=(()=>{let i=class i{constructor(){this.woocommerceUploadService=f(ge)}getAttributes(o,t){return this.woocommerceUploadService.getAttributes(o,t).pipe(B(r=>r.map(a=>({key:a.name,label:a.name}))))}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();var wt=(()=>{let i=class i{constructor(){this.wooAttributeFormService=f(we),this.channelId=Fe(),this.categoryId=Fe(),this.attributesChanges=new w}ngOnChanges(){g.IsNotEmpty(this.categoryId())&&g.IsNotEmpty(this.channelId())&&(this.attributes$=this.wooAttributeFormService.getAttributes(this.channelId(),this.categoryId()))}onSelectAttribute(o){this.attributesChanges.emit([o.key])}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["wooocommerce-attribute-form"]],inputs:{channelId:[1,"channelId"],categoryId:[1,"categoryId"]},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([we]),O,U],decls:6,vars:3,consts:[[1,"row"],[1,"col-6"],[1,"mb-1"],["bindLabel","label","bindValue","id","placeholder","Pilih Atribut",3,"change","items"]],template:function(t,r){t&1&&(s(0,"div",0)(1,"div",1)(2,"div",2),h(3,"Atribut"),l(),s(4,"ng-select",3),S(5,"async"),y("change",function(d){return r.onSelectAttribute(d)}),l()()()),t&2&&(m(4),p("items",T(5,1,r.attributes$)))},dependencies:[I,E,oe,W,H,Y]});let e=i;return e})();var De=(()=>{let i=class i{constructor(){this.httpService=f(re),this.formBuilder=f(Z)}getAttributes(o,t){return this.httpService.get("api/product/tokopedia/GetAttributes",[{key:"ID",value:o},{key:"CategoryID",value:t}]).pipe(B(a=>a))}createFormGroup(o){let t=this.formBuilder.group({});return o.forEach(r=>{t.addControl(r.variant,this.formBuilder.control(null))}),t}convertAttributes(o={}){return Object.values(o).filter(r=>r!==null).map(r=>JSON.stringify(r))}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function pi(e,i){if(e&1&&(s(0,"div",3)(1,"div",4),h(2),l(),u(3,"ng-select",5),l()),e&2){let n=i.$implicit;m(2),K(" ",n==null?null:n.variant," "),m(),p("formControlName",n.variant)("items",n.values)("placeholder","Pilih "+(n==null?null:n.variant))}}function si(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2),R(3,pi,4,4,"div",3,$),l()(),V()),e&2){let n=i.ngIf,o=c();m(),p("formGroup",o.form),m(2),G(n)}}var Dt=(()=>{let i=class i{constructor(){this.tokpedAttrFormService=f(De),this.attributesChanges=new w}ngOnInit(){}ngOnChanges(o){g.IsNotEmpty(this.categoryId)&&g.IsNotEmpty(this.channelId)&&(this.attributes$=this.tokpedAttrFormService.getAttributes(this.channelId,this.categoryId).pipe(L(t=>{this.form=this.tokpedAttrFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){let o=[];this.formSubscription=this.form.valueChanges.subscribe(t=>{o=this.tokpedAttrFormService.convertAttributes(t),this.attributesChanges.emit(o)})}ngOnDestroy(){this.formSubscription&&this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["tokopedia-attribute-form"]],inputs:{channelId:"channelId",categoryId:"categoryId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([De]),O,U],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["bindLabel","name","bindValue","id",3,"formControlName","items","placeholder"]],template:function(t,r){t&1&&(_(0,si,5,1,"ng-container",0),S(1,"async")),t&2&&p("ngIf",T(1,1,r.attributes$))},dependencies:[I,A,E,W,H,Y,J,j,z,Q,q]});let e=i;return e})();var Ve=(()=>{let i=class i{constructor(){this.httpService=f(re),this.formBuilder=f(Z)}getAttributes(o){return this.httpService.get("api/product/shopify/GetAttributes",[{key:"ID",value:o}]).pipe(L(r=>(r.Options.StatusOptions=r.Options.Status.map(a=>({id:a,name:a})),r)))}createFormGroup(o){let t=this.formBuilder.group({});return Object.keys(o.Attribute).forEach(a=>{t.addControl(a,this.formBuilder.control(null))}),t}};i.\u0275fac=function(t){return new(t||i)},i.\u0275prov=N({token:i,factory:i.\u0275fac});let e=i;return e})();function di(e,i){if(e&1&&(D(0),s(1,"form",1)(2,"div",2)(3,"div",3)(4,"div",4),h(5," Brand "),l(),u(6,"input",5),l(),s(7,"div",6)(8,"div",4),h(9," Product Type "),l(),u(10,"input",7),l(),s(11,"div",6)(12,"div",4),h(13," Status "),l(),u(14,"ng-select",8),l()()(),V()),e&2){let n=i.ngIf,o=c();m(),p("formGroup",o.form),m(13),p("items",n.Options.StatusOptions)}}var Vt=(()=>{let i=class i{constructor(){this.attributesChanges=new w,this.shopifyFormService=f(Ve)}ngOnChanges(o){o.channelId&&(this.attributes$=this.shopifyFormService.getAttributes(this.channelId).pipe(L(t=>{this.form=this.shopifyFormService.createFormGroup(t),this.listenToFormChange()})))}listenToFormChange(){this.formSubscription=this.form.valueChanges.pipe(Le(500)).subscribe(o=>{this.attributesChanges.emit([o])})}ngOnDestroy(){this.formSubscription.unsubscribe()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["shopify-attribute-form"]],inputs:{channelId:"channelId"},outputs:{attributesChanges:"attributesChanges"},standalone:!0,features:[F([Ve]),O,U],decls:2,vars:3,consts:[[4,"ngIf"],[3,"formGroup"],[1,"row"],[1,"col-6","mb-3"],[1,"mb-1"],["formControlName","Brand","type","text","placeholder","brand",1,"form-control"],[1,"col-6"],["formControlName","ProductType","type","text","placeholder","Product Type",1,"form-control"],["formControlName","Status","bindLabel","name","bindValue","id","placeholder","Status",3,"items"]],template:function(t,r){t&1&&(_(0,di,15,2,"ng-container",0),S(1,"async")),t&2&&p("ngIf",T(1,1,r.attributes$))},dependencies:[I,A,E,Y,J,se,j,z,Q,q,W,H]});let e=i;return e})();function ui(e,i){if(e&1&&(s(0,"div",6),u(1,"app-product-card",9),l()),e&2){let n=i.$implicit;m(),p("productId",n==null?null:n.ID)("title",n==null?null:n.Name)("image",n==null?null:n.ThumbnailUrl)("description",(n==null||n.Variants==null?null:n.Variants.length)>1?(n==null||n.Variants==null?null:n.Variants.length)+" Variants":null)("imageForZoom",n==null?null:n.ImageUrl)("code",n==null||n.Variants[0]==null?null:n.Variants[0].Code)("showFooter",!1)}}function fi(e,i){if(e&1){let n=M();D(0),s(1,"mat-checkbox",21),He("ngModelChange",function(t){C(n);let r=c().$implicit;return Ye(r.selected,t)||(r.selected=t),b(t)}),y("ngModelChange",function(){let t=C(n).ngIf,r=c(),a=r.$implicit,d=r.$index,v=c();return b(v.onSelectChannel(a,d,t))}),l(),V()}if(e&2){let n=c().$implicit;m(),je("ngModel",n.selected)}}function _i(e,i){e&1&&(s(0,"div",18),u(1,"input",22),l())}function hi(e,i){if(e&1){let n=M();s(0,"app-channel-category-select",23),y("selectedCategory",function(t){C(n);let r=c().$index,a=c();return b(a.onCategoryChange(r,t))}),l()}if(e&2){let n=c().$implicit,o=c();p("disabled",!n.selected||n.selected&&n.type==o.channelType.Lazada)("channelId",n.id)("channelType",n.type)("categoryId",n.categoryId)}}function gi(e,i){if(e&1){let n=M();s(0,"shopee-attribute-form",27),y("attributesChanges",function(t){C(n);let r=c(2).$index,a=c();return b(a.onAttributesChange(r,t))}),l()}if(e&2){let n=c(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)("channelType",n.type)}}function Ci(e,i){if(e&1){let n=M();s(0,"tiktok-attribute-form",28),y("attributesChanges",function(t){C(n);let r=c(2).$index,a=c();return b(a.onAttributesChange(r,t))}),l()}if(e&2){let n=c(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function bi(e,i){if(e&1){let n=M();s(0,"wooocommerce-attribute-form",28),y("attributesChanges",function(t){C(n);let r=c(2).$index,a=c();return b(a.onAttributesChange(r,t))}),l()}if(e&2){let n=c(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function yi(e,i){if(e&1){let n=M();s(0,"tokopedia-attribute-form",28),y("attributesChanges",function(t){C(n);let r=c(2).$index,a=c();return b(a.onAttributesChange(r,t))}),l()}if(e&2){let n=c(2).$implicit;p("categoryId",n.categoryId)("channelId",n.id)}}function vi(e,i){if(e&1&&(s(0,"div",20)(1,"div",24),_(2,gi,1,3,"shopee-attribute-form",25)(3,Ci,1,2,"tiktok-attribute-form",26)(4,bi,1,2,"wooocommerce-attribute-form",26)(5,yi,1,2,"tokopedia-attribute-form",26),l()()),e&2){let n,o=c().$implicit,t=c();m(2),k((n=o.type)===t.channelType.Shopee?2:n===t.channelType.Tiktok?3:n===t.channelType.WooCommerce?4:n===t.channelType.Tokopedia?5:-1)}}function xi(e,i){if(e&1){let n=M();s(0,"div",20)(1,"div",24)(2,"shopify-attribute-form",29),y("attributesChanges",function(t){C(n);let r=c().$index,a=c();return b(a.onAttributesChange(r,t))}),l()()()}if(e&2){let n=c().$implicit;m(2),p("channelId",n.id)}}function Ii(e,i){if(e&1&&(s(0,"div",8)(1,"div",10)(2,"div",11)(3,"div",12)(4,"div",13)(5,"div"),_(6,fi,2,1,"ng-container",14),S(7,"async"),l(),s(8,"div"),u(9,"app-channel-logo",15),l(),s(10,"div",16)(11,"span"),h(12),l()()()(),s(13,"div",12)(14,"div",17),_(15,_i,2,0,"div",18)(16,hi,1,4,"app-channel-category-select",19),l()()(),_(17,vi,6,1,"div",20)(18,xi,3,1,"div",20),l()()),e&2){let n=i.$implicit,o=c();m(6),p("ngIf",T(7,7,o.defaultCategories$)),m(3),p("typeId",n.type),m(),p("matTooltip",n.name)("matTooltipShowDelay",2500),m(2),ne(n.name),m(3),k(n.type==o.channelType.Shopify?15:16),m(2),k(n.categoryId&&o.channelType.Lazada!=n.type&&n.selected?17:o.channelType.Shopify==n.type&&n.selected?18:-1)}}var yr=(()=>{let i=class i{constructor(){this.uploadProductService=f(ut),this.selectedProducts$=this.uploadProductService.selectedProduct$,this.channelProductUploads=this.uploadProductService.channelProductUpload,this.channelType=Ke,this.defaultCategories$=this.uploadProductService.getDefaultCategory().pipe(ie(1))}onCategoryChange(o,t){this.channelProductUploads.update(r=>r.map((a,d)=>(d==o&&(a.categoryId=t,a.attributes=[]),a)))}onAttributesChange(o,t){this.channelProductUploads.update(r=>r.map((a,d)=>(d==o&&(a.attributes=t),a)))}onSelectChannel(o,t,r){this.channelProductUploads.update(a=>a.map((d,v)=>{if(v==t&&o.selected){let Se=this.findCategoryByChannelId(o.id,r);d.categoryId=Se?.DefaultCategoryID}return v==t&&!o.selected&&(d.categoryId=null),d}))}findCategoryByChannelId(o,t){return t.find(r=>r.ID===o)}onUploadProduct(){this.uploadProductService.onUploadProduct(this.channelProductUploads())}ngOnDestroy(){this.uploadProductService.clearSelectedProduct()}};i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=x({type:i,selectors:[["app-product-upload"]],standalone:!0,features:[F([he,st,dt,ge]),U],decls:17,vars:5,consts:[["headerTitle","Upload Product To Channel",3,"hideSearchBox","hideSearchDropdown"],[1,"btn","btn-light","shadow","rounded","ms-2",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-upload"],[1,"container-fluid","mt-6"],[1,"ps-3","mt-8","pb-5","fw-medium"],[1,"row","mb-10","ps-3"],[1,"col-12","col-md-6","col-xl-4","px-3","my-3"],[1,"ps-3","mb-8","border-bottom","pb-5","fw-medium"],[1,"row","mb-6"],[3,"productId","title","image","description","imageForZoom","code","showFooter"],[1,"col-12"],[1,"row"],[1,"col-3"],[1,"d-flex","align-items-center"],[4,"ngIf"],[3,"typeId"],[2,"overflow","hidden","text-overflow","ellipsis","white-space","nowrap",3,"matTooltip","matTooltipShowDelay"],[1,"w-100"],["matTooltip","Cannot change category, please change category in admin.shopify.com","matTooltipPosition","above"],[3,"disabled","channelId","channelType","categoryId"],[1,"row","my-3"],["color","primary",1,"example-margin",3,"ngModelChange","ngModel"],["disabled","","type","text","placeholder","Category Unavailable",1,"form-control","rounded-1",2,"height","35px"],[3,"selectedCategory","disabled","channelId","channelType","categoryId"],[1,"col-12","ps-11"],[3,"categoryId","channelId","channelType"],[3,"categoryId","channelId"],[3,"attributesChanges","categoryId","channelId","channelType"],[3,"attributesChanges","categoryId","channelId"],[3,"attributesChanges","channelId"]],template:function(t,r){if(t&1&&(s(0,"mainpanel",0)(1,"actions")(2,"button",1),y("click",function(){return r.onUploadProduct()}),u(3,"i",2),h(4," Upload "),l()(),s(5,"content")(6,"div",3)(7,"h3",4),h(8,"Product To Upload"),l(),s(9,"div",5),R(10,ui,2,7,"div",6,$),S(12,"async"),l(),s(13,"h3",7),h(14,"Channel To Upload"),l(),R(15,Ii,19,9,"div",8,$),l()()()),t&2){let a;p("hideSearchBox",!0)("hideSearchDropdown",!0),m(2),p("disabled",((a=r.channelProductUploads())==null?null:a.length)==0),m(8),G(T(12,3,r.selectedProducts$)),m(5),G(r.channelProductUploads())}},dependencies:[I,A,E,xt,rt,ot,St,It,lt,at,oe,j,ze,nt,it,Nt,Ot,wt,Dt,Vt,ft,Ft],encapsulation:2});let e=i;return e})();export{yr as ProductUploadComponent};
|