dealpos 26.36.2 → 26.36.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-UO6OV2AV.js → chunk-275DS7CX.js} +1 -1
- package/browser/{chunk-GOBBYNFL.js → chunk-2HPL4SL4.js} +1 -1
- package/browser/{chunk-TX74J5GA.js → chunk-2TIJB2TV.js} +1 -1
- package/browser/{chunk-7TPZYDPJ.js → chunk-2WJEVHSL.js} +1 -1
- package/browser/{chunk-7H5NRRWO.js → chunk-32HFEXNB.js} +1 -1
- package/browser/{chunk-64DX75NP.js → chunk-33LUO4GI.js} +2 -2
- package/browser/{chunk-DZB4UF2K.js → chunk-3IH3Y34L.js} +1 -1
- package/browser/{chunk-63YUGNBG.js → chunk-3TR7ZYJV.js} +1 -1
- package/browser/{chunk-FGAPJYZ5.js → chunk-3XTUKL55.js} +1 -1
- package/browser/{chunk-GYDLBTMB.js → chunk-4KZ3FWNE.js} +1 -1
- package/browser/{chunk-DCD4PMZY.js → chunk-4MXCBJRH.js} +1 -1
- package/browser/{chunk-EIMJTNYS.js → chunk-4OZYPPVL.js} +1 -1
- package/browser/{chunk-HYEBFZ2F.js → chunk-4VA2DTA6.js} +1 -1
- package/browser/{chunk-2JWXLXOS.js → chunk-5LNPOO6Q.js} +1 -1
- package/browser/{chunk-3K4YVVJB.js → chunk-5MFMWKPT.js} +1 -1
- package/browser/{chunk-N4DLJR7D.js → chunk-5RNCX5GO.js} +1 -1
- package/browser/{chunk-OGGKTI57.js → chunk-65FDZHMT.js} +1 -1
- package/browser/{chunk-YY7HRA7W.js → chunk-66SAF7DA.js} +1 -1
- package/browser/{chunk-4RSWRWUP.js → chunk-67STXSP2.js} +1 -1
- package/browser/{chunk-JVTHK6DP.js → chunk-6A2M7F62.js} +1 -1
- package/browser/{chunk-6HZWFICL.js → chunk-6BEG6JYE.js} +1 -1
- package/browser/{chunk-L3Z73JSM.js → chunk-6CKAAF25.js} +1 -1
- package/browser/{chunk-XCOYWAYI.js → chunk-7P36CXAI.js} +1 -1
- package/browser/{chunk-EB3MTHPE.js → chunk-A3KXRSGD.js} +1 -1
- package/browser/{chunk-PGCUWG3U.js → chunk-A6KRL5YB.js} +1 -1
- package/browser/{chunk-4UQA6QQ3.js → chunk-AEXBSDCW.js} +1 -1
- package/browser/{chunk-U26QXYBG.js → chunk-AXP74OA5.js} +1 -1
- package/browser/{chunk-ZRWP536P.js → chunk-B24DKIBB.js} +1 -1
- package/browser/{chunk-AD5OC5R4.js → chunk-B6NU6DWC.js} +1 -1
- package/browser/{chunk-W56FOKMP.js → chunk-BUWMZAGW.js} +2 -2
- package/browser/{chunk-AGNLDYXR.js → chunk-C7BF3ESP.js} +1 -1
- package/browser/{chunk-I3SOTZIB.js → chunk-C7LIQL2G.js} +1 -1
- package/browser/{chunk-IVGJ7HQX.js → chunk-CE3TZUKG.js} +2 -2
- package/browser/{chunk-7RLOD6CF.js → chunk-CZHBKKH3.js} +1 -1
- package/browser/{chunk-K2KEHU52.js → chunk-D72YXHRG.js} +1 -1
- package/browser/{chunk-BGEZ7L55.js → chunk-DASHPQJH.js} +1 -1
- package/browser/{chunk-XGIJG2KT.js → chunk-DGMYULZJ.js} +1 -1
- package/browser/{chunk-2SNBABAU.js → chunk-DH3OYIS4.js} +1 -1
- package/browser/{chunk-V6BLMT7L.js → chunk-DX4JI5WN.js} +1 -1
- package/browser/{chunk-DHRPXO7W.js → chunk-DYFORVB4.js} +1 -1
- package/browser/{chunk-S6QA444A.js → chunk-ECR245XG.js} +1 -1
- package/browser/{chunk-XKY5LCCK.js → chunk-EK7VNWA5.js} +1 -1
- package/browser/{chunk-XQ26O6KV.js → chunk-EWVLX3XY.js} +1 -1
- package/browser/{chunk-U7C6WYAO.js → chunk-FBI4U5NT.js} +1 -1
- package/browser/{chunk-PQ2PIXTI.js → chunk-FUIYK4SC.js} +1 -1
- package/browser/{chunk-LY6ISKJZ.js → chunk-FUO3FQ57.js} +1 -1
- package/browser/{chunk-O57CKHHE.js → chunk-G3VJKQYH.js} +1 -1
- package/browser/{chunk-BJXCHZS7.js → chunk-G5XBLCME.js} +1 -1
- package/browser/{chunk-JCW4757G.js → chunk-GXTURFFL.js} +1 -1
- package/browser/{chunk-ZSNKDCBL.js → chunk-H3KAANBR.js} +1 -1
- package/browser/{chunk-QOWCGYFK.js → chunk-HHV7RREJ.js} +1 -1
- package/browser/{chunk-6TNS3XQM.js → chunk-HP2PTD5G.js} +1 -1
- package/browser/{chunk-UT37PZM4.js → chunk-I3EEYIVT.js} +1 -1
- package/browser/{chunk-QZBFXR5W.js → chunk-ICRIBA3P.js} +1 -1
- package/browser/{chunk-ED5LJ7TQ.js → chunk-IKTNVNT2.js} +1 -1
- package/browser/{chunk-E47ESBEL.js → chunk-KI5F5CW2.js} +1 -1
- package/browser/{chunk-UP3TQSFT.js → chunk-KQF3Y7KL.js} +1 -1
- package/browser/{chunk-RQBHALKW.js → chunk-KRAPKYFO.js} +1 -1
- package/browser/{chunk-UWKYB5I7.js → chunk-KYLZHCAA.js} +1 -1
- package/browser/{chunk-P2CHARVW.js → chunk-L5FFXZXC.js} +1 -1
- package/browser/{chunk-KSPZZVPJ.js → chunk-L5WDL3DP.js} +1 -1
- package/browser/{chunk-HPQUXLVT.js → chunk-LARLPOL5.js} +1 -1
- package/browser/{chunk-M2IKL6H2.js → chunk-LESUSDPN.js} +1 -1
- package/browser/{chunk-I4QMNGVH.js → chunk-LF5MBVWB.js} +1 -1
- package/browser/{chunk-YYFLOTFX.js → chunk-LXHVHXEA.js} +1 -1
- package/browser/{chunk-ZCKNNCX3.js → chunk-M3OSX3Q7.js} +1 -1
- package/browser/{chunk-3CEPCKSU.js → chunk-M6RLTUU5.js} +1 -1
- package/browser/{chunk-ZL755W4C.js → chunk-MCZD2CPZ.js} +2 -2
- package/browser/{chunk-WMU6G4BV.js → chunk-MGSTIE7E.js} +1 -1
- package/browser/{chunk-4LWV4SOY.js → chunk-MKY7DK6O.js} +1 -1
- package/browser/{chunk-LQFCNDOF.js → chunk-MMWQPUOB.js} +1 -1
- package/browser/{chunk-PM5KSAAZ.js → chunk-MONMEVIR.js} +1 -1
- package/browser/{chunk-5LFMIXA3.js → chunk-MXIQI6OF.js} +1 -1
- package/browser/{chunk-WMLCBQY5.js → chunk-N4ZPBKRB.js} +1 -1
- package/browser/{chunk-3K5WMLOC.js → chunk-N7X3K3WP.js} +1 -1
- package/browser/{chunk-PNSDDSNF.js → chunk-NOX5OWAB.js} +1 -1
- package/browser/{chunk-P6GUMPEL.js → chunk-NR5ZKUNT.js} +1 -1
- package/browser/{chunk-XBJNUG3V.js → chunk-O3UD45LA.js} +1 -1
- package/browser/{chunk-GDCWOLXR.js → chunk-OU53L22U.js} +1 -1
- package/browser/{chunk-DFAROQV6.js → chunk-OZPBFUUW.js} +1 -1
- package/browser/{chunk-6CMYTC7Q.js → chunk-P22XPYVU.js} +1 -1
- package/browser/{chunk-YO6SSH2L.js → chunk-PB2BG6U4.js} +1 -1
- package/browser/{chunk-ZPXWEN7N.js → chunk-PD6YIACR.js} +1 -1
- package/browser/{chunk-5KOQNQAR.js → chunk-PD7BTOKH.js} +1 -1
- package/browser/{chunk-Y2KXSDWX.js → chunk-PSMI4OJG.js} +14 -14
- package/browser/{chunk-X55OGVRU.js → chunk-PWISOKUO.js} +1 -1
- package/browser/{chunk-TTN36LRJ.js → chunk-Q6PWCMNK.js} +1 -1
- package/browser/{chunk-PYR4REWW.js → chunk-QBMNOGLY.js} +1 -1
- package/browser/{chunk-RUNOMMTR.js → chunk-QFY2OCG2.js} +1 -1
- package/browser/{chunk-BFBFVAMM.js → chunk-QU72XYWG.js} +1 -1
- package/browser/{chunk-IIUFKDMI.js → chunk-RCWWB5ZM.js} +1 -1
- package/browser/{chunk-3LP4UCQF.js → chunk-RYH4IZS2.js} +1 -1
- package/browser/{chunk-YWECQOMF.js → chunk-SH3I7KVG.js} +1 -1
- package/browser/{chunk-KIHAFEFZ.js → chunk-SLVLNWLB.js} +1 -1
- package/browser/{chunk-FP5MXDL3.js → chunk-SSF37IE2.js} +1 -1
- package/browser/{chunk-YRWPIHIQ.js → chunk-SXQJ6T6N.js} +1 -1
- package/browser/{chunk-TFJXHNFW.js → chunk-SZR6MGPN.js} +1 -1
- package/browser/{chunk-ETJVDRWK.js → chunk-TEQOGSRT.js} +1 -1
- package/browser/{chunk-RNLRQDAM.js → chunk-TPLN5AIU.js} +1 -1
- package/browser/{chunk-2HTOLQPX.js → chunk-TTSPSQ5C.js} +1 -1
- package/browser/{chunk-ATIYVZR5.js → chunk-TUFJ7MRK.js} +1 -1
- package/browser/{chunk-WW4C5BVF.js → chunk-TV6O3EVB.js} +1 -1
- package/browser/{chunk-7ZWGUSM2.js → chunk-U7YH7DAU.js} +1 -1
- package/browser/{chunk-H7VDEQ7K.js → chunk-UJ4FLELW.js} +1 -1
- package/browser/{chunk-NIWQTQ4O.js → chunk-UR6XBKLF.js} +2 -2
- package/browser/{chunk-OGDOEOAZ.js → chunk-UVSA2UJK.js} +1 -1
- package/browser/{chunk-SZUEQQ7O.js → chunk-UYYASRRM.js} +1 -1
- package/browser/{chunk-KRVAZIXQ.js → chunk-V3YMDSO6.js} +1 -1
- package/browser/{chunk-U6KWQZVW.js → chunk-V7DHHIRT.js} +1 -1
- package/browser/{chunk-DVA2ULSI.js → chunk-VBVT3B3U.js} +1 -1
- package/browser/{chunk-QUH3ZFVT.js → chunk-VEMQMK3D.js} +1 -1
- package/browser/{chunk-DE5LWZZF.js → chunk-VEWPMJ7W.js} +1 -1
- package/browser/{chunk-KUTI4SLD.js → chunk-VOVTLJ6M.js} +1 -1
- package/browser/{chunk-6EWEOBCT.js → chunk-VTIO4KGR.js} +1 -1
- package/browser/{chunk-7LU4ZATY.js → chunk-WDHGY47N.js} +1 -1
- package/browser/{chunk-JEGUUL5I.js → chunk-WKJAI5WP.js} +2 -2
- package/browser/{chunk-3TFRWYFA.js → chunk-WSXTKCBU.js} +1 -1
- package/browser/{chunk-YSCG3E2K.js → chunk-XGEMW5UL.js} +1 -1
- package/browser/{chunk-MGGUBXFV.js → chunk-XZCSPAY6.js} +1 -1
- package/browser/{chunk-KUHYCLDE.js → chunk-Y5JV76W7.js} +1 -1
- package/browser/{chunk-UOORYSVA.js → chunk-Z3NSCS2T.js} +1 -1
- package/browser/{chunk-7CN3DW7K.js → chunk-Z66BUCTM.js} +1 -1
- package/browser/{chunk-HSJAJCR6.js → chunk-ZCLLRN5K.js} +1 -1
- package/browser/{chunk-4PD4TTFO.js → chunk-ZKZFV4BZ.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-5DQEX4UE.js → main-OM6BRE55.js} +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as $e}from"./chunk-U46R2HVC.js";import{b as Ve,c as Le,d as Re,e as Be,f as We,g as je}from"./chunk-RD4NULM3.js";import"./chunk-QSO3OJ62.js";import{b as ze}from"./chunk-RJUJV3CJ.js";import{c as ve}from"./chunk-AES2MVIS.js";import{c as Se}from"./chunk-AKZW6L24.js";import"./chunk-T2Y6L3PM.js";import{b as be}from"./chunk-SBLNMOXY.js";import"./chunk-EBFSFFKT.js";import"./chunk-AL62F7WU.js";import{a as Ne,f as Ae}from"./chunk-QD7VJ23Y.js";import"./chunk-TEUPLXZW.js";import{d as Fe}from"./chunk-OAR3S27F.js";import"./chunk-IMFQP5VB.js";import"./chunk-V7UKPPAB.js";import{a as we}from"./chunk-64E2KYWA.js";import{d as Oe,e as De,g as ke,h as Ue}from"./chunk-N4DLJR7D.js";import"./chunk-BFXGJLU4.js";import"./chunk-2RVNWUGY.js";import"./chunk-ZBUXJSWD.js";import"./chunk-UBFC273L.js";import"./chunk-TXPPVLN7.js";import"./chunk-7O57X7B6.js";import"./chunk-BS7OOL5F.js";import"./chunk-TVSZWXKF.js";import"./chunk-DFCFXDXX.js";import"./chunk-4PPHUFDR.js";import"./chunk-CXNSSMWD.js";import"./chunk-GDCWOLXR.js";import{a as Me}from"./chunk-63YUGNBG.js";import"./chunk-YBMKTLKP.js";import{a as Ee,b as Pe}from"./chunk-QAK7KBYZ.js";import"./chunk-LQFCNDOF.js";import"./chunk-ZK5X3QHG.js";import"./chunk-2QGJVMDP.js";import"./chunk-ZMJGUKRR.js";import"./chunk-IWAI7MVS.js";import"./chunk-PPMQE2JW.js";import"./chunk-XAGPF2DG.js";import"./chunk-BODLDM6S.js";import"./chunk-BGEZ7L55.js";import{a as ye,b as Ie,c as Te}from"./chunk-77MBEZAF.js";import"./chunk-AXL4BYTM.js";import"./chunk-7YB46QHZ.js";import"./chunk-NNCNCSRM.js";import"./chunk-APJZ7FTS.js";import"./chunk-HDB7WDVX.js";import{a as H}from"./chunk-QZBFXR5W.js";import"./chunk-URT4455F.js";import"./chunk-OAD4FS2F.js";import"./chunk-YQ4XRLUA.js";import{b as Ce,c as he}from"./chunk-IZ6OEFHZ.js";import"./chunk-ZLF22NO2.js";import"./chunk-Y6W7XUTQ.js";import"./chunk-LKCUXC3X.js";import{ra as xe}from"./chunk-CNL7LBPM.js";import{F as B,G as ge,h as _e,p as fe}from"./chunk-7OJUWRPB.js";import"./chunk-E47ESBEL.js";import"./chunk-U7C6WYAO.js";import"./chunk-QOCZG4DD.js";import"./chunk-VF6YIHOS.js";import"./chunk-PPTZHIIZ.js";import{a as ce}from"./chunk-V6BLMT7L.js";import{q as ue}from"./chunk-UBUWTJXF.js";import{$b as A,Ab as ee,Bc as ae,Ca as U,Cb as te,D as K,Db as ie,Eb as c,Fb as n,Gb as o,Gc as g,H as Y,Hb as v,Hc as C,Ic as pe,Lb as E,Mb as P,Qa as X,Qb as w,Tb as f,Tc as Q,Uc as L,Va as p,Vb as s,Wb as ne,Xb as G,Y as j,Zb as F,_b as N,aa as J,ab as $,dc as V,ea as z,eb as I,fc as oe,i as q,ic as r,jb as Z,jc as d,jd as me,kb as T,kc as y,nc as O,oa as M,oc as D,pc as k,pd as se,sa as u,ta as _,td as de,wd as R,xb as S,yc as re,zb as b,zc as le}from"./chunk-45TUMJS2.js";import"./chunk-NF7PG5F2.js";var qe=["stepperRef"],Ke=[[["preview"]],[["complete"]]],Ye=["preview","complete"];function Je(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function Xe(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function Ze(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function et(t,a){t&1&&(v(0,"i",8),n(1,"span"),r(2,"Upload"),o())}function tt(t,a){if(t&1){let e=w();n(0,"div",9)(1,"div",10)(2,"POS-uppy",11),f("fileUploaded",function(i){u(e);let m=s(2);return _(m.onDropFile(i))}),o()(),n(3,"div",12)(4,"p",13),r(5," Please refer this "),n(6,"a",14),r(7,"article"),o(),r(8," for more information "),o()()()}if(t&2){let e=s(2);p(2),c("sampleUrl",e.sampleUrl())("subtitle","Accepted file formats: .csv & max file size: 1 MB"),p(4),c("href",e.articleLink(),X)}}function it(t,a){if(t&1&&S(0,tt,9,3,"div",9),t&2){s();let e=V(1);b(e.selectedIndex===0?0:-1)}}function nt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function ot(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function rt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function lt(t,a){t&1&&(v(0,"i",15),n(1,"span"),r(2,"Preview"),o())}function at(t,a){t&1&&G(0)}function pt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function mt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function st(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function dt(t,a){t&1&&(v(0,"i",16),n(1,"span"),r(2,"Finish"),o())}function ct(t,a){t&1&&G(0,1)}var h=(function(t){return t[t.UPLOAD=0]="UPLOAD",t[t.PREVIEW=1]="PREVIEW",t[t.COMPLETE=2]="COMPLETE",t})(h||{}),Qe=(()=>{class t{constructor(){this.sampleUrl=L(""),this.articleLink=L(),this._onDropFile=Q({alias:"onDropFile"}),this.disabledEdit=L(!1),this._onStateChange=Q({alias:"onStateChange"}),console.log("Import Stepper Component Initialized")}get stepper(){return this._stepper}nextStep(){this._stepper&&(this.stepper.selected&&(this.stepper.selected.completed=!0),this._stepper.next())}previousStep(){this._stepper&&this._stepper.previous()}resetStep(){this._stepper&&this._stepper.reset()}onStepChange(e){e.selectedIndex===1?this._onStateChange.emit(h.PREVIEW):e.selectedIndex===2?this._onStateChange.emit(h.COMPLETE):this._onStateChange.emit(h.UPLOAD)}onDropFile(e){this._onDropFile.emit(e)}onRemoveFile(){}stateUpload(){}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=I({type:t,selectors:[["pos-import-stepper"]],viewQuery:function(l,i){if(l&1&&F(qe,5),l&2){let m;N(m=A())&&(i._stepper=m.first)}},inputs:{sampleUrl:[1,"sampleUrl"],articleLink:[1,"articleLink"],disabledEdit:[1,"disabledEdit"]},outputs:{_onDropFile:"onDropFile",_onStateChange:"onStateChange"},ngContentSelectors:Ye,decls:20,vars:7,consts:[["stepperRef",""],[3,"selectionChange","linear"],[3,"completed","editable"],["matStepperIcon","done"],["matStepperIcon","create"],["matStepperIcon","edit"],["matStepLabel",""],["matStepContent",""],[1,"fa-solid","fa-upload","me-3"],[1,"d-flex","flex-column","align-items-center","justify-content-center","gap-2"],[2,"max-width","580px"],["file","",3,"fileUploaded","sampleUrl","subtitle"],[1,"d-flex","w-100",2,"max-width","580px"],[1,"fst-italic"],["target","_blank",3,"href"],[1,"fa-regular","fa-file","me-3"],[1,"fa-solid","fa-check","me-3"]],template:function(l,i){l&1&&(ne(Ke),n(0,"mat-stepper",1,0),f("selectionChange",function(x){return i.onStepChange(x)}),n(2,"mat-step",2),T(3,Je,1,1,"ng-template",3)(4,Xe,1,1,"ng-template",4)(5,Ze,1,1,"ng-template",5)(6,et,3,0,"ng-template",6)(7,it,1,1,"ng-template",7),o(),n(8,"mat-step",2),T(9,nt,1,1,"ng-template",3)(10,ot,1,1,"ng-template",4)(11,rt,1,1,"ng-template",5)(12,lt,3,0,"ng-template",6)(13,at,1,0,"ng-template",7),o(),n(14,"mat-step",2),T(15,pt,1,1,"ng-template",3)(16,mt,1,1,"ng-template",4)(17,st,1,1,"ng-template",5)(18,dt,3,0,"ng-template",6)(19,ct,1,0,"ng-template",7),o()()),l&2&&(c("linear",!0),p(2),c("completed",!1)("editable",!i.disabledEdit()),p(6),c("completed",!1)("editable",!i.disabledEdit()),p(6),c("completed",!1)("editable",!1))},dependencies:[Se,B,ge,be,ve,ze,Fe,je,Be,Ve,We,Le,Re],styles:[".mat-horizontal-stepper-header-container{width:50%!important;margin:0 auto} .mat-horizontal-stepper-wrapper{gap:1rem} .mat-horizontal-stepper-content{display:flex;justify-content:center} p-table .p-datatable-tbody>tr{border-bottom-width:1px;border-color:#dee2e6} p-table .p-datatable-tbody>tr>th{font-family:Roboto,system-ui!important;font-weight:400;font-style:normal} .p-datatable .p-datatable-wrapper .p-datatable-table .p-datatable-thead>tr>th{font-family:Roboto,Courier,monospace;font-weight:700;font-style:normal;color:#333} .p-datatable .p-datatable-wrapper .p-datatable-table .p-datatable-tbody>tr>td{font-family:Roboto,Courier,monospace;font-weight:400;font-style:normal;color:#333}"]})}}return t})();var W=class t{configModal=new Ce;dialogRef=M(ye);data=M(Ie);constructor(){this.initDialogConfig()}initDialogConfig(){this.configModal.title="Preview Summary",this.configModal.hideCancel=!0,this.configModal.okText="Import (F2)",this.configModal.customWidth="500px"}onOk(){this.dialogRef.close(!0)}onClose(){this.dialogRef.close(!1)}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=I({type:t,selectors:[["app-dialog-import-preview"]],decls:30,vars:10,consts:[[3,"onOk","onCancel","onClose","config"],[1,"card","mb-0"],[1,"card-header","py-6","bg-gradient-success"],[1,"card-body"],[1,"row"],[1,"col"],[1,"d-flex","flex-column","gap-2"],[2,"font-size","1.9rem"],[2,"font-size","1rem"]],template:function(e,l){e&1&&(n(0,"modal-material",0),f("onOk",function(){return l.onOk()})("onCancel",function(){return l.onClose()})("onClose",function(){return l.onClose()}),v(1,"header"),n(2,"content")(3,"div",1)(4,"div",2)(5,"h3"),r(6,"Import Summary"),o()(),n(7,"div",3)(8,"div",4)(9,"div",5)(10,"div",6)(11,"span",7),r(12),g(13,"number"),o(),n(14,"span",8),r(15,"New Outlet"),o()()(),n(16,"div",5)(17,"div",6)(18,"span",7),r(19),g(20,"number"),o(),n(21,"span",8),r(22,"Update Outlet"),o()()(),n(23,"div",5)(24,"div",6)(25,"span",7),r(26),g(27,"number"),o(),n(28,"span",8),r(29,"New Outlet Group"),o()()()()()()()()),e&2&&(c("config",l.configModal),p(12),d(C(13,4,l.data==null?null:l.data.new)),p(7),d(C(20,6,l.data==null?null:l.data.update)),p(7),d(C(27,8,l.data==null?null:l.data.newOutletGroup)))},dependencies:[R,he,de],encapsulation:2})};var ft=["importStepper"],gt=()=>({"min-width":"50rem"}),Ct=(t,a,e)=>({"btn-success":t,"btn-outline-secondary":a,"not-allowed":e}),ht=t=>({"mb-1":t});function xt(t,a){if(t&1){let e=w();n(0,"button",14),f("click",function(){u(e);let i=s();return _(i.onPreviousStep())}),r(1," Back "),o()}}function St(t,a){if(t&1){let e=w();n(0,"button",15),g(1,"async"),g(2,"async"),f("click",function(){u(e);let i=s();return _(i.onNextStep())}),r(3," Next "),o()}if(t&2){let e,l,i=s();c("ngClass",ae(6,Ct,i.currentState()===1,i.currentState()!==1,!((e=C(1,2,i.importPreview$))!=null&&e.CanProceed)))("disabled",!((l=C(2,4,i.importPreview$))!=null&&l.CanProceed)&&i.currentState()===1)}}function bt(t,a){if(t&1){let e=w();n(0,"button",14),f("click",function(){u(e);let i=s();return _(i.onReset())}),r(1," New "),o()}}function vt(t,a){if(t&1){let e=w();n(0,"tr")(1,"th",16),r(2,"Name"),o(),n(3,"th",17),r(4,"Code"),o(),n(5,"th",18),r(6," Status "),n(7,"i",19),f("click",function(i){u(e);let m=V(9);return _(m.toggle(i))}),o(),n(8,"p-popover",null,1)(10,"div",20)(11,"div",21)(12,"p-checkbox",22),f("ngModelChange",function(i){u(e);let m=s();return _(m.selectAll(i))}),o(),n(13,"label",23),r(14,"All"),o()(),n(15,"div",24)(16,"p-checkbox",25),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(17,"label",26),r(18,"Unchanged"),o()(),n(19,"div",24)(20,"p-checkbox",27),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(21,"label",28),r(22,"New"),o()(),n(23,"div",24)(24,"p-checkbox",29),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(25,"label",30),r(26,"Error"),o()(),n(27,"div",24)(28,"p-checkbox",31),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(29,"label",32),r(30,"Update"),o()()()()(),n(31,"th"),r(32,"Message"),o()()}if(t&2){let e=s();p(12),c("ngModel",e.pickAll),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition)}}function wt(t,a){if(t&1&&(n(0,"div",33)(1,"span",34),r(2),o(),n(3,"span"),r(4),o()()),t&2){let e=a.$implicit,l=a.$index,i=s().$implicit;c("ngClass",le(3,ht,l<i.Issues.length-1)),p(2),y(" ",e.Issue,". "),p(2),y("",e.Solution," ")}}function yt(t,a){if(t&1&&(n(0,"tr")(1,"td"),r(2),o(),n(3,"td"),r(4),o(),n(5,"td"),r(6),o(),n(7,"td"),te(8,wt,5,5,"div",33,ee),o()()),t&2){let e=a.$implicit;p(2),d(e.Name),p(2),d(e.Code),p(),oe("bg-gradient-success",e.Action=="New")("bg-gradient-warning",e.Action=="Update")("bg-gradient-danger",e.Action=="Error"),p(),y(" ",e.Action," "),p(2),ie(e.Issues)}}function It(t,a){if(t&1&&(n(0,"div",37)(1,"span"),r(2),o(),r(3,", "),n(4,"span"),r(5),o(),n(6,"span"),r(7),o(),n(8,"span"),r(9,"succesfully imported"),o()()),t&2){let e=a;p(2),y("",e==null?null:e.Summary.NewOutlet," New Outlets"),p(3),y("",e==null?null:e.Summary.UpdateOutlet," Updated Outlets"),p(2),y("and ",e==null?null:e.Summary.NewOutletGroup," New Outlet Group")}}function Tt(t,a){if(t&1&&(n(0,"div",13),v(1,"i",35),n(2,"h1",36),r(3,"Upload Complete!"),o(),S(4,It,10,3,"div",37),g(5,"async"),o()),t&2){let e,l=s();p(4),b((e=C(5,1,l.importPreview$))?4:-1,e)}}var He=class t extends we{constructor(e,l){super(e);this.httpService=l;this.menuData$.subscribe()}httpService;pickAll=["All"];filterTreeCondition=["Unchanged","New","Error","Update"];importStepper;fileToImport=U(null);importPreview$;sampleImportFileUrl=ce.files.csv.outlet_import;articleLink="https://support.dealpos.com/en/articles/11069092-import-new-outlet";currentState=U(h.UPLOAD);confirmImport$;importPreview=U(null);dialog=M(Te);onDropFile(e){this.fileToImport.set(e)}onNextStep(){switch(this.currentState()){case h.UPLOAD:this.onPreviewImport();break;case h.PREVIEW:this.onImport();break;default:break}}onPreviousStep(){this.importStepper.previousStep()}onReset(){this.importPreview.set(null),this.importPreview$=null,this.confirmImport$=null,this.fileToImport.set(null),this.currentState.update(()=>h.UPLOAD),this.importStepper.resetStep()}onStateChange(e){this.currentState.update(()=>e)}onPreviewImport(){this.pickAll=["All"],this.filterTreeCondition=["Unchanged","New","Error","Update"];let e=new FormData;e.append("file",this.fileToImport()),this.importPreview$=this.httpService.postFormData(H.previewImportOutlet,e).pipe(z(l=>{this.importPreview.set(l),this.importStepper.nextStep()}),j(1))}onImport(){this.confirmImport$=this.dialog.open(W,{data:{new:this.importPreview()?.Summary?.NewOutlet,update:this.importPreview()?.Summary?.UpdateOutlet,newOutletGroup:this.importPreview()?.Summary?.NewOutletGroup}}).afterClosed().pipe(K(e=>e==!0),J(()=>this.httpService.post(H.importOutlet,{CacheKey:this.importPreview()?.CacheKey})),z(e=>{this.importStepper.nextStep()}),Y(e=>(this.pickAll=[],this.filterTreeCondition=["Error"],q)),j(1))}selectAll(e){this.pickAll=e,this.pickAll.length==0?this.filterTreeCondition=[]:this.filterTreeCondition=["Unchanged","New","Error","Update"]}static \u0275fac=function(l){return new(l||t)($(Me),$(ue))};static \u0275cmp=I({type:t,selectors:[["app-outlet-import"]],viewQuery:function(l,i){if(l&1&&F(ft,5),l&2){let m;N(m=A())&&(i.importStepper=m.first)}},features:[Z],decls:17,vars:21,consts:[["importStepper",""],["op",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","actions",5,["actions"]],["type","button",1,"btn","btn-outline-secondary"],[1,"btn",3,"ngClass","disabled"],["ngProjectAs","content",5,["content"]],[3,"onDropFile","onStateChange","sampleUrl","disabledEdit","articleLink"],["ngProjectAs","preview",5,["preview"]],[1,"w-100",3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["ngProjectAs","complete",5,["complete"]],[1,"d-flex","flex-column","align-items-center"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"btn",3,"click","ngClass","disabled"],[2,"width","300px"],[2,"width","200px"],[2,"width","100px"],[1,"fa","fa-filter","pointer",3,"click"],[2,"width","150px"],[1,"border-bottom","pb-3","d-flex","align-items-center","column-gap-3"],["label","Select All","name","filterTreeCondition","value","All","inputId","all",3,"ngModelChange","ngModel"],["for","all",1,"ms-2"],[1,"mt-4","d-flex","align-items-center","column-gap-3"],["label","Unchanged","name","filterTreeCondition","value","Unchanged","inputId","unchanged",3,"ngModelChange","ngModel"],["for","unchanged",1,"ms-2"],["label","New","name","filterTreeCondition","value","New","inputId","new",3,"ngModelChange","ngModel"],["for","new",1,"ms-2"],["label","Error","name","filterTreeCondition","value","Error","inputId","error",3,"ngModelChange","ngModel"],["for","error",1,"ms-2"],["label","Updated","name","filterTreeCondition","value","Update","inputId","update",3,"ngModelChange","ngModel"],["for","update",1,"ms-2"],[3,"ngClass"],[1,"me-1"],[1,"fa-solid","fa-circle-check","text-success",2,"font-size","110px"],[1,"mt-8"],[1,"d-flex","gap-2","fw-normal","fs-4","mt-2"]],template:function(l,i){if(l&1&&(n(0,"mainpanel-cmp",2),E(1,3),S(2,xt,2,0,"button",4),S(3,St,4,10,"button",5),S(4,bt,2,0,"button",4),P(),E(5,6),n(6,"pos-import-stepper",7,0),f("onDropFile",function(x){return i.onDropFile(x)})("onStateChange",function(x){return i.onStateChange(x)}),E(8,8),n(9,"p-table",9),g(10,"async"),g(11,"filterTree"),T(12,vt,33,5,"ng-template",10)(13,yt,10,9,"ng-template",11),o(),P(),E(14,12),S(15,Tt,6,3,"div",13),g(16,"async"),P(),o(),P(),o()),l&2){let m,x;c("pageData",i.menuData())("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),b(i.currentState()==1?2:-1),p(),b(i.fileToImport()&&((m=i.fileToImport())==null?null:m.size)>0&&i.currentState()<2?3:-1),p(),b(i.currentState()===2?4:-1),p(2),c("sampleUrl",i.sampleImportFileUrl)("disabledEdit",i.currentState()===2)("articleLink",i.articleLink),p(3),c("value",pe(11,15,(x=C(10,13,i.importPreview$))==null?null:x.DataRow,i.filterTreeCondition))("scrollable",!0)("tableStyle",re(20,gt)),p(6),b(C(16,18,i.confirmImport$)?15:-1)}},dependencies:[R,me,Qe,Ue,ke,Ae,Ne,xe,Pe,Ee,B,_e,fe,De,Oe,se,$e],encapsulation:2})};export{He as OutletImportComponent};
|
|
1
|
+
import{a as $e}from"./chunk-U46R2HVC.js";import{b as Ve,c as Le,d as Re,e as Be,f as We,g as je}from"./chunk-RD4NULM3.js";import"./chunk-QSO3OJ62.js";import{b as ze}from"./chunk-RJUJV3CJ.js";import{c as ve}from"./chunk-AES2MVIS.js";import{c as Se}from"./chunk-AKZW6L24.js";import"./chunk-T2Y6L3PM.js";import{b as be}from"./chunk-SBLNMOXY.js";import"./chunk-EBFSFFKT.js";import"./chunk-AL62F7WU.js";import{a as Ne,f as Ae}from"./chunk-QD7VJ23Y.js";import"./chunk-TEUPLXZW.js";import{d as Fe}from"./chunk-OAR3S27F.js";import"./chunk-IMFQP5VB.js";import"./chunk-V7UKPPAB.js";import{a as we}from"./chunk-64E2KYWA.js";import{d as Oe,e as De,g as ke,h as Ue}from"./chunk-5RNCX5GO.js";import"./chunk-BFXGJLU4.js";import"./chunk-2RVNWUGY.js";import"./chunk-ZBUXJSWD.js";import"./chunk-UBFC273L.js";import"./chunk-TXPPVLN7.js";import"./chunk-7O57X7B6.js";import"./chunk-BS7OOL5F.js";import"./chunk-TVSZWXKF.js";import"./chunk-DFCFXDXX.js";import"./chunk-4PPHUFDR.js";import"./chunk-CXNSSMWD.js";import"./chunk-OU53L22U.js";import{a as Me}from"./chunk-3TR7ZYJV.js";import"./chunk-YBMKTLKP.js";import{a as Ee,b as Pe}from"./chunk-QAK7KBYZ.js";import"./chunk-MMWQPUOB.js";import"./chunk-ZK5X3QHG.js";import"./chunk-2QGJVMDP.js";import"./chunk-ZMJGUKRR.js";import"./chunk-IWAI7MVS.js";import"./chunk-PPMQE2JW.js";import"./chunk-XAGPF2DG.js";import"./chunk-BODLDM6S.js";import"./chunk-DASHPQJH.js";import{a as ye,b as Ie,c as Te}from"./chunk-77MBEZAF.js";import"./chunk-AXL4BYTM.js";import"./chunk-7YB46QHZ.js";import"./chunk-NNCNCSRM.js";import"./chunk-APJZ7FTS.js";import"./chunk-HDB7WDVX.js";import{a as H}from"./chunk-ICRIBA3P.js";import"./chunk-URT4455F.js";import"./chunk-OAD4FS2F.js";import"./chunk-YQ4XRLUA.js";import{b as Ce,c as he}from"./chunk-IZ6OEFHZ.js";import"./chunk-ZLF22NO2.js";import"./chunk-Y6W7XUTQ.js";import"./chunk-LKCUXC3X.js";import{ra as xe}from"./chunk-CNL7LBPM.js";import{F as B,G as ge,h as _e,p as fe}from"./chunk-7OJUWRPB.js";import"./chunk-KI5F5CW2.js";import"./chunk-FBI4U5NT.js";import"./chunk-QOCZG4DD.js";import"./chunk-VF6YIHOS.js";import"./chunk-PPTZHIIZ.js";import{a as ce}from"./chunk-DX4JI5WN.js";import{q as ue}from"./chunk-UBUWTJXF.js";import{$b as A,Ab as ee,Bc as ae,Ca as U,Cb as te,D as K,Db as ie,Eb as c,Fb as n,Gb as o,Gc as g,H as Y,Hb as v,Hc as C,Ic as pe,Lb as E,Mb as P,Qa as X,Qb as w,Tb as f,Tc as Q,Uc as L,Va as p,Vb as s,Wb as ne,Xb as G,Y as j,Zb as F,_b as N,aa as J,ab as $,dc as V,ea as z,eb as I,fc as oe,i as q,ic as r,jb as Z,jc as d,jd as me,kb as T,kc as y,nc as O,oa as M,oc as D,pc as k,pd as se,sa as u,ta as _,td as de,wd as R,xb as S,yc as re,zb as b,zc as le}from"./chunk-45TUMJS2.js";import"./chunk-NF7PG5F2.js";var qe=["stepperRef"],Ke=[[["preview"]],[["complete"]]],Ye=["preview","complete"];function Je(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function Xe(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function Ze(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function et(t,a){t&1&&(v(0,"i",8),n(1,"span"),r(2,"Upload"),o())}function tt(t,a){if(t&1){let e=w();n(0,"div",9)(1,"div",10)(2,"POS-uppy",11),f("fileUploaded",function(i){u(e);let m=s(2);return _(m.onDropFile(i))}),o()(),n(3,"div",12)(4,"p",13),r(5," Please refer this "),n(6,"a",14),r(7,"article"),o(),r(8," for more information "),o()()()}if(t&2){let e=s(2);p(2),c("sampleUrl",e.sampleUrl())("subtitle","Accepted file formats: .csv & max file size: 1 MB"),p(4),c("href",e.articleLink(),X)}}function it(t,a){if(t&1&&S(0,tt,9,3,"div",9),t&2){s();let e=V(1);b(e.selectedIndex===0?0:-1)}}function nt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function ot(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function rt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function lt(t,a){t&1&&(v(0,"i",15),n(1,"span"),r(2,"Preview"),o())}function at(t,a){t&1&&G(0)}function pt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function mt(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function st(t,a){if(t&1&&r(0),t&2){let e=a.index;d(e+1)}}function dt(t,a){t&1&&(v(0,"i",16),n(1,"span"),r(2,"Finish"),o())}function ct(t,a){t&1&&G(0,1)}var h=(function(t){return t[t.UPLOAD=0]="UPLOAD",t[t.PREVIEW=1]="PREVIEW",t[t.COMPLETE=2]="COMPLETE",t})(h||{}),Qe=(()=>{class t{constructor(){this.sampleUrl=L(""),this.articleLink=L(),this._onDropFile=Q({alias:"onDropFile"}),this.disabledEdit=L(!1),this._onStateChange=Q({alias:"onStateChange"}),console.log("Import Stepper Component Initialized")}get stepper(){return this._stepper}nextStep(){this._stepper&&(this.stepper.selected&&(this.stepper.selected.completed=!0),this._stepper.next())}previousStep(){this._stepper&&this._stepper.previous()}resetStep(){this._stepper&&this._stepper.reset()}onStepChange(e){e.selectedIndex===1?this._onStateChange.emit(h.PREVIEW):e.selectedIndex===2?this._onStateChange.emit(h.COMPLETE):this._onStateChange.emit(h.UPLOAD)}onDropFile(e){this._onDropFile.emit(e)}onRemoveFile(){}stateUpload(){}static{this.\u0275fac=function(l){return new(l||t)}}static{this.\u0275cmp=I({type:t,selectors:[["pos-import-stepper"]],viewQuery:function(l,i){if(l&1&&F(qe,5),l&2){let m;N(m=A())&&(i._stepper=m.first)}},inputs:{sampleUrl:[1,"sampleUrl"],articleLink:[1,"articleLink"],disabledEdit:[1,"disabledEdit"]},outputs:{_onDropFile:"onDropFile",_onStateChange:"onStateChange"},ngContentSelectors:Ye,decls:20,vars:7,consts:[["stepperRef",""],[3,"selectionChange","linear"],[3,"completed","editable"],["matStepperIcon","done"],["matStepperIcon","create"],["matStepperIcon","edit"],["matStepLabel",""],["matStepContent",""],[1,"fa-solid","fa-upload","me-3"],[1,"d-flex","flex-column","align-items-center","justify-content-center","gap-2"],[2,"max-width","580px"],["file","",3,"fileUploaded","sampleUrl","subtitle"],[1,"d-flex","w-100",2,"max-width","580px"],[1,"fst-italic"],["target","_blank",3,"href"],[1,"fa-regular","fa-file","me-3"],[1,"fa-solid","fa-check","me-3"]],template:function(l,i){l&1&&(ne(Ke),n(0,"mat-stepper",1,0),f("selectionChange",function(x){return i.onStepChange(x)}),n(2,"mat-step",2),T(3,Je,1,1,"ng-template",3)(4,Xe,1,1,"ng-template",4)(5,Ze,1,1,"ng-template",5)(6,et,3,0,"ng-template",6)(7,it,1,1,"ng-template",7),o(),n(8,"mat-step",2),T(9,nt,1,1,"ng-template",3)(10,ot,1,1,"ng-template",4)(11,rt,1,1,"ng-template",5)(12,lt,3,0,"ng-template",6)(13,at,1,0,"ng-template",7),o(),n(14,"mat-step",2),T(15,pt,1,1,"ng-template",3)(16,mt,1,1,"ng-template",4)(17,st,1,1,"ng-template",5)(18,dt,3,0,"ng-template",6)(19,ct,1,0,"ng-template",7),o()()),l&2&&(c("linear",!0),p(2),c("completed",!1)("editable",!i.disabledEdit()),p(6),c("completed",!1)("editable",!i.disabledEdit()),p(6),c("completed",!1)("editable",!1))},dependencies:[Se,B,ge,be,ve,ze,Fe,je,Be,Ve,We,Le,Re],styles:[".mat-horizontal-stepper-header-container{width:50%!important;margin:0 auto} .mat-horizontal-stepper-wrapper{gap:1rem} .mat-horizontal-stepper-content{display:flex;justify-content:center} p-table .p-datatable-tbody>tr{border-bottom-width:1px;border-color:#dee2e6} p-table .p-datatable-tbody>tr>th{font-family:Roboto,system-ui!important;font-weight:400;font-style:normal} .p-datatable .p-datatable-wrapper .p-datatable-table .p-datatable-thead>tr>th{font-family:Roboto,Courier,monospace;font-weight:700;font-style:normal;color:#333} .p-datatable .p-datatable-wrapper .p-datatable-table .p-datatable-tbody>tr>td{font-family:Roboto,Courier,monospace;font-weight:400;font-style:normal;color:#333}"]})}}return t})();var W=class t{configModal=new Ce;dialogRef=M(ye);data=M(Ie);constructor(){this.initDialogConfig()}initDialogConfig(){this.configModal.title="Preview Summary",this.configModal.hideCancel=!0,this.configModal.okText="Import (F2)",this.configModal.customWidth="500px"}onOk(){this.dialogRef.close(!0)}onClose(){this.dialogRef.close(!1)}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=I({type:t,selectors:[["app-dialog-import-preview"]],decls:30,vars:10,consts:[[3,"onOk","onCancel","onClose","config"],[1,"card","mb-0"],[1,"card-header","py-6","bg-gradient-success"],[1,"card-body"],[1,"row"],[1,"col"],[1,"d-flex","flex-column","gap-2"],[2,"font-size","1.9rem"],[2,"font-size","1rem"]],template:function(e,l){e&1&&(n(0,"modal-material",0),f("onOk",function(){return l.onOk()})("onCancel",function(){return l.onClose()})("onClose",function(){return l.onClose()}),v(1,"header"),n(2,"content")(3,"div",1)(4,"div",2)(5,"h3"),r(6,"Import Summary"),o()(),n(7,"div",3)(8,"div",4)(9,"div",5)(10,"div",6)(11,"span",7),r(12),g(13,"number"),o(),n(14,"span",8),r(15,"New Outlet"),o()()(),n(16,"div",5)(17,"div",6)(18,"span",7),r(19),g(20,"number"),o(),n(21,"span",8),r(22,"Update Outlet"),o()()(),n(23,"div",5)(24,"div",6)(25,"span",7),r(26),g(27,"number"),o(),n(28,"span",8),r(29,"New Outlet Group"),o()()()()()()()()),e&2&&(c("config",l.configModal),p(12),d(C(13,4,l.data==null?null:l.data.new)),p(7),d(C(20,6,l.data==null?null:l.data.update)),p(7),d(C(27,8,l.data==null?null:l.data.newOutletGroup)))},dependencies:[R,he,de],encapsulation:2})};var ft=["importStepper"],gt=()=>({"min-width":"50rem"}),Ct=(t,a,e)=>({"btn-success":t,"btn-outline-secondary":a,"not-allowed":e}),ht=t=>({"mb-1":t});function xt(t,a){if(t&1){let e=w();n(0,"button",14),f("click",function(){u(e);let i=s();return _(i.onPreviousStep())}),r(1," Back "),o()}}function St(t,a){if(t&1){let e=w();n(0,"button",15),g(1,"async"),g(2,"async"),f("click",function(){u(e);let i=s();return _(i.onNextStep())}),r(3," Next "),o()}if(t&2){let e,l,i=s();c("ngClass",ae(6,Ct,i.currentState()===1,i.currentState()!==1,!((e=C(1,2,i.importPreview$))!=null&&e.CanProceed)))("disabled",!((l=C(2,4,i.importPreview$))!=null&&l.CanProceed)&&i.currentState()===1)}}function bt(t,a){if(t&1){let e=w();n(0,"button",14),f("click",function(){u(e);let i=s();return _(i.onReset())}),r(1," New "),o()}}function vt(t,a){if(t&1){let e=w();n(0,"tr")(1,"th",16),r(2,"Name"),o(),n(3,"th",17),r(4,"Code"),o(),n(5,"th",18),r(6," Status "),n(7,"i",19),f("click",function(i){u(e);let m=V(9);return _(m.toggle(i))}),o(),n(8,"p-popover",null,1)(10,"div",20)(11,"div",21)(12,"p-checkbox",22),f("ngModelChange",function(i){u(e);let m=s();return _(m.selectAll(i))}),o(),n(13,"label",23),r(14,"All"),o()(),n(15,"div",24)(16,"p-checkbox",25),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(17,"label",26),r(18,"Unchanged"),o()(),n(19,"div",24)(20,"p-checkbox",27),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(21,"label",28),r(22,"New"),o()(),n(23,"div",24)(24,"p-checkbox",29),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(25,"label",30),r(26,"Error"),o()(),n(27,"div",24)(28,"p-checkbox",31),k("ngModelChange",function(i){u(e);let m=s();return D(m.filterTreeCondition,i)||(m.filterTreeCondition=i),_(i)}),o(),n(29,"label",32),r(30,"Update"),o()()()()(),n(31,"th"),r(32,"Message"),o()()}if(t&2){let e=s();p(12),c("ngModel",e.pickAll),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition),p(4),O("ngModel",e.filterTreeCondition)}}function wt(t,a){if(t&1&&(n(0,"div",33)(1,"span",34),r(2),o(),n(3,"span"),r(4),o()()),t&2){let e=a.$implicit,l=a.$index,i=s().$implicit;c("ngClass",le(3,ht,l<i.Issues.length-1)),p(2),y(" ",e.Issue,". "),p(2),y("",e.Solution," ")}}function yt(t,a){if(t&1&&(n(0,"tr")(1,"td"),r(2),o(),n(3,"td"),r(4),o(),n(5,"td"),r(6),o(),n(7,"td"),te(8,wt,5,5,"div",33,ee),o()()),t&2){let e=a.$implicit;p(2),d(e.Name),p(2),d(e.Code),p(),oe("bg-gradient-success",e.Action=="New")("bg-gradient-warning",e.Action=="Update")("bg-gradient-danger",e.Action=="Error"),p(),y(" ",e.Action," "),p(2),ie(e.Issues)}}function It(t,a){if(t&1&&(n(0,"div",37)(1,"span"),r(2),o(),r(3,", "),n(4,"span"),r(5),o(),n(6,"span"),r(7),o(),n(8,"span"),r(9,"succesfully imported"),o()()),t&2){let e=a;p(2),y("",e==null?null:e.Summary.NewOutlet," New Outlets"),p(3),y("",e==null?null:e.Summary.UpdateOutlet," Updated Outlets"),p(2),y("and ",e==null?null:e.Summary.NewOutletGroup," New Outlet Group")}}function Tt(t,a){if(t&1&&(n(0,"div",13),v(1,"i",35),n(2,"h1",36),r(3,"Upload Complete!"),o(),S(4,It,10,3,"div",37),g(5,"async"),o()),t&2){let e,l=s();p(4),b((e=C(5,1,l.importPreview$))?4:-1,e)}}var He=class t extends we{constructor(e,l){super(e);this.httpService=l;this.menuData$.subscribe()}httpService;pickAll=["All"];filterTreeCondition=["Unchanged","New","Error","Update"];importStepper;fileToImport=U(null);importPreview$;sampleImportFileUrl=ce.files.csv.outlet_import;articleLink="https://support.dealpos.com/en/articles/11069092-import-new-outlet";currentState=U(h.UPLOAD);confirmImport$;importPreview=U(null);dialog=M(Te);onDropFile(e){this.fileToImport.set(e)}onNextStep(){switch(this.currentState()){case h.UPLOAD:this.onPreviewImport();break;case h.PREVIEW:this.onImport();break;default:break}}onPreviousStep(){this.importStepper.previousStep()}onReset(){this.importPreview.set(null),this.importPreview$=null,this.confirmImport$=null,this.fileToImport.set(null),this.currentState.update(()=>h.UPLOAD),this.importStepper.resetStep()}onStateChange(e){this.currentState.update(()=>e)}onPreviewImport(){this.pickAll=["All"],this.filterTreeCondition=["Unchanged","New","Error","Update"];let e=new FormData;e.append("file",this.fileToImport()),this.importPreview$=this.httpService.postFormData(H.previewImportOutlet,e).pipe(z(l=>{this.importPreview.set(l),this.importStepper.nextStep()}),j(1))}onImport(){this.confirmImport$=this.dialog.open(W,{data:{new:this.importPreview()?.Summary?.NewOutlet,update:this.importPreview()?.Summary?.UpdateOutlet,newOutletGroup:this.importPreview()?.Summary?.NewOutletGroup}}).afterClosed().pipe(K(e=>e==!0),J(()=>this.httpService.post(H.importOutlet,{CacheKey:this.importPreview()?.CacheKey})),z(e=>{this.importStepper.nextStep()}),Y(e=>(this.pickAll=[],this.filterTreeCondition=["Error"],q)),j(1))}selectAll(e){this.pickAll=e,this.pickAll.length==0?this.filterTreeCondition=[]:this.filterTreeCondition=["Unchanged","New","Error","Update"]}static \u0275fac=function(l){return new(l||t)($(Me),$(ue))};static \u0275cmp=I({type:t,selectors:[["app-outlet-import"]],viewQuery:function(l,i){if(l&1&&F(ft,5),l&2){let m;N(m=A())&&(i.importStepper=m.first)}},features:[Z],decls:17,vars:21,consts:[["importStepper",""],["op",""],[3,"pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","actions",5,["actions"]],["type","button",1,"btn","btn-outline-secondary"],[1,"btn",3,"ngClass","disabled"],["ngProjectAs","content",5,["content"]],[3,"onDropFile","onStateChange","sampleUrl","disabledEdit","articleLink"],["ngProjectAs","preview",5,["preview"]],[1,"w-100",3,"value","scrollable","tableStyle"],["pTemplate","header"],["pTemplate","body"],["ngProjectAs","complete",5,["complete"]],[1,"d-flex","flex-column","align-items-center"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"btn",3,"click","ngClass","disabled"],[2,"width","300px"],[2,"width","200px"],[2,"width","100px"],[1,"fa","fa-filter","pointer",3,"click"],[2,"width","150px"],[1,"border-bottom","pb-3","d-flex","align-items-center","column-gap-3"],["label","Select All","name","filterTreeCondition","value","All","inputId","all",3,"ngModelChange","ngModel"],["for","all",1,"ms-2"],[1,"mt-4","d-flex","align-items-center","column-gap-3"],["label","Unchanged","name","filterTreeCondition","value","Unchanged","inputId","unchanged",3,"ngModelChange","ngModel"],["for","unchanged",1,"ms-2"],["label","New","name","filterTreeCondition","value","New","inputId","new",3,"ngModelChange","ngModel"],["for","new",1,"ms-2"],["label","Error","name","filterTreeCondition","value","Error","inputId","error",3,"ngModelChange","ngModel"],["for","error",1,"ms-2"],["label","Updated","name","filterTreeCondition","value","Update","inputId","update",3,"ngModelChange","ngModel"],["for","update",1,"ms-2"],[3,"ngClass"],[1,"me-1"],[1,"fa-solid","fa-circle-check","text-success",2,"font-size","110px"],[1,"mt-8"],[1,"d-flex","gap-2","fw-normal","fs-4","mt-2"]],template:function(l,i){if(l&1&&(n(0,"mainpanel-cmp",2),E(1,3),S(2,xt,2,0,"button",4),S(3,St,4,10,"button",5),S(4,bt,2,0,"button",4),P(),E(5,6),n(6,"pos-import-stepper",7,0),f("onDropFile",function(x){return i.onDropFile(x)})("onStateChange",function(x){return i.onStateChange(x)}),E(8,8),n(9,"p-table",9),g(10,"async"),g(11,"filterTree"),T(12,vt,33,5,"ng-template",10)(13,yt,10,9,"ng-template",11),o(),P(),E(14,12),S(15,Tt,6,3,"div",13),g(16,"async"),P(),o(),P(),o()),l&2){let m,x;c("pageData",i.menuData())("hideSearchBox",!0)("hideSearchDropdown",!0),p(2),b(i.currentState()==1?2:-1),p(),b(i.fileToImport()&&((m=i.fileToImport())==null?null:m.size)>0&&i.currentState()<2?3:-1),p(),b(i.currentState()===2?4:-1),p(2),c("sampleUrl",i.sampleImportFileUrl)("disabledEdit",i.currentState()===2)("articleLink",i.articleLink),p(3),c("value",pe(11,15,(x=C(10,13,i.importPreview$))==null?null:x.DataRow,i.filterTreeCondition))("scrollable",!0)("tableStyle",re(20,gt)),p(6),b(C(16,18,i.confirmImport$)?15:-1)}},dependencies:[R,me,Qe,Ue,ke,Ae,Ne,xe,Pe,Ee,B,_e,fe,De,Oe,se,$e],encapsulation:2})};export{He as OutletImportComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ve}from"./chunk-WGVXNG3I.js";import{a as fe}from"./chunk-CI7WB3BR.js";import{a as Ce}from"./chunk-QI7I4TZD.js";import"./chunk-BYXBJQAS.js";import"./chunk-64E2KYWA.js";import{g as se,h as ce}from"./chunk-N4DLJR7D.js";import"./chunk-GDCWOLXR.js";import{a as ue}from"./chunk-63YUGNBG.js";import"./chunk-YBMKTLKP.js";import"./chunk-QAK7KBYZ.js";import"./chunk-LQFCNDOF.js";import"./chunk-ZK5X3QHG.js";import"./chunk-2QGJVMDP.js";import"./chunk-ZMJGUKRR.js";import"./chunk-IWAI7MVS.js";import"./chunk-PPMQE2JW.js";import"./chunk-XAGPF2DG.js";import"./chunk-BGEZ7L55.js";import{a as de,b as me,c as pe}from"./chunk-77MBEZAF.js";import"./chunk-AXL4BYTM.js";import"./chunk-7YB46QHZ.js";import"./chunk-NNCNCSRM.js";import"./chunk-APJZ7FTS.js";import"./chunk-HDB7WDVX.js";import{a as k}from"./chunk-QZBFXR5W.js";import{b as ae,c as le}from"./chunk-IZ6OEFHZ.js";import"./chunk-ZLF22NO2.js";import"./chunk-Y6W7XUTQ.js";import"./chunk-LKCUXC3X.js";import"./chunk-CNL7LBPM.js";import{E as te,F as ne,G as ie,c as Y,e as _,h as X,i as Q,q as Z,w as ee,x as oe}from"./chunk-7OJUWRPB.js";import"./chunk-E47ESBEL.js";import"./chunk-U7C6WYAO.js";import"./chunk-QOCZG4DD.js";import{b as re}from"./chunk-VF6YIHOS.js";import{a as F}from"./chunk-PPTZHIIZ.js";import"./chunk-V6BLMT7L.js";import{n as z,q as J}from"./chunk-UBUWTJXF.js";import{Ab as O,Ac as q,Ca as V,Cb as U,D as T,Db as H,Eb as m,Fb as i,Gb as r,Hb as c,Mc as K,Nb as $,Od as W,Pc as L,Qb as G,Tb as v,Va as l,Vb as f,ab as C,dc as j,eb as E,ic as a,jb as A,jc as x,jd as R,kb as I,kc as w,oa as b,od as B,r as D,sa as S,ta as P,wd as M,xb as p,zb as u,zc as h}from"./chunk-45TUMJS2.js";import"./chunk-NF7PG5F2.js";var N=n=>({"is-invalid":n});function Se(n,d){n&1&&(i(0,"div",16),a(1," Provider Name is required "),r())}function Pe(n,d){n&1&&(i(0,"div",20),a(1," Validate Coupon URL is required "),r())}function Ee(n,d){n&1&&(i(0,"div",20),a(1," Redeem Coupon URL is required "),r())}function Ge(n,d){n&1&&(i(0,"div",20),a(1,"Key is required"),r())}var y=class n{constructor(d){this.data=d;this.config=new ae,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}data;dialogRef=b(de);config;fb=b(te);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[_.required]],validateCoupon:[this.data?.validateCoupon||"",[_.required]],redeemCoupon:[this.data?.redeemCoupon||"",[_.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[_.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||n)(C(me))};static \u0275cmp=E({type:n,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(i(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),c(10,"input",9),i(11,"label",10),a(12,"Coupon Provider"),r()()(),i(13,"div",11)(14,"div",12)(15,"div",13),c(16,"app-customize-toggle",14),r(),i(17,"label",15),a(18,"Enabled"),r()()()(),p(19,Se,2,0,"div",16),r(),i(20,"div",17),c(21,"input",18),i(22,"label",19),a(23,"Validate Coupon URL"),r(),p(24,Pe,2,0,"div",20),r(),i(25,"div",17),c(26,"input",21),i(27,"label",22),a(28,"Redeem Coupon URL"),r(),p(29,Ee,2,0,"div",20),r(),i(30,"div",23),c(31,"textarea",24),i(32,"label",25),a(33,"Request Header (Key: value)"),r(),p(34,Ge,2,0,"div",20),r()()()()()()()),e&2&&(m("config",o.config),l(5),m("formGroup",o.formGroup),l(5),m("ngClass",h(10,N,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),u(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),m("ngClass",h(12,N,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),u(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),m("ngClass",h(14,N,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),u(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),m("ngClass",h(16,N,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),u(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,ie,Z,Y,X,Q,oe,ee,le,ve],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var xe=(n,d)=>({"bg-success-subtle text-success-emphasis":n,"bg-danger-subtle text-danger-emphasis":d});function Re(n,d){if(n&1){let e=G();i(0,"button",10),v("click",function(){S(e);let t=f();return P(t.addNewCouponProvider())}),a(1," Add "),r()}}function Me(n,d){n&1&&c(0,"th",8)}function Ne(n,d){if(n&1){let e=G();i(0,"td",11)(1,"i",14),v("click",function(){S(e);let t=f().$index,s=f(2);return P(s.onDeleteProvider(t))}),r()()}}function Te(n,d){if(n&1){let e=G();i(0,"tr"),p(1,Ne,2,0,"td",11),i(2,"td")(3,"a",12),v("click",function(){let t=S(e),s=t.$implicit,g=t.$index,be=f(2);return P(be.onUpdateProvider(s,g))}),a(4),r()(),i(5,"td"),a(6),r(),i(7,"td"),a(8),r(),i(9,"td"),a(10),r(),i(11,"td")(12,"span",13),a(13),r()()()}if(n&2){let e=d.$implicit,o=f(2);l(),u(o.role.developer.Edit?1:-1),l(3),w(" ",e.Name," "),l(2),x(e.ValidateCoupon),l(2),x(e.RedeemCoupon),l(2),x(e.KeyUI),l(2),m("ngClass",q(7,xe,e.Enabled,!e.Enabled)),l(),w(" ",e.Enabled?"Enabled":"Disabled"," ")}}function Ie(n,d){if(n&1&&U(0,Te,14,10,"tr",null,O),n&2){let e=f();H(e.listProviders())}}function we(n,d){n&1&&$(0)}function Fe(n,d){if(n&1&&I(0,we,1,0,"ng-container",15),n&2){f();let e=j(25);m("ngTemplateOutlet",e)}}function ke(n,d){n&1&&(i(0,"tr",16)(1,"td",17),c(2,"empty-state-table"),r()())}var ge=class n extends fe{constructor(e,o,t,s,g){super(e,o,k.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=s;this.dialog=g}activatedRoute;role;dialog;toastr=b(z);couponProviders=V([]);listProviders=L(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(y).afterClosed().pipe(T(e=>F.IsNotEmpty(e)),D(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(y,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(T(t=>F.IsNotEmpty(t))).subscribe(t=>{let s={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(g=>(g[o]=s,[...g])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(k.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||n)(C(ue),C(J),C(W),C(re),C(pe))};static \u0275cmp=E({type:n,selectors:[["app-coupon-configuration"]],features:[A],decls:26,vars:6,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button",1,"btn","btn-success"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],[1,"text-center",2,"width","10px"],[2,"width","220px"],["type","button",1,"btn","btn-success",3,"click"],[1,"text-center"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1&&(i(0,"mainpanel-cmp",1)(1,"actions"),p(2,Re,2,0,"button",2),r(),i(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"table",6)(8,"thead",7)(9,"tr"),p(10,Me,1,0,"th",8),i(11,"th",9),a(12,"Name"),r(),i(13,"th"),a(14,"Validate Coupon"),r(),i(15,"th"),a(16,"Redeem Coupon"),r(),i(17,"th"),a(18,"Value"),r(),i(19,"th"),a(20,"Status"),r()()(),i(21,"tbody"),p(22,Ie,2,0)(23,Fe,1,1,"ng-container"),r()()()()(),I(24,ke,3,0,"ng-template",null,0,K),r()()),o&2){let s;m("pageData",t.menuData())("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),u(t.role.developer.Edit?2:-1),l(8),u(t.role.developer.Edit?10:-1),l(12),u(((s=t.listProviders())==null?null:s.length)>0?22:23)}},dependencies:[M,R,B,ce,se,ne,Ce],encapsulation:2,changeDetection:0})};export{ge as CouponConfigurationComponent};
|
|
1
|
+
import{a as ve}from"./chunk-WGVXNG3I.js";import{a as fe}from"./chunk-CI7WB3BR.js";import{a as Ce}from"./chunk-QI7I4TZD.js";import"./chunk-BYXBJQAS.js";import"./chunk-64E2KYWA.js";import{g as se,h as ce}from"./chunk-5RNCX5GO.js";import"./chunk-OU53L22U.js";import{a as ue}from"./chunk-3TR7ZYJV.js";import"./chunk-YBMKTLKP.js";import"./chunk-QAK7KBYZ.js";import"./chunk-MMWQPUOB.js";import"./chunk-ZK5X3QHG.js";import"./chunk-2QGJVMDP.js";import"./chunk-ZMJGUKRR.js";import"./chunk-IWAI7MVS.js";import"./chunk-PPMQE2JW.js";import"./chunk-XAGPF2DG.js";import"./chunk-DASHPQJH.js";import{a as de,b as me,c as pe}from"./chunk-77MBEZAF.js";import"./chunk-AXL4BYTM.js";import"./chunk-7YB46QHZ.js";import"./chunk-NNCNCSRM.js";import"./chunk-APJZ7FTS.js";import"./chunk-HDB7WDVX.js";import{a as k}from"./chunk-ICRIBA3P.js";import{b as ae,c as le}from"./chunk-IZ6OEFHZ.js";import"./chunk-ZLF22NO2.js";import"./chunk-Y6W7XUTQ.js";import"./chunk-LKCUXC3X.js";import"./chunk-CNL7LBPM.js";import{E as te,F as ne,G as ie,c as Y,e as _,h as X,i as Q,q as Z,w as ee,x as oe}from"./chunk-7OJUWRPB.js";import"./chunk-KI5F5CW2.js";import"./chunk-FBI4U5NT.js";import"./chunk-QOCZG4DD.js";import{b as re}from"./chunk-VF6YIHOS.js";import{a as F}from"./chunk-PPTZHIIZ.js";import"./chunk-DX4JI5WN.js";import{n as z,q as J}from"./chunk-UBUWTJXF.js";import{Ab as O,Ac as q,Ca as V,Cb as U,D as T,Db as H,Eb as m,Fb as i,Gb as r,Hb as c,Mc as K,Nb as $,Od as W,Pc as L,Qb as G,Tb as v,Va as l,Vb as f,ab as C,dc as j,eb as E,ic as a,jb as A,jc as x,jd as R,kb as I,kc as w,oa as b,od as B,r as D,sa as S,ta as P,wd as M,xb as p,zb as u,zc as h}from"./chunk-45TUMJS2.js";import"./chunk-NF7PG5F2.js";var N=n=>({"is-invalid":n});function Se(n,d){n&1&&(i(0,"div",16),a(1," Provider Name is required "),r())}function Pe(n,d){n&1&&(i(0,"div",20),a(1," Validate Coupon URL is required "),r())}function Ee(n,d){n&1&&(i(0,"div",20),a(1," Redeem Coupon URL is required "),r())}function Ge(n,d){n&1&&(i(0,"div",20),a(1,"Key is required"),r())}var y=class n{constructor(d){this.data=d;this.config=new ae,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}data;dialogRef=b(de);config;fb=b(te);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[_.required]],validateCoupon:[this.data?.validateCoupon||"",[_.required]],redeemCoupon:[this.data?.redeemCoupon||"",[_.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[_.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||n)(C(me))};static \u0275cmp=E({type:n,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(i(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),c(10,"input",9),i(11,"label",10),a(12,"Coupon Provider"),r()()(),i(13,"div",11)(14,"div",12)(15,"div",13),c(16,"app-customize-toggle",14),r(),i(17,"label",15),a(18,"Enabled"),r()()()(),p(19,Se,2,0,"div",16),r(),i(20,"div",17),c(21,"input",18),i(22,"label",19),a(23,"Validate Coupon URL"),r(),p(24,Pe,2,0,"div",20),r(),i(25,"div",17),c(26,"input",21),i(27,"label",22),a(28,"Redeem Coupon URL"),r(),p(29,Ee,2,0,"div",20),r(),i(30,"div",23),c(31,"textarea",24),i(32,"label",25),a(33,"Request Header (Key: value)"),r(),p(34,Ge,2,0,"div",20),r()()()()()()()),e&2&&(m("config",o.config),l(5),m("formGroup",o.formGroup),l(5),m("ngClass",h(10,N,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),u(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),m("ngClass",h(12,N,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),u(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),m("ngClass",h(14,N,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),u(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),m("ngClass",h(16,N,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),u(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,ie,Z,Y,X,Q,oe,ee,le,ve],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var xe=(n,d)=>({"bg-success-subtle text-success-emphasis":n,"bg-danger-subtle text-danger-emphasis":d});function Re(n,d){if(n&1){let e=G();i(0,"button",10),v("click",function(){S(e);let t=f();return P(t.addNewCouponProvider())}),a(1," Add "),r()}}function Me(n,d){n&1&&c(0,"th",8)}function Ne(n,d){if(n&1){let e=G();i(0,"td",11)(1,"i",14),v("click",function(){S(e);let t=f().$index,s=f(2);return P(s.onDeleteProvider(t))}),r()()}}function Te(n,d){if(n&1){let e=G();i(0,"tr"),p(1,Ne,2,0,"td",11),i(2,"td")(3,"a",12),v("click",function(){let t=S(e),s=t.$implicit,g=t.$index,be=f(2);return P(be.onUpdateProvider(s,g))}),a(4),r()(),i(5,"td"),a(6),r(),i(7,"td"),a(8),r(),i(9,"td"),a(10),r(),i(11,"td")(12,"span",13),a(13),r()()()}if(n&2){let e=d.$implicit,o=f(2);l(),u(o.role.developer.Edit?1:-1),l(3),w(" ",e.Name," "),l(2),x(e.ValidateCoupon),l(2),x(e.RedeemCoupon),l(2),x(e.KeyUI),l(2),m("ngClass",q(7,xe,e.Enabled,!e.Enabled)),l(),w(" ",e.Enabled?"Enabled":"Disabled"," ")}}function Ie(n,d){if(n&1&&U(0,Te,14,10,"tr",null,O),n&2){let e=f();H(e.listProviders())}}function we(n,d){n&1&&$(0)}function Fe(n,d){if(n&1&&I(0,we,1,0,"ng-container",15),n&2){f();let e=j(25);m("ngTemplateOutlet",e)}}function ke(n,d){n&1&&(i(0,"tr",16)(1,"td",17),c(2,"empty-state-table"),r()())}var ge=class n extends fe{constructor(e,o,t,s,g){super(e,o,k.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=s;this.dialog=g}activatedRoute;role;dialog;toastr=b(z);couponProviders=V([]);listProviders=L(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(y).afterClosed().pipe(T(e=>F.IsNotEmpty(e)),D(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(y,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(T(t=>F.IsNotEmpty(t))).subscribe(t=>{let s={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(g=>(g[o]=s,[...g])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(k.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||n)(C(ue),C(J),C(W),C(re),C(pe))};static \u0275cmp=E({type:n,selectors:[["app-coupon-configuration"]],features:[A],decls:26,vars:6,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button",1,"btn","btn-success"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],[1,"text-center",2,"width","10px"],[2,"width","220px"],["type","button",1,"btn","btn-success",3,"click"],[1,"text-center"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1&&(i(0,"mainpanel-cmp",1)(1,"actions"),p(2,Re,2,0,"button",2),r(),i(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"table",6)(8,"thead",7)(9,"tr"),p(10,Me,1,0,"th",8),i(11,"th",9),a(12,"Name"),r(),i(13,"th"),a(14,"Validate Coupon"),r(),i(15,"th"),a(16,"Redeem Coupon"),r(),i(17,"th"),a(18,"Value"),r(),i(19,"th"),a(20,"Status"),r()()(),i(21,"tbody"),p(22,Ie,2,0)(23,Fe,1,1,"ng-container"),r()()()()(),I(24,ke,3,0,"ng-template",null,0,K),r()()),o&2){let s;m("pageData",t.menuData())("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),u(t.role.developer.Edit?2:-1),l(8),u(t.role.developer.Edit?10:-1),l(12),u(((s=t.listProviders())==null?null:s.length)>0?22:23)}},dependencies:[M,R,B,ce,se,ne,Ce],encapsulation:2,changeDetection:0})};export{ge as CouponConfigurationComponent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as g}from"./chunk-VPV7K2XI.js";import{a as h}from"./chunk-
|
|
1
|
+
import{a as g}from"./chunk-VPV7K2XI.js";import{a as h}from"./chunk-ICRIBA3P.js";import{a as c}from"./chunk-IZ6OEFHZ.js";import{a as m}from"./chunk-DX4JI5WN.js";import{n as u,q as d}from"./chunk-UBUWTJXF.js";import{ka as l,oa as o}from"./chunk-45TUMJS2.js";import{j as p}from"./chunk-NF7PG5F2.js";var b=class n{toastr=o(u);httpService=o(d);copyToClipBoard=o(g);createCustomerFromNewNumberAndSendReceipt(e,r,t,i,a){t==0?this.httpService.post(h.CreateCustomerInvoice,{InvoiceID:i.ObjectID,Mobile:e}).subscribe(s=>p(this,null,function*(){this.toastr.success(s.Message,c.Success),yield this.sendReceiptToWhatsapp(e,i,r,a)})):this.toastr.info("WABA is not supported yet",c.Info)}createWhatsappReceipt(e,r,t){let i=I=>new Intl.NumberFormat("id-ID",{style:"currency",currency:"IDR"}).format(I).replace("Rp","").trim().split(",00")?.[0],a=JSON.parse(localStorage.getItem("AccountInfo"))?.BrandName,{ObjectID:s,Final:y,InvoiceNumber:f}=e,v=window.location.host,w=`https://receipt.dealpos.app/s?Data=${window.btoa(`${s}_${v}`)}`;return this.convertWhatsappTemplateMessage({Amount:i(y),Brand:a,Currency:r,Number:f,ReceiptLink:w},t)}convertWhatsappTemplateMessage(e,r){let t=r||m?.whatsappTemplateMessage,i=["Brand","Number","Currency","Amount","ReceiptLink"],a=t;return i.forEach(s=>a=a.replace(`{${s}}`,e[s])),a}redirectToWhatsapp(e,r){let t=e;t=t[0]==="0"?`62${t.slice(1)}`:t;let i=`whatsapp://send?phone=${t}&text=${encodeURIComponent(r)}`;window.location.href=i,this.showToastrWhatsappNoInstalled()}showToastrWhatsappNoInstalled(){let e=!1;window.onblur=function(){e=!0},setTimeout(()=>{e||this.toastr.warning(`Currently, sending an e-receipt automatically opens WhatsApp Desktop, provided the device has the app installed
|
|
2
2
|
`,"WhatsApp not installed")},2e3)}copyToClipboard(e){return new Promise((r,t)=>this.copyToClipBoard.copy(e).then(()=>{this.toastr.info("Message copied to clipboard. If WhatsApp doesn't show the message, please paste it manually.","Receipt Ready",{timeOut:8e3}),r("Copied to clipboard")}).catch(i=>{console.log(i),this.toastr.warning("Could not copy message to clipboard","Clipboard Error",{timeOut:8e3}),t(i)}))}sendReceiptToWhatsapp(e,r,t,i){return p(this,null,function*(){try{let a=this.createWhatsappReceipt(r,t,i);try{yield this.copyToClipboard(a)}finally{this.redirectToWhatsapp(e,a)}}catch(a){console.warn(a),this.toastr.error("Failed to send receipt")}})}static \u0275fac=function(r){return new(r||n)};static \u0275prov=l({token:n,factory:n.\u0275fac})};export{b as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as le,b as pe}from"./chunk-TVTF7HYM.js";import"./chunk-AW3N6IVX.js";import"./chunk-AKZW6L24.js";import"./chunk-T2Y6L3PM.js";import"./chunk-SBLNMOXY.js";import"./chunk-EBFSFFKT.js";import{a as re}from"./chunk-QVLXVGK5.js";import{g as ce,h as _e}from"./chunk-
|
|
1
|
+
import{a as le,b as pe}from"./chunk-TVTF7HYM.js";import"./chunk-AW3N6IVX.js";import"./chunk-AKZW6L24.js";import"./chunk-T2Y6L3PM.js";import"./chunk-SBLNMOXY.js";import"./chunk-EBFSFFKT.js";import{a as re}from"./chunk-QVLXVGK5.js";import{g as ce,h as _e}from"./chunk-5RNCX5GO.js";import"./chunk-FRIOAB7J.js";import"./chunk-6JWDLWMH.js";import{a as se}from"./chunk-TDPR34KX.js";import"./chunk-OU53L22U.js";import{a as de}from"./chunk-3TR7ZYJV.js";import"./chunk-YBMKTLKP.js";import"./chunk-QAK7KBYZ.js";import"./chunk-MMWQPUOB.js";import"./chunk-ZK5X3QHG.js";import"./chunk-2QGJVMDP.js";import"./chunk-ZMJGUKRR.js";import"./chunk-IWAI7MVS.js";import"./chunk-PPMQE2JW.js";import"./chunk-XAGPF2DG.js";import{d as ue,e as me}from"./chunk-YLJMYMN6.js";import"./chunk-DASHPQJH.js";import"./chunk-77MBEZAF.js";import"./chunk-AXL4BYTM.js";import"./chunk-7YB46QHZ.js";import"./chunk-NNCNCSRM.js";import"./chunk-APJZ7FTS.js";import{a as Z}from"./chunk-HDB7WDVX.js";import{a as H}from"./chunk-ICRIBA3P.js";import"./chunk-IZ6OEFHZ.js";import"./chunk-ZLF22NO2.js";import"./chunk-Y6W7XUTQ.js";import"./chunk-LKCUXC3X.js";import"./chunk-CNL7LBPM.js";import{F as oe,c as te,h as ie,p as ne}from"./chunk-7OJUWRPB.js";import"./chunk-KI5F5CW2.js";import"./chunk-FBI4U5NT.js";import"./chunk-QOCZG4DD.js";import{b as ae}from"./chunk-VF6YIHOS.js";import{a as f}from"./chunk-PPTZHIIZ.js";import"./chunk-DX4JI5WN.js";import{q as ee}from"./chunk-UBUWTJXF.js";import{Bb as T,Ca as D,Cb as V,Db as k,Eb as m,Fb as o,Gb as r,Gc as d,Hb as O,Hc as g,Ic as j,Mc as q,Oa as L,Od as Q,Qb as w,Rd as X,Tb as G,Td as Y,Va as l,Vb as u,Y as b,ab as M,ea as R,eb as U,ic as p,jb as B,jc as C,kb as F,kc as W,nc as P,oa as v,oc as I,pc as E,pd as z,qc as N,rd as J,sa as c,ta as _,wd as K,xb as y,yc as $,zb as h,zc as A}from"./chunk-45TUMJS2.js";import{a as x,b as S}from"./chunk-NF7PG5F2.js";var fe=()=>["/menu/Users/User/Groups/Info"],ye=i=>({ID:i});function he(i,s){if(i&1){let e=w();o(0,"div",9)(1,"h6"),p(2,"Group"),r(),o(3,"ng-select",10),E("ngModelChange",function(t){c(e);let a=u(2);return I(a.filter().GroupID,t)||(a.filter().GroupID=t),_(t)}),r(),o(4,"h6"),p(5,"Row Count"),r(),o(6,"input",11),E("ngModelChange",function(t){c(e);let a=u(2);return I(a.filter().RowCount,t)||(a.filter().RowCount=t),_(t)}),r()()}if(i&2){let e=u(2);l(3),m("items",e.options().Groups),P("ngModel",e.filter().GroupID),l(3),m("max",1e4),P("ngModel",e.filter().RowCount)}}function Ce(i,s){if(i&1&&(o(0,"a",12),p(1),r()),i&2){let e=u().$implicit;m("routerLink",$(3,fe))("queryParams",A(4,ye,e==null||e._source==null||e._source.Log==null?null:e._source.Log.id)),l(),C(e==null||e._source==null||e._source.Log==null?null:e._source.Log.name)}}function xe(i,s){if(i&1&&(o(0,"span"),p(1),r()),i&2){let e=u().$implicit;l(),C(e==null||e._source==null||e._source.Log==null?null:e._source.Log.name)}}function Se(i,s){if(i&1&&(o(0,"tr",7)(1,"td"),y(2,Ce,2,6,"a",12),y(3,xe,2,1,"span"),r(),o(4,"td"),p(5),d(6,"date"),r(),o(7,"td"),p(8),r(),O(9,"td",13),d(10,"newlines"),r()),i&2){let e=s.$implicit,n=u(2);l(2),h(n.role.users.Edit?2:-1),l(),h(n.role.users.Edit?-1:3),l(2),W(" ",j(6,5,e==null?null:e._source["@timestamp"],"dd MMM yyyy HH:mm")," "),l(3),C(e==null||e._source==null||e._source.Log==null?null:e._source.Log.creator),l(),m("innerHtml",g(10,8,e==null||e._source==null||e._source.Log==null?null:e._source.Log.note),L)}}function be(i,s){if(i&1){let e=w();o(0,"mainpanel-cmp",2),G("onSubmit",function(){c(e);let t=u();return _(t.initData())}),o(1,"filters"),F(2,he,7,4,"ng-template",null,0,q),r(),o(4,"content")(5,"div",3)(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr")(10,"th"),p(11,"Group"),r(),o(12,"th"),p(13,"Modified"),r(),o(14,"th"),p(15,"Modify By"),r(),o(16,"th"),p(17,"Note"),r()()(),o(18,"tbody"),V(19,Se,11,10,"tr",7,T),d(21,"async"),r()(),o(22,"div"),N(23),d(24,"async"),o(25,"mat-paginator",8),G("page",function(t){c(e);let a=u();return _(a.onPaginationChange(t))}),r()()()()()()}if(i&2){let e,n,t=u();m("pageData",t.menuData)("isFilterOnDropdown",!1)("hideSearchBox",!0),l(19),k((e=g(21,6,t.data$))==null||e.Data==null?null:e.Data.hits);let a=(n=g(24,8,t.data$))==null||n.Data==null||n.Data.hits==null?null:n.Data.hits.length;l(6),m("length",a)("pageSize",t.filter().RowCount)("pageIndex",t.filter().PageNumber==0?0:t.filter().PageNumber-1)}}var ge=class i extends se{constructor(e,n){super(e);this.role=n;this.menuData$.pipe(Z()).subscribe();let t=this.routeSnapshot.snapshot?.queryParams?.ID;f.IsNotEmpty(t)&&(this.filter.update(a=>S(x({},a),{GroupID:t})),this.initData())}role;httpService=v(ee);routeSnapshot=v(Q);filter=D({PageNumber:1,RowCount:20,GroupID:f.GuidEmpty});options=D({Groups:[]});loader$=this.httpService.get(H.GroupHistoryLoader).pipe(R(e=>{this.options.set(e.Options),this.initData()}),b(1));data$;initData(){let e=f.IsNotEmpty(this.filter().GroupID)?this.filter().GroupID:f.GuidEmpty;this.data$=this.httpService.get(H.GroupHistoryData,[{key:"PageNumber",value:this.filter().PageNumber},{key:"RowCount",value:this.filter().RowCount},{key:"GroupID",value:e}]).pipe(b(1))}onPaginationChange(e){this.filter.update(n=>S(x({},n),{PageNumber:e.pageIndex+1})),this.initData()}static \u0275fac=function(n){return new(n||i)(M(de),M(ae))};static \u0275cmp=U({type:i,selectors:[["app-group-update-history"]],features:[B],decls:3,vars:3,consts:[["pageFilterTemplate",""],["searchBoxPlaceholder","Search Note...",3,"pageData","isFilterOnDropdown","hideSearchBox"],["searchBoxPlaceholder","Search Note...",3,"onSubmit","pageData","isFilterOnDropdown","hideSearchBox"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"border-bottom"],[3,"page","length","pageSize","pageIndex"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose a group","appendTo","body",3,"ngModelChange","items","ngModel"],["type","text","autoNum","",1,"input-left","w-100","form-control","input-filter",3,"ngModelChange","max","ngModel"],[3,"routerLink","queryParams"],[3,"innerHtml"]],template:function(n,t){if(n&1&&(N(0),d(1,"async"),y(2,be,26,10,"mainpanel-cmp",1)),n&2){let a=g(1,1,t.loader$);l(2),h(a?2:-1)}},dependencies:[K,_e,ce,pe,le,Y,X,oe,te,ie,ne,me,ue,z,J,re],encapsulation:2})};export{ge as GroupUpdateHistoryComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as jt}from"./chunk-WHGJJOFG.js";import{a as Lt}from"./chunk-GBVP44ZE.js";import{d as Ut}from"./chunk-76ZFEU45.js";import"./chunk-46AS32Y6.js";import{b as Pt,c as bt,d as Mt}from"./chunk-LGROCUVB.js";import{a as Bt,b as Qt}from"./chunk-MEO3WOR2.js";import{b as At}from"./chunk-DFAROQV6.js";import"./chunk-QD7VJ23Y.js";import"./chunk-YUHIF5OG.js";import"./chunk-TEUPLXZW.js";import"./chunk-OAR3S27F.js";import{a as A}from"./chunk-O57CKHHE.js";import"./chunk-JZCIJXV2.js";import"./chunk-IMFQP5VB.js";import"./chunk-V7UKPPAB.js";import{b as Ft}from"./chunk-XVMDFG2U.js";import{a as wt}from"./chunk-P2CHARVW.js";import"./chunk-CE4YPYNH.js";import"./chunk-YY7HRA7W.js";import"./chunk-K2KEHU52.js";import"./chunk-64E2KYWA.js";import"./chunk-E6DX7K73.js";import{a as kt}from"./chunk-7ABYK3LM.js";import{g as Wt,h as Nt}from"./chunk-N4DLJR7D.js";import"./chunk-BFXGJLU4.js";import"./chunk-2RVNWUGY.js";import"./chunk-JGWGGE65.js";import{a as Rt}from"./chunk-MZU7CFUE.js";import"./chunk-ZBUXJSWD.js";import"./chunk-UBFC273L.js";import"./chunk-TXPPVLN7.js";import"./chunk-7O57X7B6.js";import"./chunk-BS7OOL5F.js";import"./chunk-TVSZWXKF.js";import"./chunk-DFCFXDXX.js";import"./chunk-4PPHUFDR.js";import"./chunk-CXNSSMWD.js";import"./chunk-B2PAUOAE.js";import"./chunk-FRIOAB7J.js";import"./chunk-6JWDLWMH.js";import"./chunk-TDPR34KX.js";import"./chunk-GDCWOLXR.js";import{a as Et}from"./chunk-63YUGNBG.js";import"./chunk-YBMKTLKP.js";import"./chunk-QAK7KBYZ.js";import"./chunk-LQFCNDOF.js";import"./chunk-ZK5X3QHG.js";import"./chunk-2QGJVMDP.js";import"./chunk-ZMJGUKRR.js";import{a as Dt,b as vt}from"./chunk-IWAI7MVS.js";import"./chunk-PPMQE2JW.js";import"./chunk-XAGPF2DG.js";import"./chunk-NQUAJAD5.js";import"./chunk-PNSDDSNF.js";import"./chunk-OKQYRKDJ.js";import"./chunk-6EWEOBCT.js";import{d as St,e as Vt}from"./chunk-YLJMYMN6.js";import"./chunk-BODLDM6S.js";import"./chunk-BGEZ7L55.js";import{a as Tt,c as It}from"./chunk-77MBEZAF.js";import"./chunk-AXL4BYTM.js";import"./chunk-7YB46QHZ.js";import"./chunk-NNCNCSRM.js";import"./chunk-APJZ7FTS.js";import"./chunk-HDB7WDVX.js";import{a as q}from"./chunk-QZBFXR5W.js";import"./chunk-URT4455F.js";import"./chunk-OAD4FS2F.js";import"./chunk-YQ4XRLUA.js";import{b as xt,c as Ot}from"./chunk-IZ6OEFHZ.js";import"./chunk-ZLF22NO2.js";import"./chunk-Y6W7XUTQ.js";import"./chunk-LKCUXC3X.js";import"./chunk-CNL7LBPM.js";import{F as U,G as ft,c as yt,h as W,p as N}from"./chunk-7OJUWRPB.js";import"./chunk-E47ESBEL.js";import"./chunk-U7C6WYAO.js";import{a as Ct}from"./chunk-QOCZG4DD.js";import{b as ht}from"./chunk-VF6YIHOS.js";import{a as k}from"./chunk-PPTZHIIZ.js";import"./chunk-V6BLMT7L.js";import{n as S,q as _t}from"./chunk-UBUWTJXF.js";import{Ca as V,D as G,Eb as d,Fb as o,Gb as r,Gc as T,Hb as w,Hc as R,Ic as H,Lb as Q,Mb as j,Mc as at,Nc as ot,Od as mt,Pc as rt,Qb as D,Rd as ut,Tb as y,Td as gt,Va as l,Vb as s,Yc as lt,aa as Y,ab as M,ea as J,eb as L,fc as $,ic as c,id as st,jb as X,jc as tt,kb as O,kc as x,lc as et,ld as pt,md as dt,nc as f,oa as v,oc as h,pc as C,sa as u,ta as g,td as ct,wd as E,xb as Z,yc as nt,zb as K,zc as it}from"./chunk-45TUMJS2.js";import{a as P,b}from"./chunk-NF7PG5F2.js";var B=class a{dialogRef=v(Tt);toastrService=v(S);modalConfig;selectedOutlets=[];constructor(){this.modalConfig=new xt,this.modalConfig.title="Update ROP",this.modalConfig.customWidth="350px"}onOk(){if(this.selectedOutlets.length===0){this.toastrService.warning("Please select at least one outlet","Warning");return}this.dialogRef.close(this.selectedOutlets)}onClose(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=L({type:a,selectors:[["app-modal-update-rop"]],decls:6,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container"],[1,"row"],[1,"col-12"],[3,"ngModelChange","ngModel","multiple"]],template:function(t,e){t&1&&(o(0,"modal-material",0),y("onOk",function(){return e.onOk()})("onCancel",function(){return e.onClose()})("onClose",function(){return e.onClose()}),o(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"outlet-selector",4),C("ngModelChange",function(i){return h(e.selectedOutlets,i)||(e.selectedOutlets=i),i}),r()()()()()()),t&2&&(d("config",e.modalConfig),l(5),f("ngModel",e.selectedOutlets),d("multiple",!0))},dependencies:[E,Ot,A,U,W,N],encapsulation:2})};var z=(i=>(i[i.negative=0]="negative",i[i.empty=1]="empty",i[i.critical=2]="critical",i[i.optimal=3]="optimal",i[i.overstock=4]="overstock",i))(z||{});var Jt=()=>[],Xt=a=>({ID:a});function Zt(a,m){if(a&1){let t=D();o(0,"button",7),y("click",function(){u(t);let n=s();return g(n.openExportModal())}),w(1,"i",8),c(2," Export "),r()}}function Kt(a,m){if(a&1){let t=D();o(0,"button",9),y("click",function(){u(t);let n=s();return g(n.onSubmitROP())}),w(1,"i",10),c(2," Save ROP "),r()}if(a&2){let t=s();d("matTooltip","Save ROP to Outlet "+t.outletSelected)}}function $t(a,m){if(a&1){let t=D();o(0,"div",11)(1,"div",12)(2,"h6"),c(3,"Show Inventory & Sales for Outlet"),r(),o(4,"outlet-selector",13),C("ngModelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.ListIDs,n)||(i.pageData().Filter.ListIDs=n),g(n)}),r()(),o(5,"div",12)(6,"h6"),c(7,"Category"),r(),o(8,"POS-product-category-select",14),C("selectedCategoryIDChange",function(n){u(t);let i=s();return h(i.pageData().Filter.CategoryID,n)||(i.pageData().Filter.CategoryID=n),g(n)}),r()(),o(9,"div",12)(10,"h6"),c(11," Product Sold Within Days "),w(12,"i",15),r(),o(13,"input",16),C("ngModelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.NumberOfDays,n)||(i.pageData().Filter.NumberOfDays=n),g(n)}),r()(),o(14,"div",12)(15,"h6"),c(16,"Days Of Risk"),r(),o(17,"ng-select",17),C("ngModelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.DaysOfRisk,n)||(i.pageData().Filter.DaysOfRisk=n),g(n)}),r()(),o(18,"div",18)(19,"h6"),c(20,"Inventory Threshold"),r(),o(21,"div",19)(22,"div",20)(23,"input",21),C("ngModelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.CriticalDaysThreshold,n)||(i.pageData().Filter.CriticalDaysThreshold=n),g(n)}),y("ngModelChange",function(n){u(t);let i=s();return g(i.onCriticalChange(n))}),r(),o(24,"div",22)(25,"div",23),w(26,"div",24)(27,"div",25)(28,"div",26),r(),o(29,"div",27)(30,"span"),c(31),r(),o(32,"span"),c(33),r(),o(34,"span"),c(35),r()()(),o(36,"input",28),C("ngModelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.OverstockDaysThreshold,n)||(i.pageData().Filter.OverstockDaysThreshold=n),g(n)}),y("ngModelChange",function(n){u(t);let i=s();return g(i.onOverstockChange(n))}),r()()()(),o(37,"div",12)(38,"h6"),c(39,"Set ROP for Outlet"),r(),o(40,"outlet-selector",29),C("ngModelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.TargetOutlet,n)||(i.pageData().Filter.TargetOutlet=n),g(n)}),y("onListOutlets",function(n){u(t);let i=s();return g(i.getOutlets(n))}),r()(),o(41,"div",12)(42,"h6"),c(43,"Count Indirect Allocated"),r(),o(44,"radio-options",30),C("modelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.CalculateIndirectAllocated,n)||(i.pageData().Filter.CalculateIndirectAllocated=n),g(n)}),r()()()}if(a&2){let t,e=s();l(4),d("multiple",!0)("accessType",2),f("ngModel",e.pageData().Filter.ListIDs),l(4),f("selectedCategoryID",e.pageData().Filter.CategoryID),d("showClear",!0),l(5),f("ngModel",e.pageData().Filter.NumberOfDays),l(4),d("items",((t=e.pageData().Options)==null?null:t.DaysOfRisks)||nt(19,Jt))("clearable",!0),f("ngModel",e.pageData().Filter.DaysOfRisk),l(6),f("ngModel",e.pageData().Filter.CriticalDaysThreshold),l(8),x("\u2264",e.pageData().Filter.CriticalDaysThreshold," Days"),l(2),et("",e.pageData().Filter.CriticalDaysThreshold+1,"-",e.pageData().Filter.OverstockDaysThreshold," Days"),l(2),x(">",e.pageData().Filter.OverstockDaysThreshold," Days"),l(),f("ngModel",e.pageData().Filter.OverstockDaysThreshold),l(4),d("multiple",!1)("accessType",2),f("ngModel",e.pageData().Filter.TargetOutlet),l(4),f("model",e.pageData().Filter.CalculateIndirectAllocated)}}function te(a,m){a&1&&(o(0,"th",46),c(1," LT "),r())}function ee(a,m){if(a&1&&(o(0,"th",47),c(1," ROP "),r()),a&2){let t=s(2);d("matTooltip","Based on "+t.outletSelected+" ROP")}}function ne(a,m){if(a&1){let t=D();o(0,"td",49)(1,"input",50),C("ngModelChange",function(n){u(t);let i=s().$implicit;return h(i.LeadTime,n)||(i.LeadTime=n),g(n)}),y("ngModelChange",function(n){u(t);let i=s().$implicit,p=s(2);return g(p.onInputLeadTime(n,i))}),r()()}if(a&2){let t=s(),e=t.$implicit,n=t.index;l(),d("name","LeadTime"+n),f("ngModel",e.LeadTime),d("id","leadTime"+n)}}function ie(a,m){if(a&1){let t=D();o(0,"div",52)(1,"div",53)(2,"span",54),c(3),T(4,"number"),r(),w(5,"i",55),o(6,"div",56)(7,"input",57),T(8,"quantityFraction"),y("ngModelChange",function(n){u(t);let i=s(2).$implicit,p=s(2);return g(p.onInputROP(n,i))}),r()()()()}if(a&2){let t=s(2),e=t.$implicit,n=t.index,i=s(2);l(3),x(" ",R(4,5,i.getOriginalROP(e))," "),l(4),d("decimalPlaces",i.ropDecimalPlaces)("name","ROP"+n)("ngModel",R(8,7,e.ROP))("id","ROP"+n)}}function ae(a,m){if(a&1&&(o(0,"span",49),c(1),T(2,"number"),r()),a&2){let t=s(2).$implicit;l(),x(" ",R(2,1,t.ROP)," ")}}function oe(a,m){if(a&1&&(o(0,"td",49),O(1,ie,9,9,"div",51)(2,ae,3,3,"span",44),r()),a&2){let t=s().$implicit;l(),d("ngIf",t.LeadTime),l(),d("ngIf",!t.LeadTime)}}function re(a,m){if(a&1&&(o(0,"tr")(1,"td")(2,"a",48),c(3),r()(),o(4,"td"),c(5),r(),o(6,"td",49),c(7),T(8,"quantityFraction"),r(),o(9,"td",49),c(10),T(11,"number"),r(),o(12,"td",49),c(13),T(14,"number"),r(),o(15,"td",49)(16,"div"),c(17),r()(),O(18,ne,2,3,"td",44)(19,oe,3,2,"td",44),r()),a&2){let t=m.$implicit,e=s(2);l(2),d("queryParams",it(27,Xt,t.ID)),l(),x(" ",t.Name," "),l(2),tt(t.Code),l(2),x(" ",R(8,19,t.Available)," "),l(3),x(" ",H(11,21,t.QtySoldPerDay,"1.0-2")," "),l(3),x(" ",t.QtySoldPerDay<0?"-":H(14,24,t.DaysOf,"1.0-0")," "),l(3),$("text-negative",t.DaysOfRiskType===e.riskType.negative)("text-empty",t.DaysOfRiskType===e.riskType.empty)("text-critical",t.DaysOfRiskType===e.riskType.critical)("text-optimal",t.DaysOfRiskType===e.riskType.optimal)("text-overstock",t.DaysOfRiskType===e.riskType.overstock),l(),x(" ",t.DaysOfRisk," "),l(),d("ngIf",e.pageData().Filter.TargetOutlet),l(),d("ngIf",e.pageData().Filter.TargetOutlet)}}function le(a,m){a&1&&(o(0,"td",49)(1,"span"),c(2,"Bulk Lead Time "),r()())}function se(a,m){if(a&1){let t=D();o(0,"td")(1,"input",58),y("ngModelChange",function(n){u(t);let i=s(2);return g(i.onBulkUpdateLT(n))}),r()()}if(a&2){let t=s(2);l(),d("ngModel",t.bulkUpdateLTValue())("id","LT")}}function pe(a,m){if(a&1){let t=D();o(0,"div",31)(1,"div",32)(2,"table",33),y("matSortChange",function(n){u(t);let i=s();return g(i.sortData(n))}),o(3,"thead",34)(4,"tr")(5,"th",35),c(6,"Product"),r(),o(7,"th",36),c(8,"Code"),r(),o(9,"th",37),c(10," Available "),r(),o(11,"th",38),c(12," SOLD/DAY "),r(),o(13,"th",39),c(14," Days Of "),r(),o(15,"th",40),c(16," Risk "),r(),O(17,te,2,0,"th",41)(18,ee,2,1,"th",42),r()(),o(19,"tbody"),O(20,re,20,29,"tr",43),r(),o(21,"tfoot")(22,"tr"),w(23,"td")(24,"td")(25,"td")(26,"td")(27,"td"),O(28,le,3,0,"td",44),Z(29,se,2,2,"td"),r()()()(),o(30,"div")(31,"POS-complex-pagination",45),y("jumpToPage",function(){u(t);let n=s();return g(n.getListData())})("previousPage",function(){u(t);let n=s();return g(n.getListData())})("nextPage",function(){u(t);let n=s();return g(n.getListData())}),C("reloadRowCountChange",function(n){u(t);let i=s();return h(i.reloadRowCount,n)||(i.reloadRowCount=n),g(n)}),r()()()}if(a&2){let t,e=s();l(11),d("matTooltip","Based on Last "+e.pageData().Filter.NumberOfDays+" Days Sold"),l(6),d("ngIf",e.pageData().Filter.TargetOutlet),l(),d("ngIf",e.pageData().Filter.TargetOutlet),l(2),d("ngForOf",e.data().Data),l(8),d("ngIf",e.pageData().Filter.TargetOutlet&&e.data().Data.length>0),l(),K(e.pageData().Filter.TargetOutlet&&e.data().Data.length>0?29:-1),l(2),d("total",e.data().Data.length)("totalAllData",(t=e.data())==null?null:t.ListTotal)("pageData",e.pageData()),f("reloadRowCount",e.reloadRowCount)}}var Ht=class a extends wt{constructor(t,e,n,i,p,_){super(t,e,"Inventory/DayOf","InventoryLoader/DaysOf",void 0,_,!0);this.httpService=e;this.csvConverter=i;this.roleService=p}httpService;csvConverter;roleService;dialog=v(It);fractionData=v(Ct);locale=v(ot);riskType=z;get ropDecimalPlaces(){return this.fractionData.quantity.maximumFraction}formatQuantityFraction(t){let e=`1.${this.fractionData.quantity.minimumFraction}-${this.fractionData.quantity.maximumFraction}`;return st(t,this.locale,e)}ListUpdateROP=V([]);listOutlet=V([]);bulkUpdateLTValue=lt("");toastr=v(S);originalROPValues=V(new Map);rawROPValues=V([]);subTotalROP=rt(()=>this.ListUpdateROP()?this.ListUpdateROP().reduce((t,e)=>t+Number(e.Value),0).toFixed(3):0);postInit(t){this.rawROPValues.set(t.Data),this.ListUpdateROP.set([]),this.originalROPValues.set(new Map)}preInitList(){this.menuData().H="Days of Inventory"}onInputLeadTime(t,e){if(k.IsEmpty(t)||t===0){this.rawROPValues().find(F=>F.ID===e.ID)&&(e.LeadTime="",e.ROP=this.getOriginalROP(e)),this.data.set(b(P({},this.data()),{Data:[...this.data().Data]}));return}let n=this.originalROPValues();n.has(e.ID)||(n.set(e.ID,e.ROP),this.originalROPValues.set(new Map(n)));let i=this.fractionData.quantity.maximumFraction,p=t*e.QtySoldPerDay;e.ROP=parseFloat(p.toFixed(i)),this.ListUpdateROP.update(_=>[..._.filter(qt=>qt.Key!==e.ID),{Key:e.ID,Value:this.formatQuantityFraction(e.ROP)}])}onInputROP(t,e){if(t){let n=this.fractionData.quantity.maximumFraction,i=parseFloat(t.toFixed(n));e.ROP=i,this.ListUpdateROP.update(p=>[...p.filter(F=>F.Key!==e.ID),{Key:e.ID,Value:this.formatQuantityFraction(i)}])}}getOriginalROP(t){return this.originalROPValues().get(t.ID)||t.ROP}get outletSelected(){if(this.listOutlet().length>0&&this.pageData().Filter.TargetOutlet){let t=this.listOutlet().findIndex(e=>e.k===this.pageData().Filter.TargetOutlet);if(t!==-1)return this.listOutlet()[t].v}return""}getOutlets(t){console.log(t),this.listOutlet.set(t)}onSubmitROP(){let t={ListUpdateROP:[...this.ListUpdateROP()],EntityID:this.pageData().Filter.TargetOutlet};this.httpService.post(q.UpdateROP,t).pipe(jt("response"),J(e=>{this.toastr.success("ROP has been updated successfully.","Success!"),this.originalROPValues.set(new Map),this.getListData(),this.ListUpdateROP.set([]),this.bulkUpdateLTValue.set("")})).subscribe()}resetOriginalROP(t){let e=this.originalROPValues();e.has(t.ID)&&(e.delete(t.ID),this.originalROPValues.set(new Map(e)))}updateRop(t,e){this.dialog.open(B).afterClosed().pipe(G(n=>k.IsNotEmpty(n)),Y(n=>{let i={VariantID:t.ID,ListEntityID:n,ROP:t.ROP};return this.httpService.post(q.UpdateROP,i)})).subscribe(()=>{this.clearInput(`leadTime${e}`),this.toastr.success("ROP has been updated successfully.","Success!"),this.getListData()})}clearInput(t){let e=document.getElementById(t);e&&(e.value="")}openExportModal(){this.dialog.open(Ft,{data:{title:"Days of Inventory",exportTypes:[{ID:"InventoryExport/GetDaysOfExport",Value:"Default",FileName:"Days of Inventory"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"Inventory/DayOfCount",pagination:!0}})}sortData(t){let e=[...this.data().Data];if(!t.active||t.direction===""){this.data.set(b(P({},this.data()),{Data:[...e]}));return}let n=e.sort((i,p)=>{let _=t.direction==="asc";switch(t.active){case"Name":return I(i.Name,p.Name,_);case"Code":return I(i.Code,p.Code,_);case"QtySold":return I(i.QtySold,p.QtySold,_);case"QtySoldPerDay":return I(i.QtySoldPerDay,p.QtySoldPerDay,_);case"OnHand":return I(i.OnHand,p.OnHand,_);case"Available":return I(i.Available,p.Available,_);case"DaysOf":return I(i.DaysOf,p.DaysOf,_);default:return 0}});this.data.set(b(P({},this.data()),{Data:[...n]}))}onBulkUpdateLT(t){let e=this.originalROPValues(),n=this.rawROPValues();if(k.IsEmpty(t)){this.bulkUpdateLTValue.set(""),this.data.set(b(P({},this.data()),{Data:n.map(p=>b(P({},p),{LeadTime:null}))}));return}let i=+t;if(this.bulkUpdateLTValue.set(i),!!this.data()?.Data){for(let p of this.data().Data)e.has(p.ID)||e.set(p.ID,p.ROP),p.LeadTime=i,p.ROP=i*(p.QtySoldPerDay||0);this.originalROPValues.set(new Map(e)),this.ListUpdateROP.set(this.data().Data.map(p=>({Key:p.ID,Value:this.formatQuantityFraction(p.ROP)}))),this.data.set(b(P({},this.data()),{Data:[...this.data().Data]}))}}onCriticalChange(t){let e=this.pageData().Filter.ExceedDaysThreshold;t>=e&&(this.pageData().Filter.ExceedDaysThreshold=t+1)}onOverstockChange(t){let e=this.pageData().Filter.CriticalDaysThreshold;t<=e&&(this.pageData().Filter.ExceedDaysThreshold=e+1)}static \u0275fac=function(e){return new(e||a)(M(Et),M(_t),M(S),M(kt),M(ht),M(mt))};static \u0275cmp=L({type:a,selectors:[["app-days-of-inventory"]],inputs:{bulkUpdateLTValue:[1,"bulkUpdateLTValue"]},outputs:{bulkUpdateLTValue:"bulkUpdateLTValueChange"},features:[X],decls:9,vars:6,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"onSubmit","textChange","pageData","text","isFilterOnDropdown"],["ngProjectAs","actions",5,["actions"]],["class","btn btn-outline-secondary me-2",3,"click",4,"ngIf"],["class","btn btn-outline-secondary","role","button",3,"matTooltip","click",4,"ngIf"],["ngProjectAs","filters",5,["filters"]],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-2",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["role","button",1,"btn","btn-outline-secondary",3,"click","matTooltip"],[1,"fa-solid","fa-save","me-3"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],["placeholder","Choose Outlets",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["matTooltip","Number of past days used to calculate average daily sales for inventory planning","matTooltipPosition","above",1,"fa-light","fa-circle-info",2,"cursor","pointer"],["autoNum","","min","1",1,"form-control",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","All",1,"ng-select",3,"ngModelChange","items","clearable","ngModel"],[1,"filter-item","full"],[1,"threshold-compact-wrapper"],[1,"threshold-row"],["type","text","autoNum","","min","1",1,"threshold-input-mini","input-critical",3,"ngModelChange","ngModel"],[1,"threshold-bar-container"],[1,"threshold-bar"],["matTooltip","Critical","matTooltipPosition","above",1,"bar-segment","seg-critical"],["matTooltip","Optimal","matTooltipPosition","above",1,"bar-segment","seg-optimal"],["matTooltip","Overstock","matTooltipPosition","above",1,"bar-segment","seg-overstock"],[1,"threshold-bar-labels"],["type","text","autoNum","","min","1",1,"threshold-input-mini","input-overstock",3,"ngModelChange","ngModel"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","onListOutlets","multiple","accessType","ngModel"],["name","IndirectAllocated",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table","custom-table","mt-5",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","Code",2,"width","125px"],["mat-sort-header","Available","matTooltip","Inventory available for sale","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","QtySoldPerDay","arrowPosition","before",1,"text-end",2,"width","100px",3,"matTooltip"],["mat-sort-header","DaysOf","arrowPosition","before","matTooltip","How many days left until you run out of inventory",1,"text-end",2,"width","100px"],["mat-sort-header","DaysOfRisk","arrowPosition","before",1,"text-end",2,"width","120px"],["style","width: 80px","matTooltip","The LEAD TIME (in days) it takes to receive the inventory after placing an order","class","text-end",4,"ngIf"],["class","text-end","style","width: 120px",3,"matTooltip",4,"ngIf"],[4,"ngFor","ngForOf"],["class","text-end",4,"ngIf"],["api","Inventory/DayOfCount",3,"jumpToPage","previousPage","nextPage","reloadRowCountChange","total","totalAllData","pageData","reloadRowCount"],["matTooltip","The LEAD TIME (in days) it takes to receive the inventory after placing an order",1,"text-end",2,"width","80px"],[1,"text-end",2,"width","120px",3,"matTooltip"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"text-end"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","name","ngModel","id"],["class","rop-comparison",4,"ngIf"],[1,"rop-comparison"],[1,"d-flex","align-items-center","justify-content-end","gap-2"],[1,"old-value"],[1,"fa-solid","fa-arrow-right","text-muted"],[1,"input-group","input-group-sm",2,"width","70px"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","decimalPlaces","name","ngModel","id"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","ngModel","id"]],template:function(e,n){if(e&1){let i=D();o(0,"mainpanel-cmp",1),y("onSubmit",function(){return n.getListData()}),C("textChange",function(_){return u(i),h(n.pageData().Filter.FilterText,_)||(n.pageData().Filter.FilterText=_),g(_)}),Q(1,2),O(2,Zt,3,0,"button",3)(3,Kt,3,1,"button",4),j(),Q(4,5),O(5,$t,45,20,"ng-template",null,0,at),j(),o(7,"content"),O(8,pe,32,10,"div",6),r()()}e&2&&(d("pageData",n.menuData()),f("text",n.pageData().Filter.FilterText),d("isFilterOnDropdown",!1),l(2),d("ngIf",n.roleService.global.Export),l(),d("ngIf",n.ListUpdateROP().length>0),l(5),d("ngIf",n.data()))},dependencies:[E,pt,dt,Nt,Wt,Rt,U,yt,W,N,A,gt,ut,Qt,Bt,At,vt,Dt,ft,Mt,Pt,bt,Ut,Vt,St,ct,Lt],styles:[".threshold-compact-wrapper[_ngcontent-%COMP%]{background:#f8f9fa;border-radius:8px;padding:.6rem .75rem;border:1px solid #e9ecef}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem;width:100%}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini[_ngcontent-%COMP%]{width:48px;min-width:48px;max-width:48px;text-align:center;font-size:.75rem;font-weight:600;border-radius:6px;border:1.5px solid #e5e7eb;padding:.3rem .15rem;background:#fff;color:#374151;flex-shrink:0;transition:all .15s ease}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini[_ngcontent-%COMP%]:focus{outline:none}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-critical[_ngcontent-%COMP%]{border-color:#f5f0a6}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-critical[_ngcontent-%COMP%]:focus{border-color:#fff44f;box-shadow:0 0 0 2px #fff44f1f}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-overstock[_ngcontent-%COMP%]{border-color:#96b0f7}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-overstock[_ngcontent-%COMP%]:focus{border-color:#3581d8;box-shadow:0 0 0 2px #3581d81f}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-container[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem;min-width:0}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%]{display:flex;height:10px;border-radius:5px;overflow:hidden;box-shadow:inset 0 1px 2px #00000014}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment[_ngcontent-%COMP%]{flex:1;transition:background .3s ease;cursor:pointer}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-critical[_ngcontent-%COMP%]{background:#fff44f}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-critical[_ngcontent-%COMP%]:hover{background:#f7e817}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-optimal[_ngcontent-%COMP%]{background:#28cc2d}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-optimal[_ngcontent-%COMP%]:hover{background:#388e3c}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-overstock[_ngcontent-%COMP%]{background:#3581d8}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-overstock[_ngcontent-%COMP%]:hover{background:#2c58af}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%]{display:flex;justify-content:space-between;font-size:.55rem;font-weight:500;color:#9ca3af;padding:0 2px}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){color:#a39800}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){color:#28cc2d}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){color:#3581d8}.text-negative[_ngcontent-%COMP%]{color:#a61b29}.text-empty[_ngcontent-%COMP%]{color:#d82e3f}.text-critical[_ngcontent-%COMP%]{color:#e8c73a}.text-optimal[_ngcontent-%COMP%]{color:#28cc2d}.text-overstock[_ngcontent-%COMP%]{color:#3581d8}"],changeDetection:0})};function I(a,m,t){return a===null||a===""?t?-1:1:m===null||m===""?t?1:-1:typeof a=="string"&&typeof m=="string"?a.localeCompare(m)*(t?1:-1):typeof a=="number"&&typeof m=="number"?(a<m?-1:1)*(t?1:-1):typeof a=="string"&&typeof m=="number"?t?-1:1:typeof a=="number"&&typeof m=="string"?t?1:-1:0}export{Ht as DaysOfInventoryComponent};
|
|
1
|
+
import{a as jt}from"./chunk-WHGJJOFG.js";import{a as Lt}from"./chunk-GBVP44ZE.js";import{d as Ut}from"./chunk-76ZFEU45.js";import"./chunk-46AS32Y6.js";import{b as Pt,c as bt,d as Mt}from"./chunk-LGROCUVB.js";import{a as Bt,b as Qt}from"./chunk-MEO3WOR2.js";import{b as At}from"./chunk-OZPBFUUW.js";import"./chunk-QD7VJ23Y.js";import"./chunk-YUHIF5OG.js";import"./chunk-TEUPLXZW.js";import"./chunk-OAR3S27F.js";import{a as A}from"./chunk-G3VJKQYH.js";import"./chunk-JZCIJXV2.js";import"./chunk-IMFQP5VB.js";import"./chunk-V7UKPPAB.js";import{b as Ft}from"./chunk-XVMDFG2U.js";import{a as wt}from"./chunk-L5FFXZXC.js";import"./chunk-CE4YPYNH.js";import"./chunk-66SAF7DA.js";import"./chunk-D72YXHRG.js";import"./chunk-64E2KYWA.js";import"./chunk-E6DX7K73.js";import{a as kt}from"./chunk-7ABYK3LM.js";import{g as Wt,h as Nt}from"./chunk-5RNCX5GO.js";import"./chunk-BFXGJLU4.js";import"./chunk-2RVNWUGY.js";import"./chunk-JGWGGE65.js";import{a as Rt}from"./chunk-MZU7CFUE.js";import"./chunk-ZBUXJSWD.js";import"./chunk-UBFC273L.js";import"./chunk-TXPPVLN7.js";import"./chunk-7O57X7B6.js";import"./chunk-BS7OOL5F.js";import"./chunk-TVSZWXKF.js";import"./chunk-DFCFXDXX.js";import"./chunk-4PPHUFDR.js";import"./chunk-CXNSSMWD.js";import"./chunk-B2PAUOAE.js";import"./chunk-FRIOAB7J.js";import"./chunk-6JWDLWMH.js";import"./chunk-TDPR34KX.js";import"./chunk-OU53L22U.js";import{a as Et}from"./chunk-3TR7ZYJV.js";import"./chunk-YBMKTLKP.js";import"./chunk-QAK7KBYZ.js";import"./chunk-MMWQPUOB.js";import"./chunk-ZK5X3QHG.js";import"./chunk-2QGJVMDP.js";import"./chunk-ZMJGUKRR.js";import{a as Dt,b as vt}from"./chunk-IWAI7MVS.js";import"./chunk-PPMQE2JW.js";import"./chunk-XAGPF2DG.js";import"./chunk-NQUAJAD5.js";import"./chunk-NOX5OWAB.js";import"./chunk-OKQYRKDJ.js";import"./chunk-VTIO4KGR.js";import{d as St,e as Vt}from"./chunk-YLJMYMN6.js";import"./chunk-BODLDM6S.js";import"./chunk-DASHPQJH.js";import{a as Tt,c as It}from"./chunk-77MBEZAF.js";import"./chunk-AXL4BYTM.js";import"./chunk-7YB46QHZ.js";import"./chunk-NNCNCSRM.js";import"./chunk-APJZ7FTS.js";import"./chunk-HDB7WDVX.js";import{a as q}from"./chunk-ICRIBA3P.js";import"./chunk-URT4455F.js";import"./chunk-OAD4FS2F.js";import"./chunk-YQ4XRLUA.js";import{b as xt,c as Ot}from"./chunk-IZ6OEFHZ.js";import"./chunk-ZLF22NO2.js";import"./chunk-Y6W7XUTQ.js";import"./chunk-LKCUXC3X.js";import"./chunk-CNL7LBPM.js";import{F as U,G as ft,c as yt,h as W,p as N}from"./chunk-7OJUWRPB.js";import"./chunk-KI5F5CW2.js";import"./chunk-FBI4U5NT.js";import{a as Ct}from"./chunk-QOCZG4DD.js";import{b as ht}from"./chunk-VF6YIHOS.js";import{a as k}from"./chunk-PPTZHIIZ.js";import"./chunk-DX4JI5WN.js";import{n as S,q as _t}from"./chunk-UBUWTJXF.js";import{Ca as V,D as G,Eb as d,Fb as o,Gb as r,Gc as T,Hb as w,Hc as R,Ic as H,Lb as Q,Mb as j,Mc as at,Nc as ot,Od as mt,Pc as rt,Qb as D,Rd as ut,Tb as y,Td as gt,Va as l,Vb as s,Yc as lt,aa as Y,ab as M,ea as J,eb as L,fc as $,ic as c,id as st,jb as X,jc as tt,kb as O,kc as x,lc as et,ld as pt,md as dt,nc as f,oa as v,oc as h,pc as C,sa as u,ta as g,td as ct,wd as E,xb as Z,yc as nt,zb as K,zc as it}from"./chunk-45TUMJS2.js";import{a as P,b}from"./chunk-NF7PG5F2.js";var B=class a{dialogRef=v(Tt);toastrService=v(S);modalConfig;selectedOutlets=[];constructor(){this.modalConfig=new xt,this.modalConfig.title="Update ROP",this.modalConfig.customWidth="350px"}onOk(){if(this.selectedOutlets.length===0){this.toastrService.warning("Please select at least one outlet","Warning");return}this.dialogRef.close(this.selectedOutlets)}onClose(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||a)};static \u0275cmp=L({type:a,selectors:[["app-modal-update-rop"]],decls:6,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container"],[1,"row"],[1,"col-12"],[3,"ngModelChange","ngModel","multiple"]],template:function(t,e){t&1&&(o(0,"modal-material",0),y("onOk",function(){return e.onOk()})("onCancel",function(){return e.onClose()})("onClose",function(){return e.onClose()}),o(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"outlet-selector",4),C("ngModelChange",function(i){return h(e.selectedOutlets,i)||(e.selectedOutlets=i),i}),r()()()()()()),t&2&&(d("config",e.modalConfig),l(5),f("ngModel",e.selectedOutlets),d("multiple",!0))},dependencies:[E,Ot,A,U,W,N],encapsulation:2})};var z=(i=>(i[i.negative=0]="negative",i[i.empty=1]="empty",i[i.critical=2]="critical",i[i.optimal=3]="optimal",i[i.overstock=4]="overstock",i))(z||{});var Jt=()=>[],Xt=a=>({ID:a});function Zt(a,m){if(a&1){let t=D();o(0,"button",7),y("click",function(){u(t);let n=s();return g(n.openExportModal())}),w(1,"i",8),c(2," Export "),r()}}function Kt(a,m){if(a&1){let t=D();o(0,"button",9),y("click",function(){u(t);let n=s();return g(n.onSubmitROP())}),w(1,"i",10),c(2," Save ROP "),r()}if(a&2){let t=s();d("matTooltip","Save ROP to Outlet "+t.outletSelected)}}function $t(a,m){if(a&1){let t=D();o(0,"div",11)(1,"div",12)(2,"h6"),c(3,"Show Inventory & Sales for Outlet"),r(),o(4,"outlet-selector",13),C("ngModelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.ListIDs,n)||(i.pageData().Filter.ListIDs=n),g(n)}),r()(),o(5,"div",12)(6,"h6"),c(7,"Category"),r(),o(8,"POS-product-category-select",14),C("selectedCategoryIDChange",function(n){u(t);let i=s();return h(i.pageData().Filter.CategoryID,n)||(i.pageData().Filter.CategoryID=n),g(n)}),r()(),o(9,"div",12)(10,"h6"),c(11," Product Sold Within Days "),w(12,"i",15),r(),o(13,"input",16),C("ngModelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.NumberOfDays,n)||(i.pageData().Filter.NumberOfDays=n),g(n)}),r()(),o(14,"div",12)(15,"h6"),c(16,"Days Of Risk"),r(),o(17,"ng-select",17),C("ngModelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.DaysOfRisk,n)||(i.pageData().Filter.DaysOfRisk=n),g(n)}),r()(),o(18,"div",18)(19,"h6"),c(20,"Inventory Threshold"),r(),o(21,"div",19)(22,"div",20)(23,"input",21),C("ngModelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.CriticalDaysThreshold,n)||(i.pageData().Filter.CriticalDaysThreshold=n),g(n)}),y("ngModelChange",function(n){u(t);let i=s();return g(i.onCriticalChange(n))}),r(),o(24,"div",22)(25,"div",23),w(26,"div",24)(27,"div",25)(28,"div",26),r(),o(29,"div",27)(30,"span"),c(31),r(),o(32,"span"),c(33),r(),o(34,"span"),c(35),r()()(),o(36,"input",28),C("ngModelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.OverstockDaysThreshold,n)||(i.pageData().Filter.OverstockDaysThreshold=n),g(n)}),y("ngModelChange",function(n){u(t);let i=s();return g(i.onOverstockChange(n))}),r()()()(),o(37,"div",12)(38,"h6"),c(39,"Set ROP for Outlet"),r(),o(40,"outlet-selector",29),C("ngModelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.TargetOutlet,n)||(i.pageData().Filter.TargetOutlet=n),g(n)}),y("onListOutlets",function(n){u(t);let i=s();return g(i.getOutlets(n))}),r()(),o(41,"div",12)(42,"h6"),c(43,"Count Indirect Allocated"),r(),o(44,"radio-options",30),C("modelChange",function(n){u(t);let i=s();return h(i.pageData().Filter.CalculateIndirectAllocated,n)||(i.pageData().Filter.CalculateIndirectAllocated=n),g(n)}),r()()()}if(a&2){let t,e=s();l(4),d("multiple",!0)("accessType",2),f("ngModel",e.pageData().Filter.ListIDs),l(4),f("selectedCategoryID",e.pageData().Filter.CategoryID),d("showClear",!0),l(5),f("ngModel",e.pageData().Filter.NumberOfDays),l(4),d("items",((t=e.pageData().Options)==null?null:t.DaysOfRisks)||nt(19,Jt))("clearable",!0),f("ngModel",e.pageData().Filter.DaysOfRisk),l(6),f("ngModel",e.pageData().Filter.CriticalDaysThreshold),l(8),x("\u2264",e.pageData().Filter.CriticalDaysThreshold," Days"),l(2),et("",e.pageData().Filter.CriticalDaysThreshold+1,"-",e.pageData().Filter.OverstockDaysThreshold," Days"),l(2),x(">",e.pageData().Filter.OverstockDaysThreshold," Days"),l(),f("ngModel",e.pageData().Filter.OverstockDaysThreshold),l(4),d("multiple",!1)("accessType",2),f("ngModel",e.pageData().Filter.TargetOutlet),l(4),f("model",e.pageData().Filter.CalculateIndirectAllocated)}}function te(a,m){a&1&&(o(0,"th",46),c(1," LT "),r())}function ee(a,m){if(a&1&&(o(0,"th",47),c(1," ROP "),r()),a&2){let t=s(2);d("matTooltip","Based on "+t.outletSelected+" ROP")}}function ne(a,m){if(a&1){let t=D();o(0,"td",49)(1,"input",50),C("ngModelChange",function(n){u(t);let i=s().$implicit;return h(i.LeadTime,n)||(i.LeadTime=n),g(n)}),y("ngModelChange",function(n){u(t);let i=s().$implicit,p=s(2);return g(p.onInputLeadTime(n,i))}),r()()}if(a&2){let t=s(),e=t.$implicit,n=t.index;l(),d("name","LeadTime"+n),f("ngModel",e.LeadTime),d("id","leadTime"+n)}}function ie(a,m){if(a&1){let t=D();o(0,"div",52)(1,"div",53)(2,"span",54),c(3),T(4,"number"),r(),w(5,"i",55),o(6,"div",56)(7,"input",57),T(8,"quantityFraction"),y("ngModelChange",function(n){u(t);let i=s(2).$implicit,p=s(2);return g(p.onInputROP(n,i))}),r()()()()}if(a&2){let t=s(2),e=t.$implicit,n=t.index,i=s(2);l(3),x(" ",R(4,5,i.getOriginalROP(e))," "),l(4),d("decimalPlaces",i.ropDecimalPlaces)("name","ROP"+n)("ngModel",R(8,7,e.ROP))("id","ROP"+n)}}function ae(a,m){if(a&1&&(o(0,"span",49),c(1),T(2,"number"),r()),a&2){let t=s(2).$implicit;l(),x(" ",R(2,1,t.ROP)," ")}}function oe(a,m){if(a&1&&(o(0,"td",49),O(1,ie,9,9,"div",51)(2,ae,3,3,"span",44),r()),a&2){let t=s().$implicit;l(),d("ngIf",t.LeadTime),l(),d("ngIf",!t.LeadTime)}}function re(a,m){if(a&1&&(o(0,"tr")(1,"td")(2,"a",48),c(3),r()(),o(4,"td"),c(5),r(),o(6,"td",49),c(7),T(8,"quantityFraction"),r(),o(9,"td",49),c(10),T(11,"number"),r(),o(12,"td",49),c(13),T(14,"number"),r(),o(15,"td",49)(16,"div"),c(17),r()(),O(18,ne,2,3,"td",44)(19,oe,3,2,"td",44),r()),a&2){let t=m.$implicit,e=s(2);l(2),d("queryParams",it(27,Xt,t.ID)),l(),x(" ",t.Name," "),l(2),tt(t.Code),l(2),x(" ",R(8,19,t.Available)," "),l(3),x(" ",H(11,21,t.QtySoldPerDay,"1.0-2")," "),l(3),x(" ",t.QtySoldPerDay<0?"-":H(14,24,t.DaysOf,"1.0-0")," "),l(3),$("text-negative",t.DaysOfRiskType===e.riskType.negative)("text-empty",t.DaysOfRiskType===e.riskType.empty)("text-critical",t.DaysOfRiskType===e.riskType.critical)("text-optimal",t.DaysOfRiskType===e.riskType.optimal)("text-overstock",t.DaysOfRiskType===e.riskType.overstock),l(),x(" ",t.DaysOfRisk," "),l(),d("ngIf",e.pageData().Filter.TargetOutlet),l(),d("ngIf",e.pageData().Filter.TargetOutlet)}}function le(a,m){a&1&&(o(0,"td",49)(1,"span"),c(2,"Bulk Lead Time "),r()())}function se(a,m){if(a&1){let t=D();o(0,"td")(1,"input",58),y("ngModelChange",function(n){u(t);let i=s(2);return g(i.onBulkUpdateLT(n))}),r()()}if(a&2){let t=s(2);l(),d("ngModel",t.bulkUpdateLTValue())("id","LT")}}function pe(a,m){if(a&1){let t=D();o(0,"div",31)(1,"div",32)(2,"table",33),y("matSortChange",function(n){u(t);let i=s();return g(i.sortData(n))}),o(3,"thead",34)(4,"tr")(5,"th",35),c(6,"Product"),r(),o(7,"th",36),c(8,"Code"),r(),o(9,"th",37),c(10," Available "),r(),o(11,"th",38),c(12," SOLD/DAY "),r(),o(13,"th",39),c(14," Days Of "),r(),o(15,"th",40),c(16," Risk "),r(),O(17,te,2,0,"th",41)(18,ee,2,1,"th",42),r()(),o(19,"tbody"),O(20,re,20,29,"tr",43),r(),o(21,"tfoot")(22,"tr"),w(23,"td")(24,"td")(25,"td")(26,"td")(27,"td"),O(28,le,3,0,"td",44),Z(29,se,2,2,"td"),r()()()(),o(30,"div")(31,"POS-complex-pagination",45),y("jumpToPage",function(){u(t);let n=s();return g(n.getListData())})("previousPage",function(){u(t);let n=s();return g(n.getListData())})("nextPage",function(){u(t);let n=s();return g(n.getListData())}),C("reloadRowCountChange",function(n){u(t);let i=s();return h(i.reloadRowCount,n)||(i.reloadRowCount=n),g(n)}),r()()()}if(a&2){let t,e=s();l(11),d("matTooltip","Based on Last "+e.pageData().Filter.NumberOfDays+" Days Sold"),l(6),d("ngIf",e.pageData().Filter.TargetOutlet),l(),d("ngIf",e.pageData().Filter.TargetOutlet),l(2),d("ngForOf",e.data().Data),l(8),d("ngIf",e.pageData().Filter.TargetOutlet&&e.data().Data.length>0),l(),K(e.pageData().Filter.TargetOutlet&&e.data().Data.length>0?29:-1),l(2),d("total",e.data().Data.length)("totalAllData",(t=e.data())==null?null:t.ListTotal)("pageData",e.pageData()),f("reloadRowCount",e.reloadRowCount)}}var Ht=class a extends wt{constructor(t,e,n,i,p,_){super(t,e,"Inventory/DayOf","InventoryLoader/DaysOf",void 0,_,!0);this.httpService=e;this.csvConverter=i;this.roleService=p}httpService;csvConverter;roleService;dialog=v(It);fractionData=v(Ct);locale=v(ot);riskType=z;get ropDecimalPlaces(){return this.fractionData.quantity.maximumFraction}formatQuantityFraction(t){let e=`1.${this.fractionData.quantity.minimumFraction}-${this.fractionData.quantity.maximumFraction}`;return st(t,this.locale,e)}ListUpdateROP=V([]);listOutlet=V([]);bulkUpdateLTValue=lt("");toastr=v(S);originalROPValues=V(new Map);rawROPValues=V([]);subTotalROP=rt(()=>this.ListUpdateROP()?this.ListUpdateROP().reduce((t,e)=>t+Number(e.Value),0).toFixed(3):0);postInit(t){this.rawROPValues.set(t.Data),this.ListUpdateROP.set([]),this.originalROPValues.set(new Map)}preInitList(){this.menuData().H="Days of Inventory"}onInputLeadTime(t,e){if(k.IsEmpty(t)||t===0){this.rawROPValues().find(F=>F.ID===e.ID)&&(e.LeadTime="",e.ROP=this.getOriginalROP(e)),this.data.set(b(P({},this.data()),{Data:[...this.data().Data]}));return}let n=this.originalROPValues();n.has(e.ID)||(n.set(e.ID,e.ROP),this.originalROPValues.set(new Map(n)));let i=this.fractionData.quantity.maximumFraction,p=t*e.QtySoldPerDay;e.ROP=parseFloat(p.toFixed(i)),this.ListUpdateROP.update(_=>[..._.filter(qt=>qt.Key!==e.ID),{Key:e.ID,Value:this.formatQuantityFraction(e.ROP)}])}onInputROP(t,e){if(t){let n=this.fractionData.quantity.maximumFraction,i=parseFloat(t.toFixed(n));e.ROP=i,this.ListUpdateROP.update(p=>[...p.filter(F=>F.Key!==e.ID),{Key:e.ID,Value:this.formatQuantityFraction(i)}])}}getOriginalROP(t){return this.originalROPValues().get(t.ID)||t.ROP}get outletSelected(){if(this.listOutlet().length>0&&this.pageData().Filter.TargetOutlet){let t=this.listOutlet().findIndex(e=>e.k===this.pageData().Filter.TargetOutlet);if(t!==-1)return this.listOutlet()[t].v}return""}getOutlets(t){console.log(t),this.listOutlet.set(t)}onSubmitROP(){let t={ListUpdateROP:[...this.ListUpdateROP()],EntityID:this.pageData().Filter.TargetOutlet};this.httpService.post(q.UpdateROP,t).pipe(jt("response"),J(e=>{this.toastr.success("ROP has been updated successfully.","Success!"),this.originalROPValues.set(new Map),this.getListData(),this.ListUpdateROP.set([]),this.bulkUpdateLTValue.set("")})).subscribe()}resetOriginalROP(t){let e=this.originalROPValues();e.has(t.ID)&&(e.delete(t.ID),this.originalROPValues.set(new Map(e)))}updateRop(t,e){this.dialog.open(B).afterClosed().pipe(G(n=>k.IsNotEmpty(n)),Y(n=>{let i={VariantID:t.ID,ListEntityID:n,ROP:t.ROP};return this.httpService.post(q.UpdateROP,i)})).subscribe(()=>{this.clearInput(`leadTime${e}`),this.toastr.success("ROP has been updated successfully.","Success!"),this.getListData()})}clearInput(t){let e=document.getElementById(t);e&&(e.value="")}openExportModal(){this.dialog.open(Ft,{data:{title:"Days of Inventory",exportTypes:[{ID:"InventoryExport/GetDaysOfExport",Value:"Default",FileName:"Days of Inventory"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"Inventory/DayOfCount",pagination:!0}})}sortData(t){let e=[...this.data().Data];if(!t.active||t.direction===""){this.data.set(b(P({},this.data()),{Data:[...e]}));return}let n=e.sort((i,p)=>{let _=t.direction==="asc";switch(t.active){case"Name":return I(i.Name,p.Name,_);case"Code":return I(i.Code,p.Code,_);case"QtySold":return I(i.QtySold,p.QtySold,_);case"QtySoldPerDay":return I(i.QtySoldPerDay,p.QtySoldPerDay,_);case"OnHand":return I(i.OnHand,p.OnHand,_);case"Available":return I(i.Available,p.Available,_);case"DaysOf":return I(i.DaysOf,p.DaysOf,_);default:return 0}});this.data.set(b(P({},this.data()),{Data:[...n]}))}onBulkUpdateLT(t){let e=this.originalROPValues(),n=this.rawROPValues();if(k.IsEmpty(t)){this.bulkUpdateLTValue.set(""),this.data.set(b(P({},this.data()),{Data:n.map(p=>b(P({},p),{LeadTime:null}))}));return}let i=+t;if(this.bulkUpdateLTValue.set(i),!!this.data()?.Data){for(let p of this.data().Data)e.has(p.ID)||e.set(p.ID,p.ROP),p.LeadTime=i,p.ROP=i*(p.QtySoldPerDay||0);this.originalROPValues.set(new Map(e)),this.ListUpdateROP.set(this.data().Data.map(p=>({Key:p.ID,Value:this.formatQuantityFraction(p.ROP)}))),this.data.set(b(P({},this.data()),{Data:[...this.data().Data]}))}}onCriticalChange(t){let e=this.pageData().Filter.ExceedDaysThreshold;t>=e&&(this.pageData().Filter.ExceedDaysThreshold=t+1)}onOverstockChange(t){let e=this.pageData().Filter.CriticalDaysThreshold;t<=e&&(this.pageData().Filter.ExceedDaysThreshold=e+1)}static \u0275fac=function(e){return new(e||a)(M(Et),M(_t),M(S),M(kt),M(ht),M(mt))};static \u0275cmp=L({type:a,selectors:[["app-days-of-inventory"]],inputs:{bulkUpdateLTValue:[1,"bulkUpdateLTValue"]},outputs:{bulkUpdateLTValue:"bulkUpdateLTValueChange"},features:[X],decls:9,vars:6,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"onSubmit","textChange","pageData","text","isFilterOnDropdown"],["ngProjectAs","actions",5,["actions"]],["class","btn btn-outline-secondary me-2",3,"click",4,"ngIf"],["class","btn btn-outline-secondary","role","button",3,"matTooltip","click",4,"ngIf"],["ngProjectAs","filters",5,["filters"]],["class","container-fluid mt-5",4,"ngIf"],[1,"btn","btn-outline-secondary","me-2",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["role","button",1,"btn","btn-outline-secondary",3,"click","matTooltip"],[1,"fa-solid","fa-save","me-3"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],["placeholder","Choose Outlets",1,"ng-select-multiple",3,"ngModelChange","multiple","accessType","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["matTooltip","Number of past days used to calculate average daily sales for inventory planning","matTooltipPosition","above",1,"fa-light","fa-circle-info",2,"cursor","pointer"],["autoNum","","min","1",1,"form-control",3,"ngModelChange","ngModel"],["bindLabel","Value","bindValue","Key","placeholder","All",1,"ng-select",3,"ngModelChange","items","clearable","ngModel"],[1,"filter-item","full"],[1,"threshold-compact-wrapper"],[1,"threshold-row"],["type","text","autoNum","","min","1",1,"threshold-input-mini","input-critical",3,"ngModelChange","ngModel"],[1,"threshold-bar-container"],[1,"threshold-bar"],["matTooltip","Critical","matTooltipPosition","above",1,"bar-segment","seg-critical"],["matTooltip","Optimal","matTooltipPosition","above",1,"bar-segment","seg-optimal"],["matTooltip","Overstock","matTooltipPosition","above",1,"bar-segment","seg-overstock"],[1,"threshold-bar-labels"],["type","text","autoNum","","min","1",1,"threshold-input-mini","input-overstock",3,"ngModelChange","ngModel"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","onListOutlets","multiple","accessType","ngModel"],["name","IndirectAllocated",3,"modelChange","model"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["matSort","",1,"table","custom-table","mt-5",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","Name"],["mat-sort-header","Code",2,"width","125px"],["mat-sort-header","Available","matTooltip","Inventory available for sale","arrowPosition","before",1,"text-end",2,"width","100px"],["mat-sort-header","QtySoldPerDay","arrowPosition","before",1,"text-end",2,"width","100px",3,"matTooltip"],["mat-sort-header","DaysOf","arrowPosition","before","matTooltip","How many days left until you run out of inventory",1,"text-end",2,"width","100px"],["mat-sort-header","DaysOfRisk","arrowPosition","before",1,"text-end",2,"width","120px"],["style","width: 80px","matTooltip","The LEAD TIME (in days) it takes to receive the inventory after placing an order","class","text-end",4,"ngIf"],["class","text-end","style","width: 120px",3,"matTooltip",4,"ngIf"],[4,"ngFor","ngForOf"],["class","text-end",4,"ngIf"],["api","Inventory/DayOfCount",3,"jumpToPage","previousPage","nextPage","reloadRowCountChange","total","totalAllData","pageData","reloadRowCount"],["matTooltip","The LEAD TIME (in days) it takes to receive the inventory after placing an order",1,"text-end",2,"width","80px"],[1,"text-end",2,"width","120px",3,"matTooltip"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"text-end"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","name","ngModel","id"],["class","rop-comparison",4,"ngIf"],[1,"rop-comparison"],[1,"d-flex","align-items-center","justify-content-end","gap-2"],[1,"old-value"],[1,"fa-solid","fa-arrow-right","text-muted"],[1,"input-group","input-group-sm",2,"width","70px"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","decimalPlaces","name","ngModel","id"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","ngModel","id"]],template:function(e,n){if(e&1){let i=D();o(0,"mainpanel-cmp",1),y("onSubmit",function(){return n.getListData()}),C("textChange",function(_){return u(i),h(n.pageData().Filter.FilterText,_)||(n.pageData().Filter.FilterText=_),g(_)}),Q(1,2),O(2,Zt,3,0,"button",3)(3,Kt,3,1,"button",4),j(),Q(4,5),O(5,$t,45,20,"ng-template",null,0,at),j(),o(7,"content"),O(8,pe,32,10,"div",6),r()()}e&2&&(d("pageData",n.menuData()),f("text",n.pageData().Filter.FilterText),d("isFilterOnDropdown",!1),l(2),d("ngIf",n.roleService.global.Export),l(),d("ngIf",n.ListUpdateROP().length>0),l(5),d("ngIf",n.data()))},dependencies:[E,pt,dt,Nt,Wt,Rt,U,yt,W,N,A,gt,ut,Qt,Bt,At,vt,Dt,ft,Mt,Pt,bt,Ut,Vt,St,ct,Lt],styles:[".threshold-compact-wrapper[_ngcontent-%COMP%]{background:#f8f9fa;border-radius:8px;padding:.6rem .75rem;border:1px solid #e9ecef}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-row[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.6rem;width:100%}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini[_ngcontent-%COMP%]{width:48px;min-width:48px;max-width:48px;text-align:center;font-size:.75rem;font-weight:600;border-radius:6px;border:1.5px solid #e5e7eb;padding:.3rem .15rem;background:#fff;color:#374151;flex-shrink:0;transition:all .15s ease}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini[_ngcontent-%COMP%]:focus{outline:none}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-critical[_ngcontent-%COMP%]{border-color:#f5f0a6}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-critical[_ngcontent-%COMP%]:focus{border-color:#fff44f;box-shadow:0 0 0 2px #fff44f1f}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-overstock[_ngcontent-%COMP%]{border-color:#96b0f7}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-input-mini.input-overstock[_ngcontent-%COMP%]:focus{border-color:#3581d8;box-shadow:0 0 0 2px #3581d81f}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-container[_ngcontent-%COMP%]{flex:1;display:flex;flex-direction:column;gap:.25rem;min-width:0}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%]{display:flex;height:10px;border-radius:5px;overflow:hidden;box-shadow:inset 0 1px 2px #00000014}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment[_ngcontent-%COMP%]{flex:1;transition:background .3s ease;cursor:pointer}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-critical[_ngcontent-%COMP%]{background:#fff44f}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-critical[_ngcontent-%COMP%]:hover{background:#f7e817}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-optimal[_ngcontent-%COMP%]{background:#28cc2d}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-optimal[_ngcontent-%COMP%]:hover{background:#388e3c}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-overstock[_ngcontent-%COMP%]{background:#3581d8}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar[_ngcontent-%COMP%] .bar-segment.seg-overstock[_ngcontent-%COMP%]:hover{background:#2c58af}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%]{display:flex;justify-content:space-between;font-size:.55rem;font-weight:500;color:#9ca3af;padding:0 2px}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(1){color:#a39800}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(2){color:#28cc2d}.threshold-compact-wrapper[_ngcontent-%COMP%] .threshold-bar-labels[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:nth-child(3){color:#3581d8}.text-negative[_ngcontent-%COMP%]{color:#a61b29}.text-empty[_ngcontent-%COMP%]{color:#d82e3f}.text-critical[_ngcontent-%COMP%]{color:#e8c73a}.text-optimal[_ngcontent-%COMP%]{color:#28cc2d}.text-overstock[_ngcontent-%COMP%]{color:#3581d8}"],changeDetection:0})};function I(a,m,t){return a===null||a===""?t?-1:1:m===null||m===""?t?1:-1:typeof a=="string"&&typeof m=="string"?a.localeCompare(m)*(t?1:-1):typeof a=="number"&&typeof m=="number"?(a<m?-1:1)*(t?1:-1):typeof a=="string"&&typeof m=="number"?t?-1:1:typeof a=="number"&&typeof m=="string"?t?1:-1:0}export{Ht as DaysOfInventoryComponent};
|