marketplacepos 5.41.1 → 5.41.2
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-ZBW2ISZY.js → chunk-4DV4IT7R.js} +1 -1
- package/Marketplace/{chunk-M3OOU4DF.js → chunk-4HZR3O3W.js} +1 -1
- package/Marketplace/{chunk-6IOVMVRS.js → chunk-4JG3ZRYP.js} +2 -2
- package/Marketplace/{chunk-ZMVP6H6B.js → chunk-4YOHPIVG.js} +1 -1
- package/Marketplace/{chunk-NJFNMUFH.js → chunk-5JYR3YJW.js} +1 -1
- package/Marketplace/{chunk-FSJSQVUK.js → chunk-5ZX2OVBB.js} +1 -1
- package/Marketplace/{chunk-ZKPIENCH.js → chunk-6RSAOZUV.js} +1 -1
- package/Marketplace/{chunk-DVX3M74S.js → chunk-6SBCWEJJ.js} +1 -1
- package/Marketplace/{chunk-YZ74HE2T.js → chunk-6UEHSA6E.js} +1 -1
- package/Marketplace/{chunk-UAVYFLCM.js → chunk-7H5ILTTK.js} +1 -1
- package/Marketplace/{chunk-EL3GM6CV.js → chunk-BBVWQJ7M.js} +1 -1
- package/Marketplace/{chunk-26ZUWPMS.js → chunk-BM4KX73T.js} +1 -1
- package/Marketplace/{chunk-I3LFKNW4.js → chunk-C7QA2BEN.js} +1 -1
- package/Marketplace/{chunk-57YWGJWG.js → chunk-DG32XLYI.js} +1 -1
- package/Marketplace/{chunk-SQINA5SO.js → chunk-DS4AAABV.js} +1 -1
- package/Marketplace/{chunk-AYATC6J5.js → chunk-EL2JACEW.js} +1 -1
- package/Marketplace/{chunk-54JEYTAI.js → chunk-EVLYO3HX.js} +1 -1
- package/Marketplace/{chunk-TDIZT7CR.js → chunk-FUWROOE4.js} +1 -1
- package/Marketplace/{chunk-42Q6LYIG.js → chunk-H4PA2O6O.js} +1 -1
- package/Marketplace/{chunk-IUI6TA5K.js → chunk-H6WIS2HR.js} +1 -1
- package/Marketplace/{chunk-IL4YQGTS.js → chunk-HPGFBOM4.js} +1 -1
- package/Marketplace/{chunk-6RJV6M56.js → chunk-IARG7PLL.js} +1 -1
- package/Marketplace/chunk-IIMHYIRJ.js +1 -0
- package/Marketplace/{chunk-GPVSWXHS.js → chunk-KTIKLSOU.js} +1 -1
- package/Marketplace/{chunk-6L2THCHF.js → chunk-KTXS7IPU.js} +1 -1
- package/Marketplace/{chunk-XIYHWVQR.js → chunk-LOPJ3O56.js} +1 -1
- package/Marketplace/{chunk-5ANFGKBV.js → chunk-MCJRJUAO.js} +1 -1
- package/Marketplace/{chunk-U42BDUJ6.js → chunk-MGVYUYPC.js} +1 -1
- package/Marketplace/{chunk-B46KV6AB.js → chunk-MP43HA4R.js} +1 -1
- package/Marketplace/{chunk-CZOD43PN.js → chunk-P5FCWMYK.js} +1 -1
- package/Marketplace/{chunk-ZOJYBTIP.js → chunk-Q6V3IOGL.js} +1 -1
- package/Marketplace/{chunk-OH6LACWK.js → chunk-R5TTZPDX.js} +1 -1
- package/Marketplace/{chunk-UGAQVMUE.js → chunk-RHRJXX4W.js} +1 -1
- package/Marketplace/{chunk-DBHTTLSK.js → chunk-S3YMF63V.js} +1 -1
- package/Marketplace/{chunk-AS2UDXSX.js → chunk-SRJREA2O.js} +1 -1
- package/Marketplace/{chunk-XFFZDBGC.js → chunk-T4K3CJ2R.js} +1 -1
- package/Marketplace/{chunk-CZ2CQU4Q.js → chunk-TQ4ZLZ7C.js} +1 -1
- package/Marketplace/{chunk-WCY4XEUN.js → chunk-TQIIWFRF.js} +1 -1
- package/Marketplace/{chunk-7P65ADBU.js → chunk-UDQBFSOV.js} +1 -1
- package/Marketplace/{chunk-M7ZBU4PP.js → chunk-UYW53K3I.js} +1 -1
- package/Marketplace/{chunk-AFSORQR4.js → chunk-WTAJSWM2.js} +2 -2
- package/Marketplace/{chunk-UT7K3K63.js → chunk-WX5S3HCU.js} +1 -1
- package/Marketplace/{chunk-HZFWCHSY.js → chunk-XGYBJAFE.js} +1 -1
- package/Marketplace/{chunk-YISSSY6C.js → chunk-YP2IPJ2O.js} +1 -1
- package/Marketplace/{chunk-MYLIBJND.js → chunk-Z3KD73SP.js} +2 -2
- package/Marketplace/{chunk-BVLV6UAF.js → chunk-ZGZ74AJR.js} +1 -1
- package/Marketplace/{chunk-HNVG4QKG.js → chunk-ZLNGASME.js} +1 -1
- package/Marketplace/index.html +2 -2
- package/Marketplace/{main-B54MN6EI.js → main-SPNULRF2.js} +1 -1
- package/package.json +1 -1
- package/Marketplace/chunk-BXFJ3LAT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as M}from"./chunk-REL734JM.js";import{a as fe}from"./chunk-ZNDU44GH.js";import"./chunk-F4GMWHYJ.js";import{a as D}from"./chunk-5DIRXS7I.js";import"./chunk-VRI3CYGG.js";import"./chunk-AVEGIEYT.js";import{a as re}from"./chunk-Z3ITXK3D.js";import{a as pe}from"./chunk-ACIMXBIC.js";import"./chunk-CMZW5QAE.js";import{b as ae}from"./chunk-4M63ID5T.js";import"./chunk-K5XRGNWG.js";import{c as oe}from"./chunk-PW42BQIY.js";import{m as ce,n as ue}from"./chunk-6X2OBNJQ.js";import{z as ie}from"./chunk-CSSG7NAJ.js";import"./chunk-MZI5AYCE.js";import{b as le,c as se}from"./chunk-UJYSVGLV.js";import{r as de,s as me}from"./chunk-HFKKITEW.js";import"./chunk-OZ77CAJD.js";import{E as Y,G as ee,H as te,J as ne,d as K,g as Q,j as W,m as X,n as S}from"./chunk-MTUIRWOB.js";import{$c as y,Gb as x,Gc as s,Hc as v,Ic as z,Jb as F,Mb as c,Nc as q,Oc as $,Pc as C,Qc as j,Sc as I,Tc as J,Yb as p,Z as V,aa as w,ac as U,ad as _,dc as P,ec as k,gc as A,hc as H,ic as a,jc as r,kc as u,lc as g,mc as h,ob as L,oc as B,pa as b,rb as l,rd as Z,tc as G,uc as m,v as T,ya as R,za as N}from"./chunk-JS55A2RS.js";import"./chunk-EU2KAMEK.js";import{a as E,b as O}from"./chunk-66YHNWRR.js";var ge=(()=>{class t{transform(e){return typeof e=="number"&&(e=e.toString()),e!=null?e.replace(/\n/g,"<br />"):e}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275pipe=F({name:"newlines",type:t,pure:!0})}}return t})();var Ce=t=>({disabled:t}),ye=(t,d)=>({labelFilledInput:t,labelEmptyInput:d});function _e(t,d){if(t&1&&(a(0,"p"),s(1),y(2,"number"),r()),t&2){let e=m();l(),v(e.inputValueType()==="number"?_(2,1,e.inputValue):e.inputValue)}}function xe(t,d){if(t&1&&(u(0,"p",3),y(1,"newlines")),t&2){let e=m();p("innerHTML",_(1,1,e.inputValue),L)}}function Ie(t,d){if(t&1&&(g(0),s(1),h()),t&2){let e=m();l(),z(" ",e.labelValue," ")}}var he=(()=>{class t{constructor(){this.inputValue="",this.labelValue="",this.inputType="input",this.labelVisible=!0,this.disabled=!1,this.class="mb-6",this.tooltip="",this.isInputFilled=!1,this.isNotEmpty=pe.IsNotEmpty}inputValueType(){return typeof this.inputValue}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["lib-info-page-input"]],inputs:{inputValue:"inputValue",labelValue:"labelValue",inputType:"inputType",labelVisible:"labelVisible",disabled:"disabled",class:"class",tooltip:"tooltip"},decls:5,vars:14,consts:[["matTooltipPosition","above",3,"ngClass","matTooltip"],[4,"ngIf"],[3,"innerHTML",4,"ngIf"],[3,"innerHTML"]],template:function(o,n){o&1&&(a(0,"div",0),c(1,_e,3,3,"p",1)(2,xe,2,3,"p",2),a(3,"label"),c(4,Ie,2,1,"ng-container",1),r()()),o&2&&(U(n.class),p("ngClass",I(9,Ce,n.disabled))("matTooltip",n.tooltip),l(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="input"),l(),p("ngIf",n.isNotEmpty(n.inputValue)&&n.inputType=="textarea"),l(),U(J(11,ye,n.isNotEmpty(n.inputValue),!n.isNotEmpty(n.inputValue))),l(),p("ngIf",n.labelVisible))},dependencies:[S,K,Q,X,ge,me,de],styles:["div[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;margin-bottom:1rem;border-radius:.25rem!important}p[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}.labelEmptyInput[_ngcontent-%COMP%]{margin-top:18px;margin-bottom:18px;padding-left:.75rem!important;font-size:.875rem;color:#ccc}.disabled[_ngcontent-%COMP%]{background-color:#e9ecef;opacity:1}"]})}}return t})();var Se=t=>({ID:t});function Te(t,d){if(t&1){let e=B();a(0,"button",23),G("click",function(){R(e);let n=m(2),i=C(0);return N(n.onDeleteUser(i==null||i.selectedUser==null?null:i.selectedUser.ID))}),u(1,"i",24),s(2," Delete "),r()}}function Ue(t,d){if(t&1&&(g(0),c(1,Te,3,0,"button",22),h()),t&2){let e,o=m(),n=C(0);l(),P((n==null||n.selectedUser==null?null:n.selectedUser.Name)!==((e=o.currentLoginUser())==null?null:e.username)?1:-1)}}function Pe(t,d){if(t&1&&(g(0),a(1,"a",25),u(2,"i",26),s(3," Edit "),r(),h()),t&2){m();let e=C(0);l(),p("queryParams",I(1,Se,e==null||e.selectedUser==null?null:e.selectedUser.ID))}}function De(t,d){t&1&&(a(0,"div",19),s(1," All channels assigned to this user "),r())}function Me(t,d){if(t&1&&u(0,"p-chip",27),t&2){let e=d.$implicit;p("label",e.Name)("image",e.logo)("alt",e.Name)}}function Ee(t,d){if(t&1&&A(0,Me,1,3,"p-chip",27,k),t&2){m();let e=C(0);H(e==null?null:e.selectedChannels)}}var ot=(()=>{class t{constructor(){this.userService=b(M),this.activatedRoute=b(Y),this.toastService=b(ae),this.router=b(ee),this.userLoader$=this.activatedRoute.queryParams.pipe(w(e=>{let o=e.ID||null;return this.userService.getUserFormLoader(o).pipe(V(1),T(n=>(n.Options.Channels=oe.assignChannelLogo(n.Options.Channels),n)))}),T(e=>{let o=e.Options.Users.find(f=>f.ID===e.Form?.ID),n=e.Options.Groups.find(f=>f.ID===e.Form?.GroupID),i=e.Options.Channels.filter(f=>e.UserChannels?.includes(f.ID));return O(E({},e),{selectedUser:o||null,selectedGroup:n||null,selectedChannels:i||[],DownloadOrderDaysRange:e.Form?.DownloadOrderDaysRange||"0"})})),this.userEditRole=D.UserEdit,this.userDeleteRole=D.UserDelete,this.currentLoginUser=Z(()=>{let e=localStorage.getItem(re.AUTHORIZATION);return e?JSON.parse(e):null})}onDeleteUser(e){confirm("Are you sure you want to delete this user?")&&this.userService.deleteUsers([e]).subscribe({next:()=>{this.router.navigate(["/menu/users/users"]),this.toastService.success("User deleted successfully","Success")}})}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275cmp=x({type:t,selectors:[["app-user-info"]],features:[j([M])],decls:53,vars:12,consts:[[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","group","aria-label","User Actions",1,"btn-group"],[4,"ngxPermissionsOnly"],[1,"container-fluid","py-5","bg-light-gray"],[1,"row","mt-8"],[1,"col-12"],[1,"card"],[1,"card-header"],[1,"card-body","mt-8","pb-4"],[1,"row"],[1,"col-6"],[1,"info-label-group"],[1,"card-body","mt-8","pb-10"],["id","myTab","role","tablist",1,"nav","nav-tabs"],["role","presentation",1,"nav-item"],["id","channel-tab","data-bs-toggle","tab","data-bs-target","#channel-tab-pane","type","button","role","tab","aria-controls","channel-tab-pane","aria-selected","true",1,"nav-link","active"],["id","restriction-tab","data-bs-toggle","tab","data-bs-target","#restriction-tab-pane","type","button","role","tab","aria-controls","restriction-tab-pane","aria-selected","false",1,"nav-link"],["id","myTabContent",1,"tab-content","mt-3"],["id","channel-tab-pane","role","tabpanel","aria-labelledby","channel-tab","tabindex","0",1,"tab-pane","fade","show","active"],[1,"text-center","mt-5","fs-5","opacity-50"],["id","restriction-tab-pane","role","tabpanel","aria-labelledby","restriction-tab-pane","tabindex","1",1,"tab-pane","fade"],["tooltip","How many days of past orders this user can download.","labelValue","Download Order Days Range","inputType","input",3,"inputValue"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash","me-1"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-outline-secondary",3,"queryParams"],[1,"fa","fa-edit","me-1"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"]],template:function(o,n){if(o&1&&(q(0),y(1,"async"),a(2,"mainpanel",0)(3,"actions")(4,"div",1),c(5,Ue,2,1,"ng-container",2)(6,Pe,4,3,"ng-container",2),r()(),a(7,"content")(8,"div",3)(9,"div",4)(10,"div",5)(11,"div",6)(12,"div",7)(13,"h3"),s(14,"User Information"),r()(),a(15,"div",8)(16,"div",9)(17,"div",10)(18,"div",11)(19,"label"),s(20,"Selected User"),r(),a(21,"div")(22,"span"),s(23),r()()()(),a(24,"div",10)(25,"div",11)(26,"label"),s(27,"Selected Group"),r(),a(28,"div")(29,"span"),s(30),r()()()()()()()()(),a(31,"div",9)(32,"div",5)(33,"div",6)(34,"div",7)(35,"h3"),s(36,"Advanced"),r()(),a(37,"div",12)(38,"ul",13)(39,"li",14)(40,"button",15),s(41," Channels "),r()(),a(42,"li",14)(43,"button",16),s(44," Restriction "),r()()(),a(45,"div",17)(46,"div",18),c(47,De,2,0,"div",19)(48,Ee,2,0),r(),a(49,"div",20)(50,"div",9)(51,"div",10),u(52,"lib-info-page-input",21),r()()()()()()()()()()()),o&2){let i=$(_(1,9,n.userLoader$));l(2),p("headerTitle",(i==null||i.selectedUser==null?null:i.selectedUser.Name)+" Info")("hideSearchBox",!0)("hideSearchDropdown",!0),l(3),p("ngxPermissionsOnly",n.userDeleteRole),l(),p("ngxPermissionsOnly",n.userEditRole),l(17),v(i==null||i.selectedUser==null?null:i.selectedUser.LoginID),l(7),v(i==null||i.selectedGroup==null?null:i.selectedGroup.Name),l(17),P((i==null||i.selectedChannels==null?null:i.selectedChannels.length)===0?47:48),l(5),p("inputValue",i==null?null:i.DownloadOrderDaysRange)}},dependencies:[S,W,ue,ce,ie,ne,te,fe,se,le,he],styles:[".nav-tabs[_ngcontent-%COMP%] .nav-link.active[_ngcontent-%COMP%], .nav-tabs[_ngcontent-%COMP%] .nav-item.show[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{color:#495057;background-color:#fff;border-color:#dee2e6 #dee2e6 #fff}"]})}}return t})();export{ot as UserInfoComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as L}from"./chunk-PBGDP6XV.js";import{a as Be}from"./chunk-BQTUAYGY.js";import"./chunk-AGRVVEIR.js";import"./chunk-ZNDU44GH.js";import"./chunk-5XI7HWS5.js";import"./chunk-WGXUKTYP.js";import"./chunk-4CTORK4F.js";import{a as K}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as Le,c as Ae,d as Y}from"./chunk-GOS4RIF2.js";import{a as Te,b as Ee,c as Pe}from"./chunk-FBZW4Y3J.js";import"./chunk-NZA4BEER.js";import"./chunk-JV4MMNGD.js";import"./chunk-GZXQUJKX.js";import"./chunk-ALKC77XL.js";import"./chunk-NTW6FBP5.js";import"./chunk-LR4UZ2OS.js";import"./chunk-F4GMWHYJ.js";import{b as Re}from"./chunk-GPC4DECX.js";import"./chunk-SIYMMMKQ.js";import"./chunk-WHZ44BAL.js";import{a as De,b as ke}from"./chunk-UPYS4A4M.js";import{a as Ve}from"./chunk-JOBWFOGC.js";import"./chunk-PO7JVKK3.js";import"./chunk-LHD7CYML.js";import"./chunk-DJILLV4M.js";import{a as Me}from"./chunk-SH7KN2AS.js";import"./chunk-OKAPL3YZ.js";import"./chunk-SDUUFQUI.js";import"./chunk-3RK6DDJD.js";import"./chunk-MQXPOHBV.js";import"./chunk-M5IQRAHV.js";import{a as H}from"./chunk-5DIRXS7I.js";import"./chunk-OZ7LWNOK.js";import"./chunk-VRI3CYGG.js";import"./chunk-AVEGIEYT.js";import{e as Se}from"./chunk-SYENQYR7.js";import"./chunk-2ZTDLZVZ.js";import"./chunk-2TZBEYNY.js";import"./chunk-SXLKJLAE.js";import{i as fe}from"./chunk-I3LFKNW4.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CMZW5QAE.js";import{b as ue,e as he}from"./chunk-4M63ID5T.js";import"./chunk-K5XRGNWG.js";import"./chunk-HPYTL6TX.js";import{c as f}from"./chunk-PW42BQIY.js";import{d as Ie,l as we,m as be,n as Fe}from"./chunk-6X2OBNJQ.js";import{b as se,c as ce,h as pe,m as me,o as _e,z as de}from"./chunk-CSSG7NAJ.js";import"./chunk-MZI5AYCE.js";import{a as Ce,b as ge,c as xe}from"./chunk-UJYSVGLV.js";import{r as ve,s as ye}from"./chunk-HFKKITEW.js";import"./chunk-OZ77CAJD.js";import{d as te,g as ie,j as oe,k as ae,m as le,n as re}from"./chunk-MTUIRWOB.js";import{$c as g,Fc as z,G as q,Gb as X,Gc as p,Hc as k,Ic as V,Kc as w,Lc as b,Mb as u,Mc as F,Qc as ne,Ra as R,Sc as M,Yb as m,Z as $,ac as J,ad as v,bd as N,cd as G,dc as y,ea as O,ec as W,gc as j,hc as Q,ic as a,jc as r,kc as x,lc as E,mc as P,oc as S,pa as U,pb as D,rb as s,tc as h,uc as l,v as B,xb as I,xc as ee,ya as _,za as d}from"./chunk-JS55A2RS.js";import"./chunk-EU2KAMEK.js";import{a as A}from"./chunk-66YHNWRR.js";var Z=t=>[t],Ue=t=>({"text-decoration-line-through":t}),We=t=>({"me-10":t}),je=t=>({"bg-gradient-warning":t}),Qe=t=>({cursor:t});function ze(t,c){if(t&1){let e=S();a(0,"button",39),h("click",function(){_(e);let n=l().ngIf,i=l(2);return d(i.onScanInventory(n))}),x(1,"i",40),p(2,"Refresh "),r()}}function Ge(t,c){if(t&1){let e=S();a(0,"div",37)(1,"button",41),h("click",function(){_(e);let n=l().ngIf,i=l(2);return d(i.updateStock(n))}),x(2,"i",42),p(3," Update "),r(),x(4,"button",43),a(5,"ul",44)(6,"a",45),h("click",function(){_(e);let n=l(3);return d(n.openExportDialog())}),x(7,"i",46),a(8,"span"),p(9,"Export"),r()()()()}}function He(t,c){if(t&1){let e=S();a(0,"button",47),h("click",function(){_(e);let n=l(3);return d(n.openExportDialog())}),x(1,"i",46),a(2,"span"),p(3,"Export"),r()()}}function Ye(t,c){if(t&1&&(a(0,"div"),u(1,ze,3,0,"button",36)(2,Ge,10,0,"div",37)(3,He,4,0,"button",38),r()),t&2){let e=c.ngIf,o=l(2);s(),m("ngIf",o.productService.hasSelectionVariant(e)),s(),y(o.productService.hasSelectionVariant(e)?2:3)}}function Ke(t,c){t&1&&(a(0,"div",48)(1,"span"),p(2," showing only different stock, please press next to populate more data "),r()())}function Ze(t,c){if(t&1){let e=S();a(0,"th")(1,"input",49),F("ngModelChange",function(n){_(e);let i=l(3);return b(i.checkboxState,n)||(i.checkboxState=n),d(n)}),h("ngModelChange",function(){let n=_(e).ngIf,i=l(3);return d(i.onCheckboxStateChange(n))}),r()()}if(t&2){let e=l(3);s(),w("ngModel",e.checkboxState)}}function qe(t,c){if(t&1&&(E(0),u(1,Ze,2,1,"th",5),g(2,"async"),P()),t&2){let e=l(2);s(),m("ngIf",v(2,1,e.products$))}}function Xe(t,c){t&1&&(a(0,"th",33),p(1," Reserved "),r())}function Je(t,c){if(t&1){let e=S();a(0,"input",65),F("ngModelChange",function(n){_(e);let i=l(4).$implicit;return b(i.selected,n)||(i.selected=n),d(n)}),h("ngModelChange",function(){_(e);let n=l(4).$implicit,i=l(2);return d(i.onCheckboxStateProduct(n))}),r()}if(t&2){let e=l(4).$implicit;w("ngModel",e.selected)}}function en(t,c){if(t&1&&(E(0),a(1,"div",63),u(2,Je,1,1,"input",64),r(),P()),t&2){let e=l(3).$implicit;s(),m("ngClass",M(2,We,e.Variants.length<=1)),s(),y(e.Variants.length>1?2:-1)}}function nn(t,c){if(t&1){let e=S();a(0,"img",66),h("click",function(n){_(e);let i=l(3).$implicit,C=l(2);return d(C.onZoomImage(n,i==null?null:i.ImageUrl))}),r()}if(t&2){let e=l(3).$implicit;ee("src",e==null?null:e.ThumbnailUrl,D)}}function tn(t,c){t&1&&x(0,"img",60)}function on(t,c){if(t&1&&(x(0,"br"),a(1,"div",67),x(2,"i",68),a(3,"small"),p(4),r()()),t&2){let e=l(3).$implicit;s(4),V("(",e==null?null:e.Category,")")}}function an(t,c){if(t&1&&(a(0,"td",58)(1,"div",14),u(2,en,3,4,"ng-container",27),a(3,"div"),u(4,nn,1,1,"img",59)(5,tn,1,0,"img",60),r()()(),a(6,"td",61)(7,"span",62),p(8),r(),u(9,on,5,1),r()),t&2){let e=l(2).$implicit,o=l(2);m("rowSpan",e==null?null:e.Variants.length),s(2),m("ngxPermissionsOnly",M(6,Z,o.inventoryUpdateRole)),s(2),y(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),k(e==null?null:e.Name),s(),y(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function ln(t,c){if(t&1){let e=S();a(0,"input",49),F("ngModelChange",function(n){_(e);let i=l(3).$implicit;return b(i.selected,n)||(i.selected=n),d(n)}),r()}if(t&2){let e=l(3).$implicit;w("ngModel",e.selected)}}function rn(t,c){if(t&1&&u(0,ln,1,1,"input",70),t&2){let e=l(2).$implicit;y((e==null?null:e.Inventory)<=1e5?0:-1)}}function sn(t,c){if(t&1){let e=S();a(0,"input",49),F("ngModelChange",function(n){_(e);let i=l(2).$implicit;return b(i.selected,n)||(i.selected=n),d(n)}),r()}if(t&2){let e=l(2).$implicit;w("ngModel",e.selected)}}function cn(t,c){if(t&1&&(E(0),a(1,"td",69),u(2,rn,1,1)(3,sn,1,1,"input",70),r(),P()),t&2){let e=l().$implicit;s(2),y((e==null?null:e.Channel[0].TypeID)==1?2:(e==null?null:e.Inventory)>=0?3:-1)}}function pn(t,c){t&1&&(a(0,"div",71),p(1," Not Found "),r())}function mn(t,c){if(t&1&&(a(0,"div")(1,"span",72),p(2),g(3,"number"),r(),p(4," => "),a(5,"span",73),p(6),g(7,"number"),r()()),t&2){let e=l().$implicit;s(2),V(" ",v(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),k(v(7,4,e==null?null:e.Inventory))}}function _n(t,c){if(t&1&&(p(0),g(1,"number")),t&2){let e=l().$implicit;V(" ",v(1,1,e==null?null:e.Inventory)," ")}}function dn(t,c){if(t&1&&(E(0),a(1,"div",74)(2,"a",75),x(3,"i",76),r()(),P()),t&2){let e=l().$implicit,o=l(3);s(2),m("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),D)}}function un(t,c){if(t&1){let e=S();a(0,"span",81),h("click",function(){_(e);let n=l(2).$implicit,i=l().$implicit,C=l(2);return d(C.openTableDialog(i,n))}),p(1),g(2,"number"),r()}if(t&2){let e=l(2).$implicit,o=l(3);J(M(5,Qe,o.hasInventoryEdit())),s(),V(" ",v(2,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function hn(t,c){if(t&1){let e=S();a(0,"td",77)(1,"div",53)(2,"div"),u(3,un,3,7,"span",78),g(4,"async"),r(),a(5,"div",74)(6,"a",75),x(7,"i",76),r()(),a(8,"div",74)(9,"span",79),h("click",function(){_(e);let n=l().$implicit,i=l(3);return d(i.refreshInventory(n==null||n.Channel[0]==null?null:n.Channel[0].ChannelItemID,n==null||n.Channel[0]==null?null:n.Channel[0].ChannelVariationID,n==null||n.Channel[0]==null?null:n.Channel[0].ChannelID,n==null?null:n.ID))}),x(10,"i",80),r()()()()}if(t&2){let e=l().$implicit,o=l(3);m("ngClass",M(5,je,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",v(4,3,o.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,D)}}function Cn(t,c){if(t&1&&(E(0),a(1,"span",82),p(2),g(3,"number"),r(),P()),t&2){let e=l(2).$implicit;s(2),V(" (",v(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function gn(t,c){t&1&&p(0," - ")}function xn(t,c){if(t&1&&(E(0),a(1,"td",51),u(2,Cn,4,3,"ng-container",57)(3,gn,1,0,"ng-template",null,1,G),r(),P()),t&2){let e=z(4),o=l().$implicit;s(2),m("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function fn(t,c){t&1&&(E(0),p(1," - "),P())}function Sn(t,c){if(t&1&&(a(0,"span",83),g(1,"date"),p(2),g(3,"date"),r()),t&2){let e=l().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),V(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function vn(t,c){if(t&1&&(a(0,"tr"),u(1,an,10,8),a(2,"td",50),p(3),r(),a(4,"td",51)(5,"span",52),p(6),r()(),u(7,cn,4,1,"ng-container",27),a(8,"td")(9,"div",53),u(10,pn,2,0,"div",54)(11,mn,8,6,"div")(12,_n,2,3)(13,dn,4,1,"ng-container",5),r()(),u(14,hn,11,7,"td",55)(15,xn,5,2,"ng-container",5),a(16,"td",56),u(17,fn,2,0,"ng-container",57)(18,Sn,4,8,"ng-template",null,0,G),r()()),t&2){let e=c.$implicit,o=c.$index,n=z(19),i=l(3);s(),y(o==0?1:-1),s(2),k(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",M(14,Ue,e.Discontinued)),s(),k(e==null?null:e.Code),s(),m("ngxPermissionsOnly",M(16,Z,i.inventoryUpdateRole)),s(3),m("ngIf",(e==null?null:e.I)==null),s(),y((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?11:-1),s(),y((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?12:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",n)}}function yn(t,c){if(t&1&&(a(0,"tbody"),j(1,vn,20,18,"tr",null,W),r()),t&2){let e=c.$implicit;s(),Q(e.Variants)}}function In(t,c){if(t&1){let e=S();a(0,"mainpanel",3),h("onSubmit",function(n){_(e);let i=l();return d(i.onSearch(n))}),a(1,"actions")(2,"div",4),u(3,Ye,4,2,"div",5),g(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),p(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),h("onChannelChange",function(n){_(e);let i=l();return d(i.onChannelChange(n))}),r()(),a(10,"div",8)(11,"label",9),p(12,"PageNumber"),r(),a(13,"input",10),F("ngModelChange",function(n){_(e);let i=l();return b(i.searchFilter.PageNumber,n)||(i.searchFilter.PageNumber=n),d(n)}),r()(),a(14,"div",8)(15,"label",11),p(16,"Page Size"),r(),a(17,"input",12),F("ngModelChange",function(n){_(e);let i=l();return b(i.searchFilter.RowCount,n)||(i.searchFilter.RowCount=n),d(n)}),r()(),a(18,"div",8)(19,"label",13),p(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),F("ngModelChange",function(n){_(e);let i=l();return b(i.searchFilter.QuantityFrom,n)||(i.searchFilter.QuantityFrom=n),d(n)}),r(),p(23," - "),a(24,"input",16),F("ngModelChange",function(n){_(e);let i=l();return b(i.searchFilter.QuantityTo,n)||(i.searchFilter.QuantityTo=n),d(n)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),u(29,Ke,3,0,"div",20),a(30,"table",21),h("matSortChange",function(n){_(e);let i=l();return d(i.onSortVariant(n))}),a(31,"thead",22)(32,"tr")(33,"th",23),p(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),h("toggleChange",function(){_(e);let n=l();return n.showDifferenceStock=!n.showDifferenceStock,d(n.onShowDifferenceStock())}),a(37,"small",13),p(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),p(40,"Variant"),r(),a(41,"th",26),p(42,"SKU"),r(),u(43,qe,3,3,"ng-container",27),a(44,"th",28),p(45," POS "),r(),a(46,"th",29)(47,"div",30),h("click",function(){_(e);let n=l();return d(n.openModalFilter())}),x(48,"img",31),a(49,"span",32),p(50),g(51,"stringLimit"),r()()(),u(52,Xe,2,0,"th",33),a(53,"th",34),p(54,"Last Sync"),r()()(),j(55,yn,3,0,"tbody",null,W),g(57,"async"),r(),a(58,"infinite-paginator",35),g(59,"async"),h("onNextPage",function(){_(e);let n=l();return d(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(e);let n=l();return d(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(e);let n=l();return d(n.infinitePagination.getRowCount(n.searchFilter))}),r()()()()()()}if(t&2){let e,o,n,i=l();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",v(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),w("ngModel",i.searchFilter.PageNumber),s(4),w("ngModel",i.searchFilter.RowCount),s(5),w("ngModel",i.searchFilter.QuantityFrom),s(2),w("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngxPermissionsOnly",M(30,Z,i.inventoryUpdateRole)),s(4),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(o=i.channelIdentity())==null?null:o.img,D),s(2),V(" ",N(51,23,(n=i.channelIdentity())==null?null:n.label,13)," "),s(2),y(i.isShowReservedColumn?52:-1),s(3),Q(v(57,26,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",v(59,28,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var st=(()=>{class t{constructor(e,o,n,i,C,T,$e,Oe){this.http=e,this.toastr=o,this.dialog=n,this.productService=i,this.authService=C,this.biggerPictureService=T,this.inventoryService=$e,this.mainPanelService=Oe,this.infinitePagination=U(Y),this.ngxPermissionsService=U(Ce),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.MinDate,this.isShowReservedColumn=!0,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.guidEmpty=f.GuidEMpty,this.selectedChannel=R(null),this.channelIdentity=R({img:null,label:null}),this.inventoryUpdateRole=H.InventoryUpdate,this.hasInventoryEdit=R(!0),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.initRoles(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe(O(e=>{this.checkShowReservedColumn(e)}),B(e=>(e=this.calculateAvailableStock(e),e)),$(1)),this.products$=this.sourceObs$}initRoles(){this.ngxPermissionsService.hasPermission(H.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e))}calculateAvailableStock(e){return e.map(n=>(n.totalAvailable=n.Variants.reduce((i,C)=>(i+=C.I?.Available||0,i),0),n))}checkShowReservedColumn(e){let o=0,n;e.forEach(i=>{n=i.Variants.find(C=>f.IsNotEmpty(C?.Channel[0]?.InventoryReserved)),n&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe($(1),O(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
1
|
+
import{a as L}from"./chunk-PBGDP6XV.js";import{a as Be}from"./chunk-BQTUAYGY.js";import"./chunk-AGRVVEIR.js";import"./chunk-ZNDU44GH.js";import"./chunk-5XI7HWS5.js";import"./chunk-WGXUKTYP.js";import"./chunk-4CTORK4F.js";import{a as K}from"./chunk-XHAXYWZ7.js";import{a as Ne,b as Le,c as Ae,d as Y}from"./chunk-GOS4RIF2.js";import{a as Te,b as Ee,c as Pe}from"./chunk-FBZW4Y3J.js";import"./chunk-NZA4BEER.js";import"./chunk-JV4MMNGD.js";import"./chunk-GZXQUJKX.js";import"./chunk-ALKC77XL.js";import"./chunk-NTW6FBP5.js";import"./chunk-LR4UZ2OS.js";import"./chunk-F4GMWHYJ.js";import{b as Re}from"./chunk-GPC4DECX.js";import"./chunk-SIYMMMKQ.js";import"./chunk-WHZ44BAL.js";import{a as De,b as ke}from"./chunk-UPYS4A4M.js";import{a as Ve}from"./chunk-JOBWFOGC.js";import"./chunk-PO7JVKK3.js";import"./chunk-LHD7CYML.js";import"./chunk-DJILLV4M.js";import{a as Me}from"./chunk-SH7KN2AS.js";import"./chunk-OKAPL3YZ.js";import"./chunk-SDUUFQUI.js";import"./chunk-3RK6DDJD.js";import"./chunk-MQXPOHBV.js";import"./chunk-M5IQRAHV.js";import{a as H}from"./chunk-5DIRXS7I.js";import"./chunk-OZ7LWNOK.js";import"./chunk-VRI3CYGG.js";import"./chunk-AVEGIEYT.js";import{e as Se}from"./chunk-SYENQYR7.js";import"./chunk-2ZTDLZVZ.js";import"./chunk-2TZBEYNY.js";import"./chunk-SXLKJLAE.js";import{i as fe}from"./chunk-C7QA2BEN.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CMZW5QAE.js";import{b as ue,e as he}from"./chunk-4M63ID5T.js";import"./chunk-K5XRGNWG.js";import"./chunk-HPYTL6TX.js";import{c as f}from"./chunk-PW42BQIY.js";import{d as Ie,l as we,m as be,n as Fe}from"./chunk-6X2OBNJQ.js";import{b as se,c as ce,h as pe,m as me,o as _e,z as de}from"./chunk-CSSG7NAJ.js";import"./chunk-MZI5AYCE.js";import{a as Ce,b as ge,c as xe}from"./chunk-UJYSVGLV.js";import{r as ve,s as ye}from"./chunk-HFKKITEW.js";import"./chunk-OZ77CAJD.js";import{d as te,g as ie,j as oe,k as ae,m as le,n as re}from"./chunk-MTUIRWOB.js";import{$c as g,Fc as z,G as q,Gb as X,Gc as p,Hc as k,Ic as V,Kc as w,Lc as b,Mb as u,Mc as F,Qc as ne,Ra as R,Sc as M,Yb as m,Z as $,ac as J,ad as v,bd as N,cd as G,dc as y,ea as O,ec as W,gc as j,hc as Q,ic as a,jc as r,kc as x,lc as E,mc as P,oc as S,pa as U,pb as D,rb as s,tc as h,uc as l,v as B,xb as I,xc as ee,ya as _,za as d}from"./chunk-JS55A2RS.js";import"./chunk-EU2KAMEK.js";import{a as A}from"./chunk-66YHNWRR.js";var Z=t=>[t],Ue=t=>({"text-decoration-line-through":t}),We=t=>({"me-10":t}),je=t=>({"bg-gradient-warning":t}),Qe=t=>({cursor:t});function ze(t,c){if(t&1){let e=S();a(0,"button",39),h("click",function(){_(e);let n=l().ngIf,i=l(2);return d(i.onScanInventory(n))}),x(1,"i",40),p(2,"Refresh "),r()}}function Ge(t,c){if(t&1){let e=S();a(0,"div",37)(1,"button",41),h("click",function(){_(e);let n=l().ngIf,i=l(2);return d(i.updateStock(n))}),x(2,"i",42),p(3," Update "),r(),x(4,"button",43),a(5,"ul",44)(6,"a",45),h("click",function(){_(e);let n=l(3);return d(n.openExportDialog())}),x(7,"i",46),a(8,"span"),p(9,"Export"),r()()()()}}function He(t,c){if(t&1){let e=S();a(0,"button",47),h("click",function(){_(e);let n=l(3);return d(n.openExportDialog())}),x(1,"i",46),a(2,"span"),p(3,"Export"),r()()}}function Ye(t,c){if(t&1&&(a(0,"div"),u(1,ze,3,0,"button",36)(2,Ge,10,0,"div",37)(3,He,4,0,"button",38),r()),t&2){let e=c.ngIf,o=l(2);s(),m("ngIf",o.productService.hasSelectionVariant(e)),s(),y(o.productService.hasSelectionVariant(e)?2:3)}}function Ke(t,c){t&1&&(a(0,"div",48)(1,"span"),p(2," showing only different stock, please press next to populate more data "),r()())}function Ze(t,c){if(t&1){let e=S();a(0,"th")(1,"input",49),F("ngModelChange",function(n){_(e);let i=l(3);return b(i.checkboxState,n)||(i.checkboxState=n),d(n)}),h("ngModelChange",function(){let n=_(e).ngIf,i=l(3);return d(i.onCheckboxStateChange(n))}),r()()}if(t&2){let e=l(3);s(),w("ngModel",e.checkboxState)}}function qe(t,c){if(t&1&&(E(0),u(1,Ze,2,1,"th",5),g(2,"async"),P()),t&2){let e=l(2);s(),m("ngIf",v(2,1,e.products$))}}function Xe(t,c){t&1&&(a(0,"th",33),p(1," Reserved "),r())}function Je(t,c){if(t&1){let e=S();a(0,"input",65),F("ngModelChange",function(n){_(e);let i=l(4).$implicit;return b(i.selected,n)||(i.selected=n),d(n)}),h("ngModelChange",function(){_(e);let n=l(4).$implicit,i=l(2);return d(i.onCheckboxStateProduct(n))}),r()}if(t&2){let e=l(4).$implicit;w("ngModel",e.selected)}}function en(t,c){if(t&1&&(E(0),a(1,"div",63),u(2,Je,1,1,"input",64),r(),P()),t&2){let e=l(3).$implicit;s(),m("ngClass",M(2,We,e.Variants.length<=1)),s(),y(e.Variants.length>1?2:-1)}}function nn(t,c){if(t&1){let e=S();a(0,"img",66),h("click",function(n){_(e);let i=l(3).$implicit,C=l(2);return d(C.onZoomImage(n,i==null?null:i.ImageUrl))}),r()}if(t&2){let e=l(3).$implicit;ee("src",e==null?null:e.ThumbnailUrl,D)}}function tn(t,c){t&1&&x(0,"img",60)}function on(t,c){if(t&1&&(x(0,"br"),a(1,"div",67),x(2,"i",68),a(3,"small"),p(4),r()()),t&2){let e=l(3).$implicit;s(4),V("(",e==null?null:e.Category,")")}}function an(t,c){if(t&1&&(a(0,"td",58)(1,"div",14),u(2,en,3,4,"ng-container",27),a(3,"div"),u(4,nn,1,1,"img",59)(5,tn,1,0,"img",60),r()()(),a(6,"td",61)(7,"span",62),p(8),r(),u(9,on,5,1),r()),t&2){let e=l(2).$implicit,o=l(2);m("rowSpan",e==null?null:e.Variants.length),s(2),m("ngxPermissionsOnly",M(6,Z,o.inventoryUpdateRole)),s(2),y(e!=null&&e.ThumbnailUrl?4:5),s(2),m("rowSpan",e==null?null:e.Variants.length),s(2),k(e==null?null:e.Name),s(),y(e.CategoryID!==null&&e.CategoryID!=o.guidEmpty?9:-1)}}function ln(t,c){if(t&1){let e=S();a(0,"input",49),F("ngModelChange",function(n){_(e);let i=l(3).$implicit;return b(i.selected,n)||(i.selected=n),d(n)}),r()}if(t&2){let e=l(3).$implicit;w("ngModel",e.selected)}}function rn(t,c){if(t&1&&u(0,ln,1,1,"input",70),t&2){let e=l(2).$implicit;y((e==null?null:e.Inventory)<=1e5?0:-1)}}function sn(t,c){if(t&1){let e=S();a(0,"input",49),F("ngModelChange",function(n){_(e);let i=l(2).$implicit;return b(i.selected,n)||(i.selected=n),d(n)}),r()}if(t&2){let e=l(2).$implicit;w("ngModel",e.selected)}}function cn(t,c){if(t&1&&(E(0),a(1,"td",69),u(2,rn,1,1)(3,sn,1,1,"input",70),r(),P()),t&2){let e=l().$implicit;s(2),y((e==null?null:e.Channel[0].TypeID)==1?2:(e==null?null:e.Inventory)>=0?3:-1)}}function pn(t,c){t&1&&(a(0,"div",71),p(1," Not Found "),r())}function mn(t,c){if(t&1&&(a(0,"div")(1,"span",72),p(2),g(3,"number"),r(),p(4," => "),a(5,"span",73),p(6),g(7,"number"),r()()),t&2){let e=l().$implicit;s(2),V(" ",v(3,2,e==null||e.I==null?null:e.I.Available),""),s(4),k(v(7,4,e==null?null:e.Inventory))}}function _n(t,c){if(t&1&&(p(0),g(1,"number")),t&2){let e=l().$implicit;V(" ",v(1,1,e==null?null:e.Inventory)," ")}}function dn(t,c){if(t&1&&(E(0),a(1,"div",74)(2,"a",75),x(3,"i",76),r()(),P()),t&2){let e=l().$implicit,o=l(3);s(2),m("href",o.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),D)}}function un(t,c){if(t&1){let e=S();a(0,"span",81),h("click",function(){_(e);let n=l(2).$implicit,i=l().$implicit,C=l(2);return d(C.openTableDialog(i,n))}),p(1),g(2,"number"),r()}if(t&2){let e=l(2).$implicit,o=l(3);J(M(5,Qe,o.hasInventoryEdit())),s(),V(" ",v(2,3,e==null||e.Channel[0]==null?null:e.Channel[0].Inventory)," ")}}function hn(t,c){if(t&1){let e=S();a(0,"td",77)(1,"div",53)(2,"div"),u(3,un,3,7,"span",78),g(4,"async"),r(),a(5,"div",74)(6,"a",75),x(7,"i",76),r()(),a(8,"div",74)(9,"span",79),h("click",function(){_(e);let n=l().$implicit,i=l(3);return d(i.refreshInventory(n==null||n.Channel[0]==null?null:n.Channel[0].ChannelItemID,n==null||n.Channel[0]==null?null:n.Channel[0].ChannelVariationID,n==null||n.Channel[0]==null?null:n.Channel[0].ChannelID,n==null?null:n.ID))}),x(10,"i",80),r()()()()}if(t&2){let e=l().$implicit,o=l(3);m("ngClass",M(5,je,(e==null?null:e.Inventory)!=(e==null||e.Channel[0]==null?null:e.Channel[0].Inventory))),s(3),m("ngIf",v(4,3,o.products$)),s(3),m("href",e==null||e.Channel[0]==null?null:e.Channel[0].Url,D)}}function Cn(t,c){if(t&1&&(E(0),a(1,"span",82),p(2),g(3,"number"),r(),P()),t&2){let e=l(2).$implicit;s(2),V(" (",v(3,1,e==null||e.Channel[0]==null?null:e.Channel[0].InventoryReserved),") ")}}function gn(t,c){t&1&&p(0," - ")}function xn(t,c){if(t&1&&(E(0),a(1,"td",51),u(2,Cn,4,3,"ng-container",57)(3,gn,1,0,"ng-template",null,1,G),r(),P()),t&2){let e=z(4),o=l().$implicit;s(2),m("ngIf",o==null||o.Channel[0]==null?null:o.Channel[0].InventoryReserved)("ngIfElse",e)}}function fn(t,c){t&1&&(E(0),p(1," - "),P())}function Sn(t,c){if(t&1&&(a(0,"span",83),g(1,"date"),p(2),g(3,"date"),r()),t&2){let e=l().$implicit;m("matTooltip",N(1,2,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMMM yyyy HH:mm:ss")),s(2),V(" ",N(3,5,e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync,"dd MMM yy HH:mm")," ")}}function vn(t,c){if(t&1&&(a(0,"tr"),u(1,an,10,8),a(2,"td",50),p(3),r(),a(4,"td",51)(5,"span",52),p(6),r()(),u(7,cn,4,1,"ng-container",27),a(8,"td")(9,"div",53),u(10,pn,2,0,"div",54)(11,mn,8,6,"div")(12,_n,2,3)(13,dn,4,1,"ng-container",5),r()(),u(14,hn,11,7,"td",55)(15,xn,5,2,"ng-container",5),a(16,"td",56),u(17,fn,2,0,"ng-container",57)(18,Sn,4,8,"ng-template",null,0,G),r()()),t&2){let e=c.$implicit,o=c.$index,n=z(19),i=l(3);s(),y(o==0?1:-1),s(2),k(e==null?null:e.Model),s(2),m("matTooltip",e.Discontinued?i.discontinuedVariantMsg:"")("ngClass",M(14,Ue,e.Discontinued)),s(),k(e==null?null:e.Code),s(),m("ngxPermissionsOnly",M(16,Z,i.inventoryUpdateRole)),s(3),m("ngIf",(e==null?null:e.I)==null),s(),y((e==null?null:e.I)!=null&&(e==null?null:e.Inventory)!=(e==null||e.I==null?null:e.I.Available)?11:-1),s(),y((e==null?null:e.Inventory)==(e==null||e.I==null?null:e.I.Available)?12:-1),s(),m("ngIf",(e==null?null:e.I)!=null),s(),m("ngIf",e==null?null:e.Channel),s(),m("ngIf",i.isShowReservedColumn),s(2),m("ngIf",(e==null||e.Channel[0]==null?null:e.Channel[0].LastInventorySync)==i.minDate)("ngIfElse",n)}}function yn(t,c){if(t&1&&(a(0,"tbody"),j(1,vn,20,18,"tr",null,W),r()),t&2){let e=c.$implicit;s(),Q(e.Variants)}}function In(t,c){if(t&1){let e=S();a(0,"mainpanel",3),h("onSubmit",function(n){_(e);let i=l();return d(i.onSearch(n))}),a(1,"actions")(2,"div",4),u(3,Ye,4,2,"div",5),g(4,"async"),r()(),a(5,"filters")(6,"div")(7,"label",6),p(8,"Channel"),r(),a(9,"multiwarehouse-tree-select",7),h("onChannelChange",function(n){_(e);let i=l();return d(i.onChannelChange(n))}),r()(),a(10,"div",8)(11,"label",9),p(12,"PageNumber"),r(),a(13,"input",10),F("ngModelChange",function(n){_(e);let i=l();return b(i.searchFilter.PageNumber,n)||(i.searchFilter.PageNumber=n),d(n)}),r()(),a(14,"div",8)(15,"label",11),p(16,"Page Size"),r(),a(17,"input",12),F("ngModelChange",function(n){_(e);let i=l();return b(i.searchFilter.RowCount,n)||(i.searchFilter.RowCount=n),d(n)}),r()(),a(18,"div",8)(19,"label",13),p(20,"Quantity From - To"),r(),a(21,"div",14)(22,"input",15),F("ngModelChange",function(n){_(e);let i=l();return b(i.searchFilter.QuantityFrom,n)||(i.searchFilter.QuantityFrom=n),d(n)}),r(),p(23," - "),a(24,"input",16),F("ngModelChange",function(n){_(e);let i=l();return b(i.searchFilter.QuantityTo,n)||(i.searchFilter.QuantityTo=n),d(n)}),r()()()(),a(25,"content")(26,"div",17)(27,"div",18)(28,"div",19),u(29,Ke,3,0,"div",20),a(30,"table",21),h("matSortChange",function(n){_(e);let i=l();return d(i.onSortVariant(n))}),a(31,"thead",22)(32,"tr")(33,"th",23),p(34," Product "),x(35,"br"),a(36,"mat-slide-toggle",24),h("toggleChange",function(){_(e);let n=l();return n.showDifferenceStock=!n.showDifferenceStock,d(n.onShowDifferenceStock())}),a(37,"small",13),p(38,"FILTER DIFFERENT INVENTORY"),r()()(),a(39,"th",25),p(40,"Variant"),r(),a(41,"th",26),p(42,"SKU"),r(),u(43,qe,3,3,"ng-container",27),a(44,"th",28),p(45," POS "),r(),a(46,"th",29)(47,"div",30),h("click",function(){_(e);let n=l();return d(n.openModalFilter())}),x(48,"img",31),a(49,"span",32),p(50),g(51,"stringLimit"),r()()(),u(52,Xe,2,0,"th",33),a(53,"th",34),p(54,"Last Sync"),r()()(),j(55,yn,3,0,"tbody",null,W),g(57,"async"),r(),a(58,"infinite-paginator",35),g(59,"async"),h("onNextPage",function(){_(e);let n=l();return d(n.infinitePagination.onNextPage(n.searchFilter))})("onLastPage",function(){_(e);let n=l();return d(n.infinitePagination.onLastPage(n.searchFilter))})("onGetRowCount",function(){_(e);let n=l();return d(n.infinitePagination.getRowCount(n.searchFilter))}),r()()()()()()}if(t&2){let e,o,n,i=l();m("headerTitle","Inventory Comparison")("pageData",i.pageData)("hideSearchBox",!1),s(3),m("ngIf",v(4,21,i.products$)),s(6),m("ngModel",(i.searchFilter==null?null:i.searchFilter.LocationID)||(i.searchFilter==null?null:i.searchFilter.ChannelID)),s(4),w("ngModel",i.searchFilter.PageNumber),s(4),w("ngModel",i.searchFilter.RowCount),s(5),w("ngModel",i.searchFilter.QuantityFrom),s(2),w("ngModel",i.searchFilter.QuantityTo),s(5),m("ngIf",(i.searchFilter==null?null:i.searchFilter.filterModel)==3),s(14),m("ngxPermissionsOnly",M(30,Z,i.inventoryUpdateRole)),s(4),m("matTooltip",((e=i.channelIdentity())==null||e.label==null?null:e.label.length)>13?(e=i.channelIdentity())==null?null:e.label:""),s(),m("src",(o=i.channelIdentity())==null?null:o.img,D),s(2),V(" ",N(51,23,(n=i.channelIdentity())==null?null:n.label,13)," "),s(2),y(i.isShowReservedColumn?52:-1),s(3),Q(v(57,26,i.products$)),s(3),m("totalData",i.infinitePagination.totalData())("hideCount",i.infinitePagination.hideCount())("rowCount",v(59,28,i.infinitePagination.totalRowCount$))("pageNumber",i.infinitePagination.pageNumber())("disableNextButton",i.infinitePagination.disableNextButton())("goToLastPage",i.infinitePagination.isLastPage())}}var st=(()=>{class t{constructor(e,o,n,i,C,T,$e,Oe){this.http=e,this.toastr=o,this.dialog=n,this.productService=i,this.authService=C,this.biggerPictureService=T,this.inventoryService=$e,this.mainPanelService=Oe,this.infinitePagination=U(Y),this.ngxPermissionsService=U(Ce),this.checkboxState=!1,this.showDifferenceStock=!1,this.loaderApi="InventoryLoader/Load",this.fetchApi="Inventory/GetSingleChannelComparison",this.rowCountApi="Inventory/GetInventoryByChannelRowCount",this.minDate=f.MinDate,this.isShowReservedColumn=!0,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.guidEmpty=f.GuidEMpty,this.selectedChannel=R(null),this.channelIdentity=R({img:null,label:null}),this.inventoryUpdateRole=H.InventoryUpdate,this.hasInventoryEdit=R(!0),this.pageData={Title:"Inventory Realtime",Nav:[{Title:"Inventory Cache",Url:"/menu/inventory",Active:!1},{Title:"Inventory Realtime",Url:"/menu/inventory/realtime",Active:!0}]}}ngOnInit(){this.initRoles(),this.hostName=this.authService.getDomain(),this.initPageLoader(),this.sourceObs$=this.infinitePagination.data$.pipe(O(e=>{this.checkShowReservedColumn(e)}),B(e=>(e=this.calculateAvailableStock(e),e)),$(1)),this.products$=this.sourceObs$}initRoles(){this.ngxPermissionsService.hasPermission(H.InventoryUpdate).then(e=>this.hasInventoryEdit.set(e))}calculateAvailableStock(e){return e.map(n=>(n.totalAvailable=n.Variants.reduce((i,C)=>(i+=C.I?.Available||0,i),0),n))}checkShowReservedColumn(e){let o=0,n;e.forEach(i=>{n=i.Variants.find(C=>f.IsNotEmpty(C?.Channel[0]?.InventoryReserved)),n&&(o+=1)}),this.isShowReservedColumn=o>0}initPageLoader(){this.infinitePagination.fetchDataEndpoint=this.fetchApi,this.infinitePagination.fethRowCountEndpoint=this.rowCountApi,this.loader$=this.http.post(`/api/${this.loaderApi}`,{}).pipe($(1),O(e=>{this.searchFilter={RowCount:e.Filter.PageSize,filterModel:1,PageNumber:1,ChannelID:e.Filter.ChannelID,LocationID:e.Filter.LocationID},this.initReloadData(),this.showToastrMarketplaceInactive(!e.Filter.IsMarketplaceAppActive)}))}onChannelChange(e){let o=Object.assign({},e);this.selectedChannel.set(o),f.IsEmpty(this.channelIdentity()?.label)&&this.setChannelFilter()}setChannelFilter(){if(this.selectedChannel()){let e=Object.assign({},this.selectedChannel());f.IsNotEmpty(e.parent)?(this.searchFilter.LocationID=e.id,this.searchFilter.ChannelID=e?.parent?.id,e.label=e?.parent?.label+" - "+e?.label,e.img=f.getChannelLogoByTypeId(e?.parent?.typeid)):(this.searchFilter.LocationID=null,e.img=f.getChannelLogoByTypeId(e?.typeid),this.searchFilter.ChannelID=e?.id,this.selectedChannel.set(e)),this.channelIdentity.update(()=>({img:e.img,label:e.label}))}}initReloadData(){this.infinitePagination.reloadPagination(this.searchFilter)}showToastrMarketplaceInactive(e){e&&this.toastr.warning(`Automatic inventory sync disabled.
|
|
2
2
|
Please enable Dealpos X Marketplace Apps integration in POS Configuration`,"Warning")}onSearch(e){this.searchFilter.text=e,this.setChannelFilter(),this.initReloadData()}openModalFilter(){this.mainPanelService.openModalFilter()}updateStock(e){let o=this.productService.selectedVariantProduct(e);if(o.length>0){let n=this.searchFilter.LocationID,i=o.map(T=>A({ID:T.ID,Code:T.Code,Inventory:T.Inventory},f.IsNotEmpty(n)&&{LocationID:n})),C={ListChannelID:[this.searchFilter.ChannelID],List:i};this.http.post("/api/Inventory/UpdateChannel",C).subscribe(T=>{this.initReloadData(),this.checkboxState=!1,this.handlingUpdateStock(T)})}}handlingUpdateStock(e){if(e[0]?.Response){let o=e[0]?.Response?.Fail_list,n=e[0]?.Response?.Success_list;this.inventoryService.showToastrUpdateInventory("Stock",n,o)}else this.toastr.error(e[0]?.Exception,"Error")}refreshInventory(e,o,n,i){let C={ChannelItemID:e,ChannelVariationID:o,ChannelID:n,VariantID:i};this.http.post("/api/Inventory/RefreshInventoryChannel",C).subscribe(T=>{this.toastr.success("Successfully updated","Success"),this.initReloadData()})}onCheckboxStateProduct(e){e.Variants=e.Variants.map(o=>(o.Inventory>=0&&(o.selected=e.selected),o))}onCheckboxStateChange(e){e=e.map(o=>(o.Variants=o.Variants.map(n=>(n.selected=this.checkboxState,n)),o))}openTableDialog(e,o){this.hasInventoryEdit()&&this.dialog.open(Ne,{data:{Name:e.Name,Variant:o,ChannelID:o?.Channel[0].ChannelID,Table:"inventory",ChannelItemID:e.ChannelItemID}}).afterClosed().pipe(q(i=>f.IsNotEmpty(i))).subscribe(i=>{this.updateItemAfterDialog(i)})}updateItemAfterDialog(e){let o=this.searchFilter.LocationID,n=A({ID:e.ChannelID,ChannelItemID:e.ChannelItemID,ChannelVariantID:e.ChannelVariationID,NewQuantity:parseFloat(e.Inventory),VariantID:e.ID,SKU:e.Sku},f.IsNotEmpty(o)&&{LocationID:o});this.http.post("/api/Inventory/UpdateQuantityByItem",n).subscribe(i=>{this.searchFilter.PageNumber=1,this.initReloadData(),this.handlingUpdateStock([i])})}onScanInventory(e){let o=this.productService.selectedVariantProduct(e);this.inventoryService.refreshInventory(o).subscribe(()=>{this.initReloadData(),this.toastr.success("Inventory refreshed successfully","Success")})}openExportDialog(){this.dialog.open(Re,{data:{title:"Export Inventory Single Channel Comparison",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountApi,QuantityFrom:this.searchFilter.QuantityFrom,QuantityTo:this.searchFilter.QuantityTo,exportApi:"Inventory/GetExportSingleChannelComparison"}}).afterClosed().subscribe()}onShowDifferenceStock(){this.showDifferenceStock?this.searchFilter.filterModel=K.DIFFERENCE:this.searchFilter.filterModel=K.ALL,this.initReloadData()}onZoomImage(e,o){this.biggerPictureService.openBiggerPicture(e,o)}onSortVariant(e){if(e.direction==""){this.products$=this.sourceObs$;return}this.products$=this.products$.pipe(B(o=>o.map(n=>(n.Variants=n.Variants.sort((i,C)=>f.compare(i.I?.Available,C.I?.Available,e.direction==="asc")),n)).sort((n,i)=>f.compare(n.totalAvailable,i.totalAvailable,e.direction==="asc"))))}static{this.\u0275fac=function(o){return new(o||t)(I(he),I(ue),I(Ie),I(Ve),I(fe),I(Me),I(L),I(we))}}static{this.\u0275cmp=X({type:t,selectors:[["app-single-channel-comparison"]],features:[ne([Y,L])],decls:2,vars:3,consts:[["SYNCDATE",""],["EMPTY_RESERVED",""],["textButton","Search",3,"headerTitle","pageData","hideSearchBox","onSubmit",4,"ngIf"],["textButton","Search",3,"onSubmit","headerTitle","pageData","hideSearchBox"],[1,"d-flex"],[4,"ngIf"],["for","channelOptions",1,"fw-bold","mb-2"],["id","channelOptions",3,"onChannelChange","ngModel"],[1,"mt-5"],["for","PageNumber",1,"fw-bold"],["type","number","id","PageNumber","placeholder","PageNumber","name","PageNumber","data-toggle","tooltip","matTooltip","Page Number",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],["for","RowCount",1,"fw-bold"],["type","number","id","RowCount","placeholder","Page Size","name","RowCount","data-toggle","tooltip","matTooltip","Page Size",1,"mat-mdc-tooltip-trigger","form-control","ng-pristine","ng-valid","ng-touched","mt-3",3,"ngModelChange","ngModel"],[1,"fw-bold"],[1,"d-flex","align-items-center","justify-content-start"],["type","number","name","QuantityFrom",1,"w-25","me-2","mt-3","form-control",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"w-25","ms-2","form-control","mt-2",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],["class","alert alert-warning d-flex justify-content-between text-dark","role","alert",4,"ngIf"],["matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["scope","col","colspan","2",1,"text-center","ps-12",2,"width","25%"],[3,"toggleChange"],["scope","col",1,"text-start"],["scope","col",1,"text-end",2,"width","10%"],[4,"ngxPermissionsOnly"],["scope","col","mat-sort-header","Available","arrowPosition","before",1,"text-end","w-10",2,"width","8%"],[1,"text-end",2,"width","150px"],["role","button","matTooltipPosition","above",1,"d-inline-block",3,"click","matTooltip"],[2,"width","16px",3,"src"],[1,"ms-1"],["matTooltip","Reserved Stock","matTooltipPosition","above",1,"text-end",2,"width","80px"],[1,"text-center",2,"width","145px"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],["class","btn btn-outline-dark me-3","matTooltip","Fetch the latest stock directly from the channel",3,"click",4,"ngIf"],[1,"btn-group"],[1,"btn","btn-outline-secondary","shadow","rounded"],["matTooltip","Fetch the latest stock directly from the channel",1,"btn","btn-outline-dark","me-3",3,"click"],[1,"fa-solid","fa-arrows-rotate","me-3"],[1,"btn","btn-success",3,"click"],[1,"fas","fa-chevron-circle-up"],["data-bs-toggle","dropdown","aria-expanded","false",1,"btn","btn-success","btn-sm","dropdown-toggle","border-start"],[1,"dropdown-menu","dropdown-menu-end","pointer"],["role","button",1,"dropdown-item","cursor-pointer","fs-5",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"btn","btn-outline-secondary","shadow","rounded",3,"click"],["role","alert",1,"alert","alert-warning","d-flex","justify-content-between","text-dark"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-start"],[1,"text-end"],["matTooltipPosition","above",3,"matTooltip","ngClass"],[1,"d-flex","align-items-center","justify-content-end"],["class","text-danger","matTooltip","This product is no longer available in POS","matTooltipPosition","above",4,"ngIf"],["class","text-end",3,"ngClass",4,"ngIf"],[1,"text-center"],[4,"ngIf","ngIfElse"],[1,"text-start",2,"width","0%",3,"rowSpan"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img",2,"margin-left","20px"],[1,"text-start",3,"rowSpan"],[1,"item-name","mb-0"],[3,"ngClass"],["type","checkbox",1,"me-3",3,"ngModel"],["type","checkbox",1,"me-3",3,"ngModelChange","ngModel"],[1,"border","rounded","w-img","cursor-pointer",2,"margin-left","20px",3,"click","src"],[1,"d-flex","align-items-center"],["title","Category",1,"fa-solid","fa-tags","me-2",2,"opacity","60%"],[1,"align-middle"],["type","checkbox",3,"ngModel"],["matTooltip","This product is no longer available in POS","matTooltipPosition","above",1,"text-danger"],["title","Stock Available"],["title","Inventory below minimum inventory"],[1,"ms-3"],["target","_blank",3,"href"],[1,"fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[1,"text-end",3,"ngClass"],[3,"class","click",4,"ngIf"],["matTooltip","Refresh stock according to seller center",1,"pl-5","cursor-pointer",2,"color","var(--bs-link-color)",3,"click"],[1,"fas","fa-sync","fa-lg","external-link-custom","pt-1"],[3,"click"],[1,"text-danger"],["matTooltipShowDelay","500",3,"matTooltip"]],template:function(o,n){o&1&&(u(0,In,60,32,"mainpanel",2),g(1,"async")),o&2&&m("ngIf",v(1,1,n.loader$))},dependencies:[re,te,ie,oe,le,ae,Fe,be,Se,de,ce,_e,se,pe,me,Le,Ae,xe,ge,ke,De,ye,ve,Pe,Te,Ee,Be],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{margin-bottom:-14px!important;font-size:larger}input[type=checkbox][_ngcontent-%COMP%]{width:15px;height:15px}"]})}}return t})();export{st as SingleChannelComparisonComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as u,b as l}from"./chunk-TNKPTRB3.js";import"./chunk-UJYSVGLV.js";import"./chunk-HFKKITEW.js";import"./chunk-OZ77CAJD.js";import{F as i,J as m}from"./chunk-MTUIRWOB.js";import{Gb as r,Yb as s,ic as p,jc as a,kc as o,rb as n}from"./chunk-JS55A2RS.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var f=(()=>{class e{constructor(){this.tabs=[{Title:"Users",Url:"/menu/users/users",Description:""},{Title:"Groups",Url:"/menu/users/groups",Description:""}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=r({type:e,selectors:[["app-user-menu"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(t,c){t&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),a()()(),o(4,"router-outlet")),t&2&&(n(3),s("Tabs",c.tabs)("usePermissions",!0))},dependencies:[l,u,m,i],encapsulation:2})}}return e})(),g=[{path:"",component:f,children:[{path:"users",loadComponent(){return import("./chunk-
|
|
1
|
+
import{a as u,b as l}from"./chunk-TNKPTRB3.js";import"./chunk-UJYSVGLV.js";import"./chunk-HFKKITEW.js";import"./chunk-OZ77CAJD.js";import{F as i,J as m}from"./chunk-MTUIRWOB.js";import{Gb as r,Yb as s,ic as p,jc as a,kc as o,rb as n}from"./chunk-JS55A2RS.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var f=(()=>{class e{constructor(){this.tabs=[{Title:"Users",Url:"/menu/users/users",Description:""},{Title:"Groups",Url:"/menu/users/groups",Description:""}]}static{this.\u0275fac=function(t){return new(t||e)}}static{this.\u0275cmp=r({type:e,selectors:[["app-user-menu"]],decls:5,vars:2,consts:[[1,"navbar","page-nav","navbar-default","py-0","navbar-expand-lg"],[1,"container-fluid"],[3,"Tabs","usePermissions"]],template:function(t,c){t&1&&(p(0,"nav",0)(1,"div",1)(2,"div"),o(3,"nav-tab",2),a()()(),o(4,"router-outlet")),t&2&&(n(3),s("Tabs",c.tabs)("usePermissions",!0))},dependencies:[l,u,m,i],encapsulation:2})}}return e})(),g=[{path:"",component:f,children:[{path:"users",loadComponent(){return import("./chunk-IIMHYIRJ.js").then(e=>e.UsersComponent)},data:{title:"Users"}},{path:"users/form",loadComponent(){return import("./chunk-FUWROOE4.js").then(e=>e.UserFormComponent)},data:{title:"Users Form"}},{path:"users/info",loadComponent(){return import("./chunk-H4PA2O6O.js").then(e=>e.UserInfoComponent)},data:{title:"Users Info"}},{path:"groups",loadComponent(){return import("./chunk-PEA6KVUS.js").then(e=>e.GroupsComponent)},data:{title:"Groups"}},{path:"groups/form",loadComponent(){return import("./chunk-FFAZ3Q3F.js").then(e=>e.GroupsFormComponent)},data:{title:"Groups Form"}},{path:"groups/info",loadComponent(){return import("./chunk-CEQA4PTY.js").then(e=>e.GroupInfoComponent)},data:{title:"Groups Info"}},{path:"",pathMatch:"full",redirectTo:"users"}]}];export{f as UserMenuComponent,g as userRoutes};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as F}from"./chunk-
|
|
1
|
+
import{a as F}from"./chunk-4DV4IT7R.js";import{a as k}from"./chunk-5EQNOCXP.js";import{a as _t}from"./chunk-7KG3DC5J.js";import{a as dt,b as st,d as ft,e as ut}from"./chunk-SYENQYR7.js";import{i as pt}from"./chunk-C7QA2BEN.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CMZW5QAE.js";import{e as ct}from"./chunk-4M63ID5T.js";import"./chunk-K5XRGNWG.js";import{c as mt}from"./chunk-PW42BQIY.js";import{m as B,n as gt}from"./chunk-6X2OBNJQ.js";import{h as at,m as rt,z as lt}from"./chunk-CSSG7NAJ.js";import"./chunk-MZI5AYCE.js";import"./chunk-UJYSVGLV.js";import"./chunk-HFKKITEW.js";import"./chunk-OZ77CAJD.js";import{E as ot,H as L,J as R,d as it,f as nt,g as D,j as M,k as T,m as w,n as P}from"./chunk-MTUIRWOB.js";import{$c as d,Fc as J,Gb as N,Gc as a,Hb as b,Hc as p,Ic as C,Kc as K,Lc as Q,Mb as f,Mc as X,Rc as Y,Sc as Z,Tc as tt,Yb as m,Z as O,aa as z,ad as h,bd as S,ca as q,cd as et,f as A,ic as o,jc as n,ka as x,kc as E,lc as u,mc as g,ob as U,oc as W,pb as j,rb as r,tc as H,uc as s,v,xb as _,xc as G,ya as I,za as y}from"./chunk-JS55A2RS.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var bt=(e,c)=>({"bg-gradient-danger":e,"bg-gradient-warning":c}),Et=()=>["/menu/notification/detail"],Dt=e=>({ID:e});function Mt(e,c){if(e&1&&(o(0,"span",14),E(1,"img",15),n(),a(2)),e&2){let t=c.item;r(),m("src",t.Img,j)("alt",t.Name),r(),C(" ",t.Name," ")}}function Tt(e,c){if(e&1&&(u(0),a(1),d(2,"number"),o(3,"span"),a(4,"s"),n(),g()),e&2){let t=s().$implicit;r(),C(" ",S(2,1,t.DurationInSecond,"1.1-1")," ")}}function wt(e,c){e&1&&a(0," - ")}function Pt(e,c){if(e&1&&(u(0),o(1,"tr",16)(2,"td")(3,"a",17),E(4,"img",18),o(5,"span"),a(6),n()()(),o(7,"td")(8,"b"),a(9),n(),E(10,"div",19),n(),o(11,"td"),f(12,Tt,5,4,"ng-container",20)(13,wt,1,0,"ng-template",null,0,et),n(),o(15,"td"),a(16),n(),o(17,"td"),a(18),d(19,"date"),n()(),g()),e&2){let t=c.$implicit,i=J(14);r(),m("ngClass",tt(14,bt,t.Status==1,t.Status==0)),r(2),m("routerLink",Y(17,Et))("queryParams",Z(18,Dt,t.ID)),r(),G("src",t.Img,j),r(2),p(t.Name),r(3),p(t.Label),r(),m("innerHTML",t.Message,U),r(2),m("ngIf",t.DurationInSecond)("ngIfElse",i),r(4),p(t.StatusLabel),r(2),C(" ",S(19,11,t.Created,"dd MMM yyyy HH:mm")," ")}}function Lt(e,c){if(e&1){let t=W();u(0),o(1,"div",6)(2,"div",21)(3,"app-custom-paginator",22),d(4,"async"),d(5,"async"),H("total",function(){I(t);let l=s(2);return y(l.getRowCount())})("next",function(){I(t);let l=s(2);return y(l.getNotifications())})("previous",function(){I(t);let l=s(2);return y(l.getNotifications())}),n()()(),g()}if(e&2){let t=s().ngIf,i=s();r(3),m("filter",i.filter)("totaldata",t==null?null:t.length)("paginationTotal",h(4,4,i.rowCount$))("hasClicked",h(5,6,i.rowCount$))}}function Rt(e,c){if(e&1&&(u(0),f(1,Lt,6,8,"ng-container",13),g()),e&2){let t=c.ngIf;r(),m("ngIf",t.length>0)}}var ht=(()=>{class e{constructor(t,i,l){this.http=t,this.notificationService=i,this.authService=l,this.filter=new _t,this.destroy$=new A,this.channelOptions=l.getChannels()}ngOnInit(){this.notificationService.clearNotification(),this.initPageLoader(),this.subscribeNotification()}subscribeNotification(){this.notificationService.getNotification().pipe(q(this.destroy$)).subscribe(t=>{t.length>0&&(this.getNotifications(),this.notificationService.clearNotification())})}initPageLoader(){this.http.post("/api/notification/Load",{}).subscribe(t=>{this.filter=t.Filter,this.filter.PageSize=this.filter.RowCount,this.getNotifications()})}onFilter(){this.rowCount$=null,this.getNotifications()}getNotifications(){let t={ChannelID:this.filter.ChannelID,RowCount:this.filter.PageSize,PageNumber:this.filter.PageNumber};this.notifications$=this.http.post("/api/notification/Get",t).pipe(v(i=>i.Data),v(i=>(i=this.setChannelLogoToNotifications(i),i=this.setTimeToSecond(i),i)),O(1))}setTimeToSecond(t){return t=t.map(i=>(i.DurationInSecond=parseInt(i.Duration)/1e3,i)),t}setChannelLogoToNotifications(t){return t=t.map(i=>(i.Img=mt.getChannelLogoByTypeId(i.TypeID),i)),t}getRowCount(){let t={ChannelID:this.filter.ChannelID};this.rowCount$=this.http.post("/api/notification/RowCount",t).pipe(v(i=>i.Count),O(1))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static{this.\u0275fac=function(i){return new(i||e)(_(ct),_(F),_(pt))}}static{this.\u0275cmp=N({type:e,selectors:[["app-notification"]],standalone:!1,decls:30,vars:9,consts:[["timeNotAvailable",""],["headerTitle","Notification","hideSearchBox","true",3,"onSubmit"],[1,"mb-2"],["appendTo","body","bindLabel","Name","name","channelid","bindValue","ID","placeholder","Select Channel",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],["ng-option-tmp","","ng-label-tmp",""],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table","table-hover"],[1,"sticky-top-thead"],[1,"table-light"],[4,"ngFor","ngForOf"],[4,"ngIf"],[1,"me-2"],[2,"width","18px",3,"src","alt"],[3,"ngClass"],[3,"routerLink","queryParams"],["alt","",1,"channelLogo-md","me-4",3,"src"],[3,"innerHTML"],[4,"ngIf","ngIfElse"],[1,"col-12"],[3,"total","next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(i,l){i&1&&(o(0,"mainpanel",1),H("onSubmit",function(){return l.onFilter()}),o(1,"filters")(2,"div")(3,"h6",2),a(4,"Channel"),n(),o(5,"ng-select",3),X("ngModelChange",function($){return Q(l.filter.ChannelID,$)||(l.filter.ChannelID=$),$}),f(6,Mt,3,3,"ng-template",4),n()()(),o(7,"content")(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11)(15,"th"),a(16,"Channel"),n(),o(17,"th"),a(18,"Process"),n(),o(19,"th"),a(20,"Duration"),n(),o(21,"th"),a(22,"Status"),n(),o(23,"th"),a(24,"Created"),n()()(),o(25,"tbody"),f(26,Pt,20,20,"ng-container",12),d(27,"async"),n()()()()(),f(28,Rt,2,1,"ng-container",13),d(29,"async"),n()()()),i&2&&(r(5),m("clearable",!0)("items",l.channelOptions),K("ngModel",l.filter.ChannelID),r(21),m("ngForOf",h(27,5,l.notifications$)),r(2),m("ngIf",h(29,7,l.notifications$)))},dependencies:[it,nt,D,ft,dt,st,at,rt,B,L,k,M,w,T],encapsulation:2})}}return e})();function Ft(e,c){if(e&1&&(o(0,"div",10)(1,"div",13)(2,"div",7)(3,"h5"),a(4,"Perflog"),n()(),o(5,"div",8)(6,"div",14)(7,"div",15)(8,"pre"),a(9),n()()()()()()),e&2){let t=s().ngIf;r(9),p(t.Perflog)}}function Bt(e,c){if(e&1&&(u(0),o(1,"div",17)(2,"div",13)(3,"div",7)(4,"h5"),a(5,"StackTrace"),n()(),o(6,"div",8)(7,"div",14)(8,"div",15)(9,"pre"),a(10),n()()()()()(),g()),e&2){let t=s().ngIf;r(10),p(t==null?null:t.StackTrace)}}function kt(e,c){if(e&1&&(u(0),o(1,"mainpanel",1)(2,"actions")(3,"a",2),a(4,"Back"),n()(),o(5,"content")(6,"div",3)(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"h5"),a(12,"General"),n()(),o(13,"div",8)(14,"div",9)(15,"div",10)(16,"div",11)(17,"label"),a(18,"Created Date"),n(),o(19,"div")(20,"span"),a(21),d(22,"date"),n()()()(),o(23,"div",10)(24,"div",11)(25,"label"),a(26,"Status"),n(),o(27,"div")(28,"span"),a(29),n()()()()(),o(30,"div",12)(31,"div",10)(32,"div",11)(33,"label"),a(34,"Duration"),n(),o(35,"div")(36,"span"),a(37),d(38,"number"),n()()()(),o(39,"div",10)(40,"div",11)(41,"label"),a(42,"Label"),n(),o(43,"div")(44,"span"),a(45),n()()()()()()()()(),o(46,"div",4)(47,"div",10)(48,"div",13)(49,"div",7)(50,"h5"),a(51,"Message"),n()(),o(52,"div",8)(53,"div",14)(54,"div",15)(55,"pre"),a(56),n()()()()()(),f(57,Ft,10,1,"div",16)(58,Bt,11,1,"ng-container",0),n()()()(),g()),e&2){let t=c.ngIf;r(),m("headerTitle","Notification "+t.Name)("hideSearchBox",!0)("hideSearchDropdown",!0),r(20),p(S(22,10,t.Created,"dd MMM yyyy HH:mm:ss")),r(8),p(t.StatusLabel),r(8),C("",S(38,13,t.DurationInSecond,"1.1-1")," s"),r(8),p(t.Label),r(11),p(t.Message),r(),m("ngIf",t==null?null:t.Perflog),r(),m("ngIf",t==null?null:t.StackTrace)}}var vt=(()=>{class e{constructor(t,i){this.activatedRoute=t,this.notificationService=i}ngOnInit(){this.notification$=this.activatedRoute.queryParams.pipe(z(t=>{let i=t.ID;return this.notificationService.getNotificationDetail(i).pipe(v(l=>(l.DurationInSecond=parseInt(l.Duration)/1e3,l)))}))}static{this.\u0275fac=function(i){return new(i||e)(_(ot),_(F))}}static{this.\u0275cmp=N({type:e,selectors:[["app-detail"]],standalone:!1,decls:2,vars:3,consts:[[4,"ngIf"],[3,"headerTitle","hideSearchBox","hideSearchDropdown"],["role","button","routerLink","/menu/notification",1,"btn","btn-secondary","btn-fill","btn-lg","me-3"],[1,"container-fluid","mt-8"],[1,"row"],[1,"col-12"],[1,"card","mb-8"],[1,"card-header"],[1,"card-body"],[1,"row","mt-6"],[1,"col-sm-6"],[1,"info-label-group"],[1,"row","mt-4"],[1,"card"],[1,"col-sm-12","mt-2"],[1,"form-group"],["class","col-sm-6",4,"ngIf"],[1,"col-sm-12"]],template:function(i,l){i&1&&(f(0,kt,59,16,"ng-container",0),d(1,"async")),i&2&&m("ngIf",h(1,1,l.notification$))},dependencies:[D,B,L,M,w,T],encapsulation:2})}}return e})();var $t=[{path:"",component:ht},{path:"detail",component:vt}],Ct=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=x({imports:[P,R.forChild($t)]})}}return e})();var de=(()=>{class e{static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275mod=b({type:e})}static{this.\u0275inj=x({imports:[P,Ct,ut,lt,gt,R,k]})}}return e})();export{de as NotificationModule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as E}from"./chunk-REL734JM.js";import{a as Ee}from"./chunk-GHBGGQNM.js";import{a as we,b as be}from"./chunk-ZNDU44GH.js";import{b as Te,c as De}from"./chunk-5XI7HWS5.js";import{a as Me}from"./chunk-5QAURMZF.js";import"./chunk-NZA4BEER.js";import"./chunk-JV4MMNGD.js";import"./chunk-GZXQUJKX.js";import"./chunk-ALKC77XL.js";import"./chunk-NTW6FBP5.js";import"./chunk-LR4UZ2OS.js";import"./chunk-F4GMWHYJ.js";import{a as Y}from"./chunk-5DIRXS7I.js";import"./chunk-KXS76PRS.js";import"./chunk-OZ7LWNOK.js";import"./chunk-VRI3CYGG.js";import"./chunk-AVEGIEYT.js";import{d as Ce,e as he}from"./chunk-SYENQYR7.js";import{a as de}from"./chunk-Z3ITXK3D.js";import"./chunk-CMZW5QAE.js";import{b as Z}from"./chunk-4M63ID5T.js";import"./chunk-K5XRGNWG.js";import{c as me}from"./chunk-PW42BQIY.js";import{b as fe,c as te,d as xe,j as ye,k as Ue,m as Se,n as ve}from"./chunk-6X2OBNJQ.js";import{b as pe,h as z,m as H,z as j}from"./chunk-CSSG7NAJ.js";import"./chunk-MZI5AYCE.js";import{a as ue,b as _e,c as ge}from"./chunk-UJYSVGLV.js";import"./chunk-HFKKITEW.js";import"./chunk-OZ77CAJD.js";import{H as le,J as ce,j as $,n as q}from"./chunk-MTUIRWOB.js";import{$b as K,$c as A,G as se,Gb as B,Gc as g,Hc as Q,Ic as D,Kc as v,Lc as M,Mb as x,Mc as w,Nc as N,Oc as O,Pc as C,Qc as W,Ra as U,Rc as X,Sc as ee,Yb as u,Z as k,ad as F,dc as S,ea as J,ec as V,gc as P,hc as L,ic as o,jc as s,kc as I,lc as b,mc as T,oc as y,pa as f,pb as ae,q as oe,rb as a,rd as R,tc as h,uc as l,v as G,ya as c,za as p}from"./chunk-JS55A2RS.js";import"./chunk-EU2KAMEK.js";import{a as ne,b as re}from"./chunk-66YHNWRR.js";var ie=function(i){return i.ERROR="https://res.cloudinary.com/pos/image/upload/v1705387550/POS/Images/Cashier/globalerror.svg",i.UNAUTHORIZED="https://res.cloudinary.com/pos/image/upload/v1702547639/POS/Images/Dashboard/locked.svg",i.EMPTY_LIST="https://res.cloudinary.com/pos/image/upload/v1705388070/POS/Images/Cashier/globalnodata.svg",i.REMOVE="https://res.cloudinary.com/pos/image/upload/v1706156973/icons/globalerrorclear.svg",i}(ie||{});var ke=()=>({display:"d-flex"});function Oe(i,m){if(i&1&&(o(0,"div",6),I(1,"img",9),o(2,"p",10),g(3," All users already migrated. "),s()()),i&2){let e=l();a(),u("src",e.emptyStateIcon,ae)}}function Ae(i,m){if(i&1){let e=y();o(0,"div",14)(1,"p-checkBox",15),w("ngModelChange",function(t){let n=c(e).$implicit;return M(n.selected,t)||(n.selected=t),p(t)}),h("ngModelChange",function(){c(e);let t=l(2),n=C(0);return p(t.onUserCheckChange(n))}),s(),o(2,"label",16),g(3),s()()}if(i&2){let e=m.$implicit;a(),K(X(7,ke)),u("binary",!0)("id",e.ID),v("ngModel",e.selected),a(),u("for",e.ID),a(),D(" ",e.Name," ")}}function Fe(i,m){if(i&1){let e=y();o(0,"div",11)(1,"p-checkBox",12),w("ngModelChange",function(t){c(e);let n=l();return M(n.isCheckAll,t)||(n.isCheckAll=t),p(t)}),h("ngModelChange",function(t){c(e);let n=l(),_=C(0);return p(n.onCheckAllChange(t,_))}),s(),o(2,"label",13),g(3," Check All "),s()(),P(4,Ae,4,8,"div",14,V)}if(i&2){let e=l(),r=C(0);a(),K(X(4,ke)),u("binary",!0),v("ngModel",e.isCheckAll),a(3),L(r)}}var Ve=(()=>{class i{constructor(){this.dialogRef=f(fe),this.data=f(te),this.userService=f(E),this.dialogData=f(te),this.toastr=f(Z),this.userGroups=R(()=>this.dialogData.userGroups||[]),this.availableUsers=R(()=>{let e=new Map;return this.dialogData.availableUsers.forEach(r=>e.set(r.ID,r)),e}),this.migrateLoader$=this.userService.getUserMigrateLoader().pipe(G(e=>e.Data),G(e=>e.filter(t=>this.availableUsers().has(t.ID)===!1)),G(e=>e.map(t=>(t.selected=!0,t))),k(1)),this.isCheckAll=U(!0),this.selectedGroup=U(null),this.emptyStateIcon=ie.EMPTY_LIST,this.config=new ye,this.config.title="Migrate Users",this.config.customWidth="600px"}onUserCheckChange(e){let r=e.every(t=>t.selected);this.isCheckAll.set(r)}onCheckAllChange(e,r){this.isCheckAll.set(e),r.forEach(t=>t.selected=e)}onClose(){this.dialogRef.close(!1)}onSubmit(e){let r=e.filter(n=>n.selected);if(r.length===0){this.toastr.error("Please select at least one user","Error");return}if(me.IsEmpty(this.selectedGroup())){this.toastr.error("Please select a user group","Error");return}let t={userIds:r.map(n=>n.ID),groupId:this.selectedGroup()};this.userService.migrateUser(t).subscribe(()=>{this.dialogRef.close(!0),this.toastr.success("Users migrated successfully","Success")})}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-migrate-dialog"]],features:[W([E])],decls:15,vars:8,consts:[[3,"onClose","onCancel","onOk","config"],["content",""],[1,"row"],[1,"col","border-end"],[1,"modal-title","mb-8"],[1,"mt-5"],[1,"d-flex","flex-column","align-items-center","mt-5"],[1,"col"],["optionLabel","Name","optionValue","ID","placeholder","Select a Channel","appendTo","body","filterBy","Name",1,"w-100",2,"--p-select-padding-y","0.75rem",3,"ngModelChange","options","filter","ngModel"],["alt","No users found",2,"width","100px","height","100px",3,"src"],[1,"text-muted","mt-4","opacity-50",2,"margin-bottom","0px"],[1,"d-flex","w-100","align-items-center","mb-4"],["id","checkBoxAll",3,"ngModelChange","binary","ngModel"],["for","checkBoxAll",1,"ms-2"],[1,"d-flex","w-100","align-items-center","mb-3","ms-10"],[3,"ngModelChange","binary","id","ngModel"],[1,"ms-2",3,"for"]],template:function(r,t){if(r&1){let n=y();N(0),A(1,"async"),o(2,"modal-material",0),h("onClose",function(){return c(n),p(t.onClose())})("onCancel",function(){return c(n),p(t.onClose())})("onOk",function(){c(n);let d=C(0);return p(t.onSubmit(d))}),o(3,"div",1)(4,"div",2)(5,"div",3)(6,"h5",4),g(7,"Users from POS"),s(),o(8,"div",5),x(9,Oe,4,1,"div",6)(10,Fe,6,5),s()(),o(11,"div",7)(12,"h5",4),g(13,"Assign Group"),s(),o(14,"p-select",8),w("ngModelChange",function(d){return c(n),M(t.selectedGroup,d)||(t.selectedGroup=d),p(d)}),s()()()()()}if(r&2){let n=O(F(1,5,t.migrateLoader$));a(2),u("config",t.config),a(7),S((n==null?null:n.length)===0?9:10),a(5),u("options",t.userGroups())("filter",!0),v("ngModel",t.selectedGroup)}},dependencies:[q,$,Ue,j,z,H,Te,Me],encapsulation:2})}}return i})();var Pe=i=>({ID:i});function Re(i,m){if(i&1){let e=y();o(0,"button",13),h("click",function(){c(e);let t=l(2),n=C(0);return p(t.onDeleteUser(n==null?null:n.Filter))}),I(1,"i",14),g(2),s()}if(i&2){let e,r=l(2);a(2),D(" Delete (",(e=r.selectedUsers())==null?null:e.length,") ")}}function Ge(i,m){if(i&1&&(b(0),x(1,Re,3,1,"button",12),T()),i&2){let e,r=l();a(),S(((e=r.selectedUsers())==null?null:e.length)>0?1:-1)}}function Be(i,m){if(i&1){let e=y();b(0),o(1,"button",15),h("click",function(){c(e);let t=l(),n=C(0),_=C(2);return p(t.onMigrateUser(n==null||n.Options==null?null:n.Options.Groups,_==null?null:_.Data))}),g(2," Migrate "),s(),T()}}function We(i,m){i&1&&(b(0),o(1,"a",16),g(2," Invite "),s(),T())}function $e(i,m){if(i&1){let e=y();b(0),o(1,"th",17)(2,"div",18)(3,"input",19),h("change",function(t){c(e);let n=l(),_=C(2);return p(n.onCheckAllUser(t.target.checked,_==null?null:_.Data))}),s()()(),T()}}function qe(i,m){if(i&1){let e=y();o(0,"div",18)(1,"input",24),w("ngModelChange",function(t){c(e);let n=l(2).$implicit;return M(n.checked,t)||(n.checked=t),p(t)}),h("ngModelChange",function(){c(e);let t=l(3),n=C(2);return p(t.onSelectUser(n==null?null:n.Data))}),s()()}if(i&2){let e=l(2).$implicit;a(),v("ngModel",e.checked)}}function ze(i,m){if(i&1&&(b(0),o(1,"td"),x(2,qe,2,1,"div",18),s(),T()),i&2){let e,r=l().$implicit,t=l();a(2),S(r.Name!==((e=t.currentLoginUser())==null?null:e.username)?2:-1)}}function He(i,m){if(i&1&&(o(0,"a",20),g(1),s()),i&2){let e=l().$implicit;u("queryParams",ee(2,Pe,e.UserID)),a(),D(" ",e.Name," ")}}function je(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.Name)}}function Ye(i,m){if(i&1&&(o(0,"a",21),g(1),s()),i&2){let e=l().$implicit;u("queryParams",ee(2,Pe,e.GroupID)),a(),D(" ",e.GroupName," ")}}function Ze(i,m){if(i&1&&(o(0,"span"),g(1),s()),i&2){let e=l().$implicit;a(),Q(e.GroupName)}}function Je(i,m){if(i&1&&I(0,"p-chip",23),i&2){let e=m.$implicit;u("label",e.Name)("image",e.Logo)("alt",e.Name)}}function Ke(i,m){if(i&1&&(o(0,"tr"),x(1,ze,3,1,"ng-container",3),o(2,"td"),x(3,He,2,4,"a",20)(4,je,2,1,"span"),s(),o(5,"td"),x(6,Ye,2,4,"a",21)(7,Ze,2,1,"span"),s(),o(8,"td")(9,"div",22),P(10,Je,1,3,"p-chip",23,V),s()()()),i&2){let e=m.$implicit,r=l();a(),u("ngxPermissionsOnly",r.userDeleteRole),a(2),S(r.hasUserEditRole()?3:4),a(3),S(r.hasUserEditRole()?6:7),a(4),L(e.Channels)}}function Qe(i,m){if(i&1){let e=y();o(0,"app-mat-paginator-no-count",25),h("next",function(){c(e);let t=l(),n=C(0);return p(t.onNextPage(n==null?null:n.Filter))})("previous",function(){c(e);let t=l(),n=C(0);return p(t.onPrevPage(n==null?null:n.Filter))}),s()}if(i&2){l();let e=C(0),r=C(2);u("filter",e==null?null:e.Filter)("totaldata",r==null||r.Data==null?null:r.Data.length)("paginationTotal",r==null?null:r.Count)("hasClicked",!0)}}var Rt=(()=>{class i{constructor(){this.usersService=f(E),this.permissionService=f(ue),this.toastService=f(Z),this.dialog=f(xe),this.userInviteOptions=U([]),this.searchText=U(null),this.selectedGroup=U(null),this.userLoader$=this.usersService.getLoader().pipe(J(e=>{this.userInviteOptions.set(e.Options.Users),this.initUsers(e.Filter)}),k(1)),this.users$=oe({Count:0,Data:[]}),this.userAddRole=Y.UserAdd,this.userDeleteRole=Y.UserDelete,this.hasUserEditRole=U(!1),this.selectedUsers=U([]),this.currentLoginUser=R(()=>{let e=localStorage.getItem(de.AUTHORIZATION);return e?JSON.parse(e):null}),this.permissionService.hasPermission(Y.UserEdit).then(e=>{this.hasUserEditRole.set(e)})}initUsers(e){let r=re(ne({},e),{Name:this.searchText(),GroupID:this.selectedGroup()});this.users$=this.usersService.getUsers(r).pipe(J(t=>this.filterUserInvtiteOptions(t.Data)),k(1))}filterUserInvtiteOptions(e){this.userInviteOptions.update(r=>r.filter(t=>e.findIndex(n=>n.UserID===t.ID)===-1))}onCheckAllUser(e,r){r.forEach(n=>{n.Name!==this.currentLoginUser()?.username&&(n.checked=e)});let t=r.filter(n=>n.checked);this.selectedUsers.set(t)}onSelectUser(e){let r=e.filter(t=>t.checked);this.selectedUsers.set(r)}onDeleteUser(e={PageNumber:1,PageSize:10}){let r=this.selectedUsers().map(n=>n.UserID);confirm("Are you sure you want to delete selected users?")&&this.usersService.deleteUsers(r).subscribe(()=>{this.selectedUsers.set([]),this.toastService.success("User deleted successfully","Success"),this.initUsers(e)})}onMigrateUser(e,r){this.dialog.open(Ve,{data:{userGroups:e,availableUsers:r}}).afterClosed().pipe(se(t=>t===!0)).subscribe(()=>{this.initUsers({PageNumber:1,PageSize:10})})}onNextPage(e){e.PageNumber+=1,this.initUsers(e)}onPrevPage(e){e.PageNumber-=1,this.initUsers(e)}onSuccessUpdateUser(e){e.PageNumber=1,this.initUsers(e)}static{this.\u0275fac=function(r){return new(r||i)}}static{this.\u0275cmp=B({type:i,selectors:[["app-users"]],features:[W([E])],decls:33,vars:17,consts:[["headerTitle","Users","description","Manage your users and their permissions",3,"textChange","onSubmit","text"],[1,"fw-bold","mb-2"],["appendTo","body","bindLabel","Name","name","Name","bindValue","ID","placeholder","Select Group",1,"center-text",3,"ngModelChange","clearable","items","ngModel"],[4,"ngxPermissionsOnly"],[1,"container-fluid"],[1,"row","mt-6"],[1,"col-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","15%"],[3,"filter","totaldata","paginationTotal","hasClicked"],[3,"onSuccessUpdateUser","groups","users"],[1,"btn","btn-danger","me-3"],[1,"btn","btn-danger","me-3",3,"click"],[1,"fa","fa-trash","me-1"],[1,"btn","btn-success","me-3",3,"click"],["role","button","routerLink","/menu/users/users/form",1,"btn","btn-success"],[2,"width","5px"],[1,"d-flex"],["name","selectAll","type","checkbox",3,"change"],["routerLink","/menu/users/users/info",3,"queryParams"],["routerLink","/menu/users/groups/info",3,"queryParams"],[1,"lh-base"],[1,"me-3","mb-3",2,"--p-chip-image-width","1.2rem","--p-chip-image-height","1.2rem","--p-chip-padding-x","1rem","--p-chip-padding-y","0.5rem","--p-chip-border-radius","0.5rem","--p-chip-font-size","1.2rem",3,"label","image","alt"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"next","previous","filter","totaldata","paginationTotal","hasClicked"]],template:function(r,t){if(r&1){let n=y();N(0),A(1,"async"),N(2),A(3,"async"),o(4,"mainpanel",0),w("textChange",function(d){return c(n),M(t.searchText,d)||(t.searchText=d),p(d)}),h("onSubmit",function(){c(n);let d=C(0);return p(t.initUsers(d==null?null:d.Filter))}),o(5,"filters")(6,"div")(7,"label",1),g(8,"Group"),s(),o(9,"ng-select",2),w("ngModelChange",function(d){return c(n),M(t.selectedGroup,d)||(t.selectedGroup=d),p(d)}),s()()(),o(10,"actions"),x(11,Ge,2,1,"ng-container",3)(12,Be,3,0,"ng-container",3)(13,We,3,0,"ng-container",3),s(),o(14,"content")(15,"div",4)(16,"div",5)(17,"div",6)(18,"table",7)(19,"thead",8)(20,"tr"),x(21,$e,4,0,"ng-container",3),o(22,"th",9),g(23,"Login ID"),s(),o(24,"th",9),g(25,"Group"),s(),o(26,"th"),g(27,"Channel Filter"),s()()(),o(28,"tbody"),P(29,Ke,12,3,"tr",null,V),s()(),x(31,Qe,1,4,"app-mat-paginator-no-count",10),s()()()()(),o(32,"invite-group",11),h("onSuccessUpdateUser",function(){c(n);let d=C(0);return p(t.onSuccessUpdateUser(d==null?null:d.Filter))}),s()}if(r&2){let n=O(F(1,11,t.userLoader$));a(2);let _=O(F(3,14,t.users$));a(2),v("text",t.searchText),a(5),u("clearable",!0)("items",n==null||n.Options==null?null:n.Options.Groups),v("ngModel",t.selectedGroup),a(2),u("ngxPermissionsOnly",t.userDeleteRole),a(),u("ngxPermissionsOnly",t.userAddRole),a(),u("ngxPermissionsOnly",t.userAddRole),a(8),u("ngxPermissionsOnly",t.userDeleteRole),a(8),L(_==null?null:_.Data),a(2),S(n?31:-1),a(),u("groups",n==null||n.Options==null?null:n.Options.Groups)("users",t.userInviteOptions())}},dependencies:[q,$,ve,Se,ce,le,Ee,ge,_e,he,Ce,j,pe,z,H,De,be,we],encapsulation:2})}}return i})();export{Rt as UsersComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Ae}from"./chunk-5ANFGKBV.js";import{a as G}from"./chunk-XHAXYWZ7.js";import{a as Le}from"./chunk-YPVYJUXS.js";import"./chunk-6MPSYC77.js";import{a as Re,b as $e,c as Ue,d as Y}from"./chunk-GOS4RIF2.js";import{a as Be}from"./chunk-JRWFZQ5K.js";import{a as De}from"./chunk-7KG3DC5J.js";import{a as Me,b as Te,c as Ve}from"./chunk-ZIOAOUAM.js";import{b as ke}from"./chunk-GPC4DECX.js";import"./chunk-SIYMMMKQ.js";import"./chunk-WHZ44BAL.js";import"./chunk-UPYS4A4M.js";import{a as Oe}from"./chunk-JOBWFOGC.js";import"./chunk-PO7JVKK3.js";import"./chunk-LHD7CYML.js";import"./chunk-DJILLV4M.js";import{a as Ne}from"./chunk-SH7KN2AS.js";import"./chunk-OKAPL3YZ.js";import"./chunk-SDUUFQUI.js";import"./chunk-3RK6DDJD.js";import"./chunk-MQXPOHBV.js";import"./chunk-M5IQRAHV.js";import{a as Pe}from"./chunk-5DIRXS7I.js";import"./chunk-SYENQYR7.js";import"./chunk-2ZTDLZVZ.js";import"./chunk-2TZBEYNY.js";import"./chunk-SXLKJLAE.js";import{i as Ie}from"./chunk-I3LFKNW4.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CMZW5QAE.js";import{b as xe,e as be}from"./chunk-4M63ID5T.js";import"./chunk-K5XRGNWG.js";import"./chunk-HPYTL6TX.js";import{c as j}from"./chunk-PW42BQIY.js";import{d as we,m as Fe,n as Ee}from"./chunk-6X2OBNJQ.js";import{b as fe,h as $,m as U,z as A}from"./chunk-CSSG7NAJ.js";import"./chunk-MZI5AYCE.js";import{a as Se,b as ve,c as ye}from"./chunk-UJYSVGLV.js";import{r as W,s as K}from"./chunk-HFKKITEW.js";import"./chunk-OZ77CAJD.js";import{d as ue,f as L,g as he,j as ge,m as Ce,n as R}from"./chunk-MTUIRWOB.js";import{$b as ae,$c as P,Fc as X,G as z,Gb as k,Gc as p,Hc as se,Ic as f,Ka as oe,Kc as V,Lc as D,Mb as g,Mc as O,Nc as me,Oc as pe,Pc as Z,Qc as de,Ra as re,Sc as N,Tc as B,Yb as s,Z as H,ad as v,bd as _e,cd as q,dc as le,ea as ie,ec as E,gc as M,hc as T,ic as o,jc as a,kc as b,lc as I,mc as w,oc as S,p as te,pa as J,pb as F,rb as r,tc as C,uc as m,v as ne,xb as x,xc as ce,ya as _,za as u}from"./chunk-JS55A2RS.js";import"./chunk-EU2KAMEK.js";import{a as Q,b as ee}from"./chunk-66YHNWRR.js";var Je=(n,c)=>({color:n,"font-weight":c});function Xe(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();ae(B(7,Je,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var je=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new oe,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=k({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(i,t){i&1&&(o(0,"mat-radio-group",0),C("ngModelChange",function(d){return t.change(d)}),g(1,Xe,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[R,L,Ve,Me,Te,A,$,U,K,W],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return n})();var We=n=>[n],Ze=n=>({"text-decoration-line-through":n}),qe=n=>({"border-bottom":n}),Ye=(n,c)=>({"bg-gradient-warning":n,"border pointer cell-hover":c});function Qe(n,c){if(n&1){let e=S();I(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),O("ngModelChange",function(t){_(e);let l=m();return D(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),u(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),O("modelChange",function(t){_(e);let l=m();return D(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),u(t)}),a()(),w()}if(n&2){let e=m();r(4),s("multiple",!0),V("ngModel",e.searchFilter.ListChannelID),r(4),V("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function et(n,c){if(n&1){let e=S();o(0,"button",27),C("click",function(){_(e);let t=m().ngIf,l=m();return u(l.onUpdateItems(t))}),b(1,"i",28),p(2," Update "),a()}}function tt(n,c){if(n&1&&(I(0),o(1,"div",4),g(2,et,3,0,"button",26),a(),w()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function nt(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),b(2,"img",30),o(3,"div",31),p(4),P(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,F),r(2),f(" ",_e(5,3,e.Name,20)," ")}}function it(n,c){if(n&1){let e=S();o(0,"th")(1,"input",32),O("ngModelChange",function(t){_(e);let l=m();return D(l.checkboxState,t)||(l.checkboxState=t),u(t)}),C("ngModelChange",function(){_(e);let t=m();return u(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),V("ngModel",e.checkboxState)}}function ot(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function rt(n,c){if(n&1){let e=S();o(0,"img",47),C("click",function(t){_(e);let l=m(3).$implicit,d=m(2);return u(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;ce("src",e==null?null:e.ImageUrl,F)}}function at(n,c){n&1&&b(0,"img",48)}function lt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function ct(n,c){if(n&1&&(I(0),o(1,"td",42),g(2,rt,1,1,"img",43)(3,at,1,0,"ng-template",null,0,q),a(),o(5,"td",44)(6,"h5",45),p(7),a(),g(8,lt,2,1,"small",46),a(),w()),n&2){let e=X(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",N(7,qe,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),se(t==null?null:t.Name),r(),le(t!=null&&t.Category?8:-1)}}function st(n,c){if(n&1){let e=S();o(0,"td",49)(1,"input",32),O("ngModelChange",function(t){_(e);let l=m().$implicit;return D(l.selected,t)||(l.selected=t),u(t)}),a()()}if(n&2){let e=m().$implicit;r(),V("ngModel",e.selected)}}function mt(n,c){if(n&1){let e=S();I(0),o(1,"td",51),p(2),P(3,"number"),a(),o(4,"td",52),C("click",function(){let t=_(e).$implicit,l=m(2).$implicit,d=m().$implicit,h=m(2),y=Z(0);return u(h.openTableDialog(l,d,t,y))}),o(5,"div",53)(6,"div",54),p(7),P(8,"number"),a(),o(9,"a",55),C("click",function(t){return _(e),u(t==null?null:t.stopPropagation())}),b(10,"i",40),a()()(),w()}if(n&2){let e=c.$implicit;m(5);let i=Z(0);r(2),f(" ",v(3,4,e.PriceExpected)," "),r(2),s("ngClass",B(8,Ye,e.Price!=e.PriceExpected,i)),r(3),f(" ",v(8,6,e.Price)," "),r(2),s("href",e.Url,F)}}function pt(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function dt(n,c){if(n&1&&(I(0),g(1,mt,11,11,"ng-container",50)(2,pt,4,0,"ng-template",null,1,q),w()),n&2){let e=c.$implicit,i=X(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function _t(n,c){if(n&1&&(o(0,"tr"),g(1,ct,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),b(10,"i",40),a()()()(),g(11,st,2,1,"ng-template",19)(12,dt,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",N(8,Ze,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F),r(2),s("ngxPermissionsOnly",N(10,We,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function ut(n,c){if(n&1&&(o(0,"tbody"),M(1,_t,13,12,"tr",null,E),a()),n&2){let e=c.$implicit;r(),T(e.Variants)}}function ht(n,c){if(n&1&&(I(0),M(1,ut,3,0,"tbody",null,E),w()),n&2){let e=c.ngIf;r(),T(e)}}var on=(()=>{class n{constructor(e,i,t,l,d,h,y){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=h,this.paginationService=y,this.infinitePagination=J(Y),this.permissionService=J(Se),this.searchFilter=new De,this.checkboxState=!1,this.rolePriceEdit=Pe.PriceUpdate,this.hasRolePriceEdit=te(this.permissionService.hasPermission(this.rolePriceEdit)),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.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=re([]),this.filterTypeOptions=[{Key:G.ALL,Value:"All"},{Key:G.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];j.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(H(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ie(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=G.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),H(1))}onSelectAllData(){this.data$=this.data$.pipe(ne(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=ee(Q({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(h=>h.ID),d={ListChannelID:this.channelOptions.filter(h=>h.selected).map(h=>h.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:h=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:h=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Le,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(z(t=>j.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t,l){if(l){let d=JSON.parse(JSON.stringify(e));this.dialog.open(Re,{data:{Name:i.Name,Variant:d,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(z(y=>j.IsNotEmpty(y))).subscribe(y=>{this.updateProductPrice(y,t)})}}updateProductPrice(e,i){let t={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",t).subscribe(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(ke,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(x(be),x(xe),x(we),x(Oe),x(Ie),x(Ne),x(Be))}}static{this.\u0275cmp=k({type:n,selectors:[["app-custom-channel-price"]],features:[de([Y])],decls:40,vars:26,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(i,t){if(i&1){let l=S();me(0),P(1,"async"),o(2,"mainpanel",2),C("onSubmit",function(h){return _(l),u(t.onFilter(h))}),o(3,"filters"),g(4,Qe,9,4,"ng-container",3),P(5,"async"),a(),o(6,"actions")(7,"div",4),g(8,tt,3,1,"ng-container",3),P(9,"async"),o(10,"button",5),C("click",function(){return _(l),u(t.openExportDialog())}),b(11,"i",6),o(12,"span"),p(13,"Export"),a()()()(),o(14,"content")(15,"div",7)(16,"div",8)(17,"div",9)(18,"div",10)(19,"table",11)(20,"thead",12)(21,"tr",13),b(22,"th",14),M(23,nt,6,6,"th",15,E),a(),o(25,"tr")(26,"th",16)(27,"span"),p(28," Product "),a()(),o(29,"th",17),p(30,"Variant"),a(),o(31,"th",18),p(32,"SKU"),a(),g(33,it,2,1,"ng-template",19),M(34,ot,7,0,null,null,E),a()(),g(36,ht,3,0,"ng-container",3),P(37,"async"),a(),o(38,"infinite-paginator",20),P(39,"async"),C("onNextPage",function(){return _(l),u(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){return _(l),u(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){return _(l),u(t.infinitePagination.getRowCount(t.searchFilter))}),a()()()()()()()}i&2&&(pe(v(1,13,t.hasRolePriceEdit)),r(2),s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",v(5,16,t.loader$)),r(4),s("ngIf",v(9,18,t.data$)),r(15),T(t.channels()),r(10),s("ngxPermissionsOnly",N(24,We,t.rolePriceEdit)),r(),T(t.channels()),r(2),s("ngIf",v(37,20,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",v(39,22,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[R,ue,L,he,ge,Ce,Ee,Fe,A,fe,$,U,Ue,je,K,W,$e,ye,ve,Ae],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]})}}return n})();export{on as CustomChannelPriceComponent};
|
|
1
|
+
import{a as Ae}from"./chunk-MCJRJUAO.js";import{a as G}from"./chunk-XHAXYWZ7.js";import{a as Le}from"./chunk-YPVYJUXS.js";import"./chunk-6MPSYC77.js";import{a as Re,b as $e,c as Ue,d as Y}from"./chunk-GOS4RIF2.js";import{a as Be}from"./chunk-JRWFZQ5K.js";import{a as De}from"./chunk-7KG3DC5J.js";import{a as Me,b as Te,c as Ve}from"./chunk-ZIOAOUAM.js";import{b as ke}from"./chunk-GPC4DECX.js";import"./chunk-SIYMMMKQ.js";import"./chunk-WHZ44BAL.js";import"./chunk-UPYS4A4M.js";import{a as Oe}from"./chunk-JOBWFOGC.js";import"./chunk-PO7JVKK3.js";import"./chunk-LHD7CYML.js";import"./chunk-DJILLV4M.js";import{a as Ne}from"./chunk-SH7KN2AS.js";import"./chunk-OKAPL3YZ.js";import"./chunk-SDUUFQUI.js";import"./chunk-3RK6DDJD.js";import"./chunk-MQXPOHBV.js";import"./chunk-M5IQRAHV.js";import{a as Pe}from"./chunk-5DIRXS7I.js";import"./chunk-SYENQYR7.js";import"./chunk-2ZTDLZVZ.js";import"./chunk-2TZBEYNY.js";import"./chunk-SXLKJLAE.js";import{i as Ie}from"./chunk-C7QA2BEN.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import"./chunk-CMZW5QAE.js";import{b as xe,e as be}from"./chunk-4M63ID5T.js";import"./chunk-K5XRGNWG.js";import"./chunk-HPYTL6TX.js";import{c as j}from"./chunk-PW42BQIY.js";import{d as we,m as Fe,n as Ee}from"./chunk-6X2OBNJQ.js";import{b as fe,h as $,m as U,z as A}from"./chunk-CSSG7NAJ.js";import"./chunk-MZI5AYCE.js";import{a as Se,b as ve,c as ye}from"./chunk-UJYSVGLV.js";import{r as W,s as K}from"./chunk-HFKKITEW.js";import"./chunk-OZ77CAJD.js";import{d as ue,f as L,g as he,j as ge,m as Ce,n as R}from"./chunk-MTUIRWOB.js";import{$b as ae,$c as P,Fc as X,G as z,Gb as k,Gc as p,Hc as se,Ic as f,Ka as oe,Kc as V,Lc as D,Mb as g,Mc as O,Nc as me,Oc as pe,Pc as Z,Qc as de,Ra as re,Sc as N,Tc as B,Yb as s,Z as H,ad as v,bd as _e,cd as q,dc as le,ea as ie,ec as E,gc as M,hc as T,ic as o,jc as a,kc as b,lc as I,mc as w,oc as S,p as te,pa as J,pb as F,rb as r,tc as C,uc as m,v as ne,xb as x,xc as ce,ya as _,za as u}from"./chunk-JS55A2RS.js";import"./chunk-EU2KAMEK.js";import{a as Q,b as ee}from"./chunk-66YHNWRR.js";var Je=(n,c)=>({color:n,"font-weight":c});function Xe(n,c){if(n&1&&(o(0,"mat-radio-button",2),p(1),a()),n&2){let e=c.$implicit,i=c.index,t=m();ae(B(7,Je,t.model==e.Key&&t.activeBold?"#0976b4":"",t.model==e.Key&&t.activeBold?"700":"")),s("disabled",t.exception==e.Value)("matTooltip",t.title.length>0?t.title[i]:"")("value",e.Key)("name",t.name),r(),f("",e.Value," ")}}var je=(()=>{class n{constructor(){this.disabled=!1,this.modelChange=new oe,this.options=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"}],this.border=!1,this.name="",this.title=[],this.exception="",this.activeBold=""}change(e){this.modelChange.emit(e)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275cmp=k({type:n,selectors:[["lib-radio-options"]],inputs:{model:"model",disabled:"disabled",options:"options",border:"border",name:"name",title:"title",exception:"exception",activeBold:"activeBold"},outputs:{modelChange:"modelChange"},decls:2,vars:3,consts:[["color","primary",3,"ngModelChange","disabled","ngModel"],["matTooltipPosition","above","class","me-4 mt-1",3,"style","disabled","matTooltip","value","name",4,"ngFor","ngForOf"],["matTooltipPosition","above",1,"me-4","mt-1",3,"disabled","matTooltip","value","name"]],template:function(i,t){i&1&&(o(0,"mat-radio-group",0),C("ngModelChange",function(d){return t.change(d)}),g(1,Xe,2,10,"mat-radio-button",1),a()),i&2&&(s("disabled",t.disabled)("ngModel",t.model),r(),s("ngForOf",t.options))},dependencies:[R,L,Ve,Me,Te,A,$,U,K,W],styles:["html[_ngcontent-%COMP%]{--mdc-radio-state-layer-size: 36px}html[_ngcontent-%COMP%]{--mat-radio-touch-target-display: block}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled:checked + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__outer-circle[_ngcontent-%COMP%]{border-color:#0976b4!important}.mat-mdc-radio-button[_ngcontent-%COMP%] .mdc-radio[_ngcontent-%COMP%] .mdc-radio__native-control[_ngcontent-%COMP%]:enabled + .mdc-radio__background[_ngcontent-%COMP%] .mdc-radio__inner-circle[_ngcontent-%COMP%]{background-color:#0976b4!important;border-color:#0976b4!important}"]})}}return n})();var We=n=>[n],Ze=n=>({"text-decoration-line-through":n}),qe=n=>({"border-bottom":n}),Ye=(n,c)=>({"bg-gradient-warning":n,"border pointer cell-hover":c});function Qe(n,c){if(n&1){let e=S();I(0),o(1,"div")(2,"label",21),p(3,"Channel"),a(),o(4,"channel-select-options",22),O("ngModelChange",function(t){_(e);let l=m();return D(l.searchFilter.ListChannelID,t)||(l.searchFilter.ListChannelID=t),u(t)}),a()(),o(5,"div",23)(6,"label",24),p(7,"Filter by"),a(),o(8,"lib-radio-options",25),O("modelChange",function(t){_(e);let l=m();return D(l.searchFilter.filterModel,t)||(l.searchFilter.filterModel=t),u(t)}),a()(),w()}if(n&2){let e=m();r(4),s("multiple",!0),V("ngModel",e.searchFilter.ListChannelID),r(4),V("model",e.searchFilter.filterModel),s("options",e.filterTypeOptions)}}function et(n,c){if(n&1){let e=S();o(0,"button",27),C("click",function(){_(e);let t=m().ngIf,l=m();return u(l.onUpdateItems(t))}),b(1,"i",28),p(2," Update "),a()}}function tt(n,c){if(n&1&&(I(0),o(1,"div",4),g(2,et,3,0,"button",26),a(),w()),n&2){let e=c.ngIf,i=m();r(2),s("ngIf",i.productService.hasSelectionVariant(e))}}function nt(n,c){if(n&1&&(o(0,"th",15)(1,"div",29),b(2,"img",30),o(3,"div",31),p(4),P(5,"stringLimit"),a()()()),n&2){let e=c.$implicit;r(),s("matTooltip",(e.Name==null?null:e.Name.length)>20?e.Name:""),r(),s("src",e==null?null:e.Img,F),r(2),f(" ",_e(5,3,e.Name,20)," ")}}function it(n,c){if(n&1){let e=S();o(0,"th")(1,"input",32),O("ngModelChange",function(t){_(e);let l=m();return D(l.checkboxState,t)||(l.checkboxState=t),u(t)}),C("ngModelChange",function(){_(e);let t=m();return u(t.onSelectAllData())}),a()()}if(n&2){let e=m();r(),V("ngModel",e.checkboxState)}}function ot(n,c){n&1&&(o(0,"th",33)(1,"span"),p(2,"Expected"),a(),o(3,"span",34),p(4,"(POS)"),a()(),o(5,"th",33),p(6,"Channel"),a())}function rt(n,c){if(n&1){let e=S();o(0,"img",47),C("click",function(t){_(e);let l=m(3).$implicit,d=m(2);return u(d.onZoomImage(t,l==null?null:l.ImageUrl))}),a()}if(n&2){let e=m(3).$implicit;ce("src",e==null?null:e.ImageUrl,F)}}function at(n,c){n&1&&b(0,"img",48)}function lt(n,c){if(n&1&&(o(0,"small",46),p(1),a()),n&2){let e=m(3).$implicit;r(),f("(",e==null?null:e.Category,")")}}function ct(n,c){if(n&1&&(I(0),o(1,"td",42),g(2,rt,1,1,"img",43)(3,at,1,0,"ng-template",null,0,q),a(),o(5,"td",44)(6,"h5",45),p(7),a(),g(8,lt,2,1,"small",46),a(),w()),n&2){let e=X(4),i=m().$index,t=m().$implicit,l=m().ngIf;r(),s("rowSpan",t==null?null:t.Variants.length)("ngClass",N(7,qe,i+1==l.length)),r(),s("ngIf",t==null?null:t.ImageUrl)("ngIfElse",e),r(3),s("rowSpan",t==null?null:t.Variants.length),r(2),se(t==null?null:t.Name),r(),le(t!=null&&t.Category?8:-1)}}function st(n,c){if(n&1){let e=S();o(0,"td",49)(1,"input",32),O("ngModelChange",function(t){_(e);let l=m().$implicit;return D(l.selected,t)||(l.selected=t),u(t)}),a()()}if(n&2){let e=m().$implicit;r(),V("ngModel",e.selected)}}function mt(n,c){if(n&1){let e=S();I(0),o(1,"td",51),p(2),P(3,"number"),a(),o(4,"td",52),C("click",function(){let t=_(e).$implicit,l=m(2).$implicit,d=m().$implicit,h=m(2),y=Z(0);return u(h.openTableDialog(l,d,t,y))}),o(5,"div",53)(6,"div",54),p(7),P(8,"number"),a(),o(9,"a",55),C("click",function(t){return _(e),u(t==null?null:t.stopPropagation())}),b(10,"i",40),a()()(),w()}if(n&2){let e=c.$implicit;m(5);let i=Z(0);r(2),f(" ",v(3,4,e.PriceExpected)," "),r(2),s("ngClass",B(8,Ye,e.Price!=e.PriceExpected,i)),r(3),f(" ",v(8,6,e.Price)," "),r(2),s("href",e.Url,F)}}function pt(n,c){n&1&&(o(0,"td",56),p(1," X "),a(),o(2,"td",56),p(3," X "),a())}function dt(n,c){if(n&1&&(I(0),g(1,mt,11,11,"ng-container",50)(2,pt,4,0,"ng-template",null,1,q),w()),n&2){let e=c.$implicit,i=X(3),t=m().$implicit,l=m(3);r(),s("ngIf",l.getItemFromChannel(t,e.ID))("ngIfElse",i)}}function _t(n,c){if(n&1&&(o(0,"tr"),g(1,ct,9,9,"ng-container",3),o(2,"td",35),p(3),a(),o(4,"td",36)(5,"div",37)(6,"div",38),p(7),a(),o(8,"div",31)(9,"a",39),b(10,"i",40),a()()()(),g(11,st,2,1,"ng-template",19)(12,dt,4,2,"ng-container",41),a()),n&2){let e=c.$implicit,i=c.$index,t=m(3);r(),s("ngIf",i==0),r(2),f(" ",e==null?null:e.Model," "),r(),s("matTooltip",e.Discontinued?t.discontinuedVariantMsg:""),r(2),s("ngClass",N(8,Ze,e.Discontinued)),r(),f(" ",e==null?null:e.Code," "),r(2),s("href",t.hostName+"/menu/Products/Catalog/Variants/Info?ID="+(e==null?null:e.ID),F),r(2),s("ngxPermissionsOnly",N(10,We,t.rolePriceEdit)),r(),s("ngForOf",t.channels())}}function ut(n,c){if(n&1&&(o(0,"tbody"),M(1,_t,13,12,"tr",null,E),a()),n&2){let e=c.$implicit;r(),T(e.Variants)}}function ht(n,c){if(n&1&&(I(0),M(1,ut,3,0,"tbody",null,E),w()),n&2){let e=c.ngIf;r(),T(e)}}var on=(()=>{class n{constructor(e,i,t,l,d,h,y){this.http=e,this.toastr=i,this.dialog=t,this.productService=l,this.authService=d,this.biggerPictureService=h,this.paginationService=y,this.infinitePagination=J(Y),this.permissionService=J(Se),this.searchFilter=new De,this.checkboxState=!1,this.rolePriceEdit=Pe.PriceUpdate,this.hasRolePriceEdit=te(this.permissionService.hasPermission(this.rolePriceEdit)),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.rowCountAPI="Inventory/GetMultipleChannelComparisonRowCount",this.channels=re([]),this.filterTypeOptions=[{Key:G.ALL,Value:"All"},{Key:G.DIFFERENCE,Value:"Difference"}],this.pageData={Title:"Price Realtime",Nav:[{Title:"Price Cache",Url:"/menu/price",Active:!1}]},this.channelOptions=this.authService.getChannels(),this.hostName=this.authService.getDomain(),this.initPagination(),this.initChannelTable()}initChannelTable(){let e=this.searchFilter.ListChannelID,i=[];j.IsEmpty(e)||e?.length==0?i=this.channelOptions:i=this.channelOptions.filter(t=>e.findIndex(l=>l==t.ID)>-1),this.channels.update(()=>i)}initPagination(){this.infinitePagination.fetchDataEndpoint="Price/GetOutletPrice",this.infinitePagination.fethRowCountEndpoint=this.rowCountAPI,this.initProduct(),this.initPageLoader()}initProduct(){this.data$=this.infinitePagination.data$.pipe(H(1))}initPageLoader(){this.loader$=this.http.post("/api/PriceLoader/LoadMultiple",{}).pipe(ie(e=>{this.searchFilter=e.Filter,this.searchFilter.filterModel=G.ALL,this.infinitePagination.reloadPagination(this.searchFilter)}),H(1))}onSelectAllData(){this.data$=this.data$.pipe(ne(e=>(e.map(i=>(i.Variants&&(i.Variants=i.Variants.map(t=>(t.selected=this.checkboxState,t))),i)),e)))}onFilter(e){this.searchFilter.text=e;let i=ee(Q({},this.searchFilter),{text:e,PageNumber:this.searchFilter.PageNumber,RowCount:this.searchFilter.RowCount});this.initChannelTable(),this.infinitePagination.reloadPagination(i)}updatePrice(e){let i=this.productService.selectedVariantProduct(e);if(i.length>0){let t=i.map(h=>h.ID),d={ListChannelID:this.channelOptions.filter(h=>h.selected).map(h=>h.ID),ListID:t};this.http.post("/api/Price/UpdateChannelOutletPrice",d).subscribe({next:h=>{this.resetSelectedChannel(),this.onFilter(),this.toastr.success("Successfully updated "+d.ListID.length+" items in "+d.ListChannelID.length+" channels","Success")},error:h=>{this.resetSelectedChannel()}})}}resetSelectedChannel(){this.channelOptions=this.channelOptions.map(e=>(e.selected=!1,e))}getItemFromChannel(e,i){return e.Channel.find(t=>t.ChannelID==i)}onUpdateItems(e){let i=this.productService.selectedVariantProduct(e);this.dialog.open(Le,{data:{title:"Updating Price",selectedItems:i,channels:this.channelOptions},width:"400px"}).afterClosed().pipe(z(t=>j.IsNotEmpty(t))).subscribe(t=>{this.channelOptions=t,this.updatePrice(e)})}openTableDialog(e,i,t,l){if(l){let d=JSON.parse(JSON.stringify(e));this.dialog.open(Re,{data:{Name:i.Name,Variant:d,ChannelID:t?.ChannelID,Table:"price",ChannelItemID:t?.ChannelItemID}}).afterClosed().pipe(z(y=>j.IsNotEmpty(y))).subscribe(y=>{this.updateProductPrice(y,t)})}}updateProductPrice(e,i){let t={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",t).subscribe(l=>{i.Price=t.Price;let d=this.productService.findChannelById(t.ID,this.channelOptions);this.toastr.success(`Successfully updated ${e.ItemName} (${e.VarName}) inventory in ${d.Name} to ${t.Price}`,"Success")})}openExportDialog(){this.dialog.open(ke,{data:{title:"Export Custom Channel Price",pageNumber:this.searchFilter.PageNumber,rowCount:this.searchFilter.RowCount,filterExport:this.searchFilter,getRowCountApi:this.rowCountAPI,exportApi:"price/GetExportOutletPrice"}}).afterClosed().subscribe()}onZoomImage(e,i){this.biggerPictureService.openBiggerPicture(e,i)}static{this.\u0275fac=function(i){return new(i||n)(x(be),x(xe),x(we),x(Oe),x(Ie),x(Ne),x(Be))}}static{this.\u0275cmp=k({type:n,selectors:[["app-custom-channel-price"]],features:[de([Y])],decls:40,vars:26,consts:[["elsePic",""],["elseCol",""],["headerTitle","Price Comparison",3,"onSubmit","hideSearchBox","hideSearchDropdown","textButton"],[4,"ngIf"],[1,"d-flex"],[1,"btn","btn-outline-secondary","shadow","rounded","ms-2",3,"click"],[1,"fa-solid","fa-print","me-3"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"table"],[1,"thead-light","sticky-top-thead"],[1,"channel-column"],["colspan","5"],["scope","col","colspan","2",1,"text-center","border-bottom-0","border","text-uppercase"],["scope","col","colspan","2",1,"text-center","w-25"],["scope","col",1,"text-start","w-20"],["scope","col",1,"text-end","w-10"],[3,"ngxPermissionsOnly"],[3,"onNextPage","onLastPage","onGetRowCount","totalData","hideCount","rowCount","pageNumber","disableNextButton","goToLastPage"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5",2,"height","46px"],[1,"fw-bold","mb-2","d-block"],["name","filterModel",3,"modelChange","model","options"],["type","button","class","btn btn-success shadow rounded","data-toggle","modal",3,"click",4,"ngIf"],["type","button","data-toggle","modal",1,"btn","btn-success","shadow","rounded",3,"click"],[1,"fas","fa-chevron-circle-up"],["matTooltipPosition","above",1,"d-flex","align-items-center","justify-content-center",2,"width","180px",3,"matTooltip"],[2,"width","16px","height","16px",3,"src"],[1,"ms-2"],["type","checkbox",3,"ngModelChange","ngModel"],[1,"text-end","border-top-0","border","w-10"],[1,"ms-1"],[1,"text-start","border-bottom"],["matTooltipPosition","above",1,"text-end","border-bottom",3,"matTooltip"],[1,"d-flex","align-items-center","justify-content-end"],[3,"ngClass"],["target","_blank",3,"href"],[1,"fas","fa-solid","fa-arrow-up-right-from-square","external-link-custom"],[4,"ngFor","ngForOf"],[1,"text-center",3,"rowSpan","ngClass"],["class","border rounded w-img cursor-pointer",3,"src","click",4,"ngIf","ngIfElse"],[1,"text-start","border-bottom",2,"padding-left","0px",3,"rowSpan"],[1,"mb-0","item-name"],[1,"mt-1"],[1,"border","rounded","w-img","cursor-pointer",3,"click","src"],["src","//res.cloudinary.com/pos/image/upload/w_40/POS/Images/Icon/products_thumb.png",1,"border","rounded","w-img"],[1,"align-middle"],[4,"ngIf","ngIfElse"],[1,"text-end","border"],[1,"text-center",3,"click","ngClass"],[1,"d-flex","align-items-center","justify-content-center"],[1,"me-2"],["target","_blank",3,"click","href"],[1,"table-white","border","text-end",2,"color","red"]],template:function(i,t){if(i&1){let l=S();me(0),P(1,"async"),o(2,"mainpanel",2),C("onSubmit",function(h){return _(l),u(t.onFilter(h))}),o(3,"filters"),g(4,Qe,9,4,"ng-container",3),P(5,"async"),a(),o(6,"actions")(7,"div",4),g(8,tt,3,1,"ng-container",3),P(9,"async"),o(10,"button",5),C("click",function(){return _(l),u(t.openExportDialog())}),b(11,"i",6),o(12,"span"),p(13,"Export"),a()()()(),o(14,"content")(15,"div",7)(16,"div",8)(17,"div",9)(18,"div",10)(19,"table",11)(20,"thead",12)(21,"tr",13),b(22,"th",14),M(23,nt,6,6,"th",15,E),a(),o(25,"tr")(26,"th",16)(27,"span"),p(28," Product "),a()(),o(29,"th",17),p(30,"Variant"),a(),o(31,"th",18),p(32,"SKU"),a(),g(33,it,2,1,"ng-template",19),M(34,ot,7,0,null,null,E),a()(),g(36,ht,3,0,"ng-container",3),P(37,"async"),a(),o(38,"infinite-paginator",20),P(39,"async"),C("onNextPage",function(){return _(l),u(t.infinitePagination.onNextPage(t.searchFilter))})("onLastPage",function(){return _(l),u(t.infinitePagination.onLastPage(t.searchFilter))})("onGetRowCount",function(){return _(l),u(t.infinitePagination.getRowCount(t.searchFilter))}),a()()()()()()()}i&2&&(pe(v(1,13,t.hasRolePriceEdit)),r(2),s("hideSearchBox",!1)("hideSearchDropdown",!1)("textButton","Search"),r(2),s("ngIf",v(5,16,t.loader$)),r(4),s("ngIf",v(9,18,t.data$)),r(15),T(t.channels()),r(10),s("ngxPermissionsOnly",N(24,We,t.rolePriceEdit)),r(),T(t.channels()),r(2),s("ngIf",v(37,20,t.data$)),r(2),s("totalData",t.infinitePagination.totalData())("hideCount",t.infinitePagination.hideCount())("rowCount",v(39,22,t.infinitePagination.totalRowCount$))("pageNumber",t.infinitePagination.pageNumber())("disableNextButton",t.infinitePagination.disableNextButton())("goToLastPage",t.infinitePagination.isLastPage()))},dependencies:[R,ue,L,he,ge,Ce,Ee,Fe,A,fe,$,U,Ue,je,K,W,$e,ye,ve,Ae],styles:[".w-10[_ngcontent-%COMP%]{width:10%}.w-20[_ngcontent-%COMP%]{width:20%}.w-img[_ngcontent-%COMP%]{width:40px;height:40px}.item-name[_ngcontent-%COMP%]{font-weight:400;font-size:larger}.cell-hover[_ngcontent-%COMP%]:hover{background-color:#c9c9c9!important}"]})}}return n})();export{on as CustomChannelPriceComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as de,b as se,c as ce}from"./chunk-2BUABOHG.js";import{a as ue}from"./chunk-
|
|
1
|
+
import{a as de,b as se,c as ce}from"./chunk-2BUABOHG.js";import{a as ue}from"./chunk-P5FCWMYK.js";import{a as me}from"./chunk-K6YEZYU4.js";import{a as pe}from"./chunk-MCJRJUAO.js";import{a as ae}from"./chunk-E2CS7ZMC.js";import"./chunk-R76V3PTN.js";import{a as le}from"./chunk-5EQNOCXP.js";import"./chunk-6LH7FSOW.js";import"./chunk-XEMNZHW6.js";import"./chunk-WHZ44BAL.js";import"./chunk-LHD7CYML.js";import"./chunk-DJILLV4M.js";import"./chunk-OKAPL3YZ.js";import"./chunk-SDUUFQUI.js";import"./chunk-3RK6DDJD.js";import"./chunk-MQXPOHBV.js";import"./chunk-M5IQRAHV.js";import"./chunk-SYENQYR7.js";import"./chunk-2ZTDLZVZ.js";import"./chunk-2TZBEYNY.js";import"./chunk-SXLKJLAE.js";import"./chunk-C7QA2BEN.js";import"./chunk-Z3ITXK3D.js";import"./chunk-ACIMXBIC.js";import"./chunk-TGMCGROM.js";import{a as ie}from"./chunk-CMZW5QAE.js";import{e as te}from"./chunk-4M63ID5T.js";import"./chunk-K5XRGNWG.js";import"./chunk-HPYTL6TX.js";import"./chunk-PW42BQIY.js";import{m as oe,n as re}from"./chunk-6X2OBNJQ.js";import{c as X,h as Y,m as Z,o as $,z as ee}from"./chunk-CSSG7NAJ.js";import"./chunk-MZI5AYCE.js";import"./chunk-UJYSVGLV.js";import{s as ne}from"./chunk-HFKKITEW.js";import"./chunk-OZ77CAJD.js";import{j as q,k as J,m as K,n as Q}from"./chunk-MTUIRWOB.js";import{$c as w,Gb as W,Gc as a,Hc as f,Ic as z,Kc as g,Lc as h,Mb as y,Mc as S,Nc as A,Oc as j,Pc as H,Qc as R,Ra as I,Sc as U,Yb as c,Z as L,ac as N,ad as b,bd as G,dc as E,ec as B,gc as D,hc as k,ic as t,ja as O,jc as i,kc as _,oc as M,pa as x,pb as F,rb as r,tc as V,uc as u,v as T,ya as d,za as s}from"./chunk-JS55A2RS.js";import"./chunk-EU2KAMEK.js";import"./chunk-66YHNWRR.js";var P=(()=>{class n{constructor(){this.httpService=x(te)}getCompletedOrders(e){return this.httpService.post(ie.GetCompleted,e).pipe(T(m=>m?.Data||[]))}static{this.\u0275fac=function(m){return new(m||n)}}static{this.\u0275prov=O({token:n,factory:n.\u0275fac})}}return n})();var _e=n=>({"td-cell-hover":n});function fe(n,C){if(n&1&&_(0,"variants-dropdown",27),n&2){let e=u().$implicit;c("variants",e==null?null:e.Variants)}}function ge(n,C){if(n&1&&_(0,"variant-with-image",28),n&2){let e=u().$implicit;c("variant",e==null?null:e.Variants[0])}}function he(n,C){if(n&1&&(t(0,"span"),a(1),i()),n&2){let e=u().$implicit;r(),f(e.LogisticService==null?null:e.LogisticService.Option)}}function Se(n,C){if(n&1&&(t(0,"tr")(1,"td"),a(2),i(),t(3,"td")(4,"div",23)(5,"div",24)(6,"div"),_(7,"img",25),w(8,"channelImage"),i(),t(9,"div"),_(10,"order-link",26),i()(),t(11,"small"),a(12),w(13,"date"),i()()(),t(14,"td"),a(15),i(),t(16,"td"),y(17,fe,1,1,"variants-dropdown",27)(18,ge,1,1,"variant-with-image",28),i(),t(19,"td",29),a(20),w(21,"number"),i(),t(22,"td")(23,"span"),a(24),i(),y(25,he,2,1,"span"),i()()),n&2){let e=C.$implicit;r(2),f(e.Outlet),r(5),c("src",b(8,12,e==null?null:e.MarketType),F)("alt",e==null||e.Variants[0]==null?null:e.Variants[0].Name),r(3),c("order",e),r(2),z(" ",G(13,14,e==null?null:e.Created,"dd/MM/yyyy HH:mm:ss")," "),r(3),f(e.Customer),r(),N(U(19,_e,(e.Variants==null?null:e.Variants.length)>1)),r(),E((e.Variants==null?null:e.Variants.length)>1?17:18),r(3),f(b(21,17,e.Amount)),r(4),f(e.LogisticService!=null&&e.LogisticService.Name?e.LogisticService==null?null:e.LogisticService.Name:"-"),r(),E(e.LogisticService!=null&&e.LogisticService.Option&&(e.LogisticService==null?null:e.LogisticService.Option)!="Default"?25:-1)}}function ve(n,C){if(n&1){let e=M();t(0,"div",13)(1,"table",15)(2,"thead",16)(3,"tr",17)(4,"th",18),a(5,"Outlet"),i(),t(6,"th",19),a(7,"Number"),i(),t(8,"th",19),a(9,"Customer"),i(),t(10,"th"),a(11,"Items"),i(),t(12,"th",20),a(13,"Amount"),i(),t(14,"th",21),a(15,"Shipping"),i()()(),t(16,"tbody"),D(17,Se,26,21,"tr",null,B),i()(),t(19,"app-custom-paginator",22),V("next",function(){d(e);let o=u();return s(o.initCompletedOrders())})("previous",function(){d(e);let o=u();return s(o.initCompletedOrders())}),i()()}if(n&2){let e=u(),m=H(0);r(17),k(m),r(2),c("filter",e.filter())("totaldata",m==null?null:m.length)}}function we(n,C){n&1&&(t(0,"div",14),_(1,"app-empty-state"),i())}var Ke=(()=>{class n{constructor(){this.completedService=x(P),this.filter=I({PageNumber:1,PageSize:100,ListChannelID:[],From:null,To:null})}ngOnInit(){this.initCompletedOrders()}initCompletedOrders(){this.completedOrders$=this.completedService.getCompletedOrders(this.filter()).pipe(L(1))}static{this.\u0275fac=function(m){return new(m||n)}}static{this.\u0275cmp=W({type:n,selectors:[["app-completed"]],features:[R([P])],decls:29,vars:11,consts:[["headerTitle","Completed","searchBoxPlaceHolder","Search Orders...",3,"onSubmit","hideSearchBox"],[1,"fw-bold","mb-2"],[3,"ngModelChange","multiple","ngModel"],[1,"mt-5"],[1,"mb-4"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"fw-bold"],["type","number","name","PageNumber",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],["type","number","name","PageSize",1,"w-100","mt-2","form-control",3,"ngModelChange","ngModel"],[1,"container-fluid","mt-3"],[1,"row"],[1,"col-md-12"],[1,"table-responsive"],[1,"d-flex","flex-column","justify-content-center","align-items-center",2,"margin-top","26vh"],[1,"table"],[1,"sticky-top-thead"],[1,"table-light"],[2,"width","100px"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[2,"width","150px"],["rowCountApi","/api/orders/completedcount",3,"next","previous","filter","totaldata"],[1,"lh-sm"],[1,"d-flex","align-items-end","gap-2"],[2,"width","14px","padding-bottom","2.5px",3,"src","alt"],[2,"font-size","14px",3,"order"],[3,"variants"],[3,"variant"],[1,"text-end"]],template:function(m,o){if(m&1){let p=M();A(0),w(1,"async"),t(2,"mainpanel",0),V("onSubmit",function(){return d(p),s(o.initCompletedOrders())}),t(3,"filters")(4,"div")(5,"label",1),a(6,"From/To"),i(),t(7,"channel-select-options",2),S("ngModelChange",function(l){return d(p),h(o.filter().ListChannelID,l)||(o.filter().ListChannelID=l),s(l)}),i()(),t(8,"div",3)(9,"label",1),a(10,"From/To"),i(),t(11,"div",4)(12,"datepicker",5),S("dateChange",function(l){return d(p),h(o.filter().From,l)||(o.filter().From=l),s(l)}),i()(),t(13,"div")(14,"datepicker",6),S("dateChange",function(l){return d(p),h(o.filter().To,l)||(o.filter().To=l),s(l)}),i()()(),t(15,"div",3)(16,"label",7),a(17,"Page Number"),i(),t(18,"input",8),S("ngModelChange",function(l){return d(p),h(o.filter().PageNumber,l)||(o.filter().PageNumber=l),s(l)}),i()(),t(19,"div",3)(20,"label",7),a(21,"Page Size"),i(),t(22,"input",9),S("ngModelChange",function(l){return d(p),h(o.filter().PageSize,l)||(o.filter().PageSize=l),s(l)}),i()()(),t(23,"content")(24,"div",10)(25,"div",11)(26,"div",12),y(27,ve,20,2,"div",13)(28,we,2,0,"div",14),i()()()()()}if(m&2){let p=j(b(1,8,o.completedOrders$));r(2),c("hideSearchBox",!0),r(5),c("multiple",!0),g("ngModel",o.filter().ListChannelID),r(5),g("date",o.filter().From),r(2),g("date",o.filter().To),r(4),g("ngModel",o.filter().PageNumber),r(4),g("ngModel",o.filter().PageSize),r(5),E((p==null?null:p.length)>0?27:28)}},dependencies:[Q,q,K,J,re,oe,ae,le,ee,X,$,Y,Z,de,se,ce,me,pe,ne,ue],encapsulation:2})}}return n})();export{Ke as CompletedComponent};
|