dealpos 25.44.2 → 25.44.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-J2QBKYVZ.js → chunk-2CXL6IDS.js} +1 -1
- package/browser/{chunk-J7JOV2UE.js → chunk-2GALXGGK.js} +1 -1
- package/browser/{chunk-CLIFAF7L.js → chunk-2HLP4RJY.js} +2 -2
- package/browser/{chunk-XMABGEYA.js → chunk-42NBSIMT.js} +1 -1
- package/browser/{chunk-AXITAME4.js → chunk-4XV2ANDU.js} +1 -1
- package/browser/{chunk-OGM6TARA.js → chunk-57UEET7E.js} +2 -2
- package/browser/{chunk-PW7JCR65.js → chunk-5FSR4IZJ.js} +1 -1
- package/browser/{chunk-JXNDVG64.js → chunk-6XO6NT6E.js} +1 -1
- package/browser/{chunk-W5EJQZB4.js → chunk-7LEIOTZN.js} +1 -1
- package/browser/{chunk-CW2D4XVM.js → chunk-7QZ26SB7.js} +1 -1
- package/browser/{chunk-7M35JNER.js → chunk-A3JFNOMC.js} +1 -1
- package/browser/{chunk-DHQWJAOX.js → chunk-ABOGLWVN.js} +1 -1
- package/browser/{chunk-KAJ5NYU6.js → chunk-AJM4N35T.js} +1 -1
- package/browser/{chunk-MS67N3VC.js → chunk-BKK7PT4Q.js} +1 -1
- package/browser/{chunk-BA64MIHJ.js → chunk-BLSJR63P.js} +1 -1
- package/browser/{chunk-T6TPCDSC.js → chunk-BXSCBMI2.js} +1 -1
- package/browser/{chunk-7QOZKOAW.js → chunk-CDCIW4H7.js} +1 -1
- package/browser/{chunk-4WAY7P2M.js → chunk-CXKH3Y7Q.js} +1 -1
- package/browser/{chunk-APFUVBFJ.js → chunk-DDJ6XGOR.js} +1 -1
- package/browser/{chunk-QPS677LS.js → chunk-DK2SUVKT.js} +1 -1
- package/browser/{chunk-5E64BHHD.js → chunk-DOYS2PZE.js} +1 -1
- package/browser/{chunk-RUFSPHPN.js → chunk-DTFMCXRP.js} +1 -1
- package/browser/{chunk-Y3YIK27D.js → chunk-DWZ6HNBA.js} +1 -1
- package/browser/{chunk-ZIUOCAE2.js → chunk-EGRFS63E.js} +1 -1
- package/browser/{chunk-PJTFJKGS.js → chunk-EIYVPVSH.js} +1 -1
- package/browser/{chunk-PMEWJS46.js → chunk-EKX3MMTJ.js} +1 -1
- package/browser/{chunk-3FD5W6K2.js → chunk-ESMCBLSB.js} +2 -2
- package/browser/{chunk-YH3UWFOD.js → chunk-EUY2EQVP.js} +1 -1
- package/browser/{chunk-SPTLCHEU.js → chunk-EY2BEKKH.js} +1 -1
- package/browser/{chunk-CT7VQIZ7.js → chunk-FDFNWO3I.js} +1 -1
- package/browser/{chunk-YR223T2R.js → chunk-FEHHVG4G.js} +2 -2
- package/browser/{chunk-QMBZSWSZ.js → chunk-FEW55RO5.js} +1 -1
- package/browser/{chunk-2X7JXLPO.js → chunk-FTRVMNGV.js} +1 -1
- package/browser/{chunk-CFDWM2SO.js → chunk-GGOZMZWR.js} +1 -1
- package/browser/{chunk-PKT3SIRZ.js → chunk-GKFPNF3O.js} +1 -1
- package/browser/{chunk-BO6JXHTU.js → chunk-GN6RJLLA.js} +1 -1
- package/browser/{chunk-ODOX327P.js → chunk-GQO3Q75J.js} +1 -1
- package/browser/{chunk-NHKASBAN.js → chunk-GUURROIV.js} +1 -1
- package/browser/{chunk-DTWCNQ4N.js → chunk-HRDXDHQN.js} +2 -2
- package/browser/{chunk-M57BBETM.js → chunk-IYV6WHO4.js} +1 -1
- package/browser/{chunk-XFP34FRB.js → chunk-J4HLBSTR.js} +1 -1
- package/browser/{chunk-XMABJJGK.js → chunk-JMQDEPZK.js} +1 -1
- package/browser/{chunk-3UXPJWJQ.js → chunk-JUYFABKK.js} +1 -1
- package/browser/{chunk-655R7PDY.js → chunk-K7BQAEUZ.js} +1 -1
- package/browser/{chunk-WM2ISZEL.js → chunk-KH3Y6E5S.js} +1 -1
- package/browser/{chunk-AAX2TBEM.js → chunk-LAJ6WFQN.js} +1 -1
- package/browser/{chunk-QR4VV4GM.js → chunk-LED2YGBL.js} +1 -1
- package/browser/{chunk-UKFG66EY.js → chunk-LKII7K7T.js} +1 -1
- package/browser/{chunk-J2HRW2OD.js → chunk-LKXAGCSU.js} +1 -1
- package/browser/{chunk-2RZHUSQU.js → chunk-LQ63SW7R.js} +1 -1
- package/browser/{chunk-5XINUUVX.js → chunk-MB5ABPXA.js} +2 -2
- package/browser/{chunk-PLZ3ODXT.js → chunk-MBJ5EVQM.js} +1 -1
- package/browser/{chunk-2ZDXMF6S.js → chunk-MBRMFZQD.js} +1 -1
- package/browser/{chunk-CMAE52E3.js → chunk-MJYYXEWE.js} +1 -1
- package/browser/{chunk-D4G24QCQ.js → chunk-ML4F7QSG.js} +1 -1
- package/browser/{chunk-3Q3FUJ44.js → chunk-MO4GVGHJ.js} +1 -1
- package/browser/{chunk-IJVIVNVH.js → chunk-MPCAKU6Y.js} +1 -1
- package/browser/{chunk-OZG5SOW6.js → chunk-NMBTXI33.js} +1 -1
- package/browser/{chunk-O35SSVC5.js → chunk-PDDA2XEV.js} +1 -1
- package/browser/{chunk-V77ELRLY.js → chunk-PKRB5QHY.js} +1 -1
- package/browser/{chunk-P63I2MBK.js → chunk-PMFQUQRF.js} +1 -1
- package/browser/{chunk-YCTTD62Z.js → chunk-QO6OCZ2F.js} +2 -2
- package/browser/{chunk-53I2NSFZ.js → chunk-RDMLIBMG.js} +1 -1
- package/browser/{chunk-6PSJSHPW.js → chunk-RJEOTZXL.js} +1 -1
- package/browser/{chunk-BC4RWXWV.js → chunk-S5QHJZP7.js} +1 -1
- package/browser/{chunk-SAAWSHJS.js → chunk-SJIRHP7T.js} +1 -1
- package/browser/{chunk-EPUDCYJW.js → chunk-SXKMJUZG.js} +1 -1
- package/browser/{chunk-CKNSQS62.js → chunk-T4LU2Z4H.js} +1 -1
- package/browser/chunk-UGRZNVJI.js +1 -0
- package/browser/{chunk-SZ7M2HSN.js → chunk-UTP22HZJ.js} +1 -1
- package/browser/{chunk-ZJHWFDGD.js → chunk-V3Y7QS6E.js} +1 -1
- package/browser/{chunk-SCB5WW4J.js → chunk-VHLIFXL2.js} +1 -1
- package/browser/{chunk-BSFKTGRH.js → chunk-VK6JMOTL.js} +1 -1
- package/browser/{chunk-34KJ7YHX.js → chunk-VPQTKMSG.js} +1 -1
- package/browser/{chunk-FOF7BQHC.js → chunk-VTUDAX3L.js} +1 -1
- package/browser/{chunk-AUTKQFDZ.js → chunk-WEZJHAOW.js} +1 -1
- package/browser/{chunk-RW5SHW7P.js → chunk-WOQG2RJS.js} +1 -1
- package/browser/{chunk-ZIT77RS6.js → chunk-WTXHMI64.js} +2 -2
- package/browser/{chunk-VFEOT7L6.js → chunk-XM2Q4S3I.js} +1 -1
- package/browser/{chunk-YV6PGG6H.js → chunk-YPHODEQB.js} +1 -1
- package/browser/{chunk-RKZPHRAC.js → chunk-YTS3IROV.js} +1 -1
- package/browser/{chunk-47RLR2PC.js → chunk-ZB4A4IBA.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-4NFW4OXW.js → main-CNAQ374V.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-OTEI4GZK.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{a as Er}from"./chunk-E4DPE3J5.js";import{a as Or}from"./chunk-RKCLO5OA.js";import{a as Mr,b as Fr}from"./chunk-YZHVQD5P.js";import{a as Pr}from"./chunk-HKJLMHAD.js";import{b as Xi,c as Ir}from"./chunk-V2LFW5D3.js";import{a as Yi}from"./chunk-G454AF6P.js";import{a as hr,e as br,f as ut}from"./chunk-4G344XSZ.js";import{a as Tr}from"./chunk-XFP34FRB.js";import{a as Dr}from"./chunk-23PJKOTU.js";import{a as wr}from"./chunk-Z2LCSWV4.js";import{a as xr}from"./chunk-ALNSA73T.js";import{a as Sr}from"./chunk-3CUWPIMQ.js";import"./chunk-7ENDP7TZ.js";import{a as qt}from"./chunk-53I2NSFZ.js";import{a as jt,b as Qt}from"./chunk-57Q3ENW2.js";import"./chunk-MK4KDIMG.js";import"./chunk-L7RHCBKX.js";import{a as rr}from"./chunk-J2HRW2OD.js";import{a as or}from"./chunk-4JM455M6.js";import{a as Jo}from"./chunk-OXQJYOVG.js";import{a as Oo}from"./chunk-5HX73JZ3.js";import{a as vr,b as yr}from"./chunk-AER2U57P.js";import{a as fr,b as Gi}from"./chunk-EDXMXTEK.js";import{a as _r}from"./chunk-6PGUQ3CR.js";import{a as Ji}from"./chunk-JLXCN2NR.js";import"./chunk-2YDEXJE5.js";import"./chunk-NQX7EX5A.js";import{a as Cr}from"./chunk-EWZ63XSS.js";import{a as gr}from"./chunk-P3KIIKY4.js";import{e as pr}from"./chunk-FIHWJAIR.js";import{a as ar,b as mr,c as cr}from"./chunk-SRRURHLT.js";import{a as $i}from"./chunk-SGFSKIUE.js";import"./chunk-5M3JINH2.js";import{b as lr}from"./chunk-RFO7MTFT.js";import{a as sr,b as dr,c as ur}from"./chunk-4PPRFE5H.js";import{b as Ki}from"./chunk-YRGGDRUH.js";import{a as xt,b as st}from"./chunk-OISKO6QJ.js";import"./chunk-AEHOR4RJ.js";import"./chunk-Z3E24JZW.js";import"./chunk-NQKVYQ6V.js";import"./chunk-DAIHPIA2.js";import{a as Zo,c as er,e as tr,f as ir,g as nr}from"./chunk-4UYZJCFI.js";import{a as zi}from"./chunk-XKUQPHUA.js";import{a as Xo,b as Ui}from"./chunk-Q4CKRRGM.js";import"./chunk-PIYM2FOP.js";import"./chunk-2OWHEMAL.js";import"./chunk-XZELBTQR.js";import{e as Ni}from"./chunk-RHUDY63D.js";import{a as dt}from"./chunk-MPSML3FA.js";import{d as de,e as qi}from"./chunk-GIDGCFLX.js";import{b as Lo}from"./chunk-XBRBYCWJ.js";import"./chunk-3RK6DDJD.js";import{a as ko}from"./chunk-FP4HFB5J.js";import{p as Mo,q as Po}from"./chunk-H3OZSV6V.js";import"./chunk-YEDKRNXU.js";import"./chunk-VZEPVRCY.js";import"./chunk-7QWJJPNG.js";import{a as Fo,b as Vo,c as No,d as Ht,e as Ko}from"./chunk-6647Y35T.js";import"./chunk-VHAM2DWK.js";import{a as ri}from"./chunk-JPXXXD26.js";import{a as Ho}from"./chunk-PLZ3ODXT.js";import{c as wo}from"./chunk-VQBXUZ6U.js";import{a as Je,b as Yo}from"./chunk-BBGWXLHJ.js";import{f as li}from"./chunk-UKFG66EY.js";import{c as Pe}from"./chunk-JXNDVG64.js";import{b as Ie}from"./chunk-QHBWVJIQ.js";import{a as Se}from"./chunk-IJVIVNVH.js";import"./chunk-KAJ5NYU6.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import{a as Me}from"./chunk-XZR3IMWZ.js";import{d as Go,e as oe,f as Qi}from"./chunk-BA64MIHJ.js";import"./chunk-2RZHUSQU.js";import"./chunk-5JJSLRVS.js";import{a as ki,b as Li,c as Ro}from"./chunk-B6LPY2IZ.js";import"./chunk-CWITQVZH.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import{a as Ao,d as Bo,f as Wo,h as Ri}from"./chunk-MFCXEITE.js";import{a as Wi,c as ct}from"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import{d as zo,e as $o}from"./chunk-ZJHWFDGD.js";import{b as te}from"./chunk-SPTLCHEU.js";import"./chunk-3GOO5E5D.js";import{a as Do}from"./chunk-XMYLHF4C.js";import{F as We,G as ji,m as Eo,u as _e,v as fe,w as De}from"./chunk-H7F34T25.js";import{b as ke,c as Wt}from"./chunk-JOXTERIM.js";import{B as Uo,N as ai,O as Ne,g as Be,k as Qo,n as Hi,x as qo}from"./chunk-TSIYPTYI.js";import{a as Ai,c as Bi,d as Ee}from"./chunk-XYB3YDKL.js";import"./chunk-7VKFVS7K.js";import"./chunk-ZVDY66SR.js";import{a as pt,e as ye,f as Ke,g as A,l as jo}from"./chunk-3YKVLHZG.js";import{N as Io,_ as To}from"./chunk-ZHY3BUQJ.js";import"./chunk-VFTGIP5A.js";import"./chunk-LE3BKIDY.js";import{a as ve}from"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import{A as ho,F as Ge,G as Bt,b as Dt,c as Ce,h as R,l as $e,o as W,r as So,s as oi}from"./chunk-RVXZOIFQ.js";import"./chunk-PW7JCR65.js";import{a as bo}from"./chunk-XMABJJGK.js";import{a as T,d as ne}from"./chunk-ZZGSAFGO.js";import"./chunk-QPS677LS.js";import{$ as ze,$a as l,$b as Pi,Ac as E,Bc as P,Cc as Vi,D as Ve,Db as Xe,E as L,Fa as gi,Fc as Z,I as je,Ib as n,Jb as i,Kb as f,Lb as z,M as uo,Ma as vt,Mb as $,N as Ft,Ob as b,Od as pe,Q as _o,Qb as g,Qd as at,Rb as s,Rd as G,Td as yt,Ub as vi,Va as j,Vb as vo,Vd as ee,W as wi,Wa as ei,Wc as mt,Y as lt,Yc as J,Yd as k,Za as ti,Zb as Ei,Zc as B,_b as Mi,aa as Q,ca as fo,cd as rt,d as be,db as C,dc as we,e as gt,ec as p,ed as he,fa as q,fb as Oi,fc as I,ga as se,gc as D,gd as ge,hc as Qe,ic as yo,ja as K,jc as x,jd as X,k as Oe,ka as Zt,kb as O,kc as S,lb as ii,lc as h,ma as Vt,na as y,o as Ct,ob as re,pc as xo,qb as _,qc as N,rc as M,sc as Ae,t as V,tc as Fi,u as bt,ua as go,ub as Co,va as d,vb as m,wa as u,wb as Ci,wd as ni,x as co,xb as Nt,y as fi,z as so,zb as ot,zc as v}from"./chunk-UXRO4UFY.js";import{a as ae,b as le,d as po,j as mo}from"./chunk-7DCB7DB2.js";var Kr=()=>["/menu/Logistics/Archive/Transfer_Order/Form"],Jr=()=>["/menu/Logistics/Archive/Transfer_Order/Info"],Yr=t=>({ID:t}),Xr=(t,r,e)=>({"text-success":t,"text-warning":r,"text-danger":e}),Zr=()=>["/print/Transfer"],ea=(t,r)=>({ID:t,Template:r});function ta(t,r){if(t&1){let e=b();n(0,"a",23),g("click",function(){d(e);let o=s(3);return u(o.httpPostListID("TransferOrder/Delete"))}),f(1,"i",24),p(2," Delete"),i()}}function ia(t,r){if(t&1){let e=b();n(0,"a",23),g("click",function(){d(e);let o=s(3);return u(o.onVoid())}),f(1,"i",24),p(2," Void"),i()}}function na(t,r){if(t&1&&(z(0),_(1,ta,3,0,"a",22)(2,ia,3,0,"a",22),$()),t&2){let e=s(2);l(),m("ngIf",e.role.logistic.Delete&&!e.pageData.Config.IsVoidEnabled),l(),m("ngIf",e.role.logistic.TransferOrderVoid&&e.pageData.Config.IsVoidEnabled)}}function oa(t,r){if(t&1){let e=b();n(0,"button",25),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",26),p(2," Export "),i()}}function ra(t,r){t&1&&(n(0,"a",27),p(1,"New"),i()),t&2&&m("routerLink",N(1,Kr))}function aa(t,r){if(t&1){let e=b();n(0,"div",28)(1,"h6"),p(2,"Source"),i(),n(3,"outlet-selector",29),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"Destination"),i(),n(6,"outlet-selector",30),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.DestinationID,o)||(c.pageData.Filter.DestinationID=o),u(o)}),i(),n(7,"h6"),p(8,"Fulfillment"),i(),n(9,"ng-select",31),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.StateID,o)||(c.pageData.Filter.StateID=o),u(o)}),i(),n(10,"h6"),p(11,"Tag"),i(),n(12,"ng-select",32),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.TypeID,o)||(c.pageData.Filter.TypeID=o),u(o)}),i(),n(13,"h6"),p(14,"Courier"),i(),n(15,"ng-select",33),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CourierID,o)||(c.pageData.Filter.CourierID=o),u(o)}),i(),n(16,"h6"),p(17,"From"),i(),n(18,"datepicker",34),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(19,"h6"),p(20,"To"),i(),n(21,"datepicker",35),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i(),n(22,"h6"),p(23,"Creator"),i(),n(24,"autocompleteV2",36),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CreatorID,o)||(c.pageData.Filter.CreatorID=o),u(o)}),i(),n(25,"h6"),p(26,"Sort By"),i(),n(27,"radio-options",37),h("modelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.SortBy,o)||(c.pageData.Filter.SortBy=o),u(o)}),i(),n(28,"h6"),p(29,"Page Size"),i(),n(30,"input",38),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.RowCount,o)||(c.pageData.Filter.RowCount=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),m("accessType",2),x("ngModel",e.pageData.Filter.DestinationID),m("multiple",!1),l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.StateID),l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Courier),x("ngModel",e.pageData.Filter.CourierID),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("ngModel",e.pageData.Filter.CreatorID),l(3),m("options",e.pageData.Options==null?null:e.pageData.Options.SortOption),x("model",e.pageData.Filter.SortBy),l(3),x("ngModel",e.pageData.Filter.RowCount),m("max",1e4)}}function la(t,r){if(t&1){let e=b();n(0,"th",39)(1,"input",40),g("change",function(o){d(e);let c=s(2);return u(c.onSelectAllData(o.target.checked))}),i()()}}function pa(t,r){t&1&&(n(0,"th",41),p(1," Price "),i())}function ma(t,r){if(t&1){let e=b();n(0,"td",39)(1,"input",45),h("ngModelChange",function(o){d(e);let c=s().$implicit;return S(c.selected,o)||(c.selected=o),u(o)}),i()()}if(t&2){let e=s().$implicit;l(),x("ngModel",e.selected)}}function ca(t,r){if(t&1&&(n(0,"td",41),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.Price)," ")}}function sa(t,r){if(t&1&&(n(0,"span"),p(1),i()),t&2){let e=s().$implicit;l(),I(e.Courier)}}function da(t,r){if(t&1&&(n(0,"span"),p(1),i()),t&2){let e=s().$implicit;l(),I(e.CourierName)}}function ua(t,r){if(t&1&&(n(0,"tbody")(1,"tr"),_(2,ma,2,1,"td",12),n(3,"td"),p(4),i(),n(5,"td"),p(6),i(),n(7,"td"),f(8,"a",42),i(),n(9,"td"),p(10),v(11,"date"),i(),n(12,"td"),p(13),v(14,"date"),i(),n(15,"td",41),p(16),i(),_(17,ca,3,3,"td",17),n(18,"td"),p(19),i(),n(20,"td"),p(21),i(),n(22,"td"),p(23),i(),n(24,"td"),_(25,sa,2,1,"span",3)(26,da,2,1,"span",3),i(),n(27,"td")(28,"a",43),f(29,"i",44),i()()()()),t&2){let e=r.$implicit,a=s(2);l(2),m("ngIf",a.role.logistic.Delete&&!a.pageData.Config.IsVoidEnabled||a.role.logistic.TransferOrderVoid&&a.pageData.Config.IsVoidEnabled),l(2),I(e.Source),l(2),I(e.Destination),l(2),m("routerLink",N(25,Jr))("queryParams",M(26,Yr,e.ID))("innerHTML",e.Number,j),l(2),I(P(11,19,e.Date,"dd MMM yyyy")),l(3),I(P(14,22,e.Created,"HH:mm")),l(3),I(e.Quantity),l(),m("ngIf",a.role.sell.PriceVisible&&a.pageData.Config.PriceVisible),l(),ot(Fi(28,Xr,e.StateLabel=="Received",e.StateLabel=="Dispatched",e.StateLabel=="Approved")),l(),D(" ",e.StateLabel," "),l(2),I(e.CreatorName),l(2),I(e.TypeName),l(2),m("ngIf",e.Courier!=null),l(),m("ngIf",e.CourierName!=null&&e.Courier==null),l(2),m("routerLink",N(32,Zr))("queryParams",Ae(33,ea,e.ID,e.SourceTemplateID))}}function _a(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Number,o)||(c.pageData.Filter.Number=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,na,3,2,"ng-container",3)(3,oa,3,0,"button",4),n(4,"div",5),_(5,ra,2,2,"a",6),i()(),n(6,"filters"),_(7,aa,31,21,"ng-template",null,0,Z),i(),n(9,"content")(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11),_(15,la,2,0,"th",12),n(16,"th",13),p(17,"Source"),i(),n(18,"th",14),p(19,"Destination"),i(),n(20,"th"),p(21,"Number"),i(),n(22,"th",15),p(23,"Date"),i(),n(24,"th",15),p(25,"Time"),i(),n(26,"th",16),p(27,"Qty"),i(),_(28,pa,2,0,"th",17),n(29,"th",15),p(30,"Status"),i(),n(31,"th",18),p(32,"Creator"),i(),n(33,"th",15),p(34,"Tag"),i(),n(35,"th",15),p(36,"Courier"),i(),f(37,"th",19),i()(),_(38,ua,30,36,"tbody",20),i()(),n(39,"POS-complex-pagination",21),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.getSelectedData().length>0),l(),m("ngIf",e.role.global.Export),l(2),m("ngIf",e.role.logistic.Create),l(10),m("ngIf",e.role.logistic.Delete&&!e.pageData.Config.IsVoidEnabled||e.role.logistic.TransferOrderVoid&&e.pageData.Config.IsVoidEnabled),l(13),m("ngIf",e.role.sell.PriceVisible&&e.pageData.Config.PriceVisible),l(10),m("ngForOf",e.data.Data),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var Zi=class t extends Se{constructor(e,a,o,c,w,H,ie){super(e,a,"TransferOrder/TransferOrderList","TransferOrderLoader/TransferOrderList",c,w);this.csvConverter=o;this.role=H;this.matDialog=ie}moreFilter=!1;openExportModal(){this.matDialog.open(Ie,{data:{title:"Transfer Order",exportTypes:[{ID:"TransferOrder/TransferOrderList",Value:"Default",FileName:"Transfer Order"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"TransferOrder/TransferOrderRowsCount",pagination:!0}})}onVoid(){if(confirm("Are you sure you want to void these transfer order(s)?")==!1)return;let e=this.getSelectedData().map(a=>a.ID);e.length>0&&this.httpService.put("/api/transferorder/voidlisttransferorder",e,{},1e5,!0).subscribe(a=>{this.toastrService.success(a.Message,"Success"),this.getListData()},a=>this.toastrService.error(a.error.Message,"Error"))}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ee),C(pe),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-transfer-order"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["class","btn btn-success","role","button",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","100px"],[2,"width","150px"],[2,"width","90px"],[1,"text-end",2,"width","50px"],["class","text-end",4,"ngIf"],[2,"width","120px"],[2,"width","16px"],[4,"ngFor","ngForOf"],["api","TransferOrder/TransferOrderRowsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["role","button","class","btn btn-outline-secondary me-5",3,"click",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fas","fa-trash"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["role","button",1,"btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["placeholder","Source",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","Destination",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["bindLabel","Value","bindValue","Key","placeholder","Choose",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Options",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose a courier",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["requestUrl","/API/AC/GetUserSuggestion",1,"input-left","w-100","ac-filter",3,"ngModelChange","ngModel"],["name","SortBy",3,"modelChange","options","model"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","ngModel","max"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"text-end"],[3,"routerLink","queryParams","innerHTML"],["target","_blank",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa","fa-print"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(a,o){a&1&&_(0,_a,40,12,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,Ce,Dt,R,W,oe,de,Ht,We,Je,ct,Ee,Pe,ge,he],encapsulation:2})};var fa=()=>["/menu/Logistics/Archive/Outbound_Logistics/Form"],ga=()=>["/menu/Logistics/Archive/Outbound_Logistics/Info"],eo=t=>({ID:t}),Ca=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],va=()=>["/menu/Orders/Order/Sales_Order/Info"];function ya(t,r){if(t&1){let e=b();z(0),n(1,"a",21),g("click",function(){d(e);let o=s(2);return u(o.httpPostListID("OutboundLogistics/Delete"))}),f(2,"i",22),p(3," Delete"),i(),$()}}function xa(t,r){if(t&1){let e=b();n(0,"button",23),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",24),p(2," Export "),i()}}function Sa(t,r){t&1&&(n(0,"a",25),p(1," New"),i()),t&2&&m("routerLink",N(1,fa))}function ha(t,r){if(t&1){let e=b();n(0,"div",26)(1,"h6"),p(2,"Outlet"),i(),n(3,"outlet-selector",27),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6",28),p(5,"ORIGIN"),i(),n(6,"outlet-selector",27),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.OrderEntityID,o)||(c.pageData.Filter.OrderEntityID=o),u(o)}),i(),n(7,"h6"),p(8,"Customer"),i(),n(9,"autocompleteV2",29),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CustomerID,o)||(c.pageData.Filter.CustomerID=o),u(o)}),i(),n(10,"h6"),p(11,"From - To"),i(),n(12,"div")(13,"datepicker",30),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i()(),n(14,"div",31)(15,"datepicker",32),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i()(),n(16,"h6"),p(17,"Number Filter Comparator"),i(),n(18,"ng-select",33),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.NumberFilterComparator,o)||(c.pageData.Filter.NumberFilterComparator=o),u(o)}),g("ngModelChange",function(){d(e);let o=s(2);return u(o.validateForLookbackDays())}),i(),n(19,"h6"),p(20,"Query Options"),i(),n(21,"ng-select",34),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.QueryOption,o)||(c.pageData.Filter.QueryOption=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),m("accessType",2),x("ngModel",e.pageData.Filter.OrderEntityID),m("multiple",!1),l(3),x("ngModel",e.pageData.Filter.CustomerID),l(4),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(2),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("ngModel",e.pageData.Filter.NumberFilterComparator),m("items",e.pageData.Options.NumberFilterComparatorOptions)("clearable",!1),l(3),x("ngModel",e.pageData.Filter.QueryOption),m("items",e.pageData.Options.QueryOptions)("clearable",!1)}}function ba(t,r){if(t&1){let e=b();n(0,"th",35)(1,"input",36),g("change",function(o){d(e);let c=s(2);return u(c.onSelectAllData(o.target.checked))}),i()()}}function Da(t,r){if(t&1){let e=b();n(0,"input",40),h("ngModelChange",function(o){d(e);let c=s(2).$implicit;return S(c.selected,o)||(c.selected=o),u(o)}),i()}if(t&2){let e=s(2).$implicit;x("ngModel",e.selected)}}function Ia(t,r){if(t&1&&(n(0,"td",35),_(1,Da,1,1,"input",39),i()),t&2){let e=s().$implicit;l(),m("ngIf",e.WriteAccess)}}function Ta(t,r){if(t&1&&(z(0),f(1,"a",41),$()),t&2){let e=s().$implicit;l(),m("routerLink",N(3,ga))("queryParams",M(4,eo,e.ID))("innerHtml",e.Number,j)}}function wa(t,r){if(t&1&&(n(0,"span"),p(1),i()),t&2){let e=s().$implicit;l(),I(e.Number)}}function Oa(t,r){if(t&1&&(n(0,"a",42),p(1),i()),t&2){let e=s().$implicit;m("routerLink",N(3,Ca))("queryParams",M(4,eo,e.InvoiceID)),l(),I(e.InvoiceNumber)}}function Ea(t,r){if(t&1&&(n(0,"a",42),p(1),i()),t&2){let e=s().$implicit;m("routerLink",N(3,va))("queryParams",M(4,eo,e.OrderID)),l(),I(e.OrderNumber)}}function Ma(t,r){if(t&1&&(n(0,"tbody")(1,"tr"),_(2,Ia,2,1,"td",14),n(3,"td"),p(4),i(),n(5,"td"),_(6,Ta,2,6,"ng-container",37)(7,wa,2,1,"ng-template",null,1,Z),i(),n(9,"td"),p(10),i(),n(11,"td"),p(12),i(),n(13,"td"),_(14,Oa,2,6,"a",38)(15,Ea,2,6,"ng-template",null,2,Z),i(),n(17,"td"),p(18),v(19,"date"),i(),n(20,"td"),p(21),v(22,"date"),i()()()),t&2){let e=r.$implicit,a=we(8),o=we(16),c=s(2);l(2),m("ngIf",c.role.logistic.Delete),l(2),I(e.EntityName),l(2),m("ngIf",e.WriteAccess)("ngIfElse",a),l(4),I(e.CustomerName),l(2),I(e.OrderEntityName),l(2),m("ngIf",e.InvoiceID)("ngIfElse",o),l(4),I(P(19,10,e.Date,"dd MMM yyyy")),l(3),I(P(22,13,e.Time,"HH:mm"))}}function Pa(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",4),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Number,o)||(c.pageData.Filter.Number=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),g("textChange",function(){d(e);let o=s();return u(o.validateForLookbackDays())}),n(1,"actions"),_(2,ya,4,0,"ng-container",5)(3,xa,3,0,"button",6),n(4,"div",7),_(5,Sa,2,2,"a",8),i()(),n(6,"filters"),_(7,ha,22,17,"ng-template",null,0,Z),i(),n(9,"content")(10,"div",9)(11,"div",10)(12,"table",11)(13,"thead",12)(14,"tr",13),_(15,ba,2,0,"th",14),n(16,"th",15),p(17,"Outlet"),i(),n(18,"th"),p(19,"Number"),i(),n(20,"th",15),p(21,"Customer"),i(),n(22,"th",16),p(23,"ORIGIN"),i(),n(24,"th"),p(25,"Order#"),i(),n(26,"th",17),p(27,"Date"),i(),n(28,"th",18),p(29,"Time"),i()()(),_(30,Ma,23,16,"tbody",19),i()(),n(31,"POS-complex-pagination",20),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),m("searchBoxPlaceholder",e.searchPlaceholderText),l(2),m("ngIf",e.role.logistic.Delete&&e.getSelectedData().length>0),l(),m("ngIf",e.role.global.Export),l(2),m("ngIf",e.role.logistic.Create),l(10),m("ngIf",e.role.logistic.Delete),l(15),m("ngForOf",e.data.Data),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var en=class t extends Se{constructor(e,a,o,c,w){super(e,a,"OutboundLogistics/OutboundLogisticsList","OutboundLogisticsLoader/List",o);this.role=c;this.matDialog=w}openExportModal(){this.matDialog.open(Ie,{data:{title:"Outbound Logistics",exportTypes:[{ID:"OutboundLogistics/OutboundLogisticsList",Value:"Default",FileName:"Outbound Logistics"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"OutboundLogistics/OutboundLogisticsListCount",pagination:!0}})}sortByOptions=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}];httpPostListID(e,a,o){if(a||(a="Are you sure you want to selected record/s?"),confirm(a)==!1)return;let c=this.getSelectedData().filter(w=>w.WriteAccess);c.length>0&&this.postListID(e,c,o)}get searchPlaceholderText(){return"Number "+(this.pageData?.Options?.NumberFilterComparatorOptions?.find(e=>e.Key===this.pageData?.Filter?.NumberFilterComparator)?.Value||"Starts With")}validateForLookbackDays(){this.pageData.Filter.Number&&(this.pageData.Filter.From==T.MinDate||!this.pageData.Filter.From)&&this.pageData.AppConfig.DefaultLookbackDays>0&&(this.pageData.Filter.NumberFilterComparator===3||this.pageData.Filter.NumberFilterComparator===2)&&(this.pageData.Filter.From=this.pageData.Filter.SearchLookbackDate,this.pageData.AppConfig.QueryOptionRecompile&&(this.pageData.Filter.QueryOption=1))}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(ee),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["CustomerDisplay-customer-delivery"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],["ONLY_VIEW",""],["SALESORDER",""],[3,"pageData","text","isFilterOnDropdown","filter","searchBoxPlaceholder","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","searchBoxPlaceholder"],[4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["class","btn btn-success","role","button","matTooltipPosition","above","matTooltip","Add Delivery",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","130px"],["matTooltip","The Outlet where the order is placed","matTooltipPosition","above",2,"width","130px"],[2,"width","90px"],[2,"width","50px"],[4,"ngFor","ngForOf"],["api","OutboundLogistics/OutboundLogisticsListCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fas","fa-trash"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["role","button","matTooltipPosition","above","matTooltip","Add Delivery",1,"btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["matTooltip","The Outlet where the order is placed","matTooltipPosition","above"],["requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Customer","notFoundMessageFor","customer",1,"form-control","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an Comparator",3,"ngModelChange","ngModel","items","clearable"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an Options",3,"ngModelChange","ngModel","items","clearable"],[2,"width","14px"],["type","checkbox",3,"change"],[4,"ngIf","ngIfElse"],["target","_blank",3,"routerLink","queryParams",4,"ngIf","ngIfElse"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"routerLink","queryParams","innerHtml"],["target","_blank",3,"routerLink","queryParams"]],template:function(a,o){a&1&&_(0,Pa,32,12,"mainpanel-cmp",3),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,Dt,R,W,oe,de,We,Je,Ee,ke,Pe,he],encapsulation:2})};var Fa=()=>["/menu/Logistics/Archive/Inbound_Logistics/Form"],Va=()=>["/menu/Logistics/Archive/Inbound_Logistics/Info"],Vr=t=>({ID:t}),Na=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],ka=(t,r)=>({ID:t,Template:r});function La(t,r){if(t&1){let e=b();z(0),n(1,"a",18),g("click",function(){d(e);let o=s(2);return u(o.httpPostListID("InboundLogistics/DeleteInboundLogistics"))}),f(2,"i",19),p(3," Delete"),i(),$()}}function Ra(t,r){if(t&1){let e=b();n(0,"button",20),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",21),p(2," Export"),i()}}function Aa(t,r){t&1&&(n(0,"a",22),p(1," New"),i()),t&2&&m("routerLink",N(1,Fa))}function Ba(t,r){if(t&1){let e=b();n(0,"div",23)(1,"h6"),p(2,"Outlet"),i(),n(3,"outlet-selector",24),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"Supplier"),i(),n(6,"autocompleteV2",25),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.SupplierID,o)||(c.pageData.Filter.SupplierID=o),u(o)}),i(),n(7,"h6"),p(8,"From"),i(),n(9,"datepicker",26),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(10,"h6"),p(11,"To"),i(),n(12,"datepicker",27),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",4),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),x("ngModel",e.pageData.Filter.SupplierID),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To)}}function Wa(t,r){if(t&1){let e=b();n(0,"th",28)(1,"input",29),g("change",function(o){d(e);let c=s(2);return u(c.onSelectAllData(o.target.checked))}),i()()}}function Ha(t,r){if(t&1){let e=b();n(0,"td",28)(1,"input",34),h("ngModelChange",function(o){d(e);let c=s().$implicit;return S(c.selected,o)||(c.selected=o),u(o)}),i()()}if(t&2){let e=s().$implicit;l(),x("ngModel",e.selected)}}function ja(t,r){if(t&1&&(n(0,"tbody")(1,"tr"),_(2,Ha,2,1,"td",12),n(3,"td"),p(4),i(),n(5,"td"),f(6,"a",30),i(),n(7,"td"),p(8),i(),n(9,"td"),f(10,"a",30),i(),n(11,"td"),p(12),v(13,"date"),i(),n(14,"td"),p(15),v(16,"date"),i(),n(17,"td",31)(18,"a",32),f(19,"i",33),i()()()()),t&2){let e=r.$implicit,a=s(2);l(2),m("ngIf",a.role.logistic.Delete),l(2),I(e.EntityName),l(2),m("routerLink",N(18,Va))("queryParams",M(19,Vr,e.ID))("innerHtml",e.Number,j),l(2),I(e.Name),l(2),m("routerLink",N(21,Na))("queryParams",M(22,Vr,e.SupplierInvoiceID))("innerHtml",e.PONumber,j),l(2),I(P(13,12,e.Date,"dd MMM yyyy")),l(3),I(P(16,15,e.Time,"HH:mm")),l(3),m("queryParams",Ae(24,ka,e.ID,e.PrintTemplateID))}}function Qa(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Number,o)||(c.pageData.Filter.Number=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,La,4,0,"ng-container",3)(3,Ra,3,0,"button",4),n(4,"div",5),_(5,Aa,2,2,"a",6),i()(),n(6,"filters"),_(7,Ba,13,8,"ng-template",null,0,Z),i(),n(9,"content")(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11),_(15,Wa,2,0,"th",12),n(16,"th",13),p(17,"Outlet"),i(),n(18,"th",13),p(19,"Number"),i(),n(20,"th",14),p(21,"Supplier"),i(),n(22,"th",13),p(23,"PO Number"),i(),n(24,"th",13),p(25,"Date"),i(),n(26,"th",15),p(27,"Time"),i(),f(28,"th"),i()(),_(29,ja,20,27,"tbody",16),i()(),n(30,"POS-complex-pagination",17),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.role.logistic.Delete&&e.getSelectedData().length>0),l(),m("ngIf",e.role.global.Export),l(2),m("ngIf",e.role.logistic.Create),l(10),m("ngIf",e.role.logistic.Delete),l(14),m("ngForOf",e.data.Data),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var tn=class t extends Se{constructor(e,a,o,c,w,H){super(e,a,"InboundLogistics/InboundLogisticsList","InboundLogisticsLoader/List",c);this.csvConverter=o;this.role=w;this.matDialog=H}openExportModal(){this.matDialog.open(Ie,{data:{title:"Inbound Logistics",exportTypes:[{ID:"InboundLogistics/InboundLogisticsList",Value:"Default",FileName:"Inbound Logistics"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"InboundLogistics/InboundLogisticsRowsCount",pagination:!0}})}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ee),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["CustomerDisplay-supplier-delivery"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["class","btn btn-success","role","button","matTooltipPosition","above","matTooltip","Add Delivery",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","120px"],[2,"width","500px"],[2,"width","90px"],[4,"ngFor","ngForOf"],["api","InboundLogistics/InboundLogisticsRowsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fas","fa-trash"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["role","button","matTooltipPosition","above","matTooltip","Add Delivery",1,"btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Supplier","inputID","SupplierID","notFoundMessageFor","supplier",1,"form-control","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],[2,"width","14px"],["type","checkbox",3,"change"],[3,"routerLink","queryParams","innerHtml"],[1,"text-end"],["routerLink","/print/InDelivery","target","_blank",3,"queryParams"],["aria-hidden","true",1,"fa","fa-print"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(a,o){a&1&&_(0,Qa,31,11,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,Dt,R,W,oe,de,We,Je,ke,Pe,he],encapsulation:2})};var nn=class t{constructor(r,e,a,o){this.data=r;this.dialogRef=e;this.httpService=a;this.toastr=o;this.modalConfig=new _e,this.modalConfig.title="Email receipt to customer?",this.modalConfig.customWidth="400px"}modalConfig;email;ngOnInit(){}onOk(){let r={email:this.email,invoiceID:this.data.invoiceID};this.httpService.post("/api/Transaction/SendDeliveryEmail",r).subscribe(e=>{this.toastr.success(`Invoice Sent Successful to ${this.email}`,ve.Success),this.dialogRef.close()})}onClose(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||t)(C(Ke),C(ye),C(k),C(ee))};static \u0275cmp=O({type:t,selectors:[["POS-modal-send-email"]],standalone:!1,decls:7,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"form-floating-outline"],["type","text","id","email","placeholder","Email",1,"form-control",3,"ngModelChange","ngModel"],["for","email"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.onOk()})("onCancel",function(){return a.onClose()})("onClose",function(){return a.onClose()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"input",3),h("ngModelChange",function(c){return S(a.email,c)||(a.email=c),c}),i(),n(5,"label",4),p(6,"Email"),i()()()()()),e&2&&(m("config",a.modalConfig),l(4),x("ngModel",a.email))},dependencies:[fe,Ce,R,W],encapsulation:2})};var Nr=()=>["/print/OutDelivery"],Ua=(t,r)=>({ID:t,Template:r}),za=(t,r)=>({ID:t,Template:r,Price:1}),$a=()=>["/menu/Orders/Order/Sales_Order/Info"],xi=t=>({ID:t}),Ga=()=>["/menu/Logistics/Archive/Outbound_Logistics/Form"],Ka=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Ja=()=>["/menu/Contacts/Contact/Customers/Info"];function Ya(t,r){if(t&1&&(n(0,"a",40),f(1,"i",41),p(2," Edit "),i()),t&2){let e=s(2);m("routerLink",N(2,Ga))("queryParams",M(3,xi,e.data.Fulfillment.ID))}}function Xa(t,r){if(t&1){let e=b();n(0,"a",42),g("click",function(){d(e);let o=s(2);return u(o.deleteData("OutboundLogistics/DeleteDeliveryCustomer"))}),f(1,"i",43),p(2," Delete "),i()}}function Za(t,r){if(t&1){let e=b();n(0,"li",44)(1,"a",45),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),p(2,"Export"),i()()}}function el(t,r){if(t&1){let e=b();n(0,"li",44)(1,"a",45),g("click",function(){d(e);let o=s(2);return u(o.openModalNote(o.data.Fulfillment.Note))}),p(2," Add Note "),i()()}}function tl(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"Invoice"),i(),n(3,"td"),p(4,":"),i(),n(5,"td")(6,"a",25),p(7),i()()()),t&2){let e=s(2);l(6),m("routerLink",N(3,Ka))("queryParams",M(4,xi,e.data.Order.InvoiceId)),l(),D(" ",e.data.Order.InvoiceNumber," ")}}function il(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"Date"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),v(7,"date"),i()()),t&2){let e=s(2);l(6),I(P(7,1,e.data.Order.InvoiceDate,"dd MMM yyyy"))}}function nl(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(3);l(6),I(e.data.Customer==null?null:e.data.Customer.Mobile)}}function ol(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"City"),i(),n(3,"td"),p(4,":"),i(),f(5,"td",47),i()),t&2){let e=s(3);l(5),m("innerHTML",e.data.Customer==null?null:e.data.Customer.Address,j)}}function rl(t,r){if(t&1&&(n(0,"div",14)(1,"div",27)(2,"h2"),f(3,"i",46),p(4,"Customer"),i()(),n(5,"div",21)(6,"table",22)(7,"tr")(8,"th",23),p(9,"Name"),i(),n(10,"td"),p(11,":"),i(),n(12,"td")(13,"a",25),p(14),i()()(),_(15,nl,7,1,"tr",24)(16,ol,6,1,"tr",24),i()()()),t&2){let e=s(2);l(13),m("routerLink",N(5,Ja))("queryParams",M(6,xi,e.data.Customer==null?null:e.data.Customer.ID)),l(),I(e.data.Customer==null?null:e.data.Customer.Name),l(),m("ngIf",e.data.Customer==null?null:e.data.Customer.Mobile),l(),m("ngIf",e.data.Customer==null?null:e.data.Customer.Address)}}function al(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"Name"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(3);l(6),I(e.data.Recipient.Name)}}function ll(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(3);l(6),I(e.data.Recipient.Phone)}}function pl(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"City"),i(),n(3,"td"),p(4,":"),i(),f(5,"td",47),i()),t&2){let e=s(3);l(5),m("innerHTML",e.data.Recipient.Address,j)}}function ml(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(3);l(6),I(e.data.Recipient.City)}}function cl(t,r){if(t&1&&(n(0,"div",14)(1,"div",27)(2,"h2"),f(3,"i",46),p(4,"Recipient"),i()(),n(5,"div",21)(6,"table",22),_(7,al,7,1,"tr",24)(8,ll,7,1,"tr",24)(9,pl,6,1,"tr",24)(10,ml,7,1,"tr",24),i()()()),t&2){let e=s(2);l(7),m("ngIf",e.data.Recipient.Name),l(),m("ngIf",e.data.Recipient.Phone),l(),m("ngIf",e.data.Recipient.Address),l(),m("ngIf",e.data.Recipient.City)}}function sl(t,r){if(t&1&&(z(0),f(1,"app-serial-note",51),$()),t&2){let e=s().$implicit;l(),m("serials",e.Serial)}}function dl(t,r){if(t&1&&f(0,"p",52),t&2){let e=s().$implicit;m("innerHTML",e.Note,j)}}function ul(t,r){if(t&1&&(n(0,"tr")(1,"td"),p(2),i(),n(3,"td")(4,"a",48),p(5),i(),n(6,"div"),p(7),i(),_(8,sl,2,1,"ng-container",24)(9,dl,1,1,"p",49),i(),n(10,"td",50),p(11),v(12,"quantityFraction"),n(13,"div"),p(14),i()()()),t&2){let e=r.$implicit,a=r.index;l(2),I(a+1+"."),l(2),m("queryParams",M(10,xi,e.VariantID)),l(),D(" ",e.Name," "),l(2),I(e.Code),l(),m("ngIf",e.Serial),l(),m("ngIf",e.Note!=null),l(2),D(" ",E(12,8,e.Quantity)," "),l(3),I(e.UOMName)}}function _l(t,r){if(t&1&&(n(0,"div",14)(1,"div",27)(2,"h2"),f(3,"i",53),p(4,"Note"),i()(),f(5,"div",54),i()),t&2){let e=s(2);l(5),m("innerHTML",e.data.Fulfillment.Note,j)}}function fl(t,r){if(t&1&&(n(0,"span")(1,"b"),p(2,"Modified:"),i(),p(3),v(4,"date"),i()),t&2){let e=s(3);l(3),Qe(" ",P(4,2,e.data.CreatedInfo.Modified.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo.Modified.User," ")}}function gl(t,r){if(t&1&&(n(0,"div",55),f(1,"i",56),n(2,"span")(3,"b"),p(4," Created:"),i(),p(5),v(6,"date"),i(),_(7,fl,5,5,"span",24),i()),t&2){let e=s(2);l(5),Qe(" ",P(6,3,e.data.CreatedInfo.Created.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo.Created.User," "),l(2),m("ngIf",e.data.CreatedInfo.Modified==null?null:e.data.CreatedInfo.Modified.Date)}}function Cl(t,r){if(t&1&&(n(0,"mainpanel-cmp",1)(1,"actions")(2,"div",2)(3,"a",3),f(4,"i",4),p(5," Print "),i(),f(6,"button",5),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Print with Cost"),i()()()(),n(11,"div",8),_(12,Ya,3,5,"a",9)(13,Xa,3,0,"a",10),i()(),n(14,"content")(15,"div",11)(16,"div",12)(17,"div",13)(18,"div",14)(19,"div",15)(20,"div")(21,"h2"),f(22,"i",16),p(23,"Order "),n(24,"small",17),p(25),i()()(),n(26,"div",8)(27,"button",5),f(28,"b",18),i(),n(29,"ul",19),_(30,Za,3,0,"li",20)(31,el,3,0,"li",20),i()()(),n(32,"div",21)(33,"table",22)(34,"tr")(35,"th",23),p(36,"Outlet"),i(),n(37,"td"),p(38,":"),i(),n(39,"td"),p(40),i()(),z(41),_(42,tl,8,6,"tr",24)(43,il,8,4,"tr",24),$(),n(44,"tr")(45,"th",23),p(46,"SO Number"),i(),n(47,"td"),p(48,":"),i(),n(49,"td")(50,"a",25),p(51),i()()(),n(52,"tr")(53,"th",23),p(54,"SO Date"),i(),n(55,"td"),p(56,":"),i(),n(57,"td"),p(58),v(59,"date"),i()()()()(),_(60,rl,17,8,"div",26)(61,cl,11,4,"div",26),n(62,"div",14)(63,"div",27)(64,"h2"),f(65,"i",28),p(66,"Fulfillment"),i()(),n(67,"div",21)(68,"table",22)(69,"tr")(70,"th",23),p(71,"Outlet"),i(),n(72,"td"),p(73,":"),i(),n(74,"td"),p(75),i()(),n(76,"tr")(77,"th",23),p(78,"Date"),i(),n(79,"td"),p(80,":"),i(),n(81,"td"),p(82),v(83,"date"),i()(),n(84,"tr")(85,"th",23),p(86,"Number"),i(),n(87,"td"),p(88,":"),i(),n(89,"td"),p(90),i()(),n(91,"tr")(92,"th",23),p(93,"Courier"),i(),n(94,"td"),p(95,":"),i(),n(96,"td"),p(97),i()()()()()(),n(98,"div",29)(99,"div",14)(100,"div",27)(101,"h2"),f(102,"i",30),p(103,"Products"),i()(),n(104,"div",21)(105,"table",31)(106,"thead",32)(107,"tr")(108,"th",33),p(109,"No."),i(),n(110,"th"),p(111,"Products"),i(),n(112,"th",23),p(113,"Qty"),i()()(),n(114,"tbody"),_(115,ul,15,12,"tr",34),i(),n(116,"tfoot",35)(117,"tr")(118,"td",36),p(119," Total "),i(),n(120,"td",37),p(121),v(122,"sum"),v(123,"quantityFraction"),i()()()()()(),_(124,_l,6,1,"div",26),i(),n(125,"div",38),_(126,gl,8,6,"div",39),i()()()()()),t&2){let e=s();m("pageData",e.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(3),m("routerLink",N(40,Nr))("queryParams",Ae(41,Ua,e.data.Fulfillment.ID,e.data.PrintConfig.ID)),l(6),m("routerLink",N(44,Nr))("queryParams",Ae(45,za,e.data.Fulfillment.ID,e.data.PrintConfig.ID)),l(3),m("ngIf",e.role.logistic.Edit&&e.data.WriteAccess),l(),m("ngIf",e.role.logistic.Delete),l(12),D(" (",e.data.Fulfillment.Status,") "),l(5),m("ngIf",e.role.global.Export),l(),m("ngIf",e.data.Fulfillment.Note==null),l(9),I(e.data.Order.OutletName),l(2),m("ngIf",e.data.Order.InvoiceNumber),l(),m("ngIf",e.data.Order.InvoiceDate),l(7),m("routerLink",N(48,$a))("queryParams",M(49,xi,e.data.Order.SalesOrderId)),l(),D(" ",e.data.Order.SalesOrderNumber," "),l(7),D(" ",P(59,29,e.data.Order.SalesOrderDate,"dd MMM yyyy")," "),l(2),m("ngIf",e.data.Customer==null?null:e.data.Customer.ID),l(),m("ngIf",(e.data.Recipient==null?null:e.data.Recipient.ID)!=e.guidEmpty),l(14),D(" ",e.data.Fulfillment.OutletName," "),l(7),D(" ",P(83,32,e.data.Fulfillment.Date,"dd MMM yyyy")," "),l(8),D(" ",e.data.Fulfillment.Number," "),l(7),D(" ",e.data.Fulfillment.Courier," "),l(18),m("ngForOf",e.data.Items),l(6),D(" ",E(123,38,P(122,35,e.data.Items,"Quantity"))," "),l(3),m("ngIf",e.data==null?null:e.data.Fulfillment.Note),l(2),m("ngIf",!e.role.users.LogRestriction)}}var on=class t extends Tr{constructor(e,a,o,c,w,H,ie,Ue){super(e,a,"OutboundLogistics/Info",c);this.httpService=a;this.csvConverter=o;this.toaster=w;this.router=H;this.role=ie;this.matDialog=Ue}guidEmpty=T.GuidEmpty;openExportModal(){this.matDialog.open(Ie,{data:{title:"Outbound Logistics",exportTypes:[{ID:"OutboundLogistics/ExportInfo",Value:"Default"}],filterExport:{},getAllDataLengthAPI:"",pagination:!1}})}postBindData(e){e.Items=e.Items.filter(a=>a.Quantity!=0),this.menuData.H=`Outbound Logistics #${e.Fulfillment.Number}`}deleteData(e){confirm("Are you sure you want to delete this?")&&this.httpService.delete(`/API/${e}`,{params:[{key:"ID",value:this.data.Fulfillment.ID}]}).subscribe(()=>{this.toaster.success("Records are removed.","Success"),this.router.navigate(["/menu/Logistics/Archive/Outbound_Logistics"])})}openEmailDialog(){this.matDialog.open(nn,{data:{invoiceID:this.data.ID}})}exportCSV(e,a,o){o=o||"export.csv",this.httpService.post(`/api/${a}`,this.data.Fulfillment).subscribe(c=>{e.convertToCSV(c,o)})}onUpdate(e,a){this.httpService.post(`/api/${e}`,a).subscribe(o=>{this.reload()})}reload(){let e="OutboundLogistics/Info",a={ID:this.data.Fulfillment.ID};this.httpService.post(`/api/${e}`,a).subscribe({next:o=>{this.data=o}})}openModalNote(e){this.matDialog.open(Or,{data:e.SONote}).afterClosed().subscribe(o=>{if(e){var c={ID:this.data.Fulfillment.ID,Note:o};this.onUpdate("OutboundLogistics/UpdateNoteOutboundLogistics",c)}})}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(pe),C(ee),C(at),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-customer-delivery-detail"]],standalone:!1,features:[re],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"btn-group","me-5"],["target","_blank",1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-print"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu",2,"cursor","pointer"],["target","_blank",1,"dropdown-item",3,"routerLink","queryParams"],[1,"btn-group"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-4"],[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"fa-solid","fa-receipt","me-5"],[1,"text-body-secondary","h6"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end","cursor","text-dark"],["class","dropdown-item",4,"ngIf"],[1,"card-body"],[1,"table-sm","table-borderless"],[2,"width","80px"],[4,"ngIf"],["target","_blank",1,"ps-0",3,"routerLink","queryParams"],["class","card",4,"ngIf"],[1,"card-header"],[1,"fa-solid","fa-truck","me-5"],[1,"col-8"],[1,"fa-solid","fa-box","me-5"],[1,"table"],[1,"thead-light"],[2,"width","40px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","2",1,"text-end","empty-column","fw-bold"],[1,"text-center","empty-column","fw-bold"],[1,"col-12"],["class","alert alert-warning",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash"],[1,"dropdown-item"],[3,"click"],[1,"fa-solid","fa-address-card","me-5"],[3,"innerHTML"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],["class","special-TinyMCE fst-italic text-warning mb-0","style","word-break: break-all",3,"innerHTML",4,"ngIf"],[1,"text-center"],[3,"serials"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],[1,"fa-solid","fa-note-sticky","me-5"],[1,"card-body",3,"innerHTML"],[1,"alert","alert-warning"],["aria-hidden","true",1,"fa-regular","fa-file-lines"]],template:function(a,o){a&1&&_(0,Cl,127,51,"mainpanel-cmp",0),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,oe,dt,he,Be,ri],encapsulation:2})};var kr=t=>({ID:t}),vl=()=>["/menu/Outlets/Master/Outlets/Form"];function yl(t,r){if(t&1){let e=b();n(0,"button",18),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",19),p(2," Export"),i()}}function xl(t,r){if(t&1){let e=b();n(0,"div",20)(1,"h6"),p(2,"Outlet"),i(),n(3,"outlet-selector",21),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"From"),i(),n(6,"datepicker",22),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(7,"h6"),p(8,"To"),i(),n(9,"datepicker",23),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i(),n(10,"h6"),p(11,"Supplier"),i(),n(12,"autocompleteV2",24),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.SupplierID,o)||(c.pageData.Filter.SupplierID=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",4),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("ngModel",e.pageData.Filter.SupplierID)}}function Sl(t,r){t&1&&(n(0,"th"),p(1,"Outlet"),i())}function hl(t,r){t&1&&(n(0,"th",25),p(1,"Total"),i())}function bl(t,r){if(t&1&&(n(0,"td")(1,"a",29),p(2),i()()),t&2){let e=s().$implicit;l(),m("routerLink",N(3,vl))("queryParams",M(4,kr,e.EntityID)),l(),I(e.EntityName)}}function Dl(t,r){if(t&1&&(n(0,"td",27),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),I(E(2,1,e.Total))}}function Il(t,r){if(t&1&&(n(0,"tr")(1,"td"),p(2),i(),n(3,"td")(4,"a",26),p(5),i()(),_(6,bl,3,6,"td",9),n(7,"td",27),p(8),v(9,"number"),i(),_(10,Dl,3,3,"td",28),i()),t&2){let e=r.$implicit,a=s(2);l(2),I(e.VariantCode),l(2),m("queryParams",M(8,kr,e.VariantID)),l(),I(e.VariantName),l(),m("ngIf",!a.data.isOutlet),l(2),I(E(9,6,e.Quantity)),l(2),m("ngIf",a.roleService.sell.Create)}}function Tl(t,r){t&1&&f(0,"td",30)}function wl(t,r){if(t&1&&(n(0,"td",16),p(1),v(2,"sum"),v(3,"number"),i()),t&2){let e=s(2);l(),D(" ",E(3,4,P(2,1,e.data.Data,"Total")),"")}}function Ol(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,yl,3,0,"button",3),i(),n(3,"filters"),_(4,xl,13,8,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Code"),i(),n(14,"th"),p(15,"Variant"),i(),_(16,Sl,2,0,"th",9),n(17,"th",10),p(18,"Qty"),i(),_(19,hl,2,0,"th",11),i()(),n(20,"tbody"),_(21,Il,11,10,"tr",12),i(),n(22,"tfoot")(23,"tr",13),_(24,Tl,1,0,"td",14),n(25,"td",15),p(26,"Total :"),i(),n(27,"td",16),p(28),v(29,"sum"),v(30,"number"),i(),_(31,wl,4,6,"td",17),i()()()()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(14),m("ngIf",!e.data.isOutlet),l(3),m("ngIf",e.roleService.sell.Create),l(2),m("ngForOf",e.data.Data),l(3),m("ngIf",!e.data.isOutlet),l(4),D("",E(30,14,P(29,11,e.data.Data,"Quantity"))," "),l(3),m("ngIf",e.roleService.sell.Create)}}var rn=class t extends Se{constructor(e,a,o,c,w){super(e,a,"OutboundLogistics/GetOutStockReportProduct","OutboundLogisticsLoader/GetOutStockReporProduct");this.csvConverter=o;this.roleService=c;this.matDialog=w}openExportModal(){this.matDialog.open(Ie,{data:{title:"Out Stock Report By Product",exportTypes:[{ID:"OutboundLogistics/GetOutStockReportProduct",Value:"Default",FileName:"Out Stock Report By Product"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}sortByOptions=[{Key:!1,Value:"Code"},{Key:!0,Value:"Name"}];static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-report-outgoing-product"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","80px"],[4,"ngIf"],[1,"text-end",2,"width","200px"],["style","width:150px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","text-end empty-column",4,"ngIf"],["colspan","2",1,"text-end","empty-column"],[1,"text-end",2,"background","#F0E68C"],["class","text-end","style","background: #F0E68C;",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Supplier","inputID","SupplierID",1,"form-control","ac-filter",3,"ngModelChange","ngModel"],[1,"text-end",2,"width","150px"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","empty-column"]],template:function(a,o){a&1&&_(0,Ol,32,16,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,We,Pe,ge,Be],encapsulation:2})};var El=()=>["/menu/Logistics/Archive/Outbound_Logistics/Info"],io=t=>({ID:t}),Ml=()=>["/menu/Contacts/Contact/Customers/Info"];function Pl(t,r){if(t&1){let e=b();n(0,"button",15),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",16),p(2," Export"),i()}}function Fl(t,r){if(t&1){let e=b();n(0,"div",17)(1,"h6"),p(2,"Outlet"),i(),n(3,"outlet-selector",18),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"From"),i(),n(6,"datepicker",19),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(7,"h6"),p(8,"To"),i(),n(9,"datepicker",20),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",4),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To)}}function Vl(t,r){t&1&&(n(0,"th",21),p(1,"Price"),i())}function Nl(t,r){t&1&&(n(0,"th",21),p(1,"Total"),i())}function kl(t,r){if(t&1&&(n(0,"td",38),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),I(P(2,1,e.Price,"1.0-2"))}}function Ll(t,r){if(t&1&&(n(0,"td",38),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),I(P(2,1,e.Total,"1.0-2"))}}function Rl(t,r){if(t&1&&(n(0,"tr")(1,"td",33)(2,"a",34),p(3),i()(),n(4,"td",35),p(5),i(),n(6,"td",36),p(7),v(8,"number"),i(),_(9,kl,3,4,"td",37)(10,Ll,3,4,"td",37),i()),t&2){let e=r.$implicit,a=s(3);l(2),m("queryParams",M(9,io,e.VariantID)),l(),I(e.VariantName),l(2),D(" ",e.VariantCode,""),l(2),D(" ",P(8,6,e.Quantity,"1.0-2"),""),l(2),m("ngIf",a.roleService.sell.PriceVisible),l(),m("ngIf",a.roleService.sell.PriceVisible)}}function Al(t,r){t&1&&(n(0,"th",39),p(1,"Amount : "),i())}function Bl(t,r){if(t&1&&(n(0,"th",39),p(1),v(2,"sum"),v(3,"number"),i()),t&2){let e=s().$implicit;l(),I(P(3,4,P(2,1,e.Variant,"Total"),"1.0-2"))}}function Wl(t,r){if(t&1&&(n(0,"div",22)(1,"div")(2,"a",23)(3,"span",24),p(4),i()(),n(5,"span"),p(6),v(7,"date"),i(),n(8,"span"),p(9),i(),n(10,"a",25),p(11),i()(),n(12,"table",26),f(13,"thead"),n(14,"tbody",27),_(15,Rl,11,11,"tr",28),i()(),n(16,"table",26),f(17,"thead"),n(18,"tbody",29)(19,"tr"),f(20,"th",30),n(21,"th",31),p(22,"Total Qty : "),i(),n(23,"th",10),p(24),v(25,"sum"),v(26,"number"),i(),_(27,Al,2,0,"th",32)(28,Bl,4,7,"th",32),i()()()()),t&2){let e=r.$implicit,a=s(2);l(2),m("routerLink",N(20,El))("queryParams",M(21,io,e.OrderDeliveryID)),l(2),I(e.OutletName+" #"+e.Number),l(2),D(" "," - "+P(7,12,e.Date,"dd MMM yyyy")," "),l(3),D(" "," - "," "),l(),m("routerLink",N(23,Ml))("queryParams",M(24,io,e.CustomerID)),l(),I(e.CustomerName),l(4),m("ngForOf",e.Variant),l(9),I(E(26,18,P(25,15,e.Variant,"Quantity"))),l(3),m("ngIf",a.roleService.sell.PriceVisible),l(),m("ngIf",a.roleService.sell.PriceVisible)}}function Hl(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,Pl,3,0,"button",3),i(),n(3,"filters"),_(4,Fl,10,7,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Name"),i(),n(14,"th",9),p(15,"Code"),i(),n(16,"th",10),p(17,"Qty"),i(),_(18,Vl,2,0,"th",11)(19,Nl,2,0,"th",11),i()(),n(20,"tbody")(21,"tr")(22,"td",12),_(23,Wl,29,26,"div",13),i()()()()(),n(24,"POS-complex-pagination",14),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(16),m("ngIf",e.roleService.sell.PriceVisible),l(),m("ngIf",e.roleService.sell.PriceVisible),l(4),m("ngForOf",e.data.Data),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var an=class t extends Se{constructor(e,a,o,c,w){super(e,a,"OutboundLogistics/GetOutStockReportDetail","OutboundLogisticsLoader/GetOutStockReporProduct");this.csvConverter=o;this.roleService=c;this.matDialog=w}openExportModal(){this.matDialog.open(Ie,{data:{title:"Report Outgoing Detail",exportTypes:[{ID:"OutboundLogistics/GetOutStockReportDetail",Value:"Default",FileName:"Report Outgoing Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"OutboundLogistics/GetOutStockReportDetailCount",pagination:!0}})}sortByOptions=[{Key:!1,Value:"Code"},{Key:!0,Value:"Name"}];static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-report-outgoing-detail"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","400px"],[2,"width","150px"],[1,"text-end",2,"width","30px"],["class","text-end","style","width: 150px",4,"ngIf"],["colspan","5",1,"px-0","border-bottom-0"],["class","mb-5",4,"ngFor","ngForOf"],["api","OutboundLogistics/GetOutStockReportDetailCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],[1,"text-end",2,"width","150px"],[1,"mb-5"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-4"],[3,"routerLink","queryParams"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[4,"ngFor","ngForOf"],[1,"table","table-sm"],[2,"width","645px"],[1,"text-end",2,"width","75px"],["style","width: 90px","class","text-end",4,"ngIf"],[1,"border-start","border-end",2,"width","400px"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"border-start","border-end",2,"width","150px"],[1,"text-end","border-start","border-end",2,"width","30px"],["class","text-end border-start border-end","style","width: 150px",4,"ngIf"],[1,"text-end","border-start","border-end",2,"width","150px"],[1,"text-end",2,"width","90px"]],template:function(a,o){a&1&&_(0,Hl,25,10,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,Je,Pe,ge,he,Be],encapsulation:2})};var Lr=t=>({ID:t}),jl=()=>["/menu/Outlets/Master/Outlets/Form"];function Ql(t,r){if(t&1){let e=b();n(0,"button",18),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",19),p(2," Export"),i()}}function ql(t,r){if(t&1){let e=b();n(0,"div",20)(1,"h6"),p(2,"Outlet"),i(),n(3,"outlet-selector",21),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"From"),i(),n(6,"datepicker",22),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(7,"h6"),p(8,"To"),i(),n(9,"datepicker",23),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",2)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.EntityID),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To)}}function Ul(t,r){t&1&&(n(0,"th"),p(1,"Outlet"),i())}function zl(t,r){t&1&&(n(0,"th",10),p(1,"Total"),i())}function $l(t,r){if(t&1&&(n(0,"td")(1,"a",27),p(2),i()()),t&2){let e=s().$implicit;l(),m("routerLink",N(3,jl))("queryParams",M(4,Lr,e.EntityID)),l(),I(e.EntityName)}}function Gl(t,r){if(t&1&&(n(0,"td",25),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),I(E(2,1,e.Total))}}function Kl(t,r){if(t&1&&(n(0,"tr")(1,"td")(2,"a",24),p(3),i()(),n(4,"td"),p(5),i(),_(6,$l,3,6,"td",9),n(7,"td",25),p(8),v(9,"number"),i(),_(10,Gl,3,3,"td",26),i()),t&2){let e=r.$implicit,a=s(2);l(2),m("queryParams",M(8,Lr,e.VariantID)),l(),I(e.VariantCode),l(2),I(e.VariantName),l(),m("ngIf",!a.data.isOutlet),l(2),I(E(9,6,e.Quantity)),l(2),m("ngIf",a.roleService.product.Cost)}}function Jl(t,r){t&1&&f(0,"td",28)}function Yl(t,r){if(t&1&&(n(0,"td",16),p(1),v(2,"sum"),v(3,"number"),i()),t&2){let e=s(2);l(),D(" ",E(3,4,P(2,1,e.data.List,"Total")),"")}}function Xl(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,Ql,3,0,"button",3),i(),n(3,"filters"),_(4,ql,10,7,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Code"),i(),n(14,"th"),p(15,"Variant"),i(),_(16,Ul,2,0,"th",9),n(17,"th",10),p(18,"Qty"),i(),_(19,zl,2,0,"th",11),i()(),n(20,"tbody"),_(21,Kl,11,10,"tr",12),i(),n(22,"tfoot")(23,"tr",13),_(24,Jl,1,0,"td",14),n(25,"td",15),p(26,"Total :"),i(),n(27,"td",16),p(28),v(29,"sum"),v(30,"number"),i(),_(31,Yl,4,6,"td",17),i()()()()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(14),m("ngIf",!e.data.isOutlet),l(3),m("ngIf",e.roleService.product.Cost),l(2),m("ngForOf",e.data.List),l(3),m("ngIf",!e.data.isOutlet),l(4),D("",E(30,14,P(29,11,e.data.List,"Quantity"))," "),l(3),m("ngIf",e.roleService.product.Cost)}}var ln=class t extends Se{constructor(e,a,o,c,w){super(e,a,"InboundLogistics/GetInStockReportProduct","InboundLogisticsLoader/GetInStockReporProduct");this.csvConverter=o;this.roleService=c;this.matDialog=w}openExportModal(){this.matDialog.open(Ie,{data:{title:"Product Stock In Report",exportTypes:[{ID:"InboundLogistics/GetInStockReportProduct",Value:"Default",FileName:"Product Stock In Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}sortByOptions=[{Key:!1,Value:"Code"},{Key:!0,Value:"Name"}];static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-report-incoming-product"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","80px"],[4,"ngIf"],[1,"text-end",2,"width","50px"],["style","width:50px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","text-end empty-column",4,"ngIf"],["colspan","2",1,"text-end","empty-column"],[1,"text-end",2,"background","#F0E68C"],["class","text-end","style","background: #F0E68C;",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","outlets","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","empty-column"]],template:function(a,o){a&1&&_(0,Xl,32,16,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,Pe,ge,Be],encapsulation:2})};var Zl=()=>["/menu/Logistics/Archive/Inbound_Logistics/Info"],no=t=>({ID:t});function ep(t,r){if(t&1){let e=b();n(0,"button",15),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",16),p(2," Export"),i()}}function tp(t,r){if(t&1){let e=b();n(0,"div",17)(1,"h6"),p(2,"Outlet"),i(),n(3,"outlet-selector",18),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"From"),i(),n(6,"datepicker",19),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(7,"h6"),p(8,"To"),i(),n(9,"datepicker",20),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i(),n(10,"h6"),p(11,"Supplier"),i(),n(12,"autocompleteV2",21),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.SupplierID,o)||(c.pageData.Filter.SupplierID=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",2)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.EntityID),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("ngModel",e.pageData.Filter.SupplierID)}}function ip(t,r){t&1&&(n(0,"th",22),p(1,"Cost"),i())}function np(t,r){t&1&&(n(0,"th",22),p(1,"Total"),i())}function op(t,r){if(t&1&&(n(0,"span"),p(1," - "),n(2,"span")(3,"a",32),p(4),i()()()),t&2){let e=s().$implicit;l(3),m("queryParams",M(2,no,e.SupplierID)),l(),D(" ",e.SupplierName," ")}}function rp(t,r){if(t&1&&(n(0,"td",38),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D("",P(2,1,e.UnitCost,"1.0-2")," ")}}function ap(t,r){if(t&1&&(n(0,"td",38),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D("",P(2,1,e.Total,"1.0-2")," ")}}function lp(t,r){if(t&1&&(n(0,"tr")(1,"td",33)(2,"a",34),p(3),i()(),n(4,"td",35),p(5),i(),n(6,"td",36),p(7),i(),_(8,rp,3,4,"td",37)(9,ap,3,4,"td",37),i()),t&2){let e=r.$implicit,a=s(3);l(2),m("queryParams",M(6,no,e.VariantID)),l(),I(e.VariantName),l(2),D(" ",e.VariantCode,""),l(2),D(" ",e.Quantity,""),l(),m("ngIf",a.roleService.product.Cost),l(),m("ngIf",a.roleService.product.Cost)}}function pp(t,r){t&1&&(n(0,"th",22),p(1,"Amount : "),i())}function mp(t,r){if(t&1&&(n(0,"th",22),p(1),v(2,"sum"),v(3,"number"),i()),t&2){let e=s().$implicit;l(),I(P(3,4,P(2,1,e.Variant,"Total"),"1.0-2"))}}function cp(t,r){if(t&1&&(n(0,"div",23)(1,"div")(2,"a",24)(3,"span",25),p(4),i()(),n(5,"span"),p(6),v(7,"date"),i(),n(8,"span"),p(9),v(10,"date"),i(),_(11,op,5,4,"span",26),i(),n(12,"table",27),f(13,"thead"),n(14,"tbody",28),_(15,lp,10,8,"tr",29),i()(),n(16,"table",27),f(17,"thead"),n(18,"tbody",30)(19,"tr"),f(20,"th",8),n(21,"th",9),p(22,"Total Qty : "),i(),n(23,"th",10),p(24),v(25,"sum"),v(26,"number"),i(),_(27,pp,2,0,"th",31)(28,mp,4,7,"th",31),i()()()()),t&2){let e=r.$implicit,a=s(2);l(2),m("routerLink",N(21,Zl))("queryParams",M(22,no,e.InDeliveryID)),l(2),I(e.OutletName+" #"+e.InDeliveryNumber),l(2),D(" "," - In Date: "+P(7,10,e.InDeliveryDate,"dd MMM yyyy")," "),l(3),D(" "," - PO Date: "+P(10,13,e.PODate,"dd MMM yyyy")," "),l(2),m("ngIf",e.SupplierName),l(4),m("ngForOf",e.Variant),l(9),I(E(26,19,P(25,16,e.Variant,"Quantity"))),l(3),m("ngIf",a.roleService.product.Cost),l(),m("ngIf",a.roleService.product.Cost)}}function sp(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,ep,3,0,"button",3),i(),n(3,"filters"),_(4,tp,13,8,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Name"),i(),n(14,"th",9),p(15,"Code"),i(),n(16,"th",10),p(17,"Qty"),i(),_(18,ip,2,0,"th",11)(19,np,2,0,"th",11),i()(),n(20,"tbody")(21,"tr")(22,"td",12),_(23,cp,29,24,"div",13),i()()()()(),n(24,"POS-complex-pagination",14),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(16),m("ngIf",e.roleService.product.Cost),l(),m("ngIf",e.roleService.product.Cost),l(4),m("ngForOf",e.data.Data),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var pn=class t extends Se{constructor(e,a,o,c,w){super(e,a,"InboundLogistics/GetInStockReportDetail","InboundLogisticsLoader/GetInStockReporProduct");this.csvConverter=o;this.roleService=c;this.matDialog=w}openExportModal(){this.matDialog.open(Ie,{data:{title:"Stock In Report",exportTypes:[{ID:"InboundLogistics/GetInStockReportDetail",Value:"Default",FileName:"Stock In Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"InboundLogistics/GetInStockReportDetailCount",pagination:!0}})}sortByOptions=[{Key:!1,Value:"Code"},{Key:!0,Value:"Name"}];static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-report-incoming-detail"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[1,"text-end",2,"width","75px"],[1,"text-end",2,"width","30px"],["class","text-end","style","width: 90px",4,"ngIf"],["colspan","5",1,"px-0","border-bottom-0"],["class","mb-5",4,"ngFor","ngForOf"],["api","InboundLogistics/GetInStockReportDetailCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","outlets","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Supplier","inputID","SupplierID",1,"form-control","ac-filter",3,"ngModelChange","ngModel"],[1,"text-end",2,"width","90px"],[1,"mb-5"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-4"],[4,"ngIf"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[4,"ngFor","ngForOf"],[1,"table","table-sm","table-borderless"],["style","width: 90px","class","text-end",4,"ngIf"],["routerLink","/menu/Contacts/Contact/Suppliers/Info",3,"queryParams"],[1,"border-start","border-end",2,"width","645px"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"border-start","border-end",2,"width","75px"],[1,"text-end","border-start","border-end",2,"width","30px"],["class","text-end border-start border-end","style","width: 90px",4,"ngIf"],[1,"text-end","border-start","border-end",2,"width","90px"]],template:function(a,o){a&1&&_(0,sp,25,10,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,We,Je,Pe,ge,he,Be],encapsulation:2})};var up=t=>({ID:t});function _p(t,r){if(t&1){let e=b();n(0,"button",13),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",14),p(2," Export "),i()}}function fp(t,r){if(t&1){let e=b();n(0,"div",15)(1,"h6"),p(2,"Courier"),i(),n(3,"ng-select",16),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CourierID,o)||(c.pageData.Filter.CourierID=o),u(o)}),i(),n(4,"h6"),p(5,"Category"),i(),n(6,"POS-product-category-select",17),h("selectedCategoryIDChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CategoryID,o)||(c.pageData.Filter.CategoryID=o),u(o)}),i(),n(7,"h6"),p(8,"From"),i(),n(9,"datepicker",18),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),g("dateChange",function(){d(e);let o=s(2);return u(o.getListData())}),i(),n(10,"h6"),p(11,"To"),i(),n(12,"datepicker",19),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),g("dateChange",function(){d(e);let o=s(2);return u(o.getListData())}),i(),n(13,"h6"),p(14,"Scope"),i(),n(15,"radio-options",20),h("modelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.Product,o)||(c.pageData.Filter.Product=o),u(o)}),g("modelChange",function(){d(e);let o=s(2);return u(o.getListData())}),i(),n(16,"h6"),p(17,"Product"),i(),n(18,"autocompleteV2",21),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.ProductID,o)||(c.pageData.Filter.ProductID=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Courier),x("ngModel",e.pageData.Filter.CourierID),l(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),m("options",e.scopeOptions),x("model",e.pageData.Filter.Product),l(3),x("ngModel",e.pageData.Filter.ProductID),m("inputTextValue",e.pageData.Filter.Name)}}function gp(t,r){if(t&1&&(n(0,"th",11),p(1),i()),t&2){let e=r.$implicit;l(),D(" ",e," ")}}function Cp(t,r){if(t&1&&(n(0,"td",11),p(1),i()),t&2){let e=r.$implicit;l(),D(" ",e," ")}}function vp(t,r){if(t&1&&(n(0,"tr")(1,"td")(2,"a",22),p(3),i()(),n(4,"td",23),p(5),i(),_(6,Cp,2,1,"td",10),n(7,"td",11),p(8),i()()),t&2){let e=r.$implicit,a=s(2);l(2),m("routerLink","/menu/Products/Catalog/"+(a.pageData.Filter.Product?"Products":"Variants")+"/Info")("queryParams",M(6,up,e.ID)),l(),D(" ",e.Name," "),l(2),I(e.Code),l(),m("ngForOf",e.Quantities),l(2),I(e.Total)}}function yp(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,_p,3,0,"button",3),i(),n(3,"filters"),_(4,fp,19,12,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Name"),i(),n(14,"th",9),p(15,"Code"),i(),_(16,gp,2,1,"th",10),n(17,"th",11),p(18,"Total"),i()()(),n(19,"tbody"),_(20,vp,9,8,"tr",12),i()()()()()()}if(t&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(14),m("ngForOf",e.data.Outlet),l(4),m("ngForOf",e.data.Data)}}var mn=class t extends Se{constructor(e,a,o,c,w,H){super(e,a,"TransferOrder/DeliveryOutletByProduct","TransferOrderLoader/DeliveryOutletByProduct",null,w);this.csvConverter=o;this.roleService=c;this.matDialog=H}openExportModal(){this.matDialog.open(Ie,{data:{title:"In Stock Report By Product",exportTypes:[{ID:"TransferOrder/DeliveryOutletByProduct",Value:"Default",FileName:"In Stock Report By Product"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}scopeOptions=[{Key:!1,Value:"Variant"},{Key:!0,Value:"Product"}];static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(pe),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-report-transfer-product"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","hideSearchBox","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%","text-align","right"],["class","text-end",4,"ngFor","ngForOf"],[1,"text-end"],[4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"ngModelChange","items","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["name","scopeOptions",3,"modelChange","options","model"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Product","inputID","ProductID",1,"form-control","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],[3,"routerLink","queryParams"],[2,"text-align","right"]],template:function(a,o){a&1&&_(0,yp,21,8,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,Ht,We,Ee,li],encapsulation:2})};var xp=()=>["/menu/Logistics/Archive/Transfer_Order/Info"],Rr=t=>({ID:t}),Sp=t=>({"bg-gradient-warning":t});function hp(t,r){if(t&1){let e=b();n(0,"button",16),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",17),p(2," Export "),i()}}function bp(t,r){if(t&1){let e=b();n(0,"div",18)(1,"h6"),p(2,"Source"),i(),n(3,"outlet-selector",19),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"Destination"),i(),n(6,"outlet-selector",20),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.DestinationID,o)||(c.pageData.Filter.DestinationID=o),u(o)}),i(),n(7,"h6"),p(8,"From"),i(),n(9,"datepicker",21),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(10,"h6"),p(11,"To"),i(),n(12,"datepicker",22),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i(),n(13,"h6"),p(14,"Category"),i(),n(15,"POS-product-category-select",23),h("selectedCategoryIDChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CategoryID,o)||(c.pageData.Filter.CategoryID=o),u(o)}),i(),n(16,"h6"),p(17,"Type"),i(),n(18,"ng-select",24),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.TypeID,o)||(c.pageData.Filter.TypeID=o),u(o)}),i(),n(19,"h6"),p(20,"Delivery"),i(),n(21,"ng-select",25),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.DeliveryID,o)||(c.pageData.Filter.DeliveryID=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",4),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),m("accessType",4),x("ngModel",e.pageData.Filter.DestinationID),m("multiple",!1),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),l(3),m("items",e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),l(3),m("items",e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.DeliveryID)}}function Dp(t,r){t&1&&(n(0,"th",26),p(1," Total Price "),i())}function Ip(t,r){t&1&&(n(0,"th",26),p(1," Total Cost "),i())}function Tp(t,r){t&1&&f(0,"i",37)}function wp(t,r){if(t&1&&(f(0,"td",43),v(1,"number")),t&2){let e=s().$implicit;m("innerHTML",E(1,1,e.UnitPrice),j)}}function Op(t,r){if(t&1&&(f(0,"td",43),v(1,"number")),t&2){let e=s().$implicit;m("innerHTML",E(1,1,e.UnitCost),j)}}function Ep(t,r){if(t&1&&(n(0,"tr")(1,"td",8)(2,"a",38),p(3),i()(),f(4,"td",39)(5,"td",40)(6,"td",41),v(7,"number"),f(8,"td",41),v(9,"number"),_(10,wp,2,3,"td",42)(11,Op,2,3,"td",42),i()),t&2){let e=r.$implicit,a=s().$implicit,o=s(2);ot(M(14,Sp,e.QtyRequested!=e.Quantity)),l(2),m("queryParams",M(16,Rr,e.VariantID)),l(),D(" ",e.VariantName," "),l(),m("innerHTML",e.Code,j),l(),m("innerHTML",a.StateLabel,j),l(),m("innerHTML",E(7,10,e.QtyRequested),j),l(2),m("innerHTML",E(9,12,e.Quantity),j),l(2),m("ngIf",o.roleService.sell.PriceVisible),l(),m("ngIf",o.roleService.product.Cost)}}function Mp(t,r){if(t&1&&(n(0,"div",27)(1,"div",28)(2,"div",29)(3,"a",30),f(4,"span",31),v(5,"date"),i()()(),n(6,"div",32)(7,"span"),p(8),i(),f(9,"br"),_(10,Tp,1,0,"i",33),f(11,"span",34),i(),n(12,"div",5)(13,"table",35)(14,"tbody"),_(15,Ep,12,18,"tr",36),i()()()()),t&2){let e=r.$implicit;l(3),m("routerLink",N(12,xp))("queryParams",M(13,Rr,e.ID)),l(),m("innerHTML","# "+e.Number+" - "+P(5,9,e.Date,"dd MMM yyyy"),j),l(4),yo("",e.Source," > ",e.Destination," - ",e.TypeName,""),l(2),m("ngIf",e.Note),l(),m("innerHTML",e.Note,j),l(4),m("ngForOf",e.Items)}}function Pp(t,r){if(t&1&&(n(0,"div")(1,"strong"),p(2,"Total Unit Price :"),i(),f(3,"span",46),v(4,"GetChildrenArray"),v(5,"sum"),v(6,"number"),i()),t&2){let e=s(3);l(3),m("innerHTML",P(6,7,P(5,4,P(4,1,e.data.Data,"Items"),"UnitPrice"),"1.0-2"),j)}}function Fp(t,r){if(t&1&&(n(0,"div")(1,"strong"),p(2,"Total Unit Cost :"),i(),f(3,"span",46),v(4,"GetChildrenArray"),v(5,"sum"),v(6,"number"),i()),t&2){let e=s(3);l(3),m("innerHTML",P(6,7,P(5,4,P(4,1,e.data.Data,"Items"),"UnitCost"),"1.0-2"),j)}}function Vp(t,r){if(t&1&&(n(0,"div",44)(1,"div",45)(2,"div")(3,"strong"),p(4,"Total Quantity"),i(),f(5,"span",46),v(6,"GetChildrenArray"),v(7,"sum"),v(8,"number"),i(),_(9,Pp,7,10,"div",47)(10,Fp,7,10,"div",47),i()()),t&2){let e=s(2);l(5),m("innerHTML",E(8,9,P(7,6,P(6,3,e.data.Data,"Items"),"Quantity")),j),l(4),m("ngIf",e.roleService.sell.PriceVisible),l(),m("ngIf",e.roleService.product.Cost)}}function Np(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,hp,3,0,"button",3),i(),n(3,"filters"),_(4,bp,22,16,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Name"),i(),n(14,"th",9),p(15,"Code"),i(),n(16,"th",10),p(17,"Delivery"),i(),n(18,"th",11),p(19,"Qty Req"),i(),n(20,"th",11),p(21,"Qty Sent"),i(),_(22,Dp,2,0,"th",12)(23,Ip,2,0,"th",12),i()()()(),_(24,Mp,16,15,"div",13)(25,Vp,11,11,"div",14),n(26,"POS-complex-pagination",15),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(20),m("ngIf",e.roleService.sell.PriceVisible),l(),m("ngIf",e.roleService.product.Cost),l(),m("ngForOf",e.data.Data),l(),m("ngIf",e.data.Data.length>0),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var cn=class t extends Se{constructor(e,a,o,c,w){super(e,a,"TransferOrder/GetReport","TransferOrderLoader/TransferOutletDeliveryReport");this.csvConverter=o;this.roleService=c;this.matDialog=w}openExportModal(){this.matDialog.open(Ie,{data:{title:"Transfer Order Report",exportTypes:[{ID:"TransferOrder/GetReport",Value:"Default",FileName:"Transfer Order Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"TransferOrder/GetReportCount",pagination:!0}})}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-report-transfer-detail"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","float-thead","{ top: 60, autoReflow: true }",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-start",2,"width","700px"],[2,"width","115px"],[1,"text-end",2,"width","75px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 90px",4,"ngIf"],["class","mt-7 ms-5",4,"ngFor","ngForOf"],["class","mt-6",4,"ngIf"],["api","TransferOrder/GetReportCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","Choose destination",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose type",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose",3,"ngModelChange","items","ngModel"],[1,"text-end",2,"width","90px"],[1,"mt-7","ms-5"],[1,"d-lg-flex","mt-sm-0"],[1,"me-auto","d-sm-block"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHTML"],[1,"mt-4"],["class","fa-solid fa-note-sticky me-3",4,"ngIf"],[1,"fst-italic",3,"innerHTML"],[1,"table","table-striped","table-bordered"],[3,"class",4,"ngFor","ngForOf"],[1,"fa-solid","fa-note-sticky","me-3"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"border-start",2,"width","115px",3,"innerHTML"],[1,"text-end","border-start",2,"width","75px",3,"innerHTML"],[1,"text-end","border-start",2,"width","50px",3,"innerHTML"],["class","text-end border-start","style","width: 90px",3,"innerHTML",4,"ngIf"],[1,"text-end","border-start",2,"width","90px",3,"innerHTML"],[1,"mt-6"],[1,"zebra","d-flex","justify-content-end"],[1,"text-end",3,"innerHTML"],[4,"ngIf"]],template:function(a,o){a&1&&_(0,Np,27,11,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,Je,Ee,li,Pe,ge,he,Be,Uo],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;line-height:15px!important}"]})};function kp(t,r){if(t&1){let e=b();n(0,"div",2)(1,"div",6)(2,"datepicker",7),h("dateChange",function(o){d(e);let c=s();return S(c.date,o)||(c.date=o),u(o)}),i()(),n(3,"div",8)(4,"p-datepicker",9),h("ngModelChange",function(o){d(e);let c=s();return S(c.time,o)||(c.time=o),u(o)}),i()()()}if(t&2){let e=s();l(2),x("date",e.date),l(2),x("ngModel",e.time),m("timeOnly",!0)}}var Si=class t{constructor(r){this.dialogRef=r;let e=this.data?.title||"Receive Delivery";this.type.update(a=>this.data?.type||a),this.config=new _e,this.config.title=e,this.config.customWidth="450px"}data=y(Ke);role=y(ne);type=vt("RECEIVE");config;date=new Date;time=new Date;note="";onOk(r){if(r=="Enter")return;this.date&&(this.date=new Date(this.date),this.date.setHours(this.time.getHours(),this.time.getMinutes(),this.time.getSeconds()));let e={Date:this.date,Note:this.note};this.dialogRef.close(e)}static \u0275fac=function(e){return new(e||t)(C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-modal-receive"]],decls:7,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row","mb-8"],[1,"row"],[1,"col"],["height","200px",3,"ngModelChange","ngModel"],[1,"col","pe-1"],["appearance","outline",3,"dateChange","date"],[1,"col","ps-1"],[3,"ngModelChange","ngModel","timeOnly"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(c){return a.onOk(c)})("onCancel",function(){return a.dialogRef.close()})("onClose",function(){return a.dialogRef.close()}),n(1,"content")(2,"div",1),_(3,kp,5,3,"div",2),n(4,"div",3)(5,"div",4)(6,"POS-tinymce-editor",5),h("ngModelChange",function(c){return S(a.note,c)||(a.note=c),c}),i()()()()()()),e&2&&(m("config",a.config),l(3),Xe(a.role.global!=null&&a.role.global.Date&&a.type()=="RECEIVE"?3:-1),l(3),x("ngModel",a.note))},dependencies:[X,De,fe,Ge,R,W,qi,de,Ui,Xo,st,xt],styles:[".p-inputtext.p-component{margin-left:10px;margin-top:1px;height:45.4px}"]})};var Lp=()=>["Name","Code"],Rp=()=>["/menu/Products/Catalog/Variants/Info"],Ap=t=>({ID:t});function Bp(t,r){if(t&1&&(z(0),f(1,"p",19),$()),t&2){let e=s().$implicit;l(),m("innerHTML",e.SerialNote,j)}}function Wp(t,r){if(t&1&&f(0,"p",19),t&2){let e=s(2).$implicit;m("innerHTML",e.Note,j)}}function Hp(t,r){if(t&1&&_(0,Wp,1,1,"p",20),t&2){let e=s().$implicit;m("ngIf",e.Note!=null)}}function jp(t,r){if(t&1){let e=b();n(0,"tr")(1,"td",14),p(2),i(),n(3,"td"),f(4,"a",15),_(5,Bp,2,1,"ng-container",16)(6,Hp,1,1,"ng-template",null,0,Z),i(),f(8,"td",17),n(9,"td",14),p(10),v(11,"number"),i(),n(12,"td")(13,"input",18),h("ngModelChange",function(o){let c=d(e).$implicit;return S(c.Quantity,o)||(c.Quantity=o),u(o)}),i()()()}if(t&2){let e=r.$implicit,a=r.index,o=we(7),c=s();l(2),I(a+1+"."),l(2),m("routerLink",N(12,Rp))("queryParams",M(13,Ap,e.VariantID))("innerHTML",e.Name,j),l(),m("ngIf",e.SerialNote)("ngIfElse",o),l(3),m("innerHTML",e.Code,j),l(2),I(E(11,10,e.NewQty)),l(3),x("ngModel",e.Quantity),m("disabled",e.TypeID==c.serialized)}}function Qp(t,r){if(t&1){let e=b();n(0,"div")(1,"POS-tinymce-editor",21),h("ngModelChange",function(o){d(e);let c=s();return S(c.dispatchedNote,o)||(c.dispatchedNote=o),u(o)}),i()()}if(t&2){let e=s();l(),x("ngModel",e.dispatchedNote)}}var sn=class t{constructor(r,e){this.dt=r;this.dialogRef=e;this.data=r.data,this.setMaxSendQuantity(),this.config=new _e,this.config.title="Send Confirmation",this.config.bodyScrollable=!0,this.config.customWidth="550px"}filterText="";data;config;serialized=4;dispatchedNote=vt("");currentTabState=vt("Item");onOk(){this.data.ID=this.data.ID||this.data.Transfer.ID,this.data.Delivery.DispatchedNote=this.dispatchedNote(),this.data.Note=this.dispatchedNote(),this.dialogRef.close(this.data)}setMaxSendQuantity(){this.data.Items=this.data.Items.map(r=>(r.maxSend=this.calculateSerialQty(r.Serial?r.Serial:[]),r))}calculateSerialQty(r=[]){let e=0;return r.forEach(a=>{e+=a.Qty}),e}static \u0275fac=function(e){return new(e||t)(C(Ke),C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-modal-send-confirmation"]],decls:24,vars:9,consts:[["DEFAULT_NOTE",""],[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[3,"onTabChange"],["tabTitle","Item"],["type","text","placeholder","Search product..",1,"form-control","mb-5",3,"ngModelChange","ngModel"],[1,"table","table-bordered","custom-table"],[1,"thead-light"],[1,"text-center","border-end",2,"width","1px"],[1,"border-end",2,"width","400px"],[1,"border-end",2,"width","70px"],[1,"text-center","border-end",2,"width","30px"],[4,"ngFor","ngForOf"],["tabTitle","Note"],[1,"text-center"],["target","_blank",3,"routerLink","queryParams","innerHTML"],[4,"ngIf","ngIfElse"],[3,"innerHTML"],["autoNum","","emptyInputBehavior","null","type","text",1,"text-end","form-control",2,"width","46px",3,"ngModelChange","ngModel","disabled"],[1,"text-body-secondary",2,"word-break","break-all",3,"innerHTML"],["class","text-body-secondary","style","word-break: break-all",3,"innerHTML",4,"ngIf"],[3,"ngModelChange","ngModel"]],template:function(e,a){e&1&&(n(0,"modal-material",1),g("onOk",function(){return a.onOk()})("onCancel",function(){return a.dialogRef.close()})("onClose",function(){return a.dialogRef.close()}),n(1,"content")(2,"div",2)(3,"custom-tabs",3),g("onTabChange",function(c){return a.currentTabState.set(c)}),n(4,"tab",4)(5,"input",5),h("ngModelChange",function(c){return S(a.filterText,c)||(a.filterText=c),c}),i(),n(6,"table",6)(7,"thead",7)(8,"tr")(9,"th",8),p(10,"No"),i(),n(11,"th",9),p(12,"Name"),i(),n(13,"th",10),p(14,"Code"),i(),n(15,"th",11),p(16," Qty Req. "),i(),n(17,"th",11),p(18," Qty Send "),i()()(),n(19,"tbody"),_(20,jp,14,15,"tr",12),v(21,"FilterByArray"),i()()(),n(22,"tab",13),_(23,Qp,2,1,"div"),i()()()()()),e&2&&(m("config",a.config),l(5),x("ngModel",a.filterText),l(15),m("ngForOf",Vi(21,4,a.data.Items,N(8,Lp),a.filterText)),l(3),Xe(a.currentTabState()=="Note"?23:-1))},dependencies:[X,J,B,ge,De,fe,yt,G,ai,qo,Ge,Ce,R,W,st,xt,sr,ur,dr,Er],encapsulation:2})};var qp=()=>["/print/Transfer"],Ar=(t,r)=>({ID:t,Template:r}),Up=()=>["/print/TransferMini"],zp=t=>({"opacity-50 cursor-auto":t}),$p=()=>["/menu/Logistics/Archive/Transfer_Order/Receive"],un=t=>({ID:t}),Gp=()=>["/menu/Logistics/Archive/Transfer_Order/Form"],Kp=()=>["/menu/Logistics/Setup/Recycle_Bin"],Jp=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Yp=()=>["/menu/Products/Catalog/Variants/Info"],Xp=t=>({"bg-gradient-danger":t}),Zp=()=>["/menu/Logistics/Report/Transfer/History"],em=t=>({TransferOrderID:t});function tm(t,r){if(t&1){let e=b();n(0,"div",46)(1,"button",47),g("click",function(){d(e);let o=s(2);return u(o.export("TransferOrder/ExportInfo","Transfer Order"))}),f(2,"i",48),p(3,"Export "),i(),f(4,"button",49),n(5,"ul",7)(6,"li",50),g("click",function(){d(e);let o=s(2);return u(o.export("TransferOrder/ExportDetailInfo","Transfer Order Detail.csv"))}),n(7,"a"),p(8,"Export with Detail"),i()()()()}}function im(t,r){if(t&1){let e=b();n(0,"a",56),g("click",function(){d(e);let o=s(3);return u(o.onApproveDelivery())}),f(1,"i",57),p(2,"\xA0Approve Delivery "),i()}}function nm(t,r){if(t&1){let e=b();n(0,"a",58),g("click",function(){d(e);let o=s(3);return u(o.onDispatchDelivery())}),f(1,"i",59),p(2,"\xA0Send"),i()}}function om(t,r){if(t&1){let e=b();n(0,"button",60),g("click",function(){d(e);let o=s(3);return u(o.role.logistic.TransferOrderReceiver?o.onReceiveDelivery():null)}),f(1,"i",57),p(2,"\xA0Receive Delivery "),i()}if(t&2){let e=s(3);vi("matTooltip",e.role.logistic.TransferOrderReceiver?"":"Receiving delivery requires the transfer order receiver role"),m("ngClass",M(2,zp,!e.role.logistic.TransferOrderReceiver))}}function rm(t,r){if(t&1&&(n(0,"button",61),f(1,"b",62),i()),t&2){let e=s(3);m("disabled",!e.role.logistic.TransferOrderReceiver)}}function am(t,r){if(t&1&&(n(0,"ul",63)(1,"li")(2,"a",8),p(3,"Receive and Adjust"),i()()()),t&2){let e=s(3);l(2),m("routerLink",N(2,$p))("queryParams",M(3,un,e.data.ID))}}function lm(t,r){if(t&1&&(n(0,"div",46),_(1,im,3,0,"a",51)(2,nm,3,0,"a",52)(3,om,3,4,"button",53)(4,rm,2,1,"button",54)(5,am,4,5,"ul",55),i()),t&2){let e=s(2);l(),m("ngIf",e.data.Config.EligibleToApprove&&e.role.logistic.TransferOrderApproval&&!e.data.Transfer.IsVoided),l(),m("ngIf",e.data.Config.EligibleToSend&&e.role.logistic.TransferOrderEditor&&!e.data.Transfer.IsVoided),l(),m("ngIf",e.data.Config.EligibleToReceive&&e.data.Config.HasReceiverRole&&!e.data.Transfer.IsVoided),l(),m("ngIf",e.data.Config.EligibleToReceive&&e.role.adjustment.Create&&e.data.Config.HasReceiverRole&&!e.data.Transfer.IsVoided),l(),m("ngIf",e.data.Config.EligibleToReceive&&e.role.adjustment.Create&&e.data.Config.HasReceiverRole&&!e.data.Transfer.IsVoided)}}function pm(t,r){if(t&1&&(n(0,"a",64),f(1,"i",65),p(2,"Edit"),i()),t&2){let e=s(2);m("routerLink",N(2,Gp))("queryParams",M(3,un,e.data.ID))}}function mm(t,r){if(t&1){let e=b();n(0,"a",67),g("click",function(){d(e);let o=s(3);return u(o.deleteData())}),f(1,"i",68),p(2,"Delete"),i()}}function cm(t,r){if(t&1){let e=b();n(0,"a",67),g("click",function(){d(e);let o=s(3);return u(o.onVoid())}),f(1,"i",68),p(2,"Void"),i()}}function sm(t,r){if(t&1&&(z(0),_(1,mm,3,0,"a",66)(2,cm,3,0,"a",66),$()),t&2){let e=s(2);l(),m("ngIf",e.role.logistic.Delete&&(!e.data.Config.IsVoidEnabled||e.data.Transfer.IsVoided)),l(),m("ngIf",e.role.logistic.TransferOrderVoid&&e.data.Config.IsVoidEnabled&&!e.data.Transfer.IsVoided)}}function dm(t,r){t&1&&(n(0,"a",69),f(1,"i",70),n(2,"span",71),p(3,"Voided"),i()()),t&2&&m("routerLink",N(1,Kp))}function um(t,r){if(t&1&&(n(0,"tr")(1,"th"),p(2,"Adjusted at"),i(),n(3,"td"),p(4,":"),i(),n(5,"td")(6,"a",45),p(7),i()()()),t&2){let e=s(2);l(6),m("routerLink",N(3,Jp))("queryParams",M(4,un,e.data.AdjustmentID)),l(),I(e.data.Transfer==null?null:e.data.Transfer.AdjustedAt)}}function _m(t,r){if(t&1&&(n(0,"tr")(1,"th"),p(2,"Journal"),i(),n(3,"td"),p(4,":"),i(),n(5,"td")(6,"a",72),p(7,"View Journal"),i()()()),t&2){let e=s(2);l(6),vo("href","https://accounting.dealpos.app/pages/journal-entry;TransID=",e.data.ID,"",ei)}}function fm(t,r){if(t&1&&(z(0),n(1,"div",80),p(2,"Receive Note:"),i(),f(3,"div",81),$()),t&2){let e=s(3);l(3),m("innerHTML",e.data.Delivery.ReceivedNote,j)}}function gm(t,r){if(t&1&&(n(0,"div",12)(1,"div",73)(2,"h4"),p(3),v(4,"date"),i(),n(5,"p",74),p(6),v(7,"date"),i()(),n(8,"div",75),f(9,"i",76),n(10,"div",77),f(11,"div",78),i()(),n(12,"div",79)(13,"h4"),p(14,"Received By"),i(),n(15,"p",74),p(16),i(),_(17,fm,4,1,"ng-container",10),i()()),t&2){let e=s(2);Nt("pb-8",e.data.Delivery.ReceivedNote),l(3),D(" ",P(4,8,e.data.Delivery.ReceivedDate,"dd MMM yyyy")," "),l(3),D(" ",P(7,11,e.data.Delivery.ReceivedDate,"HH:mm a")," "),l(3),Ci("color",e.currentDeliveryState=="(Received)"?"blue":"black"),l(7),I(e.data.Delivery.ReceiveBy),l(),m("ngIf",e.data.Delivery.ReceivedNote)}}function Cm(t,r){if(t&1&&(n(0,"div",80),p(1,"Dispatch Note:"),i(),f(2,"div",81)),t&2){let e=s(3);l(2),m("innerHTML",e.data.Delivery==null?null:e.data.Delivery.DispatchedNote,j)}}function vm(t,r){if(t&1&&(n(0,"div",82)(1,"div",73)(2,"h4"),p(3),v(4,"date"),i(),n(5,"p",74),p(6),v(7,"date"),i()(),n(8,"div",75),f(9,"i",76),n(10,"div",77),f(11,"div",78),i()(),n(12,"div",79)(13,"h4"),p(14,"Dispatched By"),i(),n(15,"p",74),p(16),i(),_(17,Cm,3,1),i()()),t&2){let e=s(2);l(3),D(" ",P(4,6,e.data.Delivery.DispatchedDate,"dd MMM yyyy")," "),l(3),D(" ",P(7,9,e.data.Delivery.DispatchedDate,"HH:mm a")," "),l(3),Ci("color",e.currentDeliveryState=="(Dispatched)"?"blue":"black"),l(7),I(e.data.Delivery.DispatchedBy),l(),Xe(e.data.Delivery!=null&&e.data.Delivery.DispatchedNote?17:-1)}}function ym(t,r){if(t&1&&(n(0,"div",80),p(1,"Approve Note:"),i(),f(2,"div",81)),t&2){let e=s(3);l(2),m("innerHTML",e.data.Delivery==null?null:e.data.Delivery.ApprovedNote,j)}}function xm(t,r){if(t&1&&(n(0,"div",82)(1,"div",73)(2,"h4"),p(3),v(4,"date"),i(),n(5,"p",74),p(6),v(7,"date"),i()(),n(8,"div",75),f(9,"i",76),n(10,"div",77),f(11,"div",78),i()(),n(12,"div",79)(13,"h4"),p(14,"Approved By"),i(),n(15,"p",74),p(16),i(),_(17,ym,3,1),i()()),t&2){let e=s(2);l(3),I(P(4,6,e.data.Delivery.ApproveDate,"dd MMM yyyy")),l(3),D(" ",P(7,9,e.data.Delivery.ApproveDate,"HH:mm a")," "),l(3),Ci("color",e.currentDeliveryState=="(Approve)"?"blue":"black"),l(7),I(e.data.Delivery.ApproveBy),l(),Xe(e.data.Delivery!=null&&e.data.Delivery.ApprovedNote?17:-1)}}function Sm(t,r){if(t&1&&(n(0,"div",80),p(1,"Created Note:"),i(),f(2,"div",81)),t&2){let e=s(3);l(2),m("innerHTML",e.data.Transfer==null?null:e.data.Transfer.Note,j)}}function hm(t,r){if(t&1&&(n(0,"div",12)(1,"div",73)(2,"h4"),p(3),v(4,"date"),i(),n(5,"p",74),p(6),v(7,"date"),i()(),n(8,"div",75),f(9,"i",76),i(),n(10,"div",79)(11,"h4"),p(12,"Created By"),i(),n(13,"p",74),p(14),i(),_(15,Sm,3,1),i()()),t&2){let e=s(2);l(3),D(" ",P(4,6,e.data.CreatedInfo.Created.Date,"dd MMM yyyy")," "),l(3),D(" ",P(7,9,e.data.CreatedInfo.Created.Date,"HH:mm a")," "),l(3),Ci("color",e.currentDeliveryState=="(Request)"?"blue":"black"),l(5),I(e.data.CreatedInfo.Created.User),l(),Xe(e.data.Transfer!=null&&e.data.Transfer.Note?15:-1)}}function bm(t,r){if(t&1&&(n(0,"small",86),p(1),v(2,"number"),i()),t&2){let e=s(3);l(),D(" (Weight ",E(2,1,e.totalWeight())," gr) ")}}function Dm(t,r){if(t&1){let e=b();n(0,"div",21)(1,"div",83)(2,"div",84)(3,"h2",85),p(4,"Items"),i(),_(5,bm,3,3,"small",86),i(),n(6,"div")(7,"div",46)(8,"button",6),f(9,"b",62),i(),n(10,"ul",87)(11,"li")(12,"a",50),g("click",function(){d(e);let o=s(2);return u(o.showRequested=!o.showRequested)}),p(13),i()(),n(14,"li")(15,"a",50),g("click",function(){d(e);let o=s(2);return u(o.showOnHand=!o.showOnHand)}),p(16),i()()()()()()()}if(t&2){let e=s(2);l(5),Xe(e.totalWeight()?5:-1),l(8),D("",e.showRequested?"Hide":"Show"," requested"),l(3),D("",e.showOnHand?"Hide":"Show"," current on hand inventory")}}function Im(t,r){t&1&&(n(0,"th",88),p(1," Product Code "),i())}function Tm(t,r){t&1&&(n(0,"th",33),p(1," Qty Req. "),i())}function wm(t,r){t&1&&(n(0,"th",33),p(1," On Hand "),i())}function Om(t,r){t&1&&(n(0,"th",89),p(1," Cost "),i())}function Em(t,r){t&1&&(n(0,"th",89),p(1," Total Cost "),i())}function Mm(t,r){if(t&1&&(n(0,"th",90),p(1),i()),t&2){let e=s(2);l(),D(" Price (",e.data.CurrencySimbol,") ")}}function Pm(t,r){t&1&&(n(0,"th",91),p(1," % "),i())}function Fm(t,r){if(t&1&&(n(0,"th",92),p(1),i()),t&2){let e=s(2);l(),D(" Total (",e.data.CurrencySimbol,") ")}}function Vm(t,r){if(t&1&&(z(0),f(1,"p",97),$()),t&2){let e=s().$implicit;l(),m("innerHTML",e.Note,j)}}function Nm(t,r){if(t&1&&(n(0,"td"),p(1),i()),t&2){let e=s().$implicit;l(),D(" ",e.ProductCode," ")}}function km(t,r){if(t&1&&(n(0,"td",40),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.QtyRequested)," ")}}function Lm(t,r){if(t&1&&(n(0,"td",40),p(1),v(2,"number"),n(3,"div"),p(4),i()()),t&2){let e=s().$implicit;ot(M(6,Xp,e.Inventory<e.Quantity)),l(),D(" ",E(2,4,e.Inventory)," "),l(3),I(e.UOMName)}}function Rm(t,r){if(t&1&&(n(0,"td",98),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.UnitCost)," ")}}function Am(t,r){if(t&1&&(n(0,"td",98),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.Quantity*e.UnitCost)," ")}}function Bm(t,r){if(t&1&&(n(0,"td",98),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.UnitPrice)," ")}}function Wm(t,r){if(t&1&&(n(0,"td",99),p(1),i()),t&2){let e=s().$implicit;l(),D(" ",e.PriceDiscount," ")}}function Hm(t,r){if(t&1&&(n(0,"td",98),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.TotalPrice)," ")}}function jm(t,r){if(t&1&&(n(0,"tr")(1,"td",40),p(2),i(),n(3,"td")(4,"a",45),p(5),i(),n(6,"div"),p(7),i(),f(8,"app-serial-note",93),_(9,Vm,2,1,"ng-container",10),i(),_(10,Nm,2,1,"td",10)(11,km,3,3,"td",41),n(12,"td",40),p(13),v(14,"number"),i(),_(15,Lm,5,8,"td",94)(16,Rm,3,3,"td",95)(17,Am,3,3,"td",95)(18,Bm,3,3,"td",95)(19,Wm,2,1,"td",96)(20,Hm,3,3,"td",95),i()),t&2){let e=r.$implicit,a=r.index,o=s(2);l(2),I(a+1+"."),l(2),m("routerLink",N(18,Yp))("queryParams",M(19,un,e.VariantID)),l(),I(e.Name),l(2),I(e.Code),l(),m("serials",e.Serial),l(),m("ngIf",e.Note),l(),m("ngIf",o.data.Config.ProductCodeVisible),l(),m("ngIf",o.showRequested),l(2),I(E(14,16,e.Quantity)),l(2),m("ngIf",o.showOnHand),l(),m("ngIf",o.data.Config.CostVisible&&o.role.product.Cost),l(),m("ngIf",o.data.Config.CostVisible&&o.role.product.Cost),l(),m("ngIf",o.data.Config.PriceVisible&&o.role.sell.PriceVisible),l(),m("ngIf",o.data.Config.PriceVisible&&o.role.sell.PriceVisible&&o.data.Config.DiscountVisible),l(),m("ngIf",o.data.Config.PriceVisible&&o.role.sell.PriceVisible)}}function Qm(t,r){if(t&1&&(n(0,"td",40),p(1),v(2,"sum"),v(3,"number"),i()),t&2){let e=s(2);l(),D(" ",E(3,4,P(2,1,e.data.Items,"QtyRequested"))," ")}}function qm(t,r){t&1&&f(0,"td")}function Um(t,r){if(t&1&&(n(0,"td",100)(1,"b"),p(2),v(3,"sumMultiply"),v(4,"number"),i()()),t&2){let e=s(2);l(2),D(" ",E(4,5,Vi(3,1,e.data.Items,"UnitCost","Quantity"))," ")}}function zm(t,r){if(t&1&&(n(0,"td",101)(1,"b"),p(2),v(3,"sum"),v(4,"number"),i()()),t&2){let e=s(2);l(2),I(E(4,4,P(3,1,e.data.Items,"TotalPrice")))}}function $m(t,r){if(t&1&&(n(0,"span")(1,"b"),p(2," Modified:"),i(),p(3),v(4,"date"),i()),t&2){let e=s(3);l(3),Qe(" ",P(4,2,e.data.CreatedInfo==null||e.data.CreatedInfo.Modified==null?null:e.data.CreatedInfo.Modified.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo==null||e.data.CreatedInfo.Modified==null?null:e.data.CreatedInfo.Modified.User," ")}}function Gm(t,r){if(t&1&&(n(0,"a",45)(1,"div",102),f(2,"i",103),n(3,"span",104)(4,"b"),p(5," Created:"),i(),p(6),v(7,"date"),i(),_(8,$m,5,5,"span"),i()()),t&2){let e=s(2);m("routerLink",N(8,Zp))("queryParams",M(9,em,e.data.ID)),l(6),Qe(" ",P(7,5,e.data.CreatedInfo==null||e.data.CreatedInfo.Created==null?null:e.data.CreatedInfo.Created.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo==null||e.data.CreatedInfo.Created==null?null:e.data.CreatedInfo.Created.User," "),l(2),Xe(e.data.CreatedInfo.Modified.Date!=e.minDate?8:-1)}}function Km(t,r){if(t&1&&(n(0,"mainpanel-cmp",1)(1,"actions"),_(2,tm,9,0,"div",2)(3,lm,6,5,"div",2),n(4,"div",3)(5,"a",4),f(6,"i",5),p(7,"Print "),i(),f(8,"button",6),n(9,"ul",7)(10,"li")(11,"a",8),p(12,"Print with Mini"),i()()()(),n(13,"div",3),_(14,pm,3,5,"a",9)(15,sm,3,2,"ng-container",10),i()(),n(16,"content")(17,"div",11)(18,"div",12)(19,"div",13)(20,"div",14)(21,"div",15)(22,"h2",16),f(23,"i",17),p(24),i(),_(25,dm,4,2,"a",18),i(),n(26,"div",19)(27,"table",20)(28,"tr")(29,"th"),p(30,"Tag"),i(),n(31,"td"),p(32,":"),i(),n(33,"td"),p(34),i()(),n(35,"tr")(36,"th"),p(37,"Date"),i(),n(38,"td"),p(39,":"),i(),n(40,"td"),p(41),v(42,"date"),i()(),n(43,"tr")(44,"th"),p(45,"Courier"),i(),n(46,"td"),p(47,":"),i(),n(48,"td"),p(49),i()(),n(50,"tr")(51,"th"),p(52,"Status"),i(),n(53,"td"),p(54,":"),i(),n(55,"td"),p(56),i()(),_(57,um,8,6,"tr")(58,_m,8,2,"tr",10),i()()(),n(59,"div",14)(60,"div",21)(61,"h2"),p(62),i()(),n(63,"div",19),_(64,gm,18,14,"div",22)(65,vm,18,12,"div",23)(66,xm,18,12,"div",23)(67,hm,16,12,"div",24),i()()(),n(68,"div",25)(69,"div",14),_(70,Dm,17,3,"div",26),n(71,"div",19)(72,"table",27)(73,"thead",28)(74,"tr")(75,"th",29),p(76,"No"),i(),n(77,"th",30),p(78,"Name"),i(),_(79,Im,2,0,"th",31)(80,Tm,2,0,"th",32),n(81,"th",33),p(82,"Qty Sent"),i(),_(83,wm,2,0,"th",32)(84,Om,2,0,"th",34)(85,Em,2,0,"th",34)(86,Mm,2,1,"th",35)(87,Pm,2,0,"th",36)(88,Fm,2,1,"th",37),i()(),n(89,"tbody"),_(90,jm,21,21,"tr",38),i(),n(91,"tfoot",39)(92,"tr")(93,"td",40)(94,"b"),p(95,"Total"),i()(),_(96,Qm,4,6,"td",41),n(97,"td",42)(98,"b"),p(99),v(100,"sum"),v(101,"number"),i()(),_(102,qm,1,0,"td",10)(103,Um,5,7,"td",43)(104,zm,5,6,"td",44),i()()()()()()(),_(105,Gm,9,11,"a",45),i()()()),t&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0)("titleLimit",50),l(2),m("ngIf",e.role.global.Export),l(),m("ngIf",!e.data.Transfer.IsVoided),l(2),m("routerLink",N(51,qp))("queryParams",Ae(52,Ar,e.data.ID,e.data.TemplateID)),l(6),m("routerLink",N(55,Up))("queryParams",Ae(56,Ar,e.data.ID,e.data.TemplateID)),l(3),m("ngIf",e.data.Config.isEditor&&!e.data.Transfer.IsVoided),l(),m("ngIf",e.data.HasOutletSourceWriteAccess),l(9),Qe("\xA0",e.data.Transfer.Source," to ",e.data.Transfer.Destination," "),l(),m("ngIf",e.data.Transfer.IsVoided),l(9),I(e.data.Transfer.Type),l(7),I(P(42,43,e.data.Transfer.Date,"dd MMM yyyy")),l(8),I(e.data.Transfer.Courier),l(7),I(e.data.Transfer.Status),l(),Xe(e.data.Config.IsAdjusted&&(e.data.Transfer!=null&&e.data.Transfer.AdjustedAt)?57:-1),l(),m("ngIf",e.data.JournalUrl),l(4),I(e.data.Delivery.HeadDelivery),l(2),m("ngIf",e.data.Delivery.ReceivedDate),l(),m("ngIf",e.data.Delivery.DispatchedDate),l(),m("ngIf",e.data.Delivery.ApproveBy),l(),m("ngIf",e.data.CreatedInfo.Created.Date),l(3),m("ngIf",e.data.Items.length>0),l(9),m("ngIf",e.data.Config.ProductCodeVisible),l(),m("ngIf",e.showRequested),l(3),m("ngIf",e.showOnHand),l(),m("ngIf",e.data.Config.CostVisible&&e.role.product.Cost),l(),m("ngIf",e.data.Config.CostVisible&&e.role.product.Cost),l(),m("ngIf",e.data.Config.PriceVisible&&e.role.sell.PriceVisible),l(),m("ngIf",e.data.Config.PriceVisible&&e.role.sell.PriceVisible&&e.data.Config.DiscountVisible),l(),m("ngIf",e.data.Config.PriceVisible&&e.role.sell.PriceVisible),l(2),m("ngForOf",e.data.Items),l(3),Co("colspan",e.data.Config.ProductCodeVisible?"3":"2"),l(3),m("ngIf",e.showRequested),l(3),D(" ",E(101,49,P(100,46,e.data.Items,"Quantity"))," "),l(3),m("ngIf",e.showOnHand),l(),m("ngIf",e.data.Config.CostVisible&&e.role.product.Cost),l(),m("ngIf",e.data.Config.PriceVisible&&e.role.sell.PriceVisible),l(),Xe(e.role.users.LogRestriction?-1:105)}}var dn=class t extends Se{constructor(e,a,o,c,w,H,ie,Ue){super(e,a,"TransferOrder/Info",null,null,o);this.csvConverter=c;this.router=w;this.toastr=H;this.role=ie;this.matDialog=Ue}currentDeliveryState;minDate=T.MinDate;showOnHand=!1;showRequested=!1;totalWeight=vt(0);preGetList(){let e=this.route.snapshot.queryParams;this.pageData.Filter=e}postInit(){this.menuData.H=this.data.PageTitle,this.currentDeliveryState=this.data.Delivery.HeadDelivery.split(" ")[1],this.calculateWeight()}calculateWeight(){let a=this.data.Items.filter(o=>o.Weight).reduce((o,c)=>o+c.Weight*c.Quantity,0);this.totalWeight.set(a)}deleteData(){confirm("Are you sure you want to delete selected record/s?")&&this.httpService.delete("/API/TransferOrder/DeleteTransferOrderInfo",{params:[{key:"ID",value:this.data.ID}]}).subscribe(()=>{this.toastr.success("Records are removed.",ve.Success),this.router.navigate(["/menu/Logistics/Archive/Transfer_Order"])})}export(e,a){this.httpService.get(`/api/${e}`,[{key:"ID",value:this.route.snapshot.queryParams.ID}]).subscribe(o=>{this.csvConverter.convertToCSV(o,a)})}onVoid(){confirm("Are you sure you want to void this record/s?")&&this.httpService.put("/api/TransferOrder/VoidTransferOrder",{ID:this.data.ID},{},1e5).subscribe(e=>{this.toastr.success(e.Message,"Success"),this.data.Transfer.IsVoided=!0,this.menuData.H=this.menuData.H})}onApproveDelivery(){this.matDialog.open(Si,{data:{title:"Approve Delivery",type:"APPROVE"}}).afterClosed().pipe(L(e=>T.IsNotEmpty(e)),Q(e=>{let a={ID:this.data.ID||this.data.Transfer.ID,Note:e.Note};return this.httpService.post(Ne.ApproveDelivery,a)})).subscribe(()=>this.getListData())}onDispatchDelivery(){this.matDialog.open(sn,{data:{data:this.data}}).afterClosed().pipe(L(e=>T.IsNotEmpty(e)),Q(e=>this.httpService.post(Ne.SendTransferOrder,e))).subscribe(()=>this.getListData())}onReceiveDelivery(){this.matDialog.open(Si,{data:{type:"RECEIVE"}}).afterClosed().pipe(L(e=>T.IsNotEmpty(e)),Q(e=>{let a={ID:this.data.ID||this.data.Transfer.ID,Date:e.Date,Note:e.Note};return this.httpService.post(Ne.ReceiveTransferOrder,a)})).subscribe(()=>this.getListData())}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(pe),C(Me),C(at),C(ee),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-transfer-order-info"]],standalone:!1,features:[re],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown","titleLimit",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown","titleLimit"],["class","btn-group",4,"ngIf"],[1,"btn-group","ms-5"],["target","_blank",1,"btn","btn-outline-secondary",2,"float","left",3,"routerLink","queryParams"],[1,"fa-solid","fa-print","me-3"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu",2,"cursor","pointer"],["target","_blank",1,"dropdown-item",3,"routerLink","queryParams"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],[4,"ngIf"],[1,"container-fluid","card-container","mt-5"],[1,"row"],[1,"col-sm-4"],[1,"card"],[1,"card-header","d-flex","align-items-center"],[1,"title","mb-0","d-flex","align-items-center"],["aria-hidden","true",1,"fa","fa-location-dot"],["class","badge rounded-pill d-flex align-items-center gap-3 fs-5 bg-danger text-white ms-3",3,"routerLink",4,"ngIf"],[1,"card-body"],[1,"table-sm","table-borderless"],[1,"card-header"],["class","row",3,"pb-8",4,"ngIf"],["class","row pb-8",4,"ngIf"],["class","row",4,"ngIf"],[1,"col-sm-8"],["class","card-header",4,"ngIf"],["id","tableGrid",1,"table","custom-table","w-100"],[1,"thead-light","sticky-top-thead"],[1,"text-center",2,"width","1px"],[2,"width","100%"],["style","width: 400px",4,"ngIf"],["style","width: 30px","class","text-center",4,"ngIf"],[1,"text-center",2,"width","30px"],["style","width: 85px","class","text-end",4,"ngIf"],["style","width: 100px","class","text-end",4,"ngIf"],["style","width: 20px","class","text-end",4,"ngIf"],["style","width: 110px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-center"],["class","text-center",4,"ngIf"],[1,"text-center","empty-column"],["class","text-end","colspan","1",4,"ngIf"],["class","text-end","colspan","2",4,"ngIf"],["target","_blank",3,"routerLink","queryParams"],[1,"btn-group"],[1,"btn","btn-outline-secondary",2,"float","left",3,"click"],[1,"fas","fa-upload","me-3"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle","border-start-0"],[1,"dropdown-item",3,"click"],["class","btn btn-outline-secondary ms-5","role","button",3,"click",4,"ngIf"],["style","cursor: pointer","class","btn btn-outline-secondary ms-5","role","button",3,"click",4,"ngIf"],["class","btn btn-outline-secondary ms-5","role","button","matTooltipPosition","above",3,"ngClass","matTooltip","click",4,"ngIf"],["class","btn btn-outline-secondary btn-sm dropdown-toggle","data-bs-toggle","dropdown",3,"disabled",4,"ngIf"],["class","dropdown-menu dropdown-menu-end","style","cursor: pointer; color: black",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","ms-5",3,"click"],[1,"fa-solid","fa-truck"],["role","button",1,"btn","btn-outline-secondary","ms-5",2,"cursor","pointer",3,"click"],[1,"fa-solid","fa-check"],["role","button","matTooltipPosition","above",1,"btn","btn-outline-secondary","ms-5",3,"click","ngClass","matTooltip"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle",3,"disabled"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer","color","black"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square","me-3"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"badge","rounded-pill","d-flex","align-items-center","gap-3","fs-5","bg-danger","text-white","ms-3",3,"routerLink"],["aria-hidden","true",1,"fa","fa-trash","me-2"],[2,"font-size","12px"],["target","_blank",3,"href"],[1,"col","text-end"],[1,"mt-3"],[1,"col-3","text-center","position-relative"],[1,"fa-solid","fa-angle-up","current-status-icon"],[1,"d-flex","justify-content-center","h-100"],[1,"timeline"],[1,"col-5"],[1,"fw-bold"],[3,"innerHTML"],[1,"row","pb-8"],[1,"d-flex","justify-content-between"],[1,"me-auto","d-sm-block","mt-3"],[1,"d-inline"],[1,"text-body-secondary","h6"],[1,"dropdown-menu","dropdown-menu-end","cursor","text-dark",2,"z-index","1021"],[2,"width","400px"],[1,"text-end",2,"width","85px"],[1,"text-end",2,"width","100px"],[1,"text-end",2,"width","20px"],[1,"text-end",2,"width","110px"],[3,"serials"],["class","text-center",3,"class",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],[1,"text-end"],[1,"text-end","text-danger"],["colspan","1",1,"text-end"],["colspan","2",1,"text-end"],[1,"alert","alert-warning"],["aria-hidden","true",1,"fa-regular","fa-file-lines"],[1,"me-2"]],template:function(a,o){a&1&&_(0,Km,106,59,"mainpanel-cmp",0),a&2&&m("ngIf",o.data)},dependencies:[mt,J,B,G,oe,ke,dt,ge,he,Be,Qo],styles:[".current-status-icon[_ngcontent-%COMP%]{background-color:#fff;border-radius:50%;box-shadow:0 2px #b8b8b8;width:35px;height:35px;font-size:35px}.timeline[_ngcontent-%COMP%]{border-left:3px solid #e1e1e1;height:100%;width:0px}"]})};var Jm=(t,r)=>({ID:t,Template:r}),Ym=(t,r)=>({ID:t,Template:r,Cost:1}),fn=t=>({ID:t}),Xm=()=>["/menu/Logistics/Archive/Inbound_Logistics/Form"],Zm=()=>["/menu/Contacts/Contact/Suppliers/Info"];function ec(t,r){if(t&1){let e=b();n(0,"div",2)(1,"a",35),g("click",function(){d(e);let o=s(2);return u(o.export("InboundLogistics/ExportInfoItems","Transfer Item Inbound Logistics.csv"))}),f(2,"i",36),p(3,"Export "),i()()}}function tc(t,r){if(t&1&&(n(0,"a",37),f(1,"i",38),p(2,"Edit"),i()),t&2){let e=s(2);m("routerLink",N(2,Xm))("queryParams",M(3,fn,e.data.Fulfillment.ID))}}function ic(t,r){if(t&1){let e=b();n(0,"a",39),g("click",function(){d(e);let o=s(2);return u(o.deleteData())}),f(1,"i",40),p(2,"Delete"),i()}}function nc(t,r){if(t&1&&(n(0,"tr")(1,"th"),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(3);l(6),I(e.data.Supplier==null?null:e.data.Supplier.Mobile)}}function oc(t,r){if(t&1&&(n(0,"tr")(1,"th"),p(2,"City"),i(),n(3,"td"),p(4,":"),i(),f(5,"td",44),i()),t&2){let e=s(3);l(5),m("innerHTML",e.data.Supplier==null?null:e.data.Supplier.Address,j)}}function rc(t,r){if(t&1&&(n(0,"div",14)(1,"div",15)(2,"h2"),f(3,"i",41),p(4,"Supplier "),i()(),n(5,"div",18)(6,"table",19)(7,"tr")(8,"th"),p(9,"Name"),i(),n(10,"td"),p(11,":"),i(),n(12,"td")(13,"a",42),p(14),i()()(),_(15,nc,7,1,"tr",43)(16,oc,6,1,"tr",43),i()()()),t&2){let e=s(2);l(13),m("routerLink",N(5,Zm))("queryParams",M(6,fn,e.data.Supplier==null?null:e.data.Supplier.ID)),l(),I(e.data.Supplier==null?null:e.data.Supplier.Name),l(),m("ngIf",e.data.Supplier==null?null:e.data.Supplier.Mobile),l(),m("ngIf",e.data.Supplier==null?null:e.data.Supplier.Address)}}function ac(t,r){if(t&1&&(z(0),f(1,"p",48),$()),t&2){let e=s().$implicit;l(),m("innerHTML",e==null?null:e.Note,j)}}function lc(t,r){if(t&1&&(n(0,"tr")(1,"td"),p(2),i(),n(3,"td")(4,"a",45),p(5),i(),n(6,"div"),p(7),i(),f(8,"app-serial-note",46),_(9,ac,2,1,"ng-container",43),i(),n(10,"td",47),p(11),n(12,"div"),p(13),i()()()),t&2){let e=r.$implicit,a=r.index;l(2),I(a+1+"."),l(2),m("queryParams",M(8,fn,e.VariantID)),l(),D(" ",e.Name," "),l(2),I(e.Code),l(),m("serials",e.Serial),l(),m("ngIf",e.Note!=null),l(2),D("",e.Quantity," "),l(2),I(e.UOMName)}}function pc(t,r){if(t&1&&(n(0,"div",14)(1,"div",15)(2,"h2"),f(3,"i",49),p(4,"Note "),i()(),f(5,"div",50),i()),t&2){let e=s(2);l(5),m("innerHTML",e.data.Fulfillment.Note,j)}}function mc(t,r){if(t&1&&(n(0,"span")(1,"b"),p(2,"Modified:"),i(),p(3),v(4,"date"),i()),t&2){let e=s(3);l(3),Qe(" ",P(4,2,e.data.CreatedInfo.Modified.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo.Modified.User," ")}}function cc(t,r){if(t&1&&(n(0,"div",51),f(1,"i",52),n(2,"span")(3,"b"),p(4," Created:"),i(),p(5),v(6,"date"),i(),_(7,mc,5,5,"span",43),i()),t&2){let e=s(2);l(5),Qe(" ",P(6,3,e.data.CreatedInfo.Created.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo.Created.User," "),l(2),m("ngIf",e.data.CreatedInfo.Modified==null?null:e.data.CreatedInfo.Modified.Date)}}function sc(t,r){if(t&1&&(n(0,"mainpanel-cmp",1)(1,"actions")(2,"div",2)(3,"a",3),f(4,"i",4),p(5,"Print "),i(),f(6,"button",5),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Print with Cost"),i()()()(),_(11,ec,4,0,"div",8),n(12,"div",2),_(13,tc,3,5,"a",9)(14,ic,3,0,"a",10),i()(),n(15,"content")(16,"div",11)(17,"div",12)(18,"div",13)(19,"div",14)(20,"div",15)(21,"h2"),f(22,"i",16),p(23,"Order "),n(24,"small",17),p(25),i()()(),n(26,"div",18)(27,"table",19)(28,"tr")(29,"th"),p(30,"Outlet"),i(),n(31,"td"),p(32,":"),i(),n(33,"td"),p(34),i()(),n(35,"tr")(36,"th"),p(37,"Bill"),i(),n(38,"td"),p(39,":"),i(),n(40,"td")(41,"a",20),p(42),i(),p(43),v(44,"date"),i()()()()(),_(45,rc,17,8,"div",21),n(46,"div",14)(47,"div",15)(48,"h2"),f(49,"i",22),p(50,"Fulfillment "),i()(),n(51,"div",18)(52,"table",19)(53,"tr")(54,"th"),p(55,"Outlet"),i(),n(56,"td"),p(57,":"),i(),n(58,"td"),p(59),i()(),n(60,"tr")(61,"th"),p(62,"Date"),i(),n(63,"td"),p(64,":"),i(),n(65,"td"),p(66),v(67,"date"),i()(),n(68,"tr")(69,"th"),p(70,"Number"),i(),n(71,"td"),p(72,":"),i(),n(73,"td"),p(74),i()(),n(75,"tr")(76,"th"),p(77,"Courier"),i(),n(78,"td"),p(79,":"),i(),n(80,"td"),p(81),i()()()()()(),n(82,"div",23)(83,"div",14)(84,"div",15)(85,"h2"),f(86,"i",24),p(87,"Products "),i()(),n(88,"div",18)(89,"table",25)(90,"thead",26)(91,"tr")(92,"th",27),p(93,"No."),i(),n(94,"th"),p(95,"Products"),i(),n(96,"th",28),p(97,"Qty"),i()()(),n(98,"tbody"),_(99,lc,14,10,"tr",29),i(),n(100,"tfoot",30)(101,"tr")(102,"td",31),p(103,"Total"),i(),n(104,"td",32),p(105),v(106,"sum"),i()()()()()(),_(107,pc,6,1,"div",21),i(),n(108,"div",33),_(109,cc,8,6,"div",34),i()()()()()),t&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),l(3),m("queryParams",Ae(31,Jm,e.data.Fulfillment.ID,e.data.PrintConfig.ID)),l(6),m("queryParams",Ae(34,Ym,e.data.Fulfillment.ID,e.data.PrintConfig.ID)),l(2),m("ngIf",e.roleService.global.Export),l(2),m("ngIf",e.roleService.logistic.Edit),l(),m("ngIf",e.roleService.logistic.Delete),l(11),D(" (",e.data.Fulfillment.Status,") "),l(9),I(e.data.Order.OutletName),l(7),m("queryParams",M(37,fn,e.data.Order.InvoiceID)),l(),D(" ",e.data.Order.Number," "),l(),D(" - ",P(44,22,e.data.Order.Date,"dd MMM yyyy")," "),l(2),m("ngIf",e.data.Supplier==null?null:e.data.Supplier.ID),l(14),D(" ",e.data.Fulfillment.OutletName," "),l(7),D(" ",P(67,25,e.data.Fulfillment.Date,"dd MMM yyyy")," "),l(8),D(" ",e.data.Fulfillment.Number," "),l(7),D(" ",e.data.Fulfillment.Courier," "),l(18),m("ngForOf",e.data.Items),l(6),D("",P(106,28,e.data.Items,"Quantity")," "),l(2),m("ngIf",e.data==null?null:e.data.Fulfillment.Note),l(2),m("ngIf",!e.roleService.users.LogRestriction)}}var _n=class t extends Se{constructor(e,a,o,c,w,H,ie){super(e,a,"InboundLogistics/DetailInfo",null,null,o);this.csvConverter=c;this.router=w;this.toastr=H;this.roleService=ie}preGetList(){let e=this.route.snapshot.queryParams;this.pageData.Filter.ID=e.ID}postInit(e){e.Items=e.Items.filter(a=>a.Quantity!=0),this.menuData.H=`Inbound Logistics #${e.Fulfillment.Number}`}deleteData(){confirm("Are you sure you want to delete selected record/s?")&&this.httpService.delete("/API/InboundLogistics/DeleteInfo",{params:[{key:"ID",value:this.data.Fulfillment.ID}]}).subscribe(e=>{this.toastr.success(e.Message,ve.Success),this.router.navigate(["/menu/Logistics/Archive/Inbound_Logistics"])})}export(e,a){this.httpService.get(`/api/${e}`,[{key:"ID",value:this.route.snapshot.queryParams.ID}]).subscribe(o=>{this.csvConverter.convertToCSV(o,a)})}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(pe),C(Me),C(at),C(ee),C(ne))};static \u0275cmp=O({type:t,selectors:[["POS-supplier-delivery-info"]],standalone:!1,features:[re],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn-group","me-5"],["routerLink","/print/InDelivery",1,"btn","btn-outline-secondary",2,"float","left",3,"queryParams"],[1,"fa-solid","fa-print","me-3"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu",2,"cursor","pointer"],["routerLink","/print/InDelivery",1,"dropdown-item",3,"queryParams"],["class","btn-group me-5",4,"ngIf"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-4"],[1,"card"],[1,"card-header"],[1,"fa-solid","fa-receipt","me-5"],[1,"text-body-secondary","h6"],[1,"card-body"],[1,"table-sm","table-borderless"],["target","_blank","routerLink","/menu/Orders/Orders/Supplier_Bill/Info",3,"queryParams"],["class","card",4,"ngIf"],[1,"fa-solid","fa-truck","me-5"],[1,"col-8"],[1,"fa-solid","fa-box","me-5"],[1,"table"],[1,"thead-light"],[2,"width","40px"],[2,"width","50px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","2",1,"text-end","empty-column","fw-bold"],[1,"text-center","empty-column","fw-bold"],[1,"col-12"],["class","alert alert-warning",4,"ngIf"],[1,"btn","btn-outline-secondary",2,"float","left",3,"click"],[1,"fas","fa-upload","me-3"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square","me-3"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"fa-solid","fa-address-card","me-5"],["target","_blank",3,"routerLink","queryParams"],[4,"ngIf"],[3,"innerHTML"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[3,"serials"],[1,"text-center"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],[1,"fa-solid","fa-note-sticky","me-5"],[1,"card-body",3,"innerHTML"],[1,"alert","alert-warning"],["aria-hidden","true",1,"fa-regular","fa-file-lines"]],template:function(a,o){a&1&&_(0,sc,110,39,"mainpanel-cmp",0),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,oe,dt,he,Be],encapsulation:2})};function dc(t,r){if(t&1){let e=b();z(0),n(1,"POS-uppy",3),g("fileUploaded",function(o){d(e);let c=s(2);return u(c.onSelectFile(o))}),i(),$()}t&2&&(l(),m("subtitle","Accepted file formats: .csv & max file size: 1 MB"))}function uc(t,r){if(t&1){let e=b();z(0),n(1,"POS-uppy",3),g("fileUploaded",function(o){d(e);let c=s(2);return u(c.onSelectFile(o))}),i(),$()}t&2&&(l(),m("subtitle","Accepted file formats: .csv & max file size: 1 MB"))}function _c(t,r){if(t&1&&_(0,dc,2,1,"ng-container",2)(1,uc,2,1,"ng-container",2),t&2){let e=s();m("ngIf",e.uploadState()===e.uploadStateEnum.Idle||e.uploadState()===e.uploadStateEnum.Uploading),l(),m("ngIf",e.uploadState()===e.uploadStateEnum.Success||e.uploadState()===e.uploadStateEnum.Error)}}var gn=class t{constructor(r,e,a){this.dialogRef=r;this.toastService=e;this.httpService=a;this.config=new _e,this.config.title="Import Courier"}config;file;uploadState=vt(0);uploadStateEnum=gr;onSelectFile(r){this.file=r}onOk(){this.uploadState.set(1);let r=new FormData;r.append("File",this.file),this.httpService.postFormData("/api/transferorder/ImportCourier",r).subscribe({next:e=>{this.uploadState.set(2),this.toastService.success(e.Message,ve.Success),this.dialogRef.close("Success")},error:e=>{this.uploadState.set(3)}})}onClose(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||t)(C(ye),C(ee),C(k))};static \u0275cmp=O({type:t,selectors:[["POS-modal-upload-courier"]],standalone:!1,decls:3,vars:1,consts:[["modalContent",""],[3,"onOk","onCancel","onClose","config"],[4,"ngIf"],["sampleUrl","https://cdn.dealpos.xyz/web-import-template/Courier-Import-Template.csv",3,"fileUploaded","subtitle"]],template:function(e,a){if(e&1){let o=b();n(0,"modal-material",1),g("onOk",function(){return d(o),u(a.onOk())})("onCancel",function(){return d(o),u(a.onClose())})("onClose",function(){return d(o),u(a.onClose())}),_(1,_c,2,2,"ng-template",null,0,Z),i()}e&2&&m("config",a.config)},dependencies:[B,fe,Ki],encapsulation:2})};var fc=()=>["/menu/Logistics/Setup/Courier/Form"],gc=t=>({"border-end-0":t}),Cc=()=>["/menu/Logistics/Setup/Courier/Info"],vc=t=>({ID:t}),yc=t=>({"text-decoration-line-through":t});function xc(t,r){if(t&1){let e=b();n(0,"a",17),g("click",function(){d(e);let o=s(2);return u(o.httpPostListID("TransferOrder/RemoveCourier"))}),f(1,"i",18),p(2,"Delete "),i()}}function Sc(t,r){if(t&1){let e=b();n(0,"button",19),g("click",function(){d(e);let o=s(2);return u(o.onImport())}),f(1,"i",20),p(2,"Import "),i()}if(t&2){let e=s(2);ot(M(2,gc,e.roleService.global.Export))}}function hc(t,r){if(t&1){let e=b();n(0,"button",19),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",21),p(2," Export "),i()}}function bc(t,r){if(t&1){let e=b();n(0,"div",22)(1,"h6"),p(2,"Discontinued"),i(),n(3,"radio-options",23),h("modelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.Bin,o)||(c.pageData.Filter.Bin=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),x("model",e.pageData.Filter.Bin),m("options",e.radioOption)}}function Dc(t,r){if(t&1){let e=b();n(0,"input",27),h("ngModelChange",function(o){d(e);let c=s().$implicit;return S(c.selected,o)||(c.selected=o),u(o)}),i()}if(t&2){let e=s().$implicit;x("ngModel",e.selected)}}function Ic(t,r){if(t&1&&(n(0,"tr",24)(1,"td"),_(2,Dc,1,1,"input",25),i(),n(3,"td")(4,"a",26)(5,"span"),p(6),i()()(),n(7,"td"),p(8),i()()),t&2){let e=r.$implicit,a=s(2);l(2),m("ngIf",a.roleService.logistic.Delete),l(2),m("routerLink",N(7,Cc))("queryParams",M(8,vc,e.ID)),l(),ot(M(10,yc,e.Bin)),l(),D(" ",e.Name," "),l(2),I(e.OutletName)}}function Tc(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,xc,3,0,"a",3),n(3,"div",4),_(4,Sc,3,4,"button",5)(5,hc,3,0,"button",6),i(),n(6,"a",7),p(7,"Add"),i()(),n(8,"filters"),_(9,bc,4,2,"ng-template",null,0,Z),i(),n(11,"content")(12,"div",8)(13,"div",9)(14,"table",10)(15,"thead",11)(16,"tr")(17,"th",12)(18,"input",13),g("change",function(o){d(e);let c=s();return u(c.onSelectAllData(o.target.checked))}),i()(),n(19,"th"),p(20,"Name"),i(),n(21,"th"),p(22,"Destination Outlet Filter"),i()()(),n(23,"tbody"),_(24,Ic,9,12,"tr",14),i()()(),n(25,"div",15)(26,"POS-complex-pagination",16),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.getSelectedData().length>0),l(2),m("ngIf",e.roleService.logistic.Create),l(),m("ngIf",e.roleService.global.Export),l(),m("routerLink",N(11,fc)),l(18),m("ngForOf",e.data.Data),l(2),m("total",e.data.Data.length)("pageData",e.pageData)}}var Cn=class t extends Se{constructor(e,a,o,c,w){super(e,a,"TransferOrder/GetCourierList","TransferOrderLoader/GetCourierListLoader",o);this.roleService=c;this.matDialog=w;this.radioOption=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"},{Key:null,Value:"All"}]}radioOption;onImport(){this.matDialog.open(gn).afterClosed().pipe(L(e=>T.IsNotEmpty(e))).subscribe(()=>this.getListData())}openExportModal(){this.matDialog.open(Ie,{data:{title:"Courier",exportTypes:[{ID:"TransferOrderExport/GetCourierList",Value:"Default",FileName:"Courier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"TransferOrder/GetCourierListCount",pagination:!0}})}postInit(e){this.data.Data=e.Data.map(a=>le(ae({},a),{OutletName:a.Outlet?a.Outlet?.join(", "):""}))}preInitList(){this.pageData.Filter.Bin=!1}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(ee),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-courier"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["value","Delete","matTooltipPosition","above","matTooltip","Delete","class","btn btn-danger me-3",3,"click",4,"ngIf"],[1,"btn-group","ms-3","me-6"],["class","btn btn-outline-secondary",3,"class","click",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"button","btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","14px"],["type","checkbox",3,"change"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"d-sm-block","mt-2"],["api","TransferOrder/GetCourierListCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["value","Delete","matTooltipPosition","above","matTooltip","Delete",1,"btn","btn-danger","me-3",3,"click"],[1,"fas","fa-trash","me-3"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-download","me-3"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","CourierStatus",3,"modelChange","model","options"],[1,"border-bottom"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[3,"routerLink","queryParams"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(a,o){a&1&&_(0,Tc,27,12,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,Dt,R,W,oe,Ht,Je,ke],encapsulation:2})};var wc=()=>["/menu/Logistics/Setup/Courier"];function Oc(t,r){t&1&&(n(0,"span",21),p(1,"Name is required"),i())}function Ec(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2)(1,"actions")(2,"a",3),p(3,"Cancel"),i(),n(4,"button",4),g("click",function(){d(e);let o=s();return u(o.onSubmit("TransferOrder/UpdateCourierList"))}),p(5," Save "),i()(),n(6,"content")(7,"div",5)(8,"div",6)(9,"div",7)(10,"div",8)(11,"div",9)(12,"h3"),p(13,"General"),i()(),n(14,"div",10)(15,"div",6)(16,"div",11)(17,"div",12)(18,"input",13,0),h("ngModelChange",function(o){d(e);let c=s();return S(c.formData.Name,o)||(c.formData.Name=o),u(o)}),i(),n(20,"label"),p(21,"Name"),i(),_(22,Oc,2,0,"span",14),i()(),n(23,"div",11)(24,"div",12)(25,"div",15)(26,"label"),p(27,"Suspend"),i(),n(28,"mat-radio-group",16),h("ngModelChange",function(o){d(e);let c=s();return S(c.formData.Bin,o)||(c.formData.Bin=o),u(o)}),n(29,"mat-radio-button",17),p(30,"Yes"),i(),n(31,"mat-radio-button",18),p(32," No "),i()()()()()()()()()(),n(33,"div",6)(34,"div",7)(35,"div",8)(36,"div",9)(37,"h3"),p(38,"Destination Outlet Filter"),i()(),n(39,"div",10)(40,"div",6)(41,"div",7)(42,"outlet-selector",19),h("ngModelChange",function(o){d(e);let c=s();return S(c.formData.EntityID,o)||(c.formData.EntityID=o),u(o)}),i(),n(43,"small",20),p(44," This restriction only applies for the destination outlet in the "),n(45,"strong"),p(46,"Transfer Order Form"),i(),p(47,". "),i()()()()()()()()()()}if(t&2){let e=we(19),a=s();m("pageData",a.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),m("routerLink",N(14,wc)),l(2),m("disabled",!a.formData.Name),l(14),x("ngModel",a.formData.Name),l(4),m("ngIf",e.invalid&&(e.dirty||e.touched)),l(6),x("ngModel",a.formData.Bin),l(),m("value",!0),l(2),m("value",!1),l(11),m("multiple",!0),x("ngModel",a.formData.EntityID),m("maxSelectedLabels",10)("isFloatLabel",!0)}}var vn=class t extends qt{constructor(e,a,o,c,w){super(e,a,"TransferOrderLoader/CourierFormInitial",o);this.toaster=c;this.router=w}postBindForm(){T.IsEmpty(this.formData.Name)&&(this.formData.Name="")}onSubmitSuccess(e){this.toaster.success(e.Message,ve.Success),this.router.navigate(["/menu/Logistics/Setup/Courier"])}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(pe),C(ee),C(at))};static \u0275cmp=O({type:t,selectors:[["POS-courier-form"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["name","ngModel"],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"routerLink"],["type","button","role","button",1,"btn","btn-success",3,"click","disabled"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-6"],[1,"form-floating-outline"],["type","text","autofocus","","required","","name","Name","id","Name","placeholder","Name",1,"form-control",3,"ngModelChange","ngModel"],["class","control-label text-danger",4,"ngIf"],[1,"form-floating-outline","radio","border","rounded"],["aria-label","Select an option","color","primary",3,"ngModelChange","ngModel"],[3,"value"],[1,"ps-3","mt-4",3,"value"],[3,"ngModelChange","multiple","ngModel","maxSelectedLabels","isFloatLabel"],[1,"form-text","text-muted","outlet-info"],[1,"control-label","text-danger"]],template:function(a,o){a&1&&_(0,Ec,48,15,"mainpanel-cmp",1),a&2&&m("ngIf",o.formData&&o.formData.Name!=null)},dependencies:[B,G,Ce,R,ho,W,Fo,Vo,oe,Pe],styles:[".outlet-info[_ngcontent-%COMP%]{display:block;margin-top:.4rem;font-size:.85rem;color:#6c757d}.outlet-info[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#495057}.outlet-info[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:italic;color:#5a6268}"]})};var yn=class t{constructor(r,e){this.dt=r;this.dialogRef=e;this.config=new _e,this.config.title="Receive Note",this.data=r.data}config;data;onSave(){this.dialogRef.close(this.data)}static \u0275fac=function(e){return new(e||t)(C(Ke),C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-modal-note"]],standalone:!1,decls:4,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],["cols","24","rows","6",1,"form-control",3,"ngModelChange","ngModel"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.onSave()})("onCancel",function(){return a.dialogRef.close()})("onClose",function(){return a.dialogRef.close()}),n(1,"content")(2,"div",1)(3,"textarea",2),h("ngModelChange",function(c){return S(a.data.Note,c)||(a.data.Note=c),c}),i()()()()),e&2&&(m("config",a.config),l(3),x("ngModel",a.data.Note))},dependencies:[fe,Ce,R,W],encapsulation:2})};var Br=t=>({ID:t}),Mc=()=>["/menu/Products/Catalog/Variants/Info"],Pc=t=>({"bg-gradient-warning":t});function Fc(t,r){if(t&1){let e=b();n(0,"tr",27)(1,"td")(2,"a",28),p(3),i()(),f(4,"td",29),n(5,"td")(6,"input",30),h("ngModelChange",function(o){let c=d(e).$implicit;return S(c.Quantity,o)||(c.Quantity=o),u(o)}),i()(),n(7,"td",31),p(8),v(9,"number"),i(),n(10,"td",32),p(11),v(12,"number"),i(),n(13,"td")(14,"textarea",33),h("ngModelChange",function(o){let c=d(e).$implicit;return S(c.Note,o)||(c.Note=o),u(o)}),i()()()}if(t&2){let e=r.$implicit,a=s(2);l(2),m("routerLink",N(16,Mc))("queryParams",M(17,Br,e.VariantID)),l(),I(e.Name),l(),m("innerHTML",e.Code,j),l(2),x("ngModel",e.Quantity),m("max",e.Transfer)("disabled",e.TypeID==a.serialized),l(2),D(" ",E(9,12,e.Transfer)," "),l(2),m("ngClass",M(19,Pc,e.Quantity-e.Transfer!=0)),l(),D(" ",E(12,14,e.Quantity-e.Transfer)," "),l(3),x("ngModel",e.Note),m("disabled",e.TypeID==a.serialized)}}function Vc(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",1)(1,"actions")(2,"a",2),p(3,"Cancel"),i(),n(4,"button",3),g("click",function(){d(e);let o=s();return u(o.openNoteDialog())}),p(5,"Save"),i()(),n(6,"content")(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h2"),f(13,"i",9),p(14),i()(),n(15,"div",10)(16,"div",11)(17,"div",12),p(18,"Date"),i(),n(19,"div",13),p(20,":"),i(),n(21,"div",14)(22,"datepicker",15),h("dateChange",function(o){d(e);let c=s();return S(c.data.Date,o)||(c.data.Date=o),u(o)}),i()()(),n(23,"div",16)(24,"div",12),p(25,"Courier"),i(),n(26,"div",13),p(27,":"),i(),n(28,"div",14),p(29),i()(),n(30,"div",17)(31,"div",12),p(32,"Note"),i(),n(33,"div",13),p(34,":"),i(),f(35,"div",18),i()()()(),n(36,"div",19)(37,"div",7)(38,"div",8)(39,"h2"),p(40,"Products"),i()(),n(41,"div",10)(42,"table",20)(43,"thead",21)(44,"tr")(45,"th",22),p(46,"NAME"),i(),n(47,"th",23),p(48,"CODE"),i(),n(49,"th",24),p(50,"QTY"),i(),n(51,"th",24),p(52,"TRANSFER"),i(),n(53,"th",24),p(54,"DIFF"),i(),n(55,"th",25),p(56,"NOTE"),i()()(),n(57,"tbody"),_(58,Fc,15,21,"tr",26),i()()()()()()()()()}if(t&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),m("queryParams",M(10,Br,e.data.ID)),l(12),D(" ",e.data==null?null:e.data.Outlet," "),l(8),m("width",100),x("date",e.data.Date),l(7),D(" ",e.data.Courier," "),l(6),m("innerHTML",e.data.Note,j),l(23),m("ngForOf",e.data.Items)}}var xn=class t extends qt{constructor(e,a,o,c,w,H,ie){super(a,o,"TransferOrder/ReceiveOutletDelivery",c);this.title=e;this.toastr=w;this.matDialog=H;this.router=ie}serialized=4;postBindForm(e){this.menuData.H=e.PageTitle,this.title.setTitle("Receive & Adjust")}openNoteDialog(){this.matDialog.open(yn,{data:{data:{Note:null}},width:"400px"}).afterClosed().pipe(L(e=>T.IsNotEmpty(e))).subscribe(e=>{let a=le(ae({},this.data),{Note:e?.Note});this.httpService.post("/api/TransferOrder/CheckOut",a).subscribe(o=>this.onSubmitSuccess(o))})}onSubmitSuccess(e){this.toastr.success("Delivery has been received!",ve.Success),this.router.navigate(["/menu/Logistics/Archive/Transfer_Order"])}static \u0275fac=function(a){return new(a||t)(C(ni),C(te),C(k),C(pe),C(ee),C(A),C(at))};static \u0275cmp=O({type:t,selectors:[["POS-receive-transfer-order"]],standalone:!1,features:[re],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["routerLink","/menu/Logistics/Archive/Transfer_Order/Info",1,"btn","me-5","btn-outline-secondary",3,"queryParams"],[1,"btn","btn-success",3,"click"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-xs-12","col-md-3","col-lg-12","col-xl-3","col-sm-12"],[1,"card"],[1,"card-header"],["aria-hidden","true",1,"fa","fa-location-dot"],[1,"card-body"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[2,"width","20%"],[1,"me-2",2,"width","5%"],[1,"w-75"],["appearance","outline",3,"dateChange","width","date"],[1,"d-flex","align-items-center","justify-content-between","w-100","mt-8"],[1,"d-flex","align-items-center","justify-content-between","w-100",2,"margin-top","28px"],[1,"w-75","text-break",3,"innerHTML"],[1,"col-xs-12","col-md-9","col-lg-12","col-xl-9","col-sm-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","250px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],["target","_blank",3,"routerLink","queryParams"],[1,"text-end",3,"innerHTML"],["type","text","autoNum","",1,"form-control","text-end",3,"ngModelChange","ngModel","max","disabled"],[1,"text-end"],[1,"text-end",3,"ngClass"],["rows","3",1,"form-control",3,"ngModelChange","ngModel","disabled"]],template:function(a,o){a&1&&_(0,Vc,59,12,"mainpanel-cmp",0),a&2&&m("ngIf",o.data)},dependencies:[mt,J,B,G,Ce,R,W,oe,de,ct,ge],encapsulation:2})};var pi=class t{constructor(r,e,a){this.data=r;this.dialogRef=e;this.convertCsvService=a;this.modalConfig=new _e,this.modalConfig.title=r.title}modalConfig;convertedData;onSelectFile(r){this.convertCsvService.convert(r).subscribe(e=>{this.convertedData=e})}onClose(){this.dialogRef.close()}onOk(){this.dialogRef.close(this.convertedData)}static \u0275fac=function(e){return new(e||t)(C(Ke),C(ye),C(Cr))};static \u0275cmp=O({type:t,selectors:[["app-modal-import"]],standalone:!1,decls:14,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"modal-dialog"],[1,"modal-content","border-0"],["href","//res.cloudinary.com/pos/raw/upload/v1671075053/POS/CSV/Inbound_QTY.csv",1,"noteBox"],[1,"d-flex","justify-content-between"],["accept",".csv","id","csv","type","file","name","myfile",1,"form-control",3,"change"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.onOk()})("onCancel",function(){return a.onClose()})("onClose",function(){return a.onClose()}),n(1,"content",1)(2,"div",2)(3,"div")(4,"a",3),p(5,"Download Template File"),i()(),n(6,"div",4)(7,"table")(8,"tbody")(9,"tr")(10,"th"),p(11," CSV: "),i(),n(12,"td")(13,"input",5),g("change",function(c){return a.onSelectFile(c.target)}),i()()()()()()()()()),e&2&&m("config",a.modalConfig)},dependencies:[fe],styles:[".noteBox[_ngcontent-%COMP%]{background-color:#ffffe1;border:1px solid #cacaca;padding:3px;display:block;outline:0;margin-bottom:5px;font-size:11px;text-decoration:none}"]})};var Sn=class t{httpService=y(k);constructor(){}getUnfulfilledOrderByNumberOrReferenceNumber(r){return this.httpService.get(Ne.GetUnfulfilledOrderByNumberOrReferenceNumber,[{key:"orderNumberOrReferenceNumber",value:r}])}getUnfulfilledOrderByNumber(r){return this.httpService.post(Ne.GetUnfulfilledNumberByNumber,{Prefix:r,Count:20})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var zt=class t{constructor(r,e){this.toastr=r;this.matDialog=e}cartItems;formItems;entityID;bindCartItems(r=[],e=[],a){this.cartItems=[],r.forEach(o=>{let c=Object.assign({},o);c.QuantityDelivered=o.Quantity,c.Sent=0,c.BarcodeCount=0,c.Completed=!1,c.MaxDeliveryQuantity=c.Quantity,c=this.setSerialSourceItem(c),this.checkIsSent(c,e),a&&this.checkIsEdit(c),this.cartItems.push(c)})}setSerialSourceItem(r){return r.TypeID==4&&(r.serialSources=r?.Serial?JSON.parse(JSON.stringify(r?.Serial)):[]),r}checkIsEdit(r){let e=this.formItems.find(a=>a.ID==r.ID);T.IsNotEmpty(e)?(r.QuantityDelivered=e.Quantity,r.Completed=!1,r.MaxDeliveryQuantity=r.Quantity-r.Sent+e.Quantity):r.Completed||(r.QuantityDelivered=0)}checkIsSent(r,e){let a=e?.find(o=>o.ID==r.ID);T.IsNotEmpty(a)&&(r.Sent=a.Quantity,r.QuantityDelivered=r.Quantity-r.Sent,r.MaxDeliveryQuantity=r.Quantity-r.Sent,r.Completed=r.QuantityDelivered==0)}onScanBarcode(r){if(T.IsEmpty(r))this.toastr.error("Code is empty",ve.Error);else{let e=this.cartItems.find(a=>T.IsNotEmpty(a.Code)&&a.Code==r);if(T.IsNotEmpty(e)){this.cartItems.filter(o=>o.Code==r).forEach(o=>o.BarcodeCount+=1);let a=[];this.cartItems.forEach(o=>a.push(o)),this.cartItems=a,this.toastr.success(`${e.Name} (${e.Code}) count: ${e.BarcodeCount}`,ve.Success)}else this.toastr.error(`No variant with code ${r} found`,ve.Error)}}static \u0275fac=function(e){return new(e||t)(Vt(ee),Vt(A))};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var mi=class t{constructor(r,e,a){this.toastr=r;this.router=e;this.dialog=a}validate(r,e,a){let o=!0;return r.filter(c=>c.QuantityDelivered!=0).length==0&&!a&&(this.toastr.error("Deliver at least one item",ve.Error),o=!1),r.forEach(c=>{c.QuantityDelivered>c.MaxDeliveryQuantity&&(this.toastr.error(`Delivery item of ${c.Name} is greater than ordered!`,ve.Error),o=!1)}),o=this.checkBarcodeConfig(r,e),o}checkBarcodeConfig(r,e){if(!e)return!0;let a=r.some(c=>(c.QuantityDelivered<0?c.QuantityDelivered*-1:c.QuantityDelivered)!=c.BarcodeCount&&c.QuantityDelivered>0),o=!0;return a&&(this.dialog.open(ar,{id:"modalLogisticInfoId",data:{title:"Logistic - Quantity Counter Config Enabled",message:`You must scan the product to be sent one by one before the record can be SAVED or you can turn off the config by following
|
|
1
|
+
import{a as Er}from"./chunk-E4DPE3J5.js";import{a as Or}from"./chunk-RKCLO5OA.js";import{a as Mr,b as Fr}from"./chunk-YZHVQD5P.js";import{a as Pr}from"./chunk-HKJLMHAD.js";import{b as Xi,c as Ir}from"./chunk-V2LFW5D3.js";import{a as Yi}from"./chunk-G454AF6P.js";import{a as hr,e as br,f as ut}from"./chunk-4G344XSZ.js";import{a as Tr}from"./chunk-J4HLBSTR.js";import{a as Dr}from"./chunk-23PJKOTU.js";import{a as wr}from"./chunk-Z2LCSWV4.js";import{a as xr}from"./chunk-ALNSA73T.js";import{a as Sr}from"./chunk-3CUWPIMQ.js";import"./chunk-7ENDP7TZ.js";import{a as qt}from"./chunk-RDMLIBMG.js";import{a as jt,b as Qt}from"./chunk-57Q3ENW2.js";import"./chunk-MK4KDIMG.js";import"./chunk-L7RHCBKX.js";import{a as rr}from"./chunk-LKXAGCSU.js";import{a as or}from"./chunk-4JM455M6.js";import{a as Jo}from"./chunk-OXQJYOVG.js";import{a as Oo}from"./chunk-5HX73JZ3.js";import{a as vr,b as yr}from"./chunk-AER2U57P.js";import{a as fr,b as Gi}from"./chunk-EDXMXTEK.js";import{a as _r}from"./chunk-6PGUQ3CR.js";import{a as Ji}from"./chunk-JLXCN2NR.js";import"./chunk-2YDEXJE5.js";import"./chunk-NQX7EX5A.js";import{a as Cr}from"./chunk-EWZ63XSS.js";import{a as gr}from"./chunk-P3KIIKY4.js";import{e as pr}from"./chunk-FIHWJAIR.js";import{a as ar,b as mr,c as cr}from"./chunk-SRRURHLT.js";import{a as $i}from"./chunk-SGFSKIUE.js";import"./chunk-5M3JINH2.js";import{b as lr}from"./chunk-RFO7MTFT.js";import{a as sr,b as dr,c as ur}from"./chunk-4PPRFE5H.js";import{b as Ki}from"./chunk-YRGGDRUH.js";import{a as xt,b as st}from"./chunk-OISKO6QJ.js";import"./chunk-AEHOR4RJ.js";import"./chunk-Z3E24JZW.js";import"./chunk-NQKVYQ6V.js";import"./chunk-DAIHPIA2.js";import{a as Zo,c as er,e as tr,f as ir,g as nr}from"./chunk-4UYZJCFI.js";import{a as zi}from"./chunk-XKUQPHUA.js";import{a as Xo,b as Ui}from"./chunk-Q4CKRRGM.js";import"./chunk-PIYM2FOP.js";import"./chunk-2OWHEMAL.js";import"./chunk-XZELBTQR.js";import{e as Ni}from"./chunk-RHUDY63D.js";import{a as dt}from"./chunk-MPSML3FA.js";import{d as de,e as qi}from"./chunk-GIDGCFLX.js";import{b as Lo}from"./chunk-XBRBYCWJ.js";import"./chunk-3RK6DDJD.js";import{a as ko}from"./chunk-FP4HFB5J.js";import{p as Mo,q as Po}from"./chunk-H3OZSV6V.js";import"./chunk-YEDKRNXU.js";import"./chunk-VZEPVRCY.js";import"./chunk-7QWJJPNG.js";import{a as Fo,b as Vo,c as No,d as Ht,e as Ko}from"./chunk-6647Y35T.js";import"./chunk-VHAM2DWK.js";import{a as ri}from"./chunk-JPXXXD26.js";import{a as Ho}from"./chunk-MBJ5EVQM.js";import{c as wo}from"./chunk-VQBXUZ6U.js";import{a as Je,b as Yo}from"./chunk-BBGWXLHJ.js";import{f as li}from"./chunk-LKII7K7T.js";import{c as Pe}from"./chunk-6XO6NT6E.js";import{b as Ie}from"./chunk-QHBWVJIQ.js";import{a as Se}from"./chunk-MPCAKU6Y.js";import"./chunk-AJM4N35T.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import{a as Me}from"./chunk-XZR3IMWZ.js";import{d as Go,e as oe,f as Qi}from"./chunk-BLSJR63P.js";import"./chunk-LQ63SW7R.js";import"./chunk-5JJSLRVS.js";import{a as ki,b as Li,c as Ro}from"./chunk-B6LPY2IZ.js";import"./chunk-CWITQVZH.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import{a as Ao,d as Bo,f as Wo,h as Ri}from"./chunk-MFCXEITE.js";import{a as Wi,c as ct}from"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import{d as zo,e as $o}from"./chunk-V3Y7QS6E.js";import{b as te}from"./chunk-EY2BEKKH.js";import"./chunk-3GOO5E5D.js";import{a as Do}from"./chunk-XMYLHF4C.js";import{F as We,G as ji,m as Eo,u as _e,v as fe,w as De}from"./chunk-H7F34T25.js";import{b as ke,c as Wt}from"./chunk-JOXTERIM.js";import{B as Uo,N as ai,O as Ne,g as Be,k as Qo,n as Hi,x as qo}from"./chunk-TSIYPTYI.js";import{a as Ai,c as Bi,d as Ee}from"./chunk-XYB3YDKL.js";import"./chunk-7VKFVS7K.js";import"./chunk-ZVDY66SR.js";import{a as pt,e as ye,f as Ke,g as A,l as jo}from"./chunk-3YKVLHZG.js";import{N as Io,_ as To}from"./chunk-ZHY3BUQJ.js";import"./chunk-VFTGIP5A.js";import"./chunk-LE3BKIDY.js";import{a as ve}from"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import{A as ho,F as Ge,G as Bt,b as Dt,c as Ce,h as R,l as $e,o as W,r as So,s as oi}from"./chunk-RVXZOIFQ.js";import"./chunk-5FSR4IZJ.js";import{a as bo}from"./chunk-JMQDEPZK.js";import{a as T,d as ne}from"./chunk-ZZGSAFGO.js";import"./chunk-DK2SUVKT.js";import{$ as ze,$a as l,$b as Pi,Ac as E,Bc as P,Cc as Vi,D as Ve,Db as Xe,E as L,Fa as gi,Fc as Z,I as je,Ib as n,Jb as i,Kb as f,Lb as z,M as uo,Ma as vt,Mb as $,N as Ft,Ob as b,Od as pe,Q as _o,Qb as g,Qd as at,Rb as s,Rd as G,Td as yt,Ub as vi,Va as j,Vb as vo,Vd as ee,W as wi,Wa as ei,Wc as mt,Y as lt,Yc as J,Yd as k,Za as ti,Zb as Ei,Zc as B,_b as Mi,aa as Q,ca as fo,cd as rt,d as be,db as C,dc as we,e as gt,ec as p,ed as he,fa as q,fb as Oi,fc as I,ga as se,gc as D,gd as ge,hc as Qe,ic as yo,ja as K,jc as x,jd as X,k as Oe,ka as Zt,kb as O,kc as S,lb as ii,lc as h,ma as Vt,na as y,o as Ct,ob as re,pc as xo,qb as _,qc as N,rc as M,sc as Ae,t as V,tc as Fi,u as bt,ua as go,ub as Co,va as d,vb as m,wa as u,wb as Ci,wd as ni,x as co,xb as Nt,y as fi,z as so,zb as ot,zc as v}from"./chunk-UXRO4UFY.js";import{a as ae,b as le,d as po,j as mo}from"./chunk-7DCB7DB2.js";var Kr=()=>["/menu/Logistics/Archive/Transfer_Order/Form"],Jr=()=>["/menu/Logistics/Archive/Transfer_Order/Info"],Yr=t=>({ID:t}),Xr=(t,r,e)=>({"text-success":t,"text-warning":r,"text-danger":e}),Zr=()=>["/print/Transfer"],ea=(t,r)=>({ID:t,Template:r});function ta(t,r){if(t&1){let e=b();n(0,"a",23),g("click",function(){d(e);let o=s(3);return u(o.httpPostListID("TransferOrder/Delete"))}),f(1,"i",24),p(2," Delete"),i()}}function ia(t,r){if(t&1){let e=b();n(0,"a",23),g("click",function(){d(e);let o=s(3);return u(o.onVoid())}),f(1,"i",24),p(2," Void"),i()}}function na(t,r){if(t&1&&(z(0),_(1,ta,3,0,"a",22)(2,ia,3,0,"a",22),$()),t&2){let e=s(2);l(),m("ngIf",e.role.logistic.Delete&&!e.pageData.Config.IsVoidEnabled),l(),m("ngIf",e.role.logistic.TransferOrderVoid&&e.pageData.Config.IsVoidEnabled)}}function oa(t,r){if(t&1){let e=b();n(0,"button",25),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",26),p(2," Export "),i()}}function ra(t,r){t&1&&(n(0,"a",27),p(1,"New"),i()),t&2&&m("routerLink",N(1,Kr))}function aa(t,r){if(t&1){let e=b();n(0,"div",28)(1,"h6"),p(2,"Source"),i(),n(3,"outlet-selector",29),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"Destination"),i(),n(6,"outlet-selector",30),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.DestinationID,o)||(c.pageData.Filter.DestinationID=o),u(o)}),i(),n(7,"h6"),p(8,"Fulfillment"),i(),n(9,"ng-select",31),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.StateID,o)||(c.pageData.Filter.StateID=o),u(o)}),i(),n(10,"h6"),p(11,"Tag"),i(),n(12,"ng-select",32),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.TypeID,o)||(c.pageData.Filter.TypeID=o),u(o)}),i(),n(13,"h6"),p(14,"Courier"),i(),n(15,"ng-select",33),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CourierID,o)||(c.pageData.Filter.CourierID=o),u(o)}),i(),n(16,"h6"),p(17,"From"),i(),n(18,"datepicker",34),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(19,"h6"),p(20,"To"),i(),n(21,"datepicker",35),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i(),n(22,"h6"),p(23,"Creator"),i(),n(24,"autocompleteV2",36),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CreatorID,o)||(c.pageData.Filter.CreatorID=o),u(o)}),i(),n(25,"h6"),p(26,"Sort By"),i(),n(27,"radio-options",37),h("modelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.SortBy,o)||(c.pageData.Filter.SortBy=o),u(o)}),i(),n(28,"h6"),p(29,"Page Size"),i(),n(30,"input",38),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.RowCount,o)||(c.pageData.Filter.RowCount=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),m("accessType",2),x("ngModel",e.pageData.Filter.DestinationID),m("multiple",!1),l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.StateID),l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Courier),x("ngModel",e.pageData.Filter.CourierID),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("ngModel",e.pageData.Filter.CreatorID),l(3),m("options",e.pageData.Options==null?null:e.pageData.Options.SortOption),x("model",e.pageData.Filter.SortBy),l(3),x("ngModel",e.pageData.Filter.RowCount),m("max",1e4)}}function la(t,r){if(t&1){let e=b();n(0,"th",39)(1,"input",40),g("change",function(o){d(e);let c=s(2);return u(c.onSelectAllData(o.target.checked))}),i()()}}function pa(t,r){t&1&&(n(0,"th",41),p(1," Price "),i())}function ma(t,r){if(t&1){let e=b();n(0,"td",39)(1,"input",45),h("ngModelChange",function(o){d(e);let c=s().$implicit;return S(c.selected,o)||(c.selected=o),u(o)}),i()()}if(t&2){let e=s().$implicit;l(),x("ngModel",e.selected)}}function ca(t,r){if(t&1&&(n(0,"td",41),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.Price)," ")}}function sa(t,r){if(t&1&&(n(0,"span"),p(1),i()),t&2){let e=s().$implicit;l(),I(e.Courier)}}function da(t,r){if(t&1&&(n(0,"span"),p(1),i()),t&2){let e=s().$implicit;l(),I(e.CourierName)}}function ua(t,r){if(t&1&&(n(0,"tbody")(1,"tr"),_(2,ma,2,1,"td",12),n(3,"td"),p(4),i(),n(5,"td"),p(6),i(),n(7,"td"),f(8,"a",42),i(),n(9,"td"),p(10),v(11,"date"),i(),n(12,"td"),p(13),v(14,"date"),i(),n(15,"td",41),p(16),i(),_(17,ca,3,3,"td",17),n(18,"td"),p(19),i(),n(20,"td"),p(21),i(),n(22,"td"),p(23),i(),n(24,"td"),_(25,sa,2,1,"span",3)(26,da,2,1,"span",3),i(),n(27,"td")(28,"a",43),f(29,"i",44),i()()()()),t&2){let e=r.$implicit,a=s(2);l(2),m("ngIf",a.role.logistic.Delete&&!a.pageData.Config.IsVoidEnabled||a.role.logistic.TransferOrderVoid&&a.pageData.Config.IsVoidEnabled),l(2),I(e.Source),l(2),I(e.Destination),l(2),m("routerLink",N(25,Jr))("queryParams",M(26,Yr,e.ID))("innerHTML",e.Number,j),l(2),I(P(11,19,e.Date,"dd MMM yyyy")),l(3),I(P(14,22,e.Created,"HH:mm")),l(3),I(e.Quantity),l(),m("ngIf",a.role.sell.PriceVisible&&a.pageData.Config.PriceVisible),l(),ot(Fi(28,Xr,e.StateLabel=="Received",e.StateLabel=="Dispatched",e.StateLabel=="Approved")),l(),D(" ",e.StateLabel," "),l(2),I(e.CreatorName),l(2),I(e.TypeName),l(2),m("ngIf",e.Courier!=null),l(),m("ngIf",e.CourierName!=null&&e.Courier==null),l(2),m("routerLink",N(32,Zr))("queryParams",Ae(33,ea,e.ID,e.SourceTemplateID))}}function _a(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Number,o)||(c.pageData.Filter.Number=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,na,3,2,"ng-container",3)(3,oa,3,0,"button",4),n(4,"div",5),_(5,ra,2,2,"a",6),i()(),n(6,"filters"),_(7,aa,31,21,"ng-template",null,0,Z),i(),n(9,"content")(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11),_(15,la,2,0,"th",12),n(16,"th",13),p(17,"Source"),i(),n(18,"th",14),p(19,"Destination"),i(),n(20,"th"),p(21,"Number"),i(),n(22,"th",15),p(23,"Date"),i(),n(24,"th",15),p(25,"Time"),i(),n(26,"th",16),p(27,"Qty"),i(),_(28,pa,2,0,"th",17),n(29,"th",15),p(30,"Status"),i(),n(31,"th",18),p(32,"Creator"),i(),n(33,"th",15),p(34,"Tag"),i(),n(35,"th",15),p(36,"Courier"),i(),f(37,"th",19),i()(),_(38,ua,30,36,"tbody",20),i()(),n(39,"POS-complex-pagination",21),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.getSelectedData().length>0),l(),m("ngIf",e.role.global.Export),l(2),m("ngIf",e.role.logistic.Create),l(10),m("ngIf",e.role.logistic.Delete&&!e.pageData.Config.IsVoidEnabled||e.role.logistic.TransferOrderVoid&&e.pageData.Config.IsVoidEnabled),l(13),m("ngIf",e.role.sell.PriceVisible&&e.pageData.Config.PriceVisible),l(10),m("ngForOf",e.data.Data),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var Zi=class t extends Se{constructor(e,a,o,c,w,H,ie){super(e,a,"TransferOrder/TransferOrderList","TransferOrderLoader/TransferOrderList",c,w);this.csvConverter=o;this.role=H;this.matDialog=ie}moreFilter=!1;openExportModal(){this.matDialog.open(Ie,{data:{title:"Transfer Order",exportTypes:[{ID:"TransferOrder/TransferOrderList",Value:"Default",FileName:"Transfer Order"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"TransferOrder/TransferOrderRowsCount",pagination:!0}})}onVoid(){if(confirm("Are you sure you want to void these transfer order(s)?")==!1)return;let e=this.getSelectedData().map(a=>a.ID);e.length>0&&this.httpService.put("/api/transferorder/voidlisttransferorder",e,{},1e5,!0).subscribe(a=>{this.toastrService.success(a.Message,"Success"),this.getListData()},a=>this.toastrService.error(a.error.Message,"Error"))}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ee),C(pe),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-transfer-order"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["class","btn btn-success","role","button",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","100px"],[2,"width","150px"],[2,"width","90px"],[1,"text-end",2,"width","50px"],["class","text-end",4,"ngIf"],[2,"width","120px"],[2,"width","16px"],[4,"ngFor","ngForOf"],["api","TransferOrder/TransferOrderRowsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["role","button","class","btn btn-outline-secondary me-5",3,"click",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fas","fa-trash"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["role","button",1,"btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["placeholder","Source",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","Destination",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["bindLabel","Value","bindValue","Key","placeholder","Choose",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Options",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose a courier",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["requestUrl","/API/AC/GetUserSuggestion",1,"input-left","w-100","ac-filter",3,"ngModelChange","ngModel"],["name","SortBy",3,"modelChange","options","model"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","ngModel","max"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"text-end"],[3,"routerLink","queryParams","innerHTML"],["target","_blank",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa","fa-print"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(a,o){a&1&&_(0,_a,40,12,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,Ce,Dt,R,W,oe,de,Ht,We,Je,ct,Ee,Pe,ge,he],encapsulation:2})};var fa=()=>["/menu/Logistics/Archive/Outbound_Logistics/Form"],ga=()=>["/menu/Logistics/Archive/Outbound_Logistics/Info"],eo=t=>({ID:t}),Ca=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],va=()=>["/menu/Orders/Order/Sales_Order/Info"];function ya(t,r){if(t&1){let e=b();z(0),n(1,"a",21),g("click",function(){d(e);let o=s(2);return u(o.httpPostListID("OutboundLogistics/Delete"))}),f(2,"i",22),p(3," Delete"),i(),$()}}function xa(t,r){if(t&1){let e=b();n(0,"button",23),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",24),p(2," Export "),i()}}function Sa(t,r){t&1&&(n(0,"a",25),p(1," New"),i()),t&2&&m("routerLink",N(1,fa))}function ha(t,r){if(t&1){let e=b();n(0,"div",26)(1,"h6"),p(2,"Outlet"),i(),n(3,"outlet-selector",27),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6",28),p(5,"ORIGIN"),i(),n(6,"outlet-selector",27),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.OrderEntityID,o)||(c.pageData.Filter.OrderEntityID=o),u(o)}),i(),n(7,"h6"),p(8,"Customer"),i(),n(9,"autocompleteV2",29),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CustomerID,o)||(c.pageData.Filter.CustomerID=o),u(o)}),i(),n(10,"h6"),p(11,"From - To"),i(),n(12,"div")(13,"datepicker",30),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i()(),n(14,"div",31)(15,"datepicker",32),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i()(),n(16,"h6"),p(17,"Number Filter Comparator"),i(),n(18,"ng-select",33),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.NumberFilterComparator,o)||(c.pageData.Filter.NumberFilterComparator=o),u(o)}),g("ngModelChange",function(){d(e);let o=s(2);return u(o.validateForLookbackDays())}),i(),n(19,"h6"),p(20,"Query Options"),i(),n(21,"ng-select",34),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.QueryOption,o)||(c.pageData.Filter.QueryOption=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),m("accessType",2),x("ngModel",e.pageData.Filter.OrderEntityID),m("multiple",!1),l(3),x("ngModel",e.pageData.Filter.CustomerID),l(4),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(2),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("ngModel",e.pageData.Filter.NumberFilterComparator),m("items",e.pageData.Options.NumberFilterComparatorOptions)("clearable",!1),l(3),x("ngModel",e.pageData.Filter.QueryOption),m("items",e.pageData.Options.QueryOptions)("clearable",!1)}}function ba(t,r){if(t&1){let e=b();n(0,"th",35)(1,"input",36),g("change",function(o){d(e);let c=s(2);return u(c.onSelectAllData(o.target.checked))}),i()()}}function Da(t,r){if(t&1){let e=b();n(0,"input",40),h("ngModelChange",function(o){d(e);let c=s(2).$implicit;return S(c.selected,o)||(c.selected=o),u(o)}),i()}if(t&2){let e=s(2).$implicit;x("ngModel",e.selected)}}function Ia(t,r){if(t&1&&(n(0,"td",35),_(1,Da,1,1,"input",39),i()),t&2){let e=s().$implicit;l(),m("ngIf",e.WriteAccess)}}function Ta(t,r){if(t&1&&(z(0),f(1,"a",41),$()),t&2){let e=s().$implicit;l(),m("routerLink",N(3,ga))("queryParams",M(4,eo,e.ID))("innerHtml",e.Number,j)}}function wa(t,r){if(t&1&&(n(0,"span"),p(1),i()),t&2){let e=s().$implicit;l(),I(e.Number)}}function Oa(t,r){if(t&1&&(n(0,"a",42),p(1),i()),t&2){let e=s().$implicit;m("routerLink",N(3,Ca))("queryParams",M(4,eo,e.InvoiceID)),l(),I(e.InvoiceNumber)}}function Ea(t,r){if(t&1&&(n(0,"a",42),p(1),i()),t&2){let e=s().$implicit;m("routerLink",N(3,va))("queryParams",M(4,eo,e.OrderID)),l(),I(e.OrderNumber)}}function Ma(t,r){if(t&1&&(n(0,"tbody")(1,"tr"),_(2,Ia,2,1,"td",14),n(3,"td"),p(4),i(),n(5,"td"),_(6,Ta,2,6,"ng-container",37)(7,wa,2,1,"ng-template",null,1,Z),i(),n(9,"td"),p(10),i(),n(11,"td"),p(12),i(),n(13,"td"),_(14,Oa,2,6,"a",38)(15,Ea,2,6,"ng-template",null,2,Z),i(),n(17,"td"),p(18),v(19,"date"),i(),n(20,"td"),p(21),v(22,"date"),i()()()),t&2){let e=r.$implicit,a=we(8),o=we(16),c=s(2);l(2),m("ngIf",c.role.logistic.Delete),l(2),I(e.EntityName),l(2),m("ngIf",e.WriteAccess)("ngIfElse",a),l(4),I(e.CustomerName),l(2),I(e.OrderEntityName),l(2),m("ngIf",e.InvoiceID)("ngIfElse",o),l(4),I(P(19,10,e.Date,"dd MMM yyyy")),l(3),I(P(22,13,e.Time,"HH:mm"))}}function Pa(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",4),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Number,o)||(c.pageData.Filter.Number=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),g("textChange",function(){d(e);let o=s();return u(o.validateForLookbackDays())}),n(1,"actions"),_(2,ya,4,0,"ng-container",5)(3,xa,3,0,"button",6),n(4,"div",7),_(5,Sa,2,2,"a",8),i()(),n(6,"filters"),_(7,ha,22,17,"ng-template",null,0,Z),i(),n(9,"content")(10,"div",9)(11,"div",10)(12,"table",11)(13,"thead",12)(14,"tr",13),_(15,ba,2,0,"th",14),n(16,"th",15),p(17,"Outlet"),i(),n(18,"th"),p(19,"Number"),i(),n(20,"th",15),p(21,"Customer"),i(),n(22,"th",16),p(23,"ORIGIN"),i(),n(24,"th"),p(25,"Order#"),i(),n(26,"th",17),p(27,"Date"),i(),n(28,"th",18),p(29,"Time"),i()()(),_(30,Ma,23,16,"tbody",19),i()(),n(31,"POS-complex-pagination",20),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),m("searchBoxPlaceholder",e.searchPlaceholderText),l(2),m("ngIf",e.role.logistic.Delete&&e.getSelectedData().length>0),l(),m("ngIf",e.role.global.Export),l(2),m("ngIf",e.role.logistic.Create),l(10),m("ngIf",e.role.logistic.Delete),l(15),m("ngForOf",e.data.Data),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var en=class t extends Se{constructor(e,a,o,c,w){super(e,a,"OutboundLogistics/OutboundLogisticsList","OutboundLogisticsLoader/List",o);this.role=c;this.matDialog=w}openExportModal(){this.matDialog.open(Ie,{data:{title:"Outbound Logistics",exportTypes:[{ID:"OutboundLogistics/OutboundLogisticsList",Value:"Default",FileName:"Outbound Logistics"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"OutboundLogistics/OutboundLogisticsListCount",pagination:!0}})}sortByOptions=[{Key:!1,Value:"Date"},{Key:!0,Value:"Created"}];httpPostListID(e,a,o){if(a||(a="Are you sure you want to selected record/s?"),confirm(a)==!1)return;let c=this.getSelectedData().filter(w=>w.WriteAccess);c.length>0&&this.postListID(e,c,o)}get searchPlaceholderText(){return"Number "+(this.pageData?.Options?.NumberFilterComparatorOptions?.find(e=>e.Key===this.pageData?.Filter?.NumberFilterComparator)?.Value||"Starts With")}validateForLookbackDays(){this.pageData.Filter.Number&&(this.pageData.Filter.From==T.MinDate||!this.pageData.Filter.From)&&this.pageData.AppConfig.DefaultLookbackDays>0&&(this.pageData.Filter.NumberFilterComparator===3||this.pageData.Filter.NumberFilterComparator===2)&&(this.pageData.Filter.From=this.pageData.Filter.SearchLookbackDate,this.pageData.AppConfig.QueryOptionRecompile&&(this.pageData.Filter.QueryOption=1))}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(ee),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["CustomerDisplay-customer-delivery"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],["ONLY_VIEW",""],["SALESORDER",""],[3,"pageData","text","isFilterOnDropdown","filter","searchBoxPlaceholder","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter","searchBoxPlaceholder"],[4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["class","btn btn-success","role","button","matTooltipPosition","above","matTooltip","Add Delivery",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","130px"],["matTooltip","The Outlet where the order is placed","matTooltipPosition","above",2,"width","130px"],[2,"width","90px"],[2,"width","50px"],[4,"ngFor","ngForOf"],["api","OutboundLogistics/OutboundLogisticsListCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fas","fa-trash"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["role","button","matTooltipPosition","above","matTooltip","Add Delivery",1,"btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["matTooltip","The Outlet where the order is placed","matTooltipPosition","above"],["requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Customer","notFoundMessageFor","customer",1,"form-control","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],[1,"mt-4"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an Comparator",3,"ngModelChange","ngModel","items","clearable"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose an Options",3,"ngModelChange","ngModel","items","clearable"],[2,"width","14px"],["type","checkbox",3,"change"],[4,"ngIf","ngIfElse"],["target","_blank",3,"routerLink","queryParams",4,"ngIf","ngIfElse"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"routerLink","queryParams","innerHtml"],["target","_blank",3,"routerLink","queryParams"]],template:function(a,o){a&1&&_(0,Pa,32,12,"mainpanel-cmp",3),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,Dt,R,W,oe,de,We,Je,Ee,ke,Pe,he],encapsulation:2})};var Fa=()=>["/menu/Logistics/Archive/Inbound_Logistics/Form"],Va=()=>["/menu/Logistics/Archive/Inbound_Logistics/Info"],Vr=t=>({ID:t}),Na=()=>["/menu/Orders/Orders/Supplier_Bill/Info"],ka=(t,r)=>({ID:t,Template:r});function La(t,r){if(t&1){let e=b();z(0),n(1,"a",18),g("click",function(){d(e);let o=s(2);return u(o.httpPostListID("InboundLogistics/DeleteInboundLogistics"))}),f(2,"i",19),p(3," Delete"),i(),$()}}function Ra(t,r){if(t&1){let e=b();n(0,"button",20),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",21),p(2," Export"),i()}}function Aa(t,r){t&1&&(n(0,"a",22),p(1," New"),i()),t&2&&m("routerLink",N(1,Fa))}function Ba(t,r){if(t&1){let e=b();n(0,"div",23)(1,"h6"),p(2,"Outlet"),i(),n(3,"outlet-selector",24),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"Supplier"),i(),n(6,"autocompleteV2",25),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.SupplierID,o)||(c.pageData.Filter.SupplierID=o),u(o)}),i(),n(7,"h6"),p(8,"From"),i(),n(9,"datepicker",26),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(10,"h6"),p(11,"To"),i(),n(12,"datepicker",27),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",4),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),x("ngModel",e.pageData.Filter.SupplierID),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To)}}function Wa(t,r){if(t&1){let e=b();n(0,"th",28)(1,"input",29),g("change",function(o){d(e);let c=s(2);return u(c.onSelectAllData(o.target.checked))}),i()()}}function Ha(t,r){if(t&1){let e=b();n(0,"td",28)(1,"input",34),h("ngModelChange",function(o){d(e);let c=s().$implicit;return S(c.selected,o)||(c.selected=o),u(o)}),i()()}if(t&2){let e=s().$implicit;l(),x("ngModel",e.selected)}}function ja(t,r){if(t&1&&(n(0,"tbody")(1,"tr"),_(2,Ha,2,1,"td",12),n(3,"td"),p(4),i(),n(5,"td"),f(6,"a",30),i(),n(7,"td"),p(8),i(),n(9,"td"),f(10,"a",30),i(),n(11,"td"),p(12),v(13,"date"),i(),n(14,"td"),p(15),v(16,"date"),i(),n(17,"td",31)(18,"a",32),f(19,"i",33),i()()()()),t&2){let e=r.$implicit,a=s(2);l(2),m("ngIf",a.role.logistic.Delete),l(2),I(e.EntityName),l(2),m("routerLink",N(18,Va))("queryParams",M(19,Vr,e.ID))("innerHtml",e.Number,j),l(2),I(e.Name),l(2),m("routerLink",N(21,Na))("queryParams",M(22,Vr,e.SupplierInvoiceID))("innerHtml",e.PONumber,j),l(2),I(P(13,12,e.Date,"dd MMM yyyy")),l(3),I(P(16,15,e.Time,"HH:mm")),l(3),m("queryParams",Ae(24,ka,e.ID,e.PrintTemplateID))}}function Qa(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Number,o)||(c.pageData.Filter.Number=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,La,4,0,"ng-container",3)(3,Ra,3,0,"button",4),n(4,"div",5),_(5,Aa,2,2,"a",6),i()(),n(6,"filters"),_(7,Ba,13,8,"ng-template",null,0,Z),i(),n(9,"content")(10,"div",7)(11,"div",8)(12,"table",9)(13,"thead",10)(14,"tr",11),_(15,Wa,2,0,"th",12),n(16,"th",13),p(17,"Outlet"),i(),n(18,"th",13),p(19,"Number"),i(),n(20,"th",14),p(21,"Supplier"),i(),n(22,"th",13),p(23,"PO Number"),i(),n(24,"th",13),p(25,"Date"),i(),n(26,"th",15),p(27,"Time"),i(),f(28,"th"),i()(),_(29,ja,20,27,"tbody",16),i()(),n(30,"POS-complex-pagination",17),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.role.logistic.Delete&&e.getSelectedData().length>0),l(),m("ngIf",e.role.global.Export),l(2),m("ngIf",e.role.logistic.Create),l(10),m("ngIf",e.role.logistic.Delete),l(14),m("ngForOf",e.data.Data),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var tn=class t extends Se{constructor(e,a,o,c,w,H){super(e,a,"InboundLogistics/InboundLogisticsList","InboundLogisticsLoader/List",c);this.csvConverter=o;this.role=w;this.matDialog=H}openExportModal(){this.matDialog.open(Ie,{data:{title:"Inbound Logistics",exportTypes:[{ID:"InboundLogistics/InboundLogisticsList",Value:"Default",FileName:"Inbound Logistics"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"InboundLogistics/InboundLogisticsRowsCount",pagination:!0}})}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ee),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["CustomerDisplay-supplier-delivery"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[4,"ngIf"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"btn-group"],["class","btn btn-success","role","button","matTooltipPosition","above","matTooltip","Add Delivery",3,"routerLink",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","120px"],[2,"width","500px"],[2,"width","90px"],[4,"ngFor","ngForOf"],["api","InboundLogistics/InboundLogisticsRowsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["role","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fas","fa-trash"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],["role","button","matTooltipPosition","above","matTooltip","Add Delivery",1,"btn","btn-success",3,"routerLink"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Supplier","inputID","SupplierID","notFoundMessageFor","supplier",1,"form-control","ac-filter",3,"ngModelChange","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],[2,"width","14px"],["type","checkbox",3,"change"],[3,"routerLink","queryParams","innerHtml"],[1,"text-end"],["routerLink","/print/InDelivery","target","_blank",3,"queryParams"],["aria-hidden","true",1,"fa","fa-print"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(a,o){a&1&&_(0,Qa,31,11,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,Dt,R,W,oe,de,We,Je,ke,Pe,he],encapsulation:2})};var nn=class t{constructor(r,e,a,o){this.data=r;this.dialogRef=e;this.httpService=a;this.toastr=o;this.modalConfig=new _e,this.modalConfig.title="Email receipt to customer?",this.modalConfig.customWidth="400px"}modalConfig;email;ngOnInit(){}onOk(){let r={email:this.email,invoiceID:this.data.invoiceID};this.httpService.post("/api/Transaction/SendDeliveryEmail",r).subscribe(e=>{this.toastr.success(`Invoice Sent Successful to ${this.email}`,ve.Success),this.dialogRef.close()})}onClose(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||t)(C(Ke),C(ye),C(k),C(ee))};static \u0275cmp=O({type:t,selectors:[["POS-modal-send-email"]],standalone:!1,decls:7,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"form-floating-outline"],["type","text","id","email","placeholder","Email",1,"form-control",3,"ngModelChange","ngModel"],["for","email"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.onOk()})("onCancel",function(){return a.onClose()})("onClose",function(){return a.onClose()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"input",3),h("ngModelChange",function(c){return S(a.email,c)||(a.email=c),c}),i(),n(5,"label",4),p(6,"Email"),i()()()()()),e&2&&(m("config",a.modalConfig),l(4),x("ngModel",a.email))},dependencies:[fe,Ce,R,W],encapsulation:2})};var Nr=()=>["/print/OutDelivery"],Ua=(t,r)=>({ID:t,Template:r}),za=(t,r)=>({ID:t,Template:r,Price:1}),$a=()=>["/menu/Orders/Order/Sales_Order/Info"],xi=t=>({ID:t}),Ga=()=>["/menu/Logistics/Archive/Outbound_Logistics/Form"],Ka=()=>["/menu/Orders/Orders/Customer_Invoice/Info"],Ja=()=>["/menu/Contacts/Contact/Customers/Info"];function Ya(t,r){if(t&1&&(n(0,"a",40),f(1,"i",41),p(2," Edit "),i()),t&2){let e=s(2);m("routerLink",N(2,Ga))("queryParams",M(3,xi,e.data.Fulfillment.ID))}}function Xa(t,r){if(t&1){let e=b();n(0,"a",42),g("click",function(){d(e);let o=s(2);return u(o.deleteData("OutboundLogistics/DeleteDeliveryCustomer"))}),f(1,"i",43),p(2," Delete "),i()}}function Za(t,r){if(t&1){let e=b();n(0,"li",44)(1,"a",45),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),p(2,"Export"),i()()}}function el(t,r){if(t&1){let e=b();n(0,"li",44)(1,"a",45),g("click",function(){d(e);let o=s(2);return u(o.openModalNote(o.data.Fulfillment.Note))}),p(2," Add Note "),i()()}}function tl(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"Invoice"),i(),n(3,"td"),p(4,":"),i(),n(5,"td")(6,"a",25),p(7),i()()()),t&2){let e=s(2);l(6),m("routerLink",N(3,Ka))("queryParams",M(4,xi,e.data.Order.InvoiceId)),l(),D(" ",e.data.Order.InvoiceNumber," ")}}function il(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"Date"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),v(7,"date"),i()()),t&2){let e=s(2);l(6),I(P(7,1,e.data.Order.InvoiceDate,"dd MMM yyyy"))}}function nl(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(3);l(6),I(e.data.Customer==null?null:e.data.Customer.Mobile)}}function ol(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"City"),i(),n(3,"td"),p(4,":"),i(),f(5,"td",47),i()),t&2){let e=s(3);l(5),m("innerHTML",e.data.Customer==null?null:e.data.Customer.Address,j)}}function rl(t,r){if(t&1&&(n(0,"div",14)(1,"div",27)(2,"h2"),f(3,"i",46),p(4,"Customer"),i()(),n(5,"div",21)(6,"table",22)(7,"tr")(8,"th",23),p(9,"Name"),i(),n(10,"td"),p(11,":"),i(),n(12,"td")(13,"a",25),p(14),i()()(),_(15,nl,7,1,"tr",24)(16,ol,6,1,"tr",24),i()()()),t&2){let e=s(2);l(13),m("routerLink",N(5,Ja))("queryParams",M(6,xi,e.data.Customer==null?null:e.data.Customer.ID)),l(),I(e.data.Customer==null?null:e.data.Customer.Name),l(),m("ngIf",e.data.Customer==null?null:e.data.Customer.Mobile),l(),m("ngIf",e.data.Customer==null?null:e.data.Customer.Address)}}function al(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"Name"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(3);l(6),I(e.data.Recipient.Name)}}function ll(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(3);l(6),I(e.data.Recipient.Phone)}}function pl(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"City"),i(),n(3,"td"),p(4,":"),i(),f(5,"td",47),i()),t&2){let e=s(3);l(5),m("innerHTML",e.data.Recipient.Address,j)}}function ml(t,r){if(t&1&&(n(0,"tr")(1,"th",23),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(3);l(6),I(e.data.Recipient.City)}}function cl(t,r){if(t&1&&(n(0,"div",14)(1,"div",27)(2,"h2"),f(3,"i",46),p(4,"Recipient"),i()(),n(5,"div",21)(6,"table",22),_(7,al,7,1,"tr",24)(8,ll,7,1,"tr",24)(9,pl,6,1,"tr",24)(10,ml,7,1,"tr",24),i()()()),t&2){let e=s(2);l(7),m("ngIf",e.data.Recipient.Name),l(),m("ngIf",e.data.Recipient.Phone),l(),m("ngIf",e.data.Recipient.Address),l(),m("ngIf",e.data.Recipient.City)}}function sl(t,r){if(t&1&&(z(0),f(1,"app-serial-note",51),$()),t&2){let e=s().$implicit;l(),m("serials",e.Serial)}}function dl(t,r){if(t&1&&f(0,"p",52),t&2){let e=s().$implicit;m("innerHTML",e.Note,j)}}function ul(t,r){if(t&1&&(n(0,"tr")(1,"td"),p(2),i(),n(3,"td")(4,"a",48),p(5),i(),n(6,"div"),p(7),i(),_(8,sl,2,1,"ng-container",24)(9,dl,1,1,"p",49),i(),n(10,"td",50),p(11),v(12,"quantityFraction"),n(13,"div"),p(14),i()()()),t&2){let e=r.$implicit,a=r.index;l(2),I(a+1+"."),l(2),m("queryParams",M(10,xi,e.VariantID)),l(),D(" ",e.Name," "),l(2),I(e.Code),l(),m("ngIf",e.Serial),l(),m("ngIf",e.Note!=null),l(2),D(" ",E(12,8,e.Quantity)," "),l(3),I(e.UOMName)}}function _l(t,r){if(t&1&&(n(0,"div",14)(1,"div",27)(2,"h2"),f(3,"i",53),p(4,"Note"),i()(),f(5,"div",54),i()),t&2){let e=s(2);l(5),m("innerHTML",e.data.Fulfillment.Note,j)}}function fl(t,r){if(t&1&&(n(0,"span")(1,"b"),p(2,"Modified:"),i(),p(3),v(4,"date"),i()),t&2){let e=s(3);l(3),Qe(" ",P(4,2,e.data.CreatedInfo.Modified.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo.Modified.User," ")}}function gl(t,r){if(t&1&&(n(0,"div",55),f(1,"i",56),n(2,"span")(3,"b"),p(4," Created:"),i(),p(5),v(6,"date"),i(),_(7,fl,5,5,"span",24),i()),t&2){let e=s(2);l(5),Qe(" ",P(6,3,e.data.CreatedInfo.Created.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo.Created.User," "),l(2),m("ngIf",e.data.CreatedInfo.Modified==null?null:e.data.CreatedInfo.Modified.Date)}}function Cl(t,r){if(t&1&&(n(0,"mainpanel-cmp",1)(1,"actions")(2,"div",2)(3,"a",3),f(4,"i",4),p(5," Print "),i(),f(6,"button",5),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Print with Cost"),i()()()(),n(11,"div",8),_(12,Ya,3,5,"a",9)(13,Xa,3,0,"a",10),i()(),n(14,"content")(15,"div",11)(16,"div",12)(17,"div",13)(18,"div",14)(19,"div",15)(20,"div")(21,"h2"),f(22,"i",16),p(23,"Order "),n(24,"small",17),p(25),i()()(),n(26,"div",8)(27,"button",5),f(28,"b",18),i(),n(29,"ul",19),_(30,Za,3,0,"li",20)(31,el,3,0,"li",20),i()()(),n(32,"div",21)(33,"table",22)(34,"tr")(35,"th",23),p(36,"Outlet"),i(),n(37,"td"),p(38,":"),i(),n(39,"td"),p(40),i()(),z(41),_(42,tl,8,6,"tr",24)(43,il,8,4,"tr",24),$(),n(44,"tr")(45,"th",23),p(46,"SO Number"),i(),n(47,"td"),p(48,":"),i(),n(49,"td")(50,"a",25),p(51),i()()(),n(52,"tr")(53,"th",23),p(54,"SO Date"),i(),n(55,"td"),p(56,":"),i(),n(57,"td"),p(58),v(59,"date"),i()()()()(),_(60,rl,17,8,"div",26)(61,cl,11,4,"div",26),n(62,"div",14)(63,"div",27)(64,"h2"),f(65,"i",28),p(66,"Fulfillment"),i()(),n(67,"div",21)(68,"table",22)(69,"tr")(70,"th",23),p(71,"Outlet"),i(),n(72,"td"),p(73,":"),i(),n(74,"td"),p(75),i()(),n(76,"tr")(77,"th",23),p(78,"Date"),i(),n(79,"td"),p(80,":"),i(),n(81,"td"),p(82),v(83,"date"),i()(),n(84,"tr")(85,"th",23),p(86,"Number"),i(),n(87,"td"),p(88,":"),i(),n(89,"td"),p(90),i()(),n(91,"tr")(92,"th",23),p(93,"Courier"),i(),n(94,"td"),p(95,":"),i(),n(96,"td"),p(97),i()()()()()(),n(98,"div",29)(99,"div",14)(100,"div",27)(101,"h2"),f(102,"i",30),p(103,"Products"),i()(),n(104,"div",21)(105,"table",31)(106,"thead",32)(107,"tr")(108,"th",33),p(109,"No."),i(),n(110,"th"),p(111,"Products"),i(),n(112,"th",23),p(113,"Qty"),i()()(),n(114,"tbody"),_(115,ul,15,12,"tr",34),i(),n(116,"tfoot",35)(117,"tr")(118,"td",36),p(119," Total "),i(),n(120,"td",37),p(121),v(122,"sum"),v(123,"quantityFraction"),i()()()()()(),_(124,_l,6,1,"div",26),i(),n(125,"div",38),_(126,gl,8,6,"div",39),i()()()()()),t&2){let e=s();m("pageData",e.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(3),m("routerLink",N(40,Nr))("queryParams",Ae(41,Ua,e.data.Fulfillment.ID,e.data.PrintConfig.ID)),l(6),m("routerLink",N(44,Nr))("queryParams",Ae(45,za,e.data.Fulfillment.ID,e.data.PrintConfig.ID)),l(3),m("ngIf",e.role.logistic.Edit&&e.data.WriteAccess),l(),m("ngIf",e.role.logistic.Delete),l(12),D(" (",e.data.Fulfillment.Status,") "),l(5),m("ngIf",e.role.global.Export),l(),m("ngIf",e.data.Fulfillment.Note==null),l(9),I(e.data.Order.OutletName),l(2),m("ngIf",e.data.Order.InvoiceNumber),l(),m("ngIf",e.data.Order.InvoiceDate),l(7),m("routerLink",N(48,$a))("queryParams",M(49,xi,e.data.Order.SalesOrderId)),l(),D(" ",e.data.Order.SalesOrderNumber," "),l(7),D(" ",P(59,29,e.data.Order.SalesOrderDate,"dd MMM yyyy")," "),l(2),m("ngIf",e.data.Customer==null?null:e.data.Customer.ID),l(),m("ngIf",(e.data.Recipient==null?null:e.data.Recipient.ID)!=e.guidEmpty),l(14),D(" ",e.data.Fulfillment.OutletName," "),l(7),D(" ",P(83,32,e.data.Fulfillment.Date,"dd MMM yyyy")," "),l(8),D(" ",e.data.Fulfillment.Number," "),l(7),D(" ",e.data.Fulfillment.Courier," "),l(18),m("ngForOf",e.data.Items),l(6),D(" ",E(123,38,P(122,35,e.data.Items,"Quantity"))," "),l(3),m("ngIf",e.data==null?null:e.data.Fulfillment.Note),l(2),m("ngIf",!e.role.users.LogRestriction)}}var on=class t extends Tr{constructor(e,a,o,c,w,H,ie,Ue){super(e,a,"OutboundLogistics/Info",c);this.httpService=a;this.csvConverter=o;this.toaster=w;this.router=H;this.role=ie;this.matDialog=Ue}guidEmpty=T.GuidEmpty;openExportModal(){this.matDialog.open(Ie,{data:{title:"Outbound Logistics",exportTypes:[{ID:"OutboundLogistics/ExportInfo",Value:"Default"}],filterExport:{},getAllDataLengthAPI:"",pagination:!1}})}postBindData(e){e.Items=e.Items.filter(a=>a.Quantity!=0),this.menuData.H=`Outbound Logistics #${e.Fulfillment.Number}`}deleteData(e){confirm("Are you sure you want to delete this?")&&this.httpService.delete(`/API/${e}`,{params:[{key:"ID",value:this.data.Fulfillment.ID}]}).subscribe(()=>{this.toaster.success("Records are removed.","Success"),this.router.navigate(["/menu/Logistics/Archive/Outbound_Logistics"])})}openEmailDialog(){this.matDialog.open(nn,{data:{invoiceID:this.data.ID}})}exportCSV(e,a,o){o=o||"export.csv",this.httpService.post(`/api/${a}`,this.data.Fulfillment).subscribe(c=>{e.convertToCSV(c,o)})}onUpdate(e,a){this.httpService.post(`/api/${e}`,a).subscribe(o=>{this.reload()})}reload(){let e="OutboundLogistics/Info",a={ID:this.data.Fulfillment.ID};this.httpService.post(`/api/${e}`,a).subscribe({next:o=>{this.data=o}})}openModalNote(e){this.matDialog.open(Or,{data:e.SONote}).afterClosed().subscribe(o=>{if(e){var c={ID:this.data.Fulfillment.ID,Note:o};this.onUpdate("OutboundLogistics/UpdateNoteOutboundLogistics",c)}})}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(pe),C(ee),C(at),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-customer-delivery-detail"]],standalone:!1,features:[re],decls:1,vars:1,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"btn-group","me-5"],["target","_blank",1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-print"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu",2,"cursor","pointer"],["target","_blank",1,"dropdown-item",3,"routerLink","queryParams"],[1,"btn-group"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-4"],[1,"card"],[1,"card-header","d-flex","justify-content-between"],[1,"fa-solid","fa-receipt","me-5"],[1,"text-body-secondary","h6"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end","cursor","text-dark"],["class","dropdown-item",4,"ngIf"],[1,"card-body"],[1,"table-sm","table-borderless"],[2,"width","80px"],[4,"ngIf"],["target","_blank",1,"ps-0",3,"routerLink","queryParams"],["class","card",4,"ngIf"],[1,"card-header"],[1,"fa-solid","fa-truck","me-5"],[1,"col-8"],[1,"fa-solid","fa-box","me-5"],[1,"table"],[1,"thead-light"],[2,"width","40px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","2",1,"text-end","empty-column","fw-bold"],[1,"text-center","empty-column","fw-bold"],[1,"col-12"],["class","alert alert-warning",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash"],[1,"dropdown-item"],[3,"click"],[1,"fa-solid","fa-address-card","me-5"],[3,"innerHTML"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],["class","special-TinyMCE fst-italic text-warning mb-0","style","word-break: break-all",3,"innerHTML",4,"ngIf"],[1,"text-center"],[3,"serials"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],[1,"fa-solid","fa-note-sticky","me-5"],[1,"card-body",3,"innerHTML"],[1,"alert","alert-warning"],["aria-hidden","true",1,"fa-regular","fa-file-lines"]],template:function(a,o){a&1&&_(0,Cl,127,51,"mainpanel-cmp",0),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,oe,dt,he,Be,ri],encapsulation:2})};var kr=t=>({ID:t}),vl=()=>["/menu/Outlets/Master/Outlets/Form"];function yl(t,r){if(t&1){let e=b();n(0,"button",18),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",19),p(2," Export"),i()}}function xl(t,r){if(t&1){let e=b();n(0,"div",20)(1,"h6"),p(2,"Outlet"),i(),n(3,"outlet-selector",21),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"From"),i(),n(6,"datepicker",22),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(7,"h6"),p(8,"To"),i(),n(9,"datepicker",23),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i(),n(10,"h6"),p(11,"Supplier"),i(),n(12,"autocompleteV2",24),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.SupplierID,o)||(c.pageData.Filter.SupplierID=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",4),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("ngModel",e.pageData.Filter.SupplierID)}}function Sl(t,r){t&1&&(n(0,"th"),p(1,"Outlet"),i())}function hl(t,r){t&1&&(n(0,"th",25),p(1,"Total"),i())}function bl(t,r){if(t&1&&(n(0,"td")(1,"a",29),p(2),i()()),t&2){let e=s().$implicit;l(),m("routerLink",N(3,vl))("queryParams",M(4,kr,e.EntityID)),l(),I(e.EntityName)}}function Dl(t,r){if(t&1&&(n(0,"td",27),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),I(E(2,1,e.Total))}}function Il(t,r){if(t&1&&(n(0,"tr")(1,"td"),p(2),i(),n(3,"td")(4,"a",26),p(5),i()(),_(6,bl,3,6,"td",9),n(7,"td",27),p(8),v(9,"number"),i(),_(10,Dl,3,3,"td",28),i()),t&2){let e=r.$implicit,a=s(2);l(2),I(e.VariantCode),l(2),m("queryParams",M(8,kr,e.VariantID)),l(),I(e.VariantName),l(),m("ngIf",!a.data.isOutlet),l(2),I(E(9,6,e.Quantity)),l(2),m("ngIf",a.roleService.sell.Create)}}function Tl(t,r){t&1&&f(0,"td",30)}function wl(t,r){if(t&1&&(n(0,"td",16),p(1),v(2,"sum"),v(3,"number"),i()),t&2){let e=s(2);l(),D(" ",E(3,4,P(2,1,e.data.Data,"Total")),"")}}function Ol(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,yl,3,0,"button",3),i(),n(3,"filters"),_(4,xl,13,8,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Code"),i(),n(14,"th"),p(15,"Variant"),i(),_(16,Sl,2,0,"th",9),n(17,"th",10),p(18,"Qty"),i(),_(19,hl,2,0,"th",11),i()(),n(20,"tbody"),_(21,Il,11,10,"tr",12),i(),n(22,"tfoot")(23,"tr",13),_(24,Tl,1,0,"td",14),n(25,"td",15),p(26,"Total :"),i(),n(27,"td",16),p(28),v(29,"sum"),v(30,"number"),i(),_(31,wl,4,6,"td",17),i()()()()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(14),m("ngIf",!e.data.isOutlet),l(3),m("ngIf",e.roleService.sell.Create),l(2),m("ngForOf",e.data.Data),l(3),m("ngIf",!e.data.isOutlet),l(4),D("",E(30,14,P(29,11,e.data.Data,"Quantity"))," "),l(3),m("ngIf",e.roleService.sell.Create)}}var rn=class t extends Se{constructor(e,a,o,c,w){super(e,a,"OutboundLogistics/GetOutStockReportProduct","OutboundLogisticsLoader/GetOutStockReporProduct");this.csvConverter=o;this.roleService=c;this.matDialog=w}openExportModal(){this.matDialog.open(Ie,{data:{title:"Out Stock Report By Product",exportTypes:[{ID:"OutboundLogistics/GetOutStockReportProduct",Value:"Default",FileName:"Out Stock Report By Product"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}sortByOptions=[{Key:!1,Value:"Code"},{Key:!0,Value:"Name"}];static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-report-outgoing-product"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","80px"],[4,"ngIf"],[1,"text-end",2,"width","200px"],["style","width:150px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","text-end empty-column",4,"ngIf"],["colspan","2",1,"text-end","empty-column"],[1,"text-end",2,"background","#F0E68C"],["class","text-end","style","background: #F0E68C;",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Supplier","inputID","SupplierID",1,"form-control","ac-filter",3,"ngModelChange","ngModel"],[1,"text-end",2,"width","150px"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","empty-column"]],template:function(a,o){a&1&&_(0,Ol,32,16,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,We,Pe,ge,Be],encapsulation:2})};var El=()=>["/menu/Logistics/Archive/Outbound_Logistics/Info"],io=t=>({ID:t}),Ml=()=>["/menu/Contacts/Contact/Customers/Info"];function Pl(t,r){if(t&1){let e=b();n(0,"button",15),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",16),p(2," Export"),i()}}function Fl(t,r){if(t&1){let e=b();n(0,"div",17)(1,"h6"),p(2,"Outlet"),i(),n(3,"outlet-selector",18),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"From"),i(),n(6,"datepicker",19),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(7,"h6"),p(8,"To"),i(),n(9,"datepicker",20),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",4),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To)}}function Vl(t,r){t&1&&(n(0,"th",21),p(1,"Price"),i())}function Nl(t,r){t&1&&(n(0,"th",21),p(1,"Total"),i())}function kl(t,r){if(t&1&&(n(0,"td",38),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),I(P(2,1,e.Price,"1.0-2"))}}function Ll(t,r){if(t&1&&(n(0,"td",38),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),I(P(2,1,e.Total,"1.0-2"))}}function Rl(t,r){if(t&1&&(n(0,"tr")(1,"td",33)(2,"a",34),p(3),i()(),n(4,"td",35),p(5),i(),n(6,"td",36),p(7),v(8,"number"),i(),_(9,kl,3,4,"td",37)(10,Ll,3,4,"td",37),i()),t&2){let e=r.$implicit,a=s(3);l(2),m("queryParams",M(9,io,e.VariantID)),l(),I(e.VariantName),l(2),D(" ",e.VariantCode,""),l(2),D(" ",P(8,6,e.Quantity,"1.0-2"),""),l(2),m("ngIf",a.roleService.sell.PriceVisible),l(),m("ngIf",a.roleService.sell.PriceVisible)}}function Al(t,r){t&1&&(n(0,"th",39),p(1,"Amount : "),i())}function Bl(t,r){if(t&1&&(n(0,"th",39),p(1),v(2,"sum"),v(3,"number"),i()),t&2){let e=s().$implicit;l(),I(P(3,4,P(2,1,e.Variant,"Total"),"1.0-2"))}}function Wl(t,r){if(t&1&&(n(0,"div",22)(1,"div")(2,"a",23)(3,"span",24),p(4),i()(),n(5,"span"),p(6),v(7,"date"),i(),n(8,"span"),p(9),i(),n(10,"a",25),p(11),i()(),n(12,"table",26),f(13,"thead"),n(14,"tbody",27),_(15,Rl,11,11,"tr",28),i()(),n(16,"table",26),f(17,"thead"),n(18,"tbody",29)(19,"tr"),f(20,"th",30),n(21,"th",31),p(22,"Total Qty : "),i(),n(23,"th",10),p(24),v(25,"sum"),v(26,"number"),i(),_(27,Al,2,0,"th",32)(28,Bl,4,7,"th",32),i()()()()),t&2){let e=r.$implicit,a=s(2);l(2),m("routerLink",N(20,El))("queryParams",M(21,io,e.OrderDeliveryID)),l(2),I(e.OutletName+" #"+e.Number),l(2),D(" "," - "+P(7,12,e.Date,"dd MMM yyyy")," "),l(3),D(" "," - "," "),l(),m("routerLink",N(23,Ml))("queryParams",M(24,io,e.CustomerID)),l(),I(e.CustomerName),l(4),m("ngForOf",e.Variant),l(9),I(E(26,18,P(25,15,e.Variant,"Quantity"))),l(3),m("ngIf",a.roleService.sell.PriceVisible),l(),m("ngIf",a.roleService.sell.PriceVisible)}}function Hl(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,Pl,3,0,"button",3),i(),n(3,"filters"),_(4,Fl,10,7,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Name"),i(),n(14,"th",9),p(15,"Code"),i(),n(16,"th",10),p(17,"Qty"),i(),_(18,Vl,2,0,"th",11)(19,Nl,2,0,"th",11),i()(),n(20,"tbody")(21,"tr")(22,"td",12),_(23,Wl,29,26,"div",13),i()()()()(),n(24,"POS-complex-pagination",14),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(16),m("ngIf",e.roleService.sell.PriceVisible),l(),m("ngIf",e.roleService.sell.PriceVisible),l(4),m("ngForOf",e.data.Data),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var an=class t extends Se{constructor(e,a,o,c,w){super(e,a,"OutboundLogistics/GetOutStockReportDetail","OutboundLogisticsLoader/GetOutStockReporProduct");this.csvConverter=o;this.roleService=c;this.matDialog=w}openExportModal(){this.matDialog.open(Ie,{data:{title:"Report Outgoing Detail",exportTypes:[{ID:"OutboundLogistics/GetOutStockReportDetail",Value:"Default",FileName:"Report Outgoing Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"OutboundLogistics/GetOutStockReportDetailCount",pagination:!0}})}sortByOptions=[{Key:!1,Value:"Code"},{Key:!0,Value:"Name"}];static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-report-outgoing-detail"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","400px"],[2,"width","150px"],[1,"text-end",2,"width","30px"],["class","text-end","style","width: 150px",4,"ngIf"],["colspan","5",1,"px-0","border-bottom-0"],["class","mb-5",4,"ngFor","ngForOf"],["api","OutboundLogistics/GetOutStockReportDetailCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],[1,"text-end",2,"width","150px"],[1,"mb-5"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-4"],[3,"routerLink","queryParams"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[4,"ngFor","ngForOf"],[1,"table","table-sm"],[2,"width","645px"],[1,"text-end",2,"width","75px"],["style","width: 90px","class","text-end",4,"ngIf"],[1,"border-start","border-end",2,"width","400px"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"border-start","border-end",2,"width","150px"],[1,"text-end","border-start","border-end",2,"width","30px"],["class","text-end border-start border-end","style","width: 150px",4,"ngIf"],[1,"text-end","border-start","border-end",2,"width","150px"],[1,"text-end",2,"width","90px"]],template:function(a,o){a&1&&_(0,Hl,25,10,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,Je,Pe,ge,he,Be],encapsulation:2})};var Lr=t=>({ID:t}),jl=()=>["/menu/Outlets/Master/Outlets/Form"];function Ql(t,r){if(t&1){let e=b();n(0,"button",18),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",19),p(2," Export"),i()}}function ql(t,r){if(t&1){let e=b();n(0,"div",20)(1,"h6"),p(2,"Outlet"),i(),n(3,"outlet-selector",21),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"From"),i(),n(6,"datepicker",22),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(7,"h6"),p(8,"To"),i(),n(9,"datepicker",23),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",2)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.EntityID),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To)}}function Ul(t,r){t&1&&(n(0,"th"),p(1,"Outlet"),i())}function zl(t,r){t&1&&(n(0,"th",10),p(1,"Total"),i())}function $l(t,r){if(t&1&&(n(0,"td")(1,"a",27),p(2),i()()),t&2){let e=s().$implicit;l(),m("routerLink",N(3,jl))("queryParams",M(4,Lr,e.EntityID)),l(),I(e.EntityName)}}function Gl(t,r){if(t&1&&(n(0,"td",25),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),I(E(2,1,e.Total))}}function Kl(t,r){if(t&1&&(n(0,"tr")(1,"td")(2,"a",24),p(3),i()(),n(4,"td"),p(5),i(),_(6,$l,3,6,"td",9),n(7,"td",25),p(8),v(9,"number"),i(),_(10,Gl,3,3,"td",26),i()),t&2){let e=r.$implicit,a=s(2);l(2),m("queryParams",M(8,Lr,e.VariantID)),l(),I(e.VariantCode),l(2),I(e.VariantName),l(),m("ngIf",!a.data.isOutlet),l(2),I(E(9,6,e.Quantity)),l(2),m("ngIf",a.roleService.product.Cost)}}function Jl(t,r){t&1&&f(0,"td",28)}function Yl(t,r){if(t&1&&(n(0,"td",16),p(1),v(2,"sum"),v(3,"number"),i()),t&2){let e=s(2);l(),D(" ",E(3,4,P(2,1,e.data.List,"Total")),"")}}function Xl(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,Ql,3,0,"button",3),i(),n(3,"filters"),_(4,ql,10,7,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Code"),i(),n(14,"th"),p(15,"Variant"),i(),_(16,Ul,2,0,"th",9),n(17,"th",10),p(18,"Qty"),i(),_(19,zl,2,0,"th",11),i()(),n(20,"tbody"),_(21,Kl,11,10,"tr",12),i(),n(22,"tfoot")(23,"tr",13),_(24,Jl,1,0,"td",14),n(25,"td",15),p(26,"Total :"),i(),n(27,"td",16),p(28),v(29,"sum"),v(30,"number"),i(),_(31,Yl,4,6,"td",17),i()()()()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(14),m("ngIf",!e.data.isOutlet),l(3),m("ngIf",e.roleService.product.Cost),l(2),m("ngForOf",e.data.List),l(3),m("ngIf",!e.data.isOutlet),l(4),D("",E(30,14,P(29,11,e.data.List,"Quantity"))," "),l(3),m("ngIf",e.roleService.product.Cost)}}var ln=class t extends Se{constructor(e,a,o,c,w){super(e,a,"InboundLogistics/GetInStockReportProduct","InboundLogisticsLoader/GetInStockReporProduct");this.csvConverter=o;this.roleService=c;this.matDialog=w}openExportModal(){this.matDialog.open(Ie,{data:{title:"Product Stock In Report",exportTypes:[{ID:"InboundLogistics/GetInStockReportProduct",Value:"Default",FileName:"Product Stock In Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}postInit(){this.menuData.H=this.data.PageTitle}sortByOptions=[{Key:!1,Value:"Code"},{Key:!0,Value:"Name"}];static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-report-incoming-product"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","80px"],[4,"ngIf"],[1,"text-end",2,"width","50px"],["style","width:50px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],["class","text-end empty-column",4,"ngIf"],["colspan","2",1,"text-end","empty-column"],[1,"text-end",2,"background","#F0E68C"],["class","text-end","style","background: #F0E68C;",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","outlets","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"text-end"],["class","text-end",4,"ngIf"],[3,"routerLink","queryParams"],[1,"text-end","empty-column"]],template:function(a,o){a&1&&_(0,Xl,32,16,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,Pe,ge,Be],encapsulation:2})};var Zl=()=>["/menu/Logistics/Archive/Inbound_Logistics/Info"],no=t=>({ID:t});function ep(t,r){if(t&1){let e=b();n(0,"button",15),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",16),p(2," Export"),i()}}function tp(t,r){if(t&1){let e=b();n(0,"div",17)(1,"h6"),p(2,"Outlet"),i(),n(3,"outlet-selector",18),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"From"),i(),n(6,"datepicker",19),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(7,"h6"),p(8,"To"),i(),n(9,"datepicker",20),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i(),n(10,"h6"),p(11,"Supplier"),i(),n(12,"autocompleteV2",21),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.SupplierID,o)||(c.pageData.Filter.SupplierID=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",2)("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),x("ngModel",e.pageData.Filter.EntityID),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("ngModel",e.pageData.Filter.SupplierID)}}function ip(t,r){t&1&&(n(0,"th",22),p(1,"Cost"),i())}function np(t,r){t&1&&(n(0,"th",22),p(1,"Total"),i())}function op(t,r){if(t&1&&(n(0,"span"),p(1," - "),n(2,"span")(3,"a",32),p(4),i()()()),t&2){let e=s().$implicit;l(3),m("queryParams",M(2,no,e.SupplierID)),l(),D(" ",e.SupplierName," ")}}function rp(t,r){if(t&1&&(n(0,"td",38),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D("",P(2,1,e.UnitCost,"1.0-2")," ")}}function ap(t,r){if(t&1&&(n(0,"td",38),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D("",P(2,1,e.Total,"1.0-2")," ")}}function lp(t,r){if(t&1&&(n(0,"tr")(1,"td",33)(2,"a",34),p(3),i()(),n(4,"td",35),p(5),i(),n(6,"td",36),p(7),i(),_(8,rp,3,4,"td",37)(9,ap,3,4,"td",37),i()),t&2){let e=r.$implicit,a=s(3);l(2),m("queryParams",M(6,no,e.VariantID)),l(),I(e.VariantName),l(2),D(" ",e.VariantCode,""),l(2),D(" ",e.Quantity,""),l(),m("ngIf",a.roleService.product.Cost),l(),m("ngIf",a.roleService.product.Cost)}}function pp(t,r){t&1&&(n(0,"th",22),p(1,"Amount : "),i())}function mp(t,r){if(t&1&&(n(0,"th",22),p(1),v(2,"sum"),v(3,"number"),i()),t&2){let e=s().$implicit;l(),I(P(3,4,P(2,1,e.Variant,"Total"),"1.0-2"))}}function cp(t,r){if(t&1&&(n(0,"div",23)(1,"div")(2,"a",24)(3,"span",25),p(4),i()(),n(5,"span"),p(6),v(7,"date"),i(),n(8,"span"),p(9),v(10,"date"),i(),_(11,op,5,4,"span",26),i(),n(12,"table",27),f(13,"thead"),n(14,"tbody",28),_(15,lp,10,8,"tr",29),i()(),n(16,"table",27),f(17,"thead"),n(18,"tbody",30)(19,"tr"),f(20,"th",8),n(21,"th",9),p(22,"Total Qty : "),i(),n(23,"th",10),p(24),v(25,"sum"),v(26,"number"),i(),_(27,pp,2,0,"th",31)(28,mp,4,7,"th",31),i()()()()),t&2){let e=r.$implicit,a=s(2);l(2),m("routerLink",N(21,Zl))("queryParams",M(22,no,e.InDeliveryID)),l(2),I(e.OutletName+" #"+e.InDeliveryNumber),l(2),D(" "," - In Date: "+P(7,10,e.InDeliveryDate,"dd MMM yyyy")," "),l(3),D(" "," - PO Date: "+P(10,13,e.PODate,"dd MMM yyyy")," "),l(2),m("ngIf",e.SupplierName),l(4),m("ngForOf",e.Variant),l(9),I(E(26,19,P(25,16,e.Variant,"Quantity"))),l(3),m("ngIf",a.roleService.product.Cost),l(),m("ngIf",a.roleService.product.Cost)}}function sp(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,ep,3,0,"button",3),i(),n(3,"filters"),_(4,tp,13,8,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Name"),i(),n(14,"th",9),p(15,"Code"),i(),n(16,"th",10),p(17,"Qty"),i(),_(18,ip,2,0,"th",11)(19,np,2,0,"th",11),i()(),n(20,"tbody")(21,"tr")(22,"td",12),_(23,cp,29,24,"div",13),i()()()()(),n(24,"POS-complex-pagination",14),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(16),m("ngIf",e.roleService.product.Cost),l(),m("ngIf",e.roleService.product.Cost),l(4),m("ngForOf",e.data.Data),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var pn=class t extends Se{constructor(e,a,o,c,w){super(e,a,"InboundLogistics/GetInStockReportDetail","InboundLogisticsLoader/GetInStockReporProduct");this.csvConverter=o;this.roleService=c;this.matDialog=w}openExportModal(){this.matDialog.open(Ie,{data:{title:"Stock In Report",exportTypes:[{ID:"InboundLogistics/GetInStockReportDetail",Value:"Default",FileName:"Stock In Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"InboundLogistics/GetInStockReportDetailCount",pagination:!0}})}sortByOptions=[{Key:!1,Value:"Code"},{Key:!0,Value:"Name"}];static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-report-incoming-detail"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[1,"text-end",2,"width","75px"],[1,"text-end",2,"width","30px"],["class","text-end","style","width: 90px",4,"ngIf"],["colspan","5",1,"px-0","border-bottom-0"],["class","mb-5",4,"ngFor","ngForOf"],["api","InboundLogistics/GetInStockReportDetailCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","outlets","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Supplier","inputID","SupplierID",1,"form-control","ac-filter",3,"ngModelChange","ngModel"],[1,"text-end",2,"width","90px"],[1,"mb-5"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",1,"ms-4"],[4,"ngIf"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[4,"ngFor","ngForOf"],[1,"table","table-sm","table-borderless"],["style","width: 90px","class","text-end",4,"ngIf"],["routerLink","/menu/Contacts/Contact/Suppliers/Info",3,"queryParams"],[1,"border-start","border-end",2,"width","645px"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"border-start","border-end",2,"width","75px"],[1,"text-end","border-start","border-end",2,"width","30px"],["class","text-end border-start border-end","style","width: 90px",4,"ngIf"],[1,"text-end","border-start","border-end",2,"width","90px"]],template:function(a,o){a&1&&_(0,sp,25,10,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,We,Je,Pe,ge,he,Be],encapsulation:2})};var up=t=>({ID:t});function _p(t,r){if(t&1){let e=b();n(0,"button",13),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",14),p(2," Export "),i()}}function fp(t,r){if(t&1){let e=b();n(0,"div",15)(1,"h6"),p(2,"Courier"),i(),n(3,"ng-select",16),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CourierID,o)||(c.pageData.Filter.CourierID=o),u(o)}),i(),n(4,"h6"),p(5,"Category"),i(),n(6,"POS-product-category-select",17),h("selectedCategoryIDChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CategoryID,o)||(c.pageData.Filter.CategoryID=o),u(o)}),i(),n(7,"h6"),p(8,"From"),i(),n(9,"datepicker",18),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),g("dateChange",function(){d(e);let o=s(2);return u(o.getListData())}),i(),n(10,"h6"),p(11,"To"),i(),n(12,"datepicker",19),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),g("dateChange",function(){d(e);let o=s(2);return u(o.getListData())}),i(),n(13,"h6"),p(14,"Scope"),i(),n(15,"radio-options",20),h("modelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.Product,o)||(c.pageData.Filter.Product=o),u(o)}),g("modelChange",function(){d(e);let o=s(2);return u(o.getListData())}),i(),n(16,"h6"),p(17,"Product"),i(),n(18,"autocompleteV2",21),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.ProductID,o)||(c.pageData.Filter.ProductID=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Courier),x("ngModel",e.pageData.Filter.CourierID),l(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),m("options",e.scopeOptions),x("model",e.pageData.Filter.Product),l(3),x("ngModel",e.pageData.Filter.ProductID),m("inputTextValue",e.pageData.Filter.Name)}}function gp(t,r){if(t&1&&(n(0,"th",11),p(1),i()),t&2){let e=r.$implicit;l(),D(" ",e," ")}}function Cp(t,r){if(t&1&&(n(0,"td",11),p(1),i()),t&2){let e=r.$implicit;l(),D(" ",e," ")}}function vp(t,r){if(t&1&&(n(0,"tr")(1,"td")(2,"a",22),p(3),i()(),n(4,"td",23),p(5),i(),_(6,Cp,2,1,"td",10),n(7,"td",11),p(8),i()()),t&2){let e=r.$implicit,a=s(2);l(2),m("routerLink","/menu/Products/Catalog/"+(a.pageData.Filter.Product?"Products":"Variants")+"/Info")("queryParams",M(6,up,e.ID)),l(),D(" ",e.Name," "),l(2),I(e.Code),l(),m("ngForOf",e.Quantities),l(2),I(e.Total)}}function yp(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,_p,3,0,"button",3),i(),n(3,"filters"),_(4,fp,19,12,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Name"),i(),n(14,"th",9),p(15,"Code"),i(),_(16,gp,2,1,"th",10),n(17,"th",11),p(18,"Total"),i()()(),n(19,"tbody"),_(20,vp,9,8,"tr",12),i()()()()()()}if(t&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(14),m("ngForOf",e.data.Outlet),l(4),m("ngForOf",e.data.Data)}}var mn=class t extends Se{constructor(e,a,o,c,w,H){super(e,a,"TransferOrder/DeliveryOutletByProduct","TransferOrderLoader/DeliveryOutletByProduct",null,w);this.csvConverter=o;this.roleService=c;this.matDialog=H}openExportModal(){this.matDialog.open(Ie,{data:{title:"In Stock Report By Product",exportTypes:[{ID:"TransferOrder/DeliveryOutletByProduct",Value:"Default",FileName:"In Stock Report By Product"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}scopeOptions=[{Key:!1,Value:"Variant"},{Key:!0,Value:"Product"}];static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(pe),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-report-transfer-product"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","hideSearchBox","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","25%"],[2,"width","10%","text-align","right"],["class","text-end",4,"ngFor","ngForOf"],[1,"text-end"],[4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose...",3,"ngModelChange","items","ngModel"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["name","scopeOptions",3,"modelChange","options","model"],["requestUrl","/API/AC/GetProductSuggestionByCodeNName","placeholder","Product","inputID","ProductID",1,"form-control","ac-filter",3,"ngModelChange","ngModel","inputTextValue"],[3,"routerLink","queryParams"],[2,"text-align","right"]],template:function(a,o){a&1&&_(0,yp,21,8,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,Ht,We,Ee,li],encapsulation:2})};var xp=()=>["/menu/Logistics/Archive/Transfer_Order/Info"],Rr=t=>({ID:t}),Sp=t=>({"bg-gradient-warning":t});function hp(t,r){if(t&1){let e=b();n(0,"button",16),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",17),p(2," Export "),i()}}function bp(t,r){if(t&1){let e=b();n(0,"div",18)(1,"h6"),p(2,"Source"),i(),n(3,"outlet-selector",19),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"Destination"),i(),n(6,"outlet-selector",20),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.DestinationID,o)||(c.pageData.Filter.DestinationID=o),u(o)}),i(),n(7,"h6"),p(8,"From"),i(),n(9,"datepicker",21),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(10,"h6"),p(11,"To"),i(),n(12,"datepicker",22),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i(),n(13,"h6"),p(14,"Category"),i(),n(15,"POS-product-category-select",23),h("selectedCategoryIDChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CategoryID,o)||(c.pageData.Filter.CategoryID=o),u(o)}),i(),n(16,"h6"),p(17,"Type"),i(),n(18,"ng-select",24),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.TypeID,o)||(c.pageData.Filter.TypeID=o),u(o)}),i(),n(19,"h6"),p(20,"Delivery"),i(),n(21,"ng-select",25),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.DeliveryID,o)||(c.pageData.Filter.DeliveryID=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",4),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),m("accessType",4),x("ngModel",e.pageData.Filter.DestinationID),m("multiple",!1),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("selectedCategoryID",e.pageData.Filter.CategoryID),m("showClear",!0),l(3),m("items",e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),l(3),m("items",e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.DeliveryID)}}function Dp(t,r){t&1&&(n(0,"th",26),p(1," Total Price "),i())}function Ip(t,r){t&1&&(n(0,"th",26),p(1," Total Cost "),i())}function Tp(t,r){t&1&&f(0,"i",37)}function wp(t,r){if(t&1&&(f(0,"td",43),v(1,"number")),t&2){let e=s().$implicit;m("innerHTML",E(1,1,e.UnitPrice),j)}}function Op(t,r){if(t&1&&(f(0,"td",43),v(1,"number")),t&2){let e=s().$implicit;m("innerHTML",E(1,1,e.UnitCost),j)}}function Ep(t,r){if(t&1&&(n(0,"tr")(1,"td",8)(2,"a",38),p(3),i()(),f(4,"td",39)(5,"td",40)(6,"td",41),v(7,"number"),f(8,"td",41),v(9,"number"),_(10,wp,2,3,"td",42)(11,Op,2,3,"td",42),i()),t&2){let e=r.$implicit,a=s().$implicit,o=s(2);ot(M(14,Sp,e.QtyRequested!=e.Quantity)),l(2),m("queryParams",M(16,Rr,e.VariantID)),l(),D(" ",e.VariantName," "),l(),m("innerHTML",e.Code,j),l(),m("innerHTML",a.StateLabel,j),l(),m("innerHTML",E(7,10,e.QtyRequested),j),l(2),m("innerHTML",E(9,12,e.Quantity),j),l(2),m("ngIf",o.roleService.sell.PriceVisible),l(),m("ngIf",o.roleService.product.Cost)}}function Mp(t,r){if(t&1&&(n(0,"div",27)(1,"div",28)(2,"div",29)(3,"a",30),f(4,"span",31),v(5,"date"),i()()(),n(6,"div",32)(7,"span"),p(8),i(),f(9,"br"),_(10,Tp,1,0,"i",33),f(11,"span",34),i(),n(12,"div",5)(13,"table",35)(14,"tbody"),_(15,Ep,12,18,"tr",36),i()()()()),t&2){let e=r.$implicit;l(3),m("routerLink",N(12,xp))("queryParams",M(13,Rr,e.ID)),l(),m("innerHTML","# "+e.Number+" - "+P(5,9,e.Date,"dd MMM yyyy"),j),l(4),yo("",e.Source," > ",e.Destination," - ",e.TypeName,""),l(2),m("ngIf",e.Note),l(),m("innerHTML",e.Note,j),l(4),m("ngForOf",e.Items)}}function Pp(t,r){if(t&1&&(n(0,"div")(1,"strong"),p(2,"Total Unit Price :"),i(),f(3,"span",46),v(4,"GetChildrenArray"),v(5,"sum"),v(6,"number"),i()),t&2){let e=s(3);l(3),m("innerHTML",P(6,7,P(5,4,P(4,1,e.data.Data,"Items"),"UnitPrice"),"1.0-2"),j)}}function Fp(t,r){if(t&1&&(n(0,"div")(1,"strong"),p(2,"Total Unit Cost :"),i(),f(3,"span",46),v(4,"GetChildrenArray"),v(5,"sum"),v(6,"number"),i()),t&2){let e=s(3);l(3),m("innerHTML",P(6,7,P(5,4,P(4,1,e.data.Data,"Items"),"UnitCost"),"1.0-2"),j)}}function Vp(t,r){if(t&1&&(n(0,"div",44)(1,"div",45)(2,"div")(3,"strong"),p(4,"Total Quantity"),i(),f(5,"span",46),v(6,"GetChildrenArray"),v(7,"sum"),v(8,"number"),i(),_(9,Pp,7,10,"div",47)(10,Fp,7,10,"div",47),i()()),t&2){let e=s(2);l(5),m("innerHTML",E(8,9,P(7,6,P(6,3,e.data.Data,"Items"),"Quantity")),j),l(4),m("ngIf",e.roleService.sell.PriceVisible),l(),m("ngIf",e.roleService.product.Cost)}}function Np(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,hp,3,0,"button",3),i(),n(3,"filters"),_(4,bp,22,16,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th",8),p(13,"Name"),i(),n(14,"th",9),p(15,"Code"),i(),n(16,"th",10),p(17,"Delivery"),i(),n(18,"th",11),p(19,"Qty Req"),i(),n(20,"th",11),p(21,"Qty Sent"),i(),_(22,Dp,2,0,"th",12)(23,Ip,2,0,"th",12),i()()()(),_(24,Mp,16,15,"div",13)(25,Vp,11,11,"div",14),n(26,"POS-complex-pagination",15),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(20),m("ngIf",e.roleService.sell.PriceVisible),l(),m("ngIf",e.roleService.product.Cost),l(),m("ngForOf",e.data.Data),l(),m("ngIf",e.data.Data.length>0),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var cn=class t extends Se{constructor(e,a,o,c,w){super(e,a,"TransferOrder/GetReport","TransferOrderLoader/TransferOutletDeliveryReport");this.csvConverter=o;this.roleService=c;this.matDialog=w}openExportModal(){this.matDialog.open(Ie,{data:{title:"Transfer Order Report",exportTypes:[{ID:"TransferOrder/GetReport",Value:"Default",FileName:"Transfer Order Report"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"TransferOrder/GetReportCount",pagination:!0}})}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-report-transfer-detail"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","float-thead","{ top: 60, autoReflow: true }",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"text-start",2,"width","700px"],[2,"width","115px"],[1,"text-end",2,"width","75px"],[1,"text-end",2,"width","50px"],["class","text-end","style","width: 90px",4,"ngIf"],["class","mt-7 ms-5",4,"ngFor","ngForOf"],["class","mt-6",4,"ngIf"],["api","TransferOrder/GetReportCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","Choose destination",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],[1,"tree-select-as-filter",3,"selectedCategoryIDChange","selectedCategoryID","showClear"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose type",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose",3,"ngModelChange","items","ngModel"],[1,"text-end",2,"width","90px"],[1,"mt-7","ms-5"],[1,"d-lg-flex","mt-sm-0"],[1,"me-auto","d-sm-block"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber",3,"innerHTML"],[1,"mt-4"],["class","fa-solid fa-note-sticky me-3",4,"ngIf"],[1,"fst-italic",3,"innerHTML"],[1,"table","table-striped","table-bordered"],[3,"class",4,"ngFor","ngForOf"],[1,"fa-solid","fa-note-sticky","me-3"],["routerLink","/menu/Products/Catalog/Variants/Info",3,"queryParams"],[1,"border-start",2,"width","115px",3,"innerHTML"],[1,"text-end","border-start",2,"width","75px",3,"innerHTML"],[1,"text-end","border-start",2,"width","50px",3,"innerHTML"],["class","text-end border-start","style","width: 90px",3,"innerHTML",4,"ngIf"],[1,"text-end","border-start",2,"width","90px",3,"innerHTML"],[1,"mt-6"],[1,"zebra","d-flex","justify-content-end"],[1,"text-end",3,"innerHTML"],[4,"ngIf"]],template:function(a,o){a&1&&_(0,Np,27,11,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,Je,Ee,li,Pe,ge,he,Be,Uo],styles:[".table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;line-height:15px!important}"]})};function kp(t,r){if(t&1){let e=b();n(0,"div",2)(1,"div",6)(2,"datepicker",7),h("dateChange",function(o){d(e);let c=s();return S(c.date,o)||(c.date=o),u(o)}),i()(),n(3,"div",8)(4,"p-datepicker",9),h("ngModelChange",function(o){d(e);let c=s();return S(c.time,o)||(c.time=o),u(o)}),i()()()}if(t&2){let e=s();l(2),x("date",e.date),l(2),x("ngModel",e.time),m("timeOnly",!0)}}var Si=class t{constructor(r){this.dialogRef=r;let e=this.data?.title||"Receive Delivery";this.type.update(a=>this.data?.type||a),this.config=new _e,this.config.title=e,this.config.customWidth="450px"}data=y(Ke);role=y(ne);type=vt("RECEIVE");config;date=new Date;time=new Date;note="";onOk(r){if(r=="Enter")return;this.date&&(this.date=new Date(this.date),this.date.setHours(this.time.getHours(),this.time.getMinutes(),this.time.getSeconds()));let e={Date:this.date,Note:this.note};this.dialogRef.close(e)}static \u0275fac=function(e){return new(e||t)(C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-modal-receive"]],decls:7,vars:3,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row","mb-8"],[1,"row"],[1,"col"],["height","200px",3,"ngModelChange","ngModel"],[1,"col","pe-1"],["appearance","outline",3,"dateChange","date"],[1,"col","ps-1"],[3,"ngModelChange","ngModel","timeOnly"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(c){return a.onOk(c)})("onCancel",function(){return a.dialogRef.close()})("onClose",function(){return a.dialogRef.close()}),n(1,"content")(2,"div",1),_(3,kp,5,3,"div",2),n(4,"div",3)(5,"div",4)(6,"POS-tinymce-editor",5),h("ngModelChange",function(c){return S(a.note,c)||(a.note=c),c}),i()()()()()()),e&2&&(m("config",a.config),l(3),Xe(a.role.global!=null&&a.role.global.Date&&a.type()=="RECEIVE"?3:-1),l(3),x("ngModel",a.note))},dependencies:[X,De,fe,Ge,R,W,qi,de,Ui,Xo,st,xt],styles:[".p-inputtext.p-component{margin-left:10px;margin-top:1px;height:45.4px}"]})};var Lp=()=>["Name","Code"],Rp=()=>["/menu/Products/Catalog/Variants/Info"],Ap=t=>({ID:t});function Bp(t,r){if(t&1&&(z(0),f(1,"p",19),$()),t&2){let e=s().$implicit;l(),m("innerHTML",e.SerialNote,j)}}function Wp(t,r){if(t&1&&f(0,"p",19),t&2){let e=s(2).$implicit;m("innerHTML",e.Note,j)}}function Hp(t,r){if(t&1&&_(0,Wp,1,1,"p",20),t&2){let e=s().$implicit;m("ngIf",e.Note!=null)}}function jp(t,r){if(t&1){let e=b();n(0,"tr")(1,"td",14),p(2),i(),n(3,"td"),f(4,"a",15),_(5,Bp,2,1,"ng-container",16)(6,Hp,1,1,"ng-template",null,0,Z),i(),f(8,"td",17),n(9,"td",14),p(10),v(11,"number"),i(),n(12,"td")(13,"input",18),h("ngModelChange",function(o){let c=d(e).$implicit;return S(c.Quantity,o)||(c.Quantity=o),u(o)}),i()()()}if(t&2){let e=r.$implicit,a=r.index,o=we(7),c=s();l(2),I(a+1+"."),l(2),m("routerLink",N(12,Rp))("queryParams",M(13,Ap,e.VariantID))("innerHTML",e.Name,j),l(),m("ngIf",e.SerialNote)("ngIfElse",o),l(3),m("innerHTML",e.Code,j),l(2),I(E(11,10,e.NewQty)),l(3),x("ngModel",e.Quantity),m("disabled",e.TypeID==c.serialized)}}function Qp(t,r){if(t&1){let e=b();n(0,"div")(1,"POS-tinymce-editor",21),h("ngModelChange",function(o){d(e);let c=s();return S(c.dispatchedNote,o)||(c.dispatchedNote=o),u(o)}),i()()}if(t&2){let e=s();l(),x("ngModel",e.dispatchedNote)}}var sn=class t{constructor(r,e){this.dt=r;this.dialogRef=e;this.data=r.data,this.setMaxSendQuantity(),this.config=new _e,this.config.title="Send Confirmation",this.config.bodyScrollable=!0,this.config.customWidth="550px"}filterText="";data;config;serialized=4;dispatchedNote=vt("");currentTabState=vt("Item");onOk(){this.data.ID=this.data.ID||this.data.Transfer.ID,this.data.Delivery.DispatchedNote=this.dispatchedNote(),this.data.Note=this.dispatchedNote(),this.dialogRef.close(this.data)}setMaxSendQuantity(){this.data.Items=this.data.Items.map(r=>(r.maxSend=this.calculateSerialQty(r.Serial?r.Serial:[]),r))}calculateSerialQty(r=[]){let e=0;return r.forEach(a=>{e+=a.Qty}),e}static \u0275fac=function(e){return new(e||t)(C(Ke),C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-modal-send-confirmation"]],decls:24,vars:9,consts:[["DEFAULT_NOTE",""],[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[3,"onTabChange"],["tabTitle","Item"],["type","text","placeholder","Search product..",1,"form-control","mb-5",3,"ngModelChange","ngModel"],[1,"table","table-bordered","custom-table"],[1,"thead-light"],[1,"text-center","border-end",2,"width","1px"],[1,"border-end",2,"width","400px"],[1,"border-end",2,"width","70px"],[1,"text-center","border-end",2,"width","30px"],[4,"ngFor","ngForOf"],["tabTitle","Note"],[1,"text-center"],["target","_blank",3,"routerLink","queryParams","innerHTML"],[4,"ngIf","ngIfElse"],[3,"innerHTML"],["autoNum","","emptyInputBehavior","null","type","text",1,"text-end","form-control",2,"width","46px",3,"ngModelChange","ngModel","disabled"],[1,"text-body-secondary",2,"word-break","break-all",3,"innerHTML"],["class","text-body-secondary","style","word-break: break-all",3,"innerHTML",4,"ngIf"],[3,"ngModelChange","ngModel"]],template:function(e,a){e&1&&(n(0,"modal-material",1),g("onOk",function(){return a.onOk()})("onCancel",function(){return a.dialogRef.close()})("onClose",function(){return a.dialogRef.close()}),n(1,"content")(2,"div",2)(3,"custom-tabs",3),g("onTabChange",function(c){return a.currentTabState.set(c)}),n(4,"tab",4)(5,"input",5),h("ngModelChange",function(c){return S(a.filterText,c)||(a.filterText=c),c}),i(),n(6,"table",6)(7,"thead",7)(8,"tr")(9,"th",8),p(10,"No"),i(),n(11,"th",9),p(12,"Name"),i(),n(13,"th",10),p(14,"Code"),i(),n(15,"th",11),p(16," Qty Req. "),i(),n(17,"th",11),p(18," Qty Send "),i()()(),n(19,"tbody"),_(20,jp,14,15,"tr",12),v(21,"FilterByArray"),i()()(),n(22,"tab",13),_(23,Qp,2,1,"div"),i()()()()()),e&2&&(m("config",a.config),l(5),x("ngModel",a.filterText),l(15),m("ngForOf",Vi(21,4,a.data.Items,N(8,Lp),a.filterText)),l(3),Xe(a.currentTabState()=="Note"?23:-1))},dependencies:[X,J,B,ge,De,fe,yt,G,ai,qo,Ge,Ce,R,W,st,xt,sr,ur,dr,Er],encapsulation:2})};var qp=()=>["/print/Transfer"],Ar=(t,r)=>({ID:t,Template:r}),Up=()=>["/print/TransferMini"],zp=t=>({"opacity-50 cursor-auto":t}),$p=()=>["/menu/Logistics/Archive/Transfer_Order/Receive"],un=t=>({ID:t}),Gp=()=>["/menu/Logistics/Archive/Transfer_Order/Form"],Kp=()=>["/menu/Logistics/Setup/Recycle_Bin"],Jp=()=>["/menu/Adjustment/Adjustment/Archive/Info"],Yp=()=>["/menu/Products/Catalog/Variants/Info"],Xp=t=>({"bg-gradient-danger":t}),Zp=()=>["/menu/Logistics/Report/Transfer/History"],em=t=>({TransferOrderID:t});function tm(t,r){if(t&1){let e=b();n(0,"div",46)(1,"button",47),g("click",function(){d(e);let o=s(2);return u(o.export("TransferOrder/ExportInfo","Transfer Order"))}),f(2,"i",48),p(3,"Export "),i(),f(4,"button",49),n(5,"ul",7)(6,"li",50),g("click",function(){d(e);let o=s(2);return u(o.export("TransferOrder/ExportDetailInfo","Transfer Order Detail.csv"))}),n(7,"a"),p(8,"Export with Detail"),i()()()()}}function im(t,r){if(t&1){let e=b();n(0,"a",56),g("click",function(){d(e);let o=s(3);return u(o.onApproveDelivery())}),f(1,"i",57),p(2,"\xA0Approve Delivery "),i()}}function nm(t,r){if(t&1){let e=b();n(0,"a",58),g("click",function(){d(e);let o=s(3);return u(o.onDispatchDelivery())}),f(1,"i",59),p(2,"\xA0Send"),i()}}function om(t,r){if(t&1){let e=b();n(0,"button",60),g("click",function(){d(e);let o=s(3);return u(o.role.logistic.TransferOrderReceiver?o.onReceiveDelivery():null)}),f(1,"i",57),p(2,"\xA0Receive Delivery "),i()}if(t&2){let e=s(3);vi("matTooltip",e.role.logistic.TransferOrderReceiver?"":"Receiving delivery requires the transfer order receiver role"),m("ngClass",M(2,zp,!e.role.logistic.TransferOrderReceiver))}}function rm(t,r){if(t&1&&(n(0,"button",61),f(1,"b",62),i()),t&2){let e=s(3);m("disabled",!e.role.logistic.TransferOrderReceiver)}}function am(t,r){if(t&1&&(n(0,"ul",63)(1,"li")(2,"a",8),p(3,"Receive and Adjust"),i()()()),t&2){let e=s(3);l(2),m("routerLink",N(2,$p))("queryParams",M(3,un,e.data.ID))}}function lm(t,r){if(t&1&&(n(0,"div",46),_(1,im,3,0,"a",51)(2,nm,3,0,"a",52)(3,om,3,4,"button",53)(4,rm,2,1,"button",54)(5,am,4,5,"ul",55),i()),t&2){let e=s(2);l(),m("ngIf",e.data.Config.EligibleToApprove&&e.role.logistic.TransferOrderApproval&&!e.data.Transfer.IsVoided),l(),m("ngIf",e.data.Config.EligibleToSend&&e.role.logistic.TransferOrderEditor&&!e.data.Transfer.IsVoided),l(),m("ngIf",e.data.Config.EligibleToReceive&&e.data.Config.HasReceiverRole&&!e.data.Transfer.IsVoided),l(),m("ngIf",e.data.Config.EligibleToReceive&&e.role.adjustment.Create&&e.data.Config.HasReceiverRole&&!e.data.Transfer.IsVoided),l(),m("ngIf",e.data.Config.EligibleToReceive&&e.role.adjustment.Create&&e.data.Config.HasReceiverRole&&!e.data.Transfer.IsVoided)}}function pm(t,r){if(t&1&&(n(0,"a",64),f(1,"i",65),p(2,"Edit"),i()),t&2){let e=s(2);m("routerLink",N(2,Gp))("queryParams",M(3,un,e.data.ID))}}function mm(t,r){if(t&1){let e=b();n(0,"a",67),g("click",function(){d(e);let o=s(3);return u(o.deleteData())}),f(1,"i",68),p(2,"Delete"),i()}}function cm(t,r){if(t&1){let e=b();n(0,"a",67),g("click",function(){d(e);let o=s(3);return u(o.onVoid())}),f(1,"i",68),p(2,"Void"),i()}}function sm(t,r){if(t&1&&(z(0),_(1,mm,3,0,"a",66)(2,cm,3,0,"a",66),$()),t&2){let e=s(2);l(),m("ngIf",e.role.logistic.Delete&&(!e.data.Config.IsVoidEnabled||e.data.Transfer.IsVoided)),l(),m("ngIf",e.role.logistic.TransferOrderVoid&&e.data.Config.IsVoidEnabled&&!e.data.Transfer.IsVoided)}}function dm(t,r){t&1&&(n(0,"a",69),f(1,"i",70),n(2,"span",71),p(3,"Voided"),i()()),t&2&&m("routerLink",N(1,Kp))}function um(t,r){if(t&1&&(n(0,"tr")(1,"th"),p(2,"Adjusted at"),i(),n(3,"td"),p(4,":"),i(),n(5,"td")(6,"a",45),p(7),i()()()),t&2){let e=s(2);l(6),m("routerLink",N(3,Jp))("queryParams",M(4,un,e.data.AdjustmentID)),l(),I(e.data.Transfer==null?null:e.data.Transfer.AdjustedAt)}}function _m(t,r){if(t&1&&(n(0,"tr")(1,"th"),p(2,"Journal"),i(),n(3,"td"),p(4,":"),i(),n(5,"td")(6,"a",72),p(7,"View Journal"),i()()()),t&2){let e=s(2);l(6),vo("href","https://accounting.dealpos.app/pages/journal-entry;TransID=",e.data.ID,"",ei)}}function fm(t,r){if(t&1&&(z(0),n(1,"div",80),p(2,"Receive Note:"),i(),f(3,"div",81),$()),t&2){let e=s(3);l(3),m("innerHTML",e.data.Delivery.ReceivedNote,j)}}function gm(t,r){if(t&1&&(n(0,"div",12)(1,"div",73)(2,"h4"),p(3),v(4,"date"),i(),n(5,"p",74),p(6),v(7,"date"),i()(),n(8,"div",75),f(9,"i",76),n(10,"div",77),f(11,"div",78),i()(),n(12,"div",79)(13,"h4"),p(14,"Received By"),i(),n(15,"p",74),p(16),i(),_(17,fm,4,1,"ng-container",10),i()()),t&2){let e=s(2);Nt("pb-8",e.data.Delivery.ReceivedNote),l(3),D(" ",P(4,8,e.data.Delivery.ReceivedDate,"dd MMM yyyy")," "),l(3),D(" ",P(7,11,e.data.Delivery.ReceivedDate,"HH:mm a")," "),l(3),Ci("color",e.currentDeliveryState=="(Received)"?"blue":"black"),l(7),I(e.data.Delivery.ReceiveBy),l(),m("ngIf",e.data.Delivery.ReceivedNote)}}function Cm(t,r){if(t&1&&(n(0,"div",80),p(1,"Dispatch Note:"),i(),f(2,"div",81)),t&2){let e=s(3);l(2),m("innerHTML",e.data.Delivery==null?null:e.data.Delivery.DispatchedNote,j)}}function vm(t,r){if(t&1&&(n(0,"div",82)(1,"div",73)(2,"h4"),p(3),v(4,"date"),i(),n(5,"p",74),p(6),v(7,"date"),i()(),n(8,"div",75),f(9,"i",76),n(10,"div",77),f(11,"div",78),i()(),n(12,"div",79)(13,"h4"),p(14,"Dispatched By"),i(),n(15,"p",74),p(16),i(),_(17,Cm,3,1),i()()),t&2){let e=s(2);l(3),D(" ",P(4,6,e.data.Delivery.DispatchedDate,"dd MMM yyyy")," "),l(3),D(" ",P(7,9,e.data.Delivery.DispatchedDate,"HH:mm a")," "),l(3),Ci("color",e.currentDeliveryState=="(Dispatched)"?"blue":"black"),l(7),I(e.data.Delivery.DispatchedBy),l(),Xe(e.data.Delivery!=null&&e.data.Delivery.DispatchedNote?17:-1)}}function ym(t,r){if(t&1&&(n(0,"div",80),p(1,"Approve Note:"),i(),f(2,"div",81)),t&2){let e=s(3);l(2),m("innerHTML",e.data.Delivery==null?null:e.data.Delivery.ApprovedNote,j)}}function xm(t,r){if(t&1&&(n(0,"div",82)(1,"div",73)(2,"h4"),p(3),v(4,"date"),i(),n(5,"p",74),p(6),v(7,"date"),i()(),n(8,"div",75),f(9,"i",76),n(10,"div",77),f(11,"div",78),i()(),n(12,"div",79)(13,"h4"),p(14,"Approved By"),i(),n(15,"p",74),p(16),i(),_(17,ym,3,1),i()()),t&2){let e=s(2);l(3),I(P(4,6,e.data.Delivery.ApproveDate,"dd MMM yyyy")),l(3),D(" ",P(7,9,e.data.Delivery.ApproveDate,"HH:mm a")," "),l(3),Ci("color",e.currentDeliveryState=="(Approve)"?"blue":"black"),l(7),I(e.data.Delivery.ApproveBy),l(),Xe(e.data.Delivery!=null&&e.data.Delivery.ApprovedNote?17:-1)}}function Sm(t,r){if(t&1&&(n(0,"div",80),p(1,"Created Note:"),i(),f(2,"div",81)),t&2){let e=s(3);l(2),m("innerHTML",e.data.Transfer==null?null:e.data.Transfer.Note,j)}}function hm(t,r){if(t&1&&(n(0,"div",12)(1,"div",73)(2,"h4"),p(3),v(4,"date"),i(),n(5,"p",74),p(6),v(7,"date"),i()(),n(8,"div",75),f(9,"i",76),i(),n(10,"div",79)(11,"h4"),p(12,"Created By"),i(),n(13,"p",74),p(14),i(),_(15,Sm,3,1),i()()),t&2){let e=s(2);l(3),D(" ",P(4,6,e.data.CreatedInfo.Created.Date,"dd MMM yyyy")," "),l(3),D(" ",P(7,9,e.data.CreatedInfo.Created.Date,"HH:mm a")," "),l(3),Ci("color",e.currentDeliveryState=="(Request)"?"blue":"black"),l(5),I(e.data.CreatedInfo.Created.User),l(),Xe(e.data.Transfer!=null&&e.data.Transfer.Note?15:-1)}}function bm(t,r){if(t&1&&(n(0,"small",86),p(1),v(2,"number"),i()),t&2){let e=s(3);l(),D(" (Weight ",E(2,1,e.totalWeight())," gr) ")}}function Dm(t,r){if(t&1){let e=b();n(0,"div",21)(1,"div",83)(2,"div",84)(3,"h2",85),p(4,"Items"),i(),_(5,bm,3,3,"small",86),i(),n(6,"div")(7,"div",46)(8,"button",6),f(9,"b",62),i(),n(10,"ul",87)(11,"li")(12,"a",50),g("click",function(){d(e);let o=s(2);return u(o.showRequested=!o.showRequested)}),p(13),i()(),n(14,"li")(15,"a",50),g("click",function(){d(e);let o=s(2);return u(o.showOnHand=!o.showOnHand)}),p(16),i()()()()()()()}if(t&2){let e=s(2);l(5),Xe(e.totalWeight()?5:-1),l(8),D("",e.showRequested?"Hide":"Show"," requested"),l(3),D("",e.showOnHand?"Hide":"Show"," current on hand inventory")}}function Im(t,r){t&1&&(n(0,"th",88),p(1," Product Code "),i())}function Tm(t,r){t&1&&(n(0,"th",33),p(1," Qty Req. "),i())}function wm(t,r){t&1&&(n(0,"th",33),p(1," On Hand "),i())}function Om(t,r){t&1&&(n(0,"th",89),p(1," Cost "),i())}function Em(t,r){t&1&&(n(0,"th",89),p(1," Total Cost "),i())}function Mm(t,r){if(t&1&&(n(0,"th",90),p(1),i()),t&2){let e=s(2);l(),D(" Price (",e.data.CurrencySimbol,") ")}}function Pm(t,r){t&1&&(n(0,"th",91),p(1," % "),i())}function Fm(t,r){if(t&1&&(n(0,"th",92),p(1),i()),t&2){let e=s(2);l(),D(" Total (",e.data.CurrencySimbol,") ")}}function Vm(t,r){if(t&1&&(z(0),f(1,"p",97),$()),t&2){let e=s().$implicit;l(),m("innerHTML",e.Note,j)}}function Nm(t,r){if(t&1&&(n(0,"td"),p(1),i()),t&2){let e=s().$implicit;l(),D(" ",e.ProductCode," ")}}function km(t,r){if(t&1&&(n(0,"td",40),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.QtyRequested)," ")}}function Lm(t,r){if(t&1&&(n(0,"td",40),p(1),v(2,"number"),n(3,"div"),p(4),i()()),t&2){let e=s().$implicit;ot(M(6,Xp,e.Inventory<e.Quantity)),l(),D(" ",E(2,4,e.Inventory)," "),l(3),I(e.UOMName)}}function Rm(t,r){if(t&1&&(n(0,"td",98),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.UnitCost)," ")}}function Am(t,r){if(t&1&&(n(0,"td",98),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.Quantity*e.UnitCost)," ")}}function Bm(t,r){if(t&1&&(n(0,"td",98),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.UnitPrice)," ")}}function Wm(t,r){if(t&1&&(n(0,"td",99),p(1),i()),t&2){let e=s().$implicit;l(),D(" ",e.PriceDiscount," ")}}function Hm(t,r){if(t&1&&(n(0,"td",98),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.TotalPrice)," ")}}function jm(t,r){if(t&1&&(n(0,"tr")(1,"td",40),p(2),i(),n(3,"td")(4,"a",45),p(5),i(),n(6,"div"),p(7),i(),f(8,"app-serial-note",93),_(9,Vm,2,1,"ng-container",10),i(),_(10,Nm,2,1,"td",10)(11,km,3,3,"td",41),n(12,"td",40),p(13),v(14,"number"),i(),_(15,Lm,5,8,"td",94)(16,Rm,3,3,"td",95)(17,Am,3,3,"td",95)(18,Bm,3,3,"td",95)(19,Wm,2,1,"td",96)(20,Hm,3,3,"td",95),i()),t&2){let e=r.$implicit,a=r.index,o=s(2);l(2),I(a+1+"."),l(2),m("routerLink",N(18,Yp))("queryParams",M(19,un,e.VariantID)),l(),I(e.Name),l(2),I(e.Code),l(),m("serials",e.Serial),l(),m("ngIf",e.Note),l(),m("ngIf",o.data.Config.ProductCodeVisible),l(),m("ngIf",o.showRequested),l(2),I(E(14,16,e.Quantity)),l(2),m("ngIf",o.showOnHand),l(),m("ngIf",o.data.Config.CostVisible&&o.role.product.Cost),l(),m("ngIf",o.data.Config.CostVisible&&o.role.product.Cost),l(),m("ngIf",o.data.Config.PriceVisible&&o.role.sell.PriceVisible),l(),m("ngIf",o.data.Config.PriceVisible&&o.role.sell.PriceVisible&&o.data.Config.DiscountVisible),l(),m("ngIf",o.data.Config.PriceVisible&&o.role.sell.PriceVisible)}}function Qm(t,r){if(t&1&&(n(0,"td",40),p(1),v(2,"sum"),v(3,"number"),i()),t&2){let e=s(2);l(),D(" ",E(3,4,P(2,1,e.data.Items,"QtyRequested"))," ")}}function qm(t,r){t&1&&f(0,"td")}function Um(t,r){if(t&1&&(n(0,"td",100)(1,"b"),p(2),v(3,"sumMultiply"),v(4,"number"),i()()),t&2){let e=s(2);l(2),D(" ",E(4,5,Vi(3,1,e.data.Items,"UnitCost","Quantity"))," ")}}function zm(t,r){if(t&1&&(n(0,"td",101)(1,"b"),p(2),v(3,"sum"),v(4,"number"),i()()),t&2){let e=s(2);l(2),I(E(4,4,P(3,1,e.data.Items,"TotalPrice")))}}function $m(t,r){if(t&1&&(n(0,"span")(1,"b"),p(2," Modified:"),i(),p(3),v(4,"date"),i()),t&2){let e=s(3);l(3),Qe(" ",P(4,2,e.data.CreatedInfo==null||e.data.CreatedInfo.Modified==null?null:e.data.CreatedInfo.Modified.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo==null||e.data.CreatedInfo.Modified==null?null:e.data.CreatedInfo.Modified.User," ")}}function Gm(t,r){if(t&1&&(n(0,"a",45)(1,"div",102),f(2,"i",103),n(3,"span",104)(4,"b"),p(5," Created:"),i(),p(6),v(7,"date"),i(),_(8,$m,5,5,"span"),i()()),t&2){let e=s(2);m("routerLink",N(8,Zp))("queryParams",M(9,em,e.data.ID)),l(6),Qe(" ",P(7,5,e.data.CreatedInfo==null||e.data.CreatedInfo.Created==null?null:e.data.CreatedInfo.Created.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo==null||e.data.CreatedInfo.Created==null?null:e.data.CreatedInfo.Created.User," "),l(2),Xe(e.data.CreatedInfo.Modified.Date!=e.minDate?8:-1)}}function Km(t,r){if(t&1&&(n(0,"mainpanel-cmp",1)(1,"actions"),_(2,tm,9,0,"div",2)(3,lm,6,5,"div",2),n(4,"div",3)(5,"a",4),f(6,"i",5),p(7,"Print "),i(),f(8,"button",6),n(9,"ul",7)(10,"li")(11,"a",8),p(12,"Print with Mini"),i()()()(),n(13,"div",3),_(14,pm,3,5,"a",9)(15,sm,3,2,"ng-container",10),i()(),n(16,"content")(17,"div",11)(18,"div",12)(19,"div",13)(20,"div",14)(21,"div",15)(22,"h2",16),f(23,"i",17),p(24),i(),_(25,dm,4,2,"a",18),i(),n(26,"div",19)(27,"table",20)(28,"tr")(29,"th"),p(30,"Tag"),i(),n(31,"td"),p(32,":"),i(),n(33,"td"),p(34),i()(),n(35,"tr")(36,"th"),p(37,"Date"),i(),n(38,"td"),p(39,":"),i(),n(40,"td"),p(41),v(42,"date"),i()(),n(43,"tr")(44,"th"),p(45,"Courier"),i(),n(46,"td"),p(47,":"),i(),n(48,"td"),p(49),i()(),n(50,"tr")(51,"th"),p(52,"Status"),i(),n(53,"td"),p(54,":"),i(),n(55,"td"),p(56),i()(),_(57,um,8,6,"tr")(58,_m,8,2,"tr",10),i()()(),n(59,"div",14)(60,"div",21)(61,"h2"),p(62),i()(),n(63,"div",19),_(64,gm,18,14,"div",22)(65,vm,18,12,"div",23)(66,xm,18,12,"div",23)(67,hm,16,12,"div",24),i()()(),n(68,"div",25)(69,"div",14),_(70,Dm,17,3,"div",26),n(71,"div",19)(72,"table",27)(73,"thead",28)(74,"tr")(75,"th",29),p(76,"No"),i(),n(77,"th",30),p(78,"Name"),i(),_(79,Im,2,0,"th",31)(80,Tm,2,0,"th",32),n(81,"th",33),p(82,"Qty Sent"),i(),_(83,wm,2,0,"th",32)(84,Om,2,0,"th",34)(85,Em,2,0,"th",34)(86,Mm,2,1,"th",35)(87,Pm,2,0,"th",36)(88,Fm,2,1,"th",37),i()(),n(89,"tbody"),_(90,jm,21,21,"tr",38),i(),n(91,"tfoot",39)(92,"tr")(93,"td",40)(94,"b"),p(95,"Total"),i()(),_(96,Qm,4,6,"td",41),n(97,"td",42)(98,"b"),p(99),v(100,"sum"),v(101,"number"),i()(),_(102,qm,1,0,"td",10)(103,Um,5,7,"td",43)(104,zm,5,6,"td",44),i()()()()()()(),_(105,Gm,9,11,"a",45),i()()()),t&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0)("titleLimit",50),l(2),m("ngIf",e.role.global.Export),l(),m("ngIf",!e.data.Transfer.IsVoided),l(2),m("routerLink",N(51,qp))("queryParams",Ae(52,Ar,e.data.ID,e.data.TemplateID)),l(6),m("routerLink",N(55,Up))("queryParams",Ae(56,Ar,e.data.ID,e.data.TemplateID)),l(3),m("ngIf",e.data.Config.isEditor&&!e.data.Transfer.IsVoided),l(),m("ngIf",e.data.HasOutletSourceWriteAccess),l(9),Qe("\xA0",e.data.Transfer.Source," to ",e.data.Transfer.Destination," "),l(),m("ngIf",e.data.Transfer.IsVoided),l(9),I(e.data.Transfer.Type),l(7),I(P(42,43,e.data.Transfer.Date,"dd MMM yyyy")),l(8),I(e.data.Transfer.Courier),l(7),I(e.data.Transfer.Status),l(),Xe(e.data.Config.IsAdjusted&&(e.data.Transfer!=null&&e.data.Transfer.AdjustedAt)?57:-1),l(),m("ngIf",e.data.JournalUrl),l(4),I(e.data.Delivery.HeadDelivery),l(2),m("ngIf",e.data.Delivery.ReceivedDate),l(),m("ngIf",e.data.Delivery.DispatchedDate),l(),m("ngIf",e.data.Delivery.ApproveBy),l(),m("ngIf",e.data.CreatedInfo.Created.Date),l(3),m("ngIf",e.data.Items.length>0),l(9),m("ngIf",e.data.Config.ProductCodeVisible),l(),m("ngIf",e.showRequested),l(3),m("ngIf",e.showOnHand),l(),m("ngIf",e.data.Config.CostVisible&&e.role.product.Cost),l(),m("ngIf",e.data.Config.CostVisible&&e.role.product.Cost),l(),m("ngIf",e.data.Config.PriceVisible&&e.role.sell.PriceVisible),l(),m("ngIf",e.data.Config.PriceVisible&&e.role.sell.PriceVisible&&e.data.Config.DiscountVisible),l(),m("ngIf",e.data.Config.PriceVisible&&e.role.sell.PriceVisible),l(2),m("ngForOf",e.data.Items),l(3),Co("colspan",e.data.Config.ProductCodeVisible?"3":"2"),l(3),m("ngIf",e.showRequested),l(3),D(" ",E(101,49,P(100,46,e.data.Items,"Quantity"))," "),l(3),m("ngIf",e.showOnHand),l(),m("ngIf",e.data.Config.CostVisible&&e.role.product.Cost),l(),m("ngIf",e.data.Config.PriceVisible&&e.role.sell.PriceVisible),l(),Xe(e.role.users.LogRestriction?-1:105)}}var dn=class t extends Se{constructor(e,a,o,c,w,H,ie,Ue){super(e,a,"TransferOrder/Info",null,null,o);this.csvConverter=c;this.router=w;this.toastr=H;this.role=ie;this.matDialog=Ue}currentDeliveryState;minDate=T.MinDate;showOnHand=!1;showRequested=!1;totalWeight=vt(0);preGetList(){let e=this.route.snapshot.queryParams;this.pageData.Filter=e}postInit(){this.menuData.H=this.data.PageTitle,this.currentDeliveryState=this.data.Delivery.HeadDelivery.split(" ")[1],this.calculateWeight()}calculateWeight(){let a=this.data.Items.filter(o=>o.Weight).reduce((o,c)=>o+c.Weight*c.Quantity,0);this.totalWeight.set(a)}deleteData(){confirm("Are you sure you want to delete selected record/s?")&&this.httpService.delete("/API/TransferOrder/DeleteTransferOrderInfo",{params:[{key:"ID",value:this.data.ID}]}).subscribe(()=>{this.toastr.success("Records are removed.",ve.Success),this.router.navigate(["/menu/Logistics/Archive/Transfer_Order"])})}export(e,a){this.httpService.get(`/api/${e}`,[{key:"ID",value:this.route.snapshot.queryParams.ID}]).subscribe(o=>{this.csvConverter.convertToCSV(o,a)})}onVoid(){confirm("Are you sure you want to void this record/s?")&&this.httpService.put("/api/TransferOrder/VoidTransferOrder",{ID:this.data.ID},{},1e5).subscribe(e=>{this.toastr.success(e.Message,"Success"),this.data.Transfer.IsVoided=!0,this.menuData.H=this.menuData.H})}onApproveDelivery(){this.matDialog.open(Si,{data:{title:"Approve Delivery",type:"APPROVE"}}).afterClosed().pipe(L(e=>T.IsNotEmpty(e)),Q(e=>{let a={ID:this.data.ID||this.data.Transfer.ID,Note:e.Note};return this.httpService.post(Ne.ApproveDelivery,a)})).subscribe(()=>this.getListData())}onDispatchDelivery(){this.matDialog.open(sn,{data:{data:this.data}}).afterClosed().pipe(L(e=>T.IsNotEmpty(e)),Q(e=>this.httpService.post(Ne.SendTransferOrder,e))).subscribe(()=>this.getListData())}onReceiveDelivery(){this.matDialog.open(Si,{data:{type:"RECEIVE"}}).afterClosed().pipe(L(e=>T.IsNotEmpty(e)),Q(e=>{let a={ID:this.data.ID||this.data.Transfer.ID,Date:e.Date,Note:e.Note};return this.httpService.post(Ne.ReceiveTransferOrder,a)})).subscribe(()=>this.getListData())}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(pe),C(Me),C(at),C(ee),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-transfer-order-info"]],standalone:!1,features:[re],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown","titleLimit",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown","titleLimit"],["class","btn-group",4,"ngIf"],[1,"btn-group","ms-5"],["target","_blank",1,"btn","btn-outline-secondary",2,"float","left",3,"routerLink","queryParams"],[1,"fa-solid","fa-print","me-3"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu",2,"cursor","pointer"],["target","_blank",1,"dropdown-item",3,"routerLink","queryParams"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],[4,"ngIf"],[1,"container-fluid","card-container","mt-5"],[1,"row"],[1,"col-sm-4"],[1,"card"],[1,"card-header","d-flex","align-items-center"],[1,"title","mb-0","d-flex","align-items-center"],["aria-hidden","true",1,"fa","fa-location-dot"],["class","badge rounded-pill d-flex align-items-center gap-3 fs-5 bg-danger text-white ms-3",3,"routerLink",4,"ngIf"],[1,"card-body"],[1,"table-sm","table-borderless"],[1,"card-header"],["class","row",3,"pb-8",4,"ngIf"],["class","row pb-8",4,"ngIf"],["class","row",4,"ngIf"],[1,"col-sm-8"],["class","card-header",4,"ngIf"],["id","tableGrid",1,"table","custom-table","w-100"],[1,"thead-light","sticky-top-thead"],[1,"text-center",2,"width","1px"],[2,"width","100%"],["style","width: 400px",4,"ngIf"],["style","width: 30px","class","text-center",4,"ngIf"],[1,"text-center",2,"width","30px"],["style","width: 85px","class","text-end",4,"ngIf"],["style","width: 100px","class","text-end",4,"ngIf"],["style","width: 20px","class","text-end",4,"ngIf"],["style","width: 110px","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"table-footer"],[1,"text-center"],["class","text-center",4,"ngIf"],[1,"text-center","empty-column"],["class","text-end","colspan","1",4,"ngIf"],["class","text-end","colspan","2",4,"ngIf"],["target","_blank",3,"routerLink","queryParams"],[1,"btn-group"],[1,"btn","btn-outline-secondary",2,"float","left",3,"click"],[1,"fas","fa-upload","me-3"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle","border-start-0"],[1,"dropdown-item",3,"click"],["class","btn btn-outline-secondary ms-5","role","button",3,"click",4,"ngIf"],["style","cursor: pointer","class","btn btn-outline-secondary ms-5","role","button",3,"click",4,"ngIf"],["class","btn btn-outline-secondary ms-5","role","button","matTooltipPosition","above",3,"ngClass","matTooltip","click",4,"ngIf"],["class","btn btn-outline-secondary btn-sm dropdown-toggle","data-bs-toggle","dropdown",3,"disabled",4,"ngIf"],["class","dropdown-menu dropdown-menu-end","style","cursor: pointer; color: black",4,"ngIf"],["role","button",1,"btn","btn-outline-secondary","ms-5",3,"click"],[1,"fa-solid","fa-truck"],["role","button",1,"btn","btn-outline-secondary","ms-5",2,"cursor","pointer",3,"click"],[1,"fa-solid","fa-check"],["role","button","matTooltipPosition","above",1,"btn","btn-outline-secondary","ms-5",3,"click","ngClass","matTooltip"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle",3,"disabled"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end",2,"cursor","pointer","color","black"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square","me-3"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"badge","rounded-pill","d-flex","align-items-center","gap-3","fs-5","bg-danger","text-white","ms-3",3,"routerLink"],["aria-hidden","true",1,"fa","fa-trash","me-2"],[2,"font-size","12px"],["target","_blank",3,"href"],[1,"col","text-end"],[1,"mt-3"],[1,"col-3","text-center","position-relative"],[1,"fa-solid","fa-angle-up","current-status-icon"],[1,"d-flex","justify-content-center","h-100"],[1,"timeline"],[1,"col-5"],[1,"fw-bold"],[3,"innerHTML"],[1,"row","pb-8"],[1,"d-flex","justify-content-between"],[1,"me-auto","d-sm-block","mt-3"],[1,"d-inline"],[1,"text-body-secondary","h6"],[1,"dropdown-menu","dropdown-menu-end","cursor","text-dark",2,"z-index","1021"],[2,"width","400px"],[1,"text-end",2,"width","85px"],[1,"text-end",2,"width","100px"],[1,"text-end",2,"width","20px"],[1,"text-end",2,"width","110px"],[3,"serials"],["class","text-center",3,"class",4,"ngIf"],["class","text-end",4,"ngIf"],["class","text-end text-danger",4,"ngIf"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],[1,"text-end"],[1,"text-end","text-danger"],["colspan","1",1,"text-end"],["colspan","2",1,"text-end"],[1,"alert","alert-warning"],["aria-hidden","true",1,"fa-regular","fa-file-lines"],[1,"me-2"]],template:function(a,o){a&1&&_(0,Km,106,59,"mainpanel-cmp",0),a&2&&m("ngIf",o.data)},dependencies:[mt,J,B,G,oe,ke,dt,ge,he,Be,Qo],styles:[".current-status-icon[_ngcontent-%COMP%]{background-color:#fff;border-radius:50%;box-shadow:0 2px #b8b8b8;width:35px;height:35px;font-size:35px}.timeline[_ngcontent-%COMP%]{border-left:3px solid #e1e1e1;height:100%;width:0px}"]})};var Jm=(t,r)=>({ID:t,Template:r}),Ym=(t,r)=>({ID:t,Template:r,Cost:1}),fn=t=>({ID:t}),Xm=()=>["/menu/Logistics/Archive/Inbound_Logistics/Form"],Zm=()=>["/menu/Contacts/Contact/Suppliers/Info"];function ec(t,r){if(t&1){let e=b();n(0,"div",2)(1,"a",35),g("click",function(){d(e);let o=s(2);return u(o.export("InboundLogistics/ExportInfoItems","Transfer Item Inbound Logistics.csv"))}),f(2,"i",36),p(3,"Export "),i()()}}function tc(t,r){if(t&1&&(n(0,"a",37),f(1,"i",38),p(2,"Edit"),i()),t&2){let e=s(2);m("routerLink",N(2,Xm))("queryParams",M(3,fn,e.data.Fulfillment.ID))}}function ic(t,r){if(t&1){let e=b();n(0,"a",39),g("click",function(){d(e);let o=s(2);return u(o.deleteData())}),f(1,"i",40),p(2,"Delete"),i()}}function nc(t,r){if(t&1&&(n(0,"tr")(1,"th"),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(3);l(6),I(e.data.Supplier==null?null:e.data.Supplier.Mobile)}}function oc(t,r){if(t&1&&(n(0,"tr")(1,"th"),p(2,"City"),i(),n(3,"td"),p(4,":"),i(),f(5,"td",44),i()),t&2){let e=s(3);l(5),m("innerHTML",e.data.Supplier==null?null:e.data.Supplier.Address,j)}}function rc(t,r){if(t&1&&(n(0,"div",14)(1,"div",15)(2,"h2"),f(3,"i",41),p(4,"Supplier "),i()(),n(5,"div",18)(6,"table",19)(7,"tr")(8,"th"),p(9,"Name"),i(),n(10,"td"),p(11,":"),i(),n(12,"td")(13,"a",42),p(14),i()()(),_(15,nc,7,1,"tr",43)(16,oc,6,1,"tr",43),i()()()),t&2){let e=s(2);l(13),m("routerLink",N(5,Zm))("queryParams",M(6,fn,e.data.Supplier==null?null:e.data.Supplier.ID)),l(),I(e.data.Supplier==null?null:e.data.Supplier.Name),l(),m("ngIf",e.data.Supplier==null?null:e.data.Supplier.Mobile),l(),m("ngIf",e.data.Supplier==null?null:e.data.Supplier.Address)}}function ac(t,r){if(t&1&&(z(0),f(1,"p",48),$()),t&2){let e=s().$implicit;l(),m("innerHTML",e==null?null:e.Note,j)}}function lc(t,r){if(t&1&&(n(0,"tr")(1,"td"),p(2),i(),n(3,"td")(4,"a",45),p(5),i(),n(6,"div"),p(7),i(),f(8,"app-serial-note",46),_(9,ac,2,1,"ng-container",43),i(),n(10,"td",47),p(11),n(12,"div"),p(13),i()()()),t&2){let e=r.$implicit,a=r.index;l(2),I(a+1+"."),l(2),m("queryParams",M(8,fn,e.VariantID)),l(),D(" ",e.Name," "),l(2),I(e.Code),l(),m("serials",e.Serial),l(),m("ngIf",e.Note!=null),l(2),D("",e.Quantity," "),l(2),I(e.UOMName)}}function pc(t,r){if(t&1&&(n(0,"div",14)(1,"div",15)(2,"h2"),f(3,"i",49),p(4,"Note "),i()(),f(5,"div",50),i()),t&2){let e=s(2);l(5),m("innerHTML",e.data.Fulfillment.Note,j)}}function mc(t,r){if(t&1&&(n(0,"span")(1,"b"),p(2,"Modified:"),i(),p(3),v(4,"date"),i()),t&2){let e=s(3);l(3),Qe(" ",P(4,2,e.data.CreatedInfo.Modified.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo.Modified.User," ")}}function cc(t,r){if(t&1&&(n(0,"div",51),f(1,"i",52),n(2,"span")(3,"b"),p(4," Created:"),i(),p(5),v(6,"date"),i(),_(7,mc,5,5,"span",43),i()),t&2){let e=s(2);l(5),Qe(" ",P(6,3,e.data.CreatedInfo.Created.Date,"dd MMM yyyy HH:mm")," / ",e.data.CreatedInfo.Created.User," "),l(2),m("ngIf",e.data.CreatedInfo.Modified==null?null:e.data.CreatedInfo.Modified.Date)}}function sc(t,r){if(t&1&&(n(0,"mainpanel-cmp",1)(1,"actions")(2,"div",2)(3,"a",3),f(4,"i",4),p(5,"Print "),i(),f(6,"button",5),n(7,"ul",6)(8,"li")(9,"a",7),p(10,"Print with Cost"),i()()()(),_(11,ec,4,0,"div",8),n(12,"div",2),_(13,tc,3,5,"a",9)(14,ic,3,0,"a",10),i()(),n(15,"content")(16,"div",11)(17,"div",12)(18,"div",13)(19,"div",14)(20,"div",15)(21,"h2"),f(22,"i",16),p(23,"Order "),n(24,"small",17),p(25),i()()(),n(26,"div",18)(27,"table",19)(28,"tr")(29,"th"),p(30,"Outlet"),i(),n(31,"td"),p(32,":"),i(),n(33,"td"),p(34),i()(),n(35,"tr")(36,"th"),p(37,"Bill"),i(),n(38,"td"),p(39,":"),i(),n(40,"td")(41,"a",20),p(42),i(),p(43),v(44,"date"),i()()()()(),_(45,rc,17,8,"div",21),n(46,"div",14)(47,"div",15)(48,"h2"),f(49,"i",22),p(50,"Fulfillment "),i()(),n(51,"div",18)(52,"table",19)(53,"tr")(54,"th"),p(55,"Outlet"),i(),n(56,"td"),p(57,":"),i(),n(58,"td"),p(59),i()(),n(60,"tr")(61,"th"),p(62,"Date"),i(),n(63,"td"),p(64,":"),i(),n(65,"td"),p(66),v(67,"date"),i()(),n(68,"tr")(69,"th"),p(70,"Number"),i(),n(71,"td"),p(72,":"),i(),n(73,"td"),p(74),i()(),n(75,"tr")(76,"th"),p(77,"Courier"),i(),n(78,"td"),p(79,":"),i(),n(80,"td"),p(81),i()()()()()(),n(82,"div",23)(83,"div",14)(84,"div",15)(85,"h2"),f(86,"i",24),p(87,"Products "),i()(),n(88,"div",18)(89,"table",25)(90,"thead",26)(91,"tr")(92,"th",27),p(93,"No."),i(),n(94,"th"),p(95,"Products"),i(),n(96,"th",28),p(97,"Qty"),i()()(),n(98,"tbody"),_(99,lc,14,10,"tr",29),i(),n(100,"tfoot",30)(101,"tr")(102,"td",31),p(103,"Total"),i(),n(104,"td",32),p(105),v(106,"sum"),i()()()()()(),_(107,pc,6,1,"div",21),i(),n(108,"div",33),_(109,cc,8,6,"div",34),i()()()()()),t&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),l(3),m("queryParams",Ae(31,Jm,e.data.Fulfillment.ID,e.data.PrintConfig.ID)),l(6),m("queryParams",Ae(34,Ym,e.data.Fulfillment.ID,e.data.PrintConfig.ID)),l(2),m("ngIf",e.roleService.global.Export),l(2),m("ngIf",e.roleService.logistic.Edit),l(),m("ngIf",e.roleService.logistic.Delete),l(11),D(" (",e.data.Fulfillment.Status,") "),l(9),I(e.data.Order.OutletName),l(7),m("queryParams",M(37,fn,e.data.Order.InvoiceID)),l(),D(" ",e.data.Order.Number," "),l(),D(" - ",P(44,22,e.data.Order.Date,"dd MMM yyyy")," "),l(2),m("ngIf",e.data.Supplier==null?null:e.data.Supplier.ID),l(14),D(" ",e.data.Fulfillment.OutletName," "),l(7),D(" ",P(67,25,e.data.Fulfillment.Date,"dd MMM yyyy")," "),l(8),D(" ",e.data.Fulfillment.Number," "),l(7),D(" ",e.data.Fulfillment.Courier," "),l(18),m("ngForOf",e.data.Items),l(6),D("",P(106,28,e.data.Items,"Quantity")," "),l(2),m("ngIf",e.data==null?null:e.data.Fulfillment.Note),l(2),m("ngIf",!e.roleService.users.LogRestriction)}}var _n=class t extends Se{constructor(e,a,o,c,w,H,ie){super(e,a,"InboundLogistics/DetailInfo",null,null,o);this.csvConverter=c;this.router=w;this.toastr=H;this.roleService=ie}preGetList(){let e=this.route.snapshot.queryParams;this.pageData.Filter.ID=e.ID}postInit(e){e.Items=e.Items.filter(a=>a.Quantity!=0),this.menuData.H=`Inbound Logistics #${e.Fulfillment.Number}`}deleteData(){confirm("Are you sure you want to delete selected record/s?")&&this.httpService.delete("/API/InboundLogistics/DeleteInfo",{params:[{key:"ID",value:this.data.Fulfillment.ID}]}).subscribe(e=>{this.toastr.success(e.Message,ve.Success),this.router.navigate(["/menu/Logistics/Archive/Inbound_Logistics"])})}export(e,a){this.httpService.get(`/api/${e}`,[{key:"ID",value:this.route.snapshot.queryParams.ID}]).subscribe(o=>{this.csvConverter.convertToCSV(o,a)})}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(pe),C(Me),C(at),C(ee),C(ne))};static \u0275cmp=O({type:t,selectors:[["POS-supplier-delivery-info"]],standalone:!1,features:[re],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn-group","me-5"],["routerLink","/print/InDelivery",1,"btn","btn-outline-secondary",2,"float","left",3,"queryParams"],[1,"fa-solid","fa-print","me-3"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","btn-sm","dropdown-toggle"],[1,"dropdown-menu",2,"cursor","pointer"],["routerLink","/print/InDelivery",1,"dropdown-item",3,"queryParams"],["class","btn-group me-5",4,"ngIf"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-4"],[1,"card"],[1,"card-header"],[1,"fa-solid","fa-receipt","me-5"],[1,"text-body-secondary","h6"],[1,"card-body"],[1,"table-sm","table-borderless"],["target","_blank","routerLink","/menu/Orders/Orders/Supplier_Bill/Info",3,"queryParams"],["class","card",4,"ngIf"],[1,"fa-solid","fa-truck","me-5"],[1,"col-8"],[1,"fa-solid","fa-box","me-5"],[1,"table"],[1,"thead-light"],[2,"width","40px"],[2,"width","50px"],[4,"ngFor","ngForOf"],[1,"table-footer"],["colspan","2",1,"text-end","empty-column","fw-bold"],[1,"text-center","empty-column","fw-bold"],[1,"col-12"],["class","alert alert-warning",4,"ngIf"],[1,"btn","btn-outline-secondary",2,"float","left",3,"click"],[1,"fas","fa-upload","me-3"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-pen-to-square","me-3"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"fa-solid","fa-address-card","me-5"],["target","_blank",3,"routerLink","queryParams"],[4,"ngIf"],[3,"innerHTML"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[3,"serials"],[1,"text-center"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],[1,"fa-solid","fa-note-sticky","me-5"],[1,"card-body",3,"innerHTML"],[1,"alert","alert-warning"],["aria-hidden","true",1,"fa-regular","fa-file-lines"]],template:function(a,o){a&1&&_(0,sc,110,39,"mainpanel-cmp",0),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,oe,dt,he,Be],encapsulation:2})};function dc(t,r){if(t&1){let e=b();z(0),n(1,"POS-uppy",3),g("fileUploaded",function(o){d(e);let c=s(2);return u(c.onSelectFile(o))}),i(),$()}t&2&&(l(),m("subtitle","Accepted file formats: .csv & max file size: 1 MB"))}function uc(t,r){if(t&1){let e=b();z(0),n(1,"POS-uppy",3),g("fileUploaded",function(o){d(e);let c=s(2);return u(c.onSelectFile(o))}),i(),$()}t&2&&(l(),m("subtitle","Accepted file formats: .csv & max file size: 1 MB"))}function _c(t,r){if(t&1&&_(0,dc,2,1,"ng-container",2)(1,uc,2,1,"ng-container",2),t&2){let e=s();m("ngIf",e.uploadState()===e.uploadStateEnum.Idle||e.uploadState()===e.uploadStateEnum.Uploading),l(),m("ngIf",e.uploadState()===e.uploadStateEnum.Success||e.uploadState()===e.uploadStateEnum.Error)}}var gn=class t{constructor(r,e,a){this.dialogRef=r;this.toastService=e;this.httpService=a;this.config=new _e,this.config.title="Import Courier"}config;file;uploadState=vt(0);uploadStateEnum=gr;onSelectFile(r){this.file=r}onOk(){this.uploadState.set(1);let r=new FormData;r.append("File",this.file),this.httpService.postFormData("/api/transferorder/ImportCourier",r).subscribe({next:e=>{this.uploadState.set(2),this.toastService.success(e.Message,ve.Success),this.dialogRef.close("Success")},error:e=>{this.uploadState.set(3)}})}onClose(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||t)(C(ye),C(ee),C(k))};static \u0275cmp=O({type:t,selectors:[["POS-modal-upload-courier"]],standalone:!1,decls:3,vars:1,consts:[["modalContent",""],[3,"onOk","onCancel","onClose","config"],[4,"ngIf"],["sampleUrl","https://cdn.dealpos.xyz/web-import-template/Courier-Import-Template.csv",3,"fileUploaded","subtitle"]],template:function(e,a){if(e&1){let o=b();n(0,"modal-material",1),g("onOk",function(){return d(o),u(a.onOk())})("onCancel",function(){return d(o),u(a.onClose())})("onClose",function(){return d(o),u(a.onClose())}),_(1,_c,2,2,"ng-template",null,0,Z),i()}e&2&&m("config",a.config)},dependencies:[B,fe,Ki],encapsulation:2})};var fc=()=>["/menu/Logistics/Setup/Courier/Form"],gc=t=>({"border-end-0":t}),Cc=()=>["/menu/Logistics/Setup/Courier/Info"],vc=t=>({ID:t}),yc=t=>({"text-decoration-line-through":t});function xc(t,r){if(t&1){let e=b();n(0,"a",17),g("click",function(){d(e);let o=s(2);return u(o.httpPostListID("TransferOrder/RemoveCourier"))}),f(1,"i",18),p(2,"Delete "),i()}}function Sc(t,r){if(t&1){let e=b();n(0,"button",19),g("click",function(){d(e);let o=s(2);return u(o.onImport())}),f(1,"i",20),p(2,"Import "),i()}if(t&2){let e=s(2);ot(M(2,gc,e.roleService.global.Export))}}function hc(t,r){if(t&1){let e=b();n(0,"button",19),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",21),p(2," Export "),i()}}function bc(t,r){if(t&1){let e=b();n(0,"div",22)(1,"h6"),p(2,"Discontinued"),i(),n(3,"radio-options",23),h("modelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.Bin,o)||(c.pageData.Filter.Bin=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),x("model",e.pageData.Filter.Bin),m("options",e.radioOption)}}function Dc(t,r){if(t&1){let e=b();n(0,"input",27),h("ngModelChange",function(o){d(e);let c=s().$implicit;return S(c.selected,o)||(c.selected=o),u(o)}),i()}if(t&2){let e=s().$implicit;x("ngModel",e.selected)}}function Ic(t,r){if(t&1&&(n(0,"tr",24)(1,"td"),_(2,Dc,1,1,"input",25),i(),n(3,"td")(4,"a",26)(5,"span"),p(6),i()()(),n(7,"td"),p(8),i()()),t&2){let e=r.$implicit,a=s(2);l(2),m("ngIf",a.roleService.logistic.Delete),l(2),m("routerLink",N(7,Cc))("queryParams",M(8,vc,e.ID)),l(),ot(M(10,yc,e.Bin)),l(),D(" ",e.Name," "),l(2),I(e.OutletName)}}function Tc(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Text,o)||(c.pageData.Filter.Text=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,xc,3,0,"a",3),n(3,"div",4),_(4,Sc,3,4,"button",5)(5,hc,3,0,"button",6),i(),n(6,"a",7),p(7,"Add"),i()(),n(8,"filters"),_(9,bc,4,2,"ng-template",null,0,Z),i(),n(11,"content")(12,"div",8)(13,"div",9)(14,"table",10)(15,"thead",11)(16,"tr")(17,"th",12)(18,"input",13),g("change",function(o){d(e);let c=s();return u(c.onSelectAllData(o.target.checked))}),i()(),n(19,"th"),p(20,"Name"),i(),n(21,"th"),p(22,"Destination Outlet Filter"),i()()(),n(23,"tbody"),_(24,Ic,9,12,"tr",14),i()()(),n(25,"div",15)(26,"POS-complex-pagination",16),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Text),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.getSelectedData().length>0),l(2),m("ngIf",e.roleService.logistic.Create),l(),m("ngIf",e.roleService.global.Export),l(),m("routerLink",N(11,fc)),l(18),m("ngForOf",e.data.Data),l(2),m("total",e.data.Data.length)("pageData",e.pageData)}}var Cn=class t extends Se{constructor(e,a,o,c,w){super(e,a,"TransferOrder/GetCourierList","TransferOrderLoader/GetCourierListLoader",o);this.roleService=c;this.matDialog=w;this.radioOption=[{Key:!1,Value:"No"},{Key:!0,Value:"Yes"},{Key:null,Value:"All"}]}radioOption;onImport(){this.matDialog.open(gn).afterClosed().pipe(L(e=>T.IsNotEmpty(e))).subscribe(()=>this.getListData())}openExportModal(){this.matDialog.open(Ie,{data:{title:"Courier",exportTypes:[{ID:"TransferOrderExport/GetCourierList",Value:"Default",FileName:"Courier"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"TransferOrder/GetCourierListCount",pagination:!0}})}postInit(e){this.data.Data=e.Data.map(a=>le(ae({},a),{OutletName:a.Outlet?a.Outlet?.join(", "):""}))}preInitList(){this.pageData.Filter.Bin=!1}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(ee),C(ne),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-courier"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["value","Delete","matTooltipPosition","above","matTooltip","Delete","class","btn btn-danger me-3",3,"click",4,"ngIf"],[1,"btn-group","ms-3","me-6"],["class","btn btn-outline-secondary",3,"class","click",4,"ngIf"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"button","btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[2,"width","14px"],["type","checkbox",3,"change"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"d-sm-block","mt-2"],["api","TransferOrder/GetCourierListCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["value","Delete","matTooltipPosition","above","matTooltip","Delete",1,"btn","btn-danger","me-3",3,"click"],[1,"fas","fa-trash","me-3"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-download","me-3"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["name","CourierStatus",3,"modelChange","model","options"],[1,"border-bottom"],["type","checkbox",3,"ngModel","ngModelChange",4,"ngIf"],[3,"routerLink","queryParams"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(a,o){a&1&&_(0,Tc,27,12,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,Dt,R,W,oe,Ht,Je,ke],encapsulation:2})};var wc=()=>["/menu/Logistics/Setup/Courier"];function Oc(t,r){t&1&&(n(0,"span",21),p(1,"Name is required"),i())}function Ec(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2)(1,"actions")(2,"a",3),p(3,"Cancel"),i(),n(4,"button",4),g("click",function(){d(e);let o=s();return u(o.onSubmit("TransferOrder/UpdateCourierList"))}),p(5," Save "),i()(),n(6,"content")(7,"div",5)(8,"div",6)(9,"div",7)(10,"div",8)(11,"div",9)(12,"h3"),p(13,"General"),i()(),n(14,"div",10)(15,"div",6)(16,"div",11)(17,"div",12)(18,"input",13,0),h("ngModelChange",function(o){d(e);let c=s();return S(c.formData.Name,o)||(c.formData.Name=o),u(o)}),i(),n(20,"label"),p(21,"Name"),i(),_(22,Oc,2,0,"span",14),i()(),n(23,"div",11)(24,"div",12)(25,"div",15)(26,"label"),p(27,"Suspend"),i(),n(28,"mat-radio-group",16),h("ngModelChange",function(o){d(e);let c=s();return S(c.formData.Bin,o)||(c.formData.Bin=o),u(o)}),n(29,"mat-radio-button",17),p(30,"Yes"),i(),n(31,"mat-radio-button",18),p(32," No "),i()()()()()()()()()(),n(33,"div",6)(34,"div",7)(35,"div",8)(36,"div",9)(37,"h3"),p(38,"Destination Outlet Filter"),i()(),n(39,"div",10)(40,"div",6)(41,"div",7)(42,"outlet-selector",19),h("ngModelChange",function(o){d(e);let c=s();return S(c.formData.EntityID,o)||(c.formData.EntityID=o),u(o)}),i(),n(43,"small",20),p(44," This restriction only applies for the destination outlet in the "),n(45,"strong"),p(46,"Transfer Order Form"),i(),p(47,". "),i()()()()()()()()()()}if(t&2){let e=we(19),a=s();m("pageData",a.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),m("routerLink",N(14,wc)),l(2),m("disabled",!a.formData.Name),l(14),x("ngModel",a.formData.Name),l(4),m("ngIf",e.invalid&&(e.dirty||e.touched)),l(6),x("ngModel",a.formData.Bin),l(),m("value",!0),l(2),m("value",!1),l(11),m("multiple",!0),x("ngModel",a.formData.EntityID),m("maxSelectedLabels",10)("isFloatLabel",!0)}}var vn=class t extends qt{constructor(e,a,o,c,w){super(e,a,"TransferOrderLoader/CourierFormInitial",o);this.toaster=c;this.router=w}postBindForm(){T.IsEmpty(this.formData.Name)&&(this.formData.Name="")}onSubmitSuccess(e){this.toaster.success(e.Message,ve.Success),this.router.navigate(["/menu/Logistics/Setup/Courier"])}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(pe),C(ee),C(at))};static \u0275cmp=O({type:t,selectors:[["POS-courier-form"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["name","ngModel"],[3,"pageData","hideSearchDropdown","hideSearchBox",4,"ngIf"],[3,"pageData","hideSearchDropdown","hideSearchBox"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"routerLink"],["type","button","role","button",1,"btn","btn-success",3,"click","disabled"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-12"],[1,"card"],[1,"card-header"],[1,"card-body"],[1,"col-sm-6"],[1,"form-floating-outline"],["type","text","autofocus","","required","","name","Name","id","Name","placeholder","Name",1,"form-control",3,"ngModelChange","ngModel"],["class","control-label text-danger",4,"ngIf"],[1,"form-floating-outline","radio","border","rounded"],["aria-label","Select an option","color","primary",3,"ngModelChange","ngModel"],[3,"value"],[1,"ps-3","mt-4",3,"value"],[3,"ngModelChange","multiple","ngModel","maxSelectedLabels","isFloatLabel"],[1,"form-text","text-muted","outlet-info"],[1,"control-label","text-danger"]],template:function(a,o){a&1&&_(0,Ec,48,15,"mainpanel-cmp",1),a&2&&m("ngIf",o.formData&&o.formData.Name!=null)},dependencies:[B,G,Ce,R,ho,W,Fo,Vo,oe,Pe],styles:[".outlet-info[_ngcontent-%COMP%]{display:block;margin-top:.4rem;font-size:.85rem;color:#6c757d}.outlet-info[_ngcontent-%COMP%] strong[_ngcontent-%COMP%]{color:#495057}.outlet-info[_ngcontent-%COMP%] em[_ngcontent-%COMP%]{font-style:italic;color:#5a6268}"]})};var yn=class t{constructor(r,e){this.dt=r;this.dialogRef=e;this.config=new _e,this.config.title="Receive Note",this.data=r.data}config;data;onSave(){this.dialogRef.close(this.data)}static \u0275fac=function(e){return new(e||t)(C(Ke),C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-modal-note"]],standalone:!1,decls:4,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],["cols","24","rows","6",1,"form-control",3,"ngModelChange","ngModel"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.onSave()})("onCancel",function(){return a.dialogRef.close()})("onClose",function(){return a.dialogRef.close()}),n(1,"content")(2,"div",1)(3,"textarea",2),h("ngModelChange",function(c){return S(a.data.Note,c)||(a.data.Note=c),c}),i()()()()),e&2&&(m("config",a.config),l(3),x("ngModel",a.data.Note))},dependencies:[fe,Ce,R,W],encapsulation:2})};var Br=t=>({ID:t}),Mc=()=>["/menu/Products/Catalog/Variants/Info"],Pc=t=>({"bg-gradient-warning":t});function Fc(t,r){if(t&1){let e=b();n(0,"tr",27)(1,"td")(2,"a",28),p(3),i()(),f(4,"td",29),n(5,"td")(6,"input",30),h("ngModelChange",function(o){let c=d(e).$implicit;return S(c.Quantity,o)||(c.Quantity=o),u(o)}),i()(),n(7,"td",31),p(8),v(9,"number"),i(),n(10,"td",32),p(11),v(12,"number"),i(),n(13,"td")(14,"textarea",33),h("ngModelChange",function(o){let c=d(e).$implicit;return S(c.Note,o)||(c.Note=o),u(o)}),i()()()}if(t&2){let e=r.$implicit,a=s(2);l(2),m("routerLink",N(16,Mc))("queryParams",M(17,Br,e.VariantID)),l(),I(e.Name),l(),m("innerHTML",e.Code,j),l(2),x("ngModel",e.Quantity),m("max",e.Transfer)("disabled",e.TypeID==a.serialized),l(2),D(" ",E(9,12,e.Transfer)," "),l(2),m("ngClass",M(19,Pc,e.Quantity-e.Transfer!=0)),l(),D(" ",E(12,14,e.Quantity-e.Transfer)," "),l(3),x("ngModel",e.Note),m("disabled",e.TypeID==a.serialized)}}function Vc(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",1)(1,"actions")(2,"a",2),p(3,"Cancel"),i(),n(4,"button",3),g("click",function(){d(e);let o=s();return u(o.openNoteDialog())}),p(5,"Save"),i()(),n(6,"content")(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h2"),f(13,"i",9),p(14),i()(),n(15,"div",10)(16,"div",11)(17,"div",12),p(18,"Date"),i(),n(19,"div",13),p(20,":"),i(),n(21,"div",14)(22,"datepicker",15),h("dateChange",function(o){d(e);let c=s();return S(c.data.Date,o)||(c.data.Date=o),u(o)}),i()()(),n(23,"div",16)(24,"div",12),p(25,"Courier"),i(),n(26,"div",13),p(27,":"),i(),n(28,"div",14),p(29),i()(),n(30,"div",17)(31,"div",12),p(32,"Note"),i(),n(33,"div",13),p(34,":"),i(),f(35,"div",18),i()()()(),n(36,"div",19)(37,"div",7)(38,"div",8)(39,"h2"),p(40,"Products"),i()(),n(41,"div",10)(42,"table",20)(43,"thead",21)(44,"tr")(45,"th",22),p(46,"NAME"),i(),n(47,"th",23),p(48,"CODE"),i(),n(49,"th",24),p(50,"QTY"),i(),n(51,"th",24),p(52,"TRANSFER"),i(),n(53,"th",24),p(54,"DIFF"),i(),n(55,"th",25),p(56,"NOTE"),i()()(),n(57,"tbody"),_(58,Fc,15,21,"tr",26),i()()()()()()()()()}if(t&2){let e=s();m("pageData",e.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),l(2),m("queryParams",M(10,Br,e.data.ID)),l(12),D(" ",e.data==null?null:e.data.Outlet," "),l(8),m("width",100),x("date",e.data.Date),l(7),D(" ",e.data.Courier," "),l(6),m("innerHTML",e.data.Note,j),l(23),m("ngForOf",e.data.Items)}}var xn=class t extends qt{constructor(e,a,o,c,w,H,ie){super(a,o,"TransferOrder/ReceiveOutletDelivery",c);this.title=e;this.toastr=w;this.matDialog=H;this.router=ie}serialized=4;postBindForm(e){this.menuData.H=e.PageTitle,this.title.setTitle("Receive & Adjust")}openNoteDialog(){this.matDialog.open(yn,{data:{data:{Note:null}},width:"400px"}).afterClosed().pipe(L(e=>T.IsNotEmpty(e))).subscribe(e=>{let a=le(ae({},this.data),{Note:e?.Note});this.httpService.post("/api/TransferOrder/CheckOut",a).subscribe(o=>this.onSubmitSuccess(o))})}onSubmitSuccess(e){this.toastr.success("Delivery has been received!",ve.Success),this.router.navigate(["/menu/Logistics/Archive/Transfer_Order"])}static \u0275fac=function(a){return new(a||t)(C(ni),C(te),C(k),C(pe),C(ee),C(A),C(at))};static \u0275cmp=O({type:t,selectors:[["POS-receive-transfer-order"]],standalone:!1,features:[re],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown",4,"ngIf"],[3,"pageData","hideSearchBox","hideSearchDropdown"],["routerLink","/menu/Logistics/Archive/Transfer_Order/Info",1,"btn","me-5","btn-outline-secondary",3,"queryParams"],[1,"btn","btn-success",3,"click"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-xs-12","col-md-3","col-lg-12","col-xl-3","col-sm-12"],[1,"card"],[1,"card-header"],["aria-hidden","true",1,"fa","fa-location-dot"],[1,"card-body"],[1,"d-flex","align-items-center","justify-content-between","w-100"],[2,"width","20%"],[1,"me-2",2,"width","5%"],[1,"w-75"],["appearance","outline",3,"dateChange","width","date"],[1,"d-flex","align-items-center","justify-content-between","w-100","mt-8"],[1,"d-flex","align-items-center","justify-content-between","w-100",2,"margin-top","28px"],[1,"w-75","text-break",3,"innerHTML"],[1,"col-xs-12","col-md-9","col-lg-12","col-xl-9","col-sm-12"],[1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","250px"],[1,"text-end",2,"width","150px"],[1,"text-end",2,"width","60px"],[1,"text-end",2,"width","250px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"border-bottom"],["target","_blank",3,"routerLink","queryParams"],[1,"text-end",3,"innerHTML"],["type","text","autoNum","",1,"form-control","text-end",3,"ngModelChange","ngModel","max","disabled"],[1,"text-end"],[1,"text-end",3,"ngClass"],["rows","3",1,"form-control",3,"ngModelChange","ngModel","disabled"]],template:function(a,o){a&1&&_(0,Vc,59,12,"mainpanel-cmp",0),a&2&&m("ngIf",o.data)},dependencies:[mt,J,B,G,Ce,R,W,oe,de,ct,ge],encapsulation:2})};var pi=class t{constructor(r,e,a){this.data=r;this.dialogRef=e;this.convertCsvService=a;this.modalConfig=new _e,this.modalConfig.title=r.title}modalConfig;convertedData;onSelectFile(r){this.convertCsvService.convert(r).subscribe(e=>{this.convertedData=e})}onClose(){this.dialogRef.close()}onOk(){this.dialogRef.close(this.convertedData)}static \u0275fac=function(e){return new(e||t)(C(Ke),C(ye),C(Cr))};static \u0275cmp=O({type:t,selectors:[["app-modal-import"]],standalone:!1,decls:14,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"modal-dialog"],[1,"modal-content","border-0"],["href","//res.cloudinary.com/pos/raw/upload/v1671075053/POS/CSV/Inbound_QTY.csv",1,"noteBox"],[1,"d-flex","justify-content-between"],["accept",".csv","id","csv","type","file","name","myfile",1,"form-control",3,"change"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.onOk()})("onCancel",function(){return a.onClose()})("onClose",function(){return a.onClose()}),n(1,"content",1)(2,"div",2)(3,"div")(4,"a",3),p(5,"Download Template File"),i()(),n(6,"div",4)(7,"table")(8,"tbody")(9,"tr")(10,"th"),p(11," CSV: "),i(),n(12,"td")(13,"input",5),g("change",function(c){return a.onSelectFile(c.target)}),i()()()()()()()()()),e&2&&m("config",a.modalConfig)},dependencies:[fe],styles:[".noteBox[_ngcontent-%COMP%]{background-color:#ffffe1;border:1px solid #cacaca;padding:3px;display:block;outline:0;margin-bottom:5px;font-size:11px;text-decoration:none}"]})};var Sn=class t{httpService=y(k);constructor(){}getUnfulfilledOrderByNumberOrReferenceNumber(r){return this.httpService.get(Ne.GetUnfulfilledOrderByNumberOrReferenceNumber,[{key:"orderNumberOrReferenceNumber",value:r}])}getUnfulfilledOrderByNumber(r){return this.httpService.post(Ne.GetUnfulfilledNumberByNumber,{Prefix:r,Count:20})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var zt=class t{constructor(r,e){this.toastr=r;this.matDialog=e}cartItems;formItems;entityID;bindCartItems(r=[],e=[],a){this.cartItems=[],r.forEach(o=>{let c=Object.assign({},o);c.QuantityDelivered=o.Quantity,c.Sent=0,c.BarcodeCount=0,c.Completed=!1,c.MaxDeliveryQuantity=c.Quantity,c=this.setSerialSourceItem(c),this.checkIsSent(c,e),a&&this.checkIsEdit(c),this.cartItems.push(c)})}setSerialSourceItem(r){return r.TypeID==4&&(r.serialSources=r?.Serial?JSON.parse(JSON.stringify(r?.Serial)):[]),r}checkIsEdit(r){let e=this.formItems.find(a=>a.ID==r.ID);T.IsNotEmpty(e)?(r.QuantityDelivered=e.Quantity,r.Completed=!1,r.MaxDeliveryQuantity=r.Quantity-r.Sent+e.Quantity):r.Completed||(r.QuantityDelivered=0)}checkIsSent(r,e){let a=e?.find(o=>o.ID==r.ID);T.IsNotEmpty(a)&&(r.Sent=a.Quantity,r.QuantityDelivered=r.Quantity-r.Sent,r.MaxDeliveryQuantity=r.Quantity-r.Sent,r.Completed=r.QuantityDelivered==0)}onScanBarcode(r){if(T.IsEmpty(r))this.toastr.error("Code is empty",ve.Error);else{let e=this.cartItems.find(a=>T.IsNotEmpty(a.Code)&&a.Code==r);if(T.IsNotEmpty(e)){this.cartItems.filter(o=>o.Code==r).forEach(o=>o.BarcodeCount+=1);let a=[];this.cartItems.forEach(o=>a.push(o)),this.cartItems=a,this.toastr.success(`${e.Name} (${e.Code}) count: ${e.BarcodeCount}`,ve.Success)}else this.toastr.error(`No variant with code ${r} found`,ve.Error)}}static \u0275fac=function(e){return new(e||t)(Vt(ee),Vt(A))};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var mi=class t{constructor(r,e,a){this.toastr=r;this.router=e;this.dialog=a}validate(r,e,a){let o=!0;return r.filter(c=>c.QuantityDelivered!=0).length==0&&!a&&(this.toastr.error("Deliver at least one item",ve.Error),o=!1),r.forEach(c=>{c.QuantityDelivered>c.MaxDeliveryQuantity&&(this.toastr.error(`Delivery item of ${c.Name} is greater than ordered!`,ve.Error),o=!1)}),o=this.checkBarcodeConfig(r,e),o}checkBarcodeConfig(r,e){if(!e)return!0;let a=r.some(c=>(c.QuantityDelivered<0?c.QuantityDelivered*-1:c.QuantityDelivered)!=c.BarcodeCount&&c.QuantityDelivered>0),o=!0;return a&&(this.dialog.open(ar,{id:"modalLogisticInfoId",data:{title:"Logistic - Quantity Counter Config Enabled",message:`You must scan the product to be sent one by one before the record can be SAVED or you can turn off the config by following
|
|
2
2
|
<a href="https://support.dealpos.com/en/articles/4773890-send-outbound-logistic-with-barcode-scan" target="_blank">this article</a>
|
|
3
|
-
.`,headerType:ve.Warning},width:"500px"}),o=!1),o}convertCartItemsToForm(r){return r.filter(a=>!a.Completed).map(a=>({ID:a.ID,Name:a.Name,VariantID:a.VariantID,Quantity:a.QuantityDelivered,PackSize:a.PackSize,Serial:a.Serial,UnitQuantity:1,Note:a.Note,InventoryTypeID:a.TypeID}))}newForm(r){this.router.navigate([`/menu/Logistics/Archive/${r}/Form`]).then(()=>window.location.reload())}undo(r,e){this.router.navigate([`/menu/Logistics/Archive/${e}/Form`],{queryParams:{ID:r}}).then(()=>window.location.reload())}mappingItemWithCsv(r,e){return e=e.map(a=>(r.forEach(o=>{o.Quantity=parseFloat(o.Quantity),o.Code==a.Code&&(a.QuantityDelivered=o.Quantity)}),a)),e}toastrShowToastrNotFoundItems(r,e){let a=r.filter(o=>{let c=e.find(w=>w.Code==o.Code);return!!T.IsEmpty(c)});a.length>0&&this.toastr.error(`Items with code ${a.map(o=>o.Code)?.join(", ")} is not found`,"Not Found Items")}static \u0275fac=function(e){return new(e||t)(Vt(ee),Vt(at),Vt(A))};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Hr=t=>[t],Nc=(t,r)=>({ID:t,Template:r}),kc=t=>({ID:t});function Lc(t,r){if(t&1&&(z(0),n(1,"div",27),p(2),i(),n(3,"div",27),p(4),v(5,"number"),i(),$()),t&2){let e=s().$implicit;l(2),I(e.Name),l(2),I(E(5,2,e.Quantity))}}function Rc(t,r){if(t&1&&(n(0,"div",25),_(1,Lc,6,4,"ng-container",26),i()),t&2){let e=r.$implicit;l(),m("ngIf",e.Quantity!=0)}}function Ac(t,r){if(t&1&&(n(0,"div",21),_(1,Rc,2,1,"div",22),n(2,"div",23)(3,"div",24),p(4,"Total Delivered Quantity:"),i(),n(5,"div",24),p(6),v(7,"sum"),v(8,"number"),i()()()),t&2){let e=s();l(),m("ngForOf",e.items),l(5),D("",E(8,5,P(7,2,e.items,"Quantity"))," ")}}var ci=class t{afterSubmitData;items;state;undo=new gi;newForm=new gi;onUndo(){this.undo.emit(this.afterSubmitData.ID)}onNewForm(){this.newForm.emit()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-complete-customer-supplier"]],inputs:{afterSubmitData:"afterSubmitData",items:"items",state:"state"},outputs:{undo:"undo",newForm:"newForm"},standalone:!1,decls:27,vars:18,consts:[[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","py-5"],[1,"btn","bg-light-gray","btn-secondary",3,"click"],[1,"fa-solid","fa-reply","me-2"],["target","_blank",1,"btn","bg-light-gray","btn-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],["class","card-body",4,"ngIf"],[1,"card-body"],["class","row justify-content-between mb-3",4,"ngFor","ngForOf"],[1,"row","justify-content-end","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col-4","text-end"],[1,"row","justify-content-between","mb-3"],[4,"ngIf"],[1,"col","text-end"]],template:function(e,a){e&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h1",4),f(5,"i",5),p(6),i()(),n(7,"div",6)(8,"div",7)(9,"div",8)(10,"a",9),g("click",function(){return a.onNewForm()}),p(11),i()()()(),n(12,"div",10)(13,"div",11)(14,"button",12),g("click",function(){return a.onUndo()}),f(15,"i",13),p(16,"Undo"),i(),n(17,"a",14),f(18,"i",15),p(19,"Print Receipt"),i()()()()(),n(20,"div",16)(21,"div",2)(22,"div",17)(23,"h2",18)(24,"a",19),p(25),i()()(),_(26,Ac,9,7,"div",20),i()()()),e&2&&(l(6),D("",a.state," Logistics Complete"),l(5),D("New ",a.state," Logistics (F8)"),l(6),m("routerLink",M(9,Hr,a.state=="Outbound"?"/print/OutDelivery":"/print/InDelivery"))("queryParams",Ae(11,Nc,a.afterSubmitData.ID,a.afterSubmitData.Template)),l(7),m("routerLink",M(14,Hr,a.state=="Outbound"?"/menu/Logistics/Archive/Outbound_Logistics/Info":"/menu/Logistics/Archive/Inbound_Logistics/Info"))("queryParams",M(16,kc,a.afterSubmitData.ID)),l(),Qe("",a.state," Logistics #",a.afterSubmitData.DeliveryNumber,""),l(),m("ngIf",a.items.length>0))},dependencies:[J,B,G,ge,Be],encapsulation:2,changeDetection:0})};var si=class t{form;tinyEditorApiKey="zc58cdrrftek5r5igtmjiar7ed4n3wr00hzd4w4mvtx8mpxa";static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-tinymce-note"]],inputs:{form:"form"},standalone:!1,decls:6,vars:1,consts:[[1,"card-header"],[1,"fa-solid","fa-note-sticky","me-5"],[1,"card-body"],["height","220px",3,"ngModelChange","ngModel"]],template:function(e,a){e&1&&(n(0,"div",0)(1,"h2"),f(2,"i",1),p(3,"Note "),i()(),n(4,"div",2)(5,"POS-tinymce-editor",3),h("ngModelChange",function(c){return S(a.form.Header.Note,c)||(a.form.Header.Note=c),c}),i()()),e&2&&(l(5),x("ngModel",a.form.Header.Note))},dependencies:[R,W,xt],encapsulation:2,changeDetection:0})};var Wc=t=>({"mt-10":t});function Hc(t,r){if(t&1){let e=b();n(0,"mat-chip-row",19),g("removed",function(){let o=d(e).$implicit,c=s(3);return u(c.onRemoveSerialChip(o))}),p(1),n(2,"button",20),f(3,"i",21),i()()}if(t&2){let e=r.$implicit;l(),D(" ",e," ")}}function jc(t,r){if(t&1){let e=b();z(0),n(1,"div",10)(2,"div",11)(3,"mat-form-field",12),g("keyup.enter",function(o){return d(e),u(o.stopPropagation())}),n(4,"mat-chip-grid",null,1),_(6,Hc,4,1,"mat-chip-row",13),n(7,"input",14,2),g("matChipInputTokenEnd",function(o){d(e);let c=we(8),w=s(2);return u(w.addSerial(o,c))}),i()()()(),n(9,"div",15)(10,"button",16),g("click",function(){d(e);let o=s(2);return u(o.submitSerial())}),f(11,"i",17),n(12,"strong",18),p(13,"ADD"),i()()()(),$()}if(t&2){let e=we(5),a=s(2);l(6),m("ngForOf",a.selectedSerialCode),l(),m("matChipInputFor",e)("matChipInputSeparatorKeyCodes",a.separatorKeysCodes)}}function Qc(t,r){if(t&1){let e=b();n(0,"ng-select",22),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.selectedSerialCode,o)||(c.selectedSerialCode=o),u(o)}),g("change",function(o){d(e);let c=s(2);return u(c.onSelectSerial(o))}),i()}if(t&2){let e=s(2);m("items",e.serialSources)("multiple",!0),x("ngModel",e.selectedSerialCode),m("disabled",e.isStateEdit)}}function qc(t,r){t&1&&f(0,"th",31)}function Uc(t,r){if(t&1){let e=b();n(0,"td",34)(1,"i",35),g("click",function(){d(e);let o=s().index,c=s(3);return u(c.onRemoveSerial(o))}),i()()}}function zc(t,r){if(t&1){let e=b();n(0,"tr"),_(1,Uc,2,0,"td",32),n(2,"td"),p(3),i(),n(4,"td")(5,"input",33),h("ngModelChange",function(o){let c=d(e).$implicit;return S(c.Quantity,o)||(c.Quantity=o),u(o)}),i()()()}if(t&2){let e=r.$implicit,a=s(3);l(),m("ngIf",!a.isStateEdit),l(2),I(e.Number),l(2),x("ngModel",e.Quantity),m("disabled",a.isStateEdit)("decimalPlaces",0)}}function $c(t,r){if(t&1&&(z(0),n(1,"div",23)(2,"div",24)(3,"table",25)(4,"thead",26)(5,"tr"),_(6,qc,1,0,"th",27),n(7,"th",28),p(8,"Serial Number"),i(),n(9,"th",29),p(10,"Quantity"),i()()(),n(11,"tbody"),_(12,zc,6,5,"tr",30),i()()()(),$()),t&2){let e=s(2);l(6),m("ngIf",!e.isStateEdit),l(6),m("ngForOf",e.selectedSerial)}}function Gc(t,r){if(t&1&&(z(0),_(1,jc,14,3,"ng-container",9)(2,Qc,1,4,"ng-template",null,0,Z)(4,$c,13,2,"ng-container",5),$()),t&2){let e=we(3),a=s();l(),m("ngIf",a.isEmptySerial&&a.state=="Inbound_Logistics")("ngIfElse",e),l(3),m("ngIf",a.selectedSerial.length>0)}}var hn=class t{constructor(r,e,a,o,c){this.data=r;this.dialogRef=e;this.toastr=a;this.logisticProductService=o;this.productService=c;this.config=new _e,this.config.title=r?.name,this.config.customWidth="550px",this.note=r?.note,this.fulfillmentOutletId=r.fulfillmentOutletId,this.state=this.data.state,this.isStateEdit=this.data.isEdit,this.initItemSerial()}separatorKeysCodes=[13,188];config;note;fulfillmentOutletId;isSerialized=!1;selectedSerial=[];serialSources=[];selectedSerialCode;isFocusInputSerial=!1;isEmptySerial=!1;state;isStateEdit;initItemSerial(){if(this.data?.item.TypeID==4){let r=this.data?.item?.serialSources;this.isEmptySerial=r?.length==0,this.isSerialized=!0,this.initSerialSources();let e=this.data?.item.Serial?this.data?.item.Serial:[];this.initSelectedSerial(e),this.mapSerialToCode()}}initSerialSources(){this.state=="Outbound_Logistics"?this.productService.getVariantSerial(this.fulfillmentOutletId,this.data?.item?.VariantID).pipe(V(r=>r.map(e=>({Number:e.Number,Quantity:e.Quantity,ExpiryDate:e.ExpiryDate})))).subscribe(r=>{this.serialSources=r}):this.serialSources=this.data?.item?.serialSources}initSelectedSerial(r){this.selectedSerial=r?.map((e,a)=>({Number:e.Number,Quantity:e.Quantity,ExpiryDate:e.ExpiryDate}))}mapSerialToCode(){this.selectedSerialCode=this.selectedSerial.map(r=>r.Number)}onSelectSerial(r){let e;this.selectedSerial=r.map(a=>(e=this.selectedSerial.find(o=>o.Number==a.Number),{Number:a.Number,Quantity:T.IsNotEmpty(e)?e.Quantity:1,ExpiryDate:a.ExpiryDate}))}onRemoveSerial(r){this.selectedSerial.splice(r,1),this.mapSerialToCode()}onFocusAddSerial(){this.isFocusInputSerial=!0}onBlurAddSerial(){this.isFocusInputSerial=!1}submitSerial(){let r=this.generateSerialData();this.selectedSerial=[...this.selectedSerial,...r],this.selectedSerialCode=[]}generateSerialData(){this.selectedSerialCode=this.selectedSerialCode.filter(a=>this.selectedSerial.findIndex(o=>o.Number==a)==-1);let r;return this.selectedSerialCode.map(a=>(r=this.serialSources.find(o=>o.Number==a),{Number:a,Quantity:1,ExpiryDate:null}))}onClose(){this.dialogRef.close()}onOk(r){!this.isFocusInputSerial&&r!="Enter"&&(this.isSerialized?this.selectedSerial.length>0?this.onCloseDialog():this.generateSerialFromCode():this.dialogRef.close({note:this.note,serials:[]}))}generateSerialFromCode(){this.selectedSerialCode.length>0?(this.selectedSerial=this.generateSerialData(),this.onCloseDialog()):this.toastr.warning("Serials cannot be empty","Warning!")}onCloseDialog(){if(this.calculateSerialQty()>this.data?.item?.Quantity){this.toastr.warning("Quantity of serials cannot be more than Item Quantity","Warning!");return}let e=this.getSubmitedSerialData();this.dialogRef.close({note:this.note,serials:e})}getSubmitedSerialData(){return this.selectedSerial.map(e=>({Number:e.Number,Quantity:e.Quantity}))}calculateSerialQty(){return this.selectedSerial?.map(e=>e.Quantity)?.reduce((e,a)=>e+a)}onRemoveSerialChip(r){this.selectedSerialCode=this.selectedSerialCode.filter(e=>e!==r)}addSerial(r,e){let a=(r.value||"").trim();if(a)if(this.selectedSerialCode.find(o=>o==a)){e.value="",this.toastr.info("Serial already exists",ve.Info);return}else this.selectedSerialCode.push(a);r.chipInput.clear()}static \u0275fac=function(e){return new(e||t)(C(Ke),C(ye),C(ee),C(zt),C($i))};static \u0275cmp=O({type:t,selectors:[["POS-modal-item-note"]],standalone:!1,decls:8,vars:7,consts:[["SERIAL_OPTIONS",""],["chipGrid",""],["inputChip",""],[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[4,"ngIf"],[1,"form-floating-outline",3,"ngClass"],["name","note","id","note","cols","60",1,"form-control",2,"width","100%",3,"ngModelChange","rows","ngModel"],["for","note"],[4,"ngIf","ngIfElse"],[1,"input-group","mb-3"],[1,"col"],["appearance","outline",1,"serial-chip",3,"keyup.enter"],[3,"removed",4,"ngFor","ngForOf"],["placeholder","E.g. Serial1 Serial2",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"col-auto"],["type","button",1,"btn","btn-outline-secondary","btn-sm","add-chip",3,"click"],["aria-hidden","true",1,"fa","fa-plus","me-1","fs-6"],[1,"headings-font-family","h6","font-weight-bold"],[3,"removed"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"],["appendTo","body","bindValue","Number","bindLabel","Number","placeholder","Insert Number",1,"ng-select-multiple",3,"ngModelChange","change","items","multiple","ngModel","disabled"],[1,"row","mt-8"],[1,"col-12"],[1,"table","table-bordered"],[1,"thead-light"],["class","border-end","style","width: 40px",4,"ngIf"],[1,"border-end"],[1,"border-end","text-end",2,"width","60px"],[4,"ngFor","ngForOf"],[1,"border-end",2,"width","40px"],["class","text-center",4,"ngIf"],["type","text","placeholder","Qty","autoNum","",1,"form-control","text-end",3,"ngModelChange","ngModel","disabled","decimalPlaces"],[1,"text-center"],["aria-hidden","true","title","Remove serial",1,"fa","fa-xmark","text-danger","cursor-pointer","fa-2x",3,"click"]],template:function(e,a){e&1&&(n(0,"modal-material",3),g("onOk",function(c){return a.onOk(c)})("onCancel",function(){return a.onClose()})("onClose",function(){return a.onClose()}),n(1,"content")(2,"div",4),_(3,Gc,5,3,"ng-container",5),n(4,"div",6)(5,"textarea",7),h("ngModelChange",function(c){return S(a.note,c)||(a.note=c),c}),i(),n(6,"label",8),p(7,"Note"),i()()()()()),e&2&&(m("config",a.config),l(3),m("ngIf",a.isSerialized),l(),m("ngClass",M(5,Wc,a.isSerialized)),l(),m("rows",a.isSerialized?3:8),x("ngModel",a.note))},dependencies:[mt,J,B,fe,Ce,R,W,Eo,ct,Ee,tr,ir,Zo,er],styles:[".serial-chip[_ngcontent-%COMP%]{width:100%}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input, .serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:40px!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading{border-color:#ccc!important}.serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:8px;padding-bottom:8px}.add-chip[_ngcontent-%COMP%]{height:calc(100% - 18.4px);margin-left:1px;border-top-left-radius:0;border-bottom-left-radius:0}"],changeDetection:0})};var Kc=t=>({ID:t});function Jc(t,r){if(t&1){let e=b();n(0,"div")(1,"button",13),g("click",function(){d(e);let o=s();return u(o.onImport())}),f(2,"i",14),p(3," Import "),i()()}}function Yc(t,r){t&1&&(n(0,"th",8),p(1," Pack Size "),i())}function Xc(t,r){if(t&1&&f(0,"p",24),t&2){let e=s().$implicit;m("innerHTML",e==null?null:e.Note,j)}}function Zc(t,r){if(t&1){let e=b();n(0,"input",25),h("ngModelChange",function(o){d(e);let c=s().$implicit;return S(c.QuantityDelivered,o)||(c.QuantityDelivered=o),u(o)}),i()}if(t&2){let e=s().$implicit,a=s();x("ngModel",e.QuantityDelivered),m("disabled",a.isEdit&&e.TypeID==4)}}function es(t,r){if(t&1){let e=b();n(0,"td")(1,"input",26),h("ngModelChange",function(o){d(e);let c=s().$implicit;return S(c.PackSize,o)||(c.PackSize=o),u(o)}),i()()}if(t&2){let e=s().$implicit;l(),x("ngModel",e.PackSize)}}function ts(t,r){t&1&&(z(0),f(1,"i",27),$())}function is(t,r){t&1&&f(0,"i",28)}function ns(t,r){if(t&1){let e=b();n(0,"tr")(1,"td")(2,"a",15),p(3),i(),f(4,"app-serial-note",16),_(5,Xc,1,1,"p",17),i(),n(6,"td"),p(7),i(),n(8,"td"),_(9,Zc,1,2,"input",18),i(),_(10,es,2,1,"td",19),n(11,"td",20),p(12),v(13,"quantityFraction"),i(),n(14,"td",20),p(15),v(16,"quantityFraction"),i(),n(17,"td",20),p(18),v(19,"quantityFraction"),i(),n(20,"td",21)(21,"div",22),g("click",function(){let o=d(e),c=o.$implicit,w=o.index,H=s();return u(H.openModalItemNote(c,w))}),_(22,ts,2,0,"ng-container",23)(23,is,1,0,"ng-template",null,0,Z),i()()()}if(t&2){let e=r.$implicit,a=we(24),o=s();l(2),m("queryParams",M(18,Kc,e.VariantID)),l(),D(" ",e.Name," "),l(),m("serials",e.Serial),l(),m("ngIf",e.Note!=null),l(2),I(e.Code),l(2),m("ngIf",!e.Completed),l(),m("ngIf",o.isDeliveryPacking),l(2),D(" ",E(13,12,e.Sent)," "),l(3),D(" ",E(16,14,e.Quantity)," "),l(3),D(" ",E(19,16,e.BarcodeCount)," "),l(4),m("ngIf",e.TypeID==4)("ngIfElse",a)}}var di=class t{constructor(r){this.dialog=r;this.eventImport=new gi}isDeliveryPacking;cartItems;state;isEdit;fulfillmentOutletId;hasImportBtn=!0;eventImport;openModalItemNote(r,e){this.dialog.open(hn,{data:{note:r.Note,name:r.Name,item:r,state:this.state,isEdit:this.isEdit,fulfillmentOutletId:this.fulfillmentOutletId}}).afterClosed().pipe(L(a=>T.IsNotEmpty(a))).subscribe(a=>{r.TypeID==4&&(r.Serial=a.serials,r.QuantityDelivered=this.calculateSerialQty(a.serials)),r.Note=a.note,this.updateCartItems(r,e)})}updateCartItems(r,e){this.cartItems=this.cartItems.map((a,o)=>(e==o&&(a=r),a))}calculateSerialQty(r=[]){let e=0;return r.forEach(a=>{e+=a.Quantity}),e}onImport(){this.eventImport.emit()}static \u0275fac=function(e){return new(e||t)(C(A))};static \u0275cmp=O({type:t,selectors:[["POS-products-delivery-list"]],inputs:{isDeliveryPacking:"isDeliveryPacking",cartItems:"cartItems",state:"state",isEdit:"isEdit",fulfillmentOutletId:"fulfillmentOutletId",hasImportBtn:"hasImportBtn"},outputs:{eventImport:"eventImport"},standalone:!1,decls:27,vars:5,consts:[["STANDART",""],[1,"card-header"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fa-solid","fa-box","me-5"],[1,"card-body"],[1,"table","table-bordered"],[1,"thead-light","sticky-top-thead"],[1,"border-end"],[1,"border-end","text-end",2,"width","80px"],["class","border-end text-end","style","width: 80px",4,"ngIf"],[1,"border-end","text-end",2,"width","55px"],[1,"border-end",2,"width","55px"],[4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","py-3","px-5",3,"click"],["aria-hidden","true",1,"fa-solid","fa-download"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",1,"d-block",3,"queryParams"],[3,"serials"],["class","special-TinyMCE fst-italic text-warning mb-0","style","word-break: break-all",3,"innerHTML",4,"ngIf"],["autoNum","","class","form-control text-end","type","text",3,"ngModel","disabled","ngModelChange",4,"ngIf"],[4,"ngIf"],[1,"text-end"],[1,"text-center"],[3,"click"],[4,"ngIf","ngIfElse"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","ngModel","disabled"],["type","text","autoNum","",1,"form-control",2,"direction","rtl",3,"ngModelChange","ngModel"],["matTooltip","Choose Serial Number",1,"fa-solid","fa-barcode","cursor-pointer","fa-2x"],["matTooltip","Note","matTooltipPosition","above",1,"fa-regular","fa-note-sticky","fa-2x","cursor-pointer"]],template:function(e,a){e&1&&(n(0,"div",1)(1,"div",2)(2,"h2"),f(3,"i",3),p(4,"Products"),i(),_(5,Jc,4,0,"div"),i()(),n(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr")(10,"th",7),p(11,"Products"),i(),n(12,"th",7),p(13,"Code"),i(),n(14,"th",8),p(15,"Qty"),i(),_(16,Yc,2,0,"th",9),n(17,"th",10),p(18),i(),n(19,"th",10),p(20),i(),n(21,"th",10),p(22,"Count"),i(),n(23,"th",11),p(24,"Action"),i()()(),n(25,"tbody"),_(26,ns,25,20,"tr",12),i()()()),e&2&&(l(5),Xe(a.hasImportBtn?5:-1),l(11),m("ngIf",a.isDeliveryPacking),l(2),D(" ",a.state=="Outbound_Logistics"?"Sent":"Received"," "),l(2),D(" Order",a.state=="Inbound_Logistics"?"ed":""," "),l(6),m("ngForOf",a.cartItems))},dependencies:[J,B,G,Ce,R,W,ct,ke,dt,ri],encapsulation:2})};var rs=()=>["/menu/Logistics/Archive/Outbound_Logistics/Info"],ro=t=>({ID:t}),as=()=>["/menu/Logistics/Archive/Outbound_Logistics"],ls=()=>["/menu/Orders/Order/Sales_Order/Info"],ps=()=>["/menu/Contacts/Contact/Customers/Info"];function ms(t,r){if(t&1&&(n(0,"a",7),p(1,"Cancel"),i()),t&2){let e=s(3);m("routerLink",N(2,rs))("queryParams",M(3,ro,e.param.ID||e.param.POID))}}function cs(t,r){t&1&&(n(0,"a",8),p(1,"Cancel"),i()),t&2&&m("routerLink",N(1,as))}function ss(t,r){if(t&1){let e=b();z(0),_(1,ms,2,5,"a",4)(2,cs,2,2,"a",5),n(3,"button",6),g("click",function(){d(e);let o=s(2);return u(o.validate())}),p(4),i(),$()}if(t&2){let e=s(2);l(),m("ngIf",e.isEdit),l(),m("ngIf",!e.isEdit),l(2),D(" ",e.isEdit?"Save":"Add"," ")}}function ds(t,r){if(t&1){let e=b();z(0),n(1,"mat-button-toggle-group",20)(2,"mat-button-toggle",21),g("click",function(){d(e);let o=s(4);return o.onTabChange("invoiceSearch"),u(o.searchLogisticType="invoice")}),f(3,"i",22),i(),n(4,"mat-button-toggle",23),g("click",function(){d(e);let o=s(4);return o.onTabChange("customerSearch"),u(o.searchLogisticType="customer")}),f(5,"i",24),i(),n(6,"mat-button-toggle",25),g("click",function(){d(e);let o=s(4);return o.onTabChange("numberSearch"),u(o.searchLogisticType="number")}),f(7,"i",26),i()(),$()}if(t&2){let e=s(4);l(2),m("checked",e.searchLogisticType=="invoice"),l(2),m("checked",e.searchLogisticType=="customer"),l(2),m("checked",e.searchLogisticType=="number")}}function us(t,r){t&1&&(n(0,"div",10)(1,"div",31),p(2,"Outlet"),i(),n(3,"div",32),p(4,"Date"),i(),n(5,"div",33),p(6,"Number"),i(),n(7,"div",33),p(8,"Reference"),i()())}function _s(t,r){if(t&1&&(n(0,"div",10)(1,"div",34),p(2),v(3,"limitTo"),i(),n(4,"div",35),p(5),v(6,"date"),i(),n(7,"div",36),p(8),i(),n(9,"div",36),p(10),i()()),t&2){let e=r.item;l(2),D(" ",P(3,4,e.OutletName,25)," "),l(3),D(" ",P(6,7,e.Date,"dd MMM yyyy")," "),l(3),D(" ",e.Number," "),l(2),D(" ",e.ReferenceNumber," ")}}function fs(t,r){if(t&1){let e=b();n(0,"ng-select",28),v(1,"async"),g("change",function(o){d(e);let c=s(5);return u(c.findSalesOrderAutoComplete(o))}),_(2,us,9,0,"ng-template",29)(3,_s,11,10,"ng-template",30),i()}if(t&2){let e=s(5);m("items",E(1,4,e.orders$))("typeahead",e.orderInput$)("ngModel",e.selectedSOID)("readonly",e.isEdit||e.isPO)}}function gs(t,r){if(t&1&&_(0,fs,4,6,"ng-select",27),t&2){let e=s(4);m("ngIf",!(e.isEdit||e.isPO))}}function Cs(t,r){if(t&1){let e=b();n(0,"div",19)(1,"autocompleteV2",37),g("onSelect",function(o){d(e);let c=s(4);return u(c.getUnfulfilledInvoices(o))}),i()()}if(t&2){let e=s(4);l(),m("inputTextValue",e.customerName)}}function vs(t,r){if(t&1){let e=b();n(0,"div",19)(1,"autocompleteV2",38),g("onInputEnter",function(o){d(e);let c=s(4);return u(c.scanUnfullfilledOrders(o))}),i()()}if(t&2){let e=s(4);l(),m("inputTextValue",e.scanResultUnfulfilledOrder())}}function ys(t,r){t&1&&(n(0,"div",10)(1,"div",40),p(2,"Outlet"),i(),n(3,"div",34),p(4,"Date"),i(),n(5,"div",41),p(6,"Number"),i()())}function xs(t,r){if(t&1&&(n(0,"div",10)(1,"div",40),p(2),v(3,"limitTo"),i(),n(4,"div",34),p(5),v(6,"date"),i(),n(7,"div",42),p(8),i()()),t&2){let e=r.item;l(2),D(" ",P(3,3,e.EntityName,25)," "),l(3),D(" ",P(6,6,e.Date,"dd MMM yyyy")," "),l(3),D(" ",e.Number," ")}}function Ss(t,r){if(t&1){let e=b();n(0,"div")(1,"ng-select",39),g("change",function(o){d(e);let c=s(4);return u(c.findSalesOrderByCustomer(o))}),_(2,ys,7,0,"ng-template",29)(3,xs,9,9,"ng-template",30),i()()}if(t&2){let e=s(4);l(),m("items",e.unfulfilledInvoices)}}function hs(t,r){if(t&1&&(n(0,"div",14)(1,"div",15)(2,"h2"),f(3,"i",16),p(4,"Choose Order"),i(),_(5,ds,8,3,"ng-container",2),i(),n(6,"div",17),_(7,gs,1,1,"ng-select",18)(8,Cs,2,1,"div",19)(9,vs,2,1,"div",19)(10,Ss,4,1,"div",2),i()()),t&2){let e=s(3);l(5),m("ngIf",!e.isEdit&&!e.isPO),l(2),Xe(e.searchLogisticType=="invoice"?7:e.searchLogisticType=="customer"?8:9),l(3),m("ngIf",e.unfulfilledInvoices.length>0&&e.searchLogisticType=="customer")}}function bs(t,r){if(t&1&&(n(0,"a",45),p(1),i()),t&2){let e=s(4);m("routerLink",N(3,ls))("queryParams",M(4,ro,e.deliveryData==null||e.deliveryData.SalesOrder==null?null:e.deliveryData.SalesOrder.ID)),l(),D(" ",e.deliveryData==null||e.deliveryData.SalesOrder==null?null:e.deliveryData.SalesOrder.Number," ")}}function Ds(t,r){if(t&1&&(n(0,"tr")(1,"th",46),p(2,"Ref. Number"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(4);l(6),D(" ",e.deliveryData==null||e.deliveryData.SalesOrder==null?null:e.deliveryData.SalesOrder.ReferenceNumber," ")}}function Is(t,r){if(t&1&&(n(0,"div",14)(1,"div",15)(2,"h2"),f(3,"i",16),p(4,"Sales Order"),i()(),n(5,"div",17)(6,"table",43)(7,"tr")(8,"th",44),p(9,"Outlet"),i(),n(10,"td"),p(11,":"),i(),n(12,"td"),p(13),i()(),n(14,"tr")(15,"th",44),p(16,"Number"),i(),n(17,"td"),p(18,":"),i(),n(19,"td"),_(20,bs,2,6,"a",45),i()(),n(21,"tr")(22,"th",44),p(23,"Date"),i(),n(24,"td"),p(25,":"),i(),n(26,"td"),p(27),v(28,"date"),i()(),_(29,Ds,7,1,"tr",2),i()()()),t&2){let e=s(3);l(13),I(e.deliveryData==null||e.deliveryData.SalesOrder==null?null:e.deliveryData.SalesOrder.EntityName),l(7),Xe(!(e.deliveryData==null||e.deliveryData.SalesOrder==null)&&e.deliveryData.SalesOrder.Number?20:-1),l(7),D(" ",P(28,4,e.deliveryData==null||e.deliveryData.SalesOrder==null?null:e.deliveryData.SalesOrder.Date,"dd MMM yyyy")," "),l(2),m("ngIf",e.deliveryData==null||e.deliveryData.SalesOrder==null?null:e.deliveryData.SalesOrder.ReferenceNumber)}}function Ts(t,r){if(t&1&&(n(0,"tr")(1,"th",49),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(4);l(6),I(e.deliveryData.Customer.Mobile)}}function ws(t,r){if(t&1&&(n(0,"tr")(1,"th",49),p(2,"City"),i(),n(3,"td"),p(4,":"),i(),f(5,"td",50),i()),t&2){let e=s(4);l(5),m("innerHTML",e.deliveryData.Customer.Address,j)}}function Os(t,r){if(t&1&&(n(0,"div",14)(1,"div",47)(2,"h2"),f(3,"i",48),p(4,"Customer"),i()(),n(5,"div",17)(6,"table",43)(7,"tr")(8,"th",49),p(9,"Name"),i(),n(10,"td"),p(11,":"),i(),n(12,"td")(13,"a",45),p(14),i()()(),_(15,Ts,7,1,"tr",2)(16,ws,6,1,"tr",2),i()()()),t&2){let e=s(3);l(13),m("routerLink",N(5,ps))("queryParams",M(6,ro,e.deliveryData.Customer.ID)),l(),I(e.deliveryData.Customer.Name),l(),m("ngIf",e.deliveryData.Customer.Mobile),l(),m("ngIf",e.deliveryData.Customer.Address)}}function Es(t,r){if(t&1&&(n(0,"tr")(1,"th",49),p(2,"Name"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(4);l(6),I(e.deliveryData.Recipient.Name)}}function Ms(t,r){if(t&1&&(n(0,"tr")(1,"th",49),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(4);l(6),I(e.deliveryData.Recipient.Phone)}}function Ps(t,r){if(t&1&&(n(0,"tr")(1,"th",49),p(2,"City"),i(),n(3,"td"),p(4,":"),i(),f(5,"td",50),i()),t&2){let e=s(4);l(5),m("innerHTML",e.deliveryData.Recipient.Address,j)}}function Fs(t,r){if(t&1&&(n(0,"tr")(1,"th",49),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(4);l(6),I(e.deliveryData.Recipient.City)}}function Vs(t,r){if(t&1&&(n(0,"div",14)(1,"div",47)(2,"h2"),f(3,"i",48),p(4,"Recipient"),i()(),n(5,"div",17)(6,"table",43),_(7,Es,7,1,"tr",2)(8,Ms,7,1,"tr",2)(9,Ps,6,1,"tr",2)(10,Fs,7,1,"tr",2),i()()()),t&2){let e=s(3);l(7),m("ngIf",e.deliveryData.Recipient.Name),l(),m("ngIf",e.deliveryData.Recipient.Phone),l(),m("ngIf",e.deliveryData.Recipient.Address),l(),m("ngIf",e.deliveryData.Recipient.City)}}function Ns(t,r){if(t&1&&(p(0),v(1,"limitTo")),t&2){let e=r.item;D(" ",P(1,1,e.Name,20)," ")}}function ks(t,r){if(t&1){let e=b();n(0,"div",14)(1,"div",47)(2,"h2"),f(3,"i",51),p(4,"Fulfillment"),i()(),n(5,"div",17)(6,"div",52)(7,"div",49),p(8,"Outlet"),i(),n(9,"div",53),p(10,":"),i(),n(11,"div",54)(12,"ng-select",55),h("ngModelChange",function(o){d(e);let c=s(3);return S(c.form.Header.EntityID,o)||(c.form.Header.EntityID=o),u(o)}),g("ngModelChange",function(o){d(e);let c=s(3);return u(c.onFulfillmentChange(o))}),_(13,Ns,2,4,"ng-template",56),i()()(),n(14,"div",52)(15,"div",49),p(16,"Date"),i(),n(17,"div",53),p(18,":"),i(),n(19,"div",54)(20,"datepicker",57),h("dateChange",function(o){d(e);let c=s(3);return S(c.form.Header.Date,o)||(c.form.Header.Date=o),u(o)}),i()()(),n(21,"div",52)(22,"div",49),p(23,"Number"),i(),n(24,"div",53),p(25,":"),i(),n(26,"div",54)(27,"input",58),h("ngModelChange",function(o){d(e);let c=s(3);return S(c.form.Header.Number,o)||(c.form.Header.Number=o),u(o)}),i()()(),n(28,"div",52)(29,"div",49),p(30,"Courier"),i(),n(31,"div",53),p(32,":"),i(),n(33,"div",54)(34,"ng-select",59),h("ngModelChange",function(o){d(e);let c=s(3);return S(c.form.Header.CourierID,o)||(c.form.Header.CourierID=o),u(o)}),i()()()()()}if(t&2){let e=s(3);l(12),Nt("diff",e.form.Header.EntityID!=e.deliveryData.SalesOrder.EntityID),m("readonly",e.isEdit&&!e.isPO)("items",e.storage.Entities),x("ngModel",e.form.Header.EntityID),l(8),m("isFloatingLabel",!1),x("date",e.form.Header.Date),l(7),x("ngModel",e.form.Header.Number),l(7),m("items",e.storage.Courier),x("ngModel",e.form.Header.CourierID)}}function Ls(t,r){if(t&1){let e=b();n(0,"div",60)(1,"div",14)(2,"POS-products-delivery-list",61),g("eventImport",function(){d(e);let o=s(3);return u(o.onImportItems())}),i()(),n(3,"div",14),f(4,"POS-tinymce-note",62),i()()}if(t&2){let e=s(3);l(2),m("isEdit",e.isEdit)("isDeliveryPacking",e.isDeliveryPacking)("cartItems",e.cartItems)("fulfillmentOutletId",e.form.Header.EntityID),l(2),m("form",e.form)}}function Rs(t,r){if(t&1&&(n(0,"div",9)(1,"div",10)(2,"div",11),_(3,hs,11,3,"div",12)(4,Is,30,7,"div",12)(5,Os,17,8,"div",12)(6,Vs,11,4,"div",12)(7,ks,35,10,"div",12),i(),_(8,Ls,5,5,"div",13),i()()),t&2){let e=s(2);l(3),m("ngIf",!(e.isEdit||e.isPO)),l(),m("ngIf",e.deliveryData),l(),m("ngIf",e.deliveryData==null||e.deliveryData.Customer==null?null:e.deliveryData.Customer.ID),l(),m("ngIf",e.deliveryData==null||e.deliveryData.Recipient==null?null:e.deliveryData.Recipient.ID),l(),m("ngIf",e.deliveryData),l(),m("ngIf",e.deliveryData)}}function As(t,r){if(t&1){let e=b();n(0,"div",9)(1,"POS-complete-customer-supplier",63),g("undo",function(o){d(e);let c=s(2);return u(c.undo(o))})("newForm",function(){d(e);let o=s(2);return u(o.newForm())}),i()()}if(t&2){let e=s(2);l(),m("afterSubmitData",e.afterSubmitData)("items",e.form.Items)}}function Bs(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",1),g("barcodeQueryChange",function(o){d(e);let c=s();return u(c.onScanBarcode(o))}),n(1,"actions"),_(2,ss,5,3,"ng-container",2),i(),n(3,"content"),_(4,Rs,9,6,"div",3)(5,As,2,2,"div",3),i()()}if(t&2){let e=s();m("pageData",e.menuData)("showBarcodeScanner",e.deliveryData&&!e.isComplete)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),m("ngIf",!e.isComplete),l(2),m("ngIf",!e.isComplete),l(),m("ngIf",e.isComplete)}}var bn=class t extends qt{constructor(e,a,o,c,w,H,ie,Ue){super(e,a,"OutboundLogisticsLoader/GetStorage",o);this.productService=c;this.formService=w;this.productHttpService=H;this.dialog=ie;this.datePipe=Ue;this.form={Header:{},Items:[]},this.searchLogisticType="invoice"}outboundLogisticsService=y(Sn);storage;deliveryData;isEdit;form;param;isDeliveryPacking;configBarcodeCount;orderInvoice;isComplete;afterSubmitData;isPO;searchLogisticType;orderInput$=new be;orders$;cartItemSource;selectedSOID;scanResultUnfulfilledOrder=vt(null);customerName;unfulfilledInvoices=[];handleF8(){this.isComplete&&this.newForm()}initializeFormState(){this.param=this.route.snapshot.queryParams,T.IsEmpty(this.param.POID)&&T.IsEmpty(this.param.ID)?(this.isEdit=!1,this.initOrderNumberOptions()):T.IsNotEmpty(this.param.POID)?(this.isPO=!0,this.getDeliveryItems(this.param.POID)):(this.isEdit=!0,this.isPO=!1,this.getDeliveryItems(this.param.ID))}initOrderNumberOptions(){this.orders$=this.orderInput$.pipe(L(e=>e!=null&&(e==""||e.length>=3)),_o(),uo(500),ze(""),Q(e=>this.outboundLogisticsService.getUnfulfilledOrderByNumber(e)))}scanUnfullfilledOrders(e){this.outboundLogisticsService.getUnfulfilledOrderByNumberOrReferenceNumber(e).pipe(q(a=>{this.formatOrderScanresult(a)})).subscribe({next:this.bindDeliveryData(),error:a=>{this.scanResultUnfulfilledOrder.set(null)}})}formatOrderScanresult(e){let a=e?.SalesOrder.EntityName,o=e?.SalesOrder.Date?new Date(e?.SalesOrder.Date):null,c=e?.SalesOrder.ReferenceNumber?`- ${e?.SalesOrder.ReferenceNumber}`:"",w=e?.SalesOrder.Number?`- ${e?.SalesOrder.Number}`:"",H=o?`- ${this.datePipe.transform(o,"dd MMM yyyy")}`:"",ie=`${a} ${H} ${w} ${c}`;this.scanResultUnfulfilledOrder.set(ie)}initOrderNumberOnEdit(){if(this.isEdit||this.isPO){let e={ID:this.deliveryData.SalesOrder.ID,Display:`${this.deliveryData.SalesOrder.Number} - ${this.deliveryData.SalesOrder.EntityName} - ${this.deliveryData.SalesOrder.Date}`};this.orders$=Ct([e]),this.selectedSOID=e.ID}}postBindForm(e){this.storage=e,this.isDeliveryPacking=e.AppConfigJSON.DeliveryPacking,this.configBarcodeCount=e.AppConfigJSON.ModuleDelivery.CustomerDelivery.QtyCount,this.initializeFormState(),!this.isEdit&&!this.isPO&&this.setFocusToAutoComplete()}setFocusToAutoComplete(e="customerSearch"){setTimeout(()=>{let a=document.getElementById(e);a&&a.focus()},100)}validate(){if(this.formService.validate(this.cartItems,this.configBarcodeCount,this.isEdit)){this.form.Items=this.formService.convertCartItemsToForm(this.cartItems),this.data.Form=this.form,this.isEdit&&(this.data.Form.Mode=1);let e=this.form.Header.CourierID;T.IsEmpty(e)&&(this.form.Header.CourierID=T.GuidEmpty),this.onSubmit("OutDelivery/SubmitOrder")}}findSalesOrderByCustomer(e){T.IsNotEmpty(e.ID)&&(this.getDeliveryItems(e.ID),this.scanResultUnfulfilledOrder.set(null))}onTabChange(e){this.setFocusToAutoComplete(e)}findSalesOrderAutoComplete(e){T.IsNotEmpty(e)?(this.getDeliveryItems(e.ID),this.scanResultUnfulfilledOrder.set(null)):this.orderInput$.next("")}getDeliveryItems(e){let a,o;this.isPO||!this.isEdit?(a="GetByPOID",this.form.Header.CustomerPOID=e,o={POID:this.param.POID||e}):(a="GetByID",o={ID:this.param.ID}),this.httpService.post(`/API/OutboundLogisticsLoader/${a}`,o).subscribe({next:this.bindDeliveryData()})}bindDeliveryData(){return e=>{this.deliveryData=e,this.initOrderNumberOnEdit(),T.IsNotEmpty(this.deliveryData.Data)&&(this.productService.formItems=this.deliveryData.Data.Items),this.productService.bindCartItems(e.OrderedItems,e.SentItems,this.isEdit),this.cartItemSource=T.cloneObject(this.productService.cartItems),this.orderInvoice=e.Label,this.isPO||!this.isEdit?(this.form.Header.Number=e.SalesOrder.GenerateDeliveryNumber,this.form.Header.Date=new Date,T.IsEmpty(this.form.Header.EntityID)&&(this.form.Header.EntityID=e.SalesOrder.EntityID),this.form.Header.Note=e.SalesOrder.Note,this.assignDefaultWarehouse(e.DefaultWarehouse)):(T.IsNotEmpty(e.Data?.Header)&&(this.form.Header=e.Data.Header),this.menuData.H=`Editing Outbound #${this.form.Header.Number}`),this.productService.entityID=this.form.Header.EntityID}}onScanBarcode(e){this.productService.onScanBarcode(e)}get cartItems(){return this.productService.cartItems}newForm(){this.formService.newForm("Outbound_Logistics")}onSubmitSuccess(e){this.isComplete=!0,this.afterSubmitData=e}undo(e){this.formService.undo(e,"Outbound_Logistics")}assignDefaultWarehouse(e){let a=this.storage.Entities.find(o=>o.ID==e);T.IsNotEmpty(a)&&(this.form.Header.EntityID=a.ID)}getUnfulfilledInvoices(e){this.httpService.post("/API/OutDelivery/GetUnfulfilledOrdersByCustomerID",{id:e}).subscribe(a=>{this.unfulfilledInvoices=a,this.scanResultUnfulfilledOrder.set(null)})}onFulfillmentChange(e){let a=this.cartItems.map(o=>o.VariantID);T.IsNotEmpty(e)&&a.length>0&&this.productHttpService.getSerialByVarianIds(e,a).subscribe(o=>{this.updateSerialItem(o)})}updateSerialItem(e){let a=[],o=T.cloneObject(this.cartItemSource);this.productService.cartItems=o.map(c=>(c.TypeID==4&&(a=e.find(w=>w.VariantID==c.VariantID)?.Serial,a&&(c.Serial=this.filterSerialBySelectedSerial(c.Serial,a),c.Serial=this.setSerialQuantity(c))),c))}filterSerialBySelectedSerial(e=[],a){let o;return a.filter(w=>(o=e.findIndex(H=>H.Number==w.Number),o!==-1))}setSerialQuantity(e){let a=e.serialSources,o=e.Serial,c;return o=o.map(w=>(c=a.findIndex(H=>H.Number==w.Number),c!==-1&&(w.Quantity=w.Quantity<a[c].Quantity?w.Quantity:a[c].Quantity),w)),o}onImportItems(){this.dialog.open(pi,{data:{title:"Import Products"}}).afterClosed().pipe(L(e=>T.IsNotEmpty(e))).subscribe(e=>{this.formService.toastrShowToastrNotFoundItems(e,this.cartItems),this.productService.cartItems=this.formService.mappingItemWithCsv(e,this.cartItems)})}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(pe),C(zt),C(mi),C($i),C(A),C(he))};static \u0275cmp=O({type:t,selectors:[["POS-outbound-logistics-form"]],hostBindings:function(a,o){a&1&&g("keydown.F8",function(w){return o.handleF8(w)},!1,ti)},standalone:!1,features:[re],decls:1,vars:1,consts:[[3,"pageData","showBarcodeScanner","hideSearchDropdown","hideSearchBox","barcodeQueryChange",4,"ngIf"],[3,"barcodeQueryChange","pageData","showBarcodeScanner","hideSearchDropdown","hideSearchBox"],[4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"routerLink",4,"ngIf"],[1,"btn","btn-success","ms-5",3,"click"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-xs-12","col-md-5","col-lg-12","col-xl-5","col-sm-12","sales-order"],["class","card",4,"ngIf"],["class","col-xs-12 col-md-7 col-lg-12 col-xl-7 col-sm-12",4,"ngIf"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],[1,"fa-solid","fa-receipt","me-5"],[1,"card-body"],["bindLabel","Display","bindValue","Key","placeholder","Invoice Number",1,"orders-search",3,"items","typeahead","ngModel","readonly"],[1,"form-floating-outline","my-0"],["name","fontStyle","aria-label","Font Style",2,"height","30px"],["matTooltipPosition","above","matTooltip","Search by Invoice Number",1,"w-100","toggle-search",3,"click","checked"],[1,"fa-solid","fa-hashtag"],["matTooltipPosition","above","matTooltip","Search by Customer",1,"w-100","toggle-search",3,"click","checked"],[1,"fa-solid","fa-address-book"],["matTooltipPosition","above","matTooltip","Scan Invoice / Packing Slip Barcode",1,"w-100","toggle-search",3,"click","checked"],[1,"fa-solid","fa-scanner-gun"],["class","orders-search","bindLabel","Display","bindValue","Key","placeholder","Invoice Number",3,"items","typeahead","ngModel","readonly","change",4,"ngIf"],["bindLabel","Display","bindValue","Key","placeholder","Invoice Number",1,"orders-search",3,"change","items","typeahead","ngModel","readonly"],["ng-header-tmp",""],["ng-option-tmp",""],[1,"col-3","fw-bold"],[1,"col-2","fw-bold","px-2"],[1,"col-3","fw-bold","px-2"],[1,"col-3"],[1,"col-2","px-2"],[1,"col-3","px-2"],["inputID","customerSearch","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Customer Name","notFoundMessageFor","customer",1,"w-100",3,"onSelect","inputTextValue"],["inputID","numberSearch","placeholder","Scan Order Here","notFoundMessageFor","order",1,"w-100",3,"onInputEnter","inputTextValue"],["appendTo","body","bindLabel","Number","bindValue","Key",1,"custom-panel-dropdown",3,"change","items"],[1,"col-5"],[1,"col-4"],[1,"col-4","text-wrap"],[1,"table-sm","table-borderless"],[2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],[2,"width","80px"],[1,"card-header"],[1,"fa-solid","fa-address-card","me-5"],[2,"width","55px"],[3,"innerHTML"],[1,"fa-solid","fa-truck","me-5"],[1,"d-flex","align-items-center","justify-content-between","w-100","mb-3"],[1,"me-2",2,"width","5px"],[1,"w-100"],["bindLabel","Name","bindValue","ID",1,"p-0",3,"ngModelChange","readonly","items","ngModel"],["ng-label-tmp",""],["appearance","outline",1,"p-0",3,"dateChange","isFloatingLabel","date"],["type","text",1,"form-control","ps-4",2,"height","35px !important","width","100%",3,"ngModelChange","ngModel"],["placeholder","Select Courier","bindLabel","Name","bindValue","ID",1,"p-0",3,"ngModelChange","items","ngModel"],[1,"col-xs-12","col-md-7","col-lg-12","col-xl-7","col-sm-12"],["state","Outbound_Logistics",3,"eventImport","isEdit","isDeliveryPacking","cartItems","fulfillmentOutletId"],[3,"form"],["state","Outbound",3,"undo","newForm","afterSubmitData","items"]],template:function(a,o){a&1&&_(0,Bs,6,7,"mainpanel-cmp",0),a&2&&m("ngIf",o.storage)},dependencies:[B,G,Ce,R,W,oe,de,We,Ee,ki,Li,ke,Ai,Bi,ci,si,di,rt,he,Hi],styles:["datepicker[_ngcontent-%COMP%] div.mat-mdc-text-field-wrapper{padding-bottom:0!important}autocompleteV2[_ngcontent-%COMP%] input{font-size:12px;height:36px} mat-button-toggle.toggle-search>button>span.mat-button-toggle-label-content{line-height:30px!important} .diff .ng-select-container{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important} .mat-button-toggle-checkbox-wrapper{display:none!important} .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0!important}.orders-search[_ngcontent-%COMP%] .ng-dropdown-panel{width:45vw}"]})};var Ws=()=>["/menu/Logistics/Archive/Inbound_Logistics/Info"],Ur=t=>({ID:t}),Hs=()=>["/menu/Logistics/Archive/Inbound_Logistics"],js=()=>["/menu/Contacts/Contact/Suppliers/Info"];function Qs(t,r){if(t&1&&(n(0,"a",8),p(1,"Cancel"),i()),t&2){let e=s(3);m("routerLink",N(2,Ws))("queryParams",M(3,Ur,e.param.ID||e.param.POID))}}function qs(t,r){t&1&&(n(0,"a",9),p(1,"Cancel"),i()),t&2&&m("routerLink",N(1,Hs))}function Us(t,r){if(t&1){let e=b();z(0),_(1,Qs,2,5,"a",5)(2,qs,2,2,"a",6),n(3,"button",7),g("click",function(){d(e);let o=s(2);return u(o.validate())}),p(4),i(),$()}if(t&2){let e=s(2);l(),m("ngIf",e.isEdit),l(),m("ngIf",!e.isEdit),l(2),I(e.isEdit?"Save":"Add")}}function zs(t,r){if(t&1){let e=b();z(0),n(1,"mat-button-toggle-group",20)(2,"mat-button-toggle",21),g("click",function(){d(e);let o=s(3);return u(o.searchLogisticType="invoice")}),f(3,"i",22),i(),n(4,"mat-button-toggle",23),g("click",function(){d(e);let o=s(3);return u(o.searchLogisticType="customer")}),f(5,"i",24),i()(),$()}if(t&2){let e=s(3);l(2),m("checked",e.searchLogisticType=="invoice"),l(2),m("checked",e.searchLogisticType=="customer")}}function $s(t,r){if(t&1){let e=b();z(0),n(1,"div",25)(2,"autocompleteV2",26),g("onSelect",function(o){d(e);let c=s(3);return u(c.getDeliveryItems(o))}),i()(),$()}if(t&2){let e=s(3);l(2),m("inputTextValue",e.orderInvoice)}}function Gs(t,r){if(t&1){let e=b();n(0,"div",25)(1,"autocompleteV2",27),g("onSelect",function(o){d(e);let c=s(3);return u(c.getUnfulfilledInvoices(o))}),i()()}}function Ks(t,r){t&1&&(n(0,"div",11)(1,"div",31),p(2," Outlet "),i(),n(3,"div",32),p(4," Date "),i(),n(5,"div",33),p(6," Number "),i()())}function Js(t,r){if(t&1&&(n(0,"div",11)(1,"div",31),p(2),v(3,"limitTo"),i(),n(4,"div",32),p(5),v(6,"date"),i(),n(7,"div",34),p(8),i()()),t&2){let e=r.item;l(2),D(" ",P(3,3,e.EntityName,25)," "),l(3),D(" ",P(6,6,e.Date,"dd MMM yyyy")," "),l(3),D(" ",e.Number," ")}}function Ys(t,r){if(t&1){let e=b();n(0,"div")(1,"ng-select",28),g("change",function(o){d(e);let c=s(3);return u(c.findSalesOrderByCustomer(o))}),_(2,Ks,7,0,"ng-template",29)(3,Js,9,9,"ng-template",30),i()()}if(t&2){let e=s(3);l(),m("items",e.unfulfilledInvoices)}}function Xs(t,r){if(t&1&&(n(0,"tr")(1,"th",38),p(2,"Name"),i(),n(3,"td"),p(4,":"),i(),n(5,"td")(6,"a",39),p(7),i()()()),t&2){let e=s(4);l(6),m("routerLink",N(3,js))("queryParams",M(4,Ur,e.deliveryData.SupplierContact.ID)),l(),D(" ",e.deliveryData==null?null:e.deliveryData.SupplierContact.Name," ")}}function Zs(t,r){if(t&1&&(n(0,"tr")(1,"th",38),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(4);l(6),I(e.deliveryData==null?null:e.deliveryData.SupplierContact.Phone)}}function ed(t,r){if(t&1&&(n(0,"tr")(1,"th",38),p(2,"City"),i(),n(3,"td"),p(4,":"),i(),f(5,"td",40),i()),t&2){let e=s(4);l(5),m("innerHTML",e.deliveryData==null?null:e.deliveryData.SupplierContact.Address,j)}}function td(t,r){if(t&1&&(n(0,"div",13)(1,"div",35)(2,"h2"),f(3,"i",36),p(4,"Supplier "),i()(),n(5,"div",16)(6,"table",37),_(7,Xs,8,6,"tr",3)(8,Zs,7,1,"tr",3)(9,ed,6,1,"tr",3),i()()()),t&2){let e=s(3);l(7),m("ngIf",e.deliveryData==null?null:e.deliveryData.SupplierContact.Name),l(),m("ngIf",e.deliveryData==null?null:e.deliveryData.SupplierContact.Phone),l(),m("ngIf",e.deliveryData==null?null:e.deliveryData.SupplierContact.Address)}}function id(t,r){if(t&1){let e=b();n(0,"div",13)(1,"div",35)(2,"h2"),f(3,"i",41),p(4,"Fulfillment "),i()(),n(5,"div",16)(6,"div",42)(7,"div",38),p(8,"Outlet"),i(),n(9,"div",43),p(10,":"),i(),n(11,"div",44)(12,"ng-select",45),h("ngModelChange",function(o){d(e);let c=s(3);return S(c.form.Header.EntityID,o)||(c.form.Header.EntityID=o),u(o)}),i()()(),n(13,"div",42)(14,"div",38),p(15,"Date"),i(),n(16,"div",43),p(17,":"),i(),n(18,"div",44)(19,"datepicker",46),h("dateChange",function(o){d(e);let c=s(3);return S(c.form.Header.Date,o)||(c.form.Header.Date=o),u(o)}),i()()(),n(20,"div",42)(21,"div",38),p(22,"Number"),i(),n(23,"div",43),p(24,":"),i(),n(25,"div",44)(26,"input",47),h("ngModelChange",function(o){d(e);let c=s(3);return S(c.form.Header.Number,o)||(c.form.Header.Number=o),u(o)}),i()()(),n(27,"div",48)(28,"div",38),p(29,"Courier"),i(),n(30,"div",43),p(31,":"),i(),n(32,"div",44)(33,"ng-select",49),h("ngModelChange",function(o){d(e);let c=s(3);return S(c.form.Header.CourierID,o)||(c.form.Header.CourierID=o),u(o)}),i()()()()()}if(t&2){let e=s(3);l(12),m("readonly",e.isEdit&&!e.isPO)("items",e.storage.Entities),x("ngModel",e.form.Header.EntityID),l(7),m("isFloatingLabel",!1),x("date",e.form.Header.Date),l(7),x("ngModel",e.form.Header.Number),l(7),m("items",e.storage.Courier),x("ngModel",e.form.Header.CourierID)}}function nd(t,r){if(t&1){let e=b();n(0,"div",50)(1,"div",13)(2,"POS-products-delivery-list",51),g("eventImport",function(){d(e);let o=s(3);return u(o.onImport())}),i()(),n(3,"div",13),f(4,"POS-tinymce-note",52),i()()}if(t&2){let e=s(3);l(2),m("isEdit",e.isEdit)("cartItems",e.cartItems),l(2),m("form",e.form)}}function od(t,r){if(t&1&&(n(0,"div",10)(1,"div",11)(2,"div",12)(3,"div",13)(4,"div",14)(5,"h2"),f(6,"i",15),p(7,"Purchase Order "),i(),_(8,zs,6,2,"ng-container",3),i(),n(9,"div",16),_(10,$s,3,1,"ng-container",17)(11,Gs,2,0,"ng-template",null,0,Z)(13,Ys,4,1,"div",3),i()(),_(14,td,10,3,"div",18)(15,id,34,8,"div",18),i(),_(16,nd,5,3,"div",19),i()()),t&2){let e=we(12),a=s(2);l(8),m("ngIf",!a.isEdit&&!a.isPO),l(2),m("ngIf",a.searchLogisticType=="invoice")("ngIfElse",e),l(3),m("ngIf",a.unfulfilledInvoices.length>0&&a.searchLogisticType=="customer"),l(),m("ngIf",a.deliveryData==null||a.deliveryData.SupplierContact==null?null:a.deliveryData.SupplierContact.ID),l(),m("ngIf",a.deliveryData),l(),m("ngIf",a.deliveryData)}}function rd(t,r){if(t&1){let e=b();n(0,"div",10)(1,"POS-complete-customer-supplier",53),g("undo",function(o){d(e);let c=s(2);return u(c.undo(o))})("newForm",function(){d(e);let o=s(2);return u(o.newForm())}),i()()}if(t&2){let e=s(2);l(),m("afterSubmitData",e.afterSubmitData)("items",e.form.Items)}}function ad(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),g("barcodeQueryChange",function(o){d(e);let c=s();return u(c.onScanBarcode(o))}),n(1,"actions"),_(2,Us,5,3,"ng-container",3),i(),n(3,"content"),_(4,od,17,7,"div",4)(5,rd,2,2,"div",4),i()()}if(t&2){let e=s();m("pageData",e.menuData)("showBarcodeScanner",e.deliveryData&&!e.isComplete)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),m("ngIf",!e.isComplete),l(2),m("ngIf",!e.isComplete),l(),m("ngIf",e.isComplete)}}var Dn=class t extends qt{constructor(e,a,o,c,w,H){super(e,a,"InboundLogisticsLoader/GetStorage",o);this.productService=c;this.formService=w;this.dialog=H;this.form={Header:{},Items:[]}}toastr=y(ee);searchLogisticType="invoice";unfulfilledInvoices=[];storage;deliveryData;isEdit;form;param;configBarcodeCount;orderInvoice;isComplete;afterSubmitData;isPO;initializeFormState(){this.param=this.route.snapshot.queryParams,T.IsEmpty(this.param.POID)&&T.IsEmpty(this.param.ID)?this.isEdit=!1:T.IsNotEmpty(this.param.POID)?(this.isPO=!0,this.getDeliveryItems(this.param.POID)):(this.isPO=!1,this.isEdit=!0,this.getDeliveryItems(this.param.ID))}postBindForm(e){this.storage=e,this.productService.formItems=this.storage.Data?.Items,this.configBarcodeCount=e.AppConfigJSON.ModuleDelivery.CustomerDelivery.InBoundQtyCount,this.initializeFormState(),!this.isEdit&&!this.isPO&&this.setFocusToAutoComplete()}setFocusToAutoComplete(){setTimeout(()=>{let e=document.getElementById("orderNumber");e&&e.focus()},100)}findSalesOrderByCustomer(e){T.IsNotEmpty(e.ID)&&this.getDeliveryItems(e.ID)}getDeliveryItems(e){let a,o;this.isPO||!this.isEdit?(a="GetByPOID",this.form.Header.PurchaseOrderID=e,o={POID:this.param.POID||e}):(a="GetByID",o={ID:this.param.ID}),this.httpService.post(`/API/InDelivery/${a}`,o).subscribe({next:this.bindDeliveryData()})}bindDeliveryData(){return e=>{this.deliveryData=e,T.IsNotEmpty(this.deliveryData.Data)&&(this.productService.formItems=this.deliveryData.Data.Items),this.productService.bindCartItems(e.PurchasedItems,e.SentItems,this.isEdit),this.orderInvoice=e.Label,this.isPO||!this.isEdit?(this.form.Header.Number=e.PO.Number,this.form.Header.Date=new Date().toJSON(),T.IsEmpty(this.form.Header.EntityID)&&(this.form.Header.EntityID=e.PO.EntityID),this.form.Header.Note=e.PO.Note,this.assignDefaultWarehouse(e.DefaultWarehouse)):(T.IsNotEmpty(e.Data?.Header)&&(this.form.Header=e.Data.Header),this.menuData.H=`Editing Inbound #${this.form.Header.Number}`)}}assignDefaultWarehouse(e){let a=this.storage.Entities.find(o=>o.ID==e);T.IsNotEmpty(a)&&(this.form.Header.EntityID=a.ID)}get cartItems(){return this.productService.cartItems}onScanBarcode(e){this.productService.onScanBarcode(e)}validate(){this.formService.validate(this.cartItems,this.configBarcodeCount,this.isEdit)&&(this.form.Items=this.formService.convertCartItemsToForm(this.cartItems),this.data.Form=this.form,this.isEdit&&(this.data.Form.Mode=1),this.onSubmit("InDelivery/SubmitOrder"))}newForm(){this.formService.newForm("Inbound_Logistics")}onSubmitSuccess(e){this.isComplete=!0,this.afterSubmitData=e}undo(e){this.formService.undo(e,"Inbound_Logistics")}onImport(){this.dialog.open(pi,{data:{title:"Import Products"}}).afterClosed().pipe(L(e=>T.IsNotEmpty(e))).subscribe(e=>{this.formService.toastrShowToastrNotFoundItems(e,this.cartItems),this.productService.cartItems=this.formService.mappingItemWithCsv(e,this.cartItems)})}getUnfulfilledInvoices(e){this.httpService.post("/API/InboundLogistics/GetUnfulfilledOrdersBySupplierID",{ID:e}).subscribe(a=>this.unfulfilledInvoices=a)}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(pe),C(zt),C(mi),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-inbound-logistics-form"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["CUSTOMER",""],[3,"pageData","showBarcodeScanner","hideSearchDropdown","hideSearchBox","barcodeQueryChange",4,"ngIf"],[3,"barcodeQueryChange","pageData","showBarcodeScanner","hideSearchDropdown","hideSearchBox"],[4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"routerLink",4,"ngIf"],[1,"btn","btn-success","ms-5",3,"click"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-xs-12","col-md-4","col-lg-12","col-xl-4","col-sm-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],[1,"fa-solid","fa-receipt","me-5"],[1,"card-body"],[4,"ngIf","ngIfElse"],["class","card",4,"ngIf"],["class","col-xs-12 col-md-8 col-lg-12 col-xl-8 col-sm-12",4,"ngIf"],["name","fontStyle","aria-label","Font Style",2,"height","30px"],["matTooltipPosition","above","matTooltip","Search by Invoice Number",1,"w-100","toggle-search",3,"click","checked"],[1,"fa-solid","fa-hashtag"],["matTooltipPosition","above","matTooltip","Search by Supplier",1,"w-100","toggle-search",3,"click","checked"],[1,"fa-solid","fa-address-book"],[1,"form-floating-outline"],["inputID","orderNumber","requestUrl","/API/AC/SearchBillOrderByNumber","placeholder","Invoice Number",1,"w-100",3,"onSelect","inputTextValue"],["inputID","customerName","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Supplier Name","notFoundMessageFor","supplier",1,"w-100",3,"onSelect"],["appendTo","body","bindLabel","Number","bindValue","Key",1,"custom-panel-dropdown",3,"change","items"],["ng-header-tmp",""],["ng-option-tmp",""],[1,"col-5"],[1,"col-3"],[1,"col-4"],[1,"col-4","text-wrap"],[1,"card-header"],[1,"fa-solid","fa-address-card","me-5"],[1,"table-sm","table-borderless"],[2,"width","55px"],["target","_blank",3,"routerLink","queryParams"],[3,"innerHTML"],[1,"fa-solid","fa-truck","me-5"],[1,"d-flex","align-items-center","justify-content-between","w-100","mb-3"],[1,"me-2",2,"width","5px"],[1,"w-100"],["bindLabel","Name","bindValue","ID",3,"ngModelChange","readonly","items","ngModel"],["appearance","outline",3,"dateChange","isFloatingLabel","date"],["type","text",1,"form-control","ps-4",2,"height","35px !important",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","justify-content-between","w-100"],["bindLabel","Name","bindValue","ID",3,"ngModelChange","items","ngModel"],[1,"col-xs-12","col-md-8","col-lg-12","col-xl-8","col-sm-12"],["state","Inbound_Logistics",3,"eventImport","isEdit","cartItems"],[3,"form"],["state","Inbound",3,"undo","newForm","afterSubmitData","items"]],template:function(a,o){a&1&&_(0,ad,6,7,"mainpanel-cmp",1),a&2&&m("ngIf",o.storage)},dependencies:[B,G,Ce,R,W,oe,de,We,Ee,ki,Li,ke,Ai,Bi,ci,si,di,he,Hi],styles:["datepicker[_ngcontent-%COMP%] div.mat-mdc-text-field-wrapper{padding-bottom:0!important}autocompleteV2[_ngcontent-%COMP%] input{font-size:16px} mat-button-toggle.toggle-search>button>span.mat-button-toggle-label-content{line-height:30px!important}"]})};var zr=t=>({ID:t});function ld(t,r){if(t&1){let e=b();n(0,"button",17),g("click",function(){d(e);let o=s();return u(o.openExportModal())}),f(1,"i",18),p(2," Export"),i()}}function pd(t,r){if(t&1){let e=b();n(0,"div",19)(1,"h6"),p(2,"Outlet"),i(),n(3,"ng-select",20),h("ngModelChange",function(o){d(e);let c=s();return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"Logistics Service"),i(),n(6,"ng-select",21),h("ngModelChange",function(o){d(e);let c=s();return S(c.pageData.Filter.LogisticServiceID,o)||(c.pageData.Filter.LogisticServiceID=o),u(o)}),i(),n(7,"h6"),p(8,"From"),i(),n(9,"div")(10,"datepicker",22),h("dateChange",function(o){d(e);let c=s();return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i()(),n(11,"h6"),p(12,"To"),i(),n(13,"div")(14,"datepicker",23),h("dateChange",function(o){d(e);let c=s();return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i()(),n(15,"h6"),p(16,"Time"),i(),n(17,"div",24)(18,"div",25)(19,"app-timepicker",26),h("timeChange",function(o){d(e);let c=s();return S(c.pageData.Filter.StartTime,o)||(c.pageData.Filter.StartTime=o),u(o)}),i()(),n(20,"div",25)(21,"app-timepicker",26),h("timeChange",function(o){d(e);let c=s();return S(c.pageData.Filter.EndTime,o)||(c.pageData.Filter.EndTime=o),u(o)}),i()()()()}if(t&2){let e=s();l(3),x("ngModel",e.pageData.Filter.EntityID),m("items",e.pageData.Options==null?null:e.pageData.Options.Entities),l(3),x("ngModel",e.pageData.Filter.LogisticServiceID),m("items",e.pageData.Options==null?null:e.pageData.Options.LogisticServices),l(4),x("date",e.pageData.Filter.From),l(4),x("date",e.pageData.Filter.To),l(5),m("fullWidth",!0),x("time",e.pageData.Filter.StartTime),l(2),m("fullWidth",!0),x("time",e.pageData.Filter.EndTime)}}function md(t,r){if(t&1&&(n(0,"li",32),p(1),i()),t&2){let e=r.$implicit;l(),Qe(" ",e.Name," x ",e.VariantUnitQuantity," ")}}function cd(t,r){if(t&1&&(n(0,"tr",27)(1,"td"),p(2),i(),n(3,"td")(4,"a",28),p(5),i()(),n(6,"td"),p(7),i(),n(8,"td")(9,"a",29),p(10),i()(),n(11,"td"),p(12),i(),n(13,"td")(14,"ul",30),_(15,md,2,2,"li",31),i()()()),t&2){let e=r.$implicit;l(2),I(e.OutletName),l(2),m("queryParams",M(8,zr,e.InvoiceID)),l(),I(e.Number),l(2),I(e.LogisticDisplayName),l(2),m("queryParams",M(10,zr,e.CustomerID)),l(),I(e.CustomerName),l(2),I(e.Fulfillment),l(3),m("ngForOf",e.SalesOrderItem)}}function sd(t,r){if(t&1){let e=b();n(0,"span",33),g("click",function(){d(e);let o=s();return u(o.StoreRowsCountAPIResult("SalesReport/LogisticServiceDetailCount"))}),n(1,"i",34),p(2,"?"),i()()}}function dd(t,r){if(t&1&&(n(0,"span"),p(1),v(2,"number"),i()),t&2){let e=s();l(),I(E(2,1,e.listTotal))}}function ud(t,r){if(t&1){let e=b();n(0,"a",35),g("click",function(){d(e);let o=s();return u(o.NextPage(!0))}),f(1,"i",36),p(2," Next"),i()}}function _d(t,r){if(t&1){let e=b();n(0,"a",37),g("click",function(){d(e);let o=s();return u(o.StoreRowsCountAPIResult("SalesReport/LogisticServiceDetailCount",!0))}),f(1,"i",38),p(2," Show All"),i()}}var In=class t extends Ho{constructor(e,a,o,c,w){super(e,a,"SalesReport/LogisticServiceDetail","SalesReportLoader/LogisticServiceDetail",null,o);this.matDialog=c;this.roleService=w}preInitList(){this.pageData.Filter.StartTime=="00:00:00"&&this.pageData.Filter.EndTime=="00:00:00"&&(this.pageData.Filter.EndTime="23:59:59"),this.initTimeFilter()}initTimeFilter(){let e=this.pageData.Filter.StartTime;e=T.IsNotEmpty(e)?e.substring(0,5):null;let a=this.pageData.Filter.EndTime;a=T.IsNotEmpty(a)?a.substring(0,5):null,this.pageData.Filter.StartTime=e,this.pageData.Filter.EndTime=a}postInit(e){this.extendData?(this.infiniteList=this.infiniteList.concat(e.Data),this.postExtendData(e),this.extendData=!1):(this.infiniteList=e.Data,this.assignAggregate(e)),this.nextPageDisabled=!(e.Data.length<this.pageData.Filter.RowCount),this.originalData=e.Data,this.menuData.H=this.data.PageTitle||this.menuData.H,this.afterPostInit(e)}openExportModal(){this.matDialog.open(Ie,{data:{title:"Logistic Service Detail",exportTypes:[{ID:"ReportExport/LogisticServiceDetail",Value:"Default",FileName:"Logistics Service Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"SalesReport/LogisticServiceDetailCount",pagination:!0}})}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(pe),C(A),C(ne))};static \u0275cmp=O({type:t,selectors:[["POS-logistics-service-detail"]],standalone:!1,features:[re],decls:36,vars:14,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","150px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","ngModel","items"],["bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6"],[3,"timeChange","fullWidth","time"],[1,"border-bottom"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],["routerLink","/menu/Contacts/Contact/Customers/Info",3,"queryParams"],[1,"list-inline","m-0"],["class","list-inline-item me-10",4,"ngFor","ngForOf"],[1,"list-inline-item","me-10"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retreive rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(a,o){if(a&1){let c=b();n(0,"mainpanel-cmp",1),h("textChange",function(H){return d(c),S(o.pageData.Filter.Name,H)||(o.pageData.Filter.Name=H),u(H)}),g("onSubmit",function(){return d(c),u(o.searchFromPageOne())}),h("filterChange",function(H){return d(c),S(o.pageData.Filter,H)||(o.pageData.Filter=H),u(H)}),n(1,"actions"),_(2,ld,3,0,"button",2),i(),n(3,"filters"),_(4,pd,22,10,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",3)(8,"table",4)(9,"thead",5)(10,"tr",6)(11,"th"),p(12,"Outlet"),i(),n(13,"th"),p(14,"Number"),i(),n(15,"th"),p(16,"Logistics"),i(),n(17,"th",7),p(18,"Customer"),i(),n(19,"th"),p(20,"Fulfillment"),i(),n(21,"th"),p(22,"Product"),i()()(),n(23,"tbody"),_(24,cd,16,12,"tr",8),i()(),n(25,"div",9)(26,"div",10)(27,"div",11),p(28),v(29,"number"),_(30,sd,3,0,"span",12)(31,dd,3,3,"span",13),p(32),i()(),n(33,"div",14),_(34,ud,3,0,"a",15)(35,_d,3,0,"a",16),i()()()()()}a&2&&(m("pageData",o.menuData),x("text",o.pageData.Filter.Name),m("isFilterOnDropdown",!1),x("filter",o.pageData.Filter),l(2),m("ngIf",o.roleService.global.Export),l(22),m("ngForOf",o.infiniteList),l(4),D(" Showing 1 - ",E(29,12,o.pageData.Filter.RowCount*(o.pageData.Filter.PageNumber-1)+(o.data==null||o.data.Data==null?null:o.data.Data.length))," of "),l(2),m("ngIf",!o.pageData.HideStoreApiCount),l(),m("ngIf",o.pageData.HideStoreApiCount),l(),D(" records ~ ",o.pageData.Filter.PageNumber," Page "),l(2),m("ngIf",o.nextPageDisabled&&!o.goToLast),l(),m("ngIf",o.nextPageDisabled&&!o.goToLast))},dependencies:[J,B,G,R,W,oe,de,Ee,ke,zi,ge],encapsulation:2})};var Re=class t{http=y(k);route=y(pe);loadForm$=this.route.queryParamMap.pipe(Q(r=>this.http.get(`/API/transferorderloader${r.get("ID")?"/"+r.get("ID"):""}/LoadTransferOrderForm`)),lt(1));config$=this.loadForm$.pipe(V(r=>r.AppConfigJSON));deliveryTypes$=this.loadForm$.pipe(V(r=>r.DeliveryTypes));destinations$=this.loadForm$.pipe(V(r=>r.DestinationEntities));outlets$=this.loadForm$.pipe(V(r=>r.Entities));data$=this.loadForm$.pipe(V(r=>r.Data),L(r=>T.IsNotEmpty(r.Order)));items$=this.data$.pipe(V(r=>r.Items.map(e=>le(ae({},e.Variant),{Quantity:e.Quantity,Total:e.Price*e.Quantity*(e.Discount/100),VariantID:e.VariantID,UnitPrice:e.Price,UnitCost:e.Cost,Serial:e.Serial,ID:e.ID,Note:e.Note,Discount:e.Discount}))));static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Fe=class t{_createNewTransaction=new be;router=y(at);createNewTransaction$=this._createNewTransaction.asObservable();constructor(){}createNewTransaction(){this._createNewTransaction.next(),this.router.navigate([],{queryParams:{ID:null}})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var ce=class t{loadForm=y(Re);lowOnStock=y(jt);overOnStock=y(Qt);toastr=y(ee);route=y(pe);isEdit=T.IsNotEmpty(this.route.snapshot.queryParams.ID);newTrans=y(Fe);sourceOutlet=new $e({value:{ID:T.GuidEmpty,Name:"Source"},disabled:this.isEdit});sourceOutletID$=fi(()=>this.sourceOutlet.valueChanges.pipe(ze(this.sourceOutlet.value))).pipe(V(r=>r.ID));destinationOutlet=new $e({value:{ID:T.GuidEmpty,Name:"Destination"},disabled:this.isEdit});destinationOutletID$=fi(()=>this.destinationOutlet.valueChanges.pipe(ze(this.destinationOutlet.value))).pipe(V(r=>r.ID));assignSourceOutlet$=this.loadForm.outlets$.pipe(L(()=>T.IsNotEmpty(this.route.snapshot.queryParams.ID)),se(this.loadForm.data$),V(([r,e])=>r.find(o=>o.ID===e.Order.SourceEntityID)),q(r=>this.sourceOutlet.setValue(r)));assignDestinationOutlet$=this.loadForm.destinations$.pipe(L(()=>T.IsNotEmpty(this.route.snapshot.queryParams.ID)),se(this.loadForm.data$),V(([r,e])=>r.find(o=>o.ID===e.Order.DestinationEntityID)),q(r=>this.destinationOutlet.setValue(r)));resetAndWarnOnSameOutlet$=Ve(this.destinationOutlet.valueChanges.pipe(V(r=>le(ae({},r),{outletType:"destination"}))),this.sourceOutlet.valueChanges.pipe(V(r=>le(ae({},r),{outletType:"source"})))).pipe(L(r=>T.IsNotEmpty(r.ID)),V(r=>r.outletType=="destination"?r.ID===this.sourceOutlet.value.ID:r.ID===this.destinationOutlet.value.ID),L(r=>r),q(()=>{this.destinationOutlet.setValue({ID:T.GuidEmpty,Name:"Destination"}),this.toastr.warning("Source and destination outlet cannot be the same","Warning")}));resetSourceOutletID$=this.newTrans.createNewTransaction$.pipe(q(()=>{console.log("reset source outlet"),this.sourceOutlet.setValue({ID:T.GuidEmpty,Name:"Source"})}));enableOutletOnNewTransaction$=this.newTrans.createNewTransaction$.pipe(q(()=>{this.sourceOutlet.enable(),this.destinationOutlet.enable()}));resetDestinationOutletID$=Ve(this.newTrans.createNewTransaction$).pipe(q(()=>this.destinationOutlet.setValue({ID:T.GuidEmpty,Name:"Destination"})));assignDestinationIDFromInventoryROP=this.lowOnStock.destinationOutlet$;assignSourceOutletFromOverInventory=this.overOnStock.outletSource$;constructor(){bt([this.assignSourceOutlet$.pipe(ze(null)),this.assignSourceOutletFromOverInventory.pipe(ze(null))]).pipe(V(([r,e])=>T.IsNotEmpty(r)?r:e),L(r=>T.IsNotEmpty(r)),pt()).subscribe(r=>{console.log(`Source Outlet: ${r.Name}`),this.sourceOutlet.setValue(r)}),bt([this.assignDestinationOutlet$.pipe(ze(null)),this.assignDestinationIDFromInventoryROP.pipe(ze(null))]).pipe(V(([r,e])=>T.IsNotEmpty(r)?r:e),L(r=>T.IsNotEmpty(r)),pt()).subscribe(r=>{console.log(`Destination Outlet: ${r.Name}`),this.destinationOutlet.setValue(r)}),this.resetAndWarnOnSameOutlet$.subscribe(),this.resetSourceOutletID$.subscribe(),this.resetDestinationOutletID$.subscribe(),this.enableOutletOnNewTransaction$.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac})};var wt=class t{outlet=y(ce);matDialog=y(A);_import=new be;import$=this._import.asObservable();importedCart$=this.import$.pipe(se(this.outlet.sourceOutletID$),L(([r,e])=>T.IsNotEmpty(e)),Q(([r,e])=>this.matDialog.open(Ji,{data:{sampleUrl:"https://res.cloudinary.com/pos/raw/upload/v1699867624/POS/CSV/ImportTransferOrder_DealPOS_New.csv",fileEndpoint:"/API/TransferOrder/UploadCsv",outletID:e,useUppy:!0}}).afterClosed()),L(r=>T.IsNotEmpty(r)),V(r=>r.map(e=>le(ae({},e.Variant),{Quantity:e.Quantity,Total:e.Price*e.Quantity,VariantID:e.VariantID,UnitPrice:e.Price,UnitCost:e.Cost,Serial:e.Serial,Note:e.Note,Discount:e.Discount,DiscountAmount:e.DiscountAmount}))));constructor(){}import(){this._import.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Tn=class t{constructor(r){this.dialogRef=r;this.config.title="Empty outlet Inventory?",this.config.customWidth="500px"}config=new _e;ok(){this.dialogRef.close("empty")}close(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||t)(C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-clear-outlet"]],decls:4,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"fw-normal"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.ok()})("onCancel",function(){return a.close()})("onClose",function(){return a.close()}),n(1,"content")(2,"h4",1),p(3,"This will populate cart with all inventory from source outlet!"),i()()()),e&2&&m("config",a.config)},dependencies:[X,De,fe],encapsulation:2})};var Ot=class t{outlet=y(ce);http=y(k);matDialog=y(A);outletID$=this.outlet.sourceOutletID$;_clearOutlet=new be;clearOutlet$=this._clearOutlet.asObservable();populateCartWithAllItemsFromSourceOutlet$=this.clearOutlet$.pipe(Q(()=>this.matDialog.open(Tn).afterClosed()),L(r=>T.IsNotEmpty(r)),se(this.outletID$),L(([r,e])=>T.IsNotEmpty(e)),Q(([r,e])=>this.http.get(Ne.getAllOutletInventory,[{key:"EntityID",value:e}]).pipe(je(()=>Oe))));constructor(){}clearOutlet(){this._clearOutlet.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Et=class t{outlet=y(ce);http=y(k);route=y(pe);loadRegister$=this.outlet.sourceOutletID$.pipe(L(r=>T.IsNotEmpty(r)),V(r=>[r,T.IsNotEmpty(this.route.snapshot.queryParams.ID)]),q(console.log),Q(([r,e])=>this.http.get("/api/TransferOrderLoader/LoadRegister",[{key:"EntityID",value:r},{key:"IsEdit",value:e}])),lt(1));constructor(){this.loadRegister$.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Kt=class t{outlet=y(ce);http=y(k);loadRegister=y(Et);outletID$=this.outlet.sourceOutletID$;quickKeyItems$=this.loadRegister.loadRegister$.pipe(V(r=>r.QuickKey));itemQuickKeyID=new $e(T.GuidEmpty);itemQuickKey$=fi(()=>this.itemQuickKeyID.valueChanges.pipe(ze(this.itemQuickKeyID.value))).pipe(L(r=>T.IsNotEmpty(r)),se(this.outletID$),L(([r,e])=>T.IsNotEmpty(e)),Q(([r,e])=>this.http.get(Ne.GetVariantByID,[{key:"ID",value:r},{key:"EntityID",value:e}]).pipe(je(()=>Oe))));static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Mt=class t{outlet=y(ce);http=y(k);_scanSerial=new be;scanSerial$=this._scanSerial.asObservable();item$=this.scanSerial$.pipe(se(this.outlet.sourceOutletID$),Q(([r,e])=>this.http.get(Ne.GetVariantBySerial,[{key:"Serial",value:r},{key:"EntityID",value:e}]).pipe(je(()=>Oe))));constructor(){}scanSerial(r){this._scanSerial.next(r)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var wn=class t{constructor(r){this.dialogRef=r;this.config.title="Void Transaction?"}config=new _e;ok(){this.dialogRef.close("void")}close(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||t)(C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-void"]],decls:4,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"fw-normal"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.ok()})("onCancel",function(){return a.close()})("onClose",function(){return a.close()}),n(1,"content")(2,"h4",1),p(3,"This will erase all current data. Are you sure?"),i()()()),e&2&&m("config",a.config)},dependencies:[X,De,fe],encapsulation:2})};var Ye=class t{matDialog=y(A);_void=new be;void$=this._void.asObservable().pipe(Q(()=>this.matDialog.open(wn).afterClosed()),L(r=>T.IsNotEmpty(r)),lt(1));void(){this._void.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Jt=class t{outlet=y(ce);http=y(k);variantAutocomplete=new $e(null);getVariantByCode$=this.variantAutocomplete.valueChanges.pipe(L(r=>T.IsNotEmpty(r)&&r.type=="Code"),V(r=>r.str),se(this.outlet.sourceOutletID$),Q(([r,e])=>this.http.get(Ne.GetVariantByCode,[{key:"Code",value:r},{key:"EntityID",value:e}]).pipe(je(()=>Oe))));getVariantByID$=this.variantAutocomplete.valueChanges.pipe(L(r=>T.IsNotEmpty(r)&&r.type=="ID"),V(r=>r.str),se(this.outlet.sourceOutletID$),Q(([r,e])=>this.http.get(Ne.GetVariantByID,[{key:"ID",value:r},{key:"EntityID",value:e}]).pipe(je(()=>Oe))));static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var gd=["quantity"],ao=t=>({selected:t}),Cd=()=>["/menu/Products/Catalog/Variants/Info"],vd=t=>({ID:t}),yd=t=>({"table-light":t});function xd(t,r){if(t&1){let e=b();n(0,"a",10),g("click",function(){d(e);let o=s();return u(o.onTabChange("Product"))}),p(1," Product "),i()}if(t&2){let e=s();m("ngClass",M(1,ao,e.tabState=="Product"))}}function Sd(t,r){if(t&1){let e=b();z(0),n(1,"a",11),g("click",function(){d(e);let o=s();return u(o.onTabChange("Serial"))}),p(2," Serial "),i(),$()}if(t&2){let e=s();l(),m("ngClass",M(1,ao,e.tabState=="Serial"))}}function hd(t,r){if(t&1&&(z(0),n(1,"div",19)(2,"div",22),f(3,"POS-variant-autocomplete",23),i()(),$()),t&2){let e=s(2);l(3),m("formControl",e.variantAutocomplete)("isOnModalVariant",!0)}}function bd(t,r){if(t&1&&(n(0,"span"),p(1),i()),t&2){let e=s(2);l(),D("(",e.variant.UOMName,")")}}function Dd(t,r){if(t&1){let e=b();n(0,"div",24)(1,"strong"),p(2,"Price"),i(),n(3,"input",25,2),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.variant.UnitPrice,o)||(c.variant.UnitPrice=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("simpleKeyboard",e.keyboard),x("ngModel",e.variant.UnitPrice)}}function Id(t,r){if(t&1){let e=b();n(0,"div",24)(1,"strong"),p(2,"Cost"),i(),n(3,"input",25,2),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.variant.UnitCost,o)||(c.variant.UnitCost=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("simpleKeyboard",e.keyboard),x("ngModel",e.variant.UnitCost)}}function Td(t,r){if(t&1){let e=b();z(0),n(1,"div",12),_(2,hd,4,2,"ng-container",8),n(3,"div",13)(4,"div",14)(5,"strong"),p(6," Qty "),_(7,bd,2,1,"span",8),i(),n(8,"input",15,0),h("ngModelChange",function(o){d(e);let c=s();return S(c.variant.Quantity,o)||(c.variant.Quantity=o),u(o)}),i()(),_(10,Dd,5,2,"div",16)(11,Id,5,2,"div",16),n(12,"div",17)(13,"strong"),p(14,"Discount %"),i(),n(15,"input",18,1),h("ngModelChange",function(o){d(e);let c=s();return S(c.variant.Discount,o)||(c.variant.Discount=o),u(o)}),i()()(),n(17,"div",19)(18,"div",20)(19,"POS-tinymce-editor",21),h("ngModelChange",function(o){d(e);let c=s();return S(c.variant.Note,o)||(c.variant.Note=o),u(o)}),i()()()(),$()}if(t&2){let e=s();l(2),m("ngIf",e.isCreate),l(5),m("ngIf",e.variant.UOMName),l(),m("simpleKeyboard",e.keyboard)("decimalPlaces",e.isSerialItem?0:4),x("ngModel",e.variant.Quantity),m("disabled",e.isEditBuyForm&&e.isSerialItem),l(2),m("ngIf",e.appConfigJSON.ModuleDelivery.OutletDelivery.PriceVisible),l(),m("ngIf",e.appConfigJSON.ModuleDelivery.OutletDelivery.CostVisible),l(4),m("simpleKeyboard",e.keyboard),x("ngModel",e.variant.Discount),m("readonly",!e.role.sell.Discount),l(4),x("ngModel",e.variant.Note)}}function wd(t,r){t&1&&(z(0),f(1,"i",32),n(2,"h6"),p(3,"No Image"),i(),$())}function Od(t,r){if(t&1&&f(0,"img",33),t&2){let e=s(2);m("src",e.variant.ThumbnailUrl,ei)}}function Ed(t,r){if(t&1&&(n(0,"th",34),f(1,"i",36),p(2),i()),t&2){let e=s(3);l(2),D("",e.destinationName," ")}}function Md(t,r){if(t&1&&(n(0,"td",41),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),D(" ",E(2,1,e.destination.onHand)," ")}}function Pd(t,r){if(t&1&&(n(0,"td",41),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),D(" ",E(2,1,e.destination.allocated)," ")}}function Fd(t,r){if(t&1&&(n(0,"td",41),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),D(" ",E(2,1,e.destination.onHand-e.destination.allocated)," ")}}function Vd(t,r){if(t&1&&(n(0,"td",41),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),D(" ",E(2,1,e.destination.rop)," ")}}function Nd(t,r){if(t&1&&(n(0,"td",49),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),Qe(" ",e.destination.ropDiff>=0?"+":"","",E(2,2,e.destination.ropDiff)," ")}}function kd(t,r){if(t&1&&(n(0,"td",41),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),D(" ",E(2,1,e.destination.max)," ")}}function Ld(t,r){if(t&1&&(n(0,"td",50),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),Qe(" ",e.destination.maxDiff>=0?"+":"","",E(2,2,e.destination.maxDiff)," ")}}function Rd(t,r){if(t&1){let e=b();n(0,"button",51),g("click",function(){d(e);let o=s().ngIf,c=s(2);return u(c.setQuantityToMax(o))}),p(1," Place Order "),i()}}function Ad(t,r){if(t&1&&(n(0,"tbody")(1,"tr")(2,"th",34),f(3,"i",35),p(4,"Inventory "),i(),n(5,"th",34),f(6,"i",36),p(7),i(),_(8,Ed,3,1,"th",37),n(9,"th",34),f(10,"i",38),p(11," Diff "),i(),n(12,"th",34),f(13,"i",39),p(14," Action "),i()(),n(15,"tr")(16,"th",40),p(17,"On Hand"),i(),n(18,"td",41),p(19),v(20,"number"),i(),_(21,Md,3,3,"td",42),f(22,"td",43)(23,"td",44),i(),n(24,"tr")(25,"th",40),p(26,"Allocated"),i(),n(27,"td",41),p(28),v(29,"number"),i(),_(30,Pd,3,3,"td",42),i(),n(31,"tr")(32,"th",40),p(33,"Available"),i(),n(34,"td",41),p(35),v(36,"number"),i(),_(37,Fd,3,3,"td",42),i(),n(38,"tr")(39,"th",40),p(40,"ROP"),i(),n(41,"td",41),p(42),v(43,"number"),i(),_(44,Vd,3,3,"td",42)(45,Nd,3,4,"td",45),i(),n(46,"tr")(47,"th",40),p(48,"Max"),i(),n(49,"td",41),p(50),v(51,"number"),i(),_(52,kd,3,3,"td",42)(53,Ld,3,4,"td",46),n(54,"td",47),_(55,Rd,2,0,"button",48),i()()()),t&2){let e=r.ngIf,a=s(2);l(7),D("",a.outletName," "),l(),m("ngIf",a.isEmptyDestinationID()),l(11),D(" ",E(20,16,e.source.onHand)," "),l(2),m("ngIf",a.isEmptyDestinationID()),l(7),D(" ",E(29,18,e.source.allocated)," "),l(2),m("ngIf",a.isEmptyDestinationID()),l(5),D(" ",E(36,20,e.source.onHand-e.source.allocated)," "),l(2),m("ngIf",a.isEmptyDestinationID()),l(5),D(" ",E(43,22,e.source.rop)," "),l(2),m("ngIf",a.isEmptyDestinationID()),l(),m("ngIf",a.isEmptyDestinationID()),l(5),D(" ",E(51,24,e.source.max)," "),l(2),m("ngIf",a.isEmptyDestinationID()),l(),m("ngIf",a.isEmptyDestinationID()),l(),m("ngClass",M(26,yd,a.variant.Quantity==e.source.max-e.source.onHand-e.source.allocated)),l(),m("ngIf",a.variant.Quantity!=e.source.max-e.source.onHand-e.source.allocated)}}function Bd(t,r){if(t&1&&(z(0),n(1,"div",26)(2,"div",27)(3,"a",28),_(4,wd,4,0,"ng-container",29)(5,Od,1,1,"ng-template",null,3,Z),i()(),n(7,"div",30)(8,"table",31),_(9,Ad,56,28,"tbody",8),v(10,"async"),i()()(),$()),t&2){let e=we(6),a=s();l(3),m("routerLink",N(7,Cd))("queryParams",M(8,vd,a.variant==null?null:a.variant.ID)),l(),m("ngIf",(a.variant==null?null:a.variant.ThumbnailUrl)==null)("ngIfElse",e),l(5),m("ngIf",E(10,5,a.variantStock$))}}function Wd(t,r){if(t&1){let e=b();z(0),n(1,"app-item-serial",52),h("cartItemChange",function(o){d(e);let c=s();return S(c.variant,o)||(c.variant=o),u(o)}),i(),$()}if(t&2){let e=s();l(),m("entityId",e.outletID),x("cartItem",e.variant),m("disabled",e.isEditBuyForm)}}var Di=class t{constructor(r,e,a,o,c,w){this.dialogRef=r;this.http=a;this.role=o;this.toastr=w;this.config=new _e,this.config.title=e.variant?.Name??"Add Variant",this.config.customWidth="750px",this.appConfigJSON=e.appConfigJSON,this.unitQtyLabel=this.appConfigJSON.ModuleSell.ProductDialog.UnitQtyLabel,this.numpadVisible=this.appConfigJSON.ModuleSell.NumPadVisible,this.numpadVisible&&(this.keyboard=c.keyboard),this.isEditBuyForm=e.isEditBuyForm,this.outletID=e.outletID,this.outletName=e.outletName,this.destinationID=e.destinationID,this.destinationName=e.destinationName,this.variant=e.variant;let ie=this.appConfigJSON?.ModuleSell?.ProductDialog?.QuantityToOneInDialog?1:null;if(this.variant)this.isSerialItem=this.variant.TypeID==4,this.variantStock$=this.getOnInventory();else{this.isCreate=!0,this.variant={Quantity:ie,UnitQuantity:1,OrderPrice:0,Total:0,Note:"",UnitPrice:0,ThumbnailUrl:"",UOMName:"",TypeID:0,Discount:0,ID:"",Serial:[],UnitCost:0,VariantID:T.GuidEmpty};let Ue=this.variantAutocomplete.valueChanges.pipe(L(Y=>Y.type=="Code"),V(Y=>Y.str),Q(Y=>a.get(Ne.GetVariantByCode,[{key:"Code",value:Y},{key:"EntityID",value:this.outletID}]).pipe(je(()=>Oe))),V(Y=>this.setUnitPrice(Y)),V(Y=>le(ae({},Y),{Quantity:ie,Total:Y.UnitPrice,VariantID:Y.ID})),q(Y=>this.config.title=Y.Name)),_i=this.variantAutocomplete.valueChanges.pipe(L(Y=>Y.type=="ID"),V(Y=>Y.str),Q(Y=>a.get(Ne.GetVariantByID,[{key:"ID",value:Y},{key:"EntityID",value:this.outletID}]).pipe(je(()=>Oe))),V(Y=>this.setUnitPrice(Y)),V(Y=>le(ae({},Y),{Quantity:ie,Total:Y.UnitPrice,VariantID:Y.ID})),q(Y=>this.config.title=Y.Name));Ve(Ue,_i).pipe(q(Y=>this.setFocusField("quantity")),lt(1)).subscribe(Y=>{this.variant=Y,this.isSerialItem=this.variant.TypeID==4,this.showInventory=!0,this.variantStock$=this.getOnInventory()})}}variantAutocomplete=new $e;_quantityElement;variant;variantStock$=Oe;isSerialItem=!1;outletID;outletName;destinationID;destinationName;appConfigJSON;numpadVisible;keyboard;isEditBuyForm=!1;unitQtyLabel;config;tabState="Cart";isCreate=!1;showInventory=!1;serials=[];isFocusOnSerialInput=!1;_onGetInventory=new gt(void 0);onGetInventory$=this._onGetInventory.asObservable();setFocusField(r){switch(r){case"quantity":this._quantityElement.nativeElement.focus();break}}onTabChange(r){this.tabState=r}ok(){if(!this.isFocusOnSerialInput){if(this.checkQuantityIsNull(),this.isSerialItem){if(this.serials.length){let a=this.serials.map(o=>({Quantity:1,Number:o}));this.variant.Serial=[...this.variant.Serial,...a]}let r=this.variant.Serial?.map(a=>a.Quantity).reduce((a,o)=>a+o,0)??0,e=this.variant.Quantity;if(r!=e){this.toastr.warning("Serial Quantity must be equal to Variant Quantity","Warning");return}}this.dialogRef.close({item:le(ae({},this.variant),{Total:this.variant.UnitPrice*this.variant.UnitQuantity*this.variant.Quantity*((100-(this.variant.Discount??0))/100)})})}}close(){this.dialogRef.close()}checkQuantityIsNull(){this.variant.Quantity==null&&(this.variant.Quantity=1)}setQuantityToMax(r){let e=r.destination.onHand-r.destination.allocated;r.destination.max>=e?(this.variant.Quantity=r.destination.max-e,this.toastr.success("Qty adjusted to Max Inventory","Success"),this.ok()):this.toastr.warning("Your Inventory Available is more than Max Inventory","Warning")}getOnInventory(){let r=a=>{let o=a.OnHand-a.Allocated;return{onHand:a.OnHand,allocated:a.Allocated,rop:a.ROP,max:a.Max,maxDiff:a.Max-o,ropDiff:a.ROP-o}},e=so({source:this.http.get(Ne.GetVariantStockByID,[{key:"ID",value:this.variant.VariantID},{key:"EntityID",value:this.outletID}]).pipe(V(r)),destination:this.http.get(Ne.GetVariantStockByID,[{key:"ID",value:this.variant.VariantID},{key:"EntityID",value:this.destinationID}]).pipe(V(r))});return this.onGetInventory$.pipe(fo((a,o)=>a?Ct(a):e,null),V(a=>a),lt(1))}setUnitPrice(r){return ae({},r)}isEmptyDestinationID(){return!T.IsEmpty(this.destinationID)}static \u0275fac=function(e){return new(e||t)(C(ye),C(Ke),C(k),C(ne),C(mr),C(ee))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-item"]],viewQuery:function(e,a){if(e&1&&Ei(gd,5),e&2){let o;Mi(o=Pi())&&(a._quantityElement=o.first)}},decls:12,vars:9,consts:[["quantity",""],["discount",""],["price",""],["SHOW_IMAGE",""],[3,"onOk","onCancel","onClose","config"],[1,"row","border-bottom","mx-5"],["data-cy","input_sell",1,"btn","btn-link",3,"click","ngClass"],["class","btn btn-link","data-cy","product",3,"ngClass","click",4,"ngIf"],[4,"ngIf"],[1,"mx-8"],["data-cy","product",1,"btn","btn-link",3,"click","ngClass"],["data-cy","serial",1,"btn","btn-link",3,"click","ngClass"],[1,"mt-8"],[1,"row","mt-8"],[1,"col-auto","mb-4","pe-0",2,"width","82px"],["id","txtCartQuantity","keyboardType","number","type","text","autoNum","",1,"form-control","input-numpad",3,"ngModelChange","simpleKeyboard","decimalPlaces","ngModel","disabled"],["class","col-auto pe-0","style","width: 112px",4,"ngIf"],[1,"col-auto","pe-0",2,"width","90px"],["id","inputDiscount","keyboardType","number","type","text","autoNum","","percentage","",1,"form-control",3,"ngModelChange","simpleKeyboard","ngModel","readonly"],[1,"row"],[1,"col","tinymce"],["height","210px",3,"ngModelChange","ngModel"],[1,"col"],[3,"formControl","isOnModalVariant"],[1,"col-auto","pe-0",2,"width","112px"],["id","inputPrice","keyboardType","number","type","text","autoNum","",1,"form-control",3,"ngModelChange","simpleKeyboard","ngModel"],[1,"row","mt-6"],[1,"col-sm-3","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink","queryParams"],[4,"ngIf","ngIfElse"],[1,"col-sm-9"],[1,"table","table-bordered","text-center","inventory-table","w-100"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"border","rounded",3,"src"],[1,"bg-light-orange"],["aria-hidden","true",1,"fa-box-archive","fa-solid","fa-1x","me-2"],["aria-hidden","true",1,"fa-solid","fa-house","fa-1x","me-2"],["class","bg-light-orange",4,"ngIf"],["aria-hidden","true",1,"fa-solid","fa-plus-minus","fa-1x","me-2"],["aria-hidden","true",1,"fa-solid","fa-sliders","fa-1x","me-2"],[1,"table-light","text-start"],[1,"text-end"],["class","text-end",4,"ngIf"],["rowspan","3",1,"table-light"],["rowspan","4",1,"table-light"],["class","text-danger",4,"ngIf"],["class","text-success",4,"ngIf"],[3,"ngClass"],["style","font-size: 12px","type","button","class","btn btn-success btn-sm me-2","matTooltipPosition","above","matTooltip","Adjust Bought Qty to max Inventory",3,"click",4,"ngIf"],[1,"text-danger"],[1,"text-success"],["type","button","matTooltipPosition","above","matTooltip","Adjust Bought Qty to max Inventory",1,"btn","btn-success","btn-sm","me-2",2,"font-size","12px",3,"click"],[3,"cartItemChange","entityId","cartItem","disabled"]],template:function(e,a){e&1&&(n(0,"modal-material",4),g("onOk",function(){return a.ok()})("onCancel",function(){return a.close()})("onClose",function(){return a.close()}),n(1,"content")(2,"div",5)(3,"div")(4,"a",6),g("click",function(){return a.onTabChange("Cart")}),p(5," Cart "),i(),_(6,xd,2,3,"a",7)(7,Sd,3,3,"ng-container",8),i()(),n(8,"div",9),_(9,Td,20,12,"ng-container",8)(10,Bd,11,10,"ng-container",8)(11,Wd,2,3,"ng-container",8),i()()()),e&2&&(m("config",a.config),l(4),m("ngClass",M(7,ao,a.tabState=="Cart")),l(2),m("ngIf",a.appConfigJSON.ModuleDelivery.OutletDelivery.Inventory&&(!a.isCreate||a.showInventory)&&a.role.inventory.View),l(),m("ngIf",a.isSerialItem),l(2),m("ngIf",a.tabState=="Cart"),l(),m("ngIf",a.tabState=="Product"&&a.role.inventory.View),l(),m("ngIf",a.tabState=="Serial"))},dependencies:[X,mt,B,rt,ge,st,xt,Ge,Ce,R,W,Ni,De,fe,Wi,ct,ji,yt,G,_r,cr,Yi,Bt,oi,Gi,fr],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}p-chips[_ngcontent-%COMP%] ul.p-inputtext{width:570px;max-width:570px;border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] ul.p-inputtext li.p-chips-input-token>input[type=text]{border:none}p-chips[_ngcontent-%COMP%] .p-chips .p-chips-multiple-container:not(.p-disabled):hover{border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container{display:inline-block}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container .p-chips-token{margin:2px;background:#96bf48}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}"]})};var Rt=class t{loadForm=y(Re);newTransaction=y(Fe);isEdit=new gt(!1);isEdit$=this.isEdit.asObservable();constructor(){this.loadForm.data$.subscribe(()=>this.setIsEdit(!0)),this.newTransaction.createNewTransaction$.subscribe(()=>this.setIsEdit(!1))}setIsEdit(r){this.isEdit.next(r)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Pt=class t{outlet=y(ce);loadForm=y(Re);route=y(pe);matDialog=y(A);isEdit$=y(Rt).isEdit$;_addItem=new be;addItem$=this._addItem.asObservable().pipe(Q(()=>Ct({outletID:this.outlet.sourceOutlet.value.ID,outletName:this.outlet.sourceOutlet.value.Name,destinationID:this.outlet.destinationOutlet.value.ID,destinationName:this.outlet.destinationOutlet.value.Name})),Q(r=>bt([this.loadForm.config$,Ct(r)]).pipe(Ft(1))),se(this.isEdit$),Q(([[r,e],a])=>this.matDialog.open(Di,{data:{appConfigJSON:r,isEdit:a,outletID:e.outletID,outletName:e.outletName,destinationID:e.destinationID,destinationName:e.destinationName}}).afterClosed()),L(r=>T.IsNotEmpty(r?.item)),V(r=>r.item));_editItem=new be;editItem$=this._editItem.asObservable().pipe(Q(r=>Ct({outletID:this.outlet.sourceOutlet.value.ID,outletName:this.outlet.sourceOutlet.value.Name,destinationID:this.outlet.destinationOutlet.value.ID,destinationName:this.outlet.destinationOutlet.value.Name,item:r.item,index:r.index})),Q(r=>bt([this.loadForm.config$,Ct(r)]).pipe(Ft(1))),se(this.isEdit$),Q(([[r,e],a])=>this.matDialog.open(Di,{data:{appConfigJSON:r,isEdit:a,outletID:e.outletID,outletName:e.outletName,destinationID:e.destinationID,destinationName:e.destinationName,variant:e.item}}).afterClosed().pipe(L(o=>T.IsNotEmpty(o?.item)),V(o=>({item:o.item,index:e.index})))));addItem(){this._addItem.next()}editItem(r,e){this._editItem.next({item:ae({},r),index:e})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ze=class t{importCart=y(wt);clearOutlet=y(Ot);loadForm=y(Re);quickKey=y(Kt);scanSerialService=y(Mt);void=y(Ye);newTrans=y(Fe);variantAutocomplete=y(Jt);itemDialog=y(Pt);lowOnStock=y(jt);overOnStock=y(Qt);_cartAction=new be;cartAction$=this._cartAction.asObservable();outletService=y(ce);RFIDService=y(Xi);constructor(){this.outletService.sourceOutletID$.pipe(Q(r=>this.RFIDService.processGroupedData(r)),q(r=>this.rfid(r))).subscribe(),this.cart$.subscribe(),Ve(this.importCart.importedCart$,this.clearOutlet.populateCartWithAllItemsFromSourceOutlet$).pipe(V(r=>({action:"addBulkItems",items:r}))).subscribe(r=>this._cartAction.next(r)),Ve(this.loadForm.items$,this.lowOnStock.items$,this.overOnStock.items$).pipe(L(r=>T.IsNotEmpty(r)&&r.length>0),V(r=>({action:"replaceCart",items:r}))).subscribe(r=>this._cartAction.next(r)),this.scanSerialService.item$.pipe(V(r=>({action:"scanSerial",item:this.formatItemObject(r)}))).subscribe(r=>this._cartAction.next(r)),Ve(this.void.void$,this.newTrans.createNewTransaction$).subscribe(()=>this._cartAction.next({action:"emptyCart"})),Ve(this.variantAutocomplete.getVariantByCode$,this.variantAutocomplete.getVariantByID$,this.quickKey.itemQuickKey$).pipe(V(r=>({action:"add",item:r}))).subscribe(r=>this._cartAction.next(r)),this.itemDialog.addItem$.pipe(V(r=>({action:"addToNewRow",item:r}))).subscribe(r=>this._cartAction.next(r)),this.itemDialog.editItem$.pipe(V(r=>({action:"update",item:r.item,index:r.index}))).subscribe(r=>this._cartAction.next(r))}rearrangeCart(r){this._cartAction.next({action:"rearrangeCart",ev:r})}remove(r){this._cartAction.next({action:"remove",index:r})}add(r){this._cartAction.next({action:"add",item:r})}addToNewRow(r){this._cartAction.next({action:"addToNewRow",item:r})}addbulkItems(r){this._cartAction.next({action:"addBulkItems",items:r})}replaceCart(r){this._cartAction.next({action:"replaceCart",items:r})}scanSerial(r){this._cartAction.next({action:"scanSerial",item:r})}return(r){this._cartAction.next({action:"return",index:r})}purchase(r){this._cartAction.next({action:"purchase",index:r})}rfid(r){this._cartAction.next({action:"rfid",items:r})}clear(){this._cartAction.next({action:"emptyCart"})}formatItemObject=r=>{let o=r,{ID:e}=o,a=po(o,["ID"]);return le(ae({},a),{Quantity:a.Quantity??1,Total:a.Total??a.UnitPrice,VariantID:e})};cart$=this.cartAction$.pipe(wi((r,e)=>{let a=[...r],o=[],c=e.action;if(c=="add"){let w=e.item,H=a.findIndex(ie=>ie.VariantID==w.ID);o=H!=-1?a.map((ie,Ue)=>Ue==H?le(ae({},ie),{Quantity:ie.Quantity+1,Total:ie.Total+ie.UnitPrice}):ie):[...a,this.formatItemObject(w)]}else if(c=="update"){let w=e.item,H=e.index;o=a.map((ie,Ue)=>Ue==H?ae({},w):ie)}else if(c=="remove"){let w=e.index;o=a.filter((H,ie)=>ie!=w)}else if(c=="addToNewRow"){let w=e.item;o=[...a,this.formatItemObject(w)]}else if(c=="addBulkItems"){let w=e.items;o=[...a,...w.map(H=>this.formatItemObject(H))]}else if(c=="replaceCart")o=[...e.items];else if(c=="rearrangeCart"){let w=e.ev;o=a,Ao(o,w.previousIndex,w.currentIndex)}else if(c=="emptyCart")o=[];else if(c=="scanSerial"){let w=le(ae({},e.item),{Serial:[{Number:e.item.Serial.Number,Quantity:1,ExpiryDate:e.item.Serial.ExpiryDate}]});if(!!a.find(ie=>ie.VariantID==w.VariantID)){let ie=w.Serial[0],Ue=a.find(Y=>Y.VariantID==w.VariantID),At=!!Ue.Serial.find(Y=>Y.Number==ie.Number)?[...Ue.Serial].map(Y=>Y.Number==ie.Number?le(ae({},Y),{Quantity:Y.Quantity+1}):Y):[...Ue.Serial,ie];o=a.map(Y=>Y.VariantID==w.VariantID?le(ae({},Y),{Quantity:Y.Quantity+1,Total:Y.Total+Y.UnitPrice,Serial:At}):Y)}else o=[...a,le(ae({},w),{Quantity:1,Total:w.UnitPrice})]}else if(c=="return"){let w=e.index;o=a.map((H,ie)=>ie==w?le(ae({},H),{Quantity:-Math.abs(H.Quantity),Total:-Math.abs(H.Total)}):H)}else if(c=="purchase"){let w=e.index;o=a.map((H,ie)=>ie==w?le(ae({},H),{Quantity:Math.abs(H.Quantity),Total:Math.abs(H.Total)}):H)}else if(c==="rfid"){let w=e.items;console.log("items",w);let H=[];Object.keys(w).forEach(ie=>{if(w.hasOwnProperty(ie)){let Ue=w[ie];if(Ue&&Object.keys(Ue.variant).length>0){let _i=a.findIndex(At=>At.Code.toLowerCase()===ie.toLowerCase());if(_i!==-1){let At=Number(Ue.count);a[_i].Quantity+=At,delete w[ie],H=[...a]}else{let At=Ue.variant,Y=Number(Ue.count),Gr=this.formatItemObject(le(ae({},At),{Quantity:Y}));delete w[ie],H=[...a,Gr]}}}}),o=[...H]}return o},[]),ze([]),lt(1));static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var On=class t{constructor(r){this.dialogRef=r;this.config.title="New Courier",this.config.customWidth="500px"}config=new _e;courier="";ok(){T.IsNotEmpty(this.courier)?this.dialogRef.close(this.courier):this.close()}close(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||t)(C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-add-courier"]],decls:8,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],["type","text","placeholder","Add New Courier",1,"form-control",3,"ngModelChange","ngModel"],["for","newCourier"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.ok()})("onCancel",function(){return a.close()})("onClose",function(){return a.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"input",4),h("ngModelChange",function(c){return S(a.courier,c)||(a.courier=c),c}),i(),n(6,"label",5),p(7,"Add New Courier"),i()()()()()()),e&2&&(m("config",a.config),l(5),x("ngModel",a.courier))},dependencies:[X,De,fe,Ge,Ce,R,W],encapsulation:2})};var $t=class t{http=y(k);loadForm=y(Re);toastr=y(ee);void=y(Ye);matDialog=y(A);newTrans=y(Fe);outletService=y(ce);courierSubject=new gt([]);courierID=new $e(null);_addNewCourier=new be;addNewCourier$=this._addNewCourier.asObservable().pipe(Q(()=>this.matDialog.open(On).afterClosed()),L(r=>T.IsNotEmpty(r)),Q(r=>this.http.post("/API/TransferOrder/UpdateCourierList",{name:r}).pipe(V(e=>le(ae({},e),{Name:r}))).pipe(je(()=>Oe))),q(r=>{this.courierID.setValue(r.ID),this.toastr.success(r.Message,ve.Success)}));initialCouriers$=this.courierSubject.asObservable();couriers$=co(this.initialCouriers$,this.addNewCourier$).pipe(wi((r,e)=>{let a=[];return Array.isArray(e)==!1?a=[...r,e]:a=e,a},[]));assignCourierID$=Ve(this.loadForm.data$.pipe(V(r=>r.Order.CourierID==T.GuidEmpty?null:r.Order.CourierID),q(r=>this.courierID.setValue(r))),this.initialCouriers$.pipe(V(r=>{let e=null;return r?.length==1&&(e=r[0].ID),e}))).pipe(q(r=>{this.courierID.setValue(r)}));resetCourierID$=Ve(this.void.void$,this.newTrans.createNewTransaction$).pipe(q(()=>this.courierID.setValue(null)));constructor(){this.assignCourierID$.subscribe(),this.resetCourierID$.subscribe(),this.listenDestinationChanges()}listenDestinationChanges(){this.outletService.destinationOutletID$.pipe(Q(r=>T.IsEmpty(r)?Oe:this.getCouriersByDestinationId(r).pipe()),pt()).subscribe()}getCouriersByDestinationId(r){return this.http.get(`${Ne.GetCourierByOutletDestination}/${r}`).pipe(q(e=>{this.courierSubject.next(e.Data)}),je(e=>Oe))}addNewCourier(){this._addNewCourier.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Yt=class t{loadForm=y(Re);void=y(Ye);newTrans=y(Fe);invoiceDate=new $e(new Date);assignInvoiceDate$=this.loadForm.data$.pipe(V(r=>r.Order.Date),q(r=>this.invoiceDate.setValue(r)));resetInvoiceDate$=Ve(this.void.void$,this.newTrans.createNewTransaction$).pipe(q(()=>this.invoiceDate.setValue(new Date)));constructor(){this.assignInvoiceDate$.subscribe(),this.resetInvoiceDate$.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ii=class t{route=y(pe);void=y(Ye);newTransaction=y(Fe);overOnStock=y(Qt);isOpenOutletDialog=new gt(!1);lowOnStock=y(jt);outletService=y(ce);isOpenOutletDialog$=this.isOpenOutletDialog.asObservable().pipe(se(this.outletService.sourceOutletID$),V(([r,e])=>T.IsNotEmpty(e)?!1:r));_onCloseOutletDialog=new gt(!1);isOpenDestinationDialog$=this._onCloseOutletDialog.pipe(se(this.lowOnStock.destinationOutlet$.pipe(ze(null)),this.overOnStock.outletSource$.pipe(ze(null))),V(([r,e,a])=>{let o=!1;return T.IsNotEmpty(e)&&T.IsNotEmpty(e?.ID)?o=!1:T.IsNotEmpty(a)&&T.IsNotEmpty(a?.ID)?o=!0:o=r,o}));onCloseOutletDialog(){this._onCloseOutletDialog.next(!0)}isEdit$=Ct(T.IsNotEmpty(this.route.snapshot.queryParams.ID)).pipe(q(r=>this.isOpenOutletDialog.next(!r)));reopenOutletDialog=this.void.void$.pipe(q(()=>this.isOpenOutletDialog.next(!0)));onCreateNewTransaction=this.newTransaction.createNewTransaction$.pipe(q(()=>this.isOpenOutletDialog.next(!0)));constructor(){this.isEdit$.subscribe(),this.reopenOutletDialog.subscribe(),this.onCreateNewTransaction.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Xt=class t{route=y(pe);outlet=y(ce);http=y(k);loadForm=y(Re);void=y(Ye);newTrans=y(Fe);loadRegister=y(Et);outletID$=this.outlet.sourceOutletID$;orderNumber=new $e("");assignGeneratedNumber$=this.loadRegister.loadRegister$.pipe(L(()=>T.IsEmpty(this.route.snapshot.queryParams.ID)),V(r=>r.Number),q(r=>this.orderNumber.setValue(r)));assignOrderNumber$=this.loadForm.data$.pipe(V(r=>r.Order.Number),q(r=>this.orderNumber.setValue(r)));resetOrderNumber$=this.newTrans.createNewTransaction$.pipe(q(()=>this.orderNumber.setValue("")));generateOrderNumberOnNewTransaction$=this.newTrans.createNewTransaction$.pipe(se(this.outletID$),L(([r,e])=>T.IsNotEmpty(e)),Q(([r,e])=>this.http.post("/API/TransferOrder/GenerateNumber",{ID:e})),q(r=>this.orderNumber.setValue(r.Number)));constructor(){this.assignGeneratedNumber$.subscribe(),this.assignOrderNumber$.subscribe(),this.generateOrderNumberOnNewTransaction$.subscribe(),this.resetOrderNumber$.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Hd=()=>["/menu/Products/Catalog/Variants/Info"],jd=t=>({ID:t});function Qd(t,r){if(t&1){let e=b();n(0,"div",16)(1,"p-checkbox",17),h("ngModelChange",function(o){let c=d(e).$implicit;return S(c.value.selected,o)||(c.value.selected=o),u(o)}),i(),n(2,"span"),p(3),i()()}if(t&2){let e,a=r.$implicit;l(),x("ngModel",a.value.selected),m("binary",!0),l(2),I((e=a.value.name)!==null&&e!==void 0?e:a.key)}}function qd(t,r){if(t&1&&(n(0,"div",13)(1,"h6",14),p(2,"Columns to View"),i(),_(3,Qd,4,3,"div",15),v(4,"keyvalueUnsort"),i()),t&2){let e=s();l(3),m("ngForOf",E(4,1,e.column))}}function Ud(t,r){t&1&&(n(0,"th",18),p(1," Qty "),i())}function zd(t,r){t&1&&(n(0,"th",18)(1,"span",19),p(2," Src "),i()())}function $d(t,r){t&1&&(n(0,"th",18)(1,"span",20),p(2," Req "),i()())}function Gd(t,r){t&1&&(n(0,"th",18)(1,"span",21),p(2," Avl "),i()())}function Kd(t,r){t&1&&(n(0,"th",18)(1,"span",22),p(2," Dest "),i()())}function Jd(t,r){t&1&&(n(0,"th",18)(1,"span",23),p(2," Max "),i()())}function Yd(t,r){if(t&1&&(n(0,"td",28),p(1),v(2,"quantityFraction"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.RequestQuantity)," ")}}function Xd(t,r){if(t&1&&(n(0,"td",28),p(1),v(2,"quantityFraction"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.SourceInventory.OnHand)," ")}}function Zd(t,r){if(t&1&&(n(0,"td",28),p(1),v(2,"quantityFraction"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.SourceInventory.Requested)," ")}}function e0(t,r){if(t&1&&(n(0,"td",28),p(1),v(2,"quantityFraction"),i()),t&2){let e=s().$implicit;ot(e.RequestQuantity>e.SourceInventory.OnHand-e.SourceInventory.Requested?"bg-gradient-warning":""),l(),D(" ",E(2,3,e.SourceInventory.OnHand-e.SourceInventory.Requested)," ")}}function t0(t,r){if(t&1&&(n(0,"td",28),p(1),v(2,"quantityFraction"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.DestinationInventory.OnHand)," ")}}function i0(t,r){if(t&1&&(n(0,"td",28),p(1),i()),t&2){let e=s().$implicit;ot(e.DestinationInventory.OnHand+e.RequestQuantity>e.DestinationInventory.Max&&e.DestinationInventory.Max>0?"bg-gradient-warning":""),l(),D(" ",e.DestinationInventory.Max," ")}}function n0(t,r){if(t&1&&(n(0,"tr")(1,"td")(2,"a",24),p(3),i(),n(4,"small",25),p(5),i()(),_(6,Yd,3,3,"td",26)(7,Xd,3,3,"td",26)(8,Zd,3,3,"td",26)(9,e0,3,5,"td",27)(10,t0,3,3,"td",26)(11,i0,2,3,"td",27),i()),t&2){let e=r.$implicit,a=s();l(2),m("routerLink",N(10,Hd))("queryParams",M(11,jd,e.VariantID)),l(),I(e.Name),l(2),I(e.Code),l(),m("ngIf",a.column.qty.selected),l(),m("ngIf",a.column.source.selected),l(),m("ngIf",a.column.requested.selected),l(),m("ngIf",a.column.available.selected),l(),m("ngIf",a.column.destination.selected),l(),m("ngIf",a.column.max.selected)}}var ui=class t{constructor(r,e,a,o,c){this.dialogRef=r;this.data=e;this.columnService=a;this.overlay=o;this.vcr=c;this.config.title="Inventory Forecast",this.config.customWidth="700px",this.config.bodyScrollable=!0,e&&(this.config.hideFooter=e.hideFooter!==void 0?e.hideFooter:!0),this.inventory=e.inventory,this.column=e.column?JSON.parse(JSON.stringify(e.column)):JSON.parse(JSON.stringify(t.column))}static column={qty:{selected:!0,name:"Qty"},source:{selected:!1,name:"Source"},requested:{selected:!1,name:"Requested"},available:{selected:!0,name:"Available"},destination:{selected:!0,name:"Destination"},max:{selected:!0,name:"Max"}};column=t.column;overlayRef=null;openColumnOverlay(r,e){this.overlayRef&&this.overlayRef.dispose();let a=this.overlay.position().flexibleConnectedTo(r).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"}]);this.overlayRef=this.overlay.create({positionStrategy:a,hasBackdrop:!0,backdropClass:"cdk-overlay-transparent-backdrop"}),this.overlayRef.attach(new Io(e,this.vcr)),this.overlayRef.backdropClick().subscribe(()=>this.overlayRef?.dispose())}config=new _e;inventory;close(){this.dialogRef.close()}ok(){return mo(this,null,function*(){this.dialogRef.close("ok")})}static \u0275fac=function(e){return new(e||t)(C(ye),C(Ke),C(Jo),C(To),C(Oi))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-analyze-inventory"]],decls:23,vars:8,consts:[["columnBtn",""],["columnOverlayTpl",""],[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row"],[1,"col-12"],["id","tableGrid",1,"table","table-bordered"],[1,"thead-light"],[2,"position","relative","display","flex"],["title","Columns to View",1,"column-icon","ms-3","toggler-wrapper",3,"click"],[1,"fa-solid","fa-columns-3"],["style","width: 60px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"cdk-overlay","column-overlay-panel","toggle-option-wrapper"],[1,"border-bottom","pb-3","mb-3"],["class","mb-2",4,"ngFor","ngForOf"],[1,"mb-2"],["inputId","binary",1,"me-3",3,"ngModelChange","ngModel","binary"],[1,"text-end",2,"width","60px"],["matTooltip","Source On-Hand","matTooltipPosition","above"],["matTooltip","Source Requested","matTooltipPosition","above"],["matTooltip","Available (Source On-Hand - Source Requested)","matTooltipPosition","above"],["matTooltip","Destination On-Hand","matTooltipPosition","above"],["matTooltip","Destination Maximum Inventory","matTooltipPosition","above"],["target","_blank",3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end",3,"class",4,"ngIf"],[1,"text-end"]],template:function(e,a){if(e&1){let o=b();n(0,"modal-material",2),g("onOk",function(){return d(o),u(a.ok())})("onCancel",function(){return d(o),u(a.close())})("onClose",function(){return d(o),u(a.close())}),n(1,"content")(2,"div",3)(3,"div",4)(4,"div",5)(5,"table",6)(6,"thead",7)(7,"tr")(8,"th",8),p(9," Product "),n(10,"div",9,0),g("click",function(){d(o);let w=we(11),H=we(14);return u(a.openColumnOverlay(w,H))}),f(12,"i",10),i(),_(13,qd,5,3,"ng-template",null,1,Z),i(),_(15,Ud,2,0,"th",11)(16,zd,3,0,"th",11)(17,$d,3,0,"th",11)(18,Gd,3,0,"th",11)(19,Kd,3,0,"th",11)(20,Jd,3,0,"th",11),i()(),n(21,"tbody"),_(22,n0,12,13,"tr",12),i()()()()()()()}e&2&&(m("config",a.config),l(15),m("ngIf",a.column.qty.selected),l(),m("ngIf",a.column.source.selected),l(),m("ngIf",a.column.requested.selected),l(),m("ngIf",a.column.available.selected),l(),m("ngIf",a.column.destination.selected),l(),m("ngIf",a.column.max.selected),l(2),m("ngForOf",a.inventory))},dependencies:[X,J,B,Ge,R,W,Wt,ke,De,fe,yt,G,Go,$o,zo,ri],styles:[".dropdown-menu[_ngcontent-%COMP%]{position:absolute!important;z-index:99999!important;left:0;top:40px;min-width:220px}.toggler-wrapper[_ngcontent-%COMP%]{display:inline-block;cursor:pointer;position:relative;z-index:10001}.toggle-option-wrapper[_ngcontent-%COMP%]{min-width:220px;background:#fff;border-radius:8px;box-shadow:0 2px 12px #0003;padding:16px;z-index:99999;color:#000}"]})};var ft=class t{http=y(k);outlet=y(ce);matDialog=y(A);cart=y(Ze);_analyze=new be;analyze$=this._analyze.asObservable();processTransactionSafe$=new be;analyzeInventory$=this.analyze$.pipe(Q(()=>bt([this.outlet.sourceOutletID$,this.outlet.destinationOutletID$,this.cart.cart$]).pipe(Ft(1))),L(([r,e,a])=>T.IsNotEmpty(r)&&T.IsNotEmpty(e)&&a.length>0),Q(([r,e,a])=>this.http.post("/API/TransferOrder/Analyze",{DestinationOutlet:e,Items:a.map(o=>le(ae({},o),{ID:o.VariantID})),SourceOutlet:r}).pipe(V(o=>o.map(c=>le(ae({},c),{Code:a.find(w=>w.VariantID===c.VariantID)?.Code,VariantID:a.find(w=>w.VariantID===c.VariantID)?.VariantID,Name:a.find(w=>w.VariantID===c.VariantID)?.Name}))),je(()=>Oe))));constructor(){this.analyzeInventory$.subscribe()}analyze(r=!0){this.analyzeInventory$.pipe(Ft(1)).pipe(q(e=>{r&&this.showAnalyzeDialog(e)})).subscribe(),this._analyze.next()}showAnalyzeDialog(r){this.matDialog.open(ui,{data:{inventory:r}}).afterClosed()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var lo=t=>({selected:t});function r0(t,r){if(t&1){let e=b();n(0,"div",9)(1,"label",10)(2,"input",11),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.typeID,o)||(c.typeID=o),u(o)}),i(),p(3),i()()}if(t&2){let e=r.$implicit,a=r.index,o=s(2);l(),vi("for","potype-"+a),m("ngClass",M(6,lo,o.typeID==e.ID)),l(),vi("id","potype-"+a),x("ngModel",o.typeID),m("value",e.ID),l(),D(" ",e.Name," ")}}function a0(t,r){if(t&1&&(n(0,"div",6),z(1),n(2,"div",7),_(3,r0,4,8,"div",8),i(),$(),i()),t&2){let e=s();l(3),m("ngForOf",e.deliveryTypes)}}function l0(t,r){if(t&1){let e=b();n(0,"div",6),z(1),n(2,"div",7)(3,"POS-tinymce-editor",12),h("ngModelChange",function(o){d(e);let c=s();return S(c.note,o)||(c.note=o),u(o)}),i()(),$(),i()}if(t&2){let e=s();l(3),x("ngModel",e.note)}}var En=class t{constructor(r,e){this.dialogRef=r;this.config.title="Notes",this.config.customWidth="600px",this.deliveryTypes=e.deliveryTypes,this.typeID=e.typeID,this.note=e.note||""}currentTabState=1;modalTabState=yr;config=new _e;deliveryTypes;typeID="";note="";ok(){this.dialogRef.close({typeID:this.typeID,note:this.note})}close(){this.dialogRef.close()}onTabChange(r){this.currentTabState=r}static \u0275fac=function(e){return new(e||t)(C(ye),C(Ke))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-delivery-type"]],decls:11,vars:9,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row","border-bottom"],["data-cy","tab-note",1,"btn","btn-link","note-tab",3,"click","ngClass"],["data-cy","tab-type",1,"btn","btn-link","note-tab",3,"click","ngClass"],["class","row mt-8",4,"ngIf"],[1,"row","mt-8"],[1,"col-12"],["class","rad-btn",4,"ngFor","ngForOf"],[1,"rad-btn"],[3,"for","ngClass"],["type","radio",3,"ngModelChange","ngModel","value","id"],[3,"ngModelChange","ngModel"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.ok()})("onCancel",function(){return a.close()})("onClose",function(){return a.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"div")(5,"a",3),g("click",function(){return a.onTabChange(a.modalTabState.NOTE)}),p(6," Note "),i(),n(7,"a",4),g("click",function(){return a.onTabChange(a.modalTabState.TYPE)}),p(8," Tag "),i()()(),_(9,a0,4,1,"div",5)(10,l0,4,1,"div",5),i()()()),e&2&&(m("config",a.config),l(5),m("ngClass",M(5,lo,a.modalTabState.NOTE==a.currentTabState)),l(2),m("ngClass",M(7,lo,a.modalTabState.TYPE==a.currentTabState)),l(2),m("ngIf",a.modalTabState.TYPE==a.currentTabState),l(),m("ngIf",a.modalTabState.NOTE==a.currentTabState))},dependencies:[X,mt,J,B,Ge,Ce,So,R,W,De,fe,st,xt],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}content[_ngcontent-%COMP%] > div.container-fluid[_ngcontent-%COMP%]{min-height:200px}.tinymce[_ngcontent-%COMP%] a[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{z-index:2;position:absolute;right:15px;bottom:19px}.tinymce[_ngcontent-%COMP%] editor[_ngcontent-%COMP%]{height:max-content;z-index:1}.rad-btn[_ngcontent-%COMP%]{position:relative;display:inline-block}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #dddddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label.selected[_ngcontent-%COMP%]{background:#dcdcdc;border:1px solid #dcdcdc}.btn-link.note-tab[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.note-tab.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}a.btn.btn-link.note-tab[_ngcontent-%COMP%]{color:inherit}.ng-select.currency-option[_ngcontent-%COMP%]{width:36%!important}.col-12[_ngcontent-%COMP%]{height:250px}"]})};var Gt=class t{loadForm=y(Re);void=y(Ye);matDialog=y(A);newTrans=y(Fe);isEdit$=y(Rt).isEdit$;typeID=new $e(T.GuidEmpty);note=new $e("");assignNote$=this.loadForm.data$.pipe(V(r=>r.Order?.Note??""),q(r=>this.note.setValue(r)));assignDefaultTypeID$=this.loadForm.deliveryTypes$.pipe(se(this.isEdit$),L(([r,e])=>!e),V(([r,e])=>r[0]?.ID),q(r=>this.typeID.setValue(r)));assignTypeID$=this.loadForm.data$.pipe(V(r=>r.Order.TypeID),q(r=>this.typeID.setValue(r)));resetTypeID$=Ve(this.void.void$,this.newTrans.createNewTransaction$).pipe(Q(()=>this.loadForm.deliveryTypes$),V(r=>r[0]?.ID),q(r=>{this.typeID.setValue(r),this.note.setValue("")}));_openTypeIDDialog=new be;openTypeIDDialog$=this._openTypeIDDialog.asObservable().pipe(se(this.loadForm.deliveryTypes$),Q(([r,e])=>this.matDialog.open(En,{data:{typeID:this.typeID.value,deliveryTypes:e,note:this.note.value}}).afterClosed()),L(r=>T.IsNotEmpty(r)),q(r=>{this.typeID.setValue(r?.typeID),this.note.setValue(r?.note)}));constructor(){console.log("TypeIDService initialized"),this.assignDefaultTypeID$.pipe(pt()).subscribe(),this.assignTypeID$.pipe(pt()).subscribe(),this.resetTypeID$.pipe(pt()).subscribe(),this.openTypeIDDialog$.pipe(pt()).subscribe(),this.assignNote$.pipe(pt()).subscribe()}openDeliveryTypeDialog(){this._openTypeIDDialog.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var ht=class t{http=y(k);matDialog=y(A);outlet=y(ce);date=y(Yt);number=y(Xt);courier=y($t);deliveryTypeID=y(Gt);cart=y(Ze);loadForm=y(Re);loadRegister=y(Et);analyzeService=y(ft);appConfigJSON$=this.loadForm.config$;_processTransaction=new be;processTransaction$=this._processTransaction.asObservable();submitOrder$=this.processTransaction$.pipe(Q(()=>bt([this.outlet.sourceOutletID$,this.outlet.destinationOutletID$,this.cart.cart$]).pipe(Ft(1))),L(([r,e,a])=>T.IsNotEmpty(r)&&T.IsNotEmpty(e)&&a.length>0),V(()=>this.deliveryTypeID.note.value),se(this.cart.cart$,this.loadRegister.loadRegister$.pipe(V(r=>r.NewOrderID)),this.loadForm.loadForm$),Q(([r,e,a,o])=>{let c={Order:{SourceEntityID:this.outlet.sourceOutlet.value.ID,DestinationEntityID:this.outlet.destinationOutlet.value.ID,Date:this.date.invoiceDate.value,Number:this.number.orderNumber.value,CourierID:T.IsEmpty(this.courier.courierID.value)?T.GuidEmpty:this.courier.courierID.value,TypeID:this.deliveryTypeID.typeID.value,Note:r,ID:o.Data.Order?.ID,StateID:o.Data.Order?.StateID},Items:e,NewOrderID:a};return this.http.post("/api/TransferOrder/SubmitOrder2",c).pipe(V(w=>le(ae({},w),{PrintTemplateID:o.Entities.find(H=>H.ID===this.outlet.sourceOutlet.value.ID)?.PrintTemplateID})),je(()=>Oe))}),lt(1));constructor(r){this.submitOrder$.subscribe(),r.processTransactionSafe$.pipe(q(()=>{this._processTransaction.next()})).subscribe()}processTransaction(){this.analyzeService.analyzeInventory$.pipe(Ft(1),se(this.appConfigJSON$),Q(([r,e])=>{if(!Array.isArray(r))return Oe;let a=r.some(w=>w.SourceInventory.Requested>w.SourceInventory.OnHand-w.RequestQuantity),o=r.some(w=>w.DestinationInventory.OnHand>=0&&w.DestinationInventory.OnHand+w.SourceInventory.Requested>w.DestinationInventory.Max&&w.DestinationInventory.Max>0),c=e.ModuleDelivery.OutletDelivery.Workflow>1;if((a||o)&&!c){let w={qty:{selected:!0,name:"Qty"},source:{selected:!1,name:"Source"},requested:{selected:!1,name:"Requested"},available:{selected:!0,name:"Available"},destination:{selected:!0,name:"Destination"},max:{selected:!0,name:"Max"}};return this.matDialog.open(ui,{data:{inventory:r,column:w,hideFooter:!1}}).afterClosed().pipe(q(ie=>{ie&&ie==="ok"&&this._processTransaction.next()}),Q(()=>Oe))}else return this._processTransaction.next(),Oe})).subscribe(),this.analyzeService.analyze(!1)}static \u0275fac=function(e){return new(e||t)(Vt(ft))};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Mn=class t{toastr=y(ee);clearOutlet=y(Ot);analyze=y(ft);outlet=y(ce);scanSerial=y(Mt);cart=y(Ze);processTransaction=y(ht);importCart=y(wt);toastrOnEmptySourceOutlet$=Ve(this.clearOutlet.clearOutlet$,this.analyze.analyze$,this.scanSerial.scanSerial$,this.processTransaction.processTransaction$,this.importCart.import$).pipe(se(this.outlet.sourceOutletID$),L(([r,e])=>e===T.GuidEmpty),q(()=>this.toastr.info("Please select source outlet",ve.Info)));toastrOnEmptyDestinationOutlet$=Ve(this.analyze.analyze$,this.processTransaction.processTransaction$).pipe(se(this.outlet.destinationOutletID$),L(([r,e])=>e===T.GuidEmpty),q(()=>this.toastr.info("Please select destination outlet",ve.Info)));toastrOnEmptyCart$=Ve(this.analyze.analyze$,this.processTransaction.processTransaction$).pipe(se(this.cart.cart$),L(([r,e])=>e.length===0),q(()=>this.toastr.info("Please add item to cart",ve.Info)));constructor(){this.toastrOnEmptySourceOutlet$.subscribe(),this.toastrOnEmptyDestinationOutlet$.subscribe(),this.toastrOnEmptyCart$.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ti=class t{createNewTransaction=y(Fe);processTransaction=y(ht);_isComplete=new gt(!1);isComplete$=this._isComplete.asObservable();constructor(){this.createNewTransaction.createNewTransaction$.subscribe(()=>this._isComplete.next(!1)),this.processTransaction.submitOrder$.subscribe(()=>this._isComplete.next(!0))}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var p0=(t,r)=>({ID:t,Template:r}),m0=()=>["/menu/Logistics/Archive/Transfer_Order/Info"],c0=t=>({ID:t});function s0(t,r){if(t&1&&(n(0,"div",25)(1,"div",26),p(2),i(),n(3,"div",26),p(4),i()()),t&2){let e=r.$implicit;l(2),I(e.Name),l(2),I(e.Quantity)}}var Pn=class t{handleF8(){this.createNewTransaction()}pageSetup=y(te);title=y(ni);afterProcessData;cartItems;orderNumber;newTransService=y(Fe);toastr=y(ee);menu$;fullContainerEl=document.getElementById("full-container");constructor(){this.pageSetup.setMenu$(),this.menu$=this.pageSetup.menu$.pipe(V(r=>le(ae({},r),{H:"Transfer Order",T:r.T.replace("undefined","Transfer Order")})),q(r=>this.title.setTitle(r.T)))}ngOnChanges(){this.orderNumber&&this.afterProcessData&&this.orderNumber!==this.afterProcessData.InvoiceNumber&&this.toastr.warning("Your transfer order number is changed to "+this.afterProcessData.InvoiceNumber,"Transfer Order Number Changed!")}ngAfterViewInit(){this.fullContainerEl.classList.remove("full-container")}ngOnDestroy(){this.fullContainerEl.classList.add("full-container")}createNewTransaction(){this.newTransService.createNewTransaction()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-complete"]],hostBindings:function(e,a){e&1&&g("keydown.F8",function(){return a.handleF8()},!1,ti)},inputs:{afterProcessData:"afterProcessData",cartItems:"cartItems",orderNumber:"orderNumber"},features:[go],decls:37,vars:23,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"order-complete"],[1,"container-fluid","pt-8"],[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","py-5"],["target","_blank",1,"btn","bg-light-gray","btn-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],["class","row justify-content-between mb-3",4,"ngFor","ngForOf"],[1,"row","justify-content-end","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col-4","text-end"],[1,"row","justify-content-between","mb-3"],[1,"col","text-end"]],template:function(e,a){e&1&&(n(0,"mainpanel-cmp",0),v(1,"async"),n(2,"content")(3,"section",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"h1",7),f(10,"i",8),p(11,"Transfer Order Complete "),i()(),n(12,"div",9)(13,"div",10)(14,"div",11)(15,"a",12),g("click",function(){return a.createNewTransaction()}),p(16,"New Transfer Order (F8)"),i()()()(),n(17,"div",13)(18,"div",14)(19,"a",15),f(20,"i",16),p(21,"Print Receipt"),i()()()()(),n(22,"div",17)(23,"div",5)(24,"div",18)(25,"h3",19)(26,"a",20),p(27),i()()(),n(28,"div",21),_(29,s0,5,2,"div",22),n(30,"div",23)(31,"div",24),p(32,"Total:"),i(),n(33,"div",24),p(34),v(35,"sum"),v(36,"number"),i()()()()()()()()()()),e&2&&(m("pageData",E(1,10,a.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),l(19),m("routerLink","/print/"+(a.afterProcessData.PrintMode=="1"?"Transfer":"TransferMini"))("queryParams",Ae(17,p0,a.afterProcessData.OrderID,a.afterProcessData.PrintTemplateID)),l(7),m("routerLink",N(20,m0))("queryParams",M(21,c0,a.afterProcessData.OrderID)),l(),D("Transfer Order #",a.afterProcessData.InvoiceNumber,""),l(2),m("ngForOf",a.cartItems),l(5),D(" ",E(36,15,P(35,12,a.cartItems,"Quantity"))," "))},dependencies:[X,J,rt,ge,ai,Be,yt,G,Qi,oe],styles:[".print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block;text-align:left}.order-complete[_ngcontent-%COMP%]{display:none}}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.125);padding-bottom:.9375rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:2rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{max-width:500px;margin-top:30px;margin-bottom:30px}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;line-height:15px!important}"]})};var Fn=class t{analyzeService=y(ft);analyze(){this.analyzeService.analyze()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-analyze"]],decls:1,vars:0,consts:[["icon","fa-sharp fa-solid fa-magnifying-glass-chart","label","Load Outlet Inventory",3,"click"]],template:function(e,a){e&1&&(n(0,"POS-dropdown-item-more-action",0),g("click",function(){return a.analyze()}),i())},dependencies:[X,ut],encapsulation:2})};var Vn=class t{voidService=y(Ye);voidTransaction(){this.voidService.void()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-void"]],decls:1,vars:0,consts:[["icon","fa-solid fa-rectangle-xmark","label","Void",3,"click"]],template:function(e,a){e&1&&(n(0,"POS-dropdown-item-more-action",0),g("click",function(){return a.voidTransaction()}),i())},dependencies:[X,ut],encapsulation:2})};var Nn=class t{importCartService=y(wt);importCart(){this.importCartService.import()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-import-cart"]],decls:1,vars:0,consts:[["icon","fa-solid fa-upload","label","Upload",3,"click"]],template:function(e,a){e&1&&(n(0,"POS-dropdown-item-more-action",0),g("click",function(){return a.importCart()}),i())},dependencies:[X,ut],encapsulation:2})};var d0=["serialInput"],kn=class t{constructor(r,e,a){this.dialogRef=r;this.toastr=e;this.scanSerialService=a;this.modalConfig.title="Scan Serial",this.modalConfig.customWidth="350px",this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}serialInputEl;modalConfig=new _e;serial;ngOnInit(){}onKeyDown(r){r.key=="Enter"&&(T.IsNotEmpty(this.serial)?(this.scanSerialService.scanSerial(this.serial),this.serial=null):this.toastr.warning("Serial Can`t be empty","Warning!"),this.setFocusInput())}setFocusInput(){this.serialInputEl&&setTimeout(()=>{this.serialInputEl?.nativeElement?.focus()},500)}static \u0275fac=function(e){return new(e||t)(C(ye),C(ee),C(Mt))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-scan-serial"]],viewQuery:function(e,a){if(e&1&&Ei(d0,5),e&2){let o;Mi(o=Pi())&&(a.serialInputEl=o.first)}},decls:7,vars:2,consts:[["serialInput",""],[3,"onClose","config"],[1,"input-group","mt-3"],["type","text","placeholder","Input Product By Serial","aria-label","Serial",1,"form-control",3,"ngModelChange","keydown","ngModel"],[1,"input-group-text"],[1,"fa-solid","fa-barcode","fs-4"]],template:function(e,a){if(e&1){let o=b();n(0,"modal-material",1),g("onClose",function(){return d(o),u(a.dialogRef.close())}),n(1,"content")(2,"div",2)(3,"input",3,0),h("ngModelChange",function(w){return d(o),S(a.serial,w)||(a.serial=w),u(w)}),g("keydown",function(w){return d(o),u(a.onKeyDown(w))}),i(),n(5,"span",4),f(6,"i",5),i()()()()}e&2&&(m("config",a.modalConfig),l(3),x("ngModel",a.serial))},dependencies:[X,Ge,Ce,R,W,De,fe],encapsulation:2})};var Ln=class t{vcr=y(Oi);matDialog=y(A);scanSerial(){this.matDialog.open(kn,{viewContainerRef:this.vcr})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-scan-serial"]],decls:1,vars:0,consts:[["icon","fa-solid fa-barcode-read","label","Serial",3,"click"]],template:function(e,a){e&1&&(n(0,"POS-dropdown-item-more-action",0),g("click",function(){return a.scanSerial()}),i())},dependencies:[X,ut],encapsulation:2})};var Rn=class t{handleF8(){this.addItem()}itemDialog=y(Pt);addItem(){this.itemDialog.addItem()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-add-item"]],hostBindings:function(e,a){e&1&&g("keydown.F4",function(){return a.handleF8()},!1,ti)},decls:1,vars:0,consts:[["icon","fa-circle-plus fa-solid","label","Add",3,"click"]],template:function(e,a){e&1&&(n(0,"POS-dropdown-item-more-action",0),g("click",function(){return a.addItem()}),i())},dependencies:[X,ut],encapsulation:2})};var u0=t=>({disabled:t}),_0=(t,r)=>({red:t,green:r}),An=class t{RFIDService=y(Xi);matDialog=y(A);constructor(){}onOpenModal(){this.matDialog.open(Ir).componentInstance.onOK.pipe(q(({hostURL:e,bufferTime:a})=>{this.RFIDService.bufferTime=a,this.RFIDService.intializeWebSocket(e)})).subscribe()}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-connect-rfid"]],decls:8,vars:13,consts:[[1,"dropdown-item","px-1","d-flex",3,"click","ngClass"],["aria-hidden","true",1,"fa-solid","fa-wifi","fs-2"],[1,"pe-0","ps-4","fs-6","ms-6","cursor-pointer"],[1,"blob",2,"position","absolute","top","0","right","0",3,"ngClass"]],template:function(e,a){e&1&&(n(0,"div",0),v(1,"async"),g("click",function(){return a.onOpenModal()}),f(2,"i",1),n(3,"label",2),p(4,"Connect RFID"),i(),f(5,"div",3),v(6,"async"),v(7,"async"),i()),e&2&&(m("ngClass",M(8,u0,E(1,2,a.RFIDService.isConnected))),l(5),m("ngClass",Ae(10,_0,!E(6,4,a.RFIDService.isConnected),E(7,6,a.RFIDService.isConnected))))},dependencies:[De,mt,rt],styles:[".disabled[_ngcontent-%COMP%]{color:gray;pointer-events:none;cursor:not-allowed}.blob[_ngcontent-%COMP%]{background:#000;border-radius:50%;box-shadow:0 0 #000;height:15px;width:15px;transform:scale(1);animation:_ngcontent-%COMP%_pulse-black 2s infinite}@keyframes _ngcontent-%COMP%_pulse-black{0%{transform:scale(.95);box-shadow:0 0 #000000b3}70%{transform:scale(1);box-shadow:0 0 0 10px #0000}to{transform:scale(.95);box-shadow:0 0 #0000}}.blob.white[_ngcontent-%COMP%]{background:#fff;box-shadow:0 0 #fff;animation:_ngcontent-%COMP%_pulse-white 2s infinite}@keyframes _ngcontent-%COMP%_pulse-white{0%{transform:scale(.95);box-shadow:0 0 #ffffffb3}70%{transform:scale(1);box-shadow:0 0 0 10px #fff0}to{transform:scale(.95);box-shadow:0 0 #fff0}}.blob.red[_ngcontent-%COMP%]{background:#ff5252;box-shadow:0 0 #ff5252;animation:_ngcontent-%COMP%_pulse-red 2s infinite}@keyframes _ngcontent-%COMP%_pulse-red{0%{transform:scale(.95);box-shadow:0 0 #ff5252b3}70%{transform:scale(1);box-shadow:0 0 0 10px #ff525200}to{transform:scale(.95);box-shadow:0 0 #ff525200}}.blob.orange[_ngcontent-%COMP%]{background:#ff793f;box-shadow:0 0 #ff793f;animation:_ngcontent-%COMP%_pulse-orange 2s infinite}@keyframes _ngcontent-%COMP%_pulse-orange{0%{transform:scale(.95);box-shadow:0 0 #ff793fb3}70%{transform:scale(1);box-shadow:0 0 0 10px #ff793f00}to{transform:scale(.95);box-shadow:0 0 #ff793f00}}.blob.yellow[_ngcontent-%COMP%]{background:#ffb142;box-shadow:0 0 #ffb142;animation:_ngcontent-%COMP%_pulse-yellow 2s infinite}@keyframes _ngcontent-%COMP%_pulse-yellow{0%{transform:scale(.95);box-shadow:0 0 #ffb142b3}70%{transform:scale(1);box-shadow:0 0 0 10px #ffb14200}to{transform:scale(.95);box-shadow:0 0 #ffb14200}}.blob.blue[_ngcontent-%COMP%]{background:#34ace0;box-shadow:0 0 #34ace0;animation:_ngcontent-%COMP%_pulse-blue 2s infinite}@keyframes _ngcontent-%COMP%_pulse-blue{0%{transform:scale(.95);box-shadow:0 0 #34ace0b3}70%{transform:scale(1);box-shadow:0 0 0 10px #34ace000}to{transform:scale(.95);box-shadow:0 0 #34ace000}}.blob.green[_ngcontent-%COMP%]{background:#77d933;box-shadow:0 0 #77d933;animation:_ngcontent-%COMP%_pulse-green 2s infinite}@keyframes _ngcontent-%COMP%_pulse-green{0%{transform:scale(.95);box-shadow:0 0 #33d938b3}70%{transform:scale(1);box-shadow:0 0 0 10px #33d9b200}to{transform:scale(.95);box-shadow:0 0 #33d9b200}}.blob.purple[_ngcontent-%COMP%]{background:#8e44ad;box-shadow:0 0 #8e44ad;animation:_ngcontent-%COMP%_pulse-purple 2s infinite}@keyframes _ngcontent-%COMP%_pulse-purple{0%{transform:scale(.95);box-shadow:0 0 #8e44adb3}70%{transform:scale(1);box-shadow:0 0 0 10px #8e44ad00}to{transform:scale(.95);box-shadow:0 0 #8e44ad00}}"]})};var Bn=class t{clearOutletService=y(Ot);onClear(){this.clearOutletService.clearOutlet()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-clear-outlet"]],decls:1,vars:0,consts:[["icon","fa-trash fa-solid","label","Empty Outlet",3,"click"]],template:function(e,a){e&1&&(n(0,"POS-dropdown-item-more-action",0),g("click",function(){return a.onClear()}),i())},dependencies:[X,ut],encapsulation:2})};var Wn=class t{static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-more-action-shell"]],decls:30,vars:0,consts:[["id","moreMenu","data-bs-toggle","dropdown",1,"d-flex","align-items-center","cursor-pointer"],[1,"me-2"],[1,"fa-solid","fa-caret-down","fa-lg"],[1,"fs-6","headings-font-family","pb-1"],[1,"h-100","d-flex","align-items-center","justify-content-between"],["aria-labelledby","moreMenu",1,"dropdown-menu","more-actions"],[1,"d-flex",2,"width","33rem"],[1,"dropdown-header","text-dark","col"],[1,"h5","mb-4"],[1,"dropdown-divider","m-0"],[1,"cursor-pointer"],[1,"position-relative","cursor-pointer"],["matTooltip","Load all source outlet stock into cart","matTooltipPosition","above",1,"cursor-pointer"]],template:function(e,a){e&1&&(n(0,"span",0)(1,"span",1),f(2,"i",2),i(),n(3,"span",3),p(4,"More Actions"),i()(),n(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),p(10,"Item"),i(),f(11,"div",9),n(12,"li",10),f(13,"POS-add-item"),i(),n(14,"li",10),f(15,"POS-scan-serial"),i(),n(16,"li",10),f(17,"POS-import-cart"),i()(),n(18,"div",7)(19,"div",8),p(20,"Advance"),i(),f(21,"div",9),n(22,"li",10),f(23,"POS-analyze"),i(),n(24,"li",10),f(25,"POS-void"),i(),n(26,"li",11),f(27,"POS-connect-rfid"),i(),n(28,"li",12),f(29,"POS-clear-outlet"),i()()()()())},dependencies:[X,Fn,Vn,Nn,Ln,Rn,An,Bn,Wt,ke],encapsulation:2})};var Hn=class t{courierService=y($t);courierForm=this.courierService.courierID;couriers$=this.courierService.couriers$;addNewCourier(){this.courierService.addNewCourier()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-courier-selection"]],decls:4,vars:4,consts:[[1,"d-flex","align-items-center"],["matTooltipPosition","below","matTooltip","New courier form",1,"fa-solid","fa-user","pointer",3,"click"],["bindLabel","Name","bindValue","ID","placeholder","Assign courier",1,"courier-select","w-100",3,"items","formControl"]],template:function(e,a){e&1&&(n(0,"div",0)(1,"i",1),g("click",function(){return a.addNewCourier()}),i(),f(2,"ng-select",2),v(3,"async"),i()),e&2&&(l(2),m("items",E(3,2,a.couriers$))("formControl",a.courierForm))},dependencies:[X,rt,Ee,Bt,R,oi,Wt,ke],styles:[".courier-select .ng-select-container{border:none} .courier-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border:none;box-shadow:none}"]})};function f0(t,r){if(t&1&&(n(0,"td",22),p(1),i()),t&2){let e=s().index;l(),D(" ",e+1,". ")}}function g0(t,r){if(t&1&&(z(0),n(1,"div",23),f(2,"img",24),i(),$()),t&2){let e=s().$implicit;l(2),m("src",e.ThumbnailUrl,ei)}}function C0(t,r){t&1&&(n(0,"div",25),f(1,"i",26),i())}function v0(t,r){if(t&1&&(n(0,"span"),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),I(E(2,1,e.Quantity))}}function y0(t,r){t&1&&(n(0,"span",27),p(1," x "),i())}function x0(t,r){if(t&1&&(n(0,"span"),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),I(E(2,1,e.UnitQuantity))}}function S0(t,r){if(t&1&&(z(0),n(1,"div",28),p(2),v(3,"number"),i(),$()),t&2){let e=s().$implicit;l(2),D(" ",P(3,1,e.UnitPrice,"1.0-4")," ")}}function h0(t,r){if(t&1&&(n(0,"span"),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D("-",E(2,1,e.Discount),"%")}}function b0(t,r){if(t&1&&(z(0),n(1,"span",29),p(2),v(3,"number"),i(),$()),t&2){let e=s().$implicit;l(2),D(" ",E(3,1,e.Total)," ")}}function D0(t,r){if(t&1){let e=b();n(0,"tr",7),g("contextmenu",function(){let o=d(e).index,c=s(2);return u(c.onContextMenu(o))})("click",function(){let o=d(e),c=o.$implicit,w=o.index,H=s(2);return u(H.update(c,w))}),_(1,f0,2,1,"td",8),n(2,"td",9)(3,"div",10),_(4,g0,3,1,"ng-container",11)(5,C0,2,0,"ng-template",null,1,Z),n(7,"div",12)(8,"div"),p(9),i(),n(10,"span",13),p(11),i(),f(12,"app-serial-note",14)(13,"small",15),i()()(),n(14,"td",16)(15,"span"),_(16,v0,3,3,"span",17)(17,y0,2,0,"span",18)(18,x0,3,3,"span",17),i()(),n(19,"td"),_(20,S0,4,4,"ng-container",17),i(),n(21,"td",19),_(22,h0,3,3,"span",17),i(),n(23,"td",16),_(24,b0,4,3,"ng-container",17),i(),n(25,"td",20)(26,"i",21),g("click",function(){let o=d(e).index,c=s(2);return u(c.deleteVariant(o))}),i()()()}if(t&2){let e=r.$implicit,a=we(6),o=s(2);m("cdkDragDisabled",!o.enabledDragDrop),l(),m("ngIf",o.appConfigJSON==null?null:o.appConfigJSON.ModuleSell.Grid.RowNumberVisible),l(),Nt("ps-0",o.appConfigJSON==null?null:o.appConfigJSON.ModuleSell.Grid.RowNumberVisible),l(2),m("ngIf",e.ThumbnailUrl)("ngIfElse",a),l(5),I(e.Name),l(2),I(e.Code),l(),m("serials",e.Serial),l(),m("innerHtml",e.Note,j),l(3),m("ngIf",e.Quantity!=1||e.UnitQuantity>1),l(),m("ngIf",e.UnitQuantity>1||e.UnitQuantity<-1),l(),m("ngIf",e.UnitQuantity>1||e.UnitQuantity<-1),l(2),m("ngIf",(o.appConfigJSON==null?null:o.appConfigJSON.ModuleDelivery.OutletDelivery.PriceVisible)&&e.Total!=e.UnitPrice),l(2),m("ngIf",e.Discount),l(2),m("ngIf",(o.appConfigJSON==null?null:o.appConfigJSON.ModuleDelivery.OutletDelivery.PriceVisible)&&e.Total)}}function I0(t,r){if(t&1){let e=b();n(0,"div",3)(1,"table",4)(2,"tbody",5),g("cdkDropListDropped",function(o){d(e);let c=s();return u(c.drop(o))}),_(3,D0,27,16,"tr",6),i()()()}if(t&2){let e=s();l(3),m("ngForOf",e.cart)}}function T0(t,r){t&1&&(n(0,"div",30)(1,"div",31)(2,"div",32)(3,"div",33)(4,"div",34),f(5,"i",35),i(),n(6,"div",36)(7,"span"),p(8,"Empty Cart"),i(),f(9,"br"),n(10,"span"),p(11,"Add products to the cart"),i(),f(12,"br"),n(13,"span"),p(14,"or scan barcode"),i()()()()()())}var jn=class t{cart=[];appConfigJSON;role=y(ne);cartService=y(Ze);itemDialog=y(Pt);enabledDragDrop=!0;onOpenContextMenuIndex=-1;constructor(){this.setDragDropEnabled()}setDragDropEnabled(){T.isMobileDevice&&(this.enabledDragDrop=!1)}onContextMenu(r){this.onOpenContextMenuIndex=r}onReturn(){this.cartService.return(this.onOpenContextMenuIndex)}onPurchase(){this.cartService.purchase(this.onOpenContextMenuIndex)}deleteVariant(r){this.cartService.remove(r)}update(r,e){this.itemDialog.editItem(r,e)}drop(r){this.cartService.rearrangeCart(r)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-cart-display"]],inputs:{cart:"cart",appConfigJSON:"appConfigJSON"},decls:3,vars:2,consts:[["EMPTY_CART",""],["NO_IMAGE",""],["PinScrollingBottom","","class","h-100","style","overflow-y: auto",4,"ngIf","ngIfElse"],["PinScrollingBottom","",1,"h-100",2,"overflow-y","auto"],[1,"table","table-borderless"],["cdkDropList","",3,"cdkDropListDropped"],["class","border-bottom","cdkDrag","",3,"cdkDragDisabled","contextmenu","click",4,"ngFor","ngForOf"],["cdkDrag","",1,"border-bottom",3,"contextmenu","click","cdkDragDisabled"],["style","width: 10px",4,"ngIf"],[2,"width","50%"],[1,"d-flex"],[4,"ngIf","ngIfElse"],[1,"ms-4","d-flex","flex-column","justify-content-center",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],[3,"serials"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",3,"innerHtml"],[1,"text-end"],[4,"ngIf"],["class","fs-6",4,"ngIf"],[1,"text-end","text-danger"],[1,"text-end",2,"width","75px"],[1,"fa-solid","fa-trash","fs-4","text-danger","pointer",3,"click"],[2,"width","10px"],[1,"ratio","ratio-1x1",2,"width","55px"],[1,"item-image",3,"src"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6"],[1,"fs-5","text-end"],[1,"fs-5"],[1,"row","g-0","h-100"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"]],template:function(e,a){if(e&1&&_(0,I0,4,1,"div",2)(1,T0,15,0,"ng-template",null,0,Z),e&2){let o=we(2);m("ngIf",a.cart.length)("ngIfElse",o)}},dependencies:[X,J,B,ge,Ri,Wo,Bo,br,dt,wr],styles:[".item-image[_ngcontent-%COMP%]{height:50px;width:56px;display:block;border:solid 1px #dddddd;border-radius:5px;object-fit:contain}.example-menu[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;min-width:180px;max-width:280px;background-color:#fff;padding:6px 0}.example-menu-item[_ngcontent-%COMP%]{background-color:transparent;cursor:pointer;border:none;-webkit-user-select:none;user-select:none;min-width:64px;line-height:36px;padding:0 16px;display:flex;align-items:center;flex-direction:row;flex:1}.example-menu-item[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.example-menu-item[_ngcontent-%COMP%]:active{background-color:#dcdcdc}.table[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:not(caption) > *[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{padding:12px 10px} .cdk-menu.cdk-menu-group.example-menu{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.empty-cart-description[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:#c7c7c7}"]})};var Qn=class t{processTransactionService=y(ht);cart=y(Ze);items$=this.cart.cart$.pipe(V(r=>r.length));qtyTotal$=this.cart.cart$.pipe(V(r=>r.reduce((e,a)=>e+a.Quantity,0)));processTransaction(){this.processTransactionService.processTransaction()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-process"]],decls:6,vars:6,consts:[["type","button",1,"btn","btn-success","w-100","fs-3","px-0","py-6",2,"border-left","0.1px solid #fff",3,"click"],[1,"fs-6"]],template:function(e,a){e&1&&(n(0,"button",0),g("click",function(){return a.processTransaction()}),p(1," Process "),n(2,"small",1),p(3),v(4,"async"),v(5,"async"),i()()),e&2&&(l(3),Qe("(",E(4,2,a.items$)," items, ",E(5,4,a.qtyTotal$)," Qty)"))},dependencies:[X,rt],encapsulation:2})};var qn=class t{deliveryTypeService=y(Gt);openDeliveryTypeDialog(){this.deliveryTypeService.openDeliveryTypeDialog()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-delivery-type-note"]],decls:2,vars:0,consts:[["type","button",1,"btn","btn-gray","w-100","fs-3","px-0","py-6","headings-font-family",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"]],template:function(e,a){e&1&&(n(0,"button",0),g("click",function(){return a.openDeliveryTypeDialog()}),f(1,"i",1),i())},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};var Un=class t{constructor(r){this.dialogRef=r;this.modalConfig.title="Clear Order?",this.modalConfig.headerType=ve.Success}modalConfig=new _e;onOk(){this.dialogRef.close("ok")}close(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||t)(C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-clear-cart"]],decls:4,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"fw-normal"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.onOk()})("onCancel",function(){return a.close()})("onClose",function(){return a.close()}),n(1,"content")(2,"h4",1),p(3,"This will erase all items in cart. Are you sure?"),i()()()),e&2&&m("config",a.modalConfig)},dependencies:[De,fe],encapsulation:2})};var zn=class t{dialog=y(A);cartService=y(Ze);clearCart(){this.dialog.open(Un).afterClosed().subscribe(e=>{e==="ok"&&this.cartService.clear()})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-clear-cart"]],decls:3,vars:0,consts:[[1,"w-100"],["type","button",1,"btn","btn-gray","w-100","fs-3","px-0","py-6","headings-font-family",3,"click"]],template:function(e,a){e&1&&(n(0,"div",0)(1,"button",1),g("click",function(){return a.clearCart()}),p(2," Clear "),i()())},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};var $n=class t{static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-cart-action-shell"]],decls:7,vars:0,consts:[[1,"row","g-0","pb-6","px-5"],[1,"col-1","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],[2,"flex-grow","1"],[1,"col-4","pe-5"],[1,"col-7"]],template:function(e,a){e&1&&(n(0,"div",0)(1,"div",1),f(2,"POS-delivery-type-note",2),i(),n(3,"div",3),f(4,"POS-clear-cart"),i(),n(5,"div",4),f(6,"POS-process"),i()())},dependencies:[X,Qn,qn,zn],encapsulation:2})};function w0(t,r){if(t&1&&(z(0),f(1,"POS-complete",2),v(2,"async"),v(3,"async"),$()),t&2){let e=s();l(),m("afterProcessData",E(2,3,e.completeData$))("cartItems",E(3,5,e.cart$))("orderNumber",e.orderNumberForm.value)}}function O0(t,r){if(t&1){let e=b();n(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"POS-select-outlet-form",8),v(6,"async"),v(7,"async"),g("onCloseDialog",function(){d(e);let o=s();return u(o.onCloseDialog())}),i(),f(8,"i",9)(9,"POS-select-outlet-form",10),v(10,"async"),v(11,"async"),i(),f(12,"POS-invoice-number-form",11),v(13,"async"),f(14,"POS-invoice-date",12),i()(),n(15,"div",13)(16,"div",14)(17,"div",15),f(18,"POS-more-action-shell"),i(),n(19,"div",16),f(20,"POS-courier-selection"),i(),n(21,"div",17)(22,"div",18)(23,"button",19),v(24,"async"),g("click",function(){d(e);let o=s();return u(o.collapseSidebar())}),f(25,"span",20)(26,"span",20)(27,"span",20),i()()()()()(),n(28,"div",21)(29,"div",5),f(30,"POS-quick-key",22),v(31,"async"),i(),n(32,"div",23)(33,"div",24)(34,"div",25),f(35,"POS-variant-autocomplete",26),i()(),f(36,"POS-cart-display",27),v(37,"async"),v(38,"async"),f(39,"POS-cart-action-shell"),i()()()}if(t&2){let e=s();l(5),m("outlets",E(6,24,e.outlets$))("isOpenAfterLoad",E(7,26,e.isOpenOutletDialog$))("formControl",e.sourceOutletForm)("limitOutletText",e.limitOutletText),l(4),m("outlets",E(10,28,e.destination$))("isOpenAfterLoad",E(11,30,e.isOpenDestinationDialog$))("hideLocationIcon",!0)("formControl",e.destinationOutletForm)("limitOutletText",e.limitOutletText)("sourceOutletID",e.sourceOutletForm.value.ID),l(3),m("formControl",e.orderNumberForm)("isEdit",E(13,32,e.isEdit$)),l(2),m("formControl",e.dateForm)("tooltip",e.role.global!=null&&e.role.global.Date?"":"Date role is required"),l(9),Nt("change",E(24,34,e.toggleState$)),l(6),Nt("pt-5",e.sourceOutletForm.value.ID),l(),m("quickKey",E(31,36,e.quickKeyItems$))("outletID",e.sourceOutletForm.value.ID)("formControl",e.itemQuickKeyID),l(5),m("formControl",e.variantAutocompleteForm),l(),m("cart",E(37,38,e.cart$))("appConfigJSON",E(38,40,e.appConfigJSON$))}}var Gn=class t{limitOutletText=12;isEditService=y(Rt);isEdit$=this.isEditService.isEdit$;isComplete=y(Ti);outlet=y(ce);loadForm=y(Re);isOpenOutletDialog=y(Ii);orderNumber=y(Xt);invoiceDate=y(Yt);quickKeyItems=y(Kt);cart=y(Ze);intercom=y(bo);lowOnStock=y(jt);overOnStock=y(Qt);variantAutocomplete=y(Jt);processTransaction=y(ht);toggle=y(Do);title=y(ni);role=y(ne);isComplete$=this.isComplete.isComplete$;sourceOutletForm=this.outlet.sourceOutlet;destinationOutletForm=this.outlet.destinationOutlet;outlets$=this.loadForm.outlets$;destination$=this.sourceOutletForm?.valueChanges.pipe(ze(this.sourceOutletForm?.value),Q(r=>this.loadForm.destinations$.pipe(V(e=>e?.filter(o=>o.ID!==r?.ID)))));isOpenOutletDialog$=this.isOpenOutletDialog.isOpenOutletDialog$;isOpenDestinationDialog$=this.isOpenOutletDialog.isOpenDestinationDialog$;orderNumberForm=this.orderNumber.orderNumber;dateForm=this.invoiceDate.invoiceDate;quickKeyItems$=this.quickKeyItems.quickKeyItems$;itemQuickKeyID=this.quickKeyItems.itemQuickKeyID;appConfigJSON$=this.loadForm.config$;cart$=this.cart.cart$;variantAutocompleteForm=this.variantAutocomplete.variantAutocomplete;completeData$=this.processTransaction.submitOrder$;toggleState$=this.toggle.toggleState$;constructor(){this.title.setTitle(this.title.getTitle()+" | Transfer Order"),this.role?.sell?.Number==!1&&this.orderNumberForm.disable(),this.role.global.Date==!1&&this.dateForm.disable(),Ve(this.outlet.sourceOutletID$,this.outlet.destinationOutletID$,this.cart$).pipe(pt()).subscribe(()=>this.focusSearchInput())}focusSearchInput(){let r=document.getElementById("product_search");r&&r.focus()}ngAfterViewInit(){this.intercom.hideLauncher()}ngOnDestroy(){this.intercom.showLauncher(),this.lowOnStock.resetLowOnStock(),this.overOnStock.resetOverOnStock()}collapseSidebar(){this.toggle.toggleSidebar()}onCloseDialog(){this.isOpenOutletDialog.onCloseOutletDialog()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-transfer-order-v2"]],features:[xo([Ze,$t,Yt,Ii,Xt,ce,Kt,ft,Ot,Fe,wt,Mn,Ti,ht,Mt,Gt,Ye,Jt,te,Pt,Et,Rt])],decls:4,vars:4,consts:[["ISNOTCOMPLETE",""],[4,"ngIf","ngIfElse"],[3,"afterProcessData","cartItems","orderNumber"],[1,"container-fluid"],[1,"row","header","border-bottom"],[1,"col-5","border-end"],[1,"left-toolbar-container","h-100","d-flex","align-items-center","justify-content-between"],[1,"d-flex"],[3,"onCloseDialog","outlets","isOpenAfterLoad","formControl","limitOutletText"],[1,"fa-solid","fa-arrow-right","ms-4","me-2","mt-2"],["dialogTitle","Choose Destination Outlet",3,"outlets","isOpenAfterLoad","hideLocationIcon","formControl","limitOutletText","sourceOutletID"],["transactionType","Transfer Order",3,"formControl","isEdit"],[3,"formControl","tooltip"],[1,"col-7","d-flex","align-items-center"],[1,"row","flex-grow-1"],[1,"col-lg-7","col-5","d-flex","align-items-center"],[1,"col-5","ps-0"],[1,"col-2"],[1,"navbar","mobile-button","border-bottom-0"],["type","button","aria-controls","navigation-index","aria-expanded","false","aria-label","Toggle navigation",1,"navbar-toggler","navbar-toggler-right","float-end","toggle-menu","ps-2","pe-0","border-0",2,"width","max-content","height","max-content",3,"click"],[1,"navbar-toggler-bar","burger-lines"],[1,"row","content"],[3,"quickKey","outletID","formControl"],[1,"col-7","pt-5","px-0","d-flex","flex-column"],[1,"row","w-100","ms-0"],[1,"col-12","px-0"],["inputID","product_search",3,"formControl"],[1,"cart-display",3,"cart","appConfigJSON"]],template:function(e,a){if(e&1&&(_(0,w0,4,7,"ng-container",1),v(1,"async"),_(2,O0,40,42,"ng-template",null,0,Z)),e&2){let o=we(3);m("ngIf",E(1,2,a.isComplete$))("ngIfElse",o)}},dependencies:[X,B,rt,Pn,xr,Bt,R,oi,Sr,lr,Wn,Hn,hr,jn,$n,Yi],styles:[".left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:32px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{min-height:calc(100vh - 60px)}.supplier-more-menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.cart-display[_ngcontent-%COMP%]{flex-grow:1;height:0px;overflow-y:auto}input[_ngcontent-%COMP%]{width:100%;height:38px!important;border:0;border-bottom:1px solid #ced4da;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:13px}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]{transition:.4s}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(1){-webkit-transform:rotate(-45deg) translate(-8px,4px);transform:rotate(-45deg) translate(-8px,4px)}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(2){opacity:0}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(45deg) translate(-5px,0px);transform:rotate(45deg) translate(-5px)}.mobile-button[_ngcontent-%COMP%]{display:none}@media (max-width: 990px){.mobile-button[_ngcontent-%COMP%]{display:block}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.more-actions[_ngcontent-%COMP%] div.d-flex[_ngcontent-%COMP%]{width:30rem}"]})};var E0=()=>["/menu/Logistics/Setup/Courier/Form"],M0=()=>["/menu/Logistics/Archive/Transfer_Order/Info"],P0=t=>({ID:t}),F0=(t,r,e)=>({"text-success":t,"text-warning":r,"text-danger":e}),V0=()=>["/print/Transfer"],N0=(t,r)=>({ID:t,Template:r});function k0(t,r){if(t&1){let e=b();n(0,"a",20),g("click",function(){d(e);let o=s(2);return u(o.httpPostListID("TransferOrder/Delete"))}),f(1,"i",21),p(2," Delete"),i()}}function L0(t,r){if(t&1){let e=b();n(0,"div",22)(1,"h6"),p(2,"Source"),i(),n(3,"outlet-selector",23),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"Destination"),i(),n(6,"outlet-selector",24),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.DestinationID,o)||(c.pageData.Filter.DestinationID=o),u(o)}),i(),n(7,"h6"),p(8,"Fulfillment"),i(),n(9,"ng-select",25),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.StateID,o)||(c.pageData.Filter.StateID=o),u(o)}),i(),n(10,"h6"),p(11,"Tag"),i(),n(12,"ng-select",26),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.TypeID,o)||(c.pageData.Filter.TypeID=o),u(o)}),i(),n(13,"h6"),p(14,"Courier"),i(),n(15,"ng-select",27),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CourierID,o)||(c.pageData.Filter.CourierID=o),u(o)}),i(),n(16,"h6"),p(17,"From"),i(),n(18,"datepicker",28),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(19,"h6"),p(20,"To"),i(),n(21,"datepicker",29),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i(),n(22,"h6"),p(23,"Creator"),i(),n(24,"autocompleteV2",30),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CreatorID,o)||(c.pageData.Filter.CreatorID=o),u(o)}),i(),n(25,"h6"),p(26,"Sort By"),i(),n(27,"radio-options",31),h("modelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.SortBy,o)||(c.pageData.Filter.SortBy=o),u(o)}),i(),n(28,"h6"),p(29,"Page Size"),i(),n(30,"input",32),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.RowCount,o)||(c.pageData.Filter.RowCount=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),m("accessType",2),x("ngModel",e.pageData.Filter.DestinationID),m("multiple",!1),l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.StateID),l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Courier),x("ngModel",e.pageData.Filter.CourierID),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("ngModel",e.pageData.Filter.CreatorID),l(3),m("options",e.pageData.Options==null?null:e.pageData.Options.SortOption),x("model",e.pageData.Filter.SortBy),l(3),x("ngModel",e.pageData.Filter.RowCount),m("max",1e4)}}function R0(t,r){if(t&1){let e=b();n(0,"th",33)(1,"input",34),g("change",function(o){d(e);let c=s(2);return u(c.onSelectAllData(o.target.checked))}),i()()}}function A0(t,r){t&1&&(n(0,"th",35),p(1," Price "),i())}function B0(t,r){if(t&1){let e=b();n(0,"td",33)(1,"input",40),h("ngModelChange",function(o){d(e);let c=s().$implicit;return S(c.selected,o)||(c.selected=o),u(o)}),i()()}if(t&2){let e=s().$implicit;l(),x("ngModel",e.selected)}}function W0(t,r){if(t&1&&(n(0,"td",35),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.Price)," ")}}function H0(t,r){if(t&1&&(n(0,"span"),p(1),i()),t&2){let e=s().$implicit;l(),I(e.Courier)}}function j0(t,r){if(t&1&&(n(0,"span"),p(1),i()),t&2){let e=s().$implicit;l(),I(e.CourierName)}}function Q0(t,r){if(t&1&&(n(0,"tbody")(1,"tr"),_(2,B0,2,1,"td",10),n(3,"td"),p(4),i(),n(5,"td"),p(6),i(),n(7,"td"),f(8,"a",36),i(),n(9,"td"),p(10),v(11,"date"),i(),n(12,"td"),p(13),v(14,"date"),i(),n(15,"td",35),p(16),i(),_(17,W0,3,3,"td",15),n(18,"td"),p(19),i(),n(20,"td"),p(21),i(),n(22,"td"),p(23),i(),n(24,"td"),_(25,H0,2,1,"span",37)(26,j0,2,1,"span",37),i(),n(27,"td")(28,"a",38),f(29,"i",39),i()()()()),t&2){let e=r.$implicit,a=s(2);l(2),m("ngIf",a.role.logistic.Delete),l(2),I(e.Source),l(2),I(e.Destination),l(2),m("routerLink",N(25,M0))("queryParams",M(26,P0,e.ID))("innerHTML",e.Number,j),l(2),I(P(11,19,e.Date,"dd MMM yyyy")),l(3),I(P(14,22,e.Created,"HH:mm")),l(3),I(e.Quantity),l(),m("ngIf",a.role.sell.PriceVisible&&a.pageData.Config.PriceVisible),l(),ot(Fi(28,F0,e.StateLabel=="Received",e.StateLabel=="Dispatched",e.StateLabel=="Approved")),l(),D(" ",e.StateLabel," "),l(2),I(e.CreatorName),l(2),I(e.TypeName),l(2),m("ngIf",e.Courier!=null),l(),m("ngIf",e.CourierName!=null&&e.Courier==null),l(2),m("routerLink",N(32,V0))("queryParams",Ae(33,N0,e.ID,e.SourceTemplateID))}}function q0(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Number,o)||(c.pageData.Filter.Number=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,k0,3,0,"a",3),n(3,"a",4),p(4,"Add"),i()(),n(5,"filters"),_(6,L0,31,21,"ng-template",null,0,Z),i(),n(8,"content")(9,"div",5)(10,"div",6)(11,"table",7)(12,"thead",8)(13,"tr",9),_(14,R0,2,0,"th",10),n(15,"th",11),p(16,"Source"),i(),n(17,"th",12),p(18,"Destination"),i(),n(19,"th"),p(20,"Number"),i(),n(21,"th",13),p(22,"Date"),i(),n(23,"th",13),p(24,"Time"),i(),n(25,"th",14),p(26,"Qty"),i(),_(27,A0,2,0,"th",15),n(28,"th",13),p(29,"Status"),i(),n(30,"th",16),p(31,"Creator"),i(),n(32,"th",13),p(33,"Tag"),i(),n(34,"th",13),p(35,"Courier"),i(),f(36,"th",17),i()(),_(37,Q0,30,36,"tbody",18),i()(),n(38,"POS-complex-pagination",19),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.role.logistic.Delete&&e.getSelectedData().length>0),l(),m("routerLink",N(11,E0)),l(11),m("ngIf",e.role.logistic.Delete),l(13),m("ngIf",e.role.sell.PriceVisible&&e.pageData.Config.PriceVisible),l(10),m("ngForOf",e.data.Data),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var Kn=class t extends Se{constructor(e,a,o,c){super(e,a,"transferorder/VoidedTransferOrderList","TransferOrderLoader/TransferOrderList",o);this.roleService=c}radioOption;role=y(ne);static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(ee),C(ne))};static \u0275cmp=O({type:t,selectors:[["POS-recycle-bin"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","class","btn btn-outline-secondary me-5",3,"click",4,"ngIf"],[1,"button","btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","100px"],[2,"width","150px"],[2,"width","90px"],[1,"text-end",2,"width","50px"],["class","text-end",4,"ngIf"],[2,"width","120px"],[2,"width","16px"],[4,"ngFor","ngForOf"],["api","TransferOrder/VoidedTransferOrderRowsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fas","fa-trash"],[1,"dialog-filter"],["placeholder","Source",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","Destination",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["bindLabel","Value","bindValue","Key","placeholder","Choose",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Options",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose a courier",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["requestUrl","/API/AC/GetUserSuggestion",1,"input-left","w-100","ac-filter",3,"ngModelChange","ngModel"],["name","SortBy",3,"modelChange","options","model"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","ngModel","max"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"text-end"],[3,"routerLink","queryParams","innerHTML"],[4,"ngIf"],["target","_blank",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa","fa-print"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(a,o){a&1&&_(0,q0,39,12,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,Ce,Dt,R,W,oe,de,Ht,We,Je,ct,Ee,Pe,ge,he],encapsulation:2})};var U0=()=>["/menu/Logistics/Archive/Transfer_Order/Info"],z0=t=>({ID:t});function $0(t,r){if(t&1){let e=b();n(0,"button",12),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",13),p(2," Export "),i()}}function G0(t,r){if(t&1){let e=b();n(0,"div",14)(1,"h6"),p(2,"Source"),i(),n(3,"outlet-selector",15),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.OutletSourceIds,o)||(c.pageData.Filter.OutletSourceIds=o),u(o)}),i(),n(4,"h6"),p(5,"Destination"),i(),n(6,"outlet-selector",16),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.OutletDestinationIds,o)||(c.pageData.Filter.OutletDestinationIds=o),u(o)}),i(),n(7,"h6"),p(8,"Action"),i(),n(9,"ng-select",17),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.ActionTypeID,o)||(c.pageData.Filter.ActionTypeID=o),u(o)}),i(),n(10,"h6"),p(11,"From"),i(),n(12,"datepicker",18),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(13,"h6"),p(14,"To"),i(),n(15,"datepicker",19),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i(),n(16,"h6"),p(17,"Creator"),i(),n(18,"autocompleteV2",20),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.UserID,o)||(c.pageData.Filter.UserID=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",2),x("ngModel",e.pageData.Filter.OutletSourceIds),m("multiple",!0),l(3),m("accessType",2),x("ngModel",e.pageData.Filter.OutletDestinationIds),m("multiple",!0),l(3),m("items",e.pageData.Options.ActionTypeOptions),x("ngModel",e.pageData.Filter.ActionTypeID),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("ngModel",e.pageData.Filter.UserID)}}function K0(t,r){if(t&1&&f(0,"a",24),t&2){let e=s().$implicit;m("routerLink",N(3,U0))("queryParams",M(4,z0,e.TransferOrderID))("innerHTML",e.TransferOrderNumber,j)}}function J0(t,r){if(t&1&&(n(0,"span",25),p(1),i()),t&2){let e=s().$implicit;l(),D(" ",e.TransferOrderNumber,"")}}function Y0(t,r){if(t&1&&(n(0,"tr")(1,"td"),p(2),i(),n(3,"td"),p(4),i(),n(5,"td"),_(6,K0,1,6,"a",21)(7,J0,2,1,"span",22),i(),n(8,"td"),p(9),v(10,"date"),i(),n(11,"td"),p(12),v(13,"date"),i(),n(14,"td"),p(15),i(),n(16,"td"),p(17),i(),n(18,"td"),p(19),i(),f(20,"td",23),i()),t&2){let e=r.$implicit;l(2),I(e.OutletSourceName),l(2),I(e.OutletDestinationName),l(2),m("ngIf",!e.IsDeleted),l(),m("ngIf",e.IsDeleted),l(2),I(P(10,10,e.Created,"dd MMM yyyy")),l(3),I(P(13,13,e.Created,"HH:mm")),l(3),I(e.CreatorUserName),l(2),I(e.Quantity),l(2),I(e.ActionType),l(),m("innerHTML",e.Note,j)}}function X0(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.TransferOrderNumber,o)||(c.pageData.Filter.TransferOrderNumber=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,$0,3,0,"button",3),i(),n(3,"filters"),_(4,G0,19,13,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th"),p(13,"Outlet"),i(),n(14,"th"),p(15,"Destination"),i(),n(16,"th",8),p(17,"Number"),i(),n(18,"th"),p(19,"Date"),i(),n(20,"th"),p(21,"Time"),i(),n(22,"th"),p(23,"Creator"),i(),n(24,"th"),p(25,"Qty"),i(),n(26,"th"),p(27,"Action"),i(),n(28,"th",9),p(29,"Note"),i()()(),n(30,"tbody"),_(31,Y0,21,16,"tr",10),i()()(),n(32,"POS-complex-pagination",11),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.TransferOrderNumber),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(29),m("ngForOf",e.data),l(),m("total",e.data.length)("pageData",e.pageData)}}var Jn=class t extends Se{constructor(e,a,o,c,w,H){super(e,a,"TransferOrder/gettransferorderupdatehistories","TransferOrderLoader/loadtransferorderupdatehistory",null,w);this.csvConverter=o;this.roleService=c;this.matDialog=H}openExportModal(){this.matDialog.open(Ie,{data:{title:"Transfer Order Update History",exportTypes:[{ID:"transferorderexport/gettransferorderupdatehistories",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}scopeOptions=[{Key:!1,Value:"Variant"},{Key:!0,Value:"Product"}];static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(pe),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-transfer-update-history"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","150px"],[2,"width","400px"],[4,"ngFor","ngForOf"],["api","transferorder/gettransferorderupdatehistoriescount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Source",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","Destination",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["bindLabel","Value","bindValue","Key","appendTo","body",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["requestUrl","/API/AC/GetUserSuggestion",1,"input-left","w-100","ac-filter",3,"ngModelChange","ngModel"],[3,"routerLink","queryParams","innerHTML",4,"ngIf"],["class","text-danger",4,"ngIf"],[3,"innerHTML"],[3,"routerLink","queryParams","innerHTML"],[1,"text-danger"]],template:function(a,o){a&1&&_(0,X0,33,8,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,We,Je,Ee,Pe,he],encapsulation:2})};var Z0=[{path:"Archive/Transfer_Order",component:Zi},{path:"Archive/Transfer_Order/Info",component:dn},{path:"Archive/Transfer_Order/Form",component:Gn},{path:"Archive/Transfer_Order/Receive",component:xn},{path:"Archive/Outbound_Logistics",component:en},{path:"Archive/Outbound_Logistics/Info",component:on},{path:"Archive/Outbound_Logistics/Form",component:bn},{path:"Archive/Inbound_Logistics",component:tn},{path:"Archive/Inbound_Logistics/Info",component:_n},{path:"Archive/Inbound_Logistics/Form",component:Dn},{path:"Report/Outbound/Product",component:rn},{path:"Report/Outbound/Detail",component:an},{path:"Report/Outbound/Logistics_Service",component:rr},{path:"Report/Outbound/Logistics_Service/Detail",component:In},{path:"Report/Inbound/Product",component:ln},{path:"Report/Inbound/Detail",component:pn},{path:"Report/Transfer/Product",component:mn},{path:"Report/Transfer/Detail",component:cn},{path:"Report/Transfer/History",component:Jn},{path:"Setup/Courier",component:Cn},{path:"Setup/Courier/Form",component:vn},{path:"Setup/Courier/Info",loadComponent:()=>import("./chunk-EPUDCYJW.js").then(t=>t.CourierInfoComponent)},{path:"Setup/Recycle_Bin",component:Kn},{path:"",redirectTo:"Archive/Transfer_Order",pathMatch:"full"}],Yn=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=ii({type:t});static \u0275inj=Zt({imports:[yt.forChild(Z0),yt]})};var Xn=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=ii({type:t});static \u0275inj=Zt({imports:[X,De,Ge,st]})};var $r=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=ii({type:t});static \u0275inj=Zt({imports:[X,De,Yn,Ge,Bt,ai,Oo,Mo,Po,No,Lo,Qi,qi,Ko,jo,Mr,ji,Yo,Wi,Ee,Ri,pr,Pr,Xn,Fr,Ji,Ni,st,Ro,Wt,Gi,Dr,vr,wo,Ui,dt,li,zi,Pe,or,ko,nr,Ki]})};export{$r as DeliveryModule};
|
|
3
|
+
.`,headerType:ve.Warning},width:"500px"}),o=!1),o}convertCartItemsToForm(r){return r.filter(a=>!a.Completed).map(a=>({ID:a.ID,Name:a.Name,VariantID:a.VariantID,Quantity:a.QuantityDelivered,PackSize:a.PackSize,Serial:a.Serial,UnitQuantity:1,Note:a.Note,InventoryTypeID:a.TypeID}))}newForm(r){this.router.navigate([`/menu/Logistics/Archive/${r}/Form`]).then(()=>window.location.reload())}undo(r,e){this.router.navigate([`/menu/Logistics/Archive/${e}/Form`],{queryParams:{ID:r}}).then(()=>window.location.reload())}mappingItemWithCsv(r,e){return e=e.map(a=>(r.forEach(o=>{o.Quantity=parseFloat(o.Quantity),o.Code==a.Code&&(a.QuantityDelivered=o.Quantity)}),a)),e}toastrShowToastrNotFoundItems(r,e){let a=r.filter(o=>{let c=e.find(w=>w.Code==o.Code);return!!T.IsEmpty(c)});a.length>0&&this.toastr.error(`Items with code ${a.map(o=>o.Code)?.join(", ")} is not found`,"Not Found Items")}static \u0275fac=function(e){return new(e||t)(Vt(ee),Vt(at),Vt(A))};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Hr=t=>[t],Nc=(t,r)=>({ID:t,Template:r}),kc=t=>({ID:t});function Lc(t,r){if(t&1&&(z(0),n(1,"div",27),p(2),i(),n(3,"div",27),p(4),v(5,"number"),i(),$()),t&2){let e=s().$implicit;l(2),I(e.Name),l(2),I(E(5,2,e.Quantity))}}function Rc(t,r){if(t&1&&(n(0,"div",25),_(1,Lc,6,4,"ng-container",26),i()),t&2){let e=r.$implicit;l(),m("ngIf",e.Quantity!=0)}}function Ac(t,r){if(t&1&&(n(0,"div",21),_(1,Rc,2,1,"div",22),n(2,"div",23)(3,"div",24),p(4,"Total Delivered Quantity:"),i(),n(5,"div",24),p(6),v(7,"sum"),v(8,"number"),i()()()),t&2){let e=s();l(),m("ngForOf",e.items),l(5),D("",E(8,5,P(7,2,e.items,"Quantity"))," ")}}var ci=class t{afterSubmitData;items;state;undo=new gi;newForm=new gi;onUndo(){this.undo.emit(this.afterSubmitData.ID)}onNewForm(){this.newForm.emit()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-complete-customer-supplier"]],inputs:{afterSubmitData:"afterSubmitData",items:"items",state:"state"},outputs:{undo:"undo",newForm:"newForm"},standalone:!1,decls:27,vars:18,consts:[[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","py-5"],[1,"btn","bg-light-gray","btn-secondary",3,"click"],[1,"fa-solid","fa-reply","me-2"],["target","_blank",1,"btn","bg-light-gray","btn-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],["class","card-body",4,"ngIf"],[1,"card-body"],["class","row justify-content-between mb-3",4,"ngFor","ngForOf"],[1,"row","justify-content-end","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col-4","text-end"],[1,"row","justify-content-between","mb-3"],[4,"ngIf"],[1,"col","text-end"]],template:function(e,a){e&1&&(n(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3)(4,"h1",4),f(5,"i",5),p(6),i()(),n(7,"div",6)(8,"div",7)(9,"div",8)(10,"a",9),g("click",function(){return a.onNewForm()}),p(11),i()()()(),n(12,"div",10)(13,"div",11)(14,"button",12),g("click",function(){return a.onUndo()}),f(15,"i",13),p(16,"Undo"),i(),n(17,"a",14),f(18,"i",15),p(19,"Print Receipt"),i()()()()(),n(20,"div",16)(21,"div",2)(22,"div",17)(23,"h2",18)(24,"a",19),p(25),i()()(),_(26,Ac,9,7,"div",20),i()()()),e&2&&(l(6),D("",a.state," Logistics Complete"),l(5),D("New ",a.state," Logistics (F8)"),l(6),m("routerLink",M(9,Hr,a.state=="Outbound"?"/print/OutDelivery":"/print/InDelivery"))("queryParams",Ae(11,Nc,a.afterSubmitData.ID,a.afterSubmitData.Template)),l(7),m("routerLink",M(14,Hr,a.state=="Outbound"?"/menu/Logistics/Archive/Outbound_Logistics/Info":"/menu/Logistics/Archive/Inbound_Logistics/Info"))("queryParams",M(16,kc,a.afterSubmitData.ID)),l(),Qe("",a.state," Logistics #",a.afterSubmitData.DeliveryNumber,""),l(),m("ngIf",a.items.length>0))},dependencies:[J,B,G,ge,Be],encapsulation:2,changeDetection:0})};var si=class t{form;tinyEditorApiKey="zc58cdrrftek5r5igtmjiar7ed4n3wr00hzd4w4mvtx8mpxa";static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-tinymce-note"]],inputs:{form:"form"},standalone:!1,decls:6,vars:1,consts:[[1,"card-header"],[1,"fa-solid","fa-note-sticky","me-5"],[1,"card-body"],["height","220px",3,"ngModelChange","ngModel"]],template:function(e,a){e&1&&(n(0,"div",0)(1,"h2"),f(2,"i",1),p(3,"Note "),i()(),n(4,"div",2)(5,"POS-tinymce-editor",3),h("ngModelChange",function(c){return S(a.form.Header.Note,c)||(a.form.Header.Note=c),c}),i()()),e&2&&(l(5),x("ngModel",a.form.Header.Note))},dependencies:[R,W,xt],encapsulation:2,changeDetection:0})};var Wc=t=>({"mt-10":t});function Hc(t,r){if(t&1){let e=b();n(0,"mat-chip-row",19),g("removed",function(){let o=d(e).$implicit,c=s(3);return u(c.onRemoveSerialChip(o))}),p(1),n(2,"button",20),f(3,"i",21),i()()}if(t&2){let e=r.$implicit;l(),D(" ",e," ")}}function jc(t,r){if(t&1){let e=b();z(0),n(1,"div",10)(2,"div",11)(3,"mat-form-field",12),g("keyup.enter",function(o){return d(e),u(o.stopPropagation())}),n(4,"mat-chip-grid",null,1),_(6,Hc,4,1,"mat-chip-row",13),n(7,"input",14,2),g("matChipInputTokenEnd",function(o){d(e);let c=we(8),w=s(2);return u(w.addSerial(o,c))}),i()()()(),n(9,"div",15)(10,"button",16),g("click",function(){d(e);let o=s(2);return u(o.submitSerial())}),f(11,"i",17),n(12,"strong",18),p(13,"ADD"),i()()()(),$()}if(t&2){let e=we(5),a=s(2);l(6),m("ngForOf",a.selectedSerialCode),l(),m("matChipInputFor",e)("matChipInputSeparatorKeyCodes",a.separatorKeysCodes)}}function Qc(t,r){if(t&1){let e=b();n(0,"ng-select",22),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.selectedSerialCode,o)||(c.selectedSerialCode=o),u(o)}),g("change",function(o){d(e);let c=s(2);return u(c.onSelectSerial(o))}),i()}if(t&2){let e=s(2);m("items",e.serialSources)("multiple",!0),x("ngModel",e.selectedSerialCode),m("disabled",e.isStateEdit)}}function qc(t,r){t&1&&f(0,"th",31)}function Uc(t,r){if(t&1){let e=b();n(0,"td",34)(1,"i",35),g("click",function(){d(e);let o=s().index,c=s(3);return u(c.onRemoveSerial(o))}),i()()}}function zc(t,r){if(t&1){let e=b();n(0,"tr"),_(1,Uc,2,0,"td",32),n(2,"td"),p(3),i(),n(4,"td")(5,"input",33),h("ngModelChange",function(o){let c=d(e).$implicit;return S(c.Quantity,o)||(c.Quantity=o),u(o)}),i()()()}if(t&2){let e=r.$implicit,a=s(3);l(),m("ngIf",!a.isStateEdit),l(2),I(e.Number),l(2),x("ngModel",e.Quantity),m("disabled",a.isStateEdit)("decimalPlaces",0)}}function $c(t,r){if(t&1&&(z(0),n(1,"div",23)(2,"div",24)(3,"table",25)(4,"thead",26)(5,"tr"),_(6,qc,1,0,"th",27),n(7,"th",28),p(8,"Serial Number"),i(),n(9,"th",29),p(10,"Quantity"),i()()(),n(11,"tbody"),_(12,zc,6,5,"tr",30),i()()()(),$()),t&2){let e=s(2);l(6),m("ngIf",!e.isStateEdit),l(6),m("ngForOf",e.selectedSerial)}}function Gc(t,r){if(t&1&&(z(0),_(1,jc,14,3,"ng-container",9)(2,Qc,1,4,"ng-template",null,0,Z)(4,$c,13,2,"ng-container",5),$()),t&2){let e=we(3),a=s();l(),m("ngIf",a.isEmptySerial&&a.state=="Inbound_Logistics")("ngIfElse",e),l(3),m("ngIf",a.selectedSerial.length>0)}}var hn=class t{constructor(r,e,a,o,c){this.data=r;this.dialogRef=e;this.toastr=a;this.logisticProductService=o;this.productService=c;this.config=new _e,this.config.title=r?.name,this.config.customWidth="550px",this.note=r?.note,this.fulfillmentOutletId=r.fulfillmentOutletId,this.state=this.data.state,this.isStateEdit=this.data.isEdit,this.initItemSerial()}separatorKeysCodes=[13,188];config;note;fulfillmentOutletId;isSerialized=!1;selectedSerial=[];serialSources=[];selectedSerialCode;isFocusInputSerial=!1;isEmptySerial=!1;state;isStateEdit;initItemSerial(){if(this.data?.item.TypeID==4){let r=this.data?.item?.serialSources;this.isEmptySerial=r?.length==0,this.isSerialized=!0,this.initSerialSources();let e=this.data?.item.Serial?this.data?.item.Serial:[];this.initSelectedSerial(e),this.mapSerialToCode()}}initSerialSources(){this.state=="Outbound_Logistics"?this.productService.getVariantSerial(this.fulfillmentOutletId,this.data?.item?.VariantID).pipe(V(r=>r.map(e=>({Number:e.Number,Quantity:e.Quantity,ExpiryDate:e.ExpiryDate})))).subscribe(r=>{this.serialSources=r}):this.serialSources=this.data?.item?.serialSources}initSelectedSerial(r){this.selectedSerial=r?.map((e,a)=>({Number:e.Number,Quantity:e.Quantity,ExpiryDate:e.ExpiryDate}))}mapSerialToCode(){this.selectedSerialCode=this.selectedSerial.map(r=>r.Number)}onSelectSerial(r){let e;this.selectedSerial=r.map(a=>(e=this.selectedSerial.find(o=>o.Number==a.Number),{Number:a.Number,Quantity:T.IsNotEmpty(e)?e.Quantity:1,ExpiryDate:a.ExpiryDate}))}onRemoveSerial(r){this.selectedSerial.splice(r,1),this.mapSerialToCode()}onFocusAddSerial(){this.isFocusInputSerial=!0}onBlurAddSerial(){this.isFocusInputSerial=!1}submitSerial(){let r=this.generateSerialData();this.selectedSerial=[...this.selectedSerial,...r],this.selectedSerialCode=[]}generateSerialData(){this.selectedSerialCode=this.selectedSerialCode.filter(a=>this.selectedSerial.findIndex(o=>o.Number==a)==-1);let r;return this.selectedSerialCode.map(a=>(r=this.serialSources.find(o=>o.Number==a),{Number:a,Quantity:1,ExpiryDate:null}))}onClose(){this.dialogRef.close()}onOk(r){!this.isFocusInputSerial&&r!="Enter"&&(this.isSerialized?this.selectedSerial.length>0?this.onCloseDialog():this.generateSerialFromCode():this.dialogRef.close({note:this.note,serials:[]}))}generateSerialFromCode(){this.selectedSerialCode.length>0?(this.selectedSerial=this.generateSerialData(),this.onCloseDialog()):this.toastr.warning("Serials cannot be empty","Warning!")}onCloseDialog(){if(this.calculateSerialQty()>this.data?.item?.Quantity){this.toastr.warning("Quantity of serials cannot be more than Item Quantity","Warning!");return}let e=this.getSubmitedSerialData();this.dialogRef.close({note:this.note,serials:e})}getSubmitedSerialData(){return this.selectedSerial.map(e=>({Number:e.Number,Quantity:e.Quantity}))}calculateSerialQty(){return this.selectedSerial?.map(e=>e.Quantity)?.reduce((e,a)=>e+a)}onRemoveSerialChip(r){this.selectedSerialCode=this.selectedSerialCode.filter(e=>e!==r)}addSerial(r,e){let a=(r.value||"").trim();if(a)if(this.selectedSerialCode.find(o=>o==a)){e.value="",this.toastr.info("Serial already exists",ve.Info);return}else this.selectedSerialCode.push(a);r.chipInput.clear()}static \u0275fac=function(e){return new(e||t)(C(Ke),C(ye),C(ee),C(zt),C($i))};static \u0275cmp=O({type:t,selectors:[["POS-modal-item-note"]],standalone:!1,decls:8,vars:7,consts:[["SERIAL_OPTIONS",""],["chipGrid",""],["inputChip",""],[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[4,"ngIf"],[1,"form-floating-outline",3,"ngClass"],["name","note","id","note","cols","60",1,"form-control",2,"width","100%",3,"ngModelChange","rows","ngModel"],["for","note"],[4,"ngIf","ngIfElse"],[1,"input-group","mb-3"],[1,"col"],["appearance","outline",1,"serial-chip",3,"keyup.enter"],[3,"removed",4,"ngFor","ngForOf"],["placeholder","E.g. Serial1 Serial2",3,"matChipInputTokenEnd","matChipInputFor","matChipInputSeparatorKeyCodes"],[1,"col-auto"],["type","button",1,"btn","btn-outline-secondary","btn-sm","add-chip",3,"click"],["aria-hidden","true",1,"fa","fa-plus","me-1","fs-6"],[1,"headings-font-family","h6","font-weight-bold"],[3,"removed"],["matChipRemove",""],[1,"fa-solid","fa-circle-xmark"],["appendTo","body","bindValue","Number","bindLabel","Number","placeholder","Insert Number",1,"ng-select-multiple",3,"ngModelChange","change","items","multiple","ngModel","disabled"],[1,"row","mt-8"],[1,"col-12"],[1,"table","table-bordered"],[1,"thead-light"],["class","border-end","style","width: 40px",4,"ngIf"],[1,"border-end"],[1,"border-end","text-end",2,"width","60px"],[4,"ngFor","ngForOf"],[1,"border-end",2,"width","40px"],["class","text-center",4,"ngIf"],["type","text","placeholder","Qty","autoNum","",1,"form-control","text-end",3,"ngModelChange","ngModel","disabled","decimalPlaces"],[1,"text-center"],["aria-hidden","true","title","Remove serial",1,"fa","fa-xmark","text-danger","cursor-pointer","fa-2x",3,"click"]],template:function(e,a){e&1&&(n(0,"modal-material",3),g("onOk",function(c){return a.onOk(c)})("onCancel",function(){return a.onClose()})("onClose",function(){return a.onClose()}),n(1,"content")(2,"div",4),_(3,Gc,5,3,"ng-container",5),n(4,"div",6)(5,"textarea",7),h("ngModelChange",function(c){return S(a.note,c)||(a.note=c),c}),i(),n(6,"label",8),p(7,"Note"),i()()()()()),e&2&&(m("config",a.config),l(3),m("ngIf",a.isSerialized),l(),m("ngClass",M(5,Wc,a.isSerialized)),l(),m("rows",a.isSerialized?3:8),x("ngModel",a.note))},dependencies:[mt,J,B,fe,Ce,R,W,Eo,ct,Ee,tr,ir,Zo,er],styles:[".serial-chip[_ngcontent-%COMP%]{width:100%}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined .mdc-notched-outline .mdc-notched-outline__trailing{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--no-label:not(.mdc-text-field--textarea) .mat-mdc-form-field-input-control.mdc-text-field__input, .serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper .mat-mdc-form-field-input-control{height:40px!important}.serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__trailing, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__notch, .serial-chip[_ngcontent-%COMP%] .mdc-text-field--outlined:not(.mdc-text-field--disabled) .mdc-notched-outline__leading{border-color:#ccc!important}.serial-chip[_ngcontent-%COMP%] .mat-mdc-text-field-wrapper.mdc-text-field--outlined .mat-mdc-form-field-infix{padding-top:8px;padding-bottom:8px}.add-chip[_ngcontent-%COMP%]{height:calc(100% - 18.4px);margin-left:1px;border-top-left-radius:0;border-bottom-left-radius:0}"],changeDetection:0})};var Kc=t=>({ID:t});function Jc(t,r){if(t&1){let e=b();n(0,"div")(1,"button",13),g("click",function(){d(e);let o=s();return u(o.onImport())}),f(2,"i",14),p(3," Import "),i()()}}function Yc(t,r){t&1&&(n(0,"th",8),p(1," Pack Size "),i())}function Xc(t,r){if(t&1&&f(0,"p",24),t&2){let e=s().$implicit;m("innerHTML",e==null?null:e.Note,j)}}function Zc(t,r){if(t&1){let e=b();n(0,"input",25),h("ngModelChange",function(o){d(e);let c=s().$implicit;return S(c.QuantityDelivered,o)||(c.QuantityDelivered=o),u(o)}),i()}if(t&2){let e=s().$implicit,a=s();x("ngModel",e.QuantityDelivered),m("disabled",a.isEdit&&e.TypeID==4)}}function es(t,r){if(t&1){let e=b();n(0,"td")(1,"input",26),h("ngModelChange",function(o){d(e);let c=s().$implicit;return S(c.PackSize,o)||(c.PackSize=o),u(o)}),i()()}if(t&2){let e=s().$implicit;l(),x("ngModel",e.PackSize)}}function ts(t,r){t&1&&(z(0),f(1,"i",27),$())}function is(t,r){t&1&&f(0,"i",28)}function ns(t,r){if(t&1){let e=b();n(0,"tr")(1,"td")(2,"a",15),p(3),i(),f(4,"app-serial-note",16),_(5,Xc,1,1,"p",17),i(),n(6,"td"),p(7),i(),n(8,"td"),_(9,Zc,1,2,"input",18),i(),_(10,es,2,1,"td",19),n(11,"td",20),p(12),v(13,"quantityFraction"),i(),n(14,"td",20),p(15),v(16,"quantityFraction"),i(),n(17,"td",20),p(18),v(19,"quantityFraction"),i(),n(20,"td",21)(21,"div",22),g("click",function(){let o=d(e),c=o.$implicit,w=o.index,H=s();return u(H.openModalItemNote(c,w))}),_(22,ts,2,0,"ng-container",23)(23,is,1,0,"ng-template",null,0,Z),i()()()}if(t&2){let e=r.$implicit,a=we(24),o=s();l(2),m("queryParams",M(18,Kc,e.VariantID)),l(),D(" ",e.Name," "),l(),m("serials",e.Serial),l(),m("ngIf",e.Note!=null),l(2),I(e.Code),l(2),m("ngIf",!e.Completed),l(),m("ngIf",o.isDeliveryPacking),l(2),D(" ",E(13,12,e.Sent)," "),l(3),D(" ",E(16,14,e.Quantity)," "),l(3),D(" ",E(19,16,e.BarcodeCount)," "),l(4),m("ngIf",e.TypeID==4)("ngIfElse",a)}}var di=class t{constructor(r){this.dialog=r;this.eventImport=new gi}isDeliveryPacking;cartItems;state;isEdit;fulfillmentOutletId;hasImportBtn=!0;eventImport;openModalItemNote(r,e){this.dialog.open(hn,{data:{note:r.Note,name:r.Name,item:r,state:this.state,isEdit:this.isEdit,fulfillmentOutletId:this.fulfillmentOutletId}}).afterClosed().pipe(L(a=>T.IsNotEmpty(a))).subscribe(a=>{r.TypeID==4&&(r.Serial=a.serials,r.QuantityDelivered=this.calculateSerialQty(a.serials)),r.Note=a.note,this.updateCartItems(r,e)})}updateCartItems(r,e){this.cartItems=this.cartItems.map((a,o)=>(e==o&&(a=r),a))}calculateSerialQty(r=[]){let e=0;return r.forEach(a=>{e+=a.Quantity}),e}onImport(){this.eventImport.emit()}static \u0275fac=function(e){return new(e||t)(C(A))};static \u0275cmp=O({type:t,selectors:[["POS-products-delivery-list"]],inputs:{isDeliveryPacking:"isDeliveryPacking",cartItems:"cartItems",state:"state",isEdit:"isEdit",fulfillmentOutletId:"fulfillmentOutletId",hasImportBtn:"hasImportBtn"},outputs:{eventImport:"eventImport"},standalone:!1,decls:27,vars:5,consts:[["STANDART",""],[1,"card-header"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fa-solid","fa-box","me-5"],[1,"card-body"],[1,"table","table-bordered"],[1,"thead-light","sticky-top-thead"],[1,"border-end"],[1,"border-end","text-end",2,"width","80px"],["class","border-end text-end","style","width: 80px",4,"ngIf"],[1,"border-end","text-end",2,"width","55px"],[1,"border-end",2,"width","55px"],[4,"ngFor","ngForOf"],[1,"btn","btn-outline-secondary","py-3","px-5",3,"click"],["aria-hidden","true",1,"fa-solid","fa-download"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",1,"d-block",3,"queryParams"],[3,"serials"],["class","special-TinyMCE fst-italic text-warning mb-0","style","word-break: break-all",3,"innerHTML",4,"ngIf"],["autoNum","","class","form-control text-end","type","text",3,"ngModel","disabled","ngModelChange",4,"ngIf"],[4,"ngIf"],[1,"text-end"],[1,"text-center"],[3,"click"],[4,"ngIf","ngIfElse"],[1,"special-TinyMCE","fst-italic","text-warning","mb-0",2,"word-break","break-all",3,"innerHTML"],["autoNum","","type","text",1,"form-control","text-end",3,"ngModelChange","ngModel","disabled"],["type","text","autoNum","",1,"form-control",2,"direction","rtl",3,"ngModelChange","ngModel"],["matTooltip","Choose Serial Number",1,"fa-solid","fa-barcode","cursor-pointer","fa-2x"],["matTooltip","Note","matTooltipPosition","above",1,"fa-regular","fa-note-sticky","fa-2x","cursor-pointer"]],template:function(e,a){e&1&&(n(0,"div",1)(1,"div",2)(2,"h2"),f(3,"i",3),p(4,"Products"),i(),_(5,Jc,4,0,"div"),i()(),n(6,"div",4)(7,"table",5)(8,"thead",6)(9,"tr")(10,"th",7),p(11,"Products"),i(),n(12,"th",7),p(13,"Code"),i(),n(14,"th",8),p(15,"Qty"),i(),_(16,Yc,2,0,"th",9),n(17,"th",10),p(18),i(),n(19,"th",10),p(20),i(),n(21,"th",10),p(22,"Count"),i(),n(23,"th",11),p(24,"Action"),i()()(),n(25,"tbody"),_(26,ns,25,20,"tr",12),i()()()),e&2&&(l(5),Xe(a.hasImportBtn?5:-1),l(11),m("ngIf",a.isDeliveryPacking),l(2),D(" ",a.state=="Outbound_Logistics"?"Sent":"Received"," "),l(2),D(" Order",a.state=="Inbound_Logistics"?"ed":""," "),l(6),m("ngForOf",a.cartItems))},dependencies:[J,B,G,Ce,R,W,ct,ke,dt,ri],encapsulation:2})};var rs=()=>["/menu/Logistics/Archive/Outbound_Logistics/Info"],ro=t=>({ID:t}),as=()=>["/menu/Logistics/Archive/Outbound_Logistics"],ls=()=>["/menu/Orders/Order/Sales_Order/Info"],ps=()=>["/menu/Contacts/Contact/Customers/Info"];function ms(t,r){if(t&1&&(n(0,"a",7),p(1,"Cancel"),i()),t&2){let e=s(3);m("routerLink",N(2,rs))("queryParams",M(3,ro,e.param.ID||e.param.POID))}}function cs(t,r){t&1&&(n(0,"a",8),p(1,"Cancel"),i()),t&2&&m("routerLink",N(1,as))}function ss(t,r){if(t&1){let e=b();z(0),_(1,ms,2,5,"a",4)(2,cs,2,2,"a",5),n(3,"button",6),g("click",function(){d(e);let o=s(2);return u(o.validate())}),p(4),i(),$()}if(t&2){let e=s(2);l(),m("ngIf",e.isEdit),l(),m("ngIf",!e.isEdit),l(2),D(" ",e.isEdit?"Save":"Add"," ")}}function ds(t,r){if(t&1){let e=b();z(0),n(1,"mat-button-toggle-group",20)(2,"mat-button-toggle",21),g("click",function(){d(e);let o=s(4);return o.onTabChange("invoiceSearch"),u(o.searchLogisticType="invoice")}),f(3,"i",22),i(),n(4,"mat-button-toggle",23),g("click",function(){d(e);let o=s(4);return o.onTabChange("customerSearch"),u(o.searchLogisticType="customer")}),f(5,"i",24),i(),n(6,"mat-button-toggle",25),g("click",function(){d(e);let o=s(4);return o.onTabChange("numberSearch"),u(o.searchLogisticType="number")}),f(7,"i",26),i()(),$()}if(t&2){let e=s(4);l(2),m("checked",e.searchLogisticType=="invoice"),l(2),m("checked",e.searchLogisticType=="customer"),l(2),m("checked",e.searchLogisticType=="number")}}function us(t,r){t&1&&(n(0,"div",10)(1,"div",31),p(2,"Outlet"),i(),n(3,"div",32),p(4,"Date"),i(),n(5,"div",33),p(6,"Number"),i(),n(7,"div",33),p(8,"Reference"),i()())}function _s(t,r){if(t&1&&(n(0,"div",10)(1,"div",34),p(2),v(3,"limitTo"),i(),n(4,"div",35),p(5),v(6,"date"),i(),n(7,"div",36),p(8),i(),n(9,"div",36),p(10),i()()),t&2){let e=r.item;l(2),D(" ",P(3,4,e.OutletName,25)," "),l(3),D(" ",P(6,7,e.Date,"dd MMM yyyy")," "),l(3),D(" ",e.Number," "),l(2),D(" ",e.ReferenceNumber," ")}}function fs(t,r){if(t&1){let e=b();n(0,"ng-select",28),v(1,"async"),g("change",function(o){d(e);let c=s(5);return u(c.findSalesOrderAutoComplete(o))}),_(2,us,9,0,"ng-template",29)(3,_s,11,10,"ng-template",30),i()}if(t&2){let e=s(5);m("items",E(1,4,e.orders$))("typeahead",e.orderInput$)("ngModel",e.selectedSOID)("readonly",e.isEdit||e.isPO)}}function gs(t,r){if(t&1&&_(0,fs,4,6,"ng-select",27),t&2){let e=s(4);m("ngIf",!(e.isEdit||e.isPO))}}function Cs(t,r){if(t&1){let e=b();n(0,"div",19)(1,"autocompleteV2",37),g("onSelect",function(o){d(e);let c=s(4);return u(c.getUnfulfilledInvoices(o))}),i()()}if(t&2){let e=s(4);l(),m("inputTextValue",e.customerName)}}function vs(t,r){if(t&1){let e=b();n(0,"div",19)(1,"autocompleteV2",38),g("onInputEnter",function(o){d(e);let c=s(4);return u(c.scanUnfullfilledOrders(o))}),i()()}if(t&2){let e=s(4);l(),m("inputTextValue",e.scanResultUnfulfilledOrder())}}function ys(t,r){t&1&&(n(0,"div",10)(1,"div",40),p(2,"Outlet"),i(),n(3,"div",34),p(4,"Date"),i(),n(5,"div",41),p(6,"Number"),i()())}function xs(t,r){if(t&1&&(n(0,"div",10)(1,"div",40),p(2),v(3,"limitTo"),i(),n(4,"div",34),p(5),v(6,"date"),i(),n(7,"div",42),p(8),i()()),t&2){let e=r.item;l(2),D(" ",P(3,3,e.EntityName,25)," "),l(3),D(" ",P(6,6,e.Date,"dd MMM yyyy")," "),l(3),D(" ",e.Number," ")}}function Ss(t,r){if(t&1){let e=b();n(0,"div")(1,"ng-select",39),g("change",function(o){d(e);let c=s(4);return u(c.findSalesOrderByCustomer(o))}),_(2,ys,7,0,"ng-template",29)(3,xs,9,9,"ng-template",30),i()()}if(t&2){let e=s(4);l(),m("items",e.unfulfilledInvoices)}}function hs(t,r){if(t&1&&(n(0,"div",14)(1,"div",15)(2,"h2"),f(3,"i",16),p(4,"Choose Order"),i(),_(5,ds,8,3,"ng-container",2),i(),n(6,"div",17),_(7,gs,1,1,"ng-select",18)(8,Cs,2,1,"div",19)(9,vs,2,1,"div",19)(10,Ss,4,1,"div",2),i()()),t&2){let e=s(3);l(5),m("ngIf",!e.isEdit&&!e.isPO),l(2),Xe(e.searchLogisticType=="invoice"?7:e.searchLogisticType=="customer"?8:9),l(3),m("ngIf",e.unfulfilledInvoices.length>0&&e.searchLogisticType=="customer")}}function bs(t,r){if(t&1&&(n(0,"a",45),p(1),i()),t&2){let e=s(4);m("routerLink",N(3,ls))("queryParams",M(4,ro,e.deliveryData==null||e.deliveryData.SalesOrder==null?null:e.deliveryData.SalesOrder.ID)),l(),D(" ",e.deliveryData==null||e.deliveryData.SalesOrder==null?null:e.deliveryData.SalesOrder.Number," ")}}function Ds(t,r){if(t&1&&(n(0,"tr")(1,"th",46),p(2,"Ref. Number"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(4);l(6),D(" ",e.deliveryData==null||e.deliveryData.SalesOrder==null?null:e.deliveryData.SalesOrder.ReferenceNumber," ")}}function Is(t,r){if(t&1&&(n(0,"div",14)(1,"div",15)(2,"h2"),f(3,"i",16),p(4,"Sales Order"),i()(),n(5,"div",17)(6,"table",43)(7,"tr")(8,"th",44),p(9,"Outlet"),i(),n(10,"td"),p(11,":"),i(),n(12,"td"),p(13),i()(),n(14,"tr")(15,"th",44),p(16,"Number"),i(),n(17,"td"),p(18,":"),i(),n(19,"td"),_(20,bs,2,6,"a",45),i()(),n(21,"tr")(22,"th",44),p(23,"Date"),i(),n(24,"td"),p(25,":"),i(),n(26,"td"),p(27),v(28,"date"),i()(),_(29,Ds,7,1,"tr",2),i()()()),t&2){let e=s(3);l(13),I(e.deliveryData==null||e.deliveryData.SalesOrder==null?null:e.deliveryData.SalesOrder.EntityName),l(7),Xe(!(e.deliveryData==null||e.deliveryData.SalesOrder==null)&&e.deliveryData.SalesOrder.Number?20:-1),l(7),D(" ",P(28,4,e.deliveryData==null||e.deliveryData.SalesOrder==null?null:e.deliveryData.SalesOrder.Date,"dd MMM yyyy")," "),l(2),m("ngIf",e.deliveryData==null||e.deliveryData.SalesOrder==null?null:e.deliveryData.SalesOrder.ReferenceNumber)}}function Ts(t,r){if(t&1&&(n(0,"tr")(1,"th",49),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(4);l(6),I(e.deliveryData.Customer.Mobile)}}function ws(t,r){if(t&1&&(n(0,"tr")(1,"th",49),p(2,"City"),i(),n(3,"td"),p(4,":"),i(),f(5,"td",50),i()),t&2){let e=s(4);l(5),m("innerHTML",e.deliveryData.Customer.Address,j)}}function Os(t,r){if(t&1&&(n(0,"div",14)(1,"div",47)(2,"h2"),f(3,"i",48),p(4,"Customer"),i()(),n(5,"div",17)(6,"table",43)(7,"tr")(8,"th",49),p(9,"Name"),i(),n(10,"td"),p(11,":"),i(),n(12,"td")(13,"a",45),p(14),i()()(),_(15,Ts,7,1,"tr",2)(16,ws,6,1,"tr",2),i()()()),t&2){let e=s(3);l(13),m("routerLink",N(5,ps))("queryParams",M(6,ro,e.deliveryData.Customer.ID)),l(),I(e.deliveryData.Customer.Name),l(),m("ngIf",e.deliveryData.Customer.Mobile),l(),m("ngIf",e.deliveryData.Customer.Address)}}function Es(t,r){if(t&1&&(n(0,"tr")(1,"th",49),p(2,"Name"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(4);l(6),I(e.deliveryData.Recipient.Name)}}function Ms(t,r){if(t&1&&(n(0,"tr")(1,"th",49),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(4);l(6),I(e.deliveryData.Recipient.Phone)}}function Ps(t,r){if(t&1&&(n(0,"tr")(1,"th",49),p(2,"City"),i(),n(3,"td"),p(4,":"),i(),f(5,"td",50),i()),t&2){let e=s(4);l(5),m("innerHTML",e.deliveryData.Recipient.Address,j)}}function Fs(t,r){if(t&1&&(n(0,"tr")(1,"th",49),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(4);l(6),I(e.deliveryData.Recipient.City)}}function Vs(t,r){if(t&1&&(n(0,"div",14)(1,"div",47)(2,"h2"),f(3,"i",48),p(4,"Recipient"),i()(),n(5,"div",17)(6,"table",43),_(7,Es,7,1,"tr",2)(8,Ms,7,1,"tr",2)(9,Ps,6,1,"tr",2)(10,Fs,7,1,"tr",2),i()()()),t&2){let e=s(3);l(7),m("ngIf",e.deliveryData.Recipient.Name),l(),m("ngIf",e.deliveryData.Recipient.Phone),l(),m("ngIf",e.deliveryData.Recipient.Address),l(),m("ngIf",e.deliveryData.Recipient.City)}}function Ns(t,r){if(t&1&&(p(0),v(1,"limitTo")),t&2){let e=r.item;D(" ",P(1,1,e.Name,20)," ")}}function ks(t,r){if(t&1){let e=b();n(0,"div",14)(1,"div",47)(2,"h2"),f(3,"i",51),p(4,"Fulfillment"),i()(),n(5,"div",17)(6,"div",52)(7,"div",49),p(8,"Outlet"),i(),n(9,"div",53),p(10,":"),i(),n(11,"div",54)(12,"ng-select",55),h("ngModelChange",function(o){d(e);let c=s(3);return S(c.form.Header.EntityID,o)||(c.form.Header.EntityID=o),u(o)}),g("ngModelChange",function(o){d(e);let c=s(3);return u(c.onFulfillmentChange(o))}),_(13,Ns,2,4,"ng-template",56),i()()(),n(14,"div",52)(15,"div",49),p(16,"Date"),i(),n(17,"div",53),p(18,":"),i(),n(19,"div",54)(20,"datepicker",57),h("dateChange",function(o){d(e);let c=s(3);return S(c.form.Header.Date,o)||(c.form.Header.Date=o),u(o)}),i()()(),n(21,"div",52)(22,"div",49),p(23,"Number"),i(),n(24,"div",53),p(25,":"),i(),n(26,"div",54)(27,"input",58),h("ngModelChange",function(o){d(e);let c=s(3);return S(c.form.Header.Number,o)||(c.form.Header.Number=o),u(o)}),i()()(),n(28,"div",52)(29,"div",49),p(30,"Courier"),i(),n(31,"div",53),p(32,":"),i(),n(33,"div",54)(34,"ng-select",59),h("ngModelChange",function(o){d(e);let c=s(3);return S(c.form.Header.CourierID,o)||(c.form.Header.CourierID=o),u(o)}),i()()()()()}if(t&2){let e=s(3);l(12),Nt("diff",e.form.Header.EntityID!=e.deliveryData.SalesOrder.EntityID),m("readonly",e.isEdit&&!e.isPO)("items",e.storage.Entities),x("ngModel",e.form.Header.EntityID),l(8),m("isFloatingLabel",!1),x("date",e.form.Header.Date),l(7),x("ngModel",e.form.Header.Number),l(7),m("items",e.storage.Courier),x("ngModel",e.form.Header.CourierID)}}function Ls(t,r){if(t&1){let e=b();n(0,"div",60)(1,"div",14)(2,"POS-products-delivery-list",61),g("eventImport",function(){d(e);let o=s(3);return u(o.onImportItems())}),i()(),n(3,"div",14),f(4,"POS-tinymce-note",62),i()()}if(t&2){let e=s(3);l(2),m("isEdit",e.isEdit)("isDeliveryPacking",e.isDeliveryPacking)("cartItems",e.cartItems)("fulfillmentOutletId",e.form.Header.EntityID),l(2),m("form",e.form)}}function Rs(t,r){if(t&1&&(n(0,"div",9)(1,"div",10)(2,"div",11),_(3,hs,11,3,"div",12)(4,Is,30,7,"div",12)(5,Os,17,8,"div",12)(6,Vs,11,4,"div",12)(7,ks,35,10,"div",12),i(),_(8,Ls,5,5,"div",13),i()()),t&2){let e=s(2);l(3),m("ngIf",!(e.isEdit||e.isPO)),l(),m("ngIf",e.deliveryData),l(),m("ngIf",e.deliveryData==null||e.deliveryData.Customer==null?null:e.deliveryData.Customer.ID),l(),m("ngIf",e.deliveryData==null||e.deliveryData.Recipient==null?null:e.deliveryData.Recipient.ID),l(),m("ngIf",e.deliveryData),l(),m("ngIf",e.deliveryData)}}function As(t,r){if(t&1){let e=b();n(0,"div",9)(1,"POS-complete-customer-supplier",63),g("undo",function(o){d(e);let c=s(2);return u(c.undo(o))})("newForm",function(){d(e);let o=s(2);return u(o.newForm())}),i()()}if(t&2){let e=s(2);l(),m("afterSubmitData",e.afterSubmitData)("items",e.form.Items)}}function Bs(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",1),g("barcodeQueryChange",function(o){d(e);let c=s();return u(c.onScanBarcode(o))}),n(1,"actions"),_(2,ss,5,3,"ng-container",2),i(),n(3,"content"),_(4,Rs,9,6,"div",3)(5,As,2,2,"div",3),i()()}if(t&2){let e=s();m("pageData",e.menuData)("showBarcodeScanner",e.deliveryData&&!e.isComplete)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),m("ngIf",!e.isComplete),l(2),m("ngIf",!e.isComplete),l(),m("ngIf",e.isComplete)}}var bn=class t extends qt{constructor(e,a,o,c,w,H,ie,Ue){super(e,a,"OutboundLogisticsLoader/GetStorage",o);this.productService=c;this.formService=w;this.productHttpService=H;this.dialog=ie;this.datePipe=Ue;this.form={Header:{},Items:[]},this.searchLogisticType="invoice"}outboundLogisticsService=y(Sn);storage;deliveryData;isEdit;form;param;isDeliveryPacking;configBarcodeCount;orderInvoice;isComplete;afterSubmitData;isPO;searchLogisticType;orderInput$=new be;orders$;cartItemSource;selectedSOID;scanResultUnfulfilledOrder=vt(null);customerName;unfulfilledInvoices=[];handleF8(){this.isComplete&&this.newForm()}initializeFormState(){this.param=this.route.snapshot.queryParams,T.IsEmpty(this.param.POID)&&T.IsEmpty(this.param.ID)?(this.isEdit=!1,this.initOrderNumberOptions()):T.IsNotEmpty(this.param.POID)?(this.isPO=!0,this.getDeliveryItems(this.param.POID)):(this.isEdit=!0,this.isPO=!1,this.getDeliveryItems(this.param.ID))}initOrderNumberOptions(){this.orders$=this.orderInput$.pipe(L(e=>e!=null&&(e==""||e.length>=3)),_o(),uo(500),ze(""),Q(e=>this.outboundLogisticsService.getUnfulfilledOrderByNumber(e)))}scanUnfullfilledOrders(e){this.outboundLogisticsService.getUnfulfilledOrderByNumberOrReferenceNumber(e).pipe(q(a=>{this.formatOrderScanresult(a)})).subscribe({next:this.bindDeliveryData(),error:a=>{this.scanResultUnfulfilledOrder.set(null)}})}formatOrderScanresult(e){let a=e?.SalesOrder.EntityName,o=e?.SalesOrder.Date?new Date(e?.SalesOrder.Date):null,c=e?.SalesOrder.ReferenceNumber?`- ${e?.SalesOrder.ReferenceNumber}`:"",w=e?.SalesOrder.Number?`- ${e?.SalesOrder.Number}`:"",H=o?`- ${this.datePipe.transform(o,"dd MMM yyyy")}`:"",ie=`${a} ${H} ${w} ${c}`;this.scanResultUnfulfilledOrder.set(ie)}initOrderNumberOnEdit(){if(this.isEdit||this.isPO){let e={ID:this.deliveryData.SalesOrder.ID,Display:`${this.deliveryData.SalesOrder.Number} - ${this.deliveryData.SalesOrder.EntityName} - ${this.deliveryData.SalesOrder.Date}`};this.orders$=Ct([e]),this.selectedSOID=e.ID}}postBindForm(e){this.storage=e,this.isDeliveryPacking=e.AppConfigJSON.DeliveryPacking,this.configBarcodeCount=e.AppConfigJSON.ModuleDelivery.CustomerDelivery.QtyCount,this.initializeFormState(),!this.isEdit&&!this.isPO&&this.setFocusToAutoComplete()}setFocusToAutoComplete(e="customerSearch"){setTimeout(()=>{let a=document.getElementById(e);a&&a.focus()},100)}validate(){if(this.formService.validate(this.cartItems,this.configBarcodeCount,this.isEdit)){this.form.Items=this.formService.convertCartItemsToForm(this.cartItems),this.data.Form=this.form,this.isEdit&&(this.data.Form.Mode=1);let e=this.form.Header.CourierID;T.IsEmpty(e)&&(this.form.Header.CourierID=T.GuidEmpty),this.onSubmit("OutDelivery/SubmitOrder")}}findSalesOrderByCustomer(e){T.IsNotEmpty(e.ID)&&(this.getDeliveryItems(e.ID),this.scanResultUnfulfilledOrder.set(null))}onTabChange(e){this.setFocusToAutoComplete(e)}findSalesOrderAutoComplete(e){T.IsNotEmpty(e)?(this.getDeliveryItems(e.ID),this.scanResultUnfulfilledOrder.set(null)):this.orderInput$.next("")}getDeliveryItems(e){let a,o;this.isPO||!this.isEdit?(a="GetByPOID",this.form.Header.CustomerPOID=e,o={POID:this.param.POID||e}):(a="GetByID",o={ID:this.param.ID}),this.httpService.post(`/API/OutboundLogisticsLoader/${a}`,o).subscribe({next:this.bindDeliveryData()})}bindDeliveryData(){return e=>{this.deliveryData=e,this.initOrderNumberOnEdit(),T.IsNotEmpty(this.deliveryData.Data)&&(this.productService.formItems=this.deliveryData.Data.Items),this.productService.bindCartItems(e.OrderedItems,e.SentItems,this.isEdit),this.cartItemSource=T.cloneObject(this.productService.cartItems),this.orderInvoice=e.Label,this.isPO||!this.isEdit?(this.form.Header.Number=e.SalesOrder.GenerateDeliveryNumber,this.form.Header.Date=new Date,T.IsEmpty(this.form.Header.EntityID)&&(this.form.Header.EntityID=e.SalesOrder.EntityID),this.form.Header.Note=e.SalesOrder.Note,this.assignDefaultWarehouse(e.DefaultWarehouse)):(T.IsNotEmpty(e.Data?.Header)&&(this.form.Header=e.Data.Header),this.menuData.H=`Editing Outbound #${this.form.Header.Number}`),this.productService.entityID=this.form.Header.EntityID}}onScanBarcode(e){this.productService.onScanBarcode(e)}get cartItems(){return this.productService.cartItems}newForm(){this.formService.newForm("Outbound_Logistics")}onSubmitSuccess(e){this.isComplete=!0,this.afterSubmitData=e}undo(e){this.formService.undo(e,"Outbound_Logistics")}assignDefaultWarehouse(e){let a=this.storage.Entities.find(o=>o.ID==e);T.IsNotEmpty(a)&&(this.form.Header.EntityID=a.ID)}getUnfulfilledInvoices(e){this.httpService.post("/API/OutDelivery/GetUnfulfilledOrdersByCustomerID",{id:e}).subscribe(a=>{this.unfulfilledInvoices=a,this.scanResultUnfulfilledOrder.set(null)})}onFulfillmentChange(e){let a=this.cartItems.map(o=>o.VariantID);T.IsNotEmpty(e)&&a.length>0&&this.productHttpService.getSerialByVarianIds(e,a).subscribe(o=>{this.updateSerialItem(o)})}updateSerialItem(e){let a=[],o=T.cloneObject(this.cartItemSource);this.productService.cartItems=o.map(c=>(c.TypeID==4&&(a=e.find(w=>w.VariantID==c.VariantID)?.Serial,a&&(c.Serial=this.filterSerialBySelectedSerial(c.Serial,a),c.Serial=this.setSerialQuantity(c))),c))}filterSerialBySelectedSerial(e=[],a){let o;return a.filter(w=>(o=e.findIndex(H=>H.Number==w.Number),o!==-1))}setSerialQuantity(e){let a=e.serialSources,o=e.Serial,c;return o=o.map(w=>(c=a.findIndex(H=>H.Number==w.Number),c!==-1&&(w.Quantity=w.Quantity<a[c].Quantity?w.Quantity:a[c].Quantity),w)),o}onImportItems(){this.dialog.open(pi,{data:{title:"Import Products"}}).afterClosed().pipe(L(e=>T.IsNotEmpty(e))).subscribe(e=>{this.formService.toastrShowToastrNotFoundItems(e,this.cartItems),this.productService.cartItems=this.formService.mappingItemWithCsv(e,this.cartItems)})}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(pe),C(zt),C(mi),C($i),C(A),C(he))};static \u0275cmp=O({type:t,selectors:[["POS-outbound-logistics-form"]],hostBindings:function(a,o){a&1&&g("keydown.F8",function(w){return o.handleF8(w)},!1,ti)},standalone:!1,features:[re],decls:1,vars:1,consts:[[3,"pageData","showBarcodeScanner","hideSearchDropdown","hideSearchBox","barcodeQueryChange",4,"ngIf"],[3,"barcodeQueryChange","pageData","showBarcodeScanner","hideSearchDropdown","hideSearchBox"],[4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"routerLink",4,"ngIf"],[1,"btn","btn-success","ms-5",3,"click"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-xs-12","col-md-5","col-lg-12","col-xl-5","col-sm-12","sales-order"],["class","card",4,"ngIf"],["class","col-xs-12 col-md-7 col-lg-12 col-xl-7 col-sm-12",4,"ngIf"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],[1,"fa-solid","fa-receipt","me-5"],[1,"card-body"],["bindLabel","Display","bindValue","Key","placeholder","Invoice Number",1,"orders-search",3,"items","typeahead","ngModel","readonly"],[1,"form-floating-outline","my-0"],["name","fontStyle","aria-label","Font Style",2,"height","30px"],["matTooltipPosition","above","matTooltip","Search by Invoice Number",1,"w-100","toggle-search",3,"click","checked"],[1,"fa-solid","fa-hashtag"],["matTooltipPosition","above","matTooltip","Search by Customer",1,"w-100","toggle-search",3,"click","checked"],[1,"fa-solid","fa-address-book"],["matTooltipPosition","above","matTooltip","Scan Invoice / Packing Slip Barcode",1,"w-100","toggle-search",3,"click","checked"],[1,"fa-solid","fa-scanner-gun"],["class","orders-search","bindLabel","Display","bindValue","Key","placeholder","Invoice Number",3,"items","typeahead","ngModel","readonly","change",4,"ngIf"],["bindLabel","Display","bindValue","Key","placeholder","Invoice Number",1,"orders-search",3,"change","items","typeahead","ngModel","readonly"],["ng-header-tmp",""],["ng-option-tmp",""],[1,"col-3","fw-bold"],[1,"col-2","fw-bold","px-2"],[1,"col-3","fw-bold","px-2"],[1,"col-3"],[1,"col-2","px-2"],[1,"col-3","px-2"],["inputID","customerSearch","requestUrl","/API/AC/GetCustomerSuggestion","placeholder","Customer Name","notFoundMessageFor","customer",1,"w-100",3,"onSelect","inputTextValue"],["inputID","numberSearch","placeholder","Scan Order Here","notFoundMessageFor","order",1,"w-100",3,"onInputEnter","inputTextValue"],["appendTo","body","bindLabel","Number","bindValue","Key",1,"custom-panel-dropdown",3,"change","items"],[1,"col-5"],[1,"col-4"],[1,"col-4","text-wrap"],[1,"table-sm","table-borderless"],[2,"width","50px"],["target","_blank",3,"routerLink","queryParams"],[2,"width","80px"],[1,"card-header"],[1,"fa-solid","fa-address-card","me-5"],[2,"width","55px"],[3,"innerHTML"],[1,"fa-solid","fa-truck","me-5"],[1,"d-flex","align-items-center","justify-content-between","w-100","mb-3"],[1,"me-2",2,"width","5px"],[1,"w-100"],["bindLabel","Name","bindValue","ID",1,"p-0",3,"ngModelChange","readonly","items","ngModel"],["ng-label-tmp",""],["appearance","outline",1,"p-0",3,"dateChange","isFloatingLabel","date"],["type","text",1,"form-control","ps-4",2,"height","35px !important","width","100%",3,"ngModelChange","ngModel"],["placeholder","Select Courier","bindLabel","Name","bindValue","ID",1,"p-0",3,"ngModelChange","items","ngModel"],[1,"col-xs-12","col-md-7","col-lg-12","col-xl-7","col-sm-12"],["state","Outbound_Logistics",3,"eventImport","isEdit","isDeliveryPacking","cartItems","fulfillmentOutletId"],[3,"form"],["state","Outbound",3,"undo","newForm","afterSubmitData","items"]],template:function(a,o){a&1&&_(0,Bs,6,7,"mainpanel-cmp",0),a&2&&m("ngIf",o.storage)},dependencies:[B,G,Ce,R,W,oe,de,We,Ee,ki,Li,ke,Ai,Bi,ci,si,di,rt,he,Hi],styles:["datepicker[_ngcontent-%COMP%] div.mat-mdc-text-field-wrapper{padding-bottom:0!important}autocompleteV2[_ngcontent-%COMP%] input{font-size:12px;height:36px} mat-button-toggle.toggle-search>button>span.mat-button-toggle-label-content{line-height:30px!important} .diff .ng-select-container{background:repeating-linear-gradient(-60deg,#fcf3cf,#fcf3cf 15px,#f9e79f 15px 30px)!important} .mat-button-toggle-checkbox-wrapper{display:none!important} .mat-button-toggle-checked .mat-button-toggle-button:has(.mat-button-toggle-checkbox-wrapper){padding-left:0!important}.orders-search[_ngcontent-%COMP%] .ng-dropdown-panel{width:45vw}"]})};var Ws=()=>["/menu/Logistics/Archive/Inbound_Logistics/Info"],Ur=t=>({ID:t}),Hs=()=>["/menu/Logistics/Archive/Inbound_Logistics"],js=()=>["/menu/Contacts/Contact/Suppliers/Info"];function Qs(t,r){if(t&1&&(n(0,"a",8),p(1,"Cancel"),i()),t&2){let e=s(3);m("routerLink",N(2,Ws))("queryParams",M(3,Ur,e.param.ID||e.param.POID))}}function qs(t,r){t&1&&(n(0,"a",9),p(1,"Cancel"),i()),t&2&&m("routerLink",N(1,Hs))}function Us(t,r){if(t&1){let e=b();z(0),_(1,Qs,2,5,"a",5)(2,qs,2,2,"a",6),n(3,"button",7),g("click",function(){d(e);let o=s(2);return u(o.validate())}),p(4),i(),$()}if(t&2){let e=s(2);l(),m("ngIf",e.isEdit),l(),m("ngIf",!e.isEdit),l(2),I(e.isEdit?"Save":"Add")}}function zs(t,r){if(t&1){let e=b();z(0),n(1,"mat-button-toggle-group",20)(2,"mat-button-toggle",21),g("click",function(){d(e);let o=s(3);return u(o.searchLogisticType="invoice")}),f(3,"i",22),i(),n(4,"mat-button-toggle",23),g("click",function(){d(e);let o=s(3);return u(o.searchLogisticType="customer")}),f(5,"i",24),i()(),$()}if(t&2){let e=s(3);l(2),m("checked",e.searchLogisticType=="invoice"),l(2),m("checked",e.searchLogisticType=="customer")}}function $s(t,r){if(t&1){let e=b();z(0),n(1,"div",25)(2,"autocompleteV2",26),g("onSelect",function(o){d(e);let c=s(3);return u(c.getDeliveryItems(o))}),i()(),$()}if(t&2){let e=s(3);l(2),m("inputTextValue",e.orderInvoice)}}function Gs(t,r){if(t&1){let e=b();n(0,"div",25)(1,"autocompleteV2",27),g("onSelect",function(o){d(e);let c=s(3);return u(c.getUnfulfilledInvoices(o))}),i()()}}function Ks(t,r){t&1&&(n(0,"div",11)(1,"div",31),p(2," Outlet "),i(),n(3,"div",32),p(4," Date "),i(),n(5,"div",33),p(6," Number "),i()())}function Js(t,r){if(t&1&&(n(0,"div",11)(1,"div",31),p(2),v(3,"limitTo"),i(),n(4,"div",32),p(5),v(6,"date"),i(),n(7,"div",34),p(8),i()()),t&2){let e=r.item;l(2),D(" ",P(3,3,e.EntityName,25)," "),l(3),D(" ",P(6,6,e.Date,"dd MMM yyyy")," "),l(3),D(" ",e.Number," ")}}function Ys(t,r){if(t&1){let e=b();n(0,"div")(1,"ng-select",28),g("change",function(o){d(e);let c=s(3);return u(c.findSalesOrderByCustomer(o))}),_(2,Ks,7,0,"ng-template",29)(3,Js,9,9,"ng-template",30),i()()}if(t&2){let e=s(3);l(),m("items",e.unfulfilledInvoices)}}function Xs(t,r){if(t&1&&(n(0,"tr")(1,"th",38),p(2,"Name"),i(),n(3,"td"),p(4,":"),i(),n(5,"td")(6,"a",39),p(7),i()()()),t&2){let e=s(4);l(6),m("routerLink",N(3,js))("queryParams",M(4,Ur,e.deliveryData.SupplierContact.ID)),l(),D(" ",e.deliveryData==null?null:e.deliveryData.SupplierContact.Name," ")}}function Zs(t,r){if(t&1&&(n(0,"tr")(1,"th",38),p(2,"Phone"),i(),n(3,"td"),p(4,":"),i(),n(5,"td"),p(6),i()()),t&2){let e=s(4);l(6),I(e.deliveryData==null?null:e.deliveryData.SupplierContact.Phone)}}function ed(t,r){if(t&1&&(n(0,"tr")(1,"th",38),p(2,"City"),i(),n(3,"td"),p(4,":"),i(),f(5,"td",40),i()),t&2){let e=s(4);l(5),m("innerHTML",e.deliveryData==null?null:e.deliveryData.SupplierContact.Address,j)}}function td(t,r){if(t&1&&(n(0,"div",13)(1,"div",35)(2,"h2"),f(3,"i",36),p(4,"Supplier "),i()(),n(5,"div",16)(6,"table",37),_(7,Xs,8,6,"tr",3)(8,Zs,7,1,"tr",3)(9,ed,6,1,"tr",3),i()()()),t&2){let e=s(3);l(7),m("ngIf",e.deliveryData==null?null:e.deliveryData.SupplierContact.Name),l(),m("ngIf",e.deliveryData==null?null:e.deliveryData.SupplierContact.Phone),l(),m("ngIf",e.deliveryData==null?null:e.deliveryData.SupplierContact.Address)}}function id(t,r){if(t&1){let e=b();n(0,"div",13)(1,"div",35)(2,"h2"),f(3,"i",41),p(4,"Fulfillment "),i()(),n(5,"div",16)(6,"div",42)(7,"div",38),p(8,"Outlet"),i(),n(9,"div",43),p(10,":"),i(),n(11,"div",44)(12,"ng-select",45),h("ngModelChange",function(o){d(e);let c=s(3);return S(c.form.Header.EntityID,o)||(c.form.Header.EntityID=o),u(o)}),i()()(),n(13,"div",42)(14,"div",38),p(15,"Date"),i(),n(16,"div",43),p(17,":"),i(),n(18,"div",44)(19,"datepicker",46),h("dateChange",function(o){d(e);let c=s(3);return S(c.form.Header.Date,o)||(c.form.Header.Date=o),u(o)}),i()()(),n(20,"div",42)(21,"div",38),p(22,"Number"),i(),n(23,"div",43),p(24,":"),i(),n(25,"div",44)(26,"input",47),h("ngModelChange",function(o){d(e);let c=s(3);return S(c.form.Header.Number,o)||(c.form.Header.Number=o),u(o)}),i()()(),n(27,"div",48)(28,"div",38),p(29,"Courier"),i(),n(30,"div",43),p(31,":"),i(),n(32,"div",44)(33,"ng-select",49),h("ngModelChange",function(o){d(e);let c=s(3);return S(c.form.Header.CourierID,o)||(c.form.Header.CourierID=o),u(o)}),i()()()()()}if(t&2){let e=s(3);l(12),m("readonly",e.isEdit&&!e.isPO)("items",e.storage.Entities),x("ngModel",e.form.Header.EntityID),l(7),m("isFloatingLabel",!1),x("date",e.form.Header.Date),l(7),x("ngModel",e.form.Header.Number),l(7),m("items",e.storage.Courier),x("ngModel",e.form.Header.CourierID)}}function nd(t,r){if(t&1){let e=b();n(0,"div",50)(1,"div",13)(2,"POS-products-delivery-list",51),g("eventImport",function(){d(e);let o=s(3);return u(o.onImport())}),i()(),n(3,"div",13),f(4,"POS-tinymce-note",52),i()()}if(t&2){let e=s(3);l(2),m("isEdit",e.isEdit)("cartItems",e.cartItems),l(2),m("form",e.form)}}function od(t,r){if(t&1&&(n(0,"div",10)(1,"div",11)(2,"div",12)(3,"div",13)(4,"div",14)(5,"h2"),f(6,"i",15),p(7,"Purchase Order "),i(),_(8,zs,6,2,"ng-container",3),i(),n(9,"div",16),_(10,$s,3,1,"ng-container",17)(11,Gs,2,0,"ng-template",null,0,Z)(13,Ys,4,1,"div",3),i()(),_(14,td,10,3,"div",18)(15,id,34,8,"div",18),i(),_(16,nd,5,3,"div",19),i()()),t&2){let e=we(12),a=s(2);l(8),m("ngIf",!a.isEdit&&!a.isPO),l(2),m("ngIf",a.searchLogisticType=="invoice")("ngIfElse",e),l(3),m("ngIf",a.unfulfilledInvoices.length>0&&a.searchLogisticType=="customer"),l(),m("ngIf",a.deliveryData==null||a.deliveryData.SupplierContact==null?null:a.deliveryData.SupplierContact.ID),l(),m("ngIf",a.deliveryData),l(),m("ngIf",a.deliveryData)}}function rd(t,r){if(t&1){let e=b();n(0,"div",10)(1,"POS-complete-customer-supplier",53),g("undo",function(o){d(e);let c=s(2);return u(c.undo(o))})("newForm",function(){d(e);let o=s(2);return u(o.newForm())}),i()()}if(t&2){let e=s(2);l(),m("afterSubmitData",e.afterSubmitData)("items",e.form.Items)}}function ad(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),g("barcodeQueryChange",function(o){d(e);let c=s();return u(c.onScanBarcode(o))}),n(1,"actions"),_(2,Us,5,3,"ng-container",3),i(),n(3,"content"),_(4,od,17,7,"div",4)(5,rd,2,2,"div",4),i()()}if(t&2){let e=s();m("pageData",e.menuData)("showBarcodeScanner",e.deliveryData&&!e.isComplete)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),m("ngIf",!e.isComplete),l(2),m("ngIf",!e.isComplete),l(),m("ngIf",e.isComplete)}}var Dn=class t extends qt{constructor(e,a,o,c,w,H){super(e,a,"InboundLogisticsLoader/GetStorage",o);this.productService=c;this.formService=w;this.dialog=H;this.form={Header:{},Items:[]}}toastr=y(ee);searchLogisticType="invoice";unfulfilledInvoices=[];storage;deliveryData;isEdit;form;param;configBarcodeCount;orderInvoice;isComplete;afterSubmitData;isPO;initializeFormState(){this.param=this.route.snapshot.queryParams,T.IsEmpty(this.param.POID)&&T.IsEmpty(this.param.ID)?this.isEdit=!1:T.IsNotEmpty(this.param.POID)?(this.isPO=!0,this.getDeliveryItems(this.param.POID)):(this.isPO=!1,this.isEdit=!0,this.getDeliveryItems(this.param.ID))}postBindForm(e){this.storage=e,this.productService.formItems=this.storage.Data?.Items,this.configBarcodeCount=e.AppConfigJSON.ModuleDelivery.CustomerDelivery.InBoundQtyCount,this.initializeFormState(),!this.isEdit&&!this.isPO&&this.setFocusToAutoComplete()}setFocusToAutoComplete(){setTimeout(()=>{let e=document.getElementById("orderNumber");e&&e.focus()},100)}findSalesOrderByCustomer(e){T.IsNotEmpty(e.ID)&&this.getDeliveryItems(e.ID)}getDeliveryItems(e){let a,o;this.isPO||!this.isEdit?(a="GetByPOID",this.form.Header.PurchaseOrderID=e,o={POID:this.param.POID||e}):(a="GetByID",o={ID:this.param.ID}),this.httpService.post(`/API/InDelivery/${a}`,o).subscribe({next:this.bindDeliveryData()})}bindDeliveryData(){return e=>{this.deliveryData=e,T.IsNotEmpty(this.deliveryData.Data)&&(this.productService.formItems=this.deliveryData.Data.Items),this.productService.bindCartItems(e.PurchasedItems,e.SentItems,this.isEdit),this.orderInvoice=e.Label,this.isPO||!this.isEdit?(this.form.Header.Number=e.PO.Number,this.form.Header.Date=new Date().toJSON(),T.IsEmpty(this.form.Header.EntityID)&&(this.form.Header.EntityID=e.PO.EntityID),this.form.Header.Note=e.PO.Note,this.assignDefaultWarehouse(e.DefaultWarehouse)):(T.IsNotEmpty(e.Data?.Header)&&(this.form.Header=e.Data.Header),this.menuData.H=`Editing Inbound #${this.form.Header.Number}`)}}assignDefaultWarehouse(e){let a=this.storage.Entities.find(o=>o.ID==e);T.IsNotEmpty(a)&&(this.form.Header.EntityID=a.ID)}get cartItems(){return this.productService.cartItems}onScanBarcode(e){this.productService.onScanBarcode(e)}validate(){this.formService.validate(this.cartItems,this.configBarcodeCount,this.isEdit)&&(this.form.Items=this.formService.convertCartItemsToForm(this.cartItems),this.data.Form=this.form,this.isEdit&&(this.data.Form.Mode=1),this.onSubmit("InDelivery/SubmitOrder"))}newForm(){this.formService.newForm("Inbound_Logistics")}onSubmitSuccess(e){this.isComplete=!0,this.afterSubmitData=e}undo(e){this.formService.undo(e,"Inbound_Logistics")}onImport(){this.dialog.open(pi,{data:{title:"Import Products"}}).afterClosed().pipe(L(e=>T.IsNotEmpty(e))).subscribe(e=>{this.formService.toastrShowToastrNotFoundItems(e,this.cartItems),this.productService.cartItems=this.formService.mappingItemWithCsv(e,this.cartItems)})}getUnfulfilledInvoices(e){this.httpService.post("/API/InboundLogistics/GetUnfulfilledOrdersBySupplierID",{ID:e}).subscribe(a=>this.unfulfilledInvoices=a)}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(pe),C(zt),C(mi),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-inbound-logistics-form"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["CUSTOMER",""],[3,"pageData","showBarcodeScanner","hideSearchDropdown","hideSearchBox","barcodeQueryChange",4,"ngIf"],[3,"barcodeQueryChange","pageData","showBarcodeScanner","hideSearchDropdown","hideSearchBox"],[4,"ngIf"],["class","container-fluid mt-5",4,"ngIf"],["class","btn btn-outline-secondary",3,"routerLink","queryParams",4,"ngIf"],["class","btn btn-outline-secondary",3,"routerLink",4,"ngIf"],[1,"btn","btn-success","ms-5",3,"click"],[1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"btn","btn-outline-secondary",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-xs-12","col-md-4","col-lg-12","col-xl-4","col-sm-12"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],[1,"fa-solid","fa-receipt","me-5"],[1,"card-body"],[4,"ngIf","ngIfElse"],["class","card",4,"ngIf"],["class","col-xs-12 col-md-8 col-lg-12 col-xl-8 col-sm-12",4,"ngIf"],["name","fontStyle","aria-label","Font Style",2,"height","30px"],["matTooltipPosition","above","matTooltip","Search by Invoice Number",1,"w-100","toggle-search",3,"click","checked"],[1,"fa-solid","fa-hashtag"],["matTooltipPosition","above","matTooltip","Search by Supplier",1,"w-100","toggle-search",3,"click","checked"],[1,"fa-solid","fa-address-book"],[1,"form-floating-outline"],["inputID","orderNumber","requestUrl","/API/AC/SearchBillOrderByNumber","placeholder","Invoice Number",1,"w-100",3,"onSelect","inputTextValue"],["inputID","customerName","requestUrl","/API/AC/GetSupplierSuggestion","placeholder","Supplier Name","notFoundMessageFor","supplier",1,"w-100",3,"onSelect"],["appendTo","body","bindLabel","Number","bindValue","Key",1,"custom-panel-dropdown",3,"change","items"],["ng-header-tmp",""],["ng-option-tmp",""],[1,"col-5"],[1,"col-3"],[1,"col-4"],[1,"col-4","text-wrap"],[1,"card-header"],[1,"fa-solid","fa-address-card","me-5"],[1,"table-sm","table-borderless"],[2,"width","55px"],["target","_blank",3,"routerLink","queryParams"],[3,"innerHTML"],[1,"fa-solid","fa-truck","me-5"],[1,"d-flex","align-items-center","justify-content-between","w-100","mb-3"],[1,"me-2",2,"width","5px"],[1,"w-100"],["bindLabel","Name","bindValue","ID",3,"ngModelChange","readonly","items","ngModel"],["appearance","outline",3,"dateChange","isFloatingLabel","date"],["type","text",1,"form-control","ps-4",2,"height","35px !important",3,"ngModelChange","ngModel"],[1,"d-flex","align-items-center","justify-content-between","w-100"],["bindLabel","Name","bindValue","ID",3,"ngModelChange","items","ngModel"],[1,"col-xs-12","col-md-8","col-lg-12","col-xl-8","col-sm-12"],["state","Inbound_Logistics",3,"eventImport","isEdit","cartItems"],[3,"form"],["state","Inbound",3,"undo","newForm","afterSubmitData","items"]],template:function(a,o){a&1&&_(0,ad,6,7,"mainpanel-cmp",1),a&2&&m("ngIf",o.storage)},dependencies:[B,G,Ce,R,W,oe,de,We,Ee,ki,Li,ke,Ai,Bi,ci,si,di,he,Hi],styles:["datepicker[_ngcontent-%COMP%] div.mat-mdc-text-field-wrapper{padding-bottom:0!important}autocompleteV2[_ngcontent-%COMP%] input{font-size:16px} mat-button-toggle.toggle-search>button>span.mat-button-toggle-label-content{line-height:30px!important}"]})};var zr=t=>({ID:t});function ld(t,r){if(t&1){let e=b();n(0,"button",17),g("click",function(){d(e);let o=s();return u(o.openExportModal())}),f(1,"i",18),p(2," Export"),i()}}function pd(t,r){if(t&1){let e=b();n(0,"div",19)(1,"h6"),p(2,"Outlet"),i(),n(3,"ng-select",20),h("ngModelChange",function(o){d(e);let c=s();return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"Logistics Service"),i(),n(6,"ng-select",21),h("ngModelChange",function(o){d(e);let c=s();return S(c.pageData.Filter.LogisticServiceID,o)||(c.pageData.Filter.LogisticServiceID=o),u(o)}),i(),n(7,"h6"),p(8,"From"),i(),n(9,"div")(10,"datepicker",22),h("dateChange",function(o){d(e);let c=s();return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i()(),n(11,"h6"),p(12,"To"),i(),n(13,"div")(14,"datepicker",23),h("dateChange",function(o){d(e);let c=s();return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i()(),n(15,"h6"),p(16,"Time"),i(),n(17,"div",24)(18,"div",25)(19,"app-timepicker",26),h("timeChange",function(o){d(e);let c=s();return S(c.pageData.Filter.StartTime,o)||(c.pageData.Filter.StartTime=o),u(o)}),i()(),n(20,"div",25)(21,"app-timepicker",26),h("timeChange",function(o){d(e);let c=s();return S(c.pageData.Filter.EndTime,o)||(c.pageData.Filter.EndTime=o),u(o)}),i()()()()}if(t&2){let e=s();l(3),x("ngModel",e.pageData.Filter.EntityID),m("items",e.pageData.Options==null?null:e.pageData.Options.Entities),l(3),x("ngModel",e.pageData.Filter.LogisticServiceID),m("items",e.pageData.Options==null?null:e.pageData.Options.LogisticServices),l(4),x("date",e.pageData.Filter.From),l(4),x("date",e.pageData.Filter.To),l(5),m("fullWidth",!0),x("time",e.pageData.Filter.StartTime),l(2),m("fullWidth",!0),x("time",e.pageData.Filter.EndTime)}}function md(t,r){if(t&1&&(n(0,"li",32),p(1),i()),t&2){let e=r.$implicit;l(),Qe(" ",e.Name," x ",e.VariantUnitQuantity," ")}}function cd(t,r){if(t&1&&(n(0,"tr",27)(1,"td"),p(2),i(),n(3,"td")(4,"a",28),p(5),i()(),n(6,"td"),p(7),i(),n(8,"td")(9,"a",29),p(10),i()(),n(11,"td"),p(12),i(),n(13,"td")(14,"ul",30),_(15,md,2,2,"li",31),i()()()),t&2){let e=r.$implicit;l(2),I(e.OutletName),l(2),m("queryParams",M(8,zr,e.InvoiceID)),l(),I(e.Number),l(2),I(e.LogisticDisplayName),l(2),m("queryParams",M(10,zr,e.CustomerID)),l(),I(e.CustomerName),l(2),I(e.Fulfillment),l(3),m("ngForOf",e.SalesOrderItem)}}function sd(t,r){if(t&1){let e=b();n(0,"span",33),g("click",function(){d(e);let o=s();return u(o.StoreRowsCountAPIResult("SalesReport/LogisticServiceDetailCount"))}),n(1,"i",34),p(2,"?"),i()()}}function dd(t,r){if(t&1&&(n(0,"span"),p(1),v(2,"number"),i()),t&2){let e=s();l(),I(E(2,1,e.listTotal))}}function ud(t,r){if(t&1){let e=b();n(0,"a",35),g("click",function(){d(e);let o=s();return u(o.NextPage(!0))}),f(1,"i",36),p(2," Next"),i()}}function _d(t,r){if(t&1){let e=b();n(0,"a",37),g("click",function(){d(e);let o=s();return u(o.StoreRowsCountAPIResult("SalesReport/LogisticServiceDetailCount",!0))}),f(1,"i",38),p(2," Show All"),i()}}var In=class t extends Ho{constructor(e,a,o,c,w){super(e,a,"SalesReport/LogisticServiceDetail","SalesReportLoader/LogisticServiceDetail",null,o);this.matDialog=c;this.roleService=w}preInitList(){this.pageData.Filter.StartTime=="00:00:00"&&this.pageData.Filter.EndTime=="00:00:00"&&(this.pageData.Filter.EndTime="23:59:59"),this.initTimeFilter()}initTimeFilter(){let e=this.pageData.Filter.StartTime;e=T.IsNotEmpty(e)?e.substring(0,5):null;let a=this.pageData.Filter.EndTime;a=T.IsNotEmpty(a)?a.substring(0,5):null,this.pageData.Filter.StartTime=e,this.pageData.Filter.EndTime=a}postInit(e){this.extendData?(this.infiniteList=this.infiniteList.concat(e.Data),this.postExtendData(e),this.extendData=!1):(this.infiniteList=e.Data,this.assignAggregate(e)),this.nextPageDisabled=!(e.Data.length<this.pageData.Filter.RowCount),this.originalData=e.Data,this.menuData.H=this.data.PageTitle||this.menuData.H,this.afterPostInit(e)}openExportModal(){this.matDialog.open(Ie,{data:{title:"Logistic Service Detail",exportTypes:[{ID:"ReportExport/LogisticServiceDetail",Value:"Default",FileName:"Logistics Service Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"SalesReport/LogisticServiceDetailCount",pagination:!0}})}static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(pe),C(A),C(ne))};static \u0275cmp=O({type:t,selectors:[["POS-logistics-service-detail"]],standalone:!1,features:[re],decls:36,vars:14,consts:[["pageFilterTemplate",""],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","150px"],["class","border-bottom",4,"ngFor","ngForOf"],[1,"d-flex","justify-content-between","mt-5"],[1,"me-auto","d-sm-block","collapse","mt-3"],[1,"fw-bold","fst-italic","hidden-xxs"],["style","cursor:pointer",3,"click",4,"ngIf"],[4,"ngIf"],[1,"btn-group"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load next page",3,"click",4,"ngIf"],["role","button","class","btn btn-outline-secondary btn-sm text-primary","matTooltipPosition","above","matTooltip","Load all products",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["bindLabel","Name","bindValue","ID","placeholder","Choose an outlet",3,"ngModelChange","ngModel","items"],["bindLabel","Name","bindValue","ID","placeholder","Choose Logistic Service",3,"ngModelChange","ngModel","items"],["name","From",3,"dateChange","date"],["name","To",3,"dateChange","date"],[1,"row"],[1,"col-6"],[3,"timeChange","fullWidth","time"],[1,"border-bottom"],["routerLink","/menu/Orders/Orders/Customer_Invoice/Info",3,"queryParams"],["routerLink","/menu/Contacts/Contact/Customers/Info",3,"queryParams"],[1,"list-inline","m-0"],["class","list-inline-item me-10",4,"ngFor","ngForOf"],[1,"list-inline-item","me-10"],[2,"cursor","pointer",3,"click"],["matTooltipPosition","above","matTooltip","Retreive rows count",1,"border","p-3"],["role","button","matTooltipPosition","above","matTooltip","Load next page",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-arrow-right"],["role","button","matTooltipPosition","above","matTooltip","Load all products",1,"btn","btn-outline-secondary","btn-sm","text-primary",3,"click"],[1,"fa-solid","fa-share"]],template:function(a,o){if(a&1){let c=b();n(0,"mainpanel-cmp",1),h("textChange",function(H){return d(c),S(o.pageData.Filter.Name,H)||(o.pageData.Filter.Name=H),u(H)}),g("onSubmit",function(){return d(c),u(o.searchFromPageOne())}),h("filterChange",function(H){return d(c),S(o.pageData.Filter,H)||(o.pageData.Filter=H),u(H)}),n(1,"actions"),_(2,ld,3,0,"button",2),i(),n(3,"filters"),_(4,pd,22,10,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",3)(8,"table",4)(9,"thead",5)(10,"tr",6)(11,"th"),p(12,"Outlet"),i(),n(13,"th"),p(14,"Number"),i(),n(15,"th"),p(16,"Logistics"),i(),n(17,"th",7),p(18,"Customer"),i(),n(19,"th"),p(20,"Fulfillment"),i(),n(21,"th"),p(22,"Product"),i()()(),n(23,"tbody"),_(24,cd,16,12,"tr",8),i()(),n(25,"div",9)(26,"div",10)(27,"div",11),p(28),v(29,"number"),_(30,sd,3,0,"span",12)(31,dd,3,3,"span",13),p(32),i()(),n(33,"div",14),_(34,ud,3,0,"a",15)(35,_d,3,0,"a",16),i()()()()()}a&2&&(m("pageData",o.menuData),x("text",o.pageData.Filter.Name),m("isFilterOnDropdown",!1),x("filter",o.pageData.Filter),l(2),m("ngIf",o.roleService.global.Export),l(22),m("ngForOf",o.infiniteList),l(4),D(" Showing 1 - ",E(29,12,o.pageData.Filter.RowCount*(o.pageData.Filter.PageNumber-1)+(o.data==null||o.data.Data==null?null:o.data.Data.length))," of "),l(2),m("ngIf",!o.pageData.HideStoreApiCount),l(),m("ngIf",o.pageData.HideStoreApiCount),l(),D(" records ~ ",o.pageData.Filter.PageNumber," Page "),l(2),m("ngIf",o.nextPageDisabled&&!o.goToLast),l(),m("ngIf",o.nextPageDisabled&&!o.goToLast))},dependencies:[J,B,G,R,W,oe,de,Ee,ke,zi,ge],encapsulation:2})};var Re=class t{http=y(k);route=y(pe);loadForm$=this.route.queryParamMap.pipe(Q(r=>this.http.get(`/API/transferorderloader${r.get("ID")?"/"+r.get("ID"):""}/LoadTransferOrderForm`)),lt(1));config$=this.loadForm$.pipe(V(r=>r.AppConfigJSON));deliveryTypes$=this.loadForm$.pipe(V(r=>r.DeliveryTypes));destinations$=this.loadForm$.pipe(V(r=>r.DestinationEntities));outlets$=this.loadForm$.pipe(V(r=>r.Entities));data$=this.loadForm$.pipe(V(r=>r.Data),L(r=>T.IsNotEmpty(r.Order)));items$=this.data$.pipe(V(r=>r.Items.map(e=>le(ae({},e.Variant),{Quantity:e.Quantity,Total:e.Price*e.Quantity*(e.Discount/100),VariantID:e.VariantID,UnitPrice:e.Price,UnitCost:e.Cost,Serial:e.Serial,ID:e.ID,Note:e.Note,Discount:e.Discount}))));static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Fe=class t{_createNewTransaction=new be;router=y(at);createNewTransaction$=this._createNewTransaction.asObservable();constructor(){}createNewTransaction(){this._createNewTransaction.next(),this.router.navigate([],{queryParams:{ID:null}})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var ce=class t{loadForm=y(Re);lowOnStock=y(jt);overOnStock=y(Qt);toastr=y(ee);route=y(pe);isEdit=T.IsNotEmpty(this.route.snapshot.queryParams.ID);newTrans=y(Fe);sourceOutlet=new $e({value:{ID:T.GuidEmpty,Name:"Source"},disabled:this.isEdit});sourceOutletID$=fi(()=>this.sourceOutlet.valueChanges.pipe(ze(this.sourceOutlet.value))).pipe(V(r=>r.ID));destinationOutlet=new $e({value:{ID:T.GuidEmpty,Name:"Destination"},disabled:this.isEdit});destinationOutletID$=fi(()=>this.destinationOutlet.valueChanges.pipe(ze(this.destinationOutlet.value))).pipe(V(r=>r.ID));assignSourceOutlet$=this.loadForm.outlets$.pipe(L(()=>T.IsNotEmpty(this.route.snapshot.queryParams.ID)),se(this.loadForm.data$),V(([r,e])=>r.find(o=>o.ID===e.Order.SourceEntityID)),q(r=>this.sourceOutlet.setValue(r)));assignDestinationOutlet$=this.loadForm.destinations$.pipe(L(()=>T.IsNotEmpty(this.route.snapshot.queryParams.ID)),se(this.loadForm.data$),V(([r,e])=>r.find(o=>o.ID===e.Order.DestinationEntityID)),q(r=>this.destinationOutlet.setValue(r)));resetAndWarnOnSameOutlet$=Ve(this.destinationOutlet.valueChanges.pipe(V(r=>le(ae({},r),{outletType:"destination"}))),this.sourceOutlet.valueChanges.pipe(V(r=>le(ae({},r),{outletType:"source"})))).pipe(L(r=>T.IsNotEmpty(r.ID)),V(r=>r.outletType=="destination"?r.ID===this.sourceOutlet.value.ID:r.ID===this.destinationOutlet.value.ID),L(r=>r),q(()=>{this.destinationOutlet.setValue({ID:T.GuidEmpty,Name:"Destination"}),this.toastr.warning("Source and destination outlet cannot be the same","Warning")}));resetSourceOutletID$=this.newTrans.createNewTransaction$.pipe(q(()=>{console.log("reset source outlet"),this.sourceOutlet.setValue({ID:T.GuidEmpty,Name:"Source"})}));enableOutletOnNewTransaction$=this.newTrans.createNewTransaction$.pipe(q(()=>{this.sourceOutlet.enable(),this.destinationOutlet.enable()}));resetDestinationOutletID$=Ve(this.newTrans.createNewTransaction$).pipe(q(()=>this.destinationOutlet.setValue({ID:T.GuidEmpty,Name:"Destination"})));assignDestinationIDFromInventoryROP=this.lowOnStock.destinationOutlet$;assignSourceOutletFromOverInventory=this.overOnStock.outletSource$;constructor(){bt([this.assignSourceOutlet$.pipe(ze(null)),this.assignSourceOutletFromOverInventory.pipe(ze(null))]).pipe(V(([r,e])=>T.IsNotEmpty(r)?r:e),L(r=>T.IsNotEmpty(r)),pt()).subscribe(r=>{console.log(`Source Outlet: ${r.Name}`),this.sourceOutlet.setValue(r)}),bt([this.assignDestinationOutlet$.pipe(ze(null)),this.assignDestinationIDFromInventoryROP.pipe(ze(null))]).pipe(V(([r,e])=>T.IsNotEmpty(r)?r:e),L(r=>T.IsNotEmpty(r)),pt()).subscribe(r=>{console.log(`Destination Outlet: ${r.Name}`),this.destinationOutlet.setValue(r)}),this.resetAndWarnOnSameOutlet$.subscribe(),this.resetSourceOutletID$.subscribe(),this.resetDestinationOutletID$.subscribe(),this.enableOutletOnNewTransaction$.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac})};var wt=class t{outlet=y(ce);matDialog=y(A);_import=new be;import$=this._import.asObservable();importedCart$=this.import$.pipe(se(this.outlet.sourceOutletID$),L(([r,e])=>T.IsNotEmpty(e)),Q(([r,e])=>this.matDialog.open(Ji,{data:{sampleUrl:"https://res.cloudinary.com/pos/raw/upload/v1699867624/POS/CSV/ImportTransferOrder_DealPOS_New.csv",fileEndpoint:"/API/TransferOrder/UploadCsv",outletID:e,useUppy:!0}}).afterClosed()),L(r=>T.IsNotEmpty(r)),V(r=>r.map(e=>le(ae({},e.Variant),{Quantity:e.Quantity,Total:e.Price*e.Quantity,VariantID:e.VariantID,UnitPrice:e.Price,UnitCost:e.Cost,Serial:e.Serial,Note:e.Note,Discount:e.Discount,DiscountAmount:e.DiscountAmount}))));constructor(){}import(){this._import.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Tn=class t{constructor(r){this.dialogRef=r;this.config.title="Empty outlet Inventory?",this.config.customWidth="500px"}config=new _e;ok(){this.dialogRef.close("empty")}close(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||t)(C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-clear-outlet"]],decls:4,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"fw-normal"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.ok()})("onCancel",function(){return a.close()})("onClose",function(){return a.close()}),n(1,"content")(2,"h4",1),p(3,"This will populate cart with all inventory from source outlet!"),i()()()),e&2&&m("config",a.config)},dependencies:[X,De,fe],encapsulation:2})};var Ot=class t{outlet=y(ce);http=y(k);matDialog=y(A);outletID$=this.outlet.sourceOutletID$;_clearOutlet=new be;clearOutlet$=this._clearOutlet.asObservable();populateCartWithAllItemsFromSourceOutlet$=this.clearOutlet$.pipe(Q(()=>this.matDialog.open(Tn).afterClosed()),L(r=>T.IsNotEmpty(r)),se(this.outletID$),L(([r,e])=>T.IsNotEmpty(e)),Q(([r,e])=>this.http.get(Ne.getAllOutletInventory,[{key:"EntityID",value:e}]).pipe(je(()=>Oe))));constructor(){}clearOutlet(){this._clearOutlet.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Et=class t{outlet=y(ce);http=y(k);route=y(pe);loadRegister$=this.outlet.sourceOutletID$.pipe(L(r=>T.IsNotEmpty(r)),V(r=>[r,T.IsNotEmpty(this.route.snapshot.queryParams.ID)]),q(console.log),Q(([r,e])=>this.http.get("/api/TransferOrderLoader/LoadRegister",[{key:"EntityID",value:r},{key:"IsEdit",value:e}])),lt(1));constructor(){this.loadRegister$.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Kt=class t{outlet=y(ce);http=y(k);loadRegister=y(Et);outletID$=this.outlet.sourceOutletID$;quickKeyItems$=this.loadRegister.loadRegister$.pipe(V(r=>r.QuickKey));itemQuickKeyID=new $e(T.GuidEmpty);itemQuickKey$=fi(()=>this.itemQuickKeyID.valueChanges.pipe(ze(this.itemQuickKeyID.value))).pipe(L(r=>T.IsNotEmpty(r)),se(this.outletID$),L(([r,e])=>T.IsNotEmpty(e)),Q(([r,e])=>this.http.get(Ne.GetVariantByID,[{key:"ID",value:r},{key:"EntityID",value:e}]).pipe(je(()=>Oe))));static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Mt=class t{outlet=y(ce);http=y(k);_scanSerial=new be;scanSerial$=this._scanSerial.asObservable();item$=this.scanSerial$.pipe(se(this.outlet.sourceOutletID$),Q(([r,e])=>this.http.get(Ne.GetVariantBySerial,[{key:"Serial",value:r},{key:"EntityID",value:e}]).pipe(je(()=>Oe))));constructor(){}scanSerial(r){this._scanSerial.next(r)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var wn=class t{constructor(r){this.dialogRef=r;this.config.title="Void Transaction?"}config=new _e;ok(){this.dialogRef.close("void")}close(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||t)(C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-void"]],decls:4,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"fw-normal"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.ok()})("onCancel",function(){return a.close()})("onClose",function(){return a.close()}),n(1,"content")(2,"h4",1),p(3,"This will erase all current data. Are you sure?"),i()()()),e&2&&m("config",a.config)},dependencies:[X,De,fe],encapsulation:2})};var Ye=class t{matDialog=y(A);_void=new be;void$=this._void.asObservable().pipe(Q(()=>this.matDialog.open(wn).afterClosed()),L(r=>T.IsNotEmpty(r)),lt(1));void(){this._void.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Jt=class t{outlet=y(ce);http=y(k);variantAutocomplete=new $e(null);getVariantByCode$=this.variantAutocomplete.valueChanges.pipe(L(r=>T.IsNotEmpty(r)&&r.type=="Code"),V(r=>r.str),se(this.outlet.sourceOutletID$),Q(([r,e])=>this.http.get(Ne.GetVariantByCode,[{key:"Code",value:r},{key:"EntityID",value:e}]).pipe(je(()=>Oe))));getVariantByID$=this.variantAutocomplete.valueChanges.pipe(L(r=>T.IsNotEmpty(r)&&r.type=="ID"),V(r=>r.str),se(this.outlet.sourceOutletID$),Q(([r,e])=>this.http.get(Ne.GetVariantByID,[{key:"ID",value:r},{key:"EntityID",value:e}]).pipe(je(()=>Oe))));static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var gd=["quantity"],ao=t=>({selected:t}),Cd=()=>["/menu/Products/Catalog/Variants/Info"],vd=t=>({ID:t}),yd=t=>({"table-light":t});function xd(t,r){if(t&1){let e=b();n(0,"a",10),g("click",function(){d(e);let o=s();return u(o.onTabChange("Product"))}),p(1," Product "),i()}if(t&2){let e=s();m("ngClass",M(1,ao,e.tabState=="Product"))}}function Sd(t,r){if(t&1){let e=b();z(0),n(1,"a",11),g("click",function(){d(e);let o=s();return u(o.onTabChange("Serial"))}),p(2," Serial "),i(),$()}if(t&2){let e=s();l(),m("ngClass",M(1,ao,e.tabState=="Serial"))}}function hd(t,r){if(t&1&&(z(0),n(1,"div",19)(2,"div",22),f(3,"POS-variant-autocomplete",23),i()(),$()),t&2){let e=s(2);l(3),m("formControl",e.variantAutocomplete)("isOnModalVariant",!0)}}function bd(t,r){if(t&1&&(n(0,"span"),p(1),i()),t&2){let e=s(2);l(),D("(",e.variant.UOMName,")")}}function Dd(t,r){if(t&1){let e=b();n(0,"div",24)(1,"strong"),p(2,"Price"),i(),n(3,"input",25,2),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.variant.UnitPrice,o)||(c.variant.UnitPrice=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("simpleKeyboard",e.keyboard),x("ngModel",e.variant.UnitPrice)}}function Id(t,r){if(t&1){let e=b();n(0,"div",24)(1,"strong"),p(2,"Cost"),i(),n(3,"input",25,2),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.variant.UnitCost,o)||(c.variant.UnitCost=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("simpleKeyboard",e.keyboard),x("ngModel",e.variant.UnitCost)}}function Td(t,r){if(t&1){let e=b();z(0),n(1,"div",12),_(2,hd,4,2,"ng-container",8),n(3,"div",13)(4,"div",14)(5,"strong"),p(6," Qty "),_(7,bd,2,1,"span",8),i(),n(8,"input",15,0),h("ngModelChange",function(o){d(e);let c=s();return S(c.variant.Quantity,o)||(c.variant.Quantity=o),u(o)}),i()(),_(10,Dd,5,2,"div",16)(11,Id,5,2,"div",16),n(12,"div",17)(13,"strong"),p(14,"Discount %"),i(),n(15,"input",18,1),h("ngModelChange",function(o){d(e);let c=s();return S(c.variant.Discount,o)||(c.variant.Discount=o),u(o)}),i()()(),n(17,"div",19)(18,"div",20)(19,"POS-tinymce-editor",21),h("ngModelChange",function(o){d(e);let c=s();return S(c.variant.Note,o)||(c.variant.Note=o),u(o)}),i()()()(),$()}if(t&2){let e=s();l(2),m("ngIf",e.isCreate),l(5),m("ngIf",e.variant.UOMName),l(),m("simpleKeyboard",e.keyboard)("decimalPlaces",e.isSerialItem?0:4),x("ngModel",e.variant.Quantity),m("disabled",e.isEditBuyForm&&e.isSerialItem),l(2),m("ngIf",e.appConfigJSON.ModuleDelivery.OutletDelivery.PriceVisible),l(),m("ngIf",e.appConfigJSON.ModuleDelivery.OutletDelivery.CostVisible),l(4),m("simpleKeyboard",e.keyboard),x("ngModel",e.variant.Discount),m("readonly",!e.role.sell.Discount),l(4),x("ngModel",e.variant.Note)}}function wd(t,r){t&1&&(z(0),f(1,"i",32),n(2,"h6"),p(3,"No Image"),i(),$())}function Od(t,r){if(t&1&&f(0,"img",33),t&2){let e=s(2);m("src",e.variant.ThumbnailUrl,ei)}}function Ed(t,r){if(t&1&&(n(0,"th",34),f(1,"i",36),p(2),i()),t&2){let e=s(3);l(2),D("",e.destinationName," ")}}function Md(t,r){if(t&1&&(n(0,"td",41),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),D(" ",E(2,1,e.destination.onHand)," ")}}function Pd(t,r){if(t&1&&(n(0,"td",41),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),D(" ",E(2,1,e.destination.allocated)," ")}}function Fd(t,r){if(t&1&&(n(0,"td",41),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),D(" ",E(2,1,e.destination.onHand-e.destination.allocated)," ")}}function Vd(t,r){if(t&1&&(n(0,"td",41),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),D(" ",E(2,1,e.destination.rop)," ")}}function Nd(t,r){if(t&1&&(n(0,"td",49),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),Qe(" ",e.destination.ropDiff>=0?"+":"","",E(2,2,e.destination.ropDiff)," ")}}function kd(t,r){if(t&1&&(n(0,"td",41),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),D(" ",E(2,1,e.destination.max)," ")}}function Ld(t,r){if(t&1&&(n(0,"td",50),p(1),v(2,"number"),i()),t&2){let e=s().ngIf;l(),Qe(" ",e.destination.maxDiff>=0?"+":"","",E(2,2,e.destination.maxDiff)," ")}}function Rd(t,r){if(t&1){let e=b();n(0,"button",51),g("click",function(){d(e);let o=s().ngIf,c=s(2);return u(c.setQuantityToMax(o))}),p(1," Place Order "),i()}}function Ad(t,r){if(t&1&&(n(0,"tbody")(1,"tr")(2,"th",34),f(3,"i",35),p(4,"Inventory "),i(),n(5,"th",34),f(6,"i",36),p(7),i(),_(8,Ed,3,1,"th",37),n(9,"th",34),f(10,"i",38),p(11," Diff "),i(),n(12,"th",34),f(13,"i",39),p(14," Action "),i()(),n(15,"tr")(16,"th",40),p(17,"On Hand"),i(),n(18,"td",41),p(19),v(20,"number"),i(),_(21,Md,3,3,"td",42),f(22,"td",43)(23,"td",44),i(),n(24,"tr")(25,"th",40),p(26,"Allocated"),i(),n(27,"td",41),p(28),v(29,"number"),i(),_(30,Pd,3,3,"td",42),i(),n(31,"tr")(32,"th",40),p(33,"Available"),i(),n(34,"td",41),p(35),v(36,"number"),i(),_(37,Fd,3,3,"td",42),i(),n(38,"tr")(39,"th",40),p(40,"ROP"),i(),n(41,"td",41),p(42),v(43,"number"),i(),_(44,Vd,3,3,"td",42)(45,Nd,3,4,"td",45),i(),n(46,"tr")(47,"th",40),p(48,"Max"),i(),n(49,"td",41),p(50),v(51,"number"),i(),_(52,kd,3,3,"td",42)(53,Ld,3,4,"td",46),n(54,"td",47),_(55,Rd,2,0,"button",48),i()()()),t&2){let e=r.ngIf,a=s(2);l(7),D("",a.outletName," "),l(),m("ngIf",a.isEmptyDestinationID()),l(11),D(" ",E(20,16,e.source.onHand)," "),l(2),m("ngIf",a.isEmptyDestinationID()),l(7),D(" ",E(29,18,e.source.allocated)," "),l(2),m("ngIf",a.isEmptyDestinationID()),l(5),D(" ",E(36,20,e.source.onHand-e.source.allocated)," "),l(2),m("ngIf",a.isEmptyDestinationID()),l(5),D(" ",E(43,22,e.source.rop)," "),l(2),m("ngIf",a.isEmptyDestinationID()),l(),m("ngIf",a.isEmptyDestinationID()),l(5),D(" ",E(51,24,e.source.max)," "),l(2),m("ngIf",a.isEmptyDestinationID()),l(),m("ngIf",a.isEmptyDestinationID()),l(),m("ngClass",M(26,yd,a.variant.Quantity==e.source.max-e.source.onHand-e.source.allocated)),l(),m("ngIf",a.variant.Quantity!=e.source.max-e.source.onHand-e.source.allocated)}}function Bd(t,r){if(t&1&&(z(0),n(1,"div",26)(2,"div",27)(3,"a",28),_(4,wd,4,0,"ng-container",29)(5,Od,1,1,"ng-template",null,3,Z),i()(),n(7,"div",30)(8,"table",31),_(9,Ad,56,28,"tbody",8),v(10,"async"),i()()(),$()),t&2){let e=we(6),a=s();l(3),m("routerLink",N(7,Cd))("queryParams",M(8,vd,a.variant==null?null:a.variant.ID)),l(),m("ngIf",(a.variant==null?null:a.variant.ThumbnailUrl)==null)("ngIfElse",e),l(5),m("ngIf",E(10,5,a.variantStock$))}}function Wd(t,r){if(t&1){let e=b();z(0),n(1,"app-item-serial",52),h("cartItemChange",function(o){d(e);let c=s();return S(c.variant,o)||(c.variant=o),u(o)}),i(),$()}if(t&2){let e=s();l(),m("entityId",e.outletID),x("cartItem",e.variant),m("disabled",e.isEditBuyForm)}}var Di=class t{constructor(r,e,a,o,c,w){this.dialogRef=r;this.http=a;this.role=o;this.toastr=w;this.config=new _e,this.config.title=e.variant?.Name??"Add Variant",this.config.customWidth="750px",this.appConfigJSON=e.appConfigJSON,this.unitQtyLabel=this.appConfigJSON.ModuleSell.ProductDialog.UnitQtyLabel,this.numpadVisible=this.appConfigJSON.ModuleSell.NumPadVisible,this.numpadVisible&&(this.keyboard=c.keyboard),this.isEditBuyForm=e.isEditBuyForm,this.outletID=e.outletID,this.outletName=e.outletName,this.destinationID=e.destinationID,this.destinationName=e.destinationName,this.variant=e.variant;let ie=this.appConfigJSON?.ModuleSell?.ProductDialog?.QuantityToOneInDialog?1:null;if(this.variant)this.isSerialItem=this.variant.TypeID==4,this.variantStock$=this.getOnInventory();else{this.isCreate=!0,this.variant={Quantity:ie,UnitQuantity:1,OrderPrice:0,Total:0,Note:"",UnitPrice:0,ThumbnailUrl:"",UOMName:"",TypeID:0,Discount:0,ID:"",Serial:[],UnitCost:0,VariantID:T.GuidEmpty};let Ue=this.variantAutocomplete.valueChanges.pipe(L(Y=>Y.type=="Code"),V(Y=>Y.str),Q(Y=>a.get(Ne.GetVariantByCode,[{key:"Code",value:Y},{key:"EntityID",value:this.outletID}]).pipe(je(()=>Oe))),V(Y=>this.setUnitPrice(Y)),V(Y=>le(ae({},Y),{Quantity:ie,Total:Y.UnitPrice,VariantID:Y.ID})),q(Y=>this.config.title=Y.Name)),_i=this.variantAutocomplete.valueChanges.pipe(L(Y=>Y.type=="ID"),V(Y=>Y.str),Q(Y=>a.get(Ne.GetVariantByID,[{key:"ID",value:Y},{key:"EntityID",value:this.outletID}]).pipe(je(()=>Oe))),V(Y=>this.setUnitPrice(Y)),V(Y=>le(ae({},Y),{Quantity:ie,Total:Y.UnitPrice,VariantID:Y.ID})),q(Y=>this.config.title=Y.Name));Ve(Ue,_i).pipe(q(Y=>this.setFocusField("quantity")),lt(1)).subscribe(Y=>{this.variant=Y,this.isSerialItem=this.variant.TypeID==4,this.showInventory=!0,this.variantStock$=this.getOnInventory()})}}variantAutocomplete=new $e;_quantityElement;variant;variantStock$=Oe;isSerialItem=!1;outletID;outletName;destinationID;destinationName;appConfigJSON;numpadVisible;keyboard;isEditBuyForm=!1;unitQtyLabel;config;tabState="Cart";isCreate=!1;showInventory=!1;serials=[];isFocusOnSerialInput=!1;_onGetInventory=new gt(void 0);onGetInventory$=this._onGetInventory.asObservable();setFocusField(r){switch(r){case"quantity":this._quantityElement.nativeElement.focus();break}}onTabChange(r){this.tabState=r}ok(){if(!this.isFocusOnSerialInput){if(this.checkQuantityIsNull(),this.isSerialItem){if(this.serials.length){let a=this.serials.map(o=>({Quantity:1,Number:o}));this.variant.Serial=[...this.variant.Serial,...a]}let r=this.variant.Serial?.map(a=>a.Quantity).reduce((a,o)=>a+o,0)??0,e=this.variant.Quantity;if(r!=e){this.toastr.warning("Serial Quantity must be equal to Variant Quantity","Warning");return}}this.dialogRef.close({item:le(ae({},this.variant),{Total:this.variant.UnitPrice*this.variant.UnitQuantity*this.variant.Quantity*((100-(this.variant.Discount??0))/100)})})}}close(){this.dialogRef.close()}checkQuantityIsNull(){this.variant.Quantity==null&&(this.variant.Quantity=1)}setQuantityToMax(r){let e=r.destination.onHand-r.destination.allocated;r.destination.max>=e?(this.variant.Quantity=r.destination.max-e,this.toastr.success("Qty adjusted to Max Inventory","Success"),this.ok()):this.toastr.warning("Your Inventory Available is more than Max Inventory","Warning")}getOnInventory(){let r=a=>{let o=a.OnHand-a.Allocated;return{onHand:a.OnHand,allocated:a.Allocated,rop:a.ROP,max:a.Max,maxDiff:a.Max-o,ropDiff:a.ROP-o}},e=so({source:this.http.get(Ne.GetVariantStockByID,[{key:"ID",value:this.variant.VariantID},{key:"EntityID",value:this.outletID}]).pipe(V(r)),destination:this.http.get(Ne.GetVariantStockByID,[{key:"ID",value:this.variant.VariantID},{key:"EntityID",value:this.destinationID}]).pipe(V(r))});return this.onGetInventory$.pipe(fo((a,o)=>a?Ct(a):e,null),V(a=>a),lt(1))}setUnitPrice(r){return ae({},r)}isEmptyDestinationID(){return!T.IsEmpty(this.destinationID)}static \u0275fac=function(e){return new(e||t)(C(ye),C(Ke),C(k),C(ne),C(mr),C(ee))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-item"]],viewQuery:function(e,a){if(e&1&&Ei(gd,5),e&2){let o;Mi(o=Pi())&&(a._quantityElement=o.first)}},decls:12,vars:9,consts:[["quantity",""],["discount",""],["price",""],["SHOW_IMAGE",""],[3,"onOk","onCancel","onClose","config"],[1,"row","border-bottom","mx-5"],["data-cy","input_sell",1,"btn","btn-link",3,"click","ngClass"],["class","btn btn-link","data-cy","product",3,"ngClass","click",4,"ngIf"],[4,"ngIf"],[1,"mx-8"],["data-cy","product",1,"btn","btn-link",3,"click","ngClass"],["data-cy","serial",1,"btn","btn-link",3,"click","ngClass"],[1,"mt-8"],[1,"row","mt-8"],[1,"col-auto","mb-4","pe-0",2,"width","82px"],["id","txtCartQuantity","keyboardType","number","type","text","autoNum","",1,"form-control","input-numpad",3,"ngModelChange","simpleKeyboard","decimalPlaces","ngModel","disabled"],["class","col-auto pe-0","style","width: 112px",4,"ngIf"],[1,"col-auto","pe-0",2,"width","90px"],["id","inputDiscount","keyboardType","number","type","text","autoNum","","percentage","",1,"form-control",3,"ngModelChange","simpleKeyboard","ngModel","readonly"],[1,"row"],[1,"col","tinymce"],["height","210px",3,"ngModelChange","ngModel"],[1,"col"],[3,"formControl","isOnModalVariant"],[1,"col-auto","pe-0",2,"width","112px"],["id","inputPrice","keyboardType","number","type","text","autoNum","",1,"form-control",3,"ngModelChange","simpleKeyboard","ngModel"],[1,"row","mt-6"],[1,"col-sm-3","d-flex","justify-content-center","flex-column","align-items-center","text-body-secondary"],["target","_blank",2,"color","inherit",3,"routerLink","queryParams"],[4,"ngIf","ngIfElse"],[1,"col-sm-9"],[1,"table","table-bordered","text-center","inventory-table","w-100"],["aria-hidden","true",1,"fa-solid","fa-image","fa-5x"],[1,"border","rounded",3,"src"],[1,"bg-light-orange"],["aria-hidden","true",1,"fa-box-archive","fa-solid","fa-1x","me-2"],["aria-hidden","true",1,"fa-solid","fa-house","fa-1x","me-2"],["class","bg-light-orange",4,"ngIf"],["aria-hidden","true",1,"fa-solid","fa-plus-minus","fa-1x","me-2"],["aria-hidden","true",1,"fa-solid","fa-sliders","fa-1x","me-2"],[1,"table-light","text-start"],[1,"text-end"],["class","text-end",4,"ngIf"],["rowspan","3",1,"table-light"],["rowspan","4",1,"table-light"],["class","text-danger",4,"ngIf"],["class","text-success",4,"ngIf"],[3,"ngClass"],["style","font-size: 12px","type","button","class","btn btn-success btn-sm me-2","matTooltipPosition","above","matTooltip","Adjust Bought Qty to max Inventory",3,"click",4,"ngIf"],[1,"text-danger"],[1,"text-success"],["type","button","matTooltipPosition","above","matTooltip","Adjust Bought Qty to max Inventory",1,"btn","btn-success","btn-sm","me-2",2,"font-size","12px",3,"click"],[3,"cartItemChange","entityId","cartItem","disabled"]],template:function(e,a){e&1&&(n(0,"modal-material",4),g("onOk",function(){return a.ok()})("onCancel",function(){return a.close()})("onClose",function(){return a.close()}),n(1,"content")(2,"div",5)(3,"div")(4,"a",6),g("click",function(){return a.onTabChange("Cart")}),p(5," Cart "),i(),_(6,xd,2,3,"a",7)(7,Sd,3,3,"ng-container",8),i()(),n(8,"div",9),_(9,Td,20,12,"ng-container",8)(10,Bd,11,10,"ng-container",8)(11,Wd,2,3,"ng-container",8),i()()()),e&2&&(m("config",a.config),l(4),m("ngClass",M(7,ao,a.tabState=="Cart")),l(2),m("ngIf",a.appConfigJSON.ModuleDelivery.OutletDelivery.Inventory&&(!a.isCreate||a.showInventory)&&a.role.inventory.View),l(),m("ngIf",a.isSerialItem),l(2),m("ngIf",a.tabState=="Cart"),l(),m("ngIf",a.tabState=="Product"&&a.role.inventory.View),l(),m("ngIf",a.tabState=="Serial"))},dependencies:[X,mt,B,rt,ge,st,xt,Ge,Ce,R,W,Ni,De,fe,Wi,ct,ji,yt,G,_r,cr,Yi,Bt,oi,Gi,fr],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}p-chips[_ngcontent-%COMP%] ul.p-inputtext{width:570px;max-width:570px;border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] ul.p-inputtext li.p-chips-input-token>input[type=text]{border:none}p-chips[_ngcontent-%COMP%] .p-chips .p-chips-multiple-container:not(.p-disabled):hover{border:1px solid #C8D3DF}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container{display:inline-block}p-chips[_ngcontent-%COMP%] .p-chips-multiple-container .p-chips-token{margin:2px;background:#96bf48}.inventory-table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .inventory-table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{line-height:6px!important}.btn-link[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}"]})};var Rt=class t{loadForm=y(Re);newTransaction=y(Fe);isEdit=new gt(!1);isEdit$=this.isEdit.asObservable();constructor(){this.loadForm.data$.subscribe(()=>this.setIsEdit(!0)),this.newTransaction.createNewTransaction$.subscribe(()=>this.setIsEdit(!1))}setIsEdit(r){this.isEdit.next(r)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Pt=class t{outlet=y(ce);loadForm=y(Re);route=y(pe);matDialog=y(A);isEdit$=y(Rt).isEdit$;_addItem=new be;addItem$=this._addItem.asObservable().pipe(Q(()=>Ct({outletID:this.outlet.sourceOutlet.value.ID,outletName:this.outlet.sourceOutlet.value.Name,destinationID:this.outlet.destinationOutlet.value.ID,destinationName:this.outlet.destinationOutlet.value.Name})),Q(r=>bt([this.loadForm.config$,Ct(r)]).pipe(Ft(1))),se(this.isEdit$),Q(([[r,e],a])=>this.matDialog.open(Di,{data:{appConfigJSON:r,isEdit:a,outletID:e.outletID,outletName:e.outletName,destinationID:e.destinationID,destinationName:e.destinationName}}).afterClosed()),L(r=>T.IsNotEmpty(r?.item)),V(r=>r.item));_editItem=new be;editItem$=this._editItem.asObservable().pipe(Q(r=>Ct({outletID:this.outlet.sourceOutlet.value.ID,outletName:this.outlet.sourceOutlet.value.Name,destinationID:this.outlet.destinationOutlet.value.ID,destinationName:this.outlet.destinationOutlet.value.Name,item:r.item,index:r.index})),Q(r=>bt([this.loadForm.config$,Ct(r)]).pipe(Ft(1))),se(this.isEdit$),Q(([[r,e],a])=>this.matDialog.open(Di,{data:{appConfigJSON:r,isEdit:a,outletID:e.outletID,outletName:e.outletName,destinationID:e.destinationID,destinationName:e.destinationName,variant:e.item}}).afterClosed().pipe(L(o=>T.IsNotEmpty(o?.item)),V(o=>({item:o.item,index:e.index})))));addItem(){this._addItem.next()}editItem(r,e){this._editItem.next({item:ae({},r),index:e})}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ze=class t{importCart=y(wt);clearOutlet=y(Ot);loadForm=y(Re);quickKey=y(Kt);scanSerialService=y(Mt);void=y(Ye);newTrans=y(Fe);variantAutocomplete=y(Jt);itemDialog=y(Pt);lowOnStock=y(jt);overOnStock=y(Qt);_cartAction=new be;cartAction$=this._cartAction.asObservable();outletService=y(ce);RFIDService=y(Xi);constructor(){this.outletService.sourceOutletID$.pipe(Q(r=>this.RFIDService.processGroupedData(r)),q(r=>this.rfid(r))).subscribe(),this.cart$.subscribe(),Ve(this.importCart.importedCart$,this.clearOutlet.populateCartWithAllItemsFromSourceOutlet$).pipe(V(r=>({action:"addBulkItems",items:r}))).subscribe(r=>this._cartAction.next(r)),Ve(this.loadForm.items$,this.lowOnStock.items$,this.overOnStock.items$).pipe(L(r=>T.IsNotEmpty(r)&&r.length>0),V(r=>({action:"replaceCart",items:r}))).subscribe(r=>this._cartAction.next(r)),this.scanSerialService.item$.pipe(V(r=>({action:"scanSerial",item:this.formatItemObject(r)}))).subscribe(r=>this._cartAction.next(r)),Ve(this.void.void$,this.newTrans.createNewTransaction$).subscribe(()=>this._cartAction.next({action:"emptyCart"})),Ve(this.variantAutocomplete.getVariantByCode$,this.variantAutocomplete.getVariantByID$,this.quickKey.itemQuickKey$).pipe(V(r=>({action:"add",item:r}))).subscribe(r=>this._cartAction.next(r)),this.itemDialog.addItem$.pipe(V(r=>({action:"addToNewRow",item:r}))).subscribe(r=>this._cartAction.next(r)),this.itemDialog.editItem$.pipe(V(r=>({action:"update",item:r.item,index:r.index}))).subscribe(r=>this._cartAction.next(r))}rearrangeCart(r){this._cartAction.next({action:"rearrangeCart",ev:r})}remove(r){this._cartAction.next({action:"remove",index:r})}add(r){this._cartAction.next({action:"add",item:r})}addToNewRow(r){this._cartAction.next({action:"addToNewRow",item:r})}addbulkItems(r){this._cartAction.next({action:"addBulkItems",items:r})}replaceCart(r){this._cartAction.next({action:"replaceCart",items:r})}scanSerial(r){this._cartAction.next({action:"scanSerial",item:r})}return(r){this._cartAction.next({action:"return",index:r})}purchase(r){this._cartAction.next({action:"purchase",index:r})}rfid(r){this._cartAction.next({action:"rfid",items:r})}clear(){this._cartAction.next({action:"emptyCart"})}formatItemObject=r=>{let o=r,{ID:e}=o,a=po(o,["ID"]);return le(ae({},a),{Quantity:a.Quantity??1,Total:a.Total??a.UnitPrice,VariantID:e})};cart$=this.cartAction$.pipe(wi((r,e)=>{let a=[...r],o=[],c=e.action;if(c=="add"){let w=e.item,H=a.findIndex(ie=>ie.VariantID==w.ID);o=H!=-1?a.map((ie,Ue)=>Ue==H?le(ae({},ie),{Quantity:ie.Quantity+1,Total:ie.Total+ie.UnitPrice}):ie):[...a,this.formatItemObject(w)]}else if(c=="update"){let w=e.item,H=e.index;o=a.map((ie,Ue)=>Ue==H?ae({},w):ie)}else if(c=="remove"){let w=e.index;o=a.filter((H,ie)=>ie!=w)}else if(c=="addToNewRow"){let w=e.item;o=[...a,this.formatItemObject(w)]}else if(c=="addBulkItems"){let w=e.items;o=[...a,...w.map(H=>this.formatItemObject(H))]}else if(c=="replaceCart")o=[...e.items];else if(c=="rearrangeCart"){let w=e.ev;o=a,Ao(o,w.previousIndex,w.currentIndex)}else if(c=="emptyCart")o=[];else if(c=="scanSerial"){let w=le(ae({},e.item),{Serial:[{Number:e.item.Serial.Number,Quantity:1,ExpiryDate:e.item.Serial.ExpiryDate}]});if(!!a.find(ie=>ie.VariantID==w.VariantID)){let ie=w.Serial[0],Ue=a.find(Y=>Y.VariantID==w.VariantID),At=!!Ue.Serial.find(Y=>Y.Number==ie.Number)?[...Ue.Serial].map(Y=>Y.Number==ie.Number?le(ae({},Y),{Quantity:Y.Quantity+1}):Y):[...Ue.Serial,ie];o=a.map(Y=>Y.VariantID==w.VariantID?le(ae({},Y),{Quantity:Y.Quantity+1,Total:Y.Total+Y.UnitPrice,Serial:At}):Y)}else o=[...a,le(ae({},w),{Quantity:1,Total:w.UnitPrice})]}else if(c=="return"){let w=e.index;o=a.map((H,ie)=>ie==w?le(ae({},H),{Quantity:-Math.abs(H.Quantity),Total:-Math.abs(H.Total)}):H)}else if(c=="purchase"){let w=e.index;o=a.map((H,ie)=>ie==w?le(ae({},H),{Quantity:Math.abs(H.Quantity),Total:Math.abs(H.Total)}):H)}else if(c==="rfid"){let w=e.items;console.log("items",w);let H=[];Object.keys(w).forEach(ie=>{if(w.hasOwnProperty(ie)){let Ue=w[ie];if(Ue&&Object.keys(Ue.variant).length>0){let _i=a.findIndex(At=>At.Code.toLowerCase()===ie.toLowerCase());if(_i!==-1){let At=Number(Ue.count);a[_i].Quantity+=At,delete w[ie],H=[...a]}else{let At=Ue.variant,Y=Number(Ue.count),Gr=this.formatItemObject(le(ae({},At),{Quantity:Y}));delete w[ie],H=[...a,Gr]}}}}),o=[...H]}return o},[]),ze([]),lt(1));static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var On=class t{constructor(r){this.dialogRef=r;this.config.title="New Courier",this.config.customWidth="500px"}config=new _e;courier="";ok(){T.IsNotEmpty(this.courier)?this.dialogRef.close(this.courier):this.close()}close(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||t)(C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-add-courier"]],decls:8,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"row"],[1,"col-sm-12"],[1,"form-floating-outline"],["type","text","placeholder","Add New Courier",1,"form-control",3,"ngModelChange","ngModel"],["for","newCourier"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.ok()})("onCancel",function(){return a.close()})("onClose",function(){return a.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"input",4),h("ngModelChange",function(c){return S(a.courier,c)||(a.courier=c),c}),i(),n(6,"label",5),p(7,"Add New Courier"),i()()()()()()),e&2&&(m("config",a.config),l(5),x("ngModel",a.courier))},dependencies:[X,De,fe,Ge,Ce,R,W],encapsulation:2})};var $t=class t{http=y(k);loadForm=y(Re);toastr=y(ee);void=y(Ye);matDialog=y(A);newTrans=y(Fe);outletService=y(ce);courierSubject=new gt([]);courierID=new $e(null);_addNewCourier=new be;addNewCourier$=this._addNewCourier.asObservable().pipe(Q(()=>this.matDialog.open(On).afterClosed()),L(r=>T.IsNotEmpty(r)),Q(r=>this.http.post("/API/TransferOrder/UpdateCourierList",{name:r}).pipe(V(e=>le(ae({},e),{Name:r}))).pipe(je(()=>Oe))),q(r=>{this.courierID.setValue(r.ID),this.toastr.success(r.Message,ve.Success)}));initialCouriers$=this.courierSubject.asObservable();couriers$=co(this.initialCouriers$,this.addNewCourier$).pipe(wi((r,e)=>{let a=[];return Array.isArray(e)==!1?a=[...r,e]:a=e,a},[]));assignCourierID$=Ve(this.loadForm.data$.pipe(V(r=>r.Order.CourierID==T.GuidEmpty?null:r.Order.CourierID),q(r=>this.courierID.setValue(r))),this.initialCouriers$.pipe(V(r=>{let e=null;return r?.length==1&&(e=r[0].ID),e}))).pipe(q(r=>{this.courierID.setValue(r)}));resetCourierID$=Ve(this.void.void$,this.newTrans.createNewTransaction$).pipe(q(()=>this.courierID.setValue(null)));constructor(){this.assignCourierID$.subscribe(),this.resetCourierID$.subscribe(),this.listenDestinationChanges()}listenDestinationChanges(){this.outletService.destinationOutletID$.pipe(Q(r=>T.IsEmpty(r)?Oe:this.getCouriersByDestinationId(r).pipe()),pt()).subscribe()}getCouriersByDestinationId(r){return this.http.get(`${Ne.GetCourierByOutletDestination}/${r}`).pipe(q(e=>{this.courierSubject.next(e.Data)}),je(e=>Oe))}addNewCourier(){this._addNewCourier.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Yt=class t{loadForm=y(Re);void=y(Ye);newTrans=y(Fe);invoiceDate=new $e(new Date);assignInvoiceDate$=this.loadForm.data$.pipe(V(r=>r.Order.Date),q(r=>this.invoiceDate.setValue(r)));resetInvoiceDate$=Ve(this.void.void$,this.newTrans.createNewTransaction$).pipe(q(()=>this.invoiceDate.setValue(new Date)));constructor(){this.assignInvoiceDate$.subscribe(),this.resetInvoiceDate$.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ii=class t{route=y(pe);void=y(Ye);newTransaction=y(Fe);overOnStock=y(Qt);isOpenOutletDialog=new gt(!1);lowOnStock=y(jt);outletService=y(ce);isOpenOutletDialog$=this.isOpenOutletDialog.asObservable().pipe(se(this.outletService.sourceOutletID$),V(([r,e])=>T.IsNotEmpty(e)?!1:r));_onCloseOutletDialog=new gt(!1);isOpenDestinationDialog$=this._onCloseOutletDialog.pipe(se(this.lowOnStock.destinationOutlet$.pipe(ze(null)),this.overOnStock.outletSource$.pipe(ze(null))),V(([r,e,a])=>{let o=!1;return T.IsNotEmpty(e)&&T.IsNotEmpty(e?.ID)?o=!1:T.IsNotEmpty(a)&&T.IsNotEmpty(a?.ID)?o=!0:o=r,o}));onCloseOutletDialog(){this._onCloseOutletDialog.next(!0)}isEdit$=Ct(T.IsNotEmpty(this.route.snapshot.queryParams.ID)).pipe(q(r=>this.isOpenOutletDialog.next(!r)));reopenOutletDialog=this.void.void$.pipe(q(()=>this.isOpenOutletDialog.next(!0)));onCreateNewTransaction=this.newTransaction.createNewTransaction$.pipe(q(()=>this.isOpenOutletDialog.next(!0)));constructor(){this.isEdit$.subscribe(),this.reopenOutletDialog.subscribe(),this.onCreateNewTransaction.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Xt=class t{route=y(pe);outlet=y(ce);http=y(k);loadForm=y(Re);void=y(Ye);newTrans=y(Fe);loadRegister=y(Et);outletID$=this.outlet.sourceOutletID$;orderNumber=new $e("");assignGeneratedNumber$=this.loadRegister.loadRegister$.pipe(L(()=>T.IsEmpty(this.route.snapshot.queryParams.ID)),V(r=>r.Number),q(r=>this.orderNumber.setValue(r)));assignOrderNumber$=this.loadForm.data$.pipe(V(r=>r.Order.Number),q(r=>this.orderNumber.setValue(r)));resetOrderNumber$=this.newTrans.createNewTransaction$.pipe(q(()=>this.orderNumber.setValue("")));generateOrderNumberOnNewTransaction$=this.newTrans.createNewTransaction$.pipe(se(this.outletID$),L(([r,e])=>T.IsNotEmpty(e)),Q(([r,e])=>this.http.post("/API/TransferOrder/GenerateNumber",{ID:e})),q(r=>this.orderNumber.setValue(r.Number)));constructor(){this.assignGeneratedNumber$.subscribe(),this.assignOrderNumber$.subscribe(),this.generateOrderNumberOnNewTransaction$.subscribe(),this.resetOrderNumber$.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Hd=()=>["/menu/Products/Catalog/Variants/Info"],jd=t=>({ID:t});function Qd(t,r){if(t&1){let e=b();n(0,"div",16)(1,"p-checkbox",17),h("ngModelChange",function(o){let c=d(e).$implicit;return S(c.value.selected,o)||(c.value.selected=o),u(o)}),i(),n(2,"span"),p(3),i()()}if(t&2){let e,a=r.$implicit;l(),x("ngModel",a.value.selected),m("binary",!0),l(2),I((e=a.value.name)!==null&&e!==void 0?e:a.key)}}function qd(t,r){if(t&1&&(n(0,"div",13)(1,"h6",14),p(2,"Columns to View"),i(),_(3,Qd,4,3,"div",15),v(4,"keyvalueUnsort"),i()),t&2){let e=s();l(3),m("ngForOf",E(4,1,e.column))}}function Ud(t,r){t&1&&(n(0,"th",18),p(1," Qty "),i())}function zd(t,r){t&1&&(n(0,"th",18)(1,"span",19),p(2," Src "),i()())}function $d(t,r){t&1&&(n(0,"th",18)(1,"span",20),p(2," Req "),i()())}function Gd(t,r){t&1&&(n(0,"th",18)(1,"span",21),p(2," Avl "),i()())}function Kd(t,r){t&1&&(n(0,"th",18)(1,"span",22),p(2," Dest "),i()())}function Jd(t,r){t&1&&(n(0,"th",18)(1,"span",23),p(2," Max "),i()())}function Yd(t,r){if(t&1&&(n(0,"td",28),p(1),v(2,"quantityFraction"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.RequestQuantity)," ")}}function Xd(t,r){if(t&1&&(n(0,"td",28),p(1),v(2,"quantityFraction"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.SourceInventory.OnHand)," ")}}function Zd(t,r){if(t&1&&(n(0,"td",28),p(1),v(2,"quantityFraction"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.SourceInventory.Requested)," ")}}function e0(t,r){if(t&1&&(n(0,"td",28),p(1),v(2,"quantityFraction"),i()),t&2){let e=s().$implicit;ot(e.RequestQuantity>e.SourceInventory.OnHand-e.SourceInventory.Requested?"bg-gradient-warning":""),l(),D(" ",E(2,3,e.SourceInventory.OnHand-e.SourceInventory.Requested)," ")}}function t0(t,r){if(t&1&&(n(0,"td",28),p(1),v(2,"quantityFraction"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.DestinationInventory.OnHand)," ")}}function i0(t,r){if(t&1&&(n(0,"td",28),p(1),i()),t&2){let e=s().$implicit;ot(e.DestinationInventory.OnHand+e.RequestQuantity>e.DestinationInventory.Max&&e.DestinationInventory.Max>0?"bg-gradient-warning":""),l(),D(" ",e.DestinationInventory.Max," ")}}function n0(t,r){if(t&1&&(n(0,"tr")(1,"td")(2,"a",24),p(3),i(),n(4,"small",25),p(5),i()(),_(6,Yd,3,3,"td",26)(7,Xd,3,3,"td",26)(8,Zd,3,3,"td",26)(9,e0,3,5,"td",27)(10,t0,3,3,"td",26)(11,i0,2,3,"td",27),i()),t&2){let e=r.$implicit,a=s();l(2),m("routerLink",N(10,Hd))("queryParams",M(11,jd,e.VariantID)),l(),I(e.Name),l(2),I(e.Code),l(),m("ngIf",a.column.qty.selected),l(),m("ngIf",a.column.source.selected),l(),m("ngIf",a.column.requested.selected),l(),m("ngIf",a.column.available.selected),l(),m("ngIf",a.column.destination.selected),l(),m("ngIf",a.column.max.selected)}}var ui=class t{constructor(r,e,a,o,c){this.dialogRef=r;this.data=e;this.columnService=a;this.overlay=o;this.vcr=c;this.config.title="Inventory Forecast",this.config.customWidth="700px",this.config.bodyScrollable=!0,e&&(this.config.hideFooter=e.hideFooter!==void 0?e.hideFooter:!0),this.inventory=e.inventory,this.column=e.column?JSON.parse(JSON.stringify(e.column)):JSON.parse(JSON.stringify(t.column))}static column={qty:{selected:!0,name:"Qty"},source:{selected:!1,name:"Source"},requested:{selected:!1,name:"Requested"},available:{selected:!0,name:"Available"},destination:{selected:!0,name:"Destination"},max:{selected:!0,name:"Max"}};column=t.column;overlayRef=null;openColumnOverlay(r,e){this.overlayRef&&this.overlayRef.dispose();let a=this.overlay.position().flexibleConnectedTo(r).withPositions([{originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"}]);this.overlayRef=this.overlay.create({positionStrategy:a,hasBackdrop:!0,backdropClass:"cdk-overlay-transparent-backdrop"}),this.overlayRef.attach(new Io(e,this.vcr)),this.overlayRef.backdropClick().subscribe(()=>this.overlayRef?.dispose())}config=new _e;inventory;close(){this.dialogRef.close()}ok(){return mo(this,null,function*(){this.dialogRef.close("ok")})}static \u0275fac=function(e){return new(e||t)(C(ye),C(Ke),C(Jo),C(To),C(Oi))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-analyze-inventory"]],decls:23,vars:8,consts:[["columnBtn",""],["columnOverlayTpl",""],[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row"],[1,"col-12"],["id","tableGrid",1,"table","table-bordered"],[1,"thead-light"],[2,"position","relative","display","flex"],["title","Columns to View",1,"column-icon","ms-3","toggler-wrapper",3,"click"],[1,"fa-solid","fa-columns-3"],["style","width: 60px;","class","text-end",4,"ngIf"],[4,"ngFor","ngForOf"],[1,"cdk-overlay","column-overlay-panel","toggle-option-wrapper"],[1,"border-bottom","pb-3","mb-3"],["class","mb-2",4,"ngFor","ngForOf"],[1,"mb-2"],["inputId","binary",1,"me-3",3,"ngModelChange","ngModel","binary"],[1,"text-end",2,"width","60px"],["matTooltip","Source On-Hand","matTooltipPosition","above"],["matTooltip","Source Requested","matTooltipPosition","above"],["matTooltip","Available (Source On-Hand - Source Requested)","matTooltipPosition","above"],["matTooltip","Destination On-Hand","matTooltipPosition","above"],["matTooltip","Destination Maximum Inventory","matTooltipPosition","above"],["target","_blank",3,"routerLink","queryParams"],[1,"d-block"],["class","text-end",4,"ngIf"],["class","text-end",3,"class",4,"ngIf"],[1,"text-end"]],template:function(e,a){if(e&1){let o=b();n(0,"modal-material",2),g("onOk",function(){return d(o),u(a.ok())})("onCancel",function(){return d(o),u(a.close())})("onClose",function(){return d(o),u(a.close())}),n(1,"content")(2,"div",3)(3,"div",4)(4,"div",5)(5,"table",6)(6,"thead",7)(7,"tr")(8,"th",8),p(9," Product "),n(10,"div",9,0),g("click",function(){d(o);let w=we(11),H=we(14);return u(a.openColumnOverlay(w,H))}),f(12,"i",10),i(),_(13,qd,5,3,"ng-template",null,1,Z),i(),_(15,Ud,2,0,"th",11)(16,zd,3,0,"th",11)(17,$d,3,0,"th",11)(18,Gd,3,0,"th",11)(19,Kd,3,0,"th",11)(20,Jd,3,0,"th",11),i()(),n(21,"tbody"),_(22,n0,12,13,"tr",12),i()()()()()()()}e&2&&(m("config",a.config),l(15),m("ngIf",a.column.qty.selected),l(),m("ngIf",a.column.source.selected),l(),m("ngIf",a.column.requested.selected),l(),m("ngIf",a.column.available.selected),l(),m("ngIf",a.column.destination.selected),l(),m("ngIf",a.column.max.selected),l(2),m("ngForOf",a.inventory))},dependencies:[X,J,B,Ge,R,W,Wt,ke,De,fe,yt,G,Go,$o,zo,ri],styles:[".dropdown-menu[_ngcontent-%COMP%]{position:absolute!important;z-index:99999!important;left:0;top:40px;min-width:220px}.toggler-wrapper[_ngcontent-%COMP%]{display:inline-block;cursor:pointer;position:relative;z-index:10001}.toggle-option-wrapper[_ngcontent-%COMP%]{min-width:220px;background:#fff;border-radius:8px;box-shadow:0 2px 12px #0003;padding:16px;z-index:99999;color:#000}"]})};var ft=class t{http=y(k);outlet=y(ce);matDialog=y(A);cart=y(Ze);_analyze=new be;analyze$=this._analyze.asObservable();processTransactionSafe$=new be;analyzeInventory$=this.analyze$.pipe(Q(()=>bt([this.outlet.sourceOutletID$,this.outlet.destinationOutletID$,this.cart.cart$]).pipe(Ft(1))),L(([r,e,a])=>T.IsNotEmpty(r)&&T.IsNotEmpty(e)&&a.length>0),Q(([r,e,a])=>this.http.post("/API/TransferOrder/Analyze",{DestinationOutlet:e,Items:a.map(o=>le(ae({},o),{ID:o.VariantID})),SourceOutlet:r}).pipe(V(o=>o.map(c=>le(ae({},c),{Code:a.find(w=>w.VariantID===c.VariantID)?.Code,VariantID:a.find(w=>w.VariantID===c.VariantID)?.VariantID,Name:a.find(w=>w.VariantID===c.VariantID)?.Name}))),je(()=>Oe))));constructor(){this.analyzeInventory$.subscribe()}analyze(r=!0){this.analyzeInventory$.pipe(Ft(1)).pipe(q(e=>{r&&this.showAnalyzeDialog(e)})).subscribe(),this._analyze.next()}showAnalyzeDialog(r){this.matDialog.open(ui,{data:{inventory:r}}).afterClosed()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var lo=t=>({selected:t});function r0(t,r){if(t&1){let e=b();n(0,"div",9)(1,"label",10)(2,"input",11),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.typeID,o)||(c.typeID=o),u(o)}),i(),p(3),i()()}if(t&2){let e=r.$implicit,a=r.index,o=s(2);l(),vi("for","potype-"+a),m("ngClass",M(6,lo,o.typeID==e.ID)),l(),vi("id","potype-"+a),x("ngModel",o.typeID),m("value",e.ID),l(),D(" ",e.Name," ")}}function a0(t,r){if(t&1&&(n(0,"div",6),z(1),n(2,"div",7),_(3,r0,4,8,"div",8),i(),$(),i()),t&2){let e=s();l(3),m("ngForOf",e.deliveryTypes)}}function l0(t,r){if(t&1){let e=b();n(0,"div",6),z(1),n(2,"div",7)(3,"POS-tinymce-editor",12),h("ngModelChange",function(o){d(e);let c=s();return S(c.note,o)||(c.note=o),u(o)}),i()(),$(),i()}if(t&2){let e=s();l(3),x("ngModel",e.note)}}var En=class t{constructor(r,e){this.dialogRef=r;this.config.title="Notes",this.config.customWidth="600px",this.deliveryTypes=e.deliveryTypes,this.typeID=e.typeID,this.note=e.note||""}currentTabState=1;modalTabState=yr;config=new _e;deliveryTypes;typeID="";note="";ok(){this.dialogRef.close({typeID:this.typeID,note:this.note})}close(){this.dialogRef.close()}onTabChange(r){this.currentTabState=r}static \u0275fac=function(e){return new(e||t)(C(ye),C(Ke))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-delivery-type"]],decls:11,vars:9,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row","border-bottom"],["data-cy","tab-note",1,"btn","btn-link","note-tab",3,"click","ngClass"],["data-cy","tab-type",1,"btn","btn-link","note-tab",3,"click","ngClass"],["class","row mt-8",4,"ngIf"],[1,"row","mt-8"],[1,"col-12"],["class","rad-btn",4,"ngFor","ngForOf"],[1,"rad-btn"],[3,"for","ngClass"],["type","radio",3,"ngModelChange","ngModel","value","id"],[3,"ngModelChange","ngModel"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.ok()})("onCancel",function(){return a.close()})("onClose",function(){return a.close()}),n(1,"content")(2,"div",1)(3,"div",2)(4,"div")(5,"a",3),g("click",function(){return a.onTabChange(a.modalTabState.NOTE)}),p(6," Note "),i(),n(7,"a",4),g("click",function(){return a.onTabChange(a.modalTabState.TYPE)}),p(8," Tag "),i()()(),_(9,a0,4,1,"div",5)(10,l0,4,1,"div",5),i()()()),e&2&&(m("config",a.config),l(5),m("ngClass",M(5,lo,a.modalTabState.NOTE==a.currentTabState)),l(2),m("ngClass",M(7,lo,a.modalTabState.TYPE==a.currentTabState)),l(2),m("ngIf",a.modalTabState.TYPE==a.currentTabState),l(),m("ngIf",a.modalTabState.NOTE==a.currentTabState))},dependencies:[X,mt,J,B,Ge,Ce,So,R,W,De,fe,st,xt],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}content[_ngcontent-%COMP%] > div.container-fluid[_ngcontent-%COMP%]{min-height:200px}.tinymce[_ngcontent-%COMP%] a[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{z-index:2;position:absolute;right:15px;bottom:19px}.tinymce[_ngcontent-%COMP%] editor[_ngcontent-%COMP%]{height:max-content;z-index:1}.rad-btn[_ngcontent-%COMP%]{position:relative;display:inline-block}.rad-btn[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{border:1px solid #dddddd;border-radius:3px;margin-right:10px;cursor:pointer;padding:10px;margin-bottom:10px;color:#000}.rad-btn[_ngcontent-%COMP%] input[type=radio][_ngcontent-%COMP%]{visibility:hidden;position:absolute;left:0;top:0}.rad-btn[_ngcontent-%COMP%] label.selected[_ngcontent-%COMP%]{background:#dcdcdc;border:1px solid #dcdcdc}.btn-link.note-tab[_ngcontent-%COMP%]{padding-top:0;color:#868686;padding-bottom:8px;border-radius:unset;font-family:Roboto Slab,serif}.btn-link.note-tab.selected[_ngcontent-%COMP%]{color:#3b3b3b;border-bottom:4px solid #07a519}a.btn.btn-link.note-tab[_ngcontent-%COMP%]{color:inherit}.ng-select.currency-option[_ngcontent-%COMP%]{width:36%!important}.col-12[_ngcontent-%COMP%]{height:250px}"]})};var Gt=class t{loadForm=y(Re);void=y(Ye);matDialog=y(A);newTrans=y(Fe);isEdit$=y(Rt).isEdit$;typeID=new $e(T.GuidEmpty);note=new $e("");assignNote$=this.loadForm.data$.pipe(V(r=>r.Order?.Note??""),q(r=>this.note.setValue(r)));assignDefaultTypeID$=this.loadForm.deliveryTypes$.pipe(se(this.isEdit$),L(([r,e])=>!e),V(([r,e])=>r[0]?.ID),q(r=>this.typeID.setValue(r)));assignTypeID$=this.loadForm.data$.pipe(V(r=>r.Order.TypeID),q(r=>this.typeID.setValue(r)));resetTypeID$=Ve(this.void.void$,this.newTrans.createNewTransaction$).pipe(Q(()=>this.loadForm.deliveryTypes$),V(r=>r[0]?.ID),q(r=>{this.typeID.setValue(r),this.note.setValue("")}));_openTypeIDDialog=new be;openTypeIDDialog$=this._openTypeIDDialog.asObservable().pipe(se(this.loadForm.deliveryTypes$),Q(([r,e])=>this.matDialog.open(En,{data:{typeID:this.typeID.value,deliveryTypes:e,note:this.note.value}}).afterClosed()),L(r=>T.IsNotEmpty(r)),q(r=>{this.typeID.setValue(r?.typeID),this.note.setValue(r?.note)}));constructor(){console.log("TypeIDService initialized"),this.assignDefaultTypeID$.pipe(pt()).subscribe(),this.assignTypeID$.pipe(pt()).subscribe(),this.resetTypeID$.pipe(pt()).subscribe(),this.openTypeIDDialog$.pipe(pt()).subscribe(),this.assignNote$.pipe(pt()).subscribe()}openDeliveryTypeDialog(){this._openTypeIDDialog.next()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var ht=class t{http=y(k);matDialog=y(A);outlet=y(ce);date=y(Yt);number=y(Xt);courier=y($t);deliveryTypeID=y(Gt);cart=y(Ze);loadForm=y(Re);loadRegister=y(Et);analyzeService=y(ft);appConfigJSON$=this.loadForm.config$;_processTransaction=new be;processTransaction$=this._processTransaction.asObservable();submitOrder$=this.processTransaction$.pipe(Q(()=>bt([this.outlet.sourceOutletID$,this.outlet.destinationOutletID$,this.cart.cart$]).pipe(Ft(1))),L(([r,e,a])=>T.IsNotEmpty(r)&&T.IsNotEmpty(e)&&a.length>0),V(()=>this.deliveryTypeID.note.value),se(this.cart.cart$,this.loadRegister.loadRegister$.pipe(V(r=>r.NewOrderID)),this.loadForm.loadForm$),Q(([r,e,a,o])=>{let c={Order:{SourceEntityID:this.outlet.sourceOutlet.value.ID,DestinationEntityID:this.outlet.destinationOutlet.value.ID,Date:this.date.invoiceDate.value,Number:this.number.orderNumber.value,CourierID:T.IsEmpty(this.courier.courierID.value)?T.GuidEmpty:this.courier.courierID.value,TypeID:this.deliveryTypeID.typeID.value,Note:r,ID:o.Data.Order?.ID,StateID:o.Data.Order?.StateID},Items:e,NewOrderID:a};return this.http.post("/api/TransferOrder/SubmitOrder2",c).pipe(V(w=>le(ae({},w),{PrintTemplateID:o.Entities.find(H=>H.ID===this.outlet.sourceOutlet.value.ID)?.PrintTemplateID})),je(()=>Oe))}),lt(1));constructor(r){this.submitOrder$.subscribe(),r.processTransactionSafe$.pipe(q(()=>{this._processTransaction.next()})).subscribe()}processTransaction(){this.analyzeService.analyzeInventory$.pipe(Ft(1),se(this.appConfigJSON$),Q(([r,e])=>{if(!Array.isArray(r))return Oe;let a=r.some(w=>w.SourceInventory.Requested>w.SourceInventory.OnHand-w.RequestQuantity),o=r.some(w=>w.DestinationInventory.OnHand>=0&&w.DestinationInventory.OnHand+w.SourceInventory.Requested>w.DestinationInventory.Max&&w.DestinationInventory.Max>0),c=e.ModuleDelivery.OutletDelivery.Workflow>1;if((a||o)&&!c){let w={qty:{selected:!0,name:"Qty"},source:{selected:!1,name:"Source"},requested:{selected:!1,name:"Requested"},available:{selected:!0,name:"Available"},destination:{selected:!0,name:"Destination"},max:{selected:!0,name:"Max"}};return this.matDialog.open(ui,{data:{inventory:r,column:w,hideFooter:!1}}).afterClosed().pipe(q(ie=>{ie&&ie==="ok"&&this._processTransaction.next()}),Q(()=>Oe))}else return this._processTransaction.next(),Oe})).subscribe(),this.analyzeService.analyze(!1)}static \u0275fac=function(e){return new(e||t)(Vt(ft))};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Mn=class t{toastr=y(ee);clearOutlet=y(Ot);analyze=y(ft);outlet=y(ce);scanSerial=y(Mt);cart=y(Ze);processTransaction=y(ht);importCart=y(wt);toastrOnEmptySourceOutlet$=Ve(this.clearOutlet.clearOutlet$,this.analyze.analyze$,this.scanSerial.scanSerial$,this.processTransaction.processTransaction$,this.importCart.import$).pipe(se(this.outlet.sourceOutletID$),L(([r,e])=>e===T.GuidEmpty),q(()=>this.toastr.info("Please select source outlet",ve.Info)));toastrOnEmptyDestinationOutlet$=Ve(this.analyze.analyze$,this.processTransaction.processTransaction$).pipe(se(this.outlet.destinationOutletID$),L(([r,e])=>e===T.GuidEmpty),q(()=>this.toastr.info("Please select destination outlet",ve.Info)));toastrOnEmptyCart$=Ve(this.analyze.analyze$,this.processTransaction.processTransaction$).pipe(se(this.cart.cart$),L(([r,e])=>e.length===0),q(()=>this.toastr.info("Please add item to cart",ve.Info)));constructor(){this.toastrOnEmptySourceOutlet$.subscribe(),this.toastrOnEmptyDestinationOutlet$.subscribe(),this.toastrOnEmptyCart$.subscribe()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var Ti=class t{createNewTransaction=y(Fe);processTransaction=y(ht);_isComplete=new gt(!1);isComplete$=this._isComplete.asObservable();constructor(){this.createNewTransaction.createNewTransaction$.subscribe(()=>this._isComplete.next(!1)),this.processTransaction.submitOrder$.subscribe(()=>this._isComplete.next(!0))}static \u0275fac=function(e){return new(e||t)};static \u0275prov=K({token:t,factory:t.\u0275fac,providedIn:"root"})};var p0=(t,r)=>({ID:t,Template:r}),m0=()=>["/menu/Logistics/Archive/Transfer_Order/Info"],c0=t=>({ID:t});function s0(t,r){if(t&1&&(n(0,"div",25)(1,"div",26),p(2),i(),n(3,"div",26),p(4),i()()),t&2){let e=r.$implicit;l(2),I(e.Name),l(2),I(e.Quantity)}}var Pn=class t{handleF8(){this.createNewTransaction()}pageSetup=y(te);title=y(ni);afterProcessData;cartItems;orderNumber;newTransService=y(Fe);toastr=y(ee);menu$;fullContainerEl=document.getElementById("full-container");constructor(){this.pageSetup.setMenu$(),this.menu$=this.pageSetup.menu$.pipe(V(r=>le(ae({},r),{H:"Transfer Order",T:r.T.replace("undefined","Transfer Order")})),q(r=>this.title.setTitle(r.T)))}ngOnChanges(){this.orderNumber&&this.afterProcessData&&this.orderNumber!==this.afterProcessData.InvoiceNumber&&this.toastr.warning("Your transfer order number is changed to "+this.afterProcessData.InvoiceNumber,"Transfer Order Number Changed!")}ngAfterViewInit(){this.fullContainerEl.classList.remove("full-container")}ngOnDestroy(){this.fullContainerEl.classList.add("full-container")}createNewTransaction(){this.newTransService.createNewTransaction()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-complete"]],hostBindings:function(e,a){e&1&&g("keydown.F8",function(){return a.handleF8()},!1,ti)},inputs:{afterProcessData:"afterProcessData",cartItems:"cartItems",orderNumber:"orderNumber"},features:[go],decls:37,vars:23,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"order-complete"],[1,"container-fluid","pt-8"],[1,"row"],[1,"col-8"],[1,"card"],[1,"card-header",2,"padding-bottom","15px"],[1,"fw-normal",2,"font-size","32px"],[1,"fa-solid","fa-check","me-3"],[1,"card-body","border-top"],[1,"row",2,"height","150px"],[1,"col","text-center","my-auto"],[1,"btn","btn-success","w-50",2,"font-size","20px",3,"click"],[1,"card-footer"],[1,"d-flex","justify-content-between","py-5"],["target","_blank",1,"btn","bg-light-gray","btn-secondary",3,"routerLink","queryParams"],[1,"fa-solid","fa-print","me-2"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],["target","_blank",3,"routerLink","queryParams"],[1,"card-body"],["class","row justify-content-between mb-3",4,"ngFor","ngForOf"],[1,"row","justify-content-end","border-top",2,"margin-top","15px","padding-top","15px"],[1,"col-4","text-end"],[1,"row","justify-content-between","mb-3"],[1,"col","text-end"]],template:function(e,a){e&1&&(n(0,"mainpanel-cmp",0),v(1,"async"),n(2,"content")(3,"section",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"div",5)(8,"div",6)(9,"h1",7),f(10,"i",8),p(11,"Transfer Order Complete "),i()(),n(12,"div",9)(13,"div",10)(14,"div",11)(15,"a",12),g("click",function(){return a.createNewTransaction()}),p(16,"New Transfer Order (F8)"),i()()()(),n(17,"div",13)(18,"div",14)(19,"a",15),f(20,"i",16),p(21,"Print Receipt"),i()()()()(),n(22,"div",17)(23,"div",5)(24,"div",18)(25,"h3",19)(26,"a",20),p(27),i()()(),n(28,"div",21),_(29,s0,5,2,"div",22),n(30,"div",23)(31,"div",24),p(32,"Total:"),i(),n(33,"div",24),p(34),v(35,"sum"),v(36,"number"),i()()()()()()()()()()),e&2&&(m("pageData",E(1,10,a.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),l(19),m("routerLink","/print/"+(a.afterProcessData.PrintMode=="1"?"Transfer":"TransferMini"))("queryParams",Ae(17,p0,a.afterProcessData.OrderID,a.afterProcessData.PrintTemplateID)),l(7),m("routerLink",N(20,m0))("queryParams",M(21,c0,a.afterProcessData.OrderID)),l(),D("Transfer Order #",a.afterProcessData.InvoiceNumber,""),l(2),m("ngForOf",a.cartItems),l(5),D(" ",E(36,15,P(35,12,a.cartItems,"Quantity"))," "))},dependencies:[X,J,rt,ge,ai,Be,yt,G,Qi,oe],styles:[".print_containers[_ngcontent-%COMP%]{display:none}@media print{.print_containers[_ngcontent-%COMP%]{display:block;text-align:left}.order-complete[_ngcontent-%COMP%]{display:none}}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%]{border-bottom:1px solid rgba(0,0,0,.125);padding-bottom:.9375rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{font-size:2rem}.order-complete[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%] .container[_ngcontent-%COMP%]{max-width:500px;margin-top:30px;margin-bottom:30px}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{vertical-align:middle;line-height:15px!important}"]})};var Fn=class t{analyzeService=y(ft);analyze(){this.analyzeService.analyze()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-analyze"]],decls:1,vars:0,consts:[["icon","fa-sharp fa-solid fa-magnifying-glass-chart","label","Load Outlet Inventory",3,"click"]],template:function(e,a){e&1&&(n(0,"POS-dropdown-item-more-action",0),g("click",function(){return a.analyze()}),i())},dependencies:[X,ut],encapsulation:2})};var Vn=class t{voidService=y(Ye);voidTransaction(){this.voidService.void()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-void"]],decls:1,vars:0,consts:[["icon","fa-solid fa-rectangle-xmark","label","Void",3,"click"]],template:function(e,a){e&1&&(n(0,"POS-dropdown-item-more-action",0),g("click",function(){return a.voidTransaction()}),i())},dependencies:[X,ut],encapsulation:2})};var Nn=class t{importCartService=y(wt);importCart(){this.importCartService.import()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-import-cart"]],decls:1,vars:0,consts:[["icon","fa-solid fa-upload","label","Upload",3,"click"]],template:function(e,a){e&1&&(n(0,"POS-dropdown-item-more-action",0),g("click",function(){return a.importCart()}),i())},dependencies:[X,ut],encapsulation:2})};var d0=["serialInput"],kn=class t{constructor(r,e,a){this.dialogRef=r;this.toastr=e;this.scanSerialService=a;this.modalConfig.title="Scan Serial",this.modalConfig.customWidth="350px",this.modalConfig.hideOk=!0,this.modalConfig.hideCancel=!0}serialInputEl;modalConfig=new _e;serial;ngOnInit(){}onKeyDown(r){r.key=="Enter"&&(T.IsNotEmpty(this.serial)?(this.scanSerialService.scanSerial(this.serial),this.serial=null):this.toastr.warning("Serial Can`t be empty","Warning!"),this.setFocusInput())}setFocusInput(){this.serialInputEl&&setTimeout(()=>{this.serialInputEl?.nativeElement?.focus()},500)}static \u0275fac=function(e){return new(e||t)(C(ye),C(ee),C(Mt))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-scan-serial"]],viewQuery:function(e,a){if(e&1&&Ei(d0,5),e&2){let o;Mi(o=Pi())&&(a.serialInputEl=o.first)}},decls:7,vars:2,consts:[["serialInput",""],[3,"onClose","config"],[1,"input-group","mt-3"],["type","text","placeholder","Input Product By Serial","aria-label","Serial",1,"form-control",3,"ngModelChange","keydown","ngModel"],[1,"input-group-text"],[1,"fa-solid","fa-barcode","fs-4"]],template:function(e,a){if(e&1){let o=b();n(0,"modal-material",1),g("onClose",function(){return d(o),u(a.dialogRef.close())}),n(1,"content")(2,"div",2)(3,"input",3,0),h("ngModelChange",function(w){return d(o),S(a.serial,w)||(a.serial=w),u(w)}),g("keydown",function(w){return d(o),u(a.onKeyDown(w))}),i(),n(5,"span",4),f(6,"i",5),i()()()()}e&2&&(m("config",a.modalConfig),l(3),x("ngModel",a.serial))},dependencies:[X,Ge,Ce,R,W,De,fe],encapsulation:2})};var Ln=class t{vcr=y(Oi);matDialog=y(A);scanSerial(){this.matDialog.open(kn,{viewContainerRef:this.vcr})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-scan-serial"]],decls:1,vars:0,consts:[["icon","fa-solid fa-barcode-read","label","Serial",3,"click"]],template:function(e,a){e&1&&(n(0,"POS-dropdown-item-more-action",0),g("click",function(){return a.scanSerial()}),i())},dependencies:[X,ut],encapsulation:2})};var Rn=class t{handleF8(){this.addItem()}itemDialog=y(Pt);addItem(){this.itemDialog.addItem()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-add-item"]],hostBindings:function(e,a){e&1&&g("keydown.F4",function(){return a.handleF8()},!1,ti)},decls:1,vars:0,consts:[["icon","fa-circle-plus fa-solid","label","Add",3,"click"]],template:function(e,a){e&1&&(n(0,"POS-dropdown-item-more-action",0),g("click",function(){return a.addItem()}),i())},dependencies:[X,ut],encapsulation:2})};var u0=t=>({disabled:t}),_0=(t,r)=>({red:t,green:r}),An=class t{RFIDService=y(Xi);matDialog=y(A);constructor(){}onOpenModal(){this.matDialog.open(Ir).componentInstance.onOK.pipe(q(({hostURL:e,bufferTime:a})=>{this.RFIDService.bufferTime=a,this.RFIDService.intializeWebSocket(e)})).subscribe()}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-connect-rfid"]],decls:8,vars:13,consts:[[1,"dropdown-item","px-1","d-flex",3,"click","ngClass"],["aria-hidden","true",1,"fa-solid","fa-wifi","fs-2"],[1,"pe-0","ps-4","fs-6","ms-6","cursor-pointer"],[1,"blob",2,"position","absolute","top","0","right","0",3,"ngClass"]],template:function(e,a){e&1&&(n(0,"div",0),v(1,"async"),g("click",function(){return a.onOpenModal()}),f(2,"i",1),n(3,"label",2),p(4,"Connect RFID"),i(),f(5,"div",3),v(6,"async"),v(7,"async"),i()),e&2&&(m("ngClass",M(8,u0,E(1,2,a.RFIDService.isConnected))),l(5),m("ngClass",Ae(10,_0,!E(6,4,a.RFIDService.isConnected),E(7,6,a.RFIDService.isConnected))))},dependencies:[De,mt,rt],styles:[".disabled[_ngcontent-%COMP%]{color:gray;pointer-events:none;cursor:not-allowed}.blob[_ngcontent-%COMP%]{background:#000;border-radius:50%;box-shadow:0 0 #000;height:15px;width:15px;transform:scale(1);animation:_ngcontent-%COMP%_pulse-black 2s infinite}@keyframes _ngcontent-%COMP%_pulse-black{0%{transform:scale(.95);box-shadow:0 0 #000000b3}70%{transform:scale(1);box-shadow:0 0 0 10px #0000}to{transform:scale(.95);box-shadow:0 0 #0000}}.blob.white[_ngcontent-%COMP%]{background:#fff;box-shadow:0 0 #fff;animation:_ngcontent-%COMP%_pulse-white 2s infinite}@keyframes _ngcontent-%COMP%_pulse-white{0%{transform:scale(.95);box-shadow:0 0 #ffffffb3}70%{transform:scale(1);box-shadow:0 0 0 10px #fff0}to{transform:scale(.95);box-shadow:0 0 #fff0}}.blob.red[_ngcontent-%COMP%]{background:#ff5252;box-shadow:0 0 #ff5252;animation:_ngcontent-%COMP%_pulse-red 2s infinite}@keyframes _ngcontent-%COMP%_pulse-red{0%{transform:scale(.95);box-shadow:0 0 #ff5252b3}70%{transform:scale(1);box-shadow:0 0 0 10px #ff525200}to{transform:scale(.95);box-shadow:0 0 #ff525200}}.blob.orange[_ngcontent-%COMP%]{background:#ff793f;box-shadow:0 0 #ff793f;animation:_ngcontent-%COMP%_pulse-orange 2s infinite}@keyframes _ngcontent-%COMP%_pulse-orange{0%{transform:scale(.95);box-shadow:0 0 #ff793fb3}70%{transform:scale(1);box-shadow:0 0 0 10px #ff793f00}to{transform:scale(.95);box-shadow:0 0 #ff793f00}}.blob.yellow[_ngcontent-%COMP%]{background:#ffb142;box-shadow:0 0 #ffb142;animation:_ngcontent-%COMP%_pulse-yellow 2s infinite}@keyframes _ngcontent-%COMP%_pulse-yellow{0%{transform:scale(.95);box-shadow:0 0 #ffb142b3}70%{transform:scale(1);box-shadow:0 0 0 10px #ffb14200}to{transform:scale(.95);box-shadow:0 0 #ffb14200}}.blob.blue[_ngcontent-%COMP%]{background:#34ace0;box-shadow:0 0 #34ace0;animation:_ngcontent-%COMP%_pulse-blue 2s infinite}@keyframes _ngcontent-%COMP%_pulse-blue{0%{transform:scale(.95);box-shadow:0 0 #34ace0b3}70%{transform:scale(1);box-shadow:0 0 0 10px #34ace000}to{transform:scale(.95);box-shadow:0 0 #34ace000}}.blob.green[_ngcontent-%COMP%]{background:#77d933;box-shadow:0 0 #77d933;animation:_ngcontent-%COMP%_pulse-green 2s infinite}@keyframes _ngcontent-%COMP%_pulse-green{0%{transform:scale(.95);box-shadow:0 0 #33d938b3}70%{transform:scale(1);box-shadow:0 0 0 10px #33d9b200}to{transform:scale(.95);box-shadow:0 0 #33d9b200}}.blob.purple[_ngcontent-%COMP%]{background:#8e44ad;box-shadow:0 0 #8e44ad;animation:_ngcontent-%COMP%_pulse-purple 2s infinite}@keyframes _ngcontent-%COMP%_pulse-purple{0%{transform:scale(.95);box-shadow:0 0 #8e44adb3}70%{transform:scale(1);box-shadow:0 0 0 10px #8e44ad00}to{transform:scale(.95);box-shadow:0 0 #8e44ad00}}"]})};var Bn=class t{clearOutletService=y(Ot);onClear(){this.clearOutletService.clearOutlet()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-clear-outlet"]],decls:1,vars:0,consts:[["icon","fa-trash fa-solid","label","Empty Outlet",3,"click"]],template:function(e,a){e&1&&(n(0,"POS-dropdown-item-more-action",0),g("click",function(){return a.onClear()}),i())},dependencies:[X,ut],encapsulation:2})};var Wn=class t{static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-more-action-shell"]],decls:30,vars:0,consts:[["id","moreMenu","data-bs-toggle","dropdown",1,"d-flex","align-items-center","cursor-pointer"],[1,"me-2"],[1,"fa-solid","fa-caret-down","fa-lg"],[1,"fs-6","headings-font-family","pb-1"],[1,"h-100","d-flex","align-items-center","justify-content-between"],["aria-labelledby","moreMenu",1,"dropdown-menu","more-actions"],[1,"d-flex",2,"width","33rem"],[1,"dropdown-header","text-dark","col"],[1,"h5","mb-4"],[1,"dropdown-divider","m-0"],[1,"cursor-pointer"],[1,"position-relative","cursor-pointer"],["matTooltip","Load all source outlet stock into cart","matTooltipPosition","above",1,"cursor-pointer"]],template:function(e,a){e&1&&(n(0,"span",0)(1,"span",1),f(2,"i",2),i(),n(3,"span",3),p(4,"More Actions"),i()(),n(5,"div",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),p(10,"Item"),i(),f(11,"div",9),n(12,"li",10),f(13,"POS-add-item"),i(),n(14,"li",10),f(15,"POS-scan-serial"),i(),n(16,"li",10),f(17,"POS-import-cart"),i()(),n(18,"div",7)(19,"div",8),p(20,"Advance"),i(),f(21,"div",9),n(22,"li",10),f(23,"POS-analyze"),i(),n(24,"li",10),f(25,"POS-void"),i(),n(26,"li",11),f(27,"POS-connect-rfid"),i(),n(28,"li",12),f(29,"POS-clear-outlet"),i()()()()())},dependencies:[X,Fn,Vn,Nn,Ln,Rn,An,Bn,Wt,ke],encapsulation:2})};var Hn=class t{courierService=y($t);courierForm=this.courierService.courierID;couriers$=this.courierService.couriers$;addNewCourier(){this.courierService.addNewCourier()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-courier-selection"]],decls:4,vars:4,consts:[[1,"d-flex","align-items-center"],["matTooltipPosition","below","matTooltip","New courier form",1,"fa-solid","fa-user","pointer",3,"click"],["bindLabel","Name","bindValue","ID","placeholder","Assign courier",1,"courier-select","w-100",3,"items","formControl"]],template:function(e,a){e&1&&(n(0,"div",0)(1,"i",1),g("click",function(){return a.addNewCourier()}),i(),f(2,"ng-select",2),v(3,"async"),i()),e&2&&(l(2),m("items",E(3,2,a.couriers$))("formControl",a.courierForm))},dependencies:[X,rt,Ee,Bt,R,oi,Wt,ke],styles:[".courier-select .ng-select-container{border:none} .courier-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border:none;box-shadow:none}"]})};function f0(t,r){if(t&1&&(n(0,"td",22),p(1),i()),t&2){let e=s().index;l(),D(" ",e+1,". ")}}function g0(t,r){if(t&1&&(z(0),n(1,"div",23),f(2,"img",24),i(),$()),t&2){let e=s().$implicit;l(2),m("src",e.ThumbnailUrl,ei)}}function C0(t,r){t&1&&(n(0,"div",25),f(1,"i",26),i())}function v0(t,r){if(t&1&&(n(0,"span"),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),I(E(2,1,e.Quantity))}}function y0(t,r){t&1&&(n(0,"span",27),p(1," x "),i())}function x0(t,r){if(t&1&&(n(0,"span"),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),I(E(2,1,e.UnitQuantity))}}function S0(t,r){if(t&1&&(z(0),n(1,"div",28),p(2),v(3,"number"),i(),$()),t&2){let e=s().$implicit;l(2),D(" ",P(3,1,e.UnitPrice,"1.0-4")," ")}}function h0(t,r){if(t&1&&(n(0,"span"),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D("-",E(2,1,e.Discount),"%")}}function b0(t,r){if(t&1&&(z(0),n(1,"span",29),p(2),v(3,"number"),i(),$()),t&2){let e=s().$implicit;l(2),D(" ",E(3,1,e.Total)," ")}}function D0(t,r){if(t&1){let e=b();n(0,"tr",7),g("contextmenu",function(){let o=d(e).index,c=s(2);return u(c.onContextMenu(o))})("click",function(){let o=d(e),c=o.$implicit,w=o.index,H=s(2);return u(H.update(c,w))}),_(1,f0,2,1,"td",8),n(2,"td",9)(3,"div",10),_(4,g0,3,1,"ng-container",11)(5,C0,2,0,"ng-template",null,1,Z),n(7,"div",12)(8,"div"),p(9),i(),n(10,"span",13),p(11),i(),f(12,"app-serial-note",14)(13,"small",15),i()()(),n(14,"td",16)(15,"span"),_(16,v0,3,3,"span",17)(17,y0,2,0,"span",18)(18,x0,3,3,"span",17),i()(),n(19,"td"),_(20,S0,4,4,"ng-container",17),i(),n(21,"td",19),_(22,h0,3,3,"span",17),i(),n(23,"td",16),_(24,b0,4,3,"ng-container",17),i(),n(25,"td",20)(26,"i",21),g("click",function(){let o=d(e).index,c=s(2);return u(c.deleteVariant(o))}),i()()()}if(t&2){let e=r.$implicit,a=we(6),o=s(2);m("cdkDragDisabled",!o.enabledDragDrop),l(),m("ngIf",o.appConfigJSON==null?null:o.appConfigJSON.ModuleSell.Grid.RowNumberVisible),l(),Nt("ps-0",o.appConfigJSON==null?null:o.appConfigJSON.ModuleSell.Grid.RowNumberVisible),l(2),m("ngIf",e.ThumbnailUrl)("ngIfElse",a),l(5),I(e.Name),l(2),I(e.Code),l(),m("serials",e.Serial),l(),m("innerHtml",e.Note,j),l(3),m("ngIf",e.Quantity!=1||e.UnitQuantity>1),l(),m("ngIf",e.UnitQuantity>1||e.UnitQuantity<-1),l(),m("ngIf",e.UnitQuantity>1||e.UnitQuantity<-1),l(2),m("ngIf",(o.appConfigJSON==null?null:o.appConfigJSON.ModuleDelivery.OutletDelivery.PriceVisible)&&e.Total!=e.UnitPrice),l(2),m("ngIf",e.Discount),l(2),m("ngIf",(o.appConfigJSON==null?null:o.appConfigJSON.ModuleDelivery.OutletDelivery.PriceVisible)&&e.Total)}}function I0(t,r){if(t&1){let e=b();n(0,"div",3)(1,"table",4)(2,"tbody",5),g("cdkDropListDropped",function(o){d(e);let c=s();return u(c.drop(o))}),_(3,D0,27,16,"tr",6),i()()()}if(t&2){let e=s();l(3),m("ngForOf",e.cart)}}function T0(t,r){t&1&&(n(0,"div",30)(1,"div",31)(2,"div",32)(3,"div",33)(4,"div",34),f(5,"i",35),i(),n(6,"div",36)(7,"span"),p(8,"Empty Cart"),i(),f(9,"br"),n(10,"span"),p(11,"Add products to the cart"),i(),f(12,"br"),n(13,"span"),p(14,"or scan barcode"),i()()()()()())}var jn=class t{cart=[];appConfigJSON;role=y(ne);cartService=y(Ze);itemDialog=y(Pt);enabledDragDrop=!0;onOpenContextMenuIndex=-1;constructor(){this.setDragDropEnabled()}setDragDropEnabled(){T.isMobileDevice&&(this.enabledDragDrop=!1)}onContextMenu(r){this.onOpenContextMenuIndex=r}onReturn(){this.cartService.return(this.onOpenContextMenuIndex)}onPurchase(){this.cartService.purchase(this.onOpenContextMenuIndex)}deleteVariant(r){this.cartService.remove(r)}update(r,e){this.itemDialog.editItem(r,e)}drop(r){this.cartService.rearrangeCart(r)}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-cart-display"]],inputs:{cart:"cart",appConfigJSON:"appConfigJSON"},decls:3,vars:2,consts:[["EMPTY_CART",""],["NO_IMAGE",""],["PinScrollingBottom","","class","h-100","style","overflow-y: auto",4,"ngIf","ngIfElse"],["PinScrollingBottom","",1,"h-100",2,"overflow-y","auto"],[1,"table","table-borderless"],["cdkDropList","",3,"cdkDropListDropped"],["class","border-bottom","cdkDrag","",3,"cdkDragDisabled","contextmenu","click",4,"ngFor","ngForOf"],["cdkDrag","",1,"border-bottom",3,"contextmenu","click","cdkDragDisabled"],["style","width: 10px",4,"ngIf"],[2,"width","50%"],[1,"d-flex"],[4,"ngIf","ngIfElse"],[1,"ms-4","d-flex","flex-column","justify-content-center",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],[3,"serials"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",3,"innerHtml"],[1,"text-end"],[4,"ngIf"],["class","fs-6",4,"ngIf"],[1,"text-end","text-danger"],[1,"text-end",2,"width","75px"],[1,"fa-solid","fa-trash","fs-4","text-danger","pointer",3,"click"],[2,"width","10px"],[1,"ratio","ratio-1x1",2,"width","55px"],[1,"item-image",3,"src"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6"],[1,"fs-5","text-end"],[1,"fs-5"],[1,"row","g-0","h-100"],[1,"col-12"],[1,"d-flex","justify-content-center","align-items-center","h-100"],[1,"row"],[1,"col-12","d-flex","justify-content-center"],[1,"fa-regular","fa-cart-arrow-up","text-secondary",2,"font-size","110px"],[1,"col-12","justify-content-center","text-center","mt-5","empty-cart-description","text-secondary","headings-font-family"]],template:function(e,a){if(e&1&&_(0,I0,4,1,"div",2)(1,T0,15,0,"ng-template",null,0,Z),e&2){let o=we(2);m("ngIf",a.cart.length)("ngIfElse",o)}},dependencies:[X,J,B,ge,Ri,Wo,Bo,br,dt,wr],styles:[".item-image[_ngcontent-%COMP%]{height:50px;width:56px;display:block;border:solid 1px #dddddd;border-radius:5px;object-fit:contain}.example-menu[_ngcontent-%COMP%]{display:inline-flex;flex-direction:column;min-width:180px;max-width:280px;background-color:#fff;padding:6px 0}.example-menu-item[_ngcontent-%COMP%]{background-color:transparent;cursor:pointer;border:none;-webkit-user-select:none;user-select:none;min-width:64px;line-height:36px;padding:0 16px;display:flex;align-items:center;flex-direction:row;flex:1}.example-menu-item[_ngcontent-%COMP%]:hover{background-color:#f5f5f5}.example-menu-item[_ngcontent-%COMP%]:active{background-color:#dcdcdc}.table[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:not(caption) > *[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{padding:12px 10px} .cdk-menu.cdk-menu-group.example-menu{box-shadow:0 5px 5px -3px #0003,0 8px 10px 1px #00000024,0 3px 14px 2px #0000001f}.empty-cart-description[_ngcontent-%COMP%]{font-size:14px;font-weight:500;color:#c7c7c7}"]})};var Qn=class t{processTransactionService=y(ht);cart=y(Ze);items$=this.cart.cart$.pipe(V(r=>r.length));qtyTotal$=this.cart.cart$.pipe(V(r=>r.reduce((e,a)=>e+a.Quantity,0)));processTransaction(){this.processTransactionService.processTransaction()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-process"]],decls:6,vars:6,consts:[["type","button",1,"btn","btn-success","w-100","fs-3","px-0","py-6",2,"border-left","0.1px solid #fff",3,"click"],[1,"fs-6"]],template:function(e,a){e&1&&(n(0,"button",0),g("click",function(){return a.processTransaction()}),p(1," Process "),n(2,"small",1),p(3),v(4,"async"),v(5,"async"),i()()),e&2&&(l(3),Qe("(",E(4,2,a.items$)," items, ",E(5,4,a.qtyTotal$)," Qty)"))},dependencies:[X,rt],encapsulation:2})};var qn=class t{deliveryTypeService=y(Gt);openDeliveryTypeDialog(){this.deliveryTypeService.openDeliveryTypeDialog()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-delivery-type-note"]],decls:2,vars:0,consts:[["type","button",1,"btn","btn-gray","w-100","fs-3","px-0","py-6","headings-font-family",3,"click"],[1,"fa-regular","fa-note-sticky","fa-xl"]],template:function(e,a){e&1&&(n(0,"button",0),g("click",function(){return a.openDeliveryTypeDialog()}),f(1,"i",1),i())},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};var Un=class t{constructor(r){this.dialogRef=r;this.modalConfig.title="Clear Order?",this.modalConfig.headerType=ve.Success}modalConfig=new _e;onOk(){this.dialogRef.close("ok")}close(){this.dialogRef.close()}static \u0275fac=function(e){return new(e||t)(C(ye))};static \u0275cmp=O({type:t,selectors:[["POS-dialog-clear-cart"]],decls:4,vars:1,consts:[[3,"onOk","onCancel","onClose","config"],[1,"fw-normal"]],template:function(e,a){e&1&&(n(0,"modal-material",0),g("onOk",function(){return a.onOk()})("onCancel",function(){return a.close()})("onClose",function(){return a.close()}),n(1,"content")(2,"h4",1),p(3,"This will erase all items in cart. Are you sure?"),i()()()),e&2&&m("config",a.modalConfig)},dependencies:[De,fe],encapsulation:2})};var zn=class t{dialog=y(A);cartService=y(Ze);clearCart(){this.dialog.open(Un).afterClosed().subscribe(e=>{e==="ok"&&this.cartService.clear()})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-clear-cart"]],decls:3,vars:0,consts:[[1,"w-100"],["type","button",1,"btn","btn-gray","w-100","fs-3","px-0","py-6","headings-font-family",3,"click"]],template:function(e,a){e&1&&(n(0,"div",0)(1,"button",1),g("click",function(){return a.clearCart()}),p(2," Clear "),i()())},styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"]})};var $n=class t{static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-cart-action-shell"]],decls:7,vars:0,consts:[[1,"row","g-0","pb-6","px-5"],[1,"col-1","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],[2,"flex-grow","1"],[1,"col-4","pe-5"],[1,"col-7"]],template:function(e,a){e&1&&(n(0,"div",0)(1,"div",1),f(2,"POS-delivery-type-note",2),i(),n(3,"div",3),f(4,"POS-clear-cart"),i(),n(5,"div",4),f(6,"POS-process"),i()())},dependencies:[X,Qn,qn,zn],encapsulation:2})};function w0(t,r){if(t&1&&(z(0),f(1,"POS-complete",2),v(2,"async"),v(3,"async"),$()),t&2){let e=s();l(),m("afterProcessData",E(2,3,e.completeData$))("cartItems",E(3,5,e.cart$))("orderNumber",e.orderNumberForm.value)}}function O0(t,r){if(t&1){let e=b();n(0,"div",3)(1,"div",4)(2,"div",5)(3,"div",6)(4,"div",7)(5,"POS-select-outlet-form",8),v(6,"async"),v(7,"async"),g("onCloseDialog",function(){d(e);let o=s();return u(o.onCloseDialog())}),i(),f(8,"i",9)(9,"POS-select-outlet-form",10),v(10,"async"),v(11,"async"),i(),f(12,"POS-invoice-number-form",11),v(13,"async"),f(14,"POS-invoice-date",12),i()(),n(15,"div",13)(16,"div",14)(17,"div",15),f(18,"POS-more-action-shell"),i(),n(19,"div",16),f(20,"POS-courier-selection"),i(),n(21,"div",17)(22,"div",18)(23,"button",19),v(24,"async"),g("click",function(){d(e);let o=s();return u(o.collapseSidebar())}),f(25,"span",20)(26,"span",20)(27,"span",20),i()()()()()(),n(28,"div",21)(29,"div",5),f(30,"POS-quick-key",22),v(31,"async"),i(),n(32,"div",23)(33,"div",24)(34,"div",25),f(35,"POS-variant-autocomplete",26),i()(),f(36,"POS-cart-display",27),v(37,"async"),v(38,"async"),f(39,"POS-cart-action-shell"),i()()()}if(t&2){let e=s();l(5),m("outlets",E(6,24,e.outlets$))("isOpenAfterLoad",E(7,26,e.isOpenOutletDialog$))("formControl",e.sourceOutletForm)("limitOutletText",e.limitOutletText),l(4),m("outlets",E(10,28,e.destination$))("isOpenAfterLoad",E(11,30,e.isOpenDestinationDialog$))("hideLocationIcon",!0)("formControl",e.destinationOutletForm)("limitOutletText",e.limitOutletText)("sourceOutletID",e.sourceOutletForm.value.ID),l(3),m("formControl",e.orderNumberForm)("isEdit",E(13,32,e.isEdit$)),l(2),m("formControl",e.dateForm)("tooltip",e.role.global!=null&&e.role.global.Date?"":"Date role is required"),l(9),Nt("change",E(24,34,e.toggleState$)),l(6),Nt("pt-5",e.sourceOutletForm.value.ID),l(),m("quickKey",E(31,36,e.quickKeyItems$))("outletID",e.sourceOutletForm.value.ID)("formControl",e.itemQuickKeyID),l(5),m("formControl",e.variantAutocompleteForm),l(),m("cart",E(37,38,e.cart$))("appConfigJSON",E(38,40,e.appConfigJSON$))}}var Gn=class t{limitOutletText=12;isEditService=y(Rt);isEdit$=this.isEditService.isEdit$;isComplete=y(Ti);outlet=y(ce);loadForm=y(Re);isOpenOutletDialog=y(Ii);orderNumber=y(Xt);invoiceDate=y(Yt);quickKeyItems=y(Kt);cart=y(Ze);intercom=y(bo);lowOnStock=y(jt);overOnStock=y(Qt);variantAutocomplete=y(Jt);processTransaction=y(ht);toggle=y(Do);title=y(ni);role=y(ne);isComplete$=this.isComplete.isComplete$;sourceOutletForm=this.outlet.sourceOutlet;destinationOutletForm=this.outlet.destinationOutlet;outlets$=this.loadForm.outlets$;destination$=this.sourceOutletForm?.valueChanges.pipe(ze(this.sourceOutletForm?.value),Q(r=>this.loadForm.destinations$.pipe(V(e=>e?.filter(o=>o.ID!==r?.ID)))));isOpenOutletDialog$=this.isOpenOutletDialog.isOpenOutletDialog$;isOpenDestinationDialog$=this.isOpenOutletDialog.isOpenDestinationDialog$;orderNumberForm=this.orderNumber.orderNumber;dateForm=this.invoiceDate.invoiceDate;quickKeyItems$=this.quickKeyItems.quickKeyItems$;itemQuickKeyID=this.quickKeyItems.itemQuickKeyID;appConfigJSON$=this.loadForm.config$;cart$=this.cart.cart$;variantAutocompleteForm=this.variantAutocomplete.variantAutocomplete;completeData$=this.processTransaction.submitOrder$;toggleState$=this.toggle.toggleState$;constructor(){this.title.setTitle(this.title.getTitle()+" | Transfer Order"),this.role?.sell?.Number==!1&&this.orderNumberForm.disable(),this.role.global.Date==!1&&this.dateForm.disable(),Ve(this.outlet.sourceOutletID$,this.outlet.destinationOutletID$,this.cart$).pipe(pt()).subscribe(()=>this.focusSearchInput())}focusSearchInput(){let r=document.getElementById("product_search");r&&r.focus()}ngAfterViewInit(){this.intercom.hideLauncher()}ngOnDestroy(){this.intercom.showLauncher(),this.lowOnStock.resetLowOnStock(),this.overOnStock.resetOverOnStock()}collapseSidebar(){this.toggle.toggleSidebar()}onCloseDialog(){this.isOpenOutletDialog.onCloseOutletDialog()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=O({type:t,selectors:[["POS-transfer-order-v2"]],features:[xo([Ze,$t,Yt,Ii,Xt,ce,Kt,ft,Ot,Fe,wt,Mn,Ti,ht,Mt,Gt,Ye,Jt,te,Pt,Et,Rt])],decls:4,vars:4,consts:[["ISNOTCOMPLETE",""],[4,"ngIf","ngIfElse"],[3,"afterProcessData","cartItems","orderNumber"],[1,"container-fluid"],[1,"row","header","border-bottom"],[1,"col-5","border-end"],[1,"left-toolbar-container","h-100","d-flex","align-items-center","justify-content-between"],[1,"d-flex"],[3,"onCloseDialog","outlets","isOpenAfterLoad","formControl","limitOutletText"],[1,"fa-solid","fa-arrow-right","ms-4","me-2","mt-2"],["dialogTitle","Choose Destination Outlet",3,"outlets","isOpenAfterLoad","hideLocationIcon","formControl","limitOutletText","sourceOutletID"],["transactionType","Transfer Order",3,"formControl","isEdit"],[3,"formControl","tooltip"],[1,"col-7","d-flex","align-items-center"],[1,"row","flex-grow-1"],[1,"col-lg-7","col-5","d-flex","align-items-center"],[1,"col-5","ps-0"],[1,"col-2"],[1,"navbar","mobile-button","border-bottom-0"],["type","button","aria-controls","navigation-index","aria-expanded","false","aria-label","Toggle navigation",1,"navbar-toggler","navbar-toggler-right","float-end","toggle-menu","ps-2","pe-0","border-0",2,"width","max-content","height","max-content",3,"click"],[1,"navbar-toggler-bar","burger-lines"],[1,"row","content"],[3,"quickKey","outletID","formControl"],[1,"col-7","pt-5","px-0","d-flex","flex-column"],[1,"row","w-100","ms-0"],[1,"col-12","px-0"],["inputID","product_search",3,"formControl"],[1,"cart-display",3,"cart","appConfigJSON"]],template:function(e,a){if(e&1&&(_(0,w0,4,7,"ng-container",1),v(1,"async"),_(2,O0,40,42,"ng-template",null,0,Z)),e&2){let o=we(3);m("ngIf",E(1,2,a.isComplete$))("ngIfElse",o)}},dependencies:[X,B,rt,Pn,xr,Bt,R,oi,Sr,lr,Wn,Hn,hr,jn,$n,Yi],styles:[".left-toolbar-container[_ngcontent-%COMP%]{position:relative}.left-toolbar-container[_ngcontent-%COMP%] POS-invoice-number-form[_ngcontent-%COMP%]{position:absolute;top:34px;left:32px}.header[_ngcontent-%COMP%]{min-height:60px}.content[_ngcontent-%COMP%]{min-height:calc(100vh - 60px)}.supplier-more-menu[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center}.cart-display[_ngcontent-%COMP%]{flex-grow:1;height:0px;overflow-y:auto}input[_ngcontent-%COMP%]{width:100%;height:38px!important;border:0;border-bottom:1px solid #ced4da;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:13px}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]{transition:.4s}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(1){-webkit-transform:rotate(-45deg) translate(-8px,4px);transform:rotate(-45deg) translate(-8px,4px)}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(2){opacity:0}.change[_ngcontent-%COMP%] .burger-lines[_ngcontent-%COMP%]:nth-child(3){-webkit-transform:rotate(45deg) translate(-5px,0px);transform:rotate(45deg) translate(-5px)}.mobile-button[_ngcontent-%COMP%]{display:none}@media (max-width: 990px){.mobile-button[_ngcontent-%COMP%]{display:block}}.navbar-toggler[_ngcontent-%COMP%]:focus{box-shadow:none!important}.more-actions[_ngcontent-%COMP%] div.d-flex[_ngcontent-%COMP%]{width:30rem}"]})};var E0=()=>["/menu/Logistics/Setup/Courier/Form"],M0=()=>["/menu/Logistics/Archive/Transfer_Order/Info"],P0=t=>({ID:t}),F0=(t,r,e)=>({"text-success":t,"text-warning":r,"text-danger":e}),V0=()=>["/print/Transfer"],N0=(t,r)=>({ID:t,Template:r});function k0(t,r){if(t&1){let e=b();n(0,"a",20),g("click",function(){d(e);let o=s(2);return u(o.httpPostListID("TransferOrder/Delete"))}),f(1,"i",21),p(2," Delete"),i()}}function L0(t,r){if(t&1){let e=b();n(0,"div",22)(1,"h6"),p(2,"Source"),i(),n(3,"outlet-selector",23),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.EntityID,o)||(c.pageData.Filter.EntityID=o),u(o)}),i(),n(4,"h6"),p(5,"Destination"),i(),n(6,"outlet-selector",24),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.DestinationID,o)||(c.pageData.Filter.DestinationID=o),u(o)}),i(),n(7,"h6"),p(8,"Fulfillment"),i(),n(9,"ng-select",25),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.StateID,o)||(c.pageData.Filter.StateID=o),u(o)}),i(),n(10,"h6"),p(11,"Tag"),i(),n(12,"ng-select",26),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.TypeID,o)||(c.pageData.Filter.TypeID=o),u(o)}),i(),n(13,"h6"),p(14,"Courier"),i(),n(15,"ng-select",27),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CourierID,o)||(c.pageData.Filter.CourierID=o),u(o)}),i(),n(16,"h6"),p(17,"From"),i(),n(18,"datepicker",28),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(19,"h6"),p(20,"To"),i(),n(21,"datepicker",29),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i(),n(22,"h6"),p(23,"Creator"),i(),n(24,"autocompleteV2",30),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.CreatorID,o)||(c.pageData.Filter.CreatorID=o),u(o)}),i(),n(25,"h6"),p(26,"Sort By"),i(),n(27,"radio-options",31),h("modelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.SortBy,o)||(c.pageData.Filter.SortBy=o),u(o)}),i(),n(28,"h6"),p(29,"Page Size"),i(),n(30,"input",32),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.RowCount,o)||(c.pageData.Filter.RowCount=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",2),x("ngModel",e.pageData.Filter.EntityID),m("multiple",!1),l(3),m("accessType",2),x("ngModel",e.pageData.Filter.DestinationID),m("multiple",!1),l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Deliveries),x("ngModel",e.pageData.Filter.StateID),l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Types),x("ngModel",e.pageData.Filter.TypeID),l(3),m("items",e.pageData.Options==null?null:e.pageData.Options.Courier),x("ngModel",e.pageData.Filter.CourierID),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("ngModel",e.pageData.Filter.CreatorID),l(3),m("options",e.pageData.Options==null?null:e.pageData.Options.SortOption),x("model",e.pageData.Filter.SortBy),l(3),x("ngModel",e.pageData.Filter.RowCount),m("max",1e4)}}function R0(t,r){if(t&1){let e=b();n(0,"th",33)(1,"input",34),g("change",function(o){d(e);let c=s(2);return u(c.onSelectAllData(o.target.checked))}),i()()}}function A0(t,r){t&1&&(n(0,"th",35),p(1," Price "),i())}function B0(t,r){if(t&1){let e=b();n(0,"td",33)(1,"input",40),h("ngModelChange",function(o){d(e);let c=s().$implicit;return S(c.selected,o)||(c.selected=o),u(o)}),i()()}if(t&2){let e=s().$implicit;l(),x("ngModel",e.selected)}}function W0(t,r){if(t&1&&(n(0,"td",35),p(1),v(2,"number"),i()),t&2){let e=s().$implicit;l(),D(" ",E(2,1,e.Price)," ")}}function H0(t,r){if(t&1&&(n(0,"span"),p(1),i()),t&2){let e=s().$implicit;l(),I(e.Courier)}}function j0(t,r){if(t&1&&(n(0,"span"),p(1),i()),t&2){let e=s().$implicit;l(),I(e.CourierName)}}function Q0(t,r){if(t&1&&(n(0,"tbody")(1,"tr"),_(2,B0,2,1,"td",10),n(3,"td"),p(4),i(),n(5,"td"),p(6),i(),n(7,"td"),f(8,"a",36),i(),n(9,"td"),p(10),v(11,"date"),i(),n(12,"td"),p(13),v(14,"date"),i(),n(15,"td",35),p(16),i(),_(17,W0,3,3,"td",15),n(18,"td"),p(19),i(),n(20,"td"),p(21),i(),n(22,"td"),p(23),i(),n(24,"td"),_(25,H0,2,1,"span",37)(26,j0,2,1,"span",37),i(),n(27,"td")(28,"a",38),f(29,"i",39),i()()()()),t&2){let e=r.$implicit,a=s(2);l(2),m("ngIf",a.role.logistic.Delete),l(2),I(e.Source),l(2),I(e.Destination),l(2),m("routerLink",N(25,M0))("queryParams",M(26,P0,e.ID))("innerHTML",e.Number,j),l(2),I(P(11,19,e.Date,"dd MMM yyyy")),l(3),I(P(14,22,e.Created,"HH:mm")),l(3),I(e.Quantity),l(),m("ngIf",a.role.sell.PriceVisible&&a.pageData.Config.PriceVisible),l(),ot(Fi(28,F0,e.StateLabel=="Received",e.StateLabel=="Dispatched",e.StateLabel=="Approved")),l(),D(" ",e.StateLabel," "),l(2),I(e.CreatorName),l(2),I(e.TypeName),l(2),m("ngIf",e.Courier!=null),l(),m("ngIf",e.CourierName!=null&&e.Courier==null),l(2),m("routerLink",N(32,V0))("queryParams",Ae(33,N0,e.ID,e.SourceTemplateID))}}function q0(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.Number,o)||(c.pageData.Filter.Number=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,k0,3,0,"a",3),n(3,"a",4),p(4,"Add"),i()(),n(5,"filters"),_(6,L0,31,21,"ng-template",null,0,Z),i(),n(8,"content")(9,"div",5)(10,"div",6)(11,"table",7)(12,"thead",8)(13,"tr",9),_(14,R0,2,0,"th",10),n(15,"th",11),p(16,"Source"),i(),n(17,"th",12),p(18,"Destination"),i(),n(19,"th"),p(20,"Number"),i(),n(21,"th",13),p(22,"Date"),i(),n(23,"th",13),p(24,"Time"),i(),n(25,"th",14),p(26,"Qty"),i(),_(27,A0,2,0,"th",15),n(28,"th",13),p(29,"Status"),i(),n(30,"th",16),p(31,"Creator"),i(),n(32,"th",13),p(33,"Tag"),i(),n(34,"th",13),p(35,"Courier"),i(),f(36,"th",17),i()(),_(37,Q0,30,36,"tbody",18),i()(),n(38,"POS-complex-pagination",19),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.Number),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.role.logistic.Delete&&e.getSelectedData().length>0),l(),m("routerLink",N(11,E0)),l(11),m("ngIf",e.role.logistic.Delete),l(13),m("ngIf",e.role.sell.PriceVisible&&e.pageData.Config.PriceVisible),l(10),m("ngForOf",e.data.Data),l(),m("total",e.data.Data.length)("pageData",e.pageData)}}var Kn=class t extends Se{constructor(e,a,o,c){super(e,a,"transferorder/VoidedTransferOrderList","TransferOrderLoader/TransferOrderList",o);this.roleService=c}radioOption;role=y(ne);static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(ee),C(ne))};static \u0275cmp=O({type:t,selectors:[["POS-recycle-bin"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["role","button","class","btn btn-outline-secondary me-5",3,"click",4,"ngIf"],[1,"button","btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"header"],["style","width: 14px",4,"ngIf"],[2,"width","100px"],[2,"width","150px"],[2,"width","90px"],[1,"text-end",2,"width","50px"],["class","text-end",4,"ngIf"],[2,"width","120px"],[2,"width","16px"],[4,"ngFor","ngForOf"],["api","TransferOrder/VoidedTransferOrderRowsCount",3,"jumpToPage","previousPage","nextPage","total","pageData"],["role","button",1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fas","fa-trash"],[1,"dialog-filter"],["placeholder","Source",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","Destination",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["bindLabel","Value","bindValue","Key","placeholder","Choose",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Options",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose a courier",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["requestUrl","/API/AC/GetUserSuggestion",1,"input-left","w-100","ac-filter",3,"ngModelChange","ngModel"],["name","SortBy",3,"modelChange","options","model"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","ngModel","max"],[2,"width","14px"],["type","checkbox",3,"change"],[1,"text-end"],[3,"routerLink","queryParams","innerHTML"],[4,"ngIf"],["target","_blank",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa","fa-print"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(a,o){a&1&&_(0,q0,39,12,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,Ce,Dt,R,W,oe,de,Ht,We,Je,ct,Ee,Pe,ge,he],encapsulation:2})};var U0=()=>["/menu/Logistics/Archive/Transfer_Order/Info"],z0=t=>({ID:t});function $0(t,r){if(t&1){let e=b();n(0,"button",12),g("click",function(){d(e);let o=s(2);return u(o.openExportModal())}),f(1,"i",13),p(2," Export "),i()}}function G0(t,r){if(t&1){let e=b();n(0,"div",14)(1,"h6"),p(2,"Source"),i(),n(3,"outlet-selector",15),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.OutletSourceIds,o)||(c.pageData.Filter.OutletSourceIds=o),u(o)}),i(),n(4,"h6"),p(5,"Destination"),i(),n(6,"outlet-selector",16),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.OutletDestinationIds,o)||(c.pageData.Filter.OutletDestinationIds=o),u(o)}),i(),n(7,"h6"),p(8,"Action"),i(),n(9,"ng-select",17),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.ActionTypeID,o)||(c.pageData.Filter.ActionTypeID=o),u(o)}),i(),n(10,"h6"),p(11,"From"),i(),n(12,"datepicker",18),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.From,o)||(c.pageData.Filter.From=o),u(o)}),i(),n(13,"h6"),p(14,"To"),i(),n(15,"datepicker",19),h("dateChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.To,o)||(c.pageData.Filter.To=o),u(o)}),i(),n(16,"h6"),p(17,"Creator"),i(),n(18,"autocompleteV2",20),h("ngModelChange",function(o){d(e);let c=s(2);return S(c.pageData.Filter.UserID,o)||(c.pageData.Filter.UserID=o),u(o)}),i()()}if(t&2){let e=s(2);l(3),m("accessType",2),x("ngModel",e.pageData.Filter.OutletSourceIds),m("multiple",!0),l(3),m("accessType",2),x("ngModel",e.pageData.Filter.OutletDestinationIds),m("multiple",!0),l(3),m("items",e.pageData.Options.ActionTypeOptions),x("ngModel",e.pageData.Filter.ActionTypeID),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.From),l(3),m("isFloatingLabel",!1),x("date",e.pageData.Filter.To),l(3),x("ngModel",e.pageData.Filter.UserID)}}function K0(t,r){if(t&1&&f(0,"a",24),t&2){let e=s().$implicit;m("routerLink",N(3,U0))("queryParams",M(4,z0,e.TransferOrderID))("innerHTML",e.TransferOrderNumber,j)}}function J0(t,r){if(t&1&&(n(0,"span",25),p(1),i()),t&2){let e=s().$implicit;l(),D(" ",e.TransferOrderNumber,"")}}function Y0(t,r){if(t&1&&(n(0,"tr")(1,"td"),p(2),i(),n(3,"td"),p(4),i(),n(5,"td"),_(6,K0,1,6,"a",21)(7,J0,2,1,"span",22),i(),n(8,"td"),p(9),v(10,"date"),i(),n(11,"td"),p(12),v(13,"date"),i(),n(14,"td"),p(15),i(),n(16,"td"),p(17),i(),n(18,"td"),p(19),i(),f(20,"td",23),i()),t&2){let e=r.$implicit;l(2),I(e.OutletSourceName),l(2),I(e.OutletDestinationName),l(2),m("ngIf",!e.IsDeleted),l(),m("ngIf",e.IsDeleted),l(2),I(P(10,10,e.Created,"dd MMM yyyy")),l(3),I(P(13,13,e.Created,"HH:mm")),l(3),I(e.CreatorUserName),l(2),I(e.Quantity),l(2),I(e.ActionType),l(),m("innerHTML",e.Note,j)}}function X0(t,r){if(t&1){let e=b();n(0,"mainpanel-cmp",2),h("textChange",function(o){d(e);let c=s();return S(c.pageData.Filter.TransferOrderNumber,o)||(c.pageData.Filter.TransferOrderNumber=o),u(o)}),g("onSubmit",function(){d(e);let o=s();return u(o.searchFromPageOne())}),h("filterChange",function(o){d(e);let c=s();return S(c.pageData.Filter,o)||(c.pageData.Filter=o),u(o)}),n(1,"actions"),_(2,$0,3,0,"button",3),i(),n(3,"filters"),_(4,G0,19,13,"ng-template",null,0,Z),i(),n(6,"content")(7,"div",4)(8,"div",5)(9,"table",6)(10,"thead",7)(11,"tr")(12,"th"),p(13,"Outlet"),i(),n(14,"th"),p(15,"Destination"),i(),n(16,"th",8),p(17,"Number"),i(),n(18,"th"),p(19,"Date"),i(),n(20,"th"),p(21,"Time"),i(),n(22,"th"),p(23,"Creator"),i(),n(24,"th"),p(25,"Qty"),i(),n(26,"th"),p(27,"Action"),i(),n(28,"th",9),p(29,"Note"),i()()(),n(30,"tbody"),_(31,Y0,21,16,"tr",10),i()()(),n(32,"POS-complex-pagination",11),g("jumpToPage",function(){d(e);let o=s();return u(o.getListData())})("previousPage",function(){d(e);let o=s();return u(o.getListData())})("nextPage",function(){d(e);let o=s();return u(o.getListData())}),i()()()()}if(t&2){let e=s();m("pageData",e.menuData),x("text",e.pageData.Filter.TransferOrderNumber),m("isFilterOnDropdown",!1),x("filter",e.pageData.Filter),l(2),m("ngIf",e.roleService.global.Export),l(29),m("ngForOf",e.data),l(),m("total",e.data.length)("pageData",e.pageData)}}var Jn=class t extends Se{constructor(e,a,o,c,w,H){super(e,a,"TransferOrder/gettransferorderupdatehistories","TransferOrderLoader/loadtransferorderupdatehistory",null,w);this.csvConverter=o;this.roleService=c;this.matDialog=H}openExportModal(){this.matDialog.open(Ie,{data:{title:"Transfer Order Update History",exportTypes:[{ID:"transferorderexport/gettransferorderupdatehistories",Value:"Default"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"",pagination:!1}})}scopeOptions=[{Key:!1,Value:"Variant"},{Key:!0,Value:"Product"}];static \u0275fac=function(a){return new(a||t)(C(te),C(k),C(Me),C(ne),C(pe),C(A))};static \u0275cmp=O({type:t,selectors:[["POS-transfer-update-history"]],standalone:!1,features:[re],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","text","isFilterOnDropdown","filter","textChange","onSubmit","filterChange",4,"ngIf"],[3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],["class","btn btn-outline-secondary me-3",3,"click",4,"ngIf"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table","border-bottom","hidden-xxs"],[1,"thead-light","sticky-top-thead"],[2,"width","150px"],[2,"width","400px"],[4,"ngFor","ngForOf"],["api","transferorder/gettransferorderupdatehistoriescount",3,"jumpToPage","previousPage","nextPage","total","pageData"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["placeholder","Source",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["placeholder","Destination",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["bindLabel","Value","bindValue","Key","appendTo","body",3,"ngModelChange","items","ngModel"],["placeholder","From","appearance","outline","name","From",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline","name","To",3,"dateChange","isFloatingLabel","date"],["requestUrl","/API/AC/GetUserSuggestion",1,"input-left","w-100","ac-filter",3,"ngModelChange","ngModel"],[3,"routerLink","queryParams","innerHTML",4,"ngIf"],["class","text-danger",4,"ngIf"],[3,"innerHTML"],[3,"routerLink","queryParams","innerHTML"],[1,"text-danger"]],template:function(a,o){a&1&&_(0,X0,33,8,"mainpanel-cmp",1),a&2&&m("ngIf",o.data)},dependencies:[J,B,G,R,W,oe,de,We,Je,Ee,Pe,he],encapsulation:2})};var Z0=[{path:"Archive/Transfer_Order",component:Zi},{path:"Archive/Transfer_Order/Info",component:dn},{path:"Archive/Transfer_Order/Form",component:Gn},{path:"Archive/Transfer_Order/Receive",component:xn},{path:"Archive/Outbound_Logistics",component:en},{path:"Archive/Outbound_Logistics/Info",component:on},{path:"Archive/Outbound_Logistics/Form",component:bn},{path:"Archive/Inbound_Logistics",component:tn},{path:"Archive/Inbound_Logistics/Info",component:_n},{path:"Archive/Inbound_Logistics/Form",component:Dn},{path:"Report/Outbound/Product",component:rn},{path:"Report/Outbound/Detail",component:an},{path:"Report/Outbound/Logistics_Service",component:rr},{path:"Report/Outbound/Logistics_Service/Detail",component:In},{path:"Report/Inbound/Product",component:ln},{path:"Report/Inbound/Detail",component:pn},{path:"Report/Transfer/Product",component:mn},{path:"Report/Transfer/Detail",component:cn},{path:"Report/Transfer/History",component:Jn},{path:"Setup/Courier",component:Cn},{path:"Setup/Courier/Form",component:vn},{path:"Setup/Courier/Info",loadComponent:()=>import("./chunk-SXKMJUZG.js").then(t=>t.CourierInfoComponent)},{path:"Setup/Recycle_Bin",component:Kn},{path:"",redirectTo:"Archive/Transfer_Order",pathMatch:"full"}],Yn=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=ii({type:t});static \u0275inj=Zt({imports:[yt.forChild(Z0),yt]})};var Xn=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=ii({type:t});static \u0275inj=Zt({imports:[X,De,Ge,st]})};var $r=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=ii({type:t});static \u0275inj=Zt({imports:[X,De,Yn,Ge,Bt,ai,Oo,Mo,Po,No,Lo,Qi,qi,Ko,jo,Mr,ji,Yo,Wi,Ee,Ri,pr,Pr,Xn,Fr,Ji,Ni,st,Ro,Wt,Gi,Dr,vr,wo,Ui,dt,li,zi,Pe,or,ko,nr,Ki]})};export{$r as DeliveryModule};
|