dealpos 25.43.2 → 25.43.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.
Files changed (88) hide show
  1. package/browser/{chunk-ZMOEZBOV.js → chunk-272PZZGG.js} +1 -1
  2. package/browser/{chunk-ZT3ATOCA.js → chunk-2EP24RI6.js} +1 -1
  3. package/browser/{chunk-KUN2P3RN.js → chunk-2PLXQ6DN.js} +1 -1
  4. package/browser/{chunk-N4FKAPLW.js → chunk-2RGZUU27.js} +1 -1
  5. package/browser/{chunk-4QQF4IJE.js → chunk-3RWAC4XP.js} +1 -1
  6. package/browser/{chunk-HKUGK6HF.js → chunk-3VT5D6VK.js} +1 -1
  7. package/browser/{chunk-NSXCBKM4.js → chunk-3Z2WREJH.js} +1 -1
  8. package/browser/{chunk-LDF4ZCJN.js → chunk-4DMEBTIA.js} +1 -1
  9. package/browser/{chunk-HMU3DWZJ.js → chunk-4V3WJ77K.js} +1 -1
  10. package/browser/{chunk-5EEOIYLP.js → chunk-5FDHNE6C.js} +1 -1
  11. package/browser/{chunk-KIQXPGXN.js → chunk-5H2362GA.js} +1 -1
  12. package/browser/{chunk-JEZGFXOM.js → chunk-5QQG3XAT.js} +1 -1
  13. package/browser/{chunk-SEXUIUP5.js → chunk-5YFCA5PL.js} +1 -1
  14. package/browser/{chunk-V73DMOF7.js → chunk-66K27OF2.js} +1 -1
  15. package/browser/{chunk-PGSKQYIL.js → chunk-6W6BB6FZ.js} +1 -1
  16. package/browser/{chunk-T4OMGJF4.js → chunk-75SMG4SF.js} +1 -1
  17. package/browser/{chunk-LAFPISY6.js → chunk-7HSR3LT6.js} +1 -1
  18. package/browser/{chunk-ITUXL4IU.js → chunk-7UXE6WII.js} +1 -1
  19. package/browser/{chunk-ROR3RTY5.js → chunk-A5ZLOGOJ.js} +2 -2
  20. package/browser/{chunk-6KPCTTDA.js → chunk-AGUT25WD.js} +1 -1
  21. package/browser/{chunk-AXLH4KKX.js → chunk-AROOOSPE.js} +2 -2
  22. package/browser/{chunk-7527AL7Q.js → chunk-AVQXAEMG.js} +1 -1
  23. package/browser/{chunk-BJ4ZY3VJ.js → chunk-B2ZLN3DU.js} +1 -1
  24. package/browser/{chunk-5YJ2OEBF.js → chunk-BLOA2A3C.js} +1 -1
  25. package/browser/{chunk-QSWKUXSH.js → chunk-C7XXRU25.js} +1 -1
  26. package/browser/{chunk-IFFXFKVP.js → chunk-CMKDM3YB.js} +6 -6
  27. package/browser/{chunk-R4CTK5NZ.js → chunk-CVI22GXH.js} +1 -1
  28. package/browser/{chunk-INZKDGM2.js → chunk-DLQL5GPU.js} +3 -3
  29. package/browser/{chunk-YEAPJ2OC.js → chunk-E72S2LHD.js} +1 -1
  30. package/browser/{chunk-QVTFZ7LA.js → chunk-EFKIYD2S.js} +1 -1
  31. package/browser/{chunk-X5OST3RI.js → chunk-EIHE3QN4.js} +1 -1
  32. package/browser/{chunk-VPFQM3LL.js → chunk-EP6KOZ4E.js} +1 -1
  33. package/browser/{chunk-PBEIFRAA.js → chunk-F3T2SC5Q.js} +1 -1
  34. package/browser/{chunk-2QU24F5P.js → chunk-F5XHOC4H.js} +1 -1
  35. package/browser/{chunk-EKDNW5AX.js → chunk-FBXL7ZXR.js} +1 -1
  36. package/browser/{chunk-CFSBMQ5D.js → chunk-FHJG45VQ.js} +2 -2
  37. package/browser/{chunk-K5KGHSAP.js → chunk-FMDB67TU.js} +1 -1
  38. package/browser/{chunk-3XR3MVQE.js → chunk-G2MU6LQ2.js} +1 -1
  39. package/browser/{chunk-O2QDJGKT.js → chunk-G7SZYW63.js} +1 -1
  40. package/browser/{chunk-ZEQ2QQEK.js → chunk-GFJYKJED.js} +1 -1
  41. package/browser/{chunk-HJVO2MYG.js → chunk-GSISS3SC.js} +1 -1
  42. package/browser/{chunk-HFYSK74N.js → chunk-HIYIS7P2.js} +1 -1
  43. package/browser/{chunk-DKDOVSVH.js → chunk-HZ2U3RGD.js} +1 -1
  44. package/browser/{chunk-ZZVT4VHZ.js → chunk-INQBV4VC.js} +1 -1
  45. package/browser/{chunk-MSBIWISH.js → chunk-IQBTWGJY.js} +1 -1
  46. package/browser/{chunk-FSXDAB7C.js → chunk-ITGJPMDT.js} +1 -1
  47. package/browser/{chunk-XTL4S3XK.js → chunk-J3IQVJI4.js} +1 -1
  48. package/browser/{chunk-MBA7MORK.js → chunk-JEAH4FYM.js} +1 -1
  49. package/browser/{chunk-EJDRY7MH.js → chunk-JGK2MYOQ.js} +1 -1
  50. package/browser/{chunk-A7FNJM6G.js → chunk-KA4TOHBS.js} +1 -1
  51. package/browser/{chunk-OB764IZP.js → chunk-M4F2UJHF.js} +1 -1
  52. package/browser/{chunk-AWSD3VOK.js → chunk-MDD6TFTM.js} +1 -1
  53. package/browser/{chunk-CSLHA6EL.js → chunk-MZPJH3AH.js} +1 -1
  54. package/browser/{chunk-6HXB7UO4.js → chunk-NISY7IAG.js} +3 -3
  55. package/browser/{chunk-6FSVJ3O6.js → chunk-NRWPQAB7.js} +1 -1
  56. package/browser/{chunk-SYQCAXOC.js → chunk-NUJC3NPK.js} +1 -1
  57. package/browser/{chunk-FXKRIVYT.js → chunk-NWXWPE73.js} +1 -1
  58. package/browser/{chunk-2HUEFC2T.js → chunk-O2OM4KZ4.js} +1 -1
  59. package/browser/{chunk-FYACJ2YI.js → chunk-O7K75UXY.js} +1 -1
  60. package/browser/{chunk-CODMBGPI.js → chunk-ONEB5DHN.js} +2 -2
  61. package/browser/{chunk-BPWQFTXE.js → chunk-PWJVQMES.js} +1 -1
  62. package/browser/{chunk-6EOWD655.js → chunk-PX65TDN3.js} +1 -1
  63. package/browser/{chunk-5YUUUZD3.js → chunk-R4KZHFTX.js} +1 -1
  64. package/browser/{chunk-B6STMZWX.js → chunk-RNH5CWRS.js} +1 -1
  65. package/browser/{chunk-BCMMSVJJ.js → chunk-S3ZJOM5T.js} +1 -1
  66. package/browser/{chunk-346EL5B3.js → chunk-SEGFXGKG.js} +1 -1
  67. package/browser/{chunk-FSTDHLYH.js → chunk-SH2AVVL5.js} +1 -1
  68. package/browser/{chunk-ACD7MZMQ.js → chunk-SYYCPGJV.js} +2 -2
  69. package/browser/{chunk-S4IKR42Q.js → chunk-TNHTZU3G.js} +1 -1
  70. package/browser/{chunk-RP455IK5.js → chunk-TS5DD7F4.js} +1 -1
  71. package/browser/{chunk-WEGDL4GR.js → chunk-UCJKQICE.js} +1 -1
  72. package/browser/{chunk-4RRARGON.js → chunk-UYLL2WJ3.js} +2 -2
  73. package/browser/{chunk-NUV6F5WN.js → chunk-VT2H5BYD.js} +1 -1
  74. package/browser/{chunk-ON5DTHAP.js → chunk-WDQOMZAV.js} +1 -1
  75. package/browser/{chunk-DK44EJTX.js → chunk-WZS6HHV3.js} +1 -1
  76. package/browser/{chunk-BJMIDKW4.js → chunk-XBC5WNSH.js} +1 -1
  77. package/browser/{chunk-KTD4OMXY.js → chunk-XRZ7VBID.js} +1 -1
  78. package/browser/{chunk-L7IGIQVH.js → chunk-XZJ645Q5.js} +2 -2
  79. package/browser/{chunk-6VOFZE3V.js → chunk-YFL7VFWC.js} +1 -1
  80. package/browser/{chunk-I7HV744J.js → chunk-YGCPZSCL.js} +1 -1
  81. package/browser/chunk-YGHO5ZLV.js +1 -0
  82. package/browser/{chunk-I3YPVX5L.js → chunk-YI4JLNCJ.js} +1 -1
  83. package/browser/{chunk-2LMF4IMC.js → chunk-YQLHHLTC.js} +1 -1
  84. package/browser/{chunk-CURYSM3Y.js → chunk-ZYI3XMBD.js} +1 -1
  85. package/browser/index.html +2 -2
  86. package/browser/{main-QGKQ75P4.js → main-SAUYF5DW.js} +2 -2
  87. package/package.json +1 -1
  88. package/browser/chunk-TE3WGV2Q.js +0 -1
@@ -1 +1 @@
1
- import{a as ue}from"./chunk-TAVO3B4U.js";import{d as pe,e as me}from"./chunk-GIDGCFLX.js";import"./chunk-XBRBYCWJ.js";import"./chunk-3RK6DDJD.js";import"./chunk-FP4HFB5J.js";import"./chunk-H3OZSV6V.js";import"./chunk-YEDKRNXU.js";import"./chunk-VZEPVRCY.js";import"./chunk-7QWJJPNG.js";import"./chunk-VHAM2DWK.js";import{a as $}from"./chunk-R4CTK5NZ.js";import{c as re}from"./chunk-PGSKQYIL.js";import{b as ne}from"./chunk-QHBWVJIQ.js";import"./chunk-MSBIWISH.js";import"./chunk-T4OMGJF4.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import{e as oe,f as le}from"./chunk-QVTFZ7LA.js";import"./chunk-FSXDAB7C.js";import"./chunk-5JJSLRVS.js";import"./chunk-B6LPY2IZ.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import"./chunk-MFCXEITE.js";import"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import"./chunk-EJDRY7MH.js";import{b as ie}from"./chunk-DK44EJTX.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import"./chunk-H7F34T25.js";import"./chunk-JOXTERIM.js";import{N as ae}from"./chunk-TSIYPTYI.js";import{d as te}from"./chunk-XYB3YDKL.js";import"./chunk-7VKFVS7K.js";import"./chunk-ZVDY66SR.js";import{g as ee}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import"./chunk-VFTGIP5A.js";import"./chunk-LE3BKIDY.js";import"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import{F as X,h as K,o as z}from"./chunk-RVXZOIFQ.js";import"./chunk-FSTDHLYH.js";import"./chunk-WEGDL4GR.js";import{d as Z}from"./chunk-ZZGSAFGO.js";import"./chunk-346EL5B3.js";import{$a as o,Ac as M,Bc as W,Db as g,Eb as F,Fc as L,Gb as O,Hb as P,Ib as a,Jb as n,Kb as B,Nb as S,Ob as y,Qb as T,Rb as m,Rd as G,Td as J,Yd as Y,Zc as H,bd as q,db as I,dc as h,ec as p,ed as Q,fc as N,gc as c,gd as j,jc as C,jd as U,kb as V,kc as D,lc as b,na as v,ob as R,qb as d,qc as k,rc as A,uc as w,va as _,vb as s,wa as f,zc as x}from"./chunk-UXRO4UFY.js";import"./chunk-7DCB7DB2.js";var ce=(t,l,e,i)=>({title:"Materials",items:t,summary:l,manufacture:e,quantity:i}),se=(t,l,e,i)=>({title:"Expenses",items:t,summary:l,manufacture:e,quantity:i}),_e=(t,l,e,i)=>({title:"Outputs",items:t,summary:l,manufacture:e,quantity:i}),fe=()=>["/menu/Manufacture/Job_Order/Archive/Info"],ge=t=>({ID:t});function xe(t,l){if(t&1){let e=y();a(0,"button",17),T("click",function(){_(e);let r=m(2);return f(r.openExportModal())}),B(1,"i",18),p(2," Export "),n()}}function Ce(t,l){if(t&1&&(a(0,"div",15),d(1,xe,3,0,"button",16),n()),t&2){let e=m();o(),s("ngIf",e.role.global==null?null:e.role.global.Export)}}function De(t,l){if(t&1){let e=y();a(0,"div",19)(1,"h6"),p(2,"Outlet"),n(),a(3,"outlet-selector",20),b("ngModelChange",function(r){_(e);let u=m();return D(u.pageData.Filter.OutletId,r)||(u.pageData.Filter.OutletId=r),f(r)}),n(),a(4,"h6"),p(5,"From - To"),n(),a(6,"datepicker",21),b("dateChange",function(r){_(e);let u=m();return D(u.pageData.Filter.From,r)||(u.pageData.Filter.From=r),f(r)}),n(),a(7,"div",22)(8,"datepicker",23),b("dateChange",function(r){_(e);let u=m();return D(u.pageData.Filter.To,r)||(u.pageData.Filter.To=r),f(r)}),n()(),a(9,"h6"),p(10,"State"),n(),a(11,"ng-select",24),b("ngModelChange",function(r){_(e);let u=m();return D(u.pageData.Filter.State,r)||(u.pageData.Filter.State=r),f(r)}),n()()}if(t&2){let e=m();o(3),s("accessType",2),C("ngModel",e.pageData.Filter.OutletId),s("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),s("items",e.pageData.Options.States),C("ngModel",e.pageData.Filter.State)}}function be(t,l){t&1&&(a(0,"th",25),p(1,"@ Cost"),n(),a(2,"th",26),p(3,"Total"),n())}function Me(t,l){t&1&&S(0)}function Se(t,l){if(t&1&&(a(0,"div"),d(1,Me,1,0,"ng-container",27),n()),t&2){let e=m().$implicit;m();let i=h(28);o(),s("ngTemplateOutlet",i)("ngTemplateOutletContext",w(2,ce,e.MaterialItems,e.MaterialsSummary,e,e==null?null:e.MaterialsTotalQuantity))}}function ye(t,l){t&1&&S(0)}function Te(t,l){if(t&1&&(a(0,"div"),d(1,ye,1,0,"ng-container",27),n()),t&2){let e=m().$implicit;m();let i=h(28);o(),s("ngTemplateOutlet",i)("ngTemplateOutletContext",w(2,se,e.ExpenseItems,e.ExpensesSummary,e,e==null?null:e.ExpensesTotalQuantity))}}function he(t,l){t&1&&S(0)}function we(t,l){if(t&1&&(a(0,"div"),d(1,he,1,0,"ng-container",27),n()),t&2){let e=m().$implicit;m();let i=h(28);o(),s("ngTemplateOutlet",i)("ngTemplateOutletContext",w(2,_e,e.OutputItems,e.OutputsSummary,e,e==null?null:e.OutputsTotalQuantity))}}function Ee(t,l){if(t&1&&d(0,Se,2,7,"div")(1,Te,2,7,"div")(2,we,2,7,"div"),t&2){let e=l.$implicit;g((e==null||e.MaterialItems==null?null:e.MaterialItems.length)>0?0:-1),o(),g((e==null||e.ExpenseItems==null?null:e.ExpenseItems.length)>0?1:-1),o(),g((e==null||e.OutputItems==null?null:e.OutputItems.length)>0?2:-1)}}function ve(t,l){if(t&1&&(a(0,"div")(1,"a",39)(2,"span",40),p(3),n()(),a(4,"span"),p(5),x(6,"date"),n()()),t&2){let e=m().manufacture;o(),s("routerLink",k(7,fe))("queryParams",A(8,ge,e.ID)),o(2),c(" ",e.OutletName+" # "+e.Number,""),o(2),c(" "," - "+W(6,4,e.Date,"dd MMM yyyy")," ")}}function Ie(t,l){if(t&1&&(a(0,"div",31),p(1),n()),t&2){let e=m().manufacture;o(),c(" ",e.State," ")}}function Fe(t,l){if(t&1&&(a(0,"td",45),p(1),x(2,"number"),n(),a(3,"td",46),p(4),x(5,"number"),n()),t&2){let e=m().$implicit;o(),c(" ",M(2,2,e.UnitCost)," "),o(3),c(" ",M(5,4,e.UnitCost*e.Quantity)," ")}}function Oe(t,l){if(t&1&&(a(0,"tr",34)(1,"td",41),p(2),n(),a(3,"td",42),p(4),n(),a(5,"td",43),p(6),x(7,"number"),n(),a(8,"td",44),p(9),n(),d(10,Fe,6,6),n()),t&2){let e=l.$implicit,i=m(2);o(2),N(e.Name),o(2),c(" ",e.Code," "),o(2),c(" ",M(7,5,e.Quantity)," "),o(3),c(" ",e.UOM," "),o(),g(i.role.product.Cost?10:-1)}}function Pe(t,l){if(t&1&&(a(0,"td",38)(1,"span",47),p(2),n(),a(3,"span"),p(4),x(5,"number"),n()()),t&2){let e=m().summary;o(2),c(" ",e==null?null:e.CurrencySymbol," "),o(2),c(" ",M(5,2,e==null?null:e.Amount)," ")}}function Le(t,l){if(t&1&&(a(0,"div",28)(1,"div",29),d(2,ve,7,10,"div"),a(3,"div")(4,"strong",30),p(5),n()()(),d(6,Ie,2,1,"div",31),n(),a(7,"table",32)(8,"tbody",33),O(9,Oe,11,7,"tr",34,F),n(),a(11,"tfoot")(12,"tr",35)(13,"td",36),p(14,"Total :"),n(),a(15,"td",37),p(16),x(17,"number"),n(),d(18,Pe,6,4,"td",38),n()()()),t&2){let e=l.title,i=l.items,r=l.quantity,u=m();o(2),g(e=="Materials"?2:-1),o(3),c(" ",e," "),o(),g(e=="Materials"?6:-1),o(3),P(i),o(7),c(" ",M(17,5,r)," "),o(2),g(u.role.product.Cost?18:-1)}}var de=class t extends ${role=v(Z);dialog=v(ee);constructor(l,e){super(l,e,"Manufacture/ReportDetail","ManufactureLoader/ReportDetail",null,null,!0)}openExportModal(){this.dialog.open(ne,{data:{title:"Manufacture Detail",exportTypes:[{ID:"ManufactureExport/ReportDetail",Value:"Default",FileName:"Manufacture Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Manufacture/ReportDetailCount",pagination:!0}})}static \u0275fac=function(e){return new(e||t)(I(ie),I(Y))};static \u0275cmp=V({type:t,selectors:[["app-manufacture-detail"]],features:[R],decls:29,vars:12,consts:[["pageFilterTemplate",""],["CHILD_TABLE",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn-group",4,"ngIf"],["filters",""],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],["colspan","6",1,"px-0",2,"border-bottom-width","0px !important"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[1,"btn-group"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose State",3,"ngModelChange","items","ngModel"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-columnmb-5","ps-1"],[1,"text-danger"],[1,"mt-5","mb-5","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table-footer"],["colspan","2",1,"text-end","fw-bold"],[1,"text-end","fw-bold","pe-3"],["colspan","3",1,"text-end","fw-bold","pe-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[2,"width","620px"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"border-start","border-end","text-end",2,"width","30px"],[1,"border-start","border-end",2,"width","40px"],[1,"text-end","border-start","border-end",2,"width","80px"],[1,"text-end","border-start","border-end",2,"width","90px"],[1,"me-4"]],template:function(e,i){if(e&1){let r=y();a(0,"mainpanel-cmp",2),T("onSubmit",function(){return _(r),f(i.searchFromPageOne())}),b("filterChange",function(E){return _(r),D(i.pageData.Filter,E)||(i.pageData.Filter=E),f(E)}),a(1,"actions"),d(2,Ce,2,1,"div",3),n(),a(3,"div",4),d(4,De,12,7,"ng-template",null,0,L),n(),a(6,"content")(7,"div",5)(8,"div",6)(9,"table",7)(10,"thead",8)(11,"tr")(12,"th",9),p(13,"Name"),n(),a(14,"th",10),p(15,"Code"),n(),a(16,"th",11),p(17,"Qty"),n(),a(18,"th",12),p(19,"UOM"),n(),d(20,be,4,0),n()(),a(21,"tbody")(22,"tr")(23,"td",13),O(24,Ee,3,3,null,null,F),n()()()(),a(26,"infinite-pagination",14),T("nextPage",function(){return _(r),f(i.NextPage(!0))})("fetchTotalData",function(){return _(r),f(i.StoreRowsCountAPIResult("Manufacture/ReportDetailCount"))})("concatAllData",function(){return _(r),f(i.StoreRowsCountAPIResult("Manufacture/ReportDetailCount",!0))}),n()()(),d(27,Le,19,7,"ng-template",null,1,L),n()()}e&2&&(s("pageData",i.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",i.pageData.Filter),o(2),s("ngIf",i.role.global==null?null:i.role.global.Export),o(18),g(i.role.product.Cost?20:-1),o(4),P(i.infiniteList),o(2),s("totalData",i.listTotal)("totalCurrentRow",i.infiniteList==null?null:i.infiniteList.length)("pageNumber",i.pageData.Filter.PageNumber)("nextPageDisabled",i.nextPageDisabled)("isFetchTotalData",i.pageData.HideStoreApiCount)("goToLast",i.goToLast))},dependencies:[U,H,q,j,Q,le,oe,re,X,K,z,me,pe,te,J,G,ue,ae],encapsulation:2})};export{de as ManufactureDetailComponent};
1
+ import{a as ue}from"./chunk-TAVO3B4U.js";import{d as pe,e as me}from"./chunk-GIDGCFLX.js";import"./chunk-XBRBYCWJ.js";import"./chunk-3RK6DDJD.js";import"./chunk-FP4HFB5J.js";import"./chunk-H3OZSV6V.js";import"./chunk-YEDKRNXU.js";import"./chunk-VZEPVRCY.js";import"./chunk-7QWJJPNG.js";import"./chunk-VHAM2DWK.js";import{a as $}from"./chunk-CVI22GXH.js";import{c as re}from"./chunk-6W6BB6FZ.js";import{b as ne}from"./chunk-QHBWVJIQ.js";import"./chunk-IQBTWGJY.js";import"./chunk-75SMG4SF.js";import"./chunk-6JAL37Y4.js";import"./chunk-4QQTEPQT.js";import{e as oe,f as le}from"./chunk-EFKIYD2S.js";import"./chunk-ITGJPMDT.js";import"./chunk-5JJSLRVS.js";import"./chunk-B6LPY2IZ.js";import"./chunk-QHRP323Q.js";import"./chunk-WDQ4UKKY.js";import"./chunk-MFCXEITE.js";import"./chunk-MUJ6277G.js";import"./chunk-LMJVRREP.js";import"./chunk-3LBZDIW2.js";import"./chunk-KTCV3KOE.js";import"./chunk-KZDE63UL.js";import"./chunk-JGK2MYOQ.js";import{b as ie}from"./chunk-WZS6HHV3.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import"./chunk-H7F34T25.js";import"./chunk-JOXTERIM.js";import{N as ae}from"./chunk-TSIYPTYI.js";import{d as te}from"./chunk-XYB3YDKL.js";import"./chunk-7VKFVS7K.js";import"./chunk-ZVDY66SR.js";import{g as ee}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import"./chunk-VFTGIP5A.js";import"./chunk-LE3BKIDY.js";import"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import{F as X,h as K,o as z}from"./chunk-RVXZOIFQ.js";import"./chunk-SH2AVVL5.js";import"./chunk-UCJKQICE.js";import{d as Z}from"./chunk-ZZGSAFGO.js";import"./chunk-SEGFXGKG.js";import{$a as o,Ac as M,Bc as W,Db as g,Eb as F,Fc as L,Gb as O,Hb as P,Ib as a,Jb as n,Kb as B,Nb as S,Ob as y,Qb as T,Rb as m,Rd as G,Td as J,Yd as Y,Zc as H,bd as q,db as I,dc as h,ec as p,ed as Q,fc as N,gc as c,gd as j,jc as C,jd as U,kb as V,kc as D,lc as b,na as v,ob as R,qb as d,qc as k,rc as A,uc as w,va as _,vb as s,wa as f,zc as x}from"./chunk-UXRO4UFY.js";import"./chunk-7DCB7DB2.js";var ce=(t,l,e,i)=>({title:"Materials",items:t,summary:l,manufacture:e,quantity:i}),se=(t,l,e,i)=>({title:"Expenses",items:t,summary:l,manufacture:e,quantity:i}),_e=(t,l,e,i)=>({title:"Outputs",items:t,summary:l,manufacture:e,quantity:i}),fe=()=>["/menu/Manufacture/Job_Order/Archive/Info"],ge=t=>({ID:t});function xe(t,l){if(t&1){let e=y();a(0,"button",17),T("click",function(){_(e);let r=m(2);return f(r.openExportModal())}),B(1,"i",18),p(2," Export "),n()}}function Ce(t,l){if(t&1&&(a(0,"div",15),d(1,xe,3,0,"button",16),n()),t&2){let e=m();o(),s("ngIf",e.role.global==null?null:e.role.global.Export)}}function De(t,l){if(t&1){let e=y();a(0,"div",19)(1,"h6"),p(2,"Outlet"),n(),a(3,"outlet-selector",20),b("ngModelChange",function(r){_(e);let u=m();return D(u.pageData.Filter.OutletId,r)||(u.pageData.Filter.OutletId=r),f(r)}),n(),a(4,"h6"),p(5,"From - To"),n(),a(6,"datepicker",21),b("dateChange",function(r){_(e);let u=m();return D(u.pageData.Filter.From,r)||(u.pageData.Filter.From=r),f(r)}),n(),a(7,"div",22)(8,"datepicker",23),b("dateChange",function(r){_(e);let u=m();return D(u.pageData.Filter.To,r)||(u.pageData.Filter.To=r),f(r)}),n()(),a(9,"h6"),p(10,"State"),n(),a(11,"ng-select",24),b("ngModelChange",function(r){_(e);let u=m();return D(u.pageData.Filter.State,r)||(u.pageData.Filter.State=r),f(r)}),n()()}if(t&2){let e=m();o(3),s("accessType",2),C("ngModel",e.pageData.Filter.OutletId),s("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),C("date",e.pageData.Filter.From),o(2),C("date",e.pageData.Filter.To),o(3),s("items",e.pageData.Options.States),C("ngModel",e.pageData.Filter.State)}}function be(t,l){t&1&&(a(0,"th",25),p(1,"@ Cost"),n(),a(2,"th",26),p(3,"Total"),n())}function Me(t,l){t&1&&S(0)}function Se(t,l){if(t&1&&(a(0,"div"),d(1,Me,1,0,"ng-container",27),n()),t&2){let e=m().$implicit;m();let i=h(28);o(),s("ngTemplateOutlet",i)("ngTemplateOutletContext",w(2,ce,e.MaterialItems,e.MaterialsSummary,e,e==null?null:e.MaterialsTotalQuantity))}}function ye(t,l){t&1&&S(0)}function Te(t,l){if(t&1&&(a(0,"div"),d(1,ye,1,0,"ng-container",27),n()),t&2){let e=m().$implicit;m();let i=h(28);o(),s("ngTemplateOutlet",i)("ngTemplateOutletContext",w(2,se,e.ExpenseItems,e.ExpensesSummary,e,e==null?null:e.ExpensesTotalQuantity))}}function he(t,l){t&1&&S(0)}function we(t,l){if(t&1&&(a(0,"div"),d(1,he,1,0,"ng-container",27),n()),t&2){let e=m().$implicit;m();let i=h(28);o(),s("ngTemplateOutlet",i)("ngTemplateOutletContext",w(2,_e,e.OutputItems,e.OutputsSummary,e,e==null?null:e.OutputsTotalQuantity))}}function Ee(t,l){if(t&1&&d(0,Se,2,7,"div")(1,Te,2,7,"div")(2,we,2,7,"div"),t&2){let e=l.$implicit;g((e==null||e.MaterialItems==null?null:e.MaterialItems.length)>0?0:-1),o(),g((e==null||e.ExpenseItems==null?null:e.ExpenseItems.length)>0?1:-1),o(),g((e==null||e.OutputItems==null?null:e.OutputItems.length)>0?2:-1)}}function ve(t,l){if(t&1&&(a(0,"div")(1,"a",39)(2,"span",40),p(3),n()(),a(4,"span"),p(5),x(6,"date"),n()()),t&2){let e=m().manufacture;o(),s("routerLink",k(7,fe))("queryParams",A(8,ge,e.ID)),o(2),c(" ",e.OutletName+" # "+e.Number,""),o(2),c(" "," - "+W(6,4,e.Date,"dd MMM yyyy")," ")}}function Ie(t,l){if(t&1&&(a(0,"div",31),p(1),n()),t&2){let e=m().manufacture;o(),c(" ",e.State," ")}}function Fe(t,l){if(t&1&&(a(0,"td",45),p(1),x(2,"number"),n(),a(3,"td",46),p(4),x(5,"number"),n()),t&2){let e=m().$implicit;o(),c(" ",M(2,2,e.UnitCost)," "),o(3),c(" ",M(5,4,e.UnitCost*e.Quantity)," ")}}function Oe(t,l){if(t&1&&(a(0,"tr",34)(1,"td",41),p(2),n(),a(3,"td",42),p(4),n(),a(5,"td",43),p(6),x(7,"number"),n(),a(8,"td",44),p(9),n(),d(10,Fe,6,6),n()),t&2){let e=l.$implicit,i=m(2);o(2),N(e.Name),o(2),c(" ",e.Code," "),o(2),c(" ",M(7,5,e.Quantity)," "),o(3),c(" ",e.UOM," "),o(),g(i.role.product.Cost?10:-1)}}function Pe(t,l){if(t&1&&(a(0,"td",38)(1,"span",47),p(2),n(),a(3,"span"),p(4),x(5,"number"),n()()),t&2){let e=m().summary;o(2),c(" ",e==null?null:e.CurrencySymbol," "),o(2),c(" ",M(5,2,e==null?null:e.Amount)," ")}}function Le(t,l){if(t&1&&(a(0,"div",28)(1,"div",29),d(2,ve,7,10,"div"),a(3,"div")(4,"strong",30),p(5),n()()(),d(6,Ie,2,1,"div",31),n(),a(7,"table",32)(8,"tbody",33),O(9,Oe,11,7,"tr",34,F),n(),a(11,"tfoot")(12,"tr",35)(13,"td",36),p(14,"Total :"),n(),a(15,"td",37),p(16),x(17,"number"),n(),d(18,Pe,6,4,"td",38),n()()()),t&2){let e=l.title,i=l.items,r=l.quantity,u=m();o(2),g(e=="Materials"?2:-1),o(3),c(" ",e," "),o(),g(e=="Materials"?6:-1),o(3),P(i),o(7),c(" ",M(17,5,r)," "),o(2),g(u.role.product.Cost?18:-1)}}var de=class t extends ${role=v(Z);dialog=v(ee);constructor(l,e){super(l,e,"Manufacture/ReportDetail","ManufactureLoader/ReportDetail",null,null,!0)}openExportModal(){this.dialog.open(ne,{data:{title:"Manufacture Detail",exportTypes:[{ID:"ManufactureExport/ReportDetail",Value:"Default",FileName:"Manufacture Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Manufacture/ReportDetailCount",pagination:!0}})}static \u0275fac=function(e){return new(e||t)(I(ie),I(Y))};static \u0275cmp=V({type:t,selectors:[["app-manufacture-detail"]],features:[R],decls:29,vars:12,consts:[["pageFilterTemplate",""],["CHILD_TABLE",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],["class","btn-group",4,"ngIf"],["filters",""],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],["colspan","6",1,"px-0",2,"border-bottom-width","0px !important"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[1,"btn-group"],["class","btn btn-outline-secondary",3,"click",4,"ngIf"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose State",3,"ngModelChange","items","ngModel"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-columnmb-5","ps-1"],[1,"text-danger"],[1,"mt-5","mb-5","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table-footer"],["colspan","2",1,"text-end","fw-bold"],[1,"text-end","fw-bold","pe-3"],["colspan","3",1,"text-end","fw-bold","pe-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[2,"width","620px"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"border-start","border-end","text-end",2,"width","30px"],[1,"border-start","border-end",2,"width","40px"],[1,"text-end","border-start","border-end",2,"width","80px"],[1,"text-end","border-start","border-end",2,"width","90px"],[1,"me-4"]],template:function(e,i){if(e&1){let r=y();a(0,"mainpanel-cmp",2),T("onSubmit",function(){return _(r),f(i.searchFromPageOne())}),b("filterChange",function(E){return _(r),D(i.pageData.Filter,E)||(i.pageData.Filter=E),f(E)}),a(1,"actions"),d(2,Ce,2,1,"div",3),n(),a(3,"div",4),d(4,De,12,7,"ng-template",null,0,L),n(),a(6,"content")(7,"div",5)(8,"div",6)(9,"table",7)(10,"thead",8)(11,"tr")(12,"th",9),p(13,"Name"),n(),a(14,"th",10),p(15,"Code"),n(),a(16,"th",11),p(17,"Qty"),n(),a(18,"th",12),p(19,"UOM"),n(),d(20,be,4,0),n()(),a(21,"tbody")(22,"tr")(23,"td",13),O(24,Ee,3,3,null,null,F),n()()()(),a(26,"infinite-pagination",14),T("nextPage",function(){return _(r),f(i.NextPage(!0))})("fetchTotalData",function(){return _(r),f(i.StoreRowsCountAPIResult("Manufacture/ReportDetailCount"))})("concatAllData",function(){return _(r),f(i.StoreRowsCountAPIResult("Manufacture/ReportDetailCount",!0))}),n()()(),d(27,Le,19,7,"ng-template",null,1,L),n()()}e&2&&(s("pageData",i.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),C("filter",i.pageData.Filter),o(2),s("ngIf",i.role.global==null?null:i.role.global.Export),o(18),g(i.role.product.Cost?20:-1),o(4),P(i.infiniteList),o(2),s("totalData",i.listTotal)("totalCurrentRow",i.infiniteList==null?null:i.infiniteList.length)("pageNumber",i.pageData.Filter.PageNumber)("nextPageDisabled",i.nextPageDisabled)("isFetchTotalData",i.pageData.HideStoreApiCount)("goToLast",i.goToLast))},dependencies:[U,H,q,j,Q,le,oe,re,X,K,z,me,pe,te,J,G,ue,ae],encapsulation:2})};export{de as ManufactureDetailComponent};
@@ -1 +1 @@
1
- import{c as U,d as W}from"./chunk-3XR3MVQE.js";import{a as X,b as Y}from"./chunk-6JAL37Y4.js";import{b as K,c as Q}from"./chunk-JOXTERIM.js";import{a as A}from"./chunk-7VKFVS7K.js";import{la as J}from"./chunk-EEEAUYZ6.js";import{F as G,h as B,o as q}from"./chunk-RVXZOIFQ.js";import{a as C}from"./chunk-ZZGSAFGO.js";import{$a as _,Ac as k,Db as H,Fa as M,Fc as F,Ib as c,Jb as m,Nb as L,Ob as V,Qb as j,Rb as n,Y as S,Yd as d,bd as N,ca as h,cd as P,d as x,db as b,dc as I,ec as v,fa as T,ga as u,gc as E,ja as w,jd as z,kb as $,ma as O,na as D,o as f,qb as a,va as p,vb as l,wa as g,zc as R}from"./chunk-UXRO4UFY.js";var y=class o{signalRClient=D(A);continuedCategories$;allCategories$;_onOpenTreeSelector=new x;onOpenTreeSelector$=this._onOpenTreeSelector.asObservable();constructor(t){this.continuedCategories$=this.onOpenTreeSelector$.pipe(u(this.signalRClient.recacheCategory$),h((e,[i,r])=>r||!e.length?(this.signalRClient.resetCategoryCache(),t.post("/api/catalog/product/GetProductStorageOptions")):f(e),[]),S(1)),this.allCategories$=this.onOpenTreeSelector$.pipe(u(this.signalRClient.recacheCategory$),h((e,[i,r])=>r||!e.length?t.get("/API/catalog/category/SelectOptions"):f(e),[]),S(1))}onOpenTreeSelector(){this._onOpenTreeSelector.next(!0)}forceLoadCategories(){this._onOpenTreeSelector.next(!0)}static \u0275fac=function(e){return new(e||o)(O(d))};static \u0275prov=w({token:o,factory:o.\u0275fac,providedIn:"root"})};function ie(o,t){o&1&&L(0)}function re(o,t){if(o&1&&(c(0,"p-floatLabel",1),a(1,ie,1,0,"ng-container",2),c(2,"label",3),v(3,"Category"),m()()),o&2){n();let e=I(3);_(),l("ngTemplateOutlet",e)}}function ne(o,t){o&1&&L(0)}function ae(o,t){if(o&1&&a(0,ne,1,0,"ng-container",2),o&2){n();let e=I(3);l("ngTemplateOutlet",e)}}function le(o,t){if(o&1&&(c(0,"div",6),v(1),m()),o&2){let e=n(2);l("matTooltip",e.selectedCategoryLabel),_(),E(" ",e.selectedCategoryLabel," ")}}function ce(o,t){if(o&1){let e=V();c(0,"p-treeSelect",4),R(1,"async"),j("click",function(){p(e);let r=n();return g(r.loadCategories())})("ngModelChange",function(r){p(e);let s=n();return g(s.onSelectCategory(r))})("onClear",function(){p(e);let r=n();return g(r.onClear())}),a(2,le,2,2,"ng-template",5),m()}if(o&2){let e=n();l("options",k(1,3,e.categories$))("ngModel",e.selectedCategory)("showClear",e.showClear)}}var Z=class o{constructor(t,e){this.http=t;this.treeSelector=e}continuedCategoriesOnly=!0;categories=[];showClear=!1;showLabel=!1;isInitializedCategoryLabel=!1;selectedCategory;selectedCategoryID;selectedCategoryIDChange=new M;selectedCategoryLabel;top=0;isLoadCategories=!1;categories$;ngAfterViewInit(){let t=document.querySelector("body");this.top=t.getBoundingClientRect().top*-1}ngOnInit(){this.isInitializedCategoryLabel&&(C.IsEmpty(this.selectedCategoryID)&&C.IsNotEmpty(this.categories)&&(this.selectedCategoryID=this.categories[0]?.key),this.selectedCategory=this.findSelectedCategory(this.categories,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)),this.categories$=this.continuedCategoriesOnly?this.treeSelector.continuedCategories$:this.treeSelector.allCategories$,this.categories$=this.categories$.pipe(T(t=>{this.selectedCategory=this.findSelectedCategory(t,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)}))}onSelectCategory(t){this.selectedCategory=t,this.generateLabelSelectedCategory(this.selectedCategory),this.selectedCategoryID=t?.key,this.selectedCategoryIDChange.emit(this.selectedCategoryID)}generateLabelSelectedCategory(t){if(t){let e=[];this.selectedCategoryLabel="";do e=[...e,t.label],t=t.parent;while(t!==void 0);this.selectedCategoryLabel=e.reverse().join("/")}else this.selectedCategoryLabel="Select Storage Location"}findSelectedCategory(t,e){if(C.IsNotEmpty(e))for(let i of t){if(i.key===e)return i;{i.children=i.children?i.children:[],i.children=i.children.map(s=>(s.parent=i,s));let r=this.findSelectedCategory(i.children,e);if(r)return r}}else return null}loadCategories(){this.treeSelector.onOpenTreeSelector()}onClear(){this.selectedCategoryID=null,this.selectedCategoryIDChange.emit(this.selectedCategoryID)}static \u0275fac=function(e){return new(e||o)(b(d),b(y))};static \u0275cmp=$({type:o,selectors:[["POS-storage-location-select"]],inputs:{continuedCategoriesOnly:"continuedCategoriesOnly",categories:"categories",showClear:"showClear",showLabel:"showLabel",isInitializedCategoryLabel:"isInitializedCategoryLabel",selectedCategoryID:"selectedCategoryID"},outputs:{selectedCategoryIDChange:"selectedCategoryIDChange"},decls:4,vars:1,consts:[["categorySelectTemplate",""],["variant","on",1,"w-100"],[4,"ngTemplateOutlet"],["for","selectCategory",1,"tree-category-label"],["appendTo","body","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","inputId","selectCategory","placeholder","Select Storage Location",3,"click","ngModelChange","onClear","options","ngModel","showClear"],["pTemplate","value"],["matTooltipPosition","above",3,"matTooltip"]],template:function(e,i){e&1&&a(0,re,4,1,"p-floatLabel",1)(1,ae,1,1,"ng-container")(2,ce,3,5,"ng-template",null,0,F),e&2&&H(i.showLabel?0:1)},dependencies:[z,N,P,Q,K,W,U,J,G,B,q,Y,X],styles:[".p-popover.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important} .p-float-label .p-inputwrapper-filled~label.tree-category-label{left:.5rem!important}"]})};export{Z as a};
1
+ import{c as U,d as W}from"./chunk-G2MU6LQ2.js";import{a as X,b as Y}from"./chunk-6JAL37Y4.js";import{b as K,c as Q}from"./chunk-JOXTERIM.js";import{a as A}from"./chunk-7VKFVS7K.js";import{la as J}from"./chunk-EEEAUYZ6.js";import{F as G,h as B,o as q}from"./chunk-RVXZOIFQ.js";import{a as C}from"./chunk-ZZGSAFGO.js";import{$a as _,Ac as k,Db as H,Fa as M,Fc as F,Ib as c,Jb as m,Nb as L,Ob as V,Qb as j,Rb as n,Y as S,Yd as d,bd as N,ca as h,cd as P,d as x,db as b,dc as I,ec as v,fa as T,ga as u,gc as E,ja as w,jd as z,kb as $,ma as O,na as D,o as f,qb as a,va as p,vb as l,wa as g,zc as R}from"./chunk-UXRO4UFY.js";var y=class o{signalRClient=D(A);continuedCategories$;allCategories$;_onOpenTreeSelector=new x;onOpenTreeSelector$=this._onOpenTreeSelector.asObservable();constructor(t){this.continuedCategories$=this.onOpenTreeSelector$.pipe(u(this.signalRClient.recacheCategory$),h((e,[i,r])=>r||!e.length?(this.signalRClient.resetCategoryCache(),t.post("/api/catalog/product/GetProductStorageOptions")):f(e),[]),S(1)),this.allCategories$=this.onOpenTreeSelector$.pipe(u(this.signalRClient.recacheCategory$),h((e,[i,r])=>r||!e.length?t.get("/API/catalog/category/SelectOptions"):f(e),[]),S(1))}onOpenTreeSelector(){this._onOpenTreeSelector.next(!0)}forceLoadCategories(){this._onOpenTreeSelector.next(!0)}static \u0275fac=function(e){return new(e||o)(O(d))};static \u0275prov=w({token:o,factory:o.\u0275fac,providedIn:"root"})};function ie(o,t){o&1&&L(0)}function re(o,t){if(o&1&&(c(0,"p-floatLabel",1),a(1,ie,1,0,"ng-container",2),c(2,"label",3),v(3,"Category"),m()()),o&2){n();let e=I(3);_(),l("ngTemplateOutlet",e)}}function ne(o,t){o&1&&L(0)}function ae(o,t){if(o&1&&a(0,ne,1,0,"ng-container",2),o&2){n();let e=I(3);l("ngTemplateOutlet",e)}}function le(o,t){if(o&1&&(c(0,"div",6),v(1),m()),o&2){let e=n(2);l("matTooltip",e.selectedCategoryLabel),_(),E(" ",e.selectedCategoryLabel," ")}}function ce(o,t){if(o&1){let e=V();c(0,"p-treeSelect",4),R(1,"async"),j("click",function(){p(e);let r=n();return g(r.loadCategories())})("ngModelChange",function(r){p(e);let s=n();return g(s.onSelectCategory(r))})("onClear",function(){p(e);let r=n();return g(r.onClear())}),a(2,le,2,2,"ng-template",5),m()}if(o&2){let e=n();l("options",k(1,3,e.categories$))("ngModel",e.selectedCategory)("showClear",e.showClear)}}var Z=class o{constructor(t,e){this.http=t;this.treeSelector=e}continuedCategoriesOnly=!0;categories=[];showClear=!1;showLabel=!1;isInitializedCategoryLabel=!1;selectedCategory;selectedCategoryID;selectedCategoryIDChange=new M;selectedCategoryLabel;top=0;isLoadCategories=!1;categories$;ngAfterViewInit(){let t=document.querySelector("body");this.top=t.getBoundingClientRect().top*-1}ngOnInit(){this.isInitializedCategoryLabel&&(C.IsEmpty(this.selectedCategoryID)&&C.IsNotEmpty(this.categories)&&(this.selectedCategoryID=this.categories[0]?.key),this.selectedCategory=this.findSelectedCategory(this.categories,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)),this.categories$=this.continuedCategoriesOnly?this.treeSelector.continuedCategories$:this.treeSelector.allCategories$,this.categories$=this.categories$.pipe(T(t=>{this.selectedCategory=this.findSelectedCategory(t,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)}))}onSelectCategory(t){this.selectedCategory=t,this.generateLabelSelectedCategory(this.selectedCategory),this.selectedCategoryID=t?.key,this.selectedCategoryIDChange.emit(this.selectedCategoryID)}generateLabelSelectedCategory(t){if(t){let e=[];this.selectedCategoryLabel="";do e=[...e,t.label],t=t.parent;while(t!==void 0);this.selectedCategoryLabel=e.reverse().join("/")}else this.selectedCategoryLabel="Select Storage Location"}findSelectedCategory(t,e){if(C.IsNotEmpty(e))for(let i of t){if(i.key===e)return i;{i.children=i.children?i.children:[],i.children=i.children.map(s=>(s.parent=i,s));let r=this.findSelectedCategory(i.children,e);if(r)return r}}else return null}loadCategories(){this.treeSelector.onOpenTreeSelector()}onClear(){this.selectedCategoryID=null,this.selectedCategoryIDChange.emit(this.selectedCategoryID)}static \u0275fac=function(e){return new(e||o)(b(d),b(y))};static \u0275cmp=$({type:o,selectors:[["POS-storage-location-select"]],inputs:{continuedCategoriesOnly:"continuedCategoriesOnly",categories:"categories",showClear:"showClear",showLabel:"showLabel",isInitializedCategoryLabel:"isInitializedCategoryLabel",selectedCategoryID:"selectedCategoryID"},outputs:{selectedCategoryIDChange:"selectedCategoryIDChange"},decls:4,vars:1,consts:[["categorySelectTemplate",""],["variant","on",1,"w-100"],[4,"ngTemplateOutlet"],["for","selectCategory",1,"tree-category-label"],["appendTo","body","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","inputId","selectCategory","placeholder","Select Storage Location",3,"click","ngModelChange","onClear","options","ngModel","showClear"],["pTemplate","value"],["matTooltipPosition","above",3,"matTooltip"]],template:function(e,i){e&1&&a(0,re,4,1,"p-floatLabel",1)(1,ae,1,1,"ng-container")(2,ce,3,5,"ng-template",null,0,F),e&2&&H(i.showLabel?0:1)},dependencies:[z,N,P,Q,K,W,U,J,G,B,q,Y,X],styles:[".p-popover.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important} .p-float-label .p-inputwrapper-filled~label.tree-category-label{left:.5rem!important}"]})};export{Z as a};
@@ -1 +1 @@
1
- import{a as ge}from"./chunk-CSQD5JSK.js";import{a as ve}from"./chunk-N4FKAPLW.js";import{a as Ce}from"./chunk-M3HHWYKD.js";import"./chunk-BYXBJQAS.js";import{e as ce,f as fe}from"./chunk-QVTFZ7LA.js";import"./chunk-EJDRY7MH.js";import{b as se}from"./chunk-DK44EJTX.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import{u as pe,v as me,w as ue}from"./chunk-H7F34T25.js";import"./chunk-JOXTERIM.js";import{O as F}from"./chunk-TSIYPTYI.js";import{e as ae,f as le,g as de}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import"./chunk-LE3BKIDY.js";import"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import{E as oe,F as te,G as ne,c as J,e as b,h as Y,i as X,p as Q,t as Z,w as ee}from"./chunk-RVXZOIFQ.js";import"./chunk-FSTDHLYH.js";import"./chunk-WEGDL4GR.js";import{a as w,d as re}from"./chunk-ZZGSAFGO.js";import"./chunk-346EL5B3.js";import{$a as l,Db as C,E as N,Eb as A,Fc as q,Gb as O,Hb as U,Ib as i,Jb as r,Kb as s,Ma as V,Nb as H,Ob as x,Od as W,Pc as K,Qb as v,Rb as f,Vd as z,Wc as R,Yd as ie,Zc as L,bd as B,db as c,dc as $,ec as a,fc as G,gc as T,jd as M,kb as E,na as h,ob as D,qb as m,rc as _,sc as j,t as k,va as y,vb as p,wa as P}from"./chunk-UXRO4UFY.js";import"./chunk-7DCB7DB2.js";var I=n=>({"is-invalid":n});function Pe(n,d){n&1&&(i(0,"div",16),a(1," Provider Name is required "),r())}function Ee(n,d){n&1&&(i(0,"div",20),a(1," Validate Coupon URL is required "),r())}function xe(n,d){n&1&&(i(0,"div",20),a(1," Redeem Coupon URL is required "),r())}function Ge(n,d){n&1&&(i(0,"div",20),a(1,"Key is required"),r())}var S=class n{constructor(d){this.data=d;this.config=new pe,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}dialogRef=h(ae);config;fb=h(oe);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[b.required]],validateCoupon:[this.data?.validateCoupon||"",[b.required]],redeemCoupon:[this.data?.redeemCoupon||"",[b.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[b.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||n)(c(le))};static \u0275cmp=E({type:n,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(i(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"input",9),i(11,"label",10),a(12,"Coupon Provider"),r()()(),i(13,"div",11)(14,"div",12)(15,"div",13),s(16,"app-customize-toggle",14),r(),i(17,"label",15),a(18,"Enabled"),r()()()(),m(19,Pe,2,0,"div",16),r(),i(20,"div",17),s(21,"input",18),i(22,"label",19),a(23,"Validate Coupon URL"),r(),m(24,Ee,2,0,"div",20),r(),i(25,"div",17),s(26,"input",21),i(27,"label",22),a(28,"Redeem Coupon URL"),r(),m(29,xe,2,0,"div",20),r(),i(30,"div",23),s(31,"textarea",24),i(32,"label",25),a(33,"Request Header (Key: value)"),r(),m(34,Ge,2,0,"div",20),r()()()()()()()),e&2&&(p("config",o.config),l(5),p("formGroup",o.formGroup),l(5),p("ngClass",_(10,I,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),C(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),p("ngClass",_(12,I,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),C(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),p("ngClass",_(14,I,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),C(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),p("ngClass",_(16,I,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),C(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,ne,Q,J,Y,X,Z,ee,ue,me,ge],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var Re=(n,d)=>({"bg-success-subtle text-success-emphasis":n,"bg-danger-subtle text-danger-emphasis":d});function Me(n,d){if(n&1){let e=x();i(0,"button",10),v("click",function(){y(e);let t=f();return P(t.addNewCouponProvider())}),a(1," Add "),r()}}function Ie(n,d){n&1&&s(0,"th",11)}function Ne(n,d){if(n&1){let e=x();i(0,"td",15)(1,"i",16),v("click",function(){y(e);let t=f().$index,u=f(2);return P(u.onDeleteProvider(t))}),r()()}}function Te(n,d){if(n&1){let e=x();i(0,"tr"),m(1,Ne,2,0,"td",12),i(2,"td")(3,"a",13),v("click",function(){let t=y(e),u=t.$implicit,g=t.$index,_e=f(2);return P(_e.onUpdateProvider(u,g))}),a(4),r()(),i(5,"td"),a(6),r(),i(7,"td"),a(8),r(),i(9,"td"),a(10),r(),i(11,"td")(12,"span",14),a(13),r()()()}if(n&2){let e=d.$implicit,o=f(2);l(),p("ngIf",o.role.developer.Edit),l(3),T(" ",e.Name," "),l(2),G(e.ValidateCoupon),l(2),G(e.RedeemCoupon),l(2),G(e.KeyUI),l(2),p("ngClass",j(7,Re,e.Enabled,!e.Enabled)),l(),T(" ",e.Enabled?"Enabled":"Disabled"," ")}}function we(n,d){if(n&1&&O(0,Te,14,10,"tr",null,A),n&2){let e=f();U(e.listProviders())}}function Fe(n,d){n&1&&H(0)}function ke(n,d){if(n&1&&m(0,Fe,1,0,"ng-container",17),n&2){f();let e=$(25);p("ngTemplateOutlet",e)}}function Ve(n,d){n&1&&(i(0,"tr",18)(1,"td",19),s(2,"empty-state-table"),r()())}var he=class n extends ve{constructor(e,o,t,u,g){super(e,o,F.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=u;this.dialog=g}toastr=h(z);couponProviders=V([]);listProviders=K(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(S).afterClosed().pipe(N(e=>w.IsNotEmpty(e)),k(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(S,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(N(t=>w.IsNotEmpty(t))).subscribe(t=>{let u={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(g=>(g[o]=u,[...g])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(F.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||n)(c(se),c(ie),c(W),c(re),c(de))};static \u0275cmp=E({type:n,selectors:[["app-coupon-configuration"]],features:[D],decls:26,vars:6,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button","class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],["class","text-center","style","width: 10px",4,"ngIf"],[2,"width","220px"],["type","button",1,"btn","btn-success",3,"click"],[1,"text-center",2,"width","10px"],["class","text-center",4,"ngIf"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],[1,"text-center"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1&&(i(0,"mainpanel-cmp",1)(1,"actions"),m(2,Me,2,0,"button",2),r(),i(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"table",6)(8,"thead",7)(9,"tr"),m(10,Ie,1,0,"th",8),i(11,"th",9),a(12,"Name"),r(),i(13,"th"),a(14,"Validate Coupon"),r(),i(15,"th"),a(16,"Redeem Coupon"),r(),i(17,"th"),a(18,"Value"),r(),i(19,"th"),a(20,"Status"),r()()(),i(21,"tbody"),m(22,we,2,0)(23,ke,1,1,"ng-container"),r()()()()(),m(24,Ve,3,0,"ng-template",null,0,q),r()()),o&2){let u;p("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",t.role.developer.Edit),l(8),p("ngIf",t.role.developer.Edit),l(12),C(((u=t.listProviders())==null?null:u.length)>0?22:23)}},dependencies:[M,R,L,B,fe,ce,te,Ce],encapsulation:2})};export{he as CouponConfigurationComponent};
1
+ import{a as ge}from"./chunk-CSQD5JSK.js";import{a as ve}from"./chunk-2RGZUU27.js";import{a as Ce}from"./chunk-M3HHWYKD.js";import"./chunk-BYXBJQAS.js";import{e as ce,f as fe}from"./chunk-EFKIYD2S.js";import"./chunk-JGK2MYOQ.js";import{b as se}from"./chunk-WZS6HHV3.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import{u as pe,v as me,w as ue}from"./chunk-H7F34T25.js";import"./chunk-JOXTERIM.js";import{O as F}from"./chunk-TSIYPTYI.js";import{e as ae,f as le,g as de}from"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import"./chunk-LE3BKIDY.js";import"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import{E as oe,F as te,G as ne,c as J,e as b,h as Y,i as X,p as Q,t as Z,w as ee}from"./chunk-RVXZOIFQ.js";import"./chunk-SH2AVVL5.js";import"./chunk-UCJKQICE.js";import{a as w,d as re}from"./chunk-ZZGSAFGO.js";import"./chunk-SEGFXGKG.js";import{$a as l,Db as C,E as N,Eb as A,Fc as q,Gb as O,Hb as U,Ib as i,Jb as r,Kb as s,Ma as V,Nb as H,Ob as x,Od as W,Pc as K,Qb as v,Rb as f,Vd as z,Wc as R,Yd as ie,Zc as L,bd as B,db as c,dc as $,ec as a,fc as G,gc as T,jd as M,kb as E,na as h,ob as D,qb as m,rc as _,sc as j,t as k,va as y,vb as p,wa as P}from"./chunk-UXRO4UFY.js";import"./chunk-7DCB7DB2.js";var I=n=>({"is-invalid":n});function Pe(n,d){n&1&&(i(0,"div",16),a(1," Provider Name is required "),r())}function Ee(n,d){n&1&&(i(0,"div",20),a(1," Validate Coupon URL is required "),r())}function xe(n,d){n&1&&(i(0,"div",20),a(1," Redeem Coupon URL is required "),r())}function Ge(n,d){n&1&&(i(0,"div",20),a(1,"Key is required"),r())}var S=class n{constructor(d){this.data=d;this.config=new pe,this.config.title="Register Provider",this.config.customWidth="600px",this.initForm()}dialogRef=h(ae);config;fb=h(oe);formGroup;initForm(){this.formGroup=this.fb.group({name:[this.data?.name||"",[b.required]],validateCoupon:[this.data?.validateCoupon||"",[b.required]],redeemCoupon:[this.data?.redeemCoupon||"",[b.required]],enabled:[this.data?.enabled!==void 0?this.data.enabled:!0],header:[this.data?.header,[b.required]]})}onClose(){this.dialogRef.close()}onOk(){this.formGroup.markAllAsTouched(),!this.formGroup.invalid&&this.dialogRef.close(this.formGroup.value)}static \u0275fac=function(e){return new(e||n)(c(le))};static \u0275cmp=E({type:n,selectors:[["app-modal-register-provider"]],decls:35,vars:18,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid","pt-4"],[1,"row"],[1,"col-12"],[3,"formGroup"],[1,"mb-8"],[1,"d-flex","align-items-center"],[1,"flex-grow-1","me-3"],[1,"form-floating-outline","mb-0"],["type","text","placeholder","Provider Name","id","name","name","name","formControlName","name",1,"form-control","bg-white",3,"ngClass"],["for","name"],[2,"width","75px"],[1,"form-check-floating"],[1,"d-flex","justify-content-center","pt-7","pb-4"],["formControlName","enabled"],[1,"labelFilledInput","text-center"],[1,"invalid-feedback","mt-2",2,"display","block"],[1,"form-floating-outline","mb-8"],["type","text","id","validateCoupon","name","validateCoupon","placeholder","Validate Coupon","formControlName","validateCoupon",1,"form-control","bg-white",3,"ngClass"],["for","validateCoupon"],[1,"invalid-feedback"],["type","text","id","redeemCoupon","placeholder","Redeem Coupon","name","redeemCoupon","formControlName","redeemCoupon",1,"form-control","bg-white",3,"ngClass"],["for","redeemCoupon"],[1,"form-floating-outline","mb-3"],["type","text","id","key","name","key","placeholder","Key: E.g. eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9","formControlName","header","rows","4",1,"form-control","bg-white",3,"ngClass"],["for","key"]],template:function(e,o){e&1&&(i(0,"modal-material",0),v("onOk",function(){return o.onOk()})("onCancel",function(){return o.onClose()})("onClose",function(){return o.onClose()}),i(1,"content")(2,"div",1)(3,"div",2)(4,"div",3)(5,"form",4)(6,"div",5)(7,"div",6)(8,"div",7)(9,"div",8),s(10,"input",9),i(11,"label",10),a(12,"Coupon Provider"),r()()(),i(13,"div",11)(14,"div",12)(15,"div",13),s(16,"app-customize-toggle",14),r(),i(17,"label",15),a(18,"Enabled"),r()()()(),m(19,Pe,2,0,"div",16),r(),i(20,"div",17),s(21,"input",18),i(22,"label",19),a(23,"Validate Coupon URL"),r(),m(24,Ee,2,0,"div",20),r(),i(25,"div",17),s(26,"input",21),i(27,"label",22),a(28,"Redeem Coupon URL"),r(),m(29,xe,2,0,"div",20),r(),i(30,"div",23),s(31,"textarea",24),i(32,"label",25),a(33,"Request Header (Key: value)"),r(),m(34,Ge,2,0,"div",20),r()()()()()()()),e&2&&(p("config",o.config),l(5),p("formGroup",o.formGroup),l(5),p("ngClass",_(10,I,(o.formGroup.controls.name==null?null:o.formGroup.controls.name.invalid)&&((o.formGroup.controls.name==null?null:o.formGroup.controls.name.dirty)||(o.formGroup.controls.name==null?null:o.formGroup.controls.name.touched)))),l(9),C(o.formGroup.controls.name.invalid&&(o.formGroup.controls.name.dirty||o.formGroup.controls.name.touched)?19:-1),l(2),p("ngClass",_(12,I,(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.invalid)&&((o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.dirty)||(o.formGroup.controls.validateCoupon==null?null:o.formGroup.controls.validateCoupon.touched)))),l(3),C(o.formGroup.controls.validateCoupon.invalid&&(o.formGroup.controls.validateCoupon.dirty||o.formGroup.controls.validateCoupon.touched)?24:-1),l(2),p("ngClass",_(14,I,(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.invalid)&&((o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.dirty)||(o.formGroup.controls.redeemCoupon==null?null:o.formGroup.controls.redeemCoupon.touched)))),l(3),C(o.formGroup.controls.redeemCoupon.invalid&&(o.formGroup.controls.redeemCoupon.dirty||o.formGroup.controls.redeemCoupon.touched)?29:-1),l(2),p("ngClass",_(16,I,(o.formGroup.controls.header==null?null:o.formGroup.controls.header.invalid)&&((o.formGroup.controls.header==null?null:o.formGroup.controls.header.dirty)||(o.formGroup.controls.header==null?null:o.formGroup.controls.header.touched)))),l(3),C(o.formGroup.controls.header.invalid&&(o.formGroup.controls.header.dirty||o.formGroup.controls.header.touched)?34:-1))},dependencies:[M,R,ne,Q,J,Y,X,Z,ee,ue,me,ge],styles:["div.form-check-floating[_ngcontent-%COMP%]{border:1px solid #ced4da;position:relative;border-radius:.25rem!important}.labelFilledInput[_ngcontent-%COMP%]{position:absolute;top:-10px;left:10px;background:#fff;padding-left:4px;padding-right:4px;font-size:.75rem!important;color:#9da2a6}"]})};var Re=(n,d)=>({"bg-success-subtle text-success-emphasis":n,"bg-danger-subtle text-danger-emphasis":d});function Me(n,d){if(n&1){let e=x();i(0,"button",10),v("click",function(){y(e);let t=f();return P(t.addNewCouponProvider())}),a(1," Add "),r()}}function Ie(n,d){n&1&&s(0,"th",11)}function Ne(n,d){if(n&1){let e=x();i(0,"td",15)(1,"i",16),v("click",function(){y(e);let t=f().$index,u=f(2);return P(u.onDeleteProvider(t))}),r()()}}function Te(n,d){if(n&1){let e=x();i(0,"tr"),m(1,Ne,2,0,"td",12),i(2,"td")(3,"a",13),v("click",function(){let t=y(e),u=t.$implicit,g=t.$index,_e=f(2);return P(_e.onUpdateProvider(u,g))}),a(4),r()(),i(5,"td"),a(6),r(),i(7,"td"),a(8),r(),i(9,"td"),a(10),r(),i(11,"td")(12,"span",14),a(13),r()()()}if(n&2){let e=d.$implicit,o=f(2);l(),p("ngIf",o.role.developer.Edit),l(3),T(" ",e.Name," "),l(2),G(e.ValidateCoupon),l(2),G(e.RedeemCoupon),l(2),G(e.KeyUI),l(2),p("ngClass",j(7,Re,e.Enabled,!e.Enabled)),l(),T(" ",e.Enabled?"Enabled":"Disabled"," ")}}function we(n,d){if(n&1&&O(0,Te,14,10,"tr",null,A),n&2){let e=f();U(e.listProviders())}}function Fe(n,d){n&1&&H(0)}function ke(n,d){if(n&1&&m(0,Fe,1,0,"ng-container",17),n&2){f();let e=$(25);p("ngTemplateOutlet",e)}}function Ve(n,d){n&1&&(i(0,"tr",18)(1,"td",19),s(2,"empty-state-table"),r()())}var he=class n extends ve{constructor(e,o,t,u,g){super(e,o,F.WebhookCouponProviderLoader,t);this.activatedRoute=t;this.role=u;this.dialog=g}toastr=h(z);couponProviders=V([]);listProviders=K(()=>this.couponProviders().map(e=>(e.KeyUI=this.generateKeyUI(e.Header),e)));generateKeyUI(e){if(!e||e.length<=25)return e||"";let o=e.substring(0,10),t=e.substring(e.length-10);return`${o}...${t}`}postBindForm(e){this.couponProviders.update(()=>e.Form.CouponProviders.map(t=>({FetchMemberPoint:t.FetchMemberPoint,Enabled:t.Enabled,Name:t.Name,RedeemCoupon:t.RedeemCoupon,ValidateCoupon:t.ValidateCoupon,Header:t.Header})))}addNewCouponProvider(){this.dialog.open(S).afterClosed().pipe(N(e=>w.IsNotEmpty(e)),k(e=>{let o={Name:e.name,ValidateCoupon:e.validateCoupon,RedeemCoupon:e.redeemCoupon,Enabled:e.enabled,Header:e.header};return[...this.couponProviders(),o]})).subscribe(e=>{this.couponProviders.update(()=>e),this.saveCouponProviders(`Coupon provider "${e[e.length-1].Name}" has been successfully added.`)})}onUpdateProvider(e,o){this.dialog.open(S,{data:{name:e.Name,validateCoupon:e.ValidateCoupon,redeemCoupon:e.RedeemCoupon,enabled:e.Enabled,header:e.Header}}).afterClosed().pipe(N(t=>w.IsNotEmpty(t))).subscribe(t=>{let u={Name:t.name,ValidateCoupon:t.validateCoupon,RedeemCoupon:t.redeemCoupon,Enabled:t.enabled,Header:t.header};this.couponProviders.update(g=>(g[o]=u,[...g])),this.saveCouponProviders(`Coupon provider "${t.name}" has been successfully updated.`)})}onDeleteProvider(e){if(confirm("Are you sure you want to delete this coupon provider?")){let o=this.couponProviders()[e]?.Name||"provider";this.couponProviders.update(t=>(t.splice(e,1),[...t])),this.saveCouponProviders(`Coupon provider "${o}" has been successfully deleted.`)}}saveCouponProviders(e){this.httpService.post(F.WebhookCouponProviderSave,this.couponProviders()).subscribe(()=>{this.toastr.success(e||"Coupon provider has been successfully updated.","Success")})}static \u0275fac=function(o){return new(o||n)(c(se),c(ie),c(W),c(re),c(de))};static \u0275cmp=E({type:n,selectors:[["app-coupon-configuration"]],features:[D],decls:26,vars:6,consts:[["EMPTY_STATE",""],[3,"pageData","hideSearchDropdown","hideSearchBox"],["type","button","class","btn btn-success",3,"click",4,"ngIf"],[1,"container-fluid","mt-6"],[1,"row"],[1,"col-12"],[1,"table","table-stripped","custom-table"],[1,"thead-light","sticky-top-thead"],["class","text-center","style","width: 10px",4,"ngIf"],[2,"width","220px"],["type","button",1,"btn","btn-success",3,"click"],[1,"text-center",2,"width","10px"],["class","text-center",4,"ngIf"],["role","button",1,"link-primary","cursor-pointer",3,"click"],[1,"p-3","rounded-2",3,"ngClass"],[1,"text-center"],["title","Delete provider",1,"fa","fa-xmark","text-danger",2,"cursor","pointer",3,"click"],[4,"ngTemplateOutlet"],[1,"table-border-bottom-0"],["colspan","7"]],template:function(o,t){if(o&1&&(i(0,"mainpanel-cmp",1)(1,"actions"),m(2,Me,2,0,"button",2),r(),i(3,"content")(4,"div",3)(5,"div",4)(6,"div",5)(7,"table",6)(8,"thead",7)(9,"tr"),m(10,Ie,1,0,"th",8),i(11,"th",9),a(12,"Name"),r(),i(13,"th"),a(14,"Validate Coupon"),r(),i(15,"th"),a(16,"Redeem Coupon"),r(),i(17,"th"),a(18,"Value"),r(),i(19,"th"),a(20,"Status"),r()()(),i(21,"tbody"),m(22,we,2,0)(23,ke,1,1,"ng-container"),r()()()()(),m(24,Ve,3,0,"ng-template",null,0,q),r()()),o&2){let u;p("pageData",t.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),l(2),p("ngIf",t.role.developer.Edit),l(8),p("ngIf",t.role.developer.Edit),l(12),C(((u=t.listProviders())==null?null:u.length)>0?22:23)}},dependencies:[M,R,L,B,fe,ce,te,Ce],encapsulation:2})};export{he as CouponConfigurationComponent};
@@ -1 +1 @@
1
- import{e as z,f as S}from"./chunk-QVTFZ7LA.js";import"./chunk-EJDRY7MH.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import"./chunk-H7F34T25.js";import"./chunk-JOXTERIM.js";import"./chunk-TSIYPTYI.js";import"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import"./chunk-LE3BKIDY.js";import"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import"./chunk-RVXZOIFQ.js";import"./chunk-FSTDHLYH.js";import"./chunk-WEGDL4GR.js";import"./chunk-ZZGSAFGO.js";import"./chunk-346EL5B3.js";import{$a as p,Ib as o,Jb as i,Kb as g,Qd as x,Td as l,db as d,ec as r,fc as v,jd as M,ka as a,kb as h,lb as s,vb as f}from"./chunk-UXRO4UFY.js";import"./chunk-7DCB7DB2.js";var m=class e{constructor(n){this.router=n;console.log(this.router.getCurrentNavigation()),console.log(this.router.lastSuccessfulNavigation),this.previousPage=this.router.lastSuccessfulNavigation?.finalUrl?.root?.children?.primary?.segments?.join("/"),this.role=this.router.getCurrentNavigation()?.extras?.state.role??localStorage.getItem("role"),localStorage.setItem("role",this.role),console.log(this.previousPage)}previousPage="";role="";menuData={H:"Unauthorized"};static \u0275fac=function(t){return new(t||e)(d(x))};static \u0275cmp=h({type:e,selectors:[["POS-unauthorized"]],standalone:!1,decls:13,vars:4,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"d-flex","align-items-center","justify-content-center","mt-8",2,"height","350px"],[1,"text-center"],["src","https://res.cloudinary.com/pos/image/upload/v1702547639/POS/Images/Dashboard/locked.svg",2,"width","200px"],[1,"mt-2","mb-6"],[1,"fw-bold"]],template:function(t,c){t&1&&(o(0,"mainpanel-cmp",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div"),g(5,"img",3),i(),o(6,"h1",4),r(7,"You are not authorized"),i(),o(8,"p"),r(9," This page require "),o(10,"span",5),r(11),i(),r(12," role. Please contact your Administrator to gain access! "),i()()()()()),t&2&&(f("pageData",c.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),p(11),v(c.role))},dependencies:[z],encapsulation:2})};var D=[{path:"Main/Unauthorized",component:m},{path:"",redirectTo:"Main/Unauthorized",pathMatch:"full"}],u=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=s({type:e});static \u0275inj=a({imports:[l.forChild(D),l]})};var y=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=s({type:e});static \u0275inj=a({imports:[M,u,S]})};export{y as UnauthorizedModule};
1
+ import{e as z,f as S}from"./chunk-EFKIYD2S.js";import"./chunk-JGK2MYOQ.js";import"./chunk-3GOO5E5D.js";import"./chunk-XMYLHF4C.js";import"./chunk-H7F34T25.js";import"./chunk-JOXTERIM.js";import"./chunk-TSIYPTYI.js";import"./chunk-3YKVLHZG.js";import"./chunk-ZHY3BUQJ.js";import"./chunk-LE3BKIDY.js";import"./chunk-2FWFPV5I.js";import"./chunk-EEEAUYZ6.js";import"./chunk-RVXZOIFQ.js";import"./chunk-SH2AVVL5.js";import"./chunk-UCJKQICE.js";import"./chunk-ZZGSAFGO.js";import"./chunk-SEGFXGKG.js";import{$a as p,Ib as o,Jb as i,Kb as g,Qd as x,Td as l,db as d,ec as r,fc as v,jd as M,ka as a,kb as h,lb as s,vb as f}from"./chunk-UXRO4UFY.js";import"./chunk-7DCB7DB2.js";var m=class e{constructor(n){this.router=n;console.log(this.router.getCurrentNavigation()),console.log(this.router.lastSuccessfulNavigation),this.previousPage=this.router.lastSuccessfulNavigation?.finalUrl?.root?.children?.primary?.segments?.join("/"),this.role=this.router.getCurrentNavigation()?.extras?.state.role??localStorage.getItem("role"),localStorage.setItem("role",this.role),console.log(this.previousPage)}previousPage="";role="";menuData={H:"Unauthorized"};static \u0275fac=function(t){return new(t||e)(d(x))};static \u0275cmp=h({type:e,selectors:[["POS-unauthorized"]],standalone:!1,decls:13,vars:4,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"d-flex","align-items-center","justify-content-center","mt-8",2,"height","350px"],[1,"text-center"],["src","https://res.cloudinary.com/pos/image/upload/v1702547639/POS/Images/Dashboard/locked.svg",2,"width","200px"],[1,"mt-2","mb-6"],[1,"fw-bold"]],template:function(t,c){t&1&&(o(0,"mainpanel-cmp",0)(1,"content")(2,"div",1)(3,"div",2)(4,"div"),g(5,"img",3),i(),o(6,"h1",4),r(7,"You are not authorized"),i(),o(8,"p"),r(9," This page require "),o(10,"span",5),r(11),i(),r(12," role. Please contact your Administrator to gain access! "),i()()()()()),t&2&&(f("pageData",c.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),p(11),v(c.role))},dependencies:[z],encapsulation:2})};var D=[{path:"Main/Unauthorized",component:m},{path:"",redirectTo:"Main/Unauthorized",pathMatch:"full"}],u=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=s({type:e});static \u0275inj=a({imports:[l.forChild(D),l]})};var y=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=s({type:e});static \u0275inj=a({imports:[M,u,S]})};export{y as UnauthorizedModule};