dealpos 26.26.0 → 26.26.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-K63CE6NY.js → chunk-36WVG2RH.js} +1 -1
- package/browser/chunk-3EOUCBIY.js +1 -0
- package/browser/{chunk-FKHDZMCX.js → chunk-3QJEGNYM.js} +1 -1
- package/browser/{chunk-LAAQQ54I.js → chunk-4AX35UGE.js} +1 -1
- package/browser/{chunk-3LPMVAWM.js → chunk-4MYITUBP.js} +1 -1
- package/browser/{chunk-QEPPP232.js → chunk-4S5JJXOX.js} +1 -1
- package/browser/{chunk-JQAEZPWQ.js → chunk-54HOVQAO.js} +1 -1
- package/browser/{chunk-XZ67U2SJ.js → chunk-5J3FNLPU.js} +1 -1
- package/browser/{chunk-4JKCFRQM.js → chunk-5UUHX6JK.js} +1 -1
- package/browser/{chunk-N4E2B2YN.js → chunk-5WHN2O3B.js} +1 -1
- package/browser/{chunk-FM4QJS4Y.js → chunk-62AECINY.js} +1 -1
- package/browser/chunk-6HEOUSQE.js +11 -0
- package/browser/{chunk-QXZB6CGY.js → chunk-6PWYCSMR.js} +1 -1
- package/browser/{chunk-Q3DNASWS.js → chunk-6PXTXNRB.js} +1 -1
- package/browser/{chunk-OOORI6SV.js → chunk-6Q75BAM6.js} +1 -1
- package/browser/{chunk-YZ6KMODY.js → chunk-6RDWWA3C.js} +2 -2
- package/browser/{chunk-INGTLRC5.js → chunk-6VCE7SG4.js} +1 -1
- package/browser/{chunk-7AF5VC5W.js → chunk-7QPEM62M.js} +1 -1
- package/browser/{chunk-245YRSKM.js → chunk-7VSRE3H5.js} +1 -1
- package/browser/{chunk-5P5IL3ZE.js → chunk-7WJ7N33E.js} +1 -1
- package/browser/{chunk-GM47QLI2.js → chunk-A2YQBEJJ.js} +1 -1
- package/browser/{chunk-YO2UMW3O.js → chunk-A3AT5NJC.js} +1 -1
- package/browser/{chunk-BFTXRD6U.js → chunk-AHZEENIP.js} +1 -1
- package/browser/{chunk-2WY2PRX3.js → chunk-AX6MSS5E.js} +1 -1
- package/browser/{chunk-KZZIGGBT.js → chunk-B4BLLM3C.js} +13 -13
- package/browser/{chunk-RDFDNMXA.js → chunk-B7ER7DPN.js} +1 -1
- package/browser/{chunk-F5DG7FK6.js → chunk-BNOFJMNK.js} +1 -1
- package/browser/{chunk-5F6JZUKB.js → chunk-CO4BO3JJ.js} +1 -1
- package/browser/{chunk-HB3OSAJ5.js → chunk-D3X6KJJL.js} +1 -1
- package/browser/{chunk-YFAH23Z2.js → chunk-D7F6DNHQ.js} +1 -1
- package/browser/{chunk-DEOIKJ5B.js → chunk-DDZYOQVE.js} +1 -1
- package/browser/{chunk-QQVYT2CE.js → chunk-DEYK4W4M.js} +1 -1
- package/browser/{chunk-56ZJT337.js → chunk-DUAVZ7RS.js} +1 -1
- package/browser/{chunk-YCIOWSQN.js → chunk-EQUQBG4B.js} +1 -1
- package/browser/{chunk-7VOS23CT.js → chunk-F2NKR4C4.js} +1 -1
- package/browser/{chunk-YJRAWWG6.js → chunk-FWFNA7J7.js} +1 -1
- package/browser/{chunk-A6EHOB2A.js → chunk-GLTIMBA3.js} +1 -1
- package/browser/{chunk-MWTVOHS3.js → chunk-GPCUC3XR.js} +2 -2
- package/browser/{chunk-D2M4XT5D.js → chunk-GRJ2DDNT.js} +1 -1
- package/browser/{chunk-IJZZOTJF.js → chunk-GS4EEPUM.js} +1 -1
- package/browser/chunk-GSAUSHUP.js +1 -0
- package/browser/{chunk-QNTF6Y4E.js → chunk-GYRSC6JK.js} +1 -1
- package/browser/{chunk-G3FRBHNH.js → chunk-GYX6HADJ.js} +1 -1
- package/browser/{chunk-BLKSUBEQ.js → chunk-GZAFDVYR.js} +1 -1
- package/browser/{chunk-DXIGMJIG.js → chunk-HJXUNR54.js} +1 -1
- package/browser/{chunk-CL67T4XP.js → chunk-HOR5NHBZ.js} +1 -1
- package/browser/{chunk-JM5OCTRW.js → chunk-ITTM22IU.js} +1 -1
- package/browser/{chunk-NOKANL76.js → chunk-IVXQ24E2.js} +1 -1
- package/browser/{chunk-3Y3QWNPG.js → chunk-J2KZM76Q.js} +1 -1
- package/browser/{chunk-YDPZ5E4C.js → chunk-J6EEFPPF.js} +1 -1
- package/browser/{chunk-TCJGA77G.js → chunk-JDHT3BUS.js} +1 -1
- package/browser/{chunk-2GORPQJA.js → chunk-JGH7V6ST.js} +2 -2
- package/browser/{chunk-KB2ROP5M.js → chunk-JO4VL2KD.js} +1 -1
- package/browser/{chunk-MS64AV3U.js → chunk-KCCRD6J2.js} +1 -1
- package/browser/{chunk-AOYMU6BP.js → chunk-KD5ARJDT.js} +1 -1
- package/browser/{chunk-2YAPXYCU.js → chunk-KNSZNN7Z.js} +1 -1
- package/browser/{chunk-SP5P5U4P.js → chunk-KZD2QXTD.js} +1 -1
- package/browser/{chunk-FQGBEAD6.js → chunk-L7OXQPMD.js} +1 -1
- package/browser/{chunk-GW66RAOB.js → chunk-LCPEGE2I.js} +1 -1
- package/browser/{chunk-B2EFVEWA.js → chunk-LVGFXQF5.js} +1 -1
- package/browser/{chunk-7ZTVJ77Q.js → chunk-MJEROUEN.js} +1 -1
- package/browser/{chunk-YQOBGILP.js → chunk-MJQ2QZRO.js} +1 -1
- package/browser/{chunk-QJBMJCVJ.js → chunk-MOIQN36K.js} +1 -1
- package/browser/{chunk-SDVVQYWW.js → chunk-N64OVQIJ.js} +1 -1
- package/browser/{chunk-JMJFKNHU.js → chunk-NIMEOIYA.js} +2 -2
- package/browser/{chunk-MOPAN53I.js → chunk-NLZEIQYE.js} +1 -1
- package/browser/{chunk-OTX3ZMAD.js → chunk-NSTIDN6K.js} +1 -1
- package/browser/{chunk-AKQUAOEK.js → chunk-NXNVJFHV.js} +1 -1
- package/browser/{chunk-ER2XOJSV.js → chunk-OAY4TSZX.js} +1 -1
- package/browser/{chunk-TE3KAMM2.js → chunk-PDXATZI7.js} +1 -1
- package/browser/{chunk-VMBP53ZK.js → chunk-PPZT5BXB.js} +1 -1
- package/browser/{chunk-T4IWUTWN.js → chunk-PRAD3TQ2.js} +1 -1
- package/browser/{chunk-J5Y26VQI.js → chunk-Q2BOQ4F2.js} +1 -1
- package/browser/{chunk-HRKBRIXI.js → chunk-Q6BIHZIC.js} +1 -1
- package/browser/{chunk-VSFXGHFU.js → chunk-QK5JKDSU.js} +1 -1
- package/browser/{chunk-2Y2TMZXI.js → chunk-R3MDM4LG.js} +2 -2
- package/browser/{chunk-5XWYCCQZ.js → chunk-RIKFXXZQ.js} +1 -1
- package/browser/chunk-RTUH3IAW.js +1 -0
- package/browser/{chunk-7MXGOH2M.js → chunk-RUCPTACF.js} +1 -1
- package/browser/{chunk-NVEBNX2R.js → chunk-RUF25AB7.js} +1 -1
- package/browser/{chunk-BV23URQW.js → chunk-RZ4ICT7G.js} +1 -1
- package/browser/{chunk-YUSNLZBH.js → chunk-SHZ73RHB.js} +1 -1
- package/browser/{chunk-PU6TICPQ.js → chunk-SQYNDMR4.js} +1 -1
- package/browser/{chunk-XZS6HMHS.js → chunk-T5Q4R3MP.js} +1 -1
- package/browser/{chunk-NIERZ7MD.js → chunk-TTL5GHFC.js} +1 -1
- package/browser/{chunk-2HGHROHW.js → chunk-UEA5CDHM.js} +1 -1
- package/browser/{chunk-TQ6LQHR6.js → chunk-UZQLCCAA.js} +1 -1
- package/browser/{chunk-YDHB555J.js → chunk-VBP255FS.js} +1 -1
- package/browser/{chunk-WJKDMFML.js → chunk-VDOHRUEO.js} +2 -2
- package/browser/{chunk-J3ZIUT4U.js → chunk-WM4GADWX.js} +1 -1
- package/browser/{chunk-ANTUC2J3.js → chunk-X4NTM2PB.js} +1 -1
- package/browser/{chunk-BCFZIQIU.js → chunk-XO5KY4T3.js} +1 -1
- package/browser/{chunk-7WHR334J.js → chunk-XOHEHG6L.js} +1 -1
- package/browser/{chunk-M7OYFLQ5.js → chunk-XVYH5K2K.js} +1 -1
- package/browser/{chunk-MK7F3CLD.js → chunk-YIUQSJID.js} +1 -1
- package/browser/{chunk-TF32W63W.js → chunk-YUBTIJHQ.js} +1 -1
- package/browser/{chunk-5GY5VJB2.js → chunk-Z5J74AKK.js} +1 -1
- package/browser/{chunk-7KJ6CXGF.js → chunk-Z6KIGEZN.js} +1 -1
- package/browser/{chunk-YAJW3NNQ.js → chunk-ZZ4YGJVH.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-IO6POO24.js → main-ULIT7CN5.js} +1 -1
- package/package.json +1 -1
- package/browser/chunk-5SXS7HCM.js +0 -1
- package/browser/chunk-7ZGR43MI.js +0 -11
- package/browser/chunk-IDBMPWUH.js +0 -1
- package/browser/chunk-VRBAZJ7Z.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{k as ze,o as tt,q as it,r as nt}from"./chunk-P2FAKIKL.js";import{a as Ke,b as qe}from"./chunk-ZFSMBBTC.js";import{a as ot,b as rt}from"./chunk-
|
|
1
|
+
import{k as ze,o as tt,q as it,r as nt}from"./chunk-P2FAKIKL.js";import{a as Ke,b as qe}from"./chunk-ZFSMBBTC.js";import{a as ot,b as rt}from"./chunk-D3X6KJJL.js";import{a as Ye,b as Je,e as Qe,f as Xe,g as Ze,h as et}from"./chunk-7HKIQJO2.js";import{a as z}from"./chunk-SY5NNN4M.js";import{a as oe,b as Ge,c as We}from"./chunk-ZIR7IDMB.js";import{F as je,a as Le,c as Ue,h as He,l as Be,s as $e}from"./chunk-TG23CQGV.js";import{a as v}from"./chunk-PTRS3UA6.js";import{n as k,q}from"./chunk-FWVQ6CFL.js";import{$b as Me,Aa as ie,Ab as h,Bb as s,C as Z,Cb as d,Db as M,G as r,H as pe,I as ee,Jb as $,K as ue,Ka as ye,L as D,Ma as be,Mb as w,O as me,Pb as y,Pc as A,Qc as W,Ra as l,Rb as p,Rc as Ae,Sb as xe,Tb as j,Ya as F,Zb as Te,_ as u,_b as Ie,aa as te,ab as V,ac as Ee,bb as ve,bc as ke,c as le,ca as I,d as se,dc as S,e as P,ec as x,fc as E,fd as Ne,ga as fe,gb as Ce,gc as Pe,ha as U,i as ce,ia as ge,k as X,ka as H,kd as K,l as _,la as B,m as a,pa as C,pb as Oe,qa as O,qc as De,r as g,s as de,sd as Re,tb as m,tc as Fe,vb as f,vc as G,wa as b,wc as ne,xb as _e,yb as Se,yc as Ve,za as he,zb as we}from"./chunk-KYVLS64M.js";import{a as R,b as L}from"./chunk-KMHZKFQS.js";var N=class{static emptyDate="Please fill invoice date";static emptyNumber="Please fill invoice number";static emptyOrderNumber="Number is Required";static failGetMenu="Fail to get pos menu";static failToGetRetur="Fail to get retur";static failGetLocalPosStorage="Fail to get setting and option from local storage, Please re-cache your data while online!";static failGetVariant='"Error getting variant with {0} {1}" - {2}';static failGetLocalVariant="Fail to get variant from local storage, Please re-cache your data while online!";static emptyBarcodeFormat='No product with barcode "{0}"';static emptyCustomerFormat='No customer with code "{0}"';static failGetSalesOrder="Fail to get sales order";static failBin="Fail to bin transaction";static failGetCustomer="Fail to get customer's data";static failCreateCustomer="Fail to create customer";static noRoleContact="You have no right to create new customer";static submitLocally="Connection unavailable ~ offline! Order stored locally";static offlineMode="There is no internet connection, it is now in offline mode";static OfflineOrderNotSupport="Offline order is not Supported!";static failOrderConnectionTimeOut="Connection timeout! Please try uploading your order again!";static failDeletePark="Fail to delete park";static emptyAccessRegister="You do not have access to any Register";static failGenerateNewNumber="Fail to generate new number";static emptyPayment="There is no active payment method.";static failOpenRegister="Fail to open register";static failGetLocalOutletInfo="Fail to get outlet information from local storage, Please re-cache your data while online!";static failTrySubmit=`[Error submitting order]
|
|
2
2
|
{0}`;static failTryCreateCustomer=`"[Error creating customer]
|
|
3
3
|
"{0}`;static createCustomerOffline="Create customer is not supported when the connection offline";static emptyCustomer="Please select customer!";static emptySalesPerson="Please select sales person!";static emptySalesType="Please select sales type!";static failCreateNewVariant="Fail to create new variant";static requiredDefaultCategory="[WARNING] - POS / Quick Create Product requires Default Category";static emptyVariant="Item is undefined, please re-type";static emptyPOItem="You must have at least one item";static emptyEntity="Please select entity before proceeding..";static failGetRetrieve="Fail to get retrieve";static failTryPark=`[Error submitting park]
|
|
4
4
|
{0}`;static failTryGetPark=`[Error during get park]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as R,b as U}from"./chunk-ZFSMBBTC.js";import{b as j,d as K,e as W}from"./chunk-CVRHFTCA.js";import{a as c}from"./chunk-SY5NNN4M.js";import{E as F,a as x,h as P,o as L}from"./chunk-TG23CQGV.js";import{q as H}from"./chunk-FWVQ6CFL.js";import{$ as y,Ab as o,B as h,Bb as p,C as f,Cb as m,Cc as $,Dc as I,K as v,Lc as V,O as _,Pb as B,Qc as a,Ra as s,Ya as M,_ as C,ab as O,d as l,ec as S,fc as N,ga as D,gb as d,id as E,l as g,ld as w,r as u,sd as A,tc as T,za as r}from"./chunk-KYVLS64M.js";function G(i,n){if(i&1&&(p(0,"div",3)(1,"span"),S(2),m()()),i&2){let t=n.item;o("matTooltip","Brand restricted to "+t.Value),s(2),N(t.Value)}}function q(i,n){i&1&&d(0,G,3,2,"ng-template",2)}var k=class i{constructor(n){this.httpService=n}placeholder=a("Choose Brand");multiple=a(!1);clearable=a(!0);prefix=a("");disabled=a(!1);stableDisabled=a(!1);_initialDisabled=r(!1);isEffectivelyDisabled=V(()=>this.stableDisabled()?this._initialDisabled():this.disabled());value=r(null);onChange=n=>{};onTouched=()=>{};brandInput$=new l;brands$;loadBrands$=new l;ngOnInit(){this._initialDisabled.set(this.disabled());let n=this.loadBrands$.pipe(y(e=>e.length?g(e):this.httpService.post(c.SearchBrand,{prefix:this.prefix(),count:20}),[])),t=this.brandInput$.pipe(u(e=>e??""),f(e=>e.length>=3),_(),v(500),C(e=>this.httpService.post(c.SearchBrand,{prefix:e,count:20})));this.brands$=h(n,t),this.loadBrands$.next()}onOpen(){this.loadBrands$.next()}writeValue(n){this.value.set(n),n!=null&&n!==""&&!(Array.isArray(n)&&n.length===0)&&this.loadBrands$.next()}registerOnChange(n){this.onChange=n}registerOnTouched(n){this.onTouched=n}onModelChange(n){this.value.set(n),this.onChange(n)}onSelectChange(){this.onChange(this.value())}static \u0275fac=function(t){return new(t||i)(M(H))};static \u0275cmp=O({type:i,selectors:[["POS-brand-options"]],inputs:{placeholder:[1,"placeholder"],multiple:[1,"multiple"],clearable:[1,"clearable"],prefix:[1,"prefix"],disabled:[1,"disabled"],stableDisabled:[1,"stableDisabled"]},features:[T([{provide:x,useExisting:D(()=>i),multi:!0}])],decls:3,vars:10,consts:[["bindLabel","Value","bindValue","Key","appendTo","body",1,"brand-select",3,"ngModelChange","change","open","items","disabled","typeahead","ngModel","multiple","placeholder","clearable"],[4,"ngIf"],["ng-label-tmp",""],["matTooltipPosition","above",3,"matTooltip"]],template:function(t,e){t&1&&(p(0,"ng-select",0),$(1,"async"),B("ngModelChange",function(z){return e.onModelChange(z)})("change",function(){return e.onSelectChange()})("open",function(){return e.onOpen()}),d(2,q,1,0,null,1),m()),t&2&&(o("items",I(1,8,e.brands$))("disabled",e.stableDisabled()?e._initialDisabled():e.disabled())("typeahead",e.brandInput$)("ngModel",e.value())("multiple",e.multiple())("placeholder",e.placeholder())("clearable",e.clearable()),s(2),o("ngIf",e.isEffectivelyDisabled()))},dependencies:[A,E,F,P,L,W,K,j,U,R,w],styles:["ng-select.brand-select.ng-select-multiple.ng-select-disabled>.ng-select-container .ng-value-container .ng-value{background-color:transparent;border:1px solid transparent}"]})};export{k as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as de}from"./chunk-PM2FPEAY.js";import{a as le}from"./chunk-RZ2MAOIO.js";import"./chunk-BYXBJQAS.js";import{g as ae,h as se}from"./chunk-
|
|
1
|
+
import{a as de}from"./chunk-PM2FPEAY.js";import{a as le}from"./chunk-RZ2MAOIO.js";import"./chunk-BYXBJQAS.js";import{g as ae,h as se}from"./chunk-4MYITUBP.js";import"./chunk-6K6JOBI3.js";import"./chunk-N64OVQIJ.js";import{a as re}from"./chunk-7WJ7N33E.js";import"./chunk-YBYU2NPK.js";import"./chunk-Y6PUTPXJ.js";import"./chunk-36WVG2RH.js";import"./chunk-NKXJK5OA.js";import"./chunk-YCVG7SEH.js";import"./chunk-P2FAKIKL.js";import"./chunk-IJDHU46P.js";import"./chunk-IQFUVZ6Y.js";import"./chunk-MQW2LRVQ.js";import"./chunk-ZFSMBBTC.js";import"./chunk-YNQPX5G6.js";import"./chunk-2QKUYPUO.js";import"./chunk-D3X6KJJL.js";import{a as oe,b as ie,c as ne}from"./chunk-7HKIQJO2.js";import"./chunk-GXXXD7U4.js";import"./chunk-TECQKS2T.js";import{a as V}from"./chunk-SY5NNN4M.js";import{b as ee,c as te}from"./chunk-ZIR7IDMB.js";import"./chunk-ONJ4E7DL.js";import"./chunk-IIFF2GRQ.js";import"./chunk-UNE3K3SG.js";import"./chunk-PDGCWLMX.js";import{E as W,F as Q,c as z,h as G,o as J}from"./chunk-TG23CQGV.js";import"./chunk-54HOVQAO.js";import"./chunk-Q6BIHZIC.js";import"./chunk-PRQZ2TZC.js";import{b as Z}from"./chunk-76THZNK6.js";import"./chunk-PTRS3UA6.js";import"./chunk-B7ER7DPN.js";import{n as q,q as X}from"./chunk-FWVQ6CFL.js";import{$b as j,Ab as _,Bb as i,C as T,Cb as a,Db as H,Hb as A,Ib as N,Ic as $,Jb as K,Kd as Y,Lc as L,Mb as y,Pb as m,Ra as l,Rb as u,Ya as f,ab as M,ec as d,fb as F,fc as O,gb as E,hc as B,jc as S,kc as x,kd as U,la as h,lc as w,pa as c,qa as p,sd as R,tb as I,vb as P,wb as g,yb as C,za as b,zb as v}from"./chunk-KYVLS64M.js";import"./chunk-KMHZKFQS.js";function he(n,r){if(n&1){let e=y();i(0,"tr")(1,"td")(2,"div",11)(3,"i",15),m("click",function(){let t=c(e).$index,s=u();return p(s.onRemoveHeader(t))}),a()()(),i(4,"td")(5,"input",16),w("ngModelChange",function(t){let s=c(e).$implicit;return x(s.Key,t)||(s.Key=t),p(t)}),a()(),i(6,"td")(7,"input",17),w("ngModelChange",function(t){let s=c(e).$implicit;return x(s.Value,t)||(s.Value=t),p(t)}),a()()()}if(n&2){let e=r.$implicit;l(5),S("ngModel",e.Key),l(2),S("ngModel",e.Value)}}var k=class n{dialogRef=h(oe);toastr=h(q);config;headers=b([{Value:"",Key:""}]);host=b("");data=h(ie);lastHeader=L(()=>this.headers()[this.headers()?.length-1]);constructor(){this.initModalConfig(),this.data&&(this.host.set(this.data.Host),this.headers.set(this.data.Headers))}initModalConfig(){this.config=new ee,this.config.title="Host Request Header",this.config.customWidth="600px"}onRemoveHeader(r){let e=this.headers();e.splice(r,1),this.headers.set([...e])}onSave(){if(!this.validateForm())return;let r={Host:this.host(),Headers:this.headers()};this.dialogRef.close(r)}validateForm(){let r=!0;return this.host()||(this.toastr.error("Host is required","Invalid Host"),r=!1),this.headers().length===0&&r&&(this.toastr.error("At least one header is required","No Headers"),r=!1),this.headers().forEach((e,o)=>{(!e.Key||!e.Value)&&r&&(this.toastr.error(`Header ${o+1} is incomplete`,"Invalid Header"),r=!1)}),r}onClose(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=M({type:n,selectors:[["app-modal-webhook-request-header"]],decls:25,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[1,"form-floating-outline","mb-8"],["type","text","id","host","name","host","placeholder","Host",1,"form-control","bg-white",3,"ngModelChange","ngModel"],["for","host"],[1,"card-title"],[1,"table","table-bordered","custom-table"],[1,"thead-light","sticky-top-thead-webhook-request-header"],[2,"width","20px"],[1,"d-flex","justify-content-center"],["type","button",1,"btn","btn-outline-dark","btn-sm","bg-white","text-black",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-plus"],[2,"width","100px"],[1,"fa","fa-xmark","text-danger","cursor-pointer",3,"click"],["type","text","id","key","name","key","placeholder","Key",1,"form-control","bg-white",3,"ngModelChange","ngModel"],["type","text","id","value","name","value","placeholder","Value",1,"form-control","bg-white",3,"ngModelChange","ngModel"]],template:function(e,o){if(e&1&&(i(0,"modal-material",0),m("onOk",function(){return o.onSave()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"div",4)(6,"input",5),w("ngModelChange",function(s){return x(o.host,s)||(o.host=s),s}),a(),i(7,"label",6),d(8,"Host"),a()(),i(9,"h5",7),d(10,"Headers"),a(),i(11,"table",8)(12,"thead",9)(13,"tr")(14,"th",10)(15,"div",11)(16,"button",12),m("click",function(){return o.headers.set([...o.headers(),{Key:"",Value:""}])}),H(17,"i",13),a()()(),i(18,"th",14),d(19,"Key"),a(),i(20,"th"),d(21,"Value"),a()()(),i(22,"tbody"),C(23,he,8,2,"tr",null,g),a()()()()()()()),e&2){let t;_("config",o.config),l(6),S("ngModel",o.host),l(10),_("disabled",(!((t=o.lastHeader())!=null&&t.Key)||!((t=o.lastHeader())!=null&&t.Value))&&o.headers().length>0),l(7),v(o.headers())}},dependencies:[R,Q,z,G,te,W,J],styles:[".sticky-top-thead-webhook-request-header[_ngcontent-%COMP%] th[_ngcontent-%COMP%]{position:sticky!important;top:-16px!important;z-index:1020!important}"]})};function fe(n,r){if(n&1&&(i(0,"div"),d(1),a()),n&2){let e=r.$implicit;l(),B(" ",e.Key," : ",e.Value," ")}}function _e(n,r){if(n&1){let e=y();i(0,"tr",11),m("click",function(){let t=c(e),s=t.$implicit,D=t.$index,ce=u(2);return p(ce.onUpdateHost(s,D))}),i(1,"td")(2,"div",12)(3,"i",13),m("click",function(){let t=c(e).$index,s=u(2);return p(s.onRemoveHeader(t))}),a()()(),i(4,"td"),d(5),a(),i(6,"td"),C(7,fe,2,2,"div",null,g),a()()}if(n&2){let e=r.$implicit;l(5),O(e.Host),l(2),v(e.Headers)}}function be(n,r){if(n&1&&C(0,_e,9,1,"tr",10,g),n&2){let e=u();v(e.host())}}function ge(n,r){n&1&&K(0)}function Ce(n,r){if(n&1&&E(0,ge,1,0,"ng-container",14),n&2){u();let e=j(20);_("ngTemplateOutlet",e)}}function ve(n,r){n&1&&(i(0,"tr",15)(1,"td",16),H(2,"empty-state-table"),a()())}var me=class n extends de{constructor(e,o,t,s,D){super(e,o,V.WebhookRequestCustomHeaderLoader,t);this.activatedRoute=t;this.role=s;this.dialog=D}host=b([]);toastr=h(q);postBindForm(e){let o=e.Form?.CustomHeaders;this.host.set(o)}addCustomHeader(){this.dialog.open(k).afterClosed().pipe(T(e=>!!e)).subscribe(e=>{if(e){let o=[...this.host(),e];this.saveHost(o)}})}onUpdateHost(e,o){this.dialog.open(k,{data:e}).afterClosed().pipe(T(t=>!!t)).subscribe(t=>{if(t){let s=[...this.host()];s[o]=t,this.saveHost(s)}})}onRemoveHeader(e){let o=this.host();o.splice(e,1);let t=[...o];this.saveHost(t)}saveHost(e){this.httpService.post(V.WebhookRequestCustomHeaderSave,e).subscribe({next:()=>{this.host.set(e),this.toastr.success("Host and headers saved successfully","Success")}})}static \u0275fac=function(o){return new(o||n)(f(re),f(X),f(Y),f(Z),f(ne))};static \u0275cmp=M({type:n,selectors:[["app-webhook-request-header"]],features:[F],decls:21,vars:4,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["ngProjectAs","actions",5,["actions"]],["type","button","role","button",1,"btn","btn-success",3,"click"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],["width","30"],[1,"cursor-pointer"],[1,"cursor-pointer",3,"click"],[1,"d-flex","justify-content-center"],[1,"fa","fa-xmark","text-danger","cursor-pointer",3,"click"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","3"]],template:function(o,t){o&1&&(i(0,"mainpanel-cmp",1),A(1,2),i(2,"button",3),m("click",function(){return t.addCustomHeader()}),d(3," Add "),a(),N(),i(4,"content")(5,"div",4)(6,"div",5)(7,"div",6)(8,"table",7)(9,"thead",8)(10,"tr"),H(11,"th",9),i(12,"th"),d(13,"Host"),a(),i(14,"th"),d(15,"Headers"),a()()(),i(16,"tbody"),I(17,be,2,0)(18,Ce,1,1,"ng-container"),a()()()()(),E(19,ve,3,0,"ng-template",null,0,$),a()()),o&2&&(_("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(17),P(t.host().length>0?17:18))},dependencies:[R,U,se,ae,W,le],encapsulation:2})};export{me as WebhookRequestHeaderComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w}from"./chunk-AE4VC5SW.js";import{g as S}from"./chunk-
|
|
1
|
+
import{a as w}from"./chunk-AE4VC5SW.js";import{g as S}from"./chunk-36WVG2RH.js";import{a as I,b as F}from"./chunk-7HKIQJO2.js";import{c as D}from"./chunk-ZIR7IDMB.js";import{F as x,c as T,e as m,h as y,l as b,s as M}from"./chunk-TG23CQGV.js";import{Ab as d,Bb as n,Cb as i,Db as c,Pb as h,Ra as r,ab as v,ec as o,fc as C,fd as _,la as f,sd as R,tb as p,vb as u,vc as g}from"./chunk-KYVLS64M.js";var E=class{};var k=t=>({"is-invalid":t});function W(t,l){t&1&&(n(0,"div",8)(1,"span"),o(2,"Host URL is required."),i()())}function U(t,l){t&1&&(n(0,"span",9),o(1,"Enter the port or device URL used by your middleware."),i())}function O(t,l){t&1&&(n(0,"div",8)(1,"span"),o(2,"Buffer Time must be at least 100 ms."),i()())}function P(t,l){t&1&&(n(0,"span",9),o(1,"Enter the buffer time in milliseconds for your RFID device."),i())}var N=class t{dialogRef=f(I);data=f(F);config=new S;urlCtrl=new b(this.data?.url,[m.required]);bufferTimeCtrl=new b(this.data?.bufferTime??100,[m.required,m.min(100)]);isConnected=this.data?.isConnected;constructor(){this.initModalConfig()}initModalConfig(){this.config.title="Connect RFID",this.config.customWidth="450px",this.config.hideCancel=!0,this.config.okText=this.isConnected?"Disconnect":"Connect Now"}onClose(){this.dialogRef.close()}onConnect(){this.isConnected?this.dialogRef.close({disconnect:!0}):this.urlCtrl.valid&&this.bufferTimeCtrl.valid&&this.dialogRef.close({url:this.urlCtrl.value,bufferTime:this.bufferTimeCtrl.value})}get modalContentWording(){let l="RFID Connected",a="Your RFID device is successfully connected.",e="RFID Not Connected",s="Please connect your RFID device to process items",A=this.isConnected?l:e,L=this.isConnected?a:s;return{title:A,description:L}}static \u0275fac=function(a){return new(a||t)};static \u0275cmp=v({type:t,selectors:[["app-modal-connect-rfid"]],decls:20,vars:15,consts:[[3,"onCancel","onClose","onOk","config","dynamicValidated"],[1,"d-flex","flex-column",2,"row-gap","1.5rem"],[1,"text-center","d-flex","flex-column","align-items-center",2,"row-gap","0.8rem"],[1,"fa-solid","fa-wifi","fa-3x","d-flex","align-items-center","justify-content-center","bg-light",2,"border-radius","50%","width","80px","height","80px",3,"ngClass"],[1,"fw-normal"],[1,"card","d-flex","justify-content-center","p-8","bg-light-gray",2,"border-radius","12px","margin","0"],["for","floatingInput",1,"fw-semibold","mb-2"],["id","floatingInput","placeholder","Host URL","type","text",1,"form-control",2,"border-radius","8px","padding","12px 16px",3,"ngClass","formControl"],[1,"invalid-feedback","mt-4"],[1,"text-muted","mt-2"],["for","floatingInput",1,"fw-semibold","mb-2","mt-4"],["id","floatingInput","placeholder","Buffer Time (ms)","type","text","autoNum","",1,"form-control",2,"border-radius","8px","padding","12px 16px",3,"ngClass","formControl"]],template:function(a,e){a&1&&(n(0,"modal-material",0),h("onCancel",function(){return e.onClose()})("onClose",function(){return e.onClose()})("onOk",function(){return e.onConnect()}),n(1,"content")(2,"div",1)(3,"div",2),c(4,"i",3),n(5,"h2"),o(6),i(),n(7,"span",4),o(8),i()(),n(9,"div",5)(10,"label",6),o(11,"Port / URL"),i(),c(12,"input",7),p(13,W,3,0,"div",8)(14,U,2,0,"span",9),n(15,"label",10),o(16,"Buffer Time"),i(),c(17,"input",11),p(18,O,3,0,"div",8)(19,P,2,0,"span",9),i()()()()),a&2&&(d("config",e.config)("dynamicValidated",e.urlCtrl.valid),r(4),d("ngClass",e.isConnected?"text-success":"text-danger"),r(2),C(e.modalContentWording.title),r(2),C(e.modalContentWording.description),r(4),d("ngClass",g(11,k,e.urlCtrl.invalid&&(e.urlCtrl.touched||e.urlCtrl.dirty)))("formControl",e.urlCtrl),r(),u(e.urlCtrl.invalid&&(e.urlCtrl.touched||e.urlCtrl.dirty)?13:14),r(4),d("ngClass",g(13,k,e.bufferTimeCtrl.invalid&&(e.bufferTimeCtrl.touched||e.bufferTimeCtrl.dirty)))("formControl",e.bufferTimeCtrl),r(),u(e.bufferTimeCtrl.invalid&&(e.bufferTimeCtrl.touched||e.bufferTimeCtrl.dirty)?18:19))},dependencies:[R,_,x,T,y,M,D,w],encapsulation:2})};export{E as a,N as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as le}from"./chunk-
|
|
1
|
+
import{a as le}from"./chunk-N64OVQIJ.js";import{a as bt}from"./chunk-YBYU2NPK.js";import{a as Vt,b as se}from"./chunk-Y6PUTPXJ.js";import{e as xt,f as wt,i as St}from"./chunk-36WVG2RH.js";import{b as kt,c as Tt,f as ce}from"./chunk-YCVG7SEH.js";import{a as ae,b as re}from"./chunk-ZFSMBBTC.js";import{N as yt,n as vt}from"./chunk-2QKUYPUO.js";import{c as Ct}from"./chunk-7HKIQJO2.js";import{a as Ye}from"./chunk-GXXXD7U4.js";import{u as _t}from"./chunk-TECQKS2T.js";import{c as ft,d as gt,h as ht,i as j}from"./chunk-UNE3K3SG.js";import{Ba as ut,Ea as mt,H as _e,O as st,Q as ct,b as at,l as rt,q as ie,sa as pt,va as dt,wa as oe,x as lt}from"./chunk-PDGCWLMX.js";import{E as ne,c as Je,h as ee,i as et,k as tt,o as te,p as nt}from"./chunk-TG23CQGV.js";import{a as Xe,c as ot}from"./chunk-54HOVQAO.js";import{a as it}from"./chunk-Q6BIHZIC.js";import{a as Ge}from"./chunk-PTRS3UA6.js";import{Aa as me,Ab as g,Bb as a,Ca as fe,Cb as l,Cc as q,Db as h,Dc as Ae,Ec as Ne,L as Se,Lc as be,Mb as b,Nd as Ue,Od as Ze,Pb as f,Pc as Re,Pd as qe,Qa as De,Qc as w,Ra as s,Rb as c,Rc as Y,Sb as $,Tb as T,Ub as U,Uc as He,Wb as M,Xb as D,Ya as y,Yc as je,Zb as Fe,Zc as G,_ as Ve,_b as Ke,_c as Qe,ab as O,bb as W,bc as R,cc as Oe,d as xe,db as Ie,dc as he,eb as Ee,ec as _,fb as Pe,fc as L,fd as ze,gb as ge,gc as A,ha as F,ia as z,ja as ke,jc as I,jd as We,kc as E,kd as $e,la as K,lc as P,pa as p,pb as Be,pc as H,qa as d,r as we,sd as X,tb as u,tc as Le,td as J,uc as Z,vb as m,vc as x,wa as v,xa as Te,xb as S,yb as V,za as Me,zb as k}from"./chunk-KYVLS64M.js";import{a as B,b as ye}from"./chunk-KMHZKFQS.js";var pe=class t{_openDialog=new xe;openDialog$=this._openDialog.asObservable();openDialog(){this._openDialog.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=F({token:t,factory:t.\u0275fac,providedIn:"root"})};var Mt=`
|
|
2
2
|
.p-popover {
|
|
3
3
|
margin-block-start: dt('popover.gutter');
|
|
4
4
|
background: dt('popover.background');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d}from"./chunk-
|
|
1
|
+
import{a as d}from"./chunk-7VSRE3H5.js";import{Aa as D,e as h,za as s}from"./chunk-KYVLS64M.js";import{a as r,b as l}from"./chunk-KMHZKFQS.js";var f=class extends d{constructor(t,i,o,e,c,p,a,g,n="post",u="post"){super(t,i,o,e,c,p,a,n,u);this.httpService=i;this.toastrService=c;this.route=p;this.cdr=g;this.dataMethod=n;this.loaderMethod=u;g&&D(()=>{this.infiniteListSignal()})}toastrCount=s(0);nextPageDisabled=s(!1);extendData=s(!1);goToLast=s(!1);listTotal=s(0);_infiniteList$=new h([]);infiniteListSignal=s([]);get infiniteList(){return this._infiniteList$.value}set infiniteList(t){this._infiniteList$.next(t),this.infiniteListSignal.set(t)}originalData=s([]);StoreRowsCountAPIResult(t,i=!1){this.httpService.post("/api/"+t,this.pageData().Filter).subscribe(o=>{this.listTotal.set(o.Count),this.pageData.update(e=>l(r({},e),{HideStoreApiCount:!0})),i&&(this.pageData.update(e=>l(r({},e),{Filter:l(r({},e.Filter),{RowCount:this.listTotal(),PageNumber:1})})),this.goToLast.set(!0),this.getListData()),this.cdr&&this.cdr.markForCheck()})}NextPage(t){this.pageData().Filter.PageNumber=this.pageData().Filter.PageNumber||1,this.pageData().Filter.PageNumber+=1,this.extendData.set(t),this.getListData()}postInit(t){t?.Data?.length>0&&this.toastrCount.set(0),t?.Data?.length===0&&this.toastrCount()===0&&(this.toastrService?.info("No more data to load","Info"),this.toastrCount.set(1));let i=Array.isArray(t.Data?.hits),o=Array.isArray(t.Data?.[0]?.Variants),e=[...this.infiniteList];if(this.extendData()){let a=e.at(-1),g=t.Data.find(n=>n.ID===a?.ID);if(o&&a)if(g){let n=t.Data.filter(u=>u.ID!==a?.ID);a.Variants=a.Variants.concat(g.Variants||[]),e=e.concat(n)}else e=e.concat(t.Data);else e=e.concat(i?t.Data.hits:t.Data);this.postExtendData(t),this.extendData.set(!1)}else e=i?t.Data.hits:t.Data,this.assignAggregate(t);this.infiniteList=e,this.originalData.set([...e]);let c=i?t.Data.hits.length:t.Data.length,p=this.pageData().Filter.RowCount||0;this.nextPageDisabled.update(()=>c<p),this.menuData.update(a=>l(r({},a),{H:this.data().PageTitle||a.H})),this.afterPostInit(t),this.cdr?.markForCheck?.()}afterPostInit(t){}preSearchFromPageOne(){this.goToLast.set(!1)}postExtendData(t){}assignAggregate(t){}onSelectAllData(t){super.onSelectAllData(t),this.infiniteList=this.infiniteList.map(i=>(i.selected=t,i))}};export{f as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C}from"./chunk-
|
|
1
|
+
import{a as C}from"./chunk-Q6BIHZIC.js";import{a as N}from"./chunk-PRQZ2TZC.js";import{b as R}from"./chunk-76THZNK6.js";import{a as u}from"./chunk-PTRS3UA6.js";import{q as U}from"./chunk-FWVQ6CFL.js";import{Ga as T,Md as v,ca as S,ha as p,ka as m,la as g,td as d,ua as h}from"./chunk-KYVLS64M.js";var k=(o=>(o[o.PAID=0]="PAID",o[o.OVERDUE=1]="OVERDUE",o[o.SELL_ONLY=2]="SELL_ONLY",o[o.SUSPENDED=3]="SUSPENDED",o))(k||{});var b=(()=>{class n{constructor(){this.document=g(h),this.platformId=g(T),this.documentIsAccessible=d(this.platformId)}static getCookieRegExp(e){let i=e.replace(/([[\]{}()|=;+?,.*^$\\])/gi,"\\$1");return new RegExp("(?:^"+i+"|;\\s*"+i+")=(.*?)(?:;|$)","g")}static safeDecodeURIComponent(e){try{return decodeURIComponent(e)}catch(i){return e}}check(e){return this.documentIsAccessible?(e=encodeURIComponent(e),n.getCookieRegExp(e).test(this.document.cookie)):!1}get(e){if(this.check(e)){e=encodeURIComponent(e);let o=n.getCookieRegExp(e).exec(this.document.cookie);return o?.[1]?n.safeDecodeURIComponent(o[1]):""}else return""}getAll(){if(!this.documentIsAccessible)return{};let e={},i=this.document;return i.cookie&&i.cookie!==""&&i.cookie.split(";").forEach(o=>{let[c,s]=o.split("=");e[n.safeDecodeURIComponent(c.replace(/^ /,""))]=n.safeDecodeURIComponent(s)}),e}set(e,i,o,c,s,l,I,L){if(!this.documentIsAccessible)return;if(typeof o=="number"||o instanceof Date||c||s||l||I){let f={expires:o,path:c,domain:s,secure:l,sameSite:I||"Lax",partitioned:L};this.set(e,i,f);return}let a=encodeURIComponent(e)+"="+encodeURIComponent(i)+";",r=o||{};if(r.expires)if(typeof r.expires=="number"){let f=new Date(new Date().getTime()+r.expires*1e3*60*60*24);a+="expires="+f.toUTCString()+";"}else a+="expires="+r.expires.toUTCString()+";";r.path&&(a+="path="+r.path+";"),r.domain&&(a+="domain="+r.domain+";"),r.secure===!1&&r.sameSite==="None"&&(r.secure=!0,console.warn(`[ngx-cookie-service] Cookie ${e} was forced with secure flag because sameSite=None.More details : https://github.com/stevermeister/ngx-cookie-service/issues/86#issuecomment-597720130`)),r.secure&&(a+="secure;"),r.sameSite||(r.sameSite="Lax"),a+="sameSite="+r.sameSite+";",r.partitioned&&(a+="Partitioned;"),this.document.cookie=a}delete(e,i,o,c,s="Lax"){if(!this.documentIsAccessible)return;let l=new Date("Thu, 01 Jan 1970 00:00:01 GMT");this.set(e,"",{expires:l,path:i,domain:o,secure:c,sameSite:s})}deleteAll(e,i,o,c="Lax"){if(!this.documentIsAccessible)return;let s=this.getAll();for(let l in s)s.hasOwnProperty(l)&&this.delete(l,e,i,o,c)}static{this.\u0275fac=function(i){return new(i||n)}}static{this.\u0275prov=p({token:n,factory:n.\u0275fac,providedIn:"root"})}}return n})();var A=class n{constructor(t,e,i,o,c,s){this.httpService=t;this.cookieService=e;this.router=i;this.roleService=o;this.intercomService=c;this.fraction=s}role=[];_returnUrl;_loginResponse;_jwtToken;set returnUrl(t){this._returnUrl=t}get returnUrl(){return this._returnUrl}login(t){return this.httpService.post("/api/Login/Web",t).pipe(S(e=>{this._loginResponse=e,e.Type=="geo"||e.Type=="totp"||this.saveLoginConfigToStorage(e)}))}loginLoader(){return this.httpService.get("/api/login/Loader")}getRedirectUrl(){let t=this.getSubscriptionStatus(),e=this.getRedirectUrlByRole();return(t==2||t==3)&&(e="/menu/Profile/Main/My_Subscription"),e}getRedirectUrlByRole(){let t,e=this.roleService;return e.dashboard.View?t="/menu/Dashboard":e.product.View?t="/menu/Products":t="/menu/Sell",t}logout(){localStorage.removeItem("ConfigData"),localStorage.removeItem("Token"),localStorage.removeItem("Roles"),localStorage.removeItem("AccountInfo"),localStorage.removeItem("CloudinaryConfig"),localStorage.removeItem("SubscriptionStatus"),this.cookieService.delete("ReportFilter","/"),this.intercomService.shutdown(),this._jwtToken=null,this.roleService.resetRoles(),this.router.navigate(["/"])}refreshToken(){this.httpService.post("/API/Authentication/RefreshToken",{}).subscribe(t=>{localStorage.removeItem("Token"),localStorage.setItem("Token",t.Token),this._jwtToken=null,this.roleService.resetRoles(),this.roleService.parseJWTRoles()})}isTokenExpired(){let t=localStorage.getItem("Token");if(t){let e=u.parseJwt(t),i=this.convertUnixTimesTamp(e.exp),o=new Date;if(i.getTime()-o.getTime()>0)return!1}return!0}isInRole(t){t.forEach(e=>e(this.role))}convertUnixTimesTamp(t){return new Date(t*1e3)}saveLoginConfigToStorage(t){localStorage.setItem("quantityFraction",JSON.stringify(t.UIConfig.Fraction.Quantity)),localStorage.setItem("amountFraction",JSON.stringify(t.UIConfig.Fraction.Amount)),this.fraction.setAmountFraction(t.UIConfig.Fraction.Amount.Minimum,t.UIConfig.Fraction.Amount.Maximum),this.fraction.setQuantityFraction(t.UIConfig.Fraction.Quantity.Minimum,t.UIConfig.Fraction.Quantity.Maximum),localStorage.setItem("AccountInfo",JSON.stringify(t?.AccountInfo)),localStorage.setItem("Token",t?.Token),localStorage.setItem("TinyMCEPlugins",t?.UIConfig.TinyMCE),this.intercomService.updateLocalStorage(t?.Intercom),localStorage.setItem("CloudinaryConfig",t?.UIConfig.CloudinaryConfig),localStorage.setItem("DataDaysRange",t?.UIConfig.DataDaysRange),localStorage.setItem("SubscriptionStatus",JSON.stringify(t?.SubscriptionStatus));let e=this.getParseToken();u.IsNotEmpty(e?.NotificationOutletID)&&localStorage.setItem("NotificationOutletID",e?.NotificationOutletID),this.roleService.parseJWTRoles(),this._loginResponse=null}getParseToken(){let t=localStorage.getItem("Token");return t&&!this._jwtToken&&(this._jwtToken=u.parseJwt(t)),this._jwtToken}get loginResponse(){return this._loginResponse}getSubscriptionStatus(){let t=localStorage.getItem("SubscriptionStatus");return t?parseInt(t):null}static \u0275fac=function(e){return new(e||n)(m(U),m(b),m(v),m(R),m(C),m(N))};static \u0275prov=p({token:n,factory:n.\u0275fac,providedIn:"root"})};export{k as a,b,A as c};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as le}from"./chunk-QEPPP232.js";import{a as ge}from"./chunk-VRBAZJ7Z.js";import{g as Ie}from"./chunk-PHMY5YYO.js";import{b as oe,c as ae,d as re}from"./chunk-PY7UTEHG.js";import{a as fe,b as ve}from"./chunk-RJXSWOYZ.js";import{b as xe}from"./chunk-BTQRNDYP.js";import{a as ye}from"./chunk-3JF6BHHX.js";import{b as pe}from"./chunk-TATP2XII.js";import{a as _e}from"./chunk-5AKPII6Z.js";import{g as Ce,h as ue}from"./chunk-3LPMVAWM.js";import{a as se}from"./chunk-5P5IL3ZE.js";import{b as ie}from"./chunk-ZFSMBBTC.js";import{d as me,e as de}from"./chunk-CVRHFTCA.js";import{c as ce}from"./chunk-7HKIQJO2.js";import{E as ee,c as X,h as Y,o as Z,q as $}from"./chunk-TG23CQGV.js";import{b as ne}from"./chunk-76THZNK6.js";import{n as U,q as te}from"./chunk-FWVQ6CFL.js";import{Aa as B,Ab as x,Bb as a,Cb as r,Cc as w,Db as V,Dc as b,Hb as E,Ib as M,Ic as G,Mb as S,Nd as K,Pb as D,Ra as o,Rb as l,Ya as h,ab as k,ec as c,fb as H,fc as F,fd as q,gb as j,gc as _,jc as y,kc as f,la as W,lc as v,pa as C,pd as z,qa as u,sd as J,tb as p,vb as s,vc as A,wb as R,xb as Q,yb as L,za as O,zb as N}from"./chunk-KYVLS64M.js";import{a as T,b as P}from"./chunk-KMHZKFQS.js";var Se=n=>({ID:n}),De=n=>({"expanded-icon":n});function we(n,d){if(n&1){let e=S();a(0,"button",15),D("click",function(){C(e);let t=l();return u(t.openExportModal())}),V(1,"i",16),c(2," Export "),r()}}function be(n,d){if(n&1){let e=S();a(0,"div",17)(1,"div")(2,"h6"),c(3,"Outlet"),r(),a(4,"outlet-selector",18),v("ngModelChange",function(t){C(e);let m=l();return f(m.pageData().Filter.OutletID,t)||(m.pageData().Filter.OutletID=t),u(t)}),r()(),a(5,"div")(6,"h6"),c(7,"Category"),r(),a(8,"POS-product-category-select",19),v("selectedCategoryIDChange",function(t){C(e);let m=l();return f(m.pageData().Filter.ProductCategoryID,t)||(m.pageData().Filter.ProductCategoryID=t),u(t)}),r()(),a(9,"h6"),c(10,"Brand"),r(),a(11,"POS-brand-options",20),v("ngModelChange",function(t){C(e);let m=l();return f(m.pageData().Filter.BrandIDs,t)||(m.pageData().Filter.BrandIDs=t),u(t)}),r(),a(12,"div")(13,"h6"),c(14,"Product Tags"),r(),a(15,"ng-select",21),v("ngModelChange",function(t){C(e);let m=l();return f(m.pageData().Filter.ProductTagID,t)||(m.pageData().Filter.ProductTagID=t),u(t)}),r()(),a(16,"div")(17,"h6"),c(18,"Quantity From - To"),r(),a(19,"div",22)(20,"input",23),v("ngModelChange",function(t){C(e);let m=l();return f(m.pageData().Filter.QtyFrom,t)||(m.pageData().Filter.QtyFrom=t),u(t)}),r(),c(21," - "),a(22,"input",24),v("ngModelChange",function(t){C(e);let m=l();return f(m.pageData().Filter.QtyTo,t)||(m.pageData().Filter.QtyTo=t),u(t)}),r()()()()}if(n&2){let e,i=l();o(4),x("accessType",2),y("ngModel",i.pageData().Filter.OutletID),o(4),y("selectedCategoryID",i.pageData().Filter.ProductCategoryID),x("showClear",!0),o(3),y("ngModel",i.pageData().Filter.BrandIDs),x("multiple",!0)("clearable",!0),o(4),x("items",(e=i.pageData().Options)==null?null:e.Tags),y("ngModel",i.pageData().Filter.ProductTagID),o(5),y("ngModel",i.pageData().Filter.QtyFrom),o(2),y("ngModel",i.pageData().Filter.QtyTo)}}function Te(n,d){if(n&1&&(a(0,"th",10),c(1),r()),n&2){let e=l();o(),_(" ",e.column.VariantName.name," ")}}function Pe(n,d){if(n&1&&(a(0,"th",11),c(1),r()),n&2){let e=l();o(),_(" ",e.column.OnHand.name," ")}}function Ve(n,d){if(n&1&&(a(0,"th",12),c(1),r()),n&2){let e=l();o(),_(" ",e.column.DirectAllocated.name," ")}}function Ee(n,d){if(n&1&&(a(0,"th",13),c(1),r()),n&2){let e=l();o(),_(" ",e.column.IndirectAllocated.name," ")}}function Me(n,d){if(n&1&&(a(0,"th",14),c(1),r()),n&2){let e=l();o(),_(" ",e.column.Available.name," ")}}function Fe(n,d){if(n&1){let e=S();a(0,"button",29),D("click",function(){C(e);let t=l(2).$implicit,m=l();return u(m.onExpand(t))}),V(1,"i",30),r()}if(n&2){let e=l(2).$implicit,i=l();o(),x("ngClass",A(1,De,i.displayExpandedRow(e.VariantID)))}}function Ae(n,d){if(n&1&&(a(0,"td")(1,"div",26),p(2,Fe,2,3,"button",27),a(3,"div")(4,"a",28),c(5),r(),V(6,"br"),a(7,"small"),c(8),r()()()()),n&2){let e=l().$implicit;o(2),s(e.ListComponent&&e.ListComponent.length>0?2:-1),o(2),x("routerLink","/menu/Products/Catalog/Variants/Info")("queryParams",A(5,Se,e.VariantID)),o(),_(" ",e.VariantName," "),o(3),_(" ",e.VariantCode," ")}}function Oe(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l().$implicit;o(),F(b(2,1,e.OnHand))}}function Le(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l(2).$implicit;o(),_(" ",b(2,1,e.DirectAllocated)," ")}}function Ne(n,d){if(n&1&&p(0,Le,3,3,"td",25),n&2){let e=l(2);s(e.column.DirectAllocated&&e.column.DirectAllocated.selected?0:-1)}}function We(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l(2).$implicit;o(),_(" ",b(2,1,e.DirectAllocated)," ")}}function Be(n,d){if(n&1&&p(0,We,3,3,"td",25),n&2){let e=l(2);s(e.column.DirectAllocated&&e.column.DirectAllocated.selected?0:-1)}}function ke(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l().$implicit;o(),F(b(2,1,e.IndirectAllocated))}}function He(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l().$implicit;o(),F(b(2,1,e.Available))}}function je(n,d){if(n&1&&(a(0,"tbody")(1,"tr")(2,"td")(3,"a",28),c(4),r()(),a(5,"td"),c(6),r(),a(7,"td",25),c(8),r(),a(9,"td",25),c(10),r()()()),n&2){let e=d.$implicit,i=l(2).$implicit;o(3),x("routerLink","/menu/Products/Catalog/Variants/Info")("queryParams",A(6,Se,i.VariantID)),o(),_(" ",e.VariantName," "),o(2),_(" ",e.VariantCode," "),o(2),_(" ",e.Quantity," "),o(2),_(" ",e.OnHand," ")}}function Re(n,d){if(n&1&&(a(0,"tr")(1,"td",31)(2,"div",7)(3,"table",32)(4,"thead",33)(5,"tr",34)(6,"th",35),c(7),r(),a(8,"th",36),c(9,"Code"),r(),a(10,"th",37),c(11," Quantity "),r(),a(12,"th",37),c(13," On Hand "),r()()(),L(14,je,11,8,"tbody",null,R),r()()()()),n&2){let e=l().$implicit;o(7),_(" Components (",e.ListComponent.length,") "),o(7),N(e.ListComponent)}}function Qe(n,d){if(n&1&&(a(0,"tr"),p(1,Ae,9,7,"td"),p(2,Oe,3,3,"td",25),p(3,Ne,1,1)(4,Be,1,1),p(5,ke,3,3,"td",25),p(6,He,3,3,"td",25),r(),p(7,Re,16,1,"tr")),n&2){let e=d.$implicit,i=l();o(),s(i.column.VariantName&&i.column.VariantName.selected?1:-1),o(),s(i.column.OnHand&&i.column.OnHand.selected?2:-1),o(),s(i.totalIndirect()>0?3:4),o(2),s(i.column.IndirectAllocated&&i.column.IndirectAllocated.selected&&i.totalIndirect()>0?5:-1),o(),s(i.column.Available&&i.column.Available.selected?6:-1),o(),s(i.displayExpandedRow(e.VariantID)&&i.column.VariantName&&i.column.VariantName.selected?7:-1)}}function Ge(n,d){if(n&1){let e=S();a(0,"div")(1,"POS-complex-pagination",38),D("jumpToPage",function(){C(e);let t=l();return u(t.getListData())})("previousPage",function(){C(e);let t=l();return u(t.getListData())})("nextPage",function(){C(e);let t=l();return u(t.getListData())}),r()()}if(n&2){let e=l();o(),x("total",e.data().Data.length)("pageData",e.pageData())}}var he=class n extends le{constructor(e,i,t,m,I){super(e,i,"inventory/GetListInventoryComposite","inventoryloader/GetListInventoryComposite",t,void 0,!1);this.httpService=i;this.csvConverter=m;this.roleService=I;B(()=>{let g=this.totalIndirect();g!==null&&g<=0&&(console.log("Indirect allocation is zero or negative"),this.column=P(T({},this.column),{DirectAllocated:P(T({},this.column.DirectAllocated),{name:"Allocated"}),IndirectAllocated:P(T({},this.column.IndirectAllocated),{show:!1})}))})}column={VariantName:{selected:!0,name:"Name",show:!0},OnHand:{selected:!0,name:"On Hand",show:!0},DirectAllocated:{selected:!0,name:"Direct Allocated",show:!0},IndirectAllocated:{selected:!0,name:"Indirect Allocated",show:!0},Available:{selected:!0,name:"Available",show:!0}};totalIndirect=O(null);expandedRow=O([]);dialog=W(ce);afterPostInit(e){console.log("Composite Inventory Data",e);let i=e.Data.reduce((t,m)=>t+m.IndirectAllocated,0);console.log("Total Indirect Allocated:",i),this.totalIndirect.set(i)}sortData(e){let i=[...this.data().Data];if(!e.active||e.direction===""){this.infiniteList=i;return}this.infiniteList=i.sort((t,m)=>{let I=e.direction==="asc";return this.compare(t[e.active],m[e.active],I)})}openExportModal(){this.dialog.open(pe,{data:{title:"Composite Inventory",exportTypes:[{ID:"inventoryExport/GetExportInventoryComposite",Value:"Default",FileName:"Composite Inventory"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"inventory/GetCountInventoryComposite",pagination:!0}})}onExpand(e){e?.VariantID&&this.expandedRow.update(i=>i.includes(e.VariantID)?i.filter(t=>t!==e.VariantID):[...i,e.VariantID])}displayExpandedRow(e){return this.expandedRow().includes(e)}static \u0275fac=function(i){return new(i||n)(h(se),h(te),h(U),h(_e),h(ne))};static \u0275cmp=k({type:n,selectors:[["pos-composite-inventory"]],features:[H],decls:21,vars:12,consts:[["pageFilterTemplate",""],["tooltipTitle","Identify and manage unsold inventory that has been stagnant for a long time",3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],["ngProjectAs","actions",5,["actions"]],[1,"btn","btn-outline-secondary","me-3"],["ngProjectAs","filters",5,["filters"]],["ngProjectAs","content",5,["content"]],[1,"container-fluid","mt-3"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","VariantName",2,"width","35%"],["mat-sort-header","OnHand",1,"text-right-sort",2,"width","10%"],["mat-sort-header","DirectAllocated",1,"text-right-sort",2,"width","10%"],["mat-sort-header","IndirectAllocated",1,"text-right-sort",2,"width","10%"],["mat-sort-header","Available",1,"text-right-sort",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"d-flex","flex-column","gap-4"],["placeholder","Choose Outlets (Leave Blank to Choose All)",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["placeholder","Choose Brand",1,"w-100",3,"ngModelChange","ngModel","multiple","clearable"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center",2,"column-gap","8px"],["type","number","name","QuantityFrom",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"text-end"],[1,"d-flex","align-items-center"],[1,"btn","btn-sm","expand-btn"],[3,"routerLink","queryParams"],[1,"btn","btn-sm","expand-btn",3,"click"],[1,"fa","fa-chevron-down",3,"ngClass"],["colspan","100%",2,"padding-left","50px"],[1,"table","border-bottom",2,"width","100%"],[2,"background-color","#f5f5f5"],[1,"text-muted"],[2,"width","55%","color","#3b3b3b"],[2,"color","#3b3b3b"],[2,"text-align","right !important","color","#3b3b3b"],["api","inventory/GetCountInventoryComposite",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(i,t){if(i&1){let m=S();a(0,"mainpanel-cmp",1),v("textChange",function(g){return C(m),f(t.pageData().Filter.SearchText,g)||(t.pageData().Filter.SearchText=g),u(g)}),D("onSubmit",function(){return t.searchFromPageOne()}),v("filterChange",function(g){return C(m),f(t.pageData().Filter,g)||(t.pageData().Filter=g),u(g)}),E(1,2),p(2,we,3,0,"button",3),M(),E(3,4),j(4,be,23,11,"ng-template",null,0,G),M(),E(6,5),a(7,"div",6)(8,"div",7)(9,"table",8),D("matSortChange",function(g){return t.sortData(g)}),a(10,"thead",9)(11,"tr"),p(12,Te,2,1,"th",10),p(13,Pe,2,1,"th",11),p(14,Ve,2,1,"th",12),p(15,Ee,2,1,"th",13),p(16,Me,2,1,"th",14),r()(),a(17,"tbody"),L(18,Qe,8,6,null,null,Q),r()()(),p(20,Ge,2,2,"div"),r(),M(),r()}i&2&&(x("pageData",t.menuData()),y("text",t.pageData().Filter.SearchText),x("isFilterOnDropdown",!1),y("filter",t.pageData().Filter),x("column",t.column),o(2),s(t.roleService.global.Export?2:-1),o(10),s(t.column.VariantName&&t.column.VariantName.selected?12:-1),o(),s(t.column.OnHand&&t.column.OnHand.selected?13:-1),o(),s(t.column.DirectAllocated&&t.column.DirectAllocated.selected?14:-1),o(),s(t.column.IndirectAllocated&&t.column.IndirectAllocated.selected&&t.totalIndirect()>0?15:-1),o(),s(t.column.Available&&t.column.Available.selected?16:-1),o(2),N(t.infiniteList),o(2),s(t.data()?20:-1))},dependencies:[ue,Ce,ye,xe,ee,X,$,Y,Z,de,me,ie,ge,ve,fe,J,q,K,re,oe,ae,Ie,z],styles:["[_nghost-%COMP%]{display:block}.expand-btn[_ngcontent-%COMP%]{border-radius:100px;width:30px;height:30px;transition:all .3s ease;padding:0;transform:rotate(270deg)}.expand-btn[_ngcontent-%COMP%]:hover{background-color:#eaeaea}.expand-btn[_ngcontent-%COMP%]:focus{border:none;outline:none}.expanded-icon[_ngcontent-%COMP%]{transform:rotate(90deg)}[_nghost-%COMP%] .text-right-sort .mat-sort-header-container{display:flex;justify-content:end}th.mat-header-cell[_ngcontent-%COMP%], td.mat-cell[_ngcontent-%COMP%]{text-align:right}"],changeDetection:0})};export{he as a};
|
|
1
|
+
import{a as le}from"./chunk-4S5JJXOX.js";import{a as ge}from"./chunk-3EOUCBIY.js";import{g as Ie}from"./chunk-PHMY5YYO.js";import{b as oe,c as ae,d as re}from"./chunk-PY7UTEHG.js";import{a as fe,b as ve}from"./chunk-RJXSWOYZ.js";import{b as xe}from"./chunk-BTQRNDYP.js";import{a as ye}from"./chunk-3JF6BHHX.js";import{b as pe}from"./chunk-TATP2XII.js";import{a as _e}from"./chunk-5AKPII6Z.js";import{g as Ce,h as ue}from"./chunk-4MYITUBP.js";import{a as se}from"./chunk-7WJ7N33E.js";import{b as ie}from"./chunk-ZFSMBBTC.js";import{d as me,e as de}from"./chunk-CVRHFTCA.js";import{c as ce}from"./chunk-7HKIQJO2.js";import{E as ee,c as X,h as Y,o as Z,q as $}from"./chunk-TG23CQGV.js";import{b as ne}from"./chunk-76THZNK6.js";import{n as U,q as te}from"./chunk-FWVQ6CFL.js";import{Aa as B,Ab as x,Bb as a,Cb as r,Cc as w,Db as V,Dc as b,Hb as E,Ib as M,Ic as G,Mb as S,Nd as K,Pb as D,Ra as o,Rb as l,Ya as h,ab as k,ec as c,fb as H,fc as F,fd as q,gb as j,gc as _,jc as y,kc as f,la as W,lc as v,pa as C,pd as z,qa as u,sd as J,tb as p,vb as s,vc as A,wb as R,xb as Q,yb as L,za as O,zb as N}from"./chunk-KYVLS64M.js";import{a as T,b as P}from"./chunk-KMHZKFQS.js";var Se=n=>({ID:n}),De=n=>({"expanded-icon":n});function we(n,d){if(n&1){let e=S();a(0,"button",15),D("click",function(){C(e);let t=l();return u(t.openExportModal())}),V(1,"i",16),c(2," Export "),r()}}function be(n,d){if(n&1){let e=S();a(0,"div",17)(1,"div")(2,"h6"),c(3,"Outlet"),r(),a(4,"outlet-selector",18),v("ngModelChange",function(t){C(e);let m=l();return f(m.pageData().Filter.OutletID,t)||(m.pageData().Filter.OutletID=t),u(t)}),r()(),a(5,"div")(6,"h6"),c(7,"Category"),r(),a(8,"POS-product-category-select",19),v("selectedCategoryIDChange",function(t){C(e);let m=l();return f(m.pageData().Filter.ProductCategoryID,t)||(m.pageData().Filter.ProductCategoryID=t),u(t)}),r()(),a(9,"h6"),c(10,"Brand"),r(),a(11,"POS-brand-options",20),v("ngModelChange",function(t){C(e);let m=l();return f(m.pageData().Filter.BrandIDs,t)||(m.pageData().Filter.BrandIDs=t),u(t)}),r(),a(12,"div")(13,"h6"),c(14,"Product Tags"),r(),a(15,"ng-select",21),v("ngModelChange",function(t){C(e);let m=l();return f(m.pageData().Filter.ProductTagID,t)||(m.pageData().Filter.ProductTagID=t),u(t)}),r()(),a(16,"div")(17,"h6"),c(18,"Quantity From - To"),r(),a(19,"div",22)(20,"input",23),v("ngModelChange",function(t){C(e);let m=l();return f(m.pageData().Filter.QtyFrom,t)||(m.pageData().Filter.QtyFrom=t),u(t)}),r(),c(21," - "),a(22,"input",24),v("ngModelChange",function(t){C(e);let m=l();return f(m.pageData().Filter.QtyTo,t)||(m.pageData().Filter.QtyTo=t),u(t)}),r()()()()}if(n&2){let e,i=l();o(4),x("accessType",2),y("ngModel",i.pageData().Filter.OutletID),o(4),y("selectedCategoryID",i.pageData().Filter.ProductCategoryID),x("showClear",!0),o(3),y("ngModel",i.pageData().Filter.BrandIDs),x("multiple",!0)("clearable",!0),o(4),x("items",(e=i.pageData().Options)==null?null:e.Tags),y("ngModel",i.pageData().Filter.ProductTagID),o(5),y("ngModel",i.pageData().Filter.QtyFrom),o(2),y("ngModel",i.pageData().Filter.QtyTo)}}function Te(n,d){if(n&1&&(a(0,"th",10),c(1),r()),n&2){let e=l();o(),_(" ",e.column.VariantName.name," ")}}function Pe(n,d){if(n&1&&(a(0,"th",11),c(1),r()),n&2){let e=l();o(),_(" ",e.column.OnHand.name," ")}}function Ve(n,d){if(n&1&&(a(0,"th",12),c(1),r()),n&2){let e=l();o(),_(" ",e.column.DirectAllocated.name," ")}}function Ee(n,d){if(n&1&&(a(0,"th",13),c(1),r()),n&2){let e=l();o(),_(" ",e.column.IndirectAllocated.name," ")}}function Me(n,d){if(n&1&&(a(0,"th",14),c(1),r()),n&2){let e=l();o(),_(" ",e.column.Available.name," ")}}function Fe(n,d){if(n&1){let e=S();a(0,"button",29),D("click",function(){C(e);let t=l(2).$implicit,m=l();return u(m.onExpand(t))}),V(1,"i",30),r()}if(n&2){let e=l(2).$implicit,i=l();o(),x("ngClass",A(1,De,i.displayExpandedRow(e.VariantID)))}}function Ae(n,d){if(n&1&&(a(0,"td")(1,"div",26),p(2,Fe,2,3,"button",27),a(3,"div")(4,"a",28),c(5),r(),V(6,"br"),a(7,"small"),c(8),r()()()()),n&2){let e=l().$implicit;o(2),s(e.ListComponent&&e.ListComponent.length>0?2:-1),o(2),x("routerLink","/menu/Products/Catalog/Variants/Info")("queryParams",A(5,Se,e.VariantID)),o(),_(" ",e.VariantName," "),o(3),_(" ",e.VariantCode," ")}}function Oe(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l().$implicit;o(),F(b(2,1,e.OnHand))}}function Le(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l(2).$implicit;o(),_(" ",b(2,1,e.DirectAllocated)," ")}}function Ne(n,d){if(n&1&&p(0,Le,3,3,"td",25),n&2){let e=l(2);s(e.column.DirectAllocated&&e.column.DirectAllocated.selected?0:-1)}}function We(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l(2).$implicit;o(),_(" ",b(2,1,e.DirectAllocated)," ")}}function Be(n,d){if(n&1&&p(0,We,3,3,"td",25),n&2){let e=l(2);s(e.column.DirectAllocated&&e.column.DirectAllocated.selected?0:-1)}}function ke(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l().$implicit;o(),F(b(2,1,e.IndirectAllocated))}}function He(n,d){if(n&1&&(a(0,"td",25),c(1),w(2,"number"),r()),n&2){let e=l().$implicit;o(),F(b(2,1,e.Available))}}function je(n,d){if(n&1&&(a(0,"tbody")(1,"tr")(2,"td")(3,"a",28),c(4),r()(),a(5,"td"),c(6),r(),a(7,"td",25),c(8),r(),a(9,"td",25),c(10),r()()()),n&2){let e=d.$implicit,i=l(2).$implicit;o(3),x("routerLink","/menu/Products/Catalog/Variants/Info")("queryParams",A(6,Se,i.VariantID)),o(),_(" ",e.VariantName," "),o(2),_(" ",e.VariantCode," "),o(2),_(" ",e.Quantity," "),o(2),_(" ",e.OnHand," ")}}function Re(n,d){if(n&1&&(a(0,"tr")(1,"td",31)(2,"div",7)(3,"table",32)(4,"thead",33)(5,"tr",34)(6,"th",35),c(7),r(),a(8,"th",36),c(9,"Code"),r(),a(10,"th",37),c(11," Quantity "),r(),a(12,"th",37),c(13," On Hand "),r()()(),L(14,je,11,8,"tbody",null,R),r()()()()),n&2){let e=l().$implicit;o(7),_(" Components (",e.ListComponent.length,") "),o(7),N(e.ListComponent)}}function Qe(n,d){if(n&1&&(a(0,"tr"),p(1,Ae,9,7,"td"),p(2,Oe,3,3,"td",25),p(3,Ne,1,1)(4,Be,1,1),p(5,ke,3,3,"td",25),p(6,He,3,3,"td",25),r(),p(7,Re,16,1,"tr")),n&2){let e=d.$implicit,i=l();o(),s(i.column.VariantName&&i.column.VariantName.selected?1:-1),o(),s(i.column.OnHand&&i.column.OnHand.selected?2:-1),o(),s(i.totalIndirect()>0?3:4),o(2),s(i.column.IndirectAllocated&&i.column.IndirectAllocated.selected&&i.totalIndirect()>0?5:-1),o(),s(i.column.Available&&i.column.Available.selected?6:-1),o(),s(i.displayExpandedRow(e.VariantID)&&i.column.VariantName&&i.column.VariantName.selected?7:-1)}}function Ge(n,d){if(n&1){let e=S();a(0,"div")(1,"POS-complex-pagination",38),D("jumpToPage",function(){C(e);let t=l();return u(t.getListData())})("previousPage",function(){C(e);let t=l();return u(t.getListData())})("nextPage",function(){C(e);let t=l();return u(t.getListData())}),r()()}if(n&2){let e=l();o(),x("total",e.data().Data.length)("pageData",e.pageData())}}var he=class n extends le{constructor(e,i,t,m,I){super(e,i,"inventory/GetListInventoryComposite","inventoryloader/GetListInventoryComposite",t,void 0,!1);this.httpService=i;this.csvConverter=m;this.roleService=I;B(()=>{let g=this.totalIndirect();g!==null&&g<=0&&(console.log("Indirect allocation is zero or negative"),this.column=P(T({},this.column),{DirectAllocated:P(T({},this.column.DirectAllocated),{name:"Allocated"}),IndirectAllocated:P(T({},this.column.IndirectAllocated),{show:!1})}))})}column={VariantName:{selected:!0,name:"Name",show:!0},OnHand:{selected:!0,name:"On Hand",show:!0},DirectAllocated:{selected:!0,name:"Direct Allocated",show:!0},IndirectAllocated:{selected:!0,name:"Indirect Allocated",show:!0},Available:{selected:!0,name:"Available",show:!0}};totalIndirect=O(null);expandedRow=O([]);dialog=W(ce);afterPostInit(e){console.log("Composite Inventory Data",e);let i=e.Data.reduce((t,m)=>t+m.IndirectAllocated,0);console.log("Total Indirect Allocated:",i),this.totalIndirect.set(i)}sortData(e){let i=[...this.data().Data];if(!e.active||e.direction===""){this.infiniteList=i;return}this.infiniteList=i.sort((t,m)=>{let I=e.direction==="asc";return this.compare(t[e.active],m[e.active],I)})}openExportModal(){this.dialog.open(pe,{data:{title:"Composite Inventory",exportTypes:[{ID:"inventoryExport/GetExportInventoryComposite",Value:"Default",FileName:"Composite Inventory"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"inventory/GetCountInventoryComposite",pagination:!0}})}onExpand(e){e?.VariantID&&this.expandedRow.update(i=>i.includes(e.VariantID)?i.filter(t=>t!==e.VariantID):[...i,e.VariantID])}displayExpandedRow(e){return this.expandedRow().includes(e)}static \u0275fac=function(i){return new(i||n)(h(se),h(te),h(U),h(_e),h(ne))};static \u0275cmp=k({type:n,selectors:[["pos-composite-inventory"]],features:[H],decls:21,vars:12,consts:[["pageFilterTemplate",""],["tooltipTitle","Identify and manage unsold inventory that has been stagnant for a long time",3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","column"],["ngProjectAs","actions",5,["actions"]],[1,"btn","btn-outline-secondary","me-3"],["ngProjectAs","filters",5,["filters"]],["ngProjectAs","content",5,["content"]],[1,"container-fluid","mt-3"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],["mat-sort-header","VariantName",2,"width","35%"],["mat-sort-header","OnHand",1,"text-right-sort",2,"width","10%"],["mat-sort-header","DirectAllocated",1,"text-right-sort",2,"width","10%"],["mat-sort-header","IndirectAllocated",1,"text-right-sort",2,"width","10%"],["mat-sort-header","Available",1,"text-right-sort",2,"width","10%"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"d-flex","flex-column","gap-4"],["placeholder","Choose Outlets (Leave Blank to Choose All)",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["placeholder","Choose Brand",1,"w-100",3,"ngModelChange","ngModel","multiple","clearable"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Tag",3,"ngModelChange","items","ngModel"],[1,"d-flex","align-items-center",2,"column-gap","8px"],["type","number","name","QuantityFrom",1,"form-control","input-filter",3,"ngModelChange","ngModel"],["type","number","name","QuantityTo",1,"form-control","input-filter",3,"ngModelChange","ngModel"],[1,"text-end"],[1,"d-flex","align-items-center"],[1,"btn","btn-sm","expand-btn"],[3,"routerLink","queryParams"],[1,"btn","btn-sm","expand-btn",3,"click"],[1,"fa","fa-chevron-down",3,"ngClass"],["colspan","100%",2,"padding-left","50px"],[1,"table","border-bottom",2,"width","100%"],[2,"background-color","#f5f5f5"],[1,"text-muted"],[2,"width","55%","color","#3b3b3b"],[2,"color","#3b3b3b"],[2,"text-align","right !important","color","#3b3b3b"],["api","inventory/GetCountInventoryComposite",3,"jumpToPage","previousPage","nextPage","total","pageData"]],template:function(i,t){if(i&1){let m=S();a(0,"mainpanel-cmp",1),v("textChange",function(g){return C(m),f(t.pageData().Filter.SearchText,g)||(t.pageData().Filter.SearchText=g),u(g)}),D("onSubmit",function(){return t.searchFromPageOne()}),v("filterChange",function(g){return C(m),f(t.pageData().Filter,g)||(t.pageData().Filter=g),u(g)}),E(1,2),p(2,we,3,0,"button",3),M(),E(3,4),j(4,be,23,11,"ng-template",null,0,G),M(),E(6,5),a(7,"div",6)(8,"div",7)(9,"table",8),D("matSortChange",function(g){return t.sortData(g)}),a(10,"thead",9)(11,"tr"),p(12,Te,2,1,"th",10),p(13,Pe,2,1,"th",11),p(14,Ve,2,1,"th",12),p(15,Ee,2,1,"th",13),p(16,Me,2,1,"th",14),r()(),a(17,"tbody"),L(18,Qe,8,6,null,null,Q),r()()(),p(20,Ge,2,2,"div"),r(),M(),r()}i&2&&(x("pageData",t.menuData()),y("text",t.pageData().Filter.SearchText),x("isFilterOnDropdown",!1),y("filter",t.pageData().Filter),x("column",t.column),o(2),s(t.roleService.global.Export?2:-1),o(10),s(t.column.VariantName&&t.column.VariantName.selected?12:-1),o(),s(t.column.OnHand&&t.column.OnHand.selected?13:-1),o(),s(t.column.DirectAllocated&&t.column.DirectAllocated.selected?14:-1),o(),s(t.column.IndirectAllocated&&t.column.IndirectAllocated.selected&&t.totalIndirect()>0?15:-1),o(),s(t.column.Available&&t.column.Available.selected?16:-1),o(2),N(t.infiniteList),o(2),s(t.data()?20:-1))},dependencies:[ue,Ce,ye,xe,ee,X,$,Y,Z,de,me,ie,ge,ve,fe,J,q,K,re,oe,ae,Ie,z],styles:["[_nghost-%COMP%]{display:block}.expand-btn[_ngcontent-%COMP%]{border-radius:100px;width:30px;height:30px;transition:all .3s ease;padding:0;transform:rotate(270deg)}.expand-btn[_ngcontent-%COMP%]:hover{background-color:#eaeaea}.expand-btn[_ngcontent-%COMP%]:focus{border:none;outline:none}.expanded-icon[_ngcontent-%COMP%]{transform:rotate(90deg)}[_nghost-%COMP%] .text-right-sort .mat-sort-header-container{display:flex;justify-content:end}th.mat-header-cell[_ngcontent-%COMP%], td.mat-cell[_ngcontent-%COMP%]{text-align:right}"],changeDetection:0})};export{he as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ae}from"./chunk-WKBDCRMS.js";import{p as ie}from"./chunk-H3FZHPK5.js";import{b as K,c as U}from"./chunk-PY7UTEHG.js";import{a as te}from"./chunk-3JF6BHHX.js";import{a as X}from"./chunk-
|
|
1
|
+
import{a as ae}from"./chunk-WKBDCRMS.js";import{p as ie}from"./chunk-H3FZHPK5.js";import{b as K,c as U}from"./chunk-PY7UTEHG.js";import{a as te}from"./chunk-3JF6BHHX.js";import{a as X}from"./chunk-7VSRE3H5.js";import{b as Z}from"./chunk-TATP2XII.js";import{g as ee}from"./chunk-4MYITUBP.js";import{a as $}from"./chunk-7WJ7N33E.js";import{c as Y}from"./chunk-7HKIQJO2.js";import{h as G,o as Q}from"./chunk-TG23CQGV.js";import{b as J}from"./chunk-76THZNK6.js";import{n as H,q as z}from"./chunk-FWVQ6CFL.js";import{Ab as g,Ac as N,Bb as r,Cb as n,Cc as h,Db as k,Ec as x,Ic as O,Kd as A,Mb as f,Nd as q,Pb as v,Ra as l,Rb as m,Ya as C,ab as b,ec as o,fb as I,fc as T,gb as W,gc as R,jc as u,kc as S,lc as y,nd as j,pa as s,qa as d,tb as L,vb as E,xb as M,xc as B,yb as V,zb as P}from"./chunk-KYVLS64M.js";import{a as w,b as F}from"./chunk-KMHZKFQS.js";var ne=(p,c,t,a,e,i)=>({LogisticServiceID:p,EntityID:c,From:t,To:a,StartTime:e,EndTime:i}),oe=(p,c,t)=>({From:p,To:c,LogisticsServiceID:t});function pe(p,c){if(p&1){let t=f();r(0,"button",4),v("click",function(){s(t);let e=m();return d(e.openExportModal())}),k(1,"i",5),o(2," Export "),n()}}function le(p,c){if(p&1){let t=f();r(0,"div",6)(1,"h6"),o(2,"Outlet"),n(),r(3,"outlet-selector",7),y("ngModelChange",function(e){s(t);let i=m();return S(i.pageData().Filter.EntityID,e)||(i.pageData().Filter.EntityID=e),d(e)}),n(),r(4,"h6"),o(5,"From"),n(),r(6,"datepicker",8),y("dateChange",function(e){s(t);let i=m();return S(i.pageData().Filter.From,e)||(i.pageData().Filter.From=e),d(e)}),n(),r(7,"h6"),o(8,"To"),n(),r(9,"datepicker",9),y("dateChange",function(e){s(t);let i=m();return S(i.pageData().Filter.To,e)||(i.pageData().Filter.To=e),d(e)}),n(),r(10,"h6"),o(11,"Time"),n(),r(12,"div",10)(13,"div",11)(14,"app-timepicker",12),y("timeChange",function(e){s(t);let i=m();return S(i.pageData().Filter.StartTime,e)||(i.pageData().Filter.StartTime=e),d(e)}),n()(),r(15,"div",11)(16,"app-timepicker",12),y("timeChange",function(e){s(t);let i=m();return S(i.pageData().Filter.EndTime,e)||(i.pageData().Filter.EndTime=e),d(e)}),n()()()()}if(p&2){let t,a=m();l(3),g("accessType",2),u("ngModel",a.pageData().Filter.EntityID),g("outlets",(t=a.pageData().Options)==null?null:t.Entities),l(3),u("date",a.pageData().Filter.From),l(3),u("date",a.pageData().Filter.To),l(5),g("fullWidth",!0),u("time",a.pageData().Filter.StartTime),l(2),g("fullWidth",!0),u("time",a.pageData().Filter.EndTime)}}function me(p,c){if(p&1&&(r(0,"tr")(1,"td"),o(2),n(),r(3,"td"),o(4),n(),r(5,"td",21)(6,"a",22),h(7,"date"),h(8,"date"),o(9),n()(),r(10,"td",21)(11,"a",23),h(12,"date"),h(13,"date"),o(14),n()(),r(15,"td",21),o(16),n()()),p&2){let t=c.$implicit,a=c.$index,e=m(2);l(2),T(a+1),l(2),T(t.Name),l(2),g("queryParams",N(19,ne,t.ID,e.pageData().Filter.EntityID,x(7,7,e.pageData().Filter.From,"yyyy-MM-dd"),x(8,10,e.pageData().Filter.To,"yyyy-MM-dd"),e.pageData().Filter.StartTime,e.pageData().Filter.EndTime)),l(3),R(" ",t.Trans," "),l(2),g("queryParams",B(26,oe,x(12,13,e.pageData().Filter.From,"yyyy-MM-dd"),x(13,16,e.pageData().Filter.To,"yyyy-MM-dd"),t.ID)),l(3),R(" ",t.Qty," "),l(2),T(t.Weight)}}function ce(p,c){if(p&1){let t=f();r(0,"content")(1,"div",13)(2,"table",14),v("matSortChange",function(e){s(t);let i=m();return d(i.sortData(e))}),r(3,"thead",15)(4,"tr")(5,"th",16),o(6,"No"),n(),r(7,"th"),o(8,"Logistics Service Name"),n(),r(9,"th",17),o(10,"Trans"),n(),r(11,"th",18),o(12,"Qty"),n(),r(13,"th",19),o(14," Weight "),r(15,"small",20),o(16,"(gram)"),n()()()(),r(17,"tbody"),V(18,me,17,30,"tr",null,M),n()()()()}if(p&2){let t=m();l(18),P(t.data().Data)}}var re=class p extends X{constructor(t,a,e,i,D,_){super(t,a,"Report/GetLogisticsService","ReportLoader/GetLogisticsService",e,i);this.matDialog=D;this.roleService=_}originalData=[];postInit(t){this.originalData=t.Data}sortData(t){let a=this.data().Data.slice();if(!t.active||t.direction===""){this.data.update(i=>F(w({},i),{Data:this.originalData}));return}let e=a.sort((i,D)=>this.compare(i[t.active],D[t.active],t.direction==="asc"));this.data.update(i=>F(w({},i),{Data:e}))}openExportModal(){this.matDialog.open(Z,{data:{title:"Logistic Service",exportTypes:[{ID:"ReportExport/LogisticService",Value:"Default",FileName:"Logistics Service"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!1}})}onChangeTime(t,a){let e=t.toTimeString().split(" ")[0].slice(0,5);this.pageData().Filter[a]=e}static \u0275fac=function(a){return new(a||p)(C($),C(z),C(H),C(A),C(Y),C(J))};static \u0275cmp=b({type:p,selectors:[["POS-logistics-service-report"]],standalone:!1,features:[I],decls:9,vars:6,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],["routerLink","/menu/Logistics/Report/Outbound/Logistics_Service/Detail",1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6"],[3,"timeChange","fullWidth","time"],[1,"container-fluid","mt-5"],["id","tableGrid","matSort","",1,"table",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","50px"],["mat-sort-header","Trans",1,"align-right"],["mat-sort-header","Qty",1,"align-right"],["mat-sort-header","Weight",1,"align-right",2,"width","180px"],[1,"fst-italic","text-dark"],[1,"text-end"],["routerLink","/menu/Logistics/Report/Outbound/Logistics_Service/Detail",3,"queryParams"],["routerLink","/menu/Reports/Sales_Report/Standard/Products_Sold",3,"queryParams"]],template:function(a,e){if(a&1){let i=f();r(0,"mainpanel-cmp",1),y("textChange",function(_){return s(i),S(e.pageData().Filter.Name,_)||(e.pageData().Filter.Name=_),d(_)}),v("onSubmit",function(){return e.searchFromPageOne()}),y("filterChange",function(_){return s(i),S(e.pageData().Filter,_)||(e.pageData().Filter=_),d(_)}),r(1,"actions"),L(2,pe,3,0,"button",2),r(3,"a",3),o(4," View Detail "),n()(),r(5,"filters"),W(6,le,17,9,"ng-template",null,0,O),n(),L(8,ce,20,0,"content"),n()}a&2&&(g("pageData",e.menuData()),u("text",e.pageData().Filter.Name),g("isFilterOnDropdown",!1),u("filter",e.pageData().Filter),l(2),E(e.roleService.global.Export?2:-1),l(6),E(e.data()?8:-1))},dependencies:[q,G,Q,ee,ie,K,U,ae,te,j],encapsulation:2,changeDetection:0})};export{re as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as J}from"./chunk-AW2DQQHL.js";import{a as G}from"./chunk-DLFAOP72.js";import{g as Y,h as z}from"./chunk-
|
|
1
|
+
import{a as J}from"./chunk-AW2DQQHL.js";import{a as G}from"./chunk-DLFAOP72.js";import{g as Y,h as z}from"./chunk-4MYITUBP.js";import"./chunk-N64OVQIJ.js";import{a as U}from"./chunk-7WJ7N33E.js";import"./chunk-YBYU2NPK.js";import"./chunk-Y6PUTPXJ.js";import"./chunk-36WVG2RH.js";import"./chunk-NKXJK5OA.js";import"./chunk-YCVG7SEH.js";import"./chunk-P2FAKIKL.js";import"./chunk-IJDHU46P.js";import"./chunk-IQFUVZ6Y.js";import"./chunk-MQW2LRVQ.js";import"./chunk-ZFSMBBTC.js";import"./chunk-YNQPX5G6.js";import"./chunk-2QKUYPUO.js";import"./chunk-D3X6KJJL.js";import"./chunk-7HKIQJO2.js";import"./chunk-GXXXD7U4.js";import"./chunk-TECQKS2T.js";import{a as A}from"./chunk-SY5NNN4M.js";import"./chunk-ZIR7IDMB.js";import"./chunk-ONJ4E7DL.js";import"./chunk-IIFF2GRQ.js";import"./chunk-UNE3K3SG.js";import"./chunk-PDGCWLMX.js";import"./chunk-TG23CQGV.js";import"./chunk-54HOVQAO.js";import"./chunk-Q6BIHZIC.js";import"./chunk-PRQZ2TZC.js";import{b as k}from"./chunk-76THZNK6.js";import"./chunk-PTRS3UA6.js";import"./chunk-B7ER7DPN.js";import{q}from"./chunk-FWVQ6CFL.js";import{Ab as d,Bb as a,Cb as n,Cc as v,Db as c,Dc as N,Ec as _,Kd as B,Nd as $,Pd as j,Ra as r,Rb as f,W as b,Ya as S,_ as M,ab as D,ca as E,ec as l,fb as P,gc as C,la as I,ld as O,mc as L,nc as R,nd as H,oc as s,r as g,s as h,sd as w,tb as u,uc as T,vb as p,vc as V}from"./chunk-KYVLS64M.js";import{a as F,b as y}from"./chunk-KMHZKFQS.js";var Q=()=>["/menu/Logistics/Setup/Courier/Form"],W=t=>({ID:t});function X(t,m){if(t&1&&(a(0,"a",1),c(1,"i",16),l(2,"Edit"),n()),t&2){f();let e=s(0);d("routerLink",T(2,Q))("queryParams",V(3,W,e==null||e.Form==null?null:e.Form.ID))}}function Z(t,m){if(t&1&&l(0),t&2){f(2);let e=s(0);C(" / ",e.Form.Creator," ")}}function ee(t,m){if(t&1&&(l(0),v(1,"date"),u(2,Z,1,1)),t&2){f();let e=s(0);C(" ",_(1,2,e.Form.Created,"dd MMM yyyy HH:mm")," "),r(2),p(!(e==null||e.Form==null)&&e.Form.Creator?2:-1)}}function te(t,m){t&1&&l(0," - ")}function ie(t,m){if(t&1&&l(0),t&2){f(2);let e=s(0);C(" / ",e.Form.Modifier," ")}}function ne(t,m){if(t&1&&(a(0,"span",15)(1,"b"),l(2,"Modified:"),n(),l(3),v(4,"date"),u(5,ie,1,1),n()),t&2){f();let e=s(0);r(3),C(" ",_(4,2,e==null||e.Form==null?null:e.Form.Modified,"dd MMM yyyy HH:mm")," "),r(2),p(!(e==null||e.Form==null)&&e.Form.Modified&&(!(e==null||e.Form==null)&&e.Form.Modifier)?5:-1)}}var K=class t extends G{constructor(e,o){super(e);this.pageSetupService=e;this.role=o;this.initCourierInfo()}httpService=I(q);activeRoute=I(B);courierInfo$;ngOnInit(){}initCourierInfo(){this.courierInfo$=h([this.menuData$,this.activeRoute.queryParams]).pipe(M(([e,o])=>this.httpService.get(`${A.GetCourierInfo}/${o.ID}`)),g(e=>{let o=e?.Form?.EntityName?e?.Form?.EntityName?.join(", "):"";return e.Form=y(F({},e.Form),{Entity:o}),e}),E(e=>{this.menuData.update(o=>y(F({},o),{H:e?.PageTitle||"Courier Info"}))}),b(1))}static \u0275fac=function(o){return new(o||t)(S(U),S(k))};static \u0275cmp=D({type:t,selectors:[["app-courier-info"]],features:[P],decls:32,vars:12,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown"],["role","button","matTooltipPosition","above","matTooltip","Edit",1,"btn","btn-outline-secondary","me-3",3,"routerLink","queryParams"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-6"],[1,"form-floating-outline"],["labelValue","Name",3,"inputValue"],["labelValue","Suspend",3,"inputValue"],["labelValue","Destination Outlet Filter",3,"inputValue"],[1,"alert","alert-warning"],["aria-hidden","true",1,"fa","fa-file-text-o"],[1,"ms-3"],["aria-hidden","true",1,"fa-solid","fa-pen-to-square","me-3"]],template:function(o,x){if(o&1&&(L(0),v(1,"async"),a(2,"mainpanel-cmp",0)(3,"actions"),u(4,X,3,5,"a",1),n(),a(5,"content")(6,"div",2)(7,"div",3)(8,"div",4)(9,"div",5)(10,"div",6)(11,"h3"),l(12,"General"),n()(),a(13,"div",7)(14,"div",3)(15,"div",8)(16,"div",9),c(17,"lib-info-page-input",10),n()(),a(18,"div",8)(19,"div",9),c(20,"lib-info-page-input",11),n()(),a(21,"div",8)(22,"div",9),c(23,"lib-info-page-input",12),n()()()()()()(),a(24,"div",13),c(25,"i",14),a(26,"span")(27,"b"),l(28,"Created: "),n(),u(29,ee,3,5)(30,te,1,0),n(),u(31,ne,6,5,"span",15),n()()()()),o&2){let i=R(N(1,9,x.courierInfo$));r(2),d("pageData",x.menuData())("hideSearchBox",!0)("hideSearchDropdown",!0),r(2),p(x.role.logistic.Edit?4:-1),r(13),d("inputValue",i==null||i.Form==null?null:i.Form.Name),r(3),d("inputValue",!(i==null||i.Form==null)&&i.Form.Bin?"Yes":"No"),r(3),d("inputValue",i==null||i.Form==null?null:i.Form.Entity),r(6),p(!(i==null||i.Form==null)&&i.Form.Created?29:30),r(2),p(!(i==null||i.Form==null)&&i.Form.Modified?31:-1)}},dependencies:[w,z,Y,j,$,J,O,H],encapsulation:2,changeDetection:0})};export{K as CourierInfoComponent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as je,b as ue}from"./chunk-CIYYKTGC.js";import{a as Et}from"./chunk-RN23PFKE.js";import{a as $i}from"./chunk-
|
|
1
|
+
import{a as je,b as ue}from"./chunk-CIYYKTGC.js";import{a as Et}from"./chunk-RN23PFKE.js";import{a as $i}from"./chunk-HJXUNR54.js";import{a as Ui}from"./chunk-JNLCCDNH.js";import{a as Be,b as Bi,d as xt,e as ji,g as ce,j as Fi,k as E,l as F,m as G}from"./chunk-XVYH5K2K.js";import{b as te}from"./chunk-NH6IWUZH.js";import{b as ot,c as $}from"./chunk-NZXJPRXS.js";import{a as Tt,b as wt,c as Pe}from"./chunk-BNOFJMNK.js";import{a as Li}from"./chunk-Q6FAFWIG.js";import{l as Ni,p as Hi}from"./chunk-H3FZHPK5.js";import{d as Ai}from"./chunk-JBDSWIIY.js";import{a as It}from"./chunk-AE4VC5SW.js";import{b as li,c as Rt,h as Qi}from"./chunk-36WVG2RH.js";import{F as Mt,n as ki,t as Vi}from"./chunk-2QKUYPUO.js";import{a as be}from"./chunk-QSEKGLC7.js";import{a as _t,b as Mi,c as Ot}from"./chunk-DCS4THVW.js";import{a as X,b as de,c as Y}from"./chunk-7HKIQJO2.js";import{a as j,b as Ii}from"./chunk-GXXXD7U4.js";import{o as Ei}from"./chunk-TECQKS2T.js";import{a as H}from"./chunk-SY5NNN4M.js";import{a as He,b as Z,c as ae}from"./chunk-ZIR7IDMB.js";import{E as Ti,F as wi,c as oe,e as Ri,h as re,l as Ve,o as De,q as xi,s as Qe}from"./chunk-TG23CQGV.js";import{a as p}from"./chunk-PTRS3UA6.js";import{n as w,q as ne}from"./chunk-FWVQ6CFL.js";import{Ab as _,Bb as s,C as J,Cb as l,Cc as P,Db as Q,Dc as N,Dd as _i,Eb as O,Ec as tt,Fb as M,Fc as St,G as Xe,Gb as ft,K as we,L as yi,Lc as A,Mb as q,Md as Oi,N as Si,O as Ee,Pb as T,Pc as Pi,Qc as it,Ra as m,Rb as C,Uc as bt,Vb as vt,Wb as Ct,Xb as yt,Ya as D,Z as ut,_ as ee,aa as ht,ab as U,ac as Di,ca as z,d as se,dc as et,e as xe,ec as c,fc as y,fd as Dt,gc as ve,ha as v,hc as si,i as Te,jc as Ce,k as fi,ka as d,kc as ye,l as fe,la as g,lc as Se,ld as Ae,m as pt,mc as ci,n as mt,nd as Pt,p as vi,pa as k,pb as bi,pd as B,qa as V,r as L,s as dt,sd as ke,t as Ci,tb as R,vb as x,vc as ie,wb as gt,xb as Ne,yb as pe,za as S,zb as me}from"./chunk-KYVLS64M.js";import{a as ct,j as lt}from"./chunk-KMHZKFQS.js";var Me=(f=>(f[f.IsNew=0]="IsNew",f[f.IsComplete=1]="IsComplete",f[f.IsEdit=2]="IsEdit",f[f.isPark=3]="isPark",f[f.IsRetrieve=4]="IsRetrieve",f[f.IsSplit=5]="IsSplit",f[f.IsBill=6]="IsBill",f[f.IsReturn=7]="IsReturn",f[f.IsUndo=8]="IsUndo",f[f.UploadOrderFail=9]="UploadOrderFail",f))(Me||{});var rt=class{ID;Code;EntityID;Name;Description;Start;StartDisplay;State;Open;CashierID;OpeningCash;EntityName;LoginID;Active;CustomerDisplayEnabled;OvoConfigurationID;CustomerDisplayID;ListImage;Suspended};var Nt=class n{odsConfigType=S(0);setODSConfig(e){this.odsConfigType.set(e)}isEnabled(){return this.odsConfigType()>0}static \u0275fac=function(t){return new(t||n)};static \u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"})};var mo=["searchInputRef"],uo=n=>({active:n}),ho=n=>({gray:n});function go(n,e){if(n&1){let t=q();s(0,"span",16),T("click",function(o){k(t);let r=C().$implicit;return C().closeRegister(r),V(o.stopPropagation())}),l()}}function fo(n,e){n&1&&(s(0,"div")(1,"span",17),c(2,"VACANT"),l()())}function vo(n,e){if(n&1&&(s(0,"div")(1,"span",18),Q(2,"i",19),s(3,"span",20),c(4),l()(),s(5,"span",21),Q(6,"i",22),s(7,"span",20),c(8),l()()()),n&2){let t=C().$implicit;m(4),y(t.LoginID),m(4),ve("",t.StartDisplay.split(" ")[3]," - Now")}}function Co(n,e){if(n&1){let t=q();s(0,"div",9)(1,"div",10)(2,"div",11)(3,"h5",12),T("click",function(){let o=k(t).$implicit,r=C();return V(r.select(o))}),s(4,"span"),Q(5,"i",13),c(6),P(7,"limitTo"),l(),R(8,go,1,0,"span",14),l(),s(9,"div",15),T("click",function(){let o=k(t).$implicit,r=C();return V(r.select(o))}),R(10,fo,3,0,"div")(11,vo,9,2,"div"),l()()()()}if(n&2){let t,i=e.$implicit,o=C();m(),_("ngClass",i.Active?"active":""),m(),_("ngClass",ie(9,uo,(i==null?null:i.ID)==(o.selectedRegister==null?null:o.selectedRegister.ID))),m(),_("ngClass",ie(11,ho,i!=o.selectedRegister)),m(3),y(tt(7,6,i.Name,15)),m(2),x(i.State!="Close"?8:-1),m(2),x((t=i.State)==="Close"?10:t==="Open"?11:-1)}}var At=class n{constructor(e,t,i,o,r,a,u){this._dialogRef=e;this._outletService=t;this._posService=i;this._userRoleService=o;this.router=r;this.httpService=a;this._odsService=u}searchInputRef;originalSelectedRegister=null;registers;searchInput="";selectedRegister=new rt;modalConfig=S(new Z);role;get AppConfigJSON(){return this._posService.Data.AppConfigJSON}destroy$=new se;ngOnInit(){this.initModalConfig(),this.subscribeToObsChanges()}ngAfterViewInit(){this.searchInputRef&&this._dialogRef.afterOpened().subscribe(()=>{setTimeout(()=>{this.searchInputRef.nativeElement.focus()},200)})}subscribeToObsChanges(){this._posService.Data$.pipe(ht(this.destroy$)).subscribe(e=>{this.registers=e.Registers}),this._outletService.Data$.pipe(ht(this.destroy$)).subscribe(e=>{this.selectedRegister=this.findOutletRegisterById(e.RegisterID),this.originalSelectedRegister=this.selectedRegister?ct({},this.selectedRegister):null,this.initModalConfig(!1)}),this._userRoleService.Data$.pipe(ht(this.destroy$)).subscribe(e=>{this.role=e})}findOutletRegisterById(e){let t=this.registers.find(i=>i.ID===e);return t||new rt}initModalConfig(e=!0){this.modalConfig.update(t=>(t.hideFooter=!0,t.hideScrollbar=!0,t.hideClose=e,t.title="Choose an outlet",t))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}onClose(){this._dialogRef.close()}select(e){if(this.AppConfigJSON.ModuleShift.Closure.Enabled)if(this.selectedRegister.ID!=null&&this.selectedRegister.Open&&e.CashierID==null)confirm("You already have an active register with "+this.selectedRegister.Name+`!
|
|
2
2
|
Do you want to end your session?`)&&(this.onClose(),this.router.navigate(["menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}}));else if(!e.Open||this.selectedRegister.ID==e.ID)this.selectedRegister=e,this.onSubmitSelectedRegister();else{if(this.role.SellEditor==!1){alert("You cannot end shift for Register "+e.Name+" - Unauthorized Access");return}alert("This Register has already active register, Are you sure you want to end this register?"),this.onClose(),this.router.navigate(["/menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}})}else this.selectedRegister=e,this.onSubmitSelectedRegister()}onSubmitSelectedRegister(){if(this.selectedRegister.ID==null){alert("Please select a register first!");return}this._outletService.pushNewRegister(this.selectedRegister),this.loadOdsConfig(this.selectedRegister.EntityID),this._dialogRef.close({selectedRegister:this.selectedRegister,openStartingCashDialog:this.selectedRegister.ID!=this.originalSelectedRegister?.ID})}closeRegister(e){let t=this.selectedRegister.ID;if(this.role.SellEditor==!1){alert("You cannot end shift for Register "+e.Name+" - Unauthorized Access");return}t==e.ID?this.router.navigate(["/menu/Shift/Main/My_Shift"]):this.router.navigate(["/menu/Shift/Main/My_Shift"],{queryParams:{RegisterID:e.ID}}),this.onClose()}loadOdsConfig(e){this.httpService.get(`/api/outlet/GetOrderDisplayBroadcastMode?EntityID=${e}`).pipe(z(t=>{this._odsService.setODSConfig(t.form.OrderDisplayBroadcastMode)})).subscribe()}static \u0275fac=function(t){return new(t||n)(D(X),D(K),D(F),D(ue),D(Oi),D(ne),D(Nt))};static \u0275cmp=U({type:n,selectors:[["pos-modal-register"]],viewQuery:function(t,i){if(t&1&&vt(mo,5),t&2){let o;Ct(o=yt())&&(i.searchInputRef=o.first)}},standalone:!1,decls:13,vars:6,consts:[["searchInputRef",""],[3,"onClose","config"],[1,"ms-0","mb-8","search-container",3,"hidden"],[1,"input-group","mb-3","rounded-start-1"],[1,"input-group-text","txtFilter","rounded-end-0"],["aria-hidden","true",1,"fa","fa-magnifying-glass"],["data-cy","SearchOutlet","type","text","placeholder","Filter by Name","aria-label","Search",1,"txtFilter","form-control","border-start-0","rounded-1","rounded-start-0",3,"ngModelChange","ngModel"],[1,"container","custom-scroll"],[1,"row",2,"width","600px"],["data-cy","registers",1,"col-4"],[1,"card","border-0",3,"ngClass"],[1,"card-body","p-0",3,"ngClass"],[1,"card-title","mb-0",3,"click","ngClass"],[1,"fa-solid","fa-house","pe-1","fs-6"],[1,"fa","fa-xmark-circle","fa-lg","position-absolute",2,"text-shadow","0 1px 0 #afafaf","right","5px","top","16px"],[1,"card-text","px-0","py-2",3,"click"],[1,"fa","fa-xmark-circle","fa-lg","position-absolute",2,"text-shadow","0 1px 0 #afafaf","right","5px","top","16px",3,"click"],[1,"idle"],[1,"cashier"],["aria-hidden","true",1,"fa","fa-user","pe-2"],[1,"d-inline"],[1,"open"],["aria-hidden","true",1,"fa-regular","fa-clock","pe-2"]],template:function(t,i){if(t&1){let o=q();s(0,"modal-material",1),T("onClose",function(){return i.onClose()}),s(1,"content")(2,"div",2)(3,"div",3)(4,"span",4),Q(5,"i",5),l(),s(6,"input",6,0),Se("ngModelChange",function(a){return k(o),ye(i.searchInput,a)||(i.searchInput=a),V(a)}),l()()(),s(8,"div",7)(9,"div",8),pe(10,Co,12,13,"div",9,Ne),P(12,"FilterByName"),l()()()()}t&2&&(_("config",i.modalConfig()),m(2),_("hidden",i.registers.length<=6),m(4),Ce("ngModel",i.searchInput),m(4),me(tt(12,3,i.registers,i.searchInput)))},dependencies:[Dt,oe,re,De,ae,ki,Vi],styles:[".text-warning[_ngcontent-%COMP%]{color:var(--bs-warning)!important}.bg-light-gray[_ngcontent-%COMP%]{background-color:var(--bs-light-gray);--bs-bg-opacity: .15 !important}.bg-gradient-danger[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#f8d7da,#f8d7da 15px,#f5c6cb 15px 30px)!important}.bg-gradient-success[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#beeebb,#beeebb 15px,#afeba8 15px 30px)!important}.bg-gradient-warning[_ngcontent-%COMP%]{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important}.bg-light-orange[_ngcontent-%COMP%]{background-color:var(--bs-light-orange);--bs-bg-opacity: .15 !important}.text-danger[_ngcontent-%COMP%]{color:#fb404b!important}.text-dark[_ngcontent-%COMP%]{color:#5e5e5e!important}.text-success[_ngcontent-%COMP%]{color:#87cb16!important}.text-black[_ngcontent-%COMP%]{color:#000!important}.text-white[_ngcontent-%COMP%]{color:var(--bs-white)!important}.btn-light-blue[_ngcontent-%COMP%]{color:#212529;background-color:#dfeffc!important;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:hover{color:#212529;background-color:#bcdef9;border-color:#b0d8f8}.btn-light-blue[_ngcontent-%COMP%]:focus, .btn-light-blue.focus[_ngcontent-%COMP%]{color:#212529;background-color:#bcdef9;border-color:#b0d8f8;box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-blue.disabled[_ngcontent-%COMP%], .btn-light-blue[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#dfeffc;border-color:#dfeffc}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#b0d8f8;border-color:#a5d2f7}.btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-blue[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-blue.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #c3d1dc80}.btn-light-danger[_ngcontent-%COMP%]{color:#212529;background-color:#f8d7da!important;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:hover{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5}.btn-light-danger[_ngcontent-%COMP%]:focus, .btn-light-danger.focus[_ngcontent-%COMP%]{color:#212529;background-color:#f5c2c7;border-color:#f1aeb5;box-shadow:0 0 0 .2rem #dc354540}.btn-light-danger.disabled[_ngcontent-%COMP%], .btn-light-danger[_ngcontent-%COMP%]:disabled{color:#212529;background-color:#f8d7da;border-color:#f8d7da}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]{color:#212529;background-color:#f1aeb5;border-color:#ea868f}.btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled):active:focus, .btn-light-danger[_ngcontent-%COMP%]:not(:disabled):not(.disabled).active:focus, .show[_ngcontent-%COMP%] > .btn-light-danger.dropdown-toggle[_ngcontent-%COMP%]:focus{box-shadow:0 0 0 .2rem #dc354540}.search-container[_ngcontent-%COMP%]{transition:all .3s ease;width:97%}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]{position:relative;transition:all .3s ease;height:2.3rem}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover, .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e4d,0 0 8px 4px #89b03e33;border-radius:4px}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]{transition:all .3s ease;border-left:none!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .txtFilter.form-control[_ngcontent-%COMP%]:focus{box-shadow:none!important;border-color:#ced4da!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .input-group-text[_ngcontent-%COMP%]{transition:all .3s ease;background-color:#fff;border-right:none!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .input-group-text[_ngcontent-%COMP%], .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .input-group-text[_ngcontent-%COMP%]{background-color:#89b03e1a;border-color:#84cc16!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%] .fa-magnifying-glass[_ngcontent-%COMP%]{transition:all .3s ease}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:hover .fa-magnifying-glass[_ngcontent-%COMP%], .search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within .fa-magnifying-glass[_ngcontent-%COMP%]{color:#84cc16!important}.search-container[_ngcontent-%COMP%] .input-group[_ngcontent-%COMP%]:focus-within{box-shadow:0 0 0 2px #89b03e66,0 0 12px 6px #89b03e40!important}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar{width:6px}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-track{background:#f1f1f1;border-radius:3px}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{background:#89b03e;border-radius:3px}.custom-scroll[_ngcontent-%COMP%]::-webkit-scrollbar-thumb:hover{background:#7a9e37}.container[_ngcontent-%COMP%]{overflow-y:auto;overflow-x:hidden;max-height:260px;min-height:150px}.col-4[_ngcontent-%COMP%]{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]{width:180px;min-height:95px;margin-right:17px;margin-bottom:17px;position:relative}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]{display:block;outline:0;border:1px solid #B1AAAA;border-radius:5px;cursor:pointer}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] h5[_ngcontent-%COMP%]{height:30px;border-radius:4px;padding:5px 10px;color:#fff;background:#b1aaaa;overflow:hidden}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] h5[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{margin-right:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]:hover, .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.active[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.vacant[_ngcontent-%COMP%]{background:#ffffe1;border:1px solid #89b03e}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%]:hover > h5[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.active[_ngcontent-%COMP%] > h5[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.vacant[_ngcontent-%COMP%] > h5[_ngcontent-%COMP%]{background:#89b03e}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover{border:1px solid #c9302c}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%], .col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover > h6[_ngcontent-%COMP%]{background:#c9302c!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#c9302c}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.occupied[_ngcontent-%COMP%]:hover{background:#fff}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]{border:1px solid #f6a828}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] > h6[_ngcontent-%COMP%]{background:#f6a828!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]:hover{border:1px solid #f6a828;background:#fff}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%]:hover > strong[_ngcontent-%COMP%]{background:#f6a828!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{background:#f6a828}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body.preparing[_ngcontent-%COMP%] div[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{font-size:.75rem!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%]{height:80px;padding:15px 10px;position:relative}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{display:block;font-weight:400;font-size:.875rem;width:100%;margin-bottom:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:first-child{margin-top:-10px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span[_ngcontent-%COMP%]:last-child{margin-bottom:0}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.alias[_ngcontent-%COMP%]{text-align:center;position:absolute;bottom:0;right:0;width:auto;background-color:#b1aaaa;border-radius:3px;padding:2px 5px;color:#fff;display:none!important}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > .card-body[_ngcontent-%COMP%] div[_ngcontent-%COMP%] span.idle[_ngcontent-%COMP%]{display:block;font-size:1.25rem;text-align:center}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{position:absolute;width:27px;height:28px;cursor:pointer;top:5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#000}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:last-of-type{right:-5px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]:nth-last-of-type(2){right:15px}.col-4[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{bottom:20px;right:5px;position:absolute}.col-4[_ngcontent-%COMP%] .duration[_ngcontent-%COMP%] > span[_ngcontent-%COMP%]{border:1px solid!important;position:absolute;bottom:-3px;left:58px;background:#fff;border-radius:5px}"]})};var So=["inputCash"],Qt=class n{constructor(e,t,i){this.dialogRef=e;this.data=t;this.focusMonitor=i;this.generateModalTitle$.subscribe()}registerService=g(K);loadPOSService=g(F);register=this.registerService.Data;username=this.loadPOSService?.Data?.UserName;amount=S(0);config=new Z;currentRegisterName;generateModalTitle$=this.registerService.Data$.pipe(J(e=>p.IsNotEmpty(e)),z(()=>{let e=this.registerService.getOutletRegister(),t=e?.Name?.length>18?`${e?.Name?.substring(0,18)}...`:e?.Name;this.config.title="Open Shift",this.currentRegisterName=t}),j());today=new Date;inputCashEl;ngOnInit(){this.config.customWidth="350px",this.config.hideCancel=!0}ngAfterViewInit(){this.focusInput(),this.dialogRef.afterOpened().subscribe(()=>{this.focusInput()})}focusInput(){let e=this.inputCashEl?.nativeElement;e&&(this.focusMonitor.focusVia(e,"program"),e.addEventListener("blur",()=>{this.dialogRef.getState()===0&&this.focusMonitor.focusVia(e,"program")}))}onOk(){this.dialogRef.close({amount:this.amount()})}static \u0275fac=function(t){return new(t||n)(D(X),D(de),D(Ei))};static \u0275cmp=U({type:n,selectors:[["POS-modal-opening-cash"]],viewQuery:function(t,i){if(t&1&&vt(So,5),t&2){let o;Ct(o=yt())&&(i.inputCashEl=o.first)}},standalone:!1,decls:25,vars:8,consts:[["inputCash",""],[3,"onOk","onCancel","onClose","config"],[1,"table","fs-5","text"],[1,"py-3"],[1,"text-end","pe-3"],[1,"py-4"],[1,"text-end"],["data-cy","InputCash","autoNum","",1,"border","form-control-lg","text-end","w-100",3,"ngModelChange","ngModel"]],template:function(t,i){if(t&1){let o=q();s(0,"modal-material",1),T("onOk",function(){return i.onOk()})("onCancel",function(){return i.dialogRef.close()})("onClose",function(){return i.dialogRef.close()}),s(1,"content")(2,"table",2)(3,"tr")(4,"td",3),c(5,"Outlet Register"),l(),s(6,"td",4),c(7),l()(),s(8,"tr")(9,"td",5),c(10,"Current User"),l(),s(11,"td",4),c(12),l()(),s(13,"tr")(14,"td",5),c(15,"Starting Time"),l(),s(16,"td",4),c(17),P(18,"date"),l()(),s(19,"tr")(20,"td",3),c(21,"Starting Cash"),l(),s(22,"td",6)(23,"input",7,0),Se("ngModelChange",function(a){return k(o),ye(i.amount,a)||(i.amount=a),V(a)}),l()()()()()()}t&2&&(_("config",i.config),m(7),y(i.currentRegisterName),m(5),y(i.username),m(5),y(tt(18,5,i.today,"EEEE, HH:mm")),m(6),Ce("ngModel",i.amount))},dependencies:[oe,re,De,ae,It,Pt],styles:[".table-title-width[_ngcontent-%COMP%]{width:120px}"]})};var Ht=class{OrderNumberElement;InvoiceNumberElement;NewOrderID};var Le=class n{constructor(e,t,i){this._httpService=e;this._onlineStatusService=t;this._localDataService=i;this._onlineStatusService.getOnlineStatus$().subscribe(o=>{this.isOnline=o})}isOnline;GenerateNumber(e,t){if(this.isOnline)return this._httpService.get(H.GenerateNumber,[{key:"EntityID",value:e},{key:"TypeID",value:1}]);{let i=new Ht;return p.IsNotEmpty(t.NumberElement)&&(t.NumberElement.Seed+=1),p.IsNotEmpty(t.InvoiceNumberElement)&&(t.InvoiceNumberElement.Seed+=1),i.InvoiceNumberElement=t.InvoiceNumberElement,i.OrderNumberElement=t.NumberElement,i.NewOrderID=p.Guid_NewGuid(),fe(i)}}findRegisterById(e){return new Promise(t=>{this._localDataService.isConfigFromServer().subscribe(i=>{i?this._httpService.get(H.GetRegisterInfo,[{key:"RegisterID",value:e}]).subscribe(o=>{t(o)}):this._localDataService.findRegisterByID(e).subscribe(o=>{t(o)})})})}recordOpeningCash(e){return mt(this._httpService.post("/API/POS/RecordOpeningCash",e))}static \u0275fac=function(t){return new(t||n)(d(ne),d(Tt),d(Rt))};static \u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"})};var K=class n{constructor(e,t,i,o,r,a){this._signalRClientService=e;this._matDialog=t;this._posHttpResponseService=i;this._CoreHttpService=o;this._toastrService=r;this._roleService=a}datePipe=g(Pt);_Data=new xe(null);Data$=this._Data.asObservable().pipe(J(e=>e!==null),Ee());get Data(){return this._Data.value}getSalesname(e){return this.Data&&this.Data.ListSales?this._Data.value.ListSales.find(t=>t.ID==e)?.Name:""}setActiveRegisterFromOptions(e,t){let o=this._posHttpResponseService.Data.AppConfigJSON.ModuleShift.Closure.Enabled;if(e.length>1){let r=e.find(a=>a.LoginID==t);if(r)this.pushNewRegister(r);else{let a=this.getOutletRegisterFromLocalStorage(),u=this.Data?.RegisterID?this.Data.RegisterID:a?.ID;e.some(b=>b.ID==u)?o?this.openChooseRegisterModal():this.initRegisterFromLocalStorage():this.openChooseRegisterModal()}}e.length==1&&(this.pushNewRegister(e[0]),p.IsEmpty(e[0].LoginID)&&p.IsEmpty(e[0].CashierID)&&this.openOpeningCashModal(e[0].ID)),e.length==0&&this._toastrService.warning("You do not have access to any OUTLET","Warning")}openChooseRegisterModal(){this._matDialog.open(At,{id:"registerModal",disableClose:!0}).afterClosed().pipe(J(e=>p.IsNotEmpty(e?.selectedRegister))).subscribe(e=>{e.selectedRegister&&this.openOpeningCashModal(e.selectedRegister.ID)})}openOpeningCashModal(e){this._posHttpResponseService.Data.AppConfigJSON.ModuleShift.Closure.Enabled&&this._matDialog.open(Qt,{disableClose:!0,id:"openingCashModal"}).afterClosed().pipe(J(o=>p.IsNotEmpty(o))).subscribe(o=>{let r={RegisterID:e,OpAmount:o.amount};this._CoreHttpService.recordOpeningCash(r).then(()=>{this.updateRegisterList(r),this.initCursorFocus(e)})})}updateRegisterList(e){let i=this._posHttpResponseService.Data.Registers.map(r=>r.ID==e.RegisterID?this.mapRegisterAsActiveRegister(r,e):r),o=this._posHttpResponseService.Data;o.Registers=i,this._posHttpResponseService.pushNewValue(o)}mapRegisterAsActiveRegister(e,t){let i=localStorage.getItem("AccountInfo");if(i){let r=JSON.parse(i);e.LoginID=r.UserName}e.OpeningCash=t.OpAmount,e.Open=!0,e.State="Open";let o=this.datePipe.transform(new Date,"dd MM yyyy HH:mm");return e.StartDisplay=o,e}initRegisterFromLocalStorage(){if(this._roleService.Data.DeleteItem==!1){let t=this.getOutletRegisterFromLocalStorage();t&&this.pushNewRegister(t)}}pushNewRegister(e){let t=this._Data.value,i=t?t.RegisterID:null;i!=e.ID&&this._CoreHttpService.findRegisterById(e.ID).then(o=>{o.RegisterCode=e.Code,o.DefaultPrintTemplate=o.PrintTemplate,o.SplitPaymentEnabled=this.findSplitPaymentConfig(o.EntityID),this._signalRClientService.SubscribeGroup(o.RegisterID,i),this.saveOutletRegisterToLocalStorage(e),this.pushNewValue(o)})}getOutletRegister(){let e=this.Data.RegisterID;return this._posHttpResponseService.Data.Registers.find(o=>o.ID==e)}pushNewValue(e){this._Data.next(e)}saveOutletRegisterToLocalStorage(e){if(this._roleService.Data.DeleteItem==!1){let i=JSON.stringify(e);localStorage.setItem("outlet_register",i)}}getOutletRegisterFromLocalStorage(){let e=this._roleService.Data.DeleteItem,t=localStorage.getItem("outlet_register"),i=null;return t&&(e?localStorage.removeItem("outlet_register"):i=JSON.parse(t)),i}findOutletRegisterById(e){return this._posHttpResponseService.Data.Registers.find(o=>o.ID===e)}findSplitPaymentConfig(e){let i=this._posHttpResponseService.Data.Entities.find(o=>o.ID===e);return i?i.SplitPaymentEnabled:!1}initCursorFocus(e){let t=document.getElementById("product");t&&p.IsNotEmpty(e)&&t.focus()}static \u0275fac=function(t){return new(t||n)(d(be),d(Y),d(F),d(Le),d(w),d(ue))};static \u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"})};var Ue=class{CommissionID;ReturNumber;parkTemporaryItem;posState;InputTextValue;constructor(){this.posState=0,this.CommissionID="",this.ReturNumber="",this.parkTemporaryItem=[],this.InputTextValue=""}};var Bt=class{RegisterID;RegisterCode;EntityID;EntityName;NumberElement;InvoiceNumberElement;ListSales;QuickKeyPack;PrintTemplate;DefaultSalesOrderTag;DefaultTaxType;DefaultWarehouse;MemberPoint;ParkLayoutPack;Promotion;DefaultPrintTemplate;NewOrderID;Payments;SplitPaymentEnabled;constructor(){this.RegisterID=null,this.RegisterCode=null,this.EntityID=null,this.EntityName=null,this.NumberElement=new Be,this.InvoiceNumberElement=new Be,this.Promotion=[],this.SplitPaymentEnabled=!0}};var $e=(a=>(a.Amount="Amount",a.Percentage="Percentage",a.Return="Return",a.ParkedDeletion="ParkedDeletion",a.DeleteItem="DeleteItem",a.FullAccess="FullAccess",a))($e||{});var jt=class n{constructor(e,t,i){this._promotionEventService=e;this._dialogRef=t;this.data=i;this.modalConfig=new Z,this.modalConfig.hideCancel=!0,this.modalConfig.hideClose=!0,this.modalConfig.headerType=He.Warning,this.modalConfig.title="Promotion Requirement unfulfilled!",this.modalConfig.customWidth="350px",this.modalConfig.okText="Ok",this.selectedPromotion=e.selectedPromotion}modalConfig;selectedPromotion;onOk(){this._promotionEventService.restoreOrder(),this._dialogRef.close()}static \u0275fac=function(t){return new(t||n)(D(ge),D(X),D(de))};static \u0275cmp=U({type:n,selectors:[["POS-modal-promotion-confirm"]],standalone:!1,decls:9,vars:4,consts:[[3,"onOk","config"],[1,"fst-italic","text-danger","mb-3"],[1,"mb-0"]],template:function(t,i){t&1&&(s(0,"modal-material",0),T("onOk",function(){return i.onOk()}),s(1,"content")(2,"div")(3,"h5"),c(4),l(),s(5,"p",1),c(6),l(),s(7,"p",2),c(8),l()()()()),t&2&&(_("config",i.modalConfig),m(4),y(i.selectedPromotion==null?null:i.selectedPromotion.Name),m(2),y(i.selectedPromotion==null?null:i.selectedPromotion.Description),m(2),y(i.data==null?null:i.data.message))},dependencies:[ae],encapsulation:2})};var Lt=class extends te{};var Ut=class{Code;Provider;OutletID;Customer;ShoppingCart};var Ge=class n{salesOrderService=g(E);registerService=g(K);customerService=g(Pe);orderCalculator=g(G);generateRedeemCouponDto(e,t){let i=new Ut,o=this.registerService.Data?.EntityID;return i.Code=e,i.Provider=t,i.ShoppingCart={Amount:this.orderCalculator.Data,Items:this.generateItems()},i.OutletID=o,i.Customer=this.generateCustomer(t),i}generateItems(){return this.salesOrderService.Data.CartItems.map(i=>({ItemTemporaryID:i.ItemTemporaryID,Price:i.Price,Quantity:i.Quantity,VariantID:i.VariantID,Code:i?.Variant?.Code,Discount:i.Discount,DiscountAmount:i.DiscountAmount,PriceBookID:i.PriceBookID,UnitPriceOriginal:i.UnitPriceOriginal,UnitPrice:i.UnitPrice,CategoryID:i?.Variant?.CategoryID}))}generateCustomer(e){let t=this.customerService.Data,i=this.salesOrderService?.Data?.Order?.CustomerID,o=null;return p.IsNotEmpty(i)&&(o={Phone:t.Mobile,Email:t.Email},e==="Internal"&&(o=ct({ID:i},o))),o}static \u0275fac=function(t){return new(t||n)};static \u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"})};function Do(n,e){if(n&1&&(s(0,"span",5),c(1),P(2,"number"),l()),n&2){let t=C().$implicit;m(),ve("",N(2,1,t.Amount),"%")}}function Po(n,e){if(n&1&&(s(0,"span",5),c(1),P(2,"number"),l()),n&2){let t=C().$implicit;m(),ve(" -",N(2,1,t.Amount)," ")}}function _o(n,e){}function Oo(n,e){if(n&1){let t=q();s(0,"button",8),T("click",function(){k(t);let o=C().$implicit,r=C();return V(r.onApplyCouponDiscount(o))}),c(1," Apply "),l()}}function Io(n,e){if(n&1&&(s(0,"tr")(1,"td"),c(2),l(),s(3,"td"),c(4),l(),s(5,"td",4),c(6),P(7,"number"),l(),s(8,"td",4),R(9,Do,3,3,"span",5)(10,Po,3,3,"span",5),l(),s(11,"td",6),R(12,_o,0,0)(13,Oo,2,0,"button",7),l()()),n&2){let t=e.$implicit,i=C();m(2),y(t==null?null:t.Name),m(2),y(t==null?null:t.Code),m(2),y(N(7,5,t==null?null:t.Price)),m(3),x((i.coupon==null?null:i.coupon.Type)==i.couponType.Percentage?9:10),m(3),x((t==null?null:t.CouponDiscount)>0?12:13)}}var $t=class n{dialogRef=g(X);coupon=g(de);salesOrderModelService=g(E);config;couponType=$e;itemsOptions=A(()=>{let e=this.salesOrderModelService?.Data?.CartItems,t=this.coupon?.ApplyToProduct??[];return t=t.filter(o=>o.UserOption),t.map(o=>{let r=e.find(a=>a.Variant.ID===o.ID);return r&&(o.Name=r.Variant?.Name,o.Price=r.Variant?.UnitPrice),o})});ngOnInit(){this.initModalConfig()}initModalConfig(){this.config=new Z,this.config.title="Choose Item to Apply Discount",this.config.hideFooter=!0}onApplyCouponDiscount(e){this.dialogRef.close(e)}onClose(){this.dialogRef.close()}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=U({type:n,selectors:[["app-modal-selected-coupon-item-v2"]],decls:17,vars:1,consts:[[3,"onCancel","onClose","config"],[1,"table","table-bordered"],[1,"thead-light"],["scope","col"],[1,"text-end"],[1,"text-danger"],[1,"text-center"],[1,"btn","btn-sm","btn-success"],[1,"btn","btn-sm","btn-success",3,"click"]],template:function(t,i){t&1&&(s(0,"modal-material",0),T("onCancel",function(){return i.onClose()})("onClose",function(){return i.onClose()}),s(1,"content")(2,"table",1)(3,"thead",2)(4,"tr")(5,"th",3),c(6,"Name"),l(),s(7,"th",3),c(8,"Code"),l(),s(9,"th",3),c(10,"Price"),l(),s(11,"th",3),c(12,"Discount"),l(),Q(13,"th",3),l()(),s(14,"tbody"),pe(15,Io,14,7,"tr",null,gt),l()()()()),t&2&&(_("config",i.config),m(15),me(i.itemsOptions()))},dependencies:[ke,Qi,B],encapsulation:2})};var qe=class n{httpService=g(ne);promotionCouponFactoryService=g(Ge);salesOrderService=g(E);userRoleService=g(ue);dialog=g(Y);posConfig=g(F);calculatorService=g(G);toastr=g(w);separateQuantityToNewRow=A(()=>this.posConfig.Data?.AppConfigJSON?.ModuleSell?.PromotionCouponSeparateQuantityToNewRow);_appliedCoupon=S(null);appliedCoupon=A(()=>this._appliedCoupon());salesOrderBeforePromotion=S(null);originalRoleData=A(()=>$(je,this.userRoleService.Data));redeemCoupon(e,t){e=this.trimInputCoupon(e);let i=this.promotionCouponFactoryService.generateRedeemCouponDto(e,"Internal");return this.httpService.post(H.ValidateInternalCouponV2,i).pipe(z(o=>{o.Note=t||"",o.Code=e,this.copyOriginalSalesOrder(),this.applyCoupon(o)}))}trimInputCoupon(e){return p.IsNotEmpty(e)&&(e=e.trim()),e}applyCoupon(e){switch(e.Type){case"Percentage":this.applyDiscountPercentage(e);break;case"Amount":this.applyDiscountAmount(e);break;case"Return":this.handleCouponReturnAccess(e);break;case"DeleteItem":this.handleDeleteItemAccess(e);break;case"ParkedDeletion":this.handleCouponParkedDeletionAccess(e);break;case"FullAccess":this.handleFullAccess(e);break}this._appliedCoupon.set(e)}applyDiscountPercentage(e){let t=e.ApplyToProduct??[];t.some(o=>p.IsNotEmpty(o.UserOption))?this.openDialogSelectItem(e):t.length>0?this.applyDiscountToProduct(e,t):this.applyDiscountToOrder(e)}applyDiscountAmount(e){let t=e.ApplyToProduct??[];t.some(o=>p.IsNotEmpty(o.UserOption))?this.openDialogSelectItem(e):t.length>0?this.applyDiscountToProduct(e,t):this.applyDiscountToOrder(e)}openDialogSelectItem(e){this.dialog.open($t,{data:e}).afterClosed().pipe(J(t=>p.IsNotEmpty(t))).subscribe(t=>{this.applyDiscountToSelectedItem(e,t)})}applyDiscountToSelectedItem(e,t){this._appliedCoupon.update(i=>(i.ApplyToProduct=i.ApplyToProduct.map(o=>(t.ID==o.ID&&(o.SelectedItem=!0),o)),i)),this.applyDiscountToProduct(e,[t])}applyDiscountToOrder(e){let t=this.salesOrderService.Data;switch(e.Type){case"Amount":t.Order.DiscountAmount=e.Amount;break;case"Percentage":let i=this.calculateMaxDiscountInvoice(e);i.type=="amount"?t.Order.DiscountAmount=i.discount:t.Order.Discount=i.discount;break}t.Order.PromotionCoupon=e.Code,t.Order.PromotionNote=e.Note,t.Order.CouponType=1,this.salesOrderService.pushNewValue(t),this.showToastrAppliedCoupon(e)}calculateMaxDiscountInvoice(e){if(e.MaxDiscount>0){let t=e.Amount;return this.calculatorService.Data*t/100>e.MaxDiscount?{discount:e.MaxDiscount,type:"amount"}:{discount:e.Amount,type:"percentage"}}else return{discount:e.Amount,type:"percentage"}}applyDiscountToProduct(e,t){let i=this.salesOrderService.Data,o=i.CartItems,r=[];o=o.map(a=>{let u=this.findPromotionItemByVariantID(a,t);if(u.isMatch){let h=t[u.index];if(this.separateQuantityToNewRow()&&a.Quantity>1&&h.OneFirstOption){let b=this.separateItemQuantityToNewRow(h,a,e);a=b.originalItem,b.separatedItem&&r.push(b.separatedItem)}else{let b=this.calculateOneOfFirstDisc(h,a.Quantity);h.Amount=b,a=this.applyDiscountToItem(a,h,e)}}return a}),o=o.concat(r),i.CartItems=o,i.Order.PromotionCoupon=e.Code,i.Order.PromotionNote=e.Note,i.Order.CouponType=1,this.salesOrderService.pushNewValue(i),this.showToastrAppliedCoupon(e)}separateItemQuantityToNewRow(e,t,i){let o=t.Quantity,r=$(te,t);return o>1?(t.Quantity=o-1,r.Quantity=1,r=this.applyDiscountToItem(r,e,i)):t=this.applyDiscountToItem(t,e,i),{originalItem:t,separatedItem:r}}calculateOneOfFirstDisc(e,t){let i=e.Amount;return e.OneFirstOption&&(i=e.Amount/t),i}applyDiscountToItem(e,t,i){switch(i.Type){case"Amount":e.DiscountAmount=t.Amount;break;case"Percentage":if(i.MaxDiscount>0)if(this.calculateDiscountItem(e,t.Amount)>i.MaxDiscount){let r=i.MaxDiscount/e.Quantity;e.DiscountAmount=r}else e.Discount=t.Amount;else e.Discount=t.Amount;break}return e}calculateDiscountItem(e,t){return e.Price*e.Quantity*t/100}findPromotionItemByVariantID(e,t){let i=t.findIndex(o=>o.ID==e.VariantID&&o.ItemTemporaryID==e.ItemTemporaryID);return{isMatch:i>-1,index:i}}handleCouponReturnAccess(e){let t=$(je,this.originalRoleData());t.Return=!0,this.userRoleService.pushNewValue(t),this.applyCouponToSalesOrder(e)}handleDeleteItemAccess(e){let t=$(je,this.originalRoleData());t.DeleteItem=!0,this.userRoleService.pushNewValue(t),this.applyCouponToSalesOrder(e)}handleCouponParkedDeletionAccess(e){let t=$(je,this.originalRoleData());t.ParkedDeletionAuthorized=!0,this.userRoleService.pushNewValue(t),this.applyCouponToSalesOrder(e)}handleFullAccess(e){let t=$(je,this.originalRoleData());t.UnitPriceEditor=!0,t.Discount=!0,t.Return=!0,t.Tax=!0,t.NumberEditor=!0,t.DateEditor=!0,t.PricebookSelector=!0,t.DeleteItem=!0,t.ParkedDeletionAuthorized=!0,this.userRoleService.pushNewValue(t),this.applyCouponToSalesOrder(e)}resetCouponOnNewTransaction(){this.userRoleService.pushNewValue(this.originalRoleData()),this._appliedCoupon.set(null)}setCouponOnEdit(e){e&&p.IsNotEmpty(e?.Type)&&(this._appliedCoupon.set(e),this.generateOriginalSalesOrderOnEdit())}generateOriginalSalesOrderOnEdit(){let e=$(ce,this.salesOrderService.Data);e.Order.PromotionCoupon=null,e.Order.PromotionNote=null,e.Order.Discount=0,e.Order.DiscountAmount=0,this.salesOrderBeforePromotion.set(e)}removeAppliedCoupon(){this.salesOrderService.pushNewValue(this.salesOrderBeforePromotion()),this.appliedCoupon().Type!="Amount"&&this.appliedCoupon().Type!="Percentage"&&this.userRoleService.pushNewValue(this.originalRoleData()),this._appliedCoupon.set(null),this.salesOrderBeforePromotion.set(null)}copyOriginalSalesOrder(){let e=$(ce,this.salesOrderService.Data);this.salesOrderBeforePromotion.set(e)}applyCouponToSalesOrder(e){let t=this.salesOrderService.Data;t.Order.PromotionCoupon=e.Code,t.Order.PromotionNote=e.Note,t.Order.CouponType=1,this.salesOrderService.pushNewValue(t),this.showToastrAppliedCoupon(e)}showToastrAppliedCoupon(e){e.Notification?this.toastr.success(e.Notification,"Coupon Applied"):this.toastr.success("Coupon applied successfully!","Coupon Applied")}static \u0275fac=function(t){return new(t||n)};static \u0275prov=v({token:n,factory:n.\u0275fac,providedIn:"root"})};var We=class n{constructor(e,t,i,o,r,a,u,h,b,f){this.variantService=e;this._posService=t;this._orderDataService=i;this.toastr=o;this._orderProcessorService=r;this._customerHttpService=a;this.promotionCouponServiceV2=u;this.promotionCouponExternalService=h;this.userRoleService=b;this.decimalPipe=f;this.subscribeToObservable()}dialog=g(Y);salesOrderData;appConfigJson;entityID;audio=new Audio;priceMinimumRestrictionWarning=S("");subscribeToObservable(){this._posService.Data$.pipe(j()).subscribe(e=>{this.appConfigJson=e.AppConfigJSON}),this._orderDataService.Data$.pipe(j()).subscribe(e=>{this.salesOrderData=e,this.entityID=e.Order.EntityID}),this._orderProcessorService.Data$.pipe(j()).subscribe(e=>{e.posState==3&&this.clearCartItemsInLocalStorage()})}addCartItemById(e,t,i=!0){return new Promise((o,r)=>{this.variantService.findVariantByID(e,this.entityID,i).then(a=>{this.isShoppingCartLockedByPromotionCoupon()==!1&&this.createNewCartItem(a,t),o(a)}).catch(a=>{r(a)})})}addCartItemByCode(e){return new Promise((t,i)=>{let o=this.appConfigJson.ModuleSell.DigitalScale;o.Digit>0&&p.IsNotEmpty(o.Regex)&&e.length==o.Digit?this.parseDigitalScaleBarcodeWithRegex(e,o).then(a=>{a||(this.toastr.info("Matching Regex Rule to Barcode","Digital Scale"),this.findVariantByCode(e).then(u=>t(u)).catch(u=>i(u)))}):this.findVariantByCode(e).then(a=>t(a)).catch(a=>i(a))})}findVariantByCode(e){let t=this.appConfigJson.ModuleSell.BarcodeSerialEnabled;return new Promise((i,o)=>{this.variantService.findVariantByCode(e,this.entityID,t).then(r=>{i(r),this.isShoppingCartLockedByPromotionCoupon()==!1&&this.createNewCartItem(r)}).catch(r=>{this.playBellRing(),o(r)})})}addItemBySerial(e){this.variantService.findVariantBySerial(e,this.entityID).subscribe(t=>{let i=this.salesOrderData.CartItems;if(i.length>0){let o,r=[],a=i.findIndex(u=>u.Variant.ID==t.ID);r=[],a!==-1?(o=i[a].Serial?.findIndex(u=>u.Number==e),r=[...i[a].Serial?i[a].Serial:[]],o==-1?(r.push({Number:e,Quantity:1}),i[a].Quantity=r.length):r.length>0?r[o].Quantity+=1:(r=[{Number:e,Quantity:1}],this.addNewSerials(t,e)),i[a].Serial=[...r],i[a].Quantity=i[a].calculateSerialQty(),this.updateCartItem(i[a],a)):this.addNewSerials(t,e)}else this.addNewSerials(t,e)})}addNewSerials(e,t){e.Serial=[{Number:t,Quantity:1}],this.createNewCartItem(e)}playBellRing(){this.audio.src="https://cdn.dealpos.xyz/web-audio/bell_ring.mp3",this.audio.load(),this.audio.play()}updateCartItem(e,t){this.isShoppingCartLockedByPromotionCoupon()==!1&&(this.salesOrderData.CartItems[t]=e,this._orderDataService.pushNewValue(this.salesOrderData),this.applyCustomerPoint(),this.saveItemsToLocalStorage())}deleteCartItem(e){this.isShoppingCartLockedByPromotionCoupon()==!1&&(this.salesOrderData.CartItems=this.salesOrderData.CartItems.filter(t=>t!==e),this._orderDataService.pushNewValue(this.salesOrderData),this.applyCustomerPoint())}parseDigitalScaleBarcodeWithRegex(e,t){return new Promise(i=>{let o=this.appConfigJson.ModuleSell.BarcodeSerialEnabled,r=new RegExp(t.Regex),a=e.match(r);if(console.log(a),p.IsNotEmpty(a)){let u=a[1],h=parseFloat(a[2]);console.log(h,"productQuantity"),h=h/t.QuantityDivider,this.variantService.findVariantByCode(u,this.entityID,o).then(b=>{this.createNewCartItem(b,null,h),i(!0)}).catch(()=>{i(!1)})}else i(!1)})}createNewCartItem(e,t,i){let o=new te,r=this.appConfigJson.ModuleSell.ProductNotes.CopyProductDescription,a=this.appConfigJson.ModuleSell.ProductNotes.CopyPromotionName;o.patchByVariant(e,r,a),o=this.applyReward(o,t),p.IsEmpty(t)&&(o=this.applyPriceBook(o)),this.validateCartItem(o)&&(o.Quantity=i||o.Quantity,t?.PromotionType==2?this.handlingPromotionQuantity(o):this.pushNewItemToArray(o,o.PromotionGift),this.applyCustomerPoint()),this.addAvailableComponent(o)}applyCustomerPoint(){let e=this.salesOrderData.Order.CustomerID,t=p.IsEmpty(e);this._orderProcessorService.reedemPointToDiscount(t)}handlingPromotionQuantity(e){let t=$(te,this.salesOrderData.CartItems),i=t.findIndex(o=>o.VariantID==e.VariantID&&o.PromotionGift);i!==-1?t[i].Quantity+=e.Quantity?e.Quantity:1:t=[...t,e],this.salesOrderData.CartItems=t,this._orderDataService.pushNewValue(this.salesOrderData)}applyPromotionProduct(e){let t=e.Variant.DiscountAmount;return t&&(e.Price=e.UnitPriceOriginal-t),e}applyReward(e,t){if(t){let i=this.appConfigJson.ModuleSell.ProductNotes.CopyPromotionName;e.Discount=t.Discount,e.Price=t.OriginalPrice;let o=t.OriginalPrice-t.UnitPrice;e.Price=e.UnitPriceOriginal-o,e.UnitPrice=e.UnitPriceOriginal-o,e.PromotionGift=!0,e.PromotionID=t.PromotionID,e.Quantity=t.Quantity?t.Quantity:1,e.PriceTypeID=3,e.Cost+=t.ExtraCost,e.UnitCost+=t.ExtraCost,e.PriceNote=t.PromotionName,i&&(e.Note=`${e.Note?e.Note:""} ${t.PromotionName} `)}return e}addAvailableComponent(e){let t=e.Price!=0,i=this.appConfigJson.ModuleSell.SellProductComponentDefaultPrice,o=e.Variant;if(o.Component!=null&&o.Component.length>0)for(let r of o.Component){let a=new Lt;a.patchByVariant(r),a.Quantity=e.Quantity*r.Quantity,t&&!i&&(r.UnitPrice=0),a.Price=r.UnitPrice,this.pushNewItemToArray(a)}}pushNewItemToArray(e,t=!1){if(this.isShoppingCartLockedByPromotionCoupon()==!1){let i=this.salesOrderData.CartItems.findIndex(o=>o.VariantID==e.VariantID);if(e=this.applyPromotionProduct(e),i==-1||t){let o=this.salesOrderData.CartItems.length;e.ItemTemporaryID=o,this.salesOrderData.CartItems.push(e)}else{let o=this.appConfigJson.ModuleSell.QuickKey.NewRowBehaviour;if(o==2){let r=this.salesOrderData.CartItems.length;e.ItemTemporaryID=r,this.salesOrderData.CartItems.push(e)}else if(o==1)this._orderProcessorService.Data.posState==4?this.salesOrderData.CartItems.push(e):this.addingQuantityItem(i,e);else{if(!this.validatePrepaidPackage(e,i)){this.toastr.error("This prepaid package is already in the cart while editing. Please remove it first before adding again.","Cannot Add Item");return}this.addingQuantityItem(i,e)}}this._orderDataService.pushNewValue(this.salesOrderData),this.saveItemsToLocalStorage()}}saveItemsToLocalStorage(){let e=this.userRoleService.Data.DeleteItem,t=this._orderProcessorService.Data?.posState;if(!e&&t!==4){let i=this._orderDataService.Data,o=i?.Order?.Number,r=i.CartItems,a={Number:o,CartItems:r};try{localStorage.setItem("cart_items",JSON.stringify(a))}catch(u){console.error("Error saving cart items to localStorage:",u)}}}clearCartItemsInLocalStorage(){localStorage.getItem("cart_items")&&(this.userRoleService.Data?.DeleteItem?this.clearCartItemsBasedOnCoupon():this.clearCartItemsStorage())}clearCartItemsBasedOnCoupon(){let e=this.promotionCouponServiceV2?.appliedCoupon();e&&(e?.Type=="FullAccess"||e?.Type=="DeleteItem")&&this.clearCartItemsStorage()}clearCartItemsStorage(){try{localStorage.removeItem("cart_items")}catch(e){console.error("Error clearing cart items from localStorage:",e)}}validatePrepaidPackage(e,t){let i=this.salesOrderData.CartItems[t],o=this._orderProcessorService.Data.posState,r=e.Variant.TypeID==10,a=p.IsNotEmpty(i.ID),u=!0;return o==2&&r&&a&&(u=!1),u}addingQuantityItem(e,t){let i=this.salesOrderData.CartItems.filter(u=>u.VariantID==t.VariantID),o=i.length,r=i.find(u=>!u.PromotionGift);this.salesOrderData.CartItems[e].PromotionGift&&o==1?this.salesOrderData.CartItems.push(t):(r.Quantity+=t.Quantity,r=this.applyPromotionProduct(r)),r&&(r=this.applyPriceBook(r))}validateCartItem(e){return e.Variant.CategoryTypeID==-1?(this.toastr.info(e.Variant.Name+" cannot be sold, check Category "+e.Variant.CategoryName+" settings","info"),!1):!!this.validateSerialItem(e)}validatePriceMinimum(e){let t=this.checkPriceMinimumRestriction(e);if(t)this.priceMinimumRestrictionWarning.set("");else{let i=this.appConfigJson.ModuleSell?.ProductDialog?.MinimumPriceIncludeDiscount,o=this.getPriceMinimum(e),r=this.generateMinimumPriceWarningMessage(i,o,e);this.priceMinimumRestrictionWarning.set(r)}return t}checkPriceMinimumRestriction(e){let t=!0,i=this.userRoleService.Data.PriceMinimum,r=this.appConfigJson.ModuleSell?.ProductDialog?.MinimumPriceIncludeDiscount?e.TotalAfterDiscountPerQuantity:e.Price;if(i){let a=this.getPriceMinimum(e);r<a?t=!1:t=!0}return t}getPriceMinimum(e){let t=this.appConfigJson.ModuleSell.ProductDialog?.PriceMinimumTypeID,i=0;switch(t){case 1:i=e.Variant?.UnitPrice;break;case 2:i=e.Variant?.UnitCost;break;case 3:i=e.Variant?.UnitPriceMinimum;break}return i}generateMinimumPriceWarningMessage(e,t,i){let o="",r=i.Discount,a=i.DiscountAmount;return e&&(r>0||a>0)?o=p.StringFormat(`<span><i class='fa-solid fa-triangle-exclamation me-2 d-inline'></i>Item net price is <h5 class='d-inline m-0'>{0}</h5></span>
|
|
3
3
|
after item discount, you cannot sell lower than <h5 class='d-inline m-0'>{1}</h5></span>`,this.decimalPipe.transform(i.TotalAfterDiscountPerQuantity),this.decimalPipe.transform(t)):o=p.StringFormat("<span><i class='fa-solid fa-triangle-exclamation me-2 d-inline'></i>Cannot sell lower than <h5 class='d-inline m-0'>{0}</h5></span>",this.decimalPipe.transform(t)),o}validateSerialItem(e){let t=!0;if(e?.Serial?.length>0&&e.Variant.TypeID==4&&e.Quantity>0){let i=0;e?.Serial?.forEach(o=>{i+=o.Quantity}),i!=e.Quantity&&(this.toastr.error("Serial must be equal with the quantity","Error"),t=!1)}return t}isShoppingCartLockedByPromotionCoupon(){let e=this.promotionCouponServiceV2.appliedCoupon(),t=this.promotionCouponExternalService.coupon,i=!1;if((p.IsNotEmpty(e)||p.IsNotEmpty(t))&&this.isNonAuthorizedCouponType){i=!0;let r=this._orderDataService.Data.Order.PromotionCoupon;this.dialog.open(Et,{id:"ShoppingCartLocked",data:{title:"Shopping Cart Locked",message:`
|
|
4
4
|
<div class="d-flex justify-content-center my-4">
|