dealpos 26.36.50 → 26.36.52

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 (115) hide show
  1. package/browser/{chunk-5PWFCP3M.js → chunk-2GXU77LM.js} +1 -1
  2. package/browser/{chunk-IHNWM7BH.js → chunk-2O56RA5P.js} +1 -1
  3. package/browser/{chunk-RQBFNSBF.js → chunk-2YXUV5KV.js} +1 -1
  4. package/browser/{chunk-LK6IAPED.js → chunk-36LYJB3O.js} +1 -1
  5. package/browser/{chunk-LTNL5APQ.js → chunk-3LU2XNRO.js} +1 -1
  6. package/browser/{chunk-WJ32HHXB.js → chunk-4AFTT2XP.js} +1 -1
  7. package/browser/{chunk-3RSMBVQP.js → chunk-4L6DG4QR.js} +2 -2
  8. package/browser/chunk-5EUIK56F.js +1 -0
  9. package/browser/{chunk-34JYAJDF.js → chunk-5GOEYGAT.js} +1 -1
  10. package/browser/{chunk-PPFZIAPG.js → chunk-5KGTYF4O.js} +1 -1
  11. package/browser/{chunk-25JZJYHC.js → chunk-5OOVEEBG.js} +1 -1
  12. package/browser/{chunk-T4YOVIY5.js → chunk-5SBYL2GI.js} +1 -1
  13. package/browser/{chunk-VCQ7N4CY.js → chunk-5TDJHSVB.js} +1 -1
  14. package/browser/{chunk-NWC6ODAC.js → chunk-5ZUVR44C.js} +1 -1
  15. package/browser/{chunk-UQ7T4O2W.js → chunk-63MASJFY.js} +1 -1
  16. package/browser/{chunk-EUQECLLC.js → chunk-63NMSZ2G.js} +1 -1
  17. package/browser/{chunk-HFFIZVX7.js → chunk-66RIXXLV.js} +2 -2
  18. package/browser/{chunk-73MZ2NY5.js → chunk-6MGEFDTC.js} +1 -1
  19. package/browser/{chunk-USSFKTN2.js → chunk-7T4NE6F6.js} +1 -1
  20. package/browser/{chunk-MNH5RHUV.js → chunk-A2I2QMXC.js} +1 -1
  21. package/browser/{chunk-6LYUUT5H.js → chunk-AFMU4M36.js} +1 -1
  22. package/browser/{chunk-6KFITZGR.js → chunk-AGAKZFB7.js} +1 -1
  23. package/browser/{chunk-M66LBW4S.js → chunk-AQ53SE6R.js} +1 -1
  24. package/browser/{chunk-LCVIYSOE.js → chunk-ASB337I7.js} +1 -1
  25. package/browser/{chunk-LHPIKFTS.js → chunk-BD3ED5WZ.js} +1 -1
  26. package/browser/{chunk-INPKRZ2D.js → chunk-BDBQFWDF.js} +1 -1
  27. package/browser/{chunk-UHWKBI3B.js → chunk-BFUB7PUK.js} +1 -1
  28. package/browser/{chunk-UGG7ICN3.js → chunk-BJI574LN.js} +1 -1
  29. package/browser/{chunk-CINH4N35.js → chunk-BKMUM2RM.js} +1 -1
  30. package/browser/{chunk-DKMIJI2W.js → chunk-BSUDKC6Z.js} +1 -1
  31. package/browser/{chunk-VGQ5TI6I.js → chunk-CIUW6RTX.js} +1 -1
  32. package/browser/{chunk-MBLN6652.js → chunk-CWSCHBIZ.js} +1 -1
  33. package/browser/{chunk-4NQBCEDJ.js → chunk-D3KPSWID.js} +3 -3
  34. package/browser/{chunk-ZXVE7T2T.js → chunk-DKQB7CH6.js} +2 -2
  35. package/browser/{chunk-XHR2WRVP.js → chunk-DKQCBH4O.js} +1 -1
  36. package/browser/{chunk-TDDRA2QL.js → chunk-DLZ2DEYH.js} +2 -2
  37. package/browser/{chunk-PEVKDKZS.js → chunk-DQ2D2JSF.js} +1 -1
  38. package/browser/{chunk-SM2UNEBA.js → chunk-DR2VSZQD.js} +1 -1
  39. package/browser/{chunk-2EWD4KGB.js → chunk-E7F4AY4U.js} +1 -1
  40. package/browser/{chunk-5MOGJ2KY.js → chunk-EGFEAPDF.js} +1 -1
  41. package/browser/{chunk-J43JZWWL.js → chunk-EJTRUTZ3.js} +1 -1
  42. package/browser/{chunk-2G3P6XQB.js → chunk-EOJKGSOK.js} +1 -1
  43. package/browser/{chunk-6IJGSZP4.js → chunk-ETIOGFW7.js} +1 -1
  44. package/browser/{chunk-Z4D2FPWL.js → chunk-F7O4N6MV.js} +1 -1
  45. package/browser/{chunk-JH2INMQM.js → chunk-FR4WXN77.js} +1 -1
  46. package/browser/{chunk-P3ITJVAR.js → chunk-G3PPLIMD.js} +1 -1
  47. package/browser/{chunk-4B77ZKLC.js → chunk-H4TJ2KAF.js} +1 -1
  48. package/browser/{chunk-ULMYPKC6.js → chunk-HGDYRQBL.js} +1 -1
  49. package/browser/{chunk-CBUBRYNP.js → chunk-HJA44BZ4.js} +1 -1
  50. package/browser/{chunk-WUOIT5SW.js → chunk-HNUEHVW2.js} +1 -1
  51. package/browser/{chunk-DGTLHFF6.js → chunk-IGP2V3PT.js} +1 -1
  52. package/browser/{chunk-PRRUKANX.js → chunk-IMJJIQ3Z.js} +1 -1
  53. package/browser/{chunk-RUP6BXC6.js → chunk-IMSMZYLG.js} +1 -1
  54. package/browser/{chunk-R4UMFJPX.js → chunk-IRJSWZQR.js} +1 -1
  55. package/browser/{chunk-Z66ELOLJ.js → chunk-ITCMJ77W.js} +1 -1
  56. package/browser/{chunk-KGCOWF6B.js → chunk-IWXBFNID.js} +1 -1
  57. package/browser/{chunk-WCLAA4SS.js → chunk-IXOA6XG3.js} +1 -1
  58. package/browser/{chunk-7H6MB2FG.js → chunk-IYVMMQUJ.js} +1 -1
  59. package/browser/{chunk-XESMJWCH.js → chunk-J6PPAROT.js} +2 -2
  60. package/browser/{chunk-M4ENO6EW.js → chunk-JCKRLI5N.js} +1 -1
  61. package/browser/{chunk-EOODBGRG.js → chunk-JFEDSR34.js} +1 -1
  62. package/browser/{chunk-I7F3VUUH.js → chunk-JFUQM6TB.js} +1 -1
  63. package/browser/{chunk-3GYURLCL.js → chunk-K2JHGNIO.js} +1 -1
  64. package/browser/{chunk-PQUEIUGD.js → chunk-KSTNMZEW.js} +1 -1
  65. package/browser/{chunk-6GAU64IG.js → chunk-KTDZ34WD.js} +1 -1
  66. package/browser/{chunk-MXUH3H6O.js → chunk-KTF3ZITG.js} +1 -1
  67. package/browser/{chunk-RA4TIAF5.js → chunk-LPRIHE3T.js} +1 -1
  68. package/browser/{chunk-EXK4IYYY.js → chunk-MH7BMICS.js} +1 -1
  69. package/browser/{chunk-I47ASJ2E.js → chunk-MHZTVDDB.js} +1 -1
  70. package/browser/{chunk-6NV4N6YM.js → chunk-N5LY6B5L.js} +2 -2
  71. package/browser/{chunk-R5HJLFJ2.js → chunk-N5MBXGEO.js} +1 -1
  72. package/browser/{chunk-IY7ZHWWS.js → chunk-N62VQ7EV.js} +1 -1
  73. package/browser/{chunk-4CT77QJN.js → chunk-NHGGV3GO.js} +1 -1
  74. package/browser/{chunk-DSD6SBQ5.js → chunk-NOS3IZI5.js} +1 -1
  75. package/browser/{chunk-L2IKKBAD.js → chunk-OKMN5YQ5.js} +1 -1
  76. package/browser/{chunk-IOQO76GP.js → chunk-OKMNTSZP.js} +1 -1
  77. package/browser/{chunk-B3HRBWBT.js → chunk-OLGXL6KY.js} +1 -1
  78. package/browser/{chunk-3KH2J2MW.js → chunk-OMFRUXZ4.js} +1 -1
  79. package/browser/{chunk-SUO7MRNW.js → chunk-OVCA6Q3J.js} +1 -1
  80. package/browser/{chunk-WIPECBGF.js → chunk-OX5TZLJ5.js} +1 -1
  81. package/browser/{chunk-IOMOKVTF.js → chunk-PEZRM57H.js} +1 -1
  82. package/browser/{chunk-CQROPDKC.js → chunk-PG62QDNS.js} +1 -1
  83. package/browser/{chunk-KPQQVMMB.js → chunk-PRQJFYK6.js} +1 -1
  84. package/browser/{chunk-KUVM6TP2.js → chunk-PYDWVDFF.js} +1 -1
  85. package/browser/{chunk-XHTHBBLM.js → chunk-Q4FP743N.js} +1 -1
  86. package/browser/{chunk-RVMD3V6N.js → chunk-QENSRIHN.js} +1 -1
  87. package/browser/{chunk-N2GXH4AT.js → chunk-QHETYXUX.js} +1 -1
  88. package/browser/{chunk-3I6T2233.js → chunk-R6I7GUOF.js} +1 -1
  89. package/browser/{chunk-BAOTWLAU.js → chunk-RDQQUDEC.js} +1 -1
  90. package/browser/{chunk-KJ5HV4AP.js → chunk-REUSKXEW.js} +1 -1
  91. package/browser/{chunk-QPK7OEK7.js → chunk-RFBGGQCB.js} +1 -1
  92. package/browser/{chunk-Q6J24WAD.js → chunk-RMG6TZOB.js} +1 -1
  93. package/browser/{chunk-4PGHGLHY.js → chunk-RQRV2JMH.js} +1 -1
  94. package/browser/{chunk-PWTUOV6H.js → chunk-RTFMOBMR.js} +1 -1
  95. package/browser/{chunk-KQXMKDZX.js → chunk-T5X5UR6Z.js} +1 -1
  96. package/browser/{chunk-HOH7PS2V.js → chunk-TNUQTOD3.js} +1 -1
  97. package/browser/{chunk-FVSAOS4H.js → chunk-TTR5CBZD.js} +1 -1
  98. package/browser/{chunk-6N6AV6W3.js → chunk-UHJSDSJ5.js} +1 -1
  99. package/browser/{chunk-4QROVULT.js → chunk-UYQMC5K6.js} +1 -1
  100. package/browser/{chunk-GD3TSII3.js → chunk-WBWM7DGA.js} +1 -1
  101. package/browser/{chunk-TFNZHJEO.js → chunk-WONZUADS.js} +1 -1
  102. package/browser/{chunk-QMJZLLUY.js → chunk-WZOIFFNT.js} +1 -1
  103. package/browser/{chunk-ZNJATMWI.js → chunk-XV4SDTMU.js} +1 -1
  104. package/browser/{chunk-2WTHW2VY.js → chunk-XWTLUM2Y.js} +1 -1
  105. package/browser/{chunk-B4FOFTYD.js → chunk-YFFT6JHN.js} +1 -1
  106. package/browser/{chunk-QUQ75V25.js → chunk-YWKCX4JS.js} +1 -1
  107. package/browser/{chunk-NXLH7TAB.js → chunk-ZMHLPV7H.js} +1 -1
  108. package/browser/{chunk-4NWJ6X6F.js → chunk-ZNDTSGLE.js} +1 -1
  109. package/browser/{chunk-SVOXRVA2.js → chunk-ZXEWERRD.js} +1 -1
  110. package/browser/{chunk-2Y6E5WHI.js → chunk-ZXF6T5NF.js} +1 -1
  111. package/browser/index.html +2 -2
  112. package/browser/{main-E7L57244.js → main-U4YNDGHP.js} +1 -1
  113. package/browser/ngsw.json +513 -513
  114. package/package.json +1 -1
  115. package/browser/chunk-5YDLZRJA.js +0 -1
@@ -1 +1 @@
1
- import{a as C}from"./chunk-N2GXH4AT.js";import{a as w}from"./chunk-2G3P6XQB.js";import{a as A}from"./chunk-SVRHZOWH.js";import{a as x}from"./chunk-K2NOGF3I.js";import{a as I}from"./chunk-4KUDABAJ.js";import{a as c}from"./chunk-FNEABRAQ.js";import{a as l}from"./chunk-PPTZHIIZ.js";import{Ea as P,ga as L,qa as f,t as F,z as S}from"./chunk-T7N5CA5W.js";import{a as y}from"./chunk-NF7PG5F2.js";var d=class{enabledDragItem;constructor(){this.enabledDragItem=!1}drop(o,t){A(t.Data,o.previousIndex,o.currentIndex)}toggleEnabledDragItem(){}onSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.postListID(o,t.data.Data)}onPutSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.putListID(o,t.data.Data)}};var D=class{constructor(o){this.httpService=o}httpService;exportCSV(o,t,e,i){e.pageData.Filter.Export=!0,e.pageData.Filter.FormatType=0,i=i||"export.csv",this.httpService.post(`/api/${t}`,e.pageData.Filter).subscribe(r=>{o.convertToCSV(r,i),e.pageData.Filter.Export=!1})}convertToCSV(o,t=!1,e){let i=this.ExportDataFromUI2(t);o.convertToCSV(i,e)}ExportDataFromUI2(o=!1){let t=document.getElementById("tableGrid"),e=[];return l.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let a=new Object,s=0;r.querySelectorAll("th, td").forEach(n=>{s++;let v=parseInt(n.getAttribute("colspan"));for(let u=1;u<v;u++)a["column"+s]="",s++;let p=n.innerText,h=p.toString().split("");if(o&&h[0]==="0"&&h.length>1){let u="'"+p.trim();a["column"+s]=u}else a["column"+s]=p.trim()}),e.push(a)}),e}};var b=class{listTotal;pageSize;show;constructor(){this.listTotal=0,this.pageSize=0,this.show=!1}changePaginationData(o){this.pageSize=o.pageData.Filter.RowCount,this.listTotal=o.data?.ListTotal??o.data?.Data?.total?.value,this.show=this.pageSize<=this.listTotal}changePage(o,t,e){t.Filter.PageNumber=o.pageIndex+1,e.getListData()}};var M=class extends x{constructor(t,e,i,r,a,s,g,n="post",v="post"){super(t);this.httpService=e;this.dataAPI=i;this.pageAPI=r;this.toastrService=a;this.route=s;this.initOpenDialog=g;this.dataMethod=n;this.loaderMethod=v;this.exportHandler=new D(e),r?(s&&(this.loaderPayload=y({ListIDs:this.reportFilterService?.initOutletFilter()},s.snapshot.queryParams)),this.preInitLoader(),S([this.menuData$,this.callApi("/api/"+this.pageAPI,this.loaderPayload,this.loaderMethod)]).pipe(F(([p,h])=>h)).pipe(I()).subscribe(p=>{this.pageData=p,this.pageData.Filter||(this.pageData.Filter={},this.pageData.Filter.RowCount=20),this.pageData.Filter.PageNumber=1,this.pageData.Filter.ID=this.loaderPayload.ID,this.preInitList(),this.initOpenDialog?this.openDialogFilter.openDialog(this.getOpenDialogOptions()):this.getListData()})):(this.pageData.Filter.RowCount=20,this.pageData.Filter.PageNumber=1,this.preInitList(),S({menuData:this.menuData$,listData:this.getListData$()}).pipe(I()).subscribe())}httpService;dataAPI;pageAPI;toastrService;route;initOpenDialog;dataMethod;loaderMethod;openDialogFilter=f(w);reportFilterService=f(C);pageData={Filter:{},Options:{},Roles:{},Config:{}};data;pagination=new b;dragDrop=new d;exportHandler;comparation=0;loaderPayload={};reloadRowCount=P(!1);mapToKeyValueArray(t){return t?Object.keys(t).map(e=>({key:e,value:t[e]})):[]}callApi(t,e,i="post"){let r=t;if(i==="get"){let a=this.mapToKeyValueArray(e);return this.httpService.get(r,a)}return this.httpService[i](r,e)}preInitLoader(){}getOpenDialogOptions(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.callApi("/api/"+this.dataAPI,this.pageData.Filter,this.dataMethod).subscribe(e=>{e.PageSubTitle&&(this.menuData.SH=e.PageSubTitle),this.data=e,this.postInit(e),this.reloadRowCount.set(!0),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)})}getListData$(t){return this.preGetList(),this.callApi("/api/"+this.dataAPI,this.pageData.Filter,this.dataMethod).pipe(L(e=>{this.data=e,this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)}))}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData.Filter.PageNumber=1,this.getListData("filterMode")}postInit(t){t.PageTitle!=null&&(this.menuData.H=t.PageTitle)}preGetList(){this.pageData.Filter.From==null&&(this.pageData.Filter.From=l.MinDate),this.pageData.Filter.To==null&&(this.pageData.Filter.To=l.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data.Data=this.data.Data.map(e=>(e.selected=t,e))}getSelectedData(){let t=[];return this.data&&(t=this.data.Data.filter(e=>e.selected)),t}httpPostListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.postListID(t,r,i)}httpPutListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.putListID(t,r,i)}httpDeleteListID(t,e,i){if(e||(e="Are you sure you want to delete selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.DeleteListID(t,r,i)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.getListData()},a=>{let s=a.status+" "+a.statusText;this.toastrService.error(a.error.Message!=""?a.error.Message:"An unknown error has occured!",s,{enableHtml:!0})})}putListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.put(`/api/${t}`,r).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(i=>{this.getListData(),this.toastrService.success(i.Message?i.Message:i,c.Success)})}compare(t,e,i){return(t<e?-1:1)*(i?1:-1)}exportCSV(t,e,i){this.exportHandler.exportCSV(t,e,this,i)}s2ab(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=0;r!=t.length;++r)i[r]=t.charCodeAt(r)&255;return e}exportXlsx(t,e){this.pageData.Filter.FormatType=1,this.pageData.Filter.Export=!0,this.httpService.post(`/api/${t}`,this.pageData.Filter).subscribe(i=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(i))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),a=document.createElement("a");a.href=r,a.setAttribute("download",e),document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(r),a.remove()})}convertToCSV(t,e=!1,i){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,i)}OnCompare(t){let e=t?this.data[t]:this.data;if(e.length<1)return;let i=Object.assign({},this.pageData.Filter);i.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),i.To=new Date(new Date(this.pageData.Filter.To).getFullYear(),new Date(this.pageData.Filter.To).getMonth(),0).toDateString(),this.httpService.post("/API/"+this.dataAPI,i).subscribe(r=>{let a=t?r[t]:r;this.comparation=0,e.forEach(s=>{s.PrevIndex="-",s.CurrentIndex="-",s.Increase="-";let g=a.filter(n=>n.EntityID==s.EntityID);if(s.CurrentIndex=s.Rank,g.length>0){let n=g[0];s.PrevIndex=n.Rank,n.SalesNet?s.Increase=(s.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(s.Increase=(s.Sales-n.Sales)/n.Sales*100),s.IsPositive=s.Increase>0,s.IsNegative=s.Increase<0,this.comparation+=s.Increase}})})}};export{M as a};
1
+ import{a as C}from"./chunk-QHETYXUX.js";import{a as w}from"./chunk-EOJKGSOK.js";import{a as A}from"./chunk-SVRHZOWH.js";import{a as x}from"./chunk-K2NOGF3I.js";import{a as I}from"./chunk-4KUDABAJ.js";import{a as c}from"./chunk-FNEABRAQ.js";import{a as l}from"./chunk-PPTZHIIZ.js";import{Ea as P,ga as L,qa as f,t as F,z as S}from"./chunk-T7N5CA5W.js";import{a as y}from"./chunk-NF7PG5F2.js";var d=class{enabledDragItem;constructor(){this.enabledDragItem=!1}drop(o,t){A(t.Data,o.previousIndex,o.currentIndex)}toggleEnabledDragItem(){}onSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.postListID(o,t.data.Data)}onPutSaveDragAndDrop(o,t){this.enabledDragItem=!this.enabledDragItem,this.enabledDragItem||t.putListID(o,t.data.Data)}};var D=class{constructor(o){this.httpService=o}httpService;exportCSV(o,t,e,i){e.pageData.Filter.Export=!0,e.pageData.Filter.FormatType=0,i=i||"export.csv",this.httpService.post(`/api/${t}`,e.pageData.Filter).subscribe(r=>{o.convertToCSV(r,i),e.pageData.Filter.Export=!1})}convertToCSV(o,t=!1,e){let i=this.ExportDataFromUI2(t);o.convertToCSV(i,e)}ExportDataFromUI2(o=!1){let t=document.getElementById("tableGrid"),e=[];return l.IsNotEmpty(t)&&t.querySelectorAll("tr").forEach(r=>{let a=new Object,s=0;r.querySelectorAll("th, td").forEach(n=>{s++;let v=parseInt(n.getAttribute("colspan"));for(let u=1;u<v;u++)a["column"+s]="",s++;let p=n.innerText,h=p.toString().split("");if(o&&h[0]==="0"&&h.length>1){let u="'"+p.trim();a["column"+s]=u}else a["column"+s]=p.trim()}),e.push(a)}),e}};var b=class{listTotal;pageSize;show;constructor(){this.listTotal=0,this.pageSize=0,this.show=!1}changePaginationData(o){this.pageSize=o.pageData.Filter.RowCount,this.listTotal=o.data?.ListTotal??o.data?.Data?.total?.value,this.show=this.pageSize<=this.listTotal}changePage(o,t,e){t.Filter.PageNumber=o.pageIndex+1,e.getListData()}};var M=class extends x{constructor(t,e,i,r,a,s,g,n="post",v="post"){super(t);this.httpService=e;this.dataAPI=i;this.pageAPI=r;this.toastrService=a;this.route=s;this.initOpenDialog=g;this.dataMethod=n;this.loaderMethod=v;this.exportHandler=new D(e),r?(s&&(this.loaderPayload=y({ListIDs:this.reportFilterService?.initOutletFilter()},s.snapshot.queryParams)),this.preInitLoader(),S([this.menuData$,this.callApi("/api/"+this.pageAPI,this.loaderPayload,this.loaderMethod)]).pipe(F(([p,h])=>h)).pipe(I()).subscribe(p=>{this.pageData=p,this.pageData.Filter||(this.pageData.Filter={},this.pageData.Filter.RowCount=20),this.pageData.Filter.PageNumber=1,this.pageData.Filter.ID=this.loaderPayload.ID,this.preInitList(),this.initOpenDialog?this.openDialogFilter.openDialog(this.getOpenDialogOptions()):this.getListData()})):(this.pageData.Filter.RowCount=20,this.pageData.Filter.PageNumber=1,this.preInitList(),S({menuData:this.menuData$,listData:this.getListData$()}).pipe(I()).subscribe())}httpService;dataAPI;pageAPI;toastrService;route;initOpenDialog;dataMethod;loaderMethod;openDialogFilter=f(w);reportFilterService=f(C);pageData={Filter:{},Options:{},Roles:{},Config:{}};data;pagination=new b;dragDrop=new d;exportHandler;comparation=0;loaderPayload={};reloadRowCount=P(!1);mapToKeyValueArray(t){return t?Object.keys(t).map(e=>({key:e,value:t[e]})):[]}callApi(t,e,i="post"){let r=t;if(i==="get"){let a=this.mapToKeyValueArray(e);return this.httpService.get(r,a)}return this.httpService[i](r,e)}preInitLoader(){}getOpenDialogOptions(){}preInitList(){}getListData(t){this.preGetList(),this.dataAPI&&this.callApi("/api/"+this.dataAPI,this.pageData.Filter,this.dataMethod).subscribe(e=>{e.PageSubTitle&&(this.menuData.SH=e.PageSubTitle),this.data=e,this.postInit(e),this.reloadRowCount.set(!0),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)})}getListData$(t){return this.preGetList(),this.callApi("/api/"+this.dataAPI,this.pageData.Filter,this.dataMethod).pipe(L(e=>{this.data=e,this.postInit(e),this.pagination.changePaginationData(this),t&&(this.pageData.HideStoreApiCount=!1)}))}searchFromPageOne(){this.preSearchFromPageOne(),this.pageData.Filter.PageNumber=1,this.getListData("filterMode")}postInit(t){t.PageTitle!=null&&(this.menuData.H=t.PageTitle)}preGetList(){this.pageData.Filter.From==null&&(this.pageData.Filter.From=l.MinDate),this.pageData.Filter.To==null&&(this.pageData.Filter.To=l.MinDate)}preSearchFromPageOne(){}onPaginationChange(t){this.pagination.changePage(t,this.pageData,this)}onSelectAllData(t){this.data.Data=this.data.Data.map(e=>(e.selected=t,e))}getSelectedData(){let t=[];return this.data&&(t=this.data.Data.filter(e=>e.selected)),t}httpPostListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.postListID(t,r,i)}httpPutListID(t,e,i){if(e||(e="Are you sure you want to selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.putListID(t,r,i)}httpDeleteListID(t,e,i){if(e||(e="Are you sure you want to delete selected record/s?"),confirm(e)==!1)return;let r=this.getSelectedData();r.length>0&&this.DeleteListID(t,r,i)}onSaveDragAndDrop(t){this.dragDrop.onSaveDragAndDrop(t,this)}onPutSaveDragAndDrop(t){this.dragDrop.onPutSaveDragAndDrop(t,this)}postListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.post(`/api/${t}`,r,1e6,!0).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.getListData()},a=>{let s=a.status+" "+a.statusText;this.toastrService.error(a.error.Message!=""?a.error.Message:"An unknown error has occured!",s,{enableHtml:!0})})}putListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.put(`/api/${t}`,r).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.afterPutListSuccess(),this.getListData()})}afterPutListSuccess(){}DeleteListID(t,e,i){let r=e.map(a=>i?a[i]:a.ID);this.httpService.delete(`/api/${t}`,{body:r}).subscribe(a=>{this.toastrService.success(a.Message?a.Message:a,c.Success),this.getListData()})}postData(t,e){this.httpService.post("/API/"+t,e).subscribe(i=>{this.getListData(),this.toastrService.success(i.Message?i.Message:i,c.Success)})}compare(t,e,i){return(t<e?-1:1)*(i?1:-1)}exportCSV(t,e,i){this.exportHandler.exportCSV(t,e,this,i)}s2ab(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),r=0;r!=t.length;++r)i[r]=t.charCodeAt(r)&255;return e}exportXlsx(t,e){this.pageData.Filter.FormatType=1,this.pageData.Filter.Export=!0,this.httpService.post(`/api/${t}`,this.pageData.Filter).subscribe(i=>{e=decodeURI(e);let r=window.URL.createObjectURL(new Blob([this.s2ab(atob(i))],{type:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"})),a=document.createElement("a");a.href=r,a.setAttribute("download",e),document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(r),a.remove()})}convertToCSV(t,e=!1,i){let r=this.exportHandler.ExportDataFromUI2(e);t.convertToCSV(r,i)}OnCompare(t){let e=t?this.data[t]:this.data;if(e.length<1)return;let i=Object.assign({},this.pageData.Filter);i.From=new Date(new Date(this.pageData.Filter.From).getFullYear(),new Date(this.pageData.Filter.From).getMonth()-1,1),i.To=new Date(new Date(this.pageData.Filter.To).getFullYear(),new Date(this.pageData.Filter.To).getMonth(),0).toDateString(),this.httpService.post("/API/"+this.dataAPI,i).subscribe(r=>{let a=t?r[t]:r;this.comparation=0,e.forEach(s=>{s.PrevIndex="-",s.CurrentIndex="-",s.Increase="-";let g=a.filter(n=>n.EntityID==s.EntityID);if(s.CurrentIndex=s.Rank,g.length>0){let n=g[0];s.PrevIndex=n.Rank,n.SalesNet?s.Increase=(s.SalesNet-n.SalesNet)/n.SalesNet*100:n.Sales&&(s.Increase=(s.Sales-n.Sales)/n.Sales*100),s.IsPositive=s.Increase>0,s.IsNegative=s.Increase<0,this.comparation+=s.Increase}})})}};export{M as a};
@@ -1 +1 @@
1
- import{a as di}from"./chunk-2XH6Q6LN.js";import{a as _t}from"./chunk-R66XDGNJ.js";import{a as ft}from"./chunk-YSXS53LW.js";import{a as mi}from"./chunk-JUJAXTRW.js";import{a as ci}from"./chunk-PWBZSXWH.js";import{a as pi}from"./chunk-ZF4BACNU.js";import"./chunk-PUCBYEX7.js";import{a as Zt,b as ei}from"./chunk-N6UN5VE7.js";import"./chunk-GSNMJQ66.js";import"./chunk-6W3NA43S.js";import{b as li}from"./chunk-NYZ4INHA.js";import"./chunk-C6T3QJYH.js";import{a as he}from"./chunk-64VNFDF5.js";import{p as Je}from"./chunk-MBGAESMM.js";import"./chunk-HKSZBGAA.js";import"./chunk-NJMXSMGX.js";import"./chunk-OLQFDT22.js";import"./chunk-EBUYDS2Y.js";import"./chunk-NNQ7YV45.js";import"./chunk-6P2JYVLD.js";import"./chunk-6QHW2WTF.js";import"./chunk-EIELIV2M.js";import{b as Kt,c as Yt,d as Xt}from"./chunk-Z5EKWBMJ.js";import{a as He}from"./chunk-MNH5RHUV.js";import"./chunk-PZN4IDFD.js";import{b as dt}from"./chunk-FLWBWEFM.js";import{a as Fe}from"./chunk-CINH4N35.js";import"./chunk-ZLK3WUVC.js";import"./chunk-5PWFCP3M.js";import"./chunk-N2GXH4AT.js";import"./chunk-MEYOCIHN.js";import"./chunk-VZUG3XWW.js";import{a as je}from"./chunk-AFSEESTO.js";import{g as be,h as ut}from"./chunk-2G3P6XQB.js";import{a as ti,b as ii,c as ni}from"./chunk-LCKY37ME.js";import{a as ct}from"./chunk-V45IFCCW.js";import"./chunk-FJAZ5KHI.js";import"./chunk-TECII4TC.js";import"./chunk-N7XFZYAR.js";import"./chunk-NHMVI3RX.js";import"./chunk-CER4VIHT.js";import"./chunk-KVRVSMPL.js";import"./chunk-EXCHBF25.js";import"./chunk-SVRHZOWH.js";import"./chunk-IHQOHLPL.js";import"./chunk-BFQOLYHL.js";import"./chunk-K2NOGF3I.js";import"./chunk-CQROPDKC.js";import{a as ye}from"./chunk-RVMD3V6N.js";import{a as qt}from"./chunk-JQBXKYC5.js";import"./chunk-QAEDK7B5.js";import{b as st,c as ri}from"./chunk-7H6MB2FG.js";import"./chunk-73C77AIF.js";import"./chunk-BOBU77RE.js";import"./chunk-XSPKXHFT.js";import{a as Ve,b as Gt}from"./chunk-SWU6BBBD.js";import"./chunk-PPMQE2JW.js";import{L as ai,N as ae,g as Ae,k as ve,o as oi}from"./chunk-WCOJ74AX.js";import"./chunk-IN35LCD3.js";import"./chunk-RUP6BXC6.js";import"./chunk-OKQYRKDJ.js";import{d as Be}from"./chunk-NCJEZXKF.js";import"./chunk-STKAHNNR.js";import"./chunk-KGCOWF6B.js";import{a as ke,b as Le,c as pe}from"./chunk-QX4FSLL5.js";import"./chunk-YXX2TH5I.js";import"./chunk-M36GLXBG.js";import"./chunk-CVOK5ITC.js";import"./chunk-J27WSAUU.js";import{a as le,b as Q}from"./chunk-4KUDABAJ.js";import{a as De}from"./chunk-HTWZXTKN.js";import"./chunk-L22C7OZ4.js";import"./chunk-SFD3J3OH.js";import"./chunk-N3XC43X2.js";import{a as xe,b as Ie,c as ue}from"./chunk-FNEABRAQ.js";import"./chunk-OSHL72QK.js";import"./chunk-3A7EKFZY.js";import"./chunk-POOTZU2L.js";import"./chunk-MMZCS6WY.js";import{F as me,b as $t,c as pt,h as Y,p as X}from"./chunk-F2ZXIBKA.js";import"./chunk-DGTLHFF6.js";import{a as zt}from"./chunk-MXUH3H6O.js";import"./chunk-FQIRVQPI.js";import{b as U}from"./chunk-36E5M6EH.js";import{a as D}from"./chunk-PPTZHIIZ.js";import"./chunk-PWTUOV6H.js";import{n as ge,q as W}from"./chunk-WE775XUV.js";import{Ac as te,Bb as u,Bc as Z,Cc as Se,D as Re,Db as q,Ea as E,Eb as G,F,Fb as K,Gb as d,Hb as o,Ib as n,Ic as f,J as Ze,Jb as _,Jc as g,Kb as Tt,Kc as ee,Lb as wt,Lc as z,Nd as lt,O as jt,Oc as ot,Qa as w,Rc as _e,Rd as mt,Sa as tt,Sb as T,Tb as Qt,Td as Ut,Ud as Ce,Va as Jt,Vb as v,Wb as Pt,Wc as se,Wd as Me,Xa as r,Xb as c,_ as At,ba as Ht,ca as re,cb as O,e as Lt,ga as N,gb as A,hb as it,hc as Ne,j as Xe,kc as m,lb as Pe,lc as S,m as Bt,ma as R,mb as nt,mc as b,na as et,pc as k,qa as C,qc as L,qd as Wt,rc as B,sd as at,t as V,ua as x,ud as rt,va as y,wd as ie,zb as s,zc as Rt,zd as ne}from"./chunk-T7N5CA5W.js";import{a as h,b as I}from"./chunk-NF7PG5F2.js";var vi=(i,t)=>({ID:i,Template:t}),bi=()=>["/menu/Orders/Order/Sales_Order/Info"],Ue=i=>({ID:i}),hi=()=>["/menu/Manufacture/Job_Order/Archive/Form"];function Si(i,t){if(i&1){let e=T();o(0,"a",39),v("click",function(){x(e);let a=c(2);return y(a.process({ID:a.data().Data.Order.ID}))}),_(1,"i",40),m(2),n()}if(i&2){let e=c(2);r(2),b(" ",e.data().Data.Order.State===1?"Execute Plan":"Finish Order"," ")}}function Mi(i,t){if(i&1&&(o(0,"a",3),_(1,"i",41),m(2," Edit "),n()),i&2){let e=c(2);d("routerLink",te(2,hi))("queryParams",Z(3,Ue,e.data().Data.Order.ID))}}function Di(i,t){if(i&1){let e=T();o(0,"a",42),v("click",function(){x(e);let a=c(2);return y(a.delete("/API/Manufacture/DeleteOrder",a.data().Data.Order.ID))}),_(1,"i",43),m(2," Delete "),n()}}function Ii(i,t){if(i&1){let e=T();o(0,"li",15)(1,"a",44),v("click",function(){x(e);let a=c(2);return y(a.exportCSV(a.csvConverter,"Manufacture/ExportDetail",a.data().ExportFileName+".csv"))}),_(2,"i",45),m(3," Export "),n()()}}function Oi(i,t){i&1&&(o(0,"th",34),m(1,"Uom"),n())}function Ei(i,t){if(i&1&&(o(0,"th",46),m(1," Cost ("),_(2,"span",21),m(3,") "),n()),i&2){let e=c(3);r(2),d("innerHTML",e.data().CurrencySymbol,w)}}function Ti(i,t){if(i&1&&(o(0,"th",46),m(1," Total ("),_(2,"span",21),m(3,") "),n()),i&2){let e=c(3);r(2),d("innerHTML",e.data().CurrencySymbol,w)}}function wi(i,t){if(i&1&&(_(0,"p",21),f(1,"newlines")),i&2){let e=c().$implicit;d("innerHTML",g(1,1,e.Note),w)}}function Pi(i,t){if(i&1&&(o(0,"td"),m(1),n()),i&2){let e=c().$implicit;r(),S(e.Variant==null?null:e.Variant.UOMName)}}function Ni(i,t){if(i&1&&(o(0,"td",49),_(1,"span",21),f(2,"number"),n()),i&2){let e=c().$implicit;r(),d("innerHTML",g(2,1,e.Cost),w)}}function Vi(i,t){if(i&1&&(o(0,"td",49),_(1,"span",21),f(2,"number"),n()),i&2){let e=c().$implicit;r(),d("innerHTML",g(2,1,e.Cost*e.Quantity),w)}}function Fi(i,t){if(i&1&&(o(0,"tr")(1,"td"),_(2,"span",21),n(),o(3,"td")(4,"a",48),m(5),n(),o(6,"div"),m(7),n(),s(8,wi,2,3,"p",21),n(),o(9,"td",49),m(10),f(11,"number"),n(),s(12,Pi,2,1,"td"),s(13,Ni,3,3,"td",49),s(14,Vi,3,3,"td",49),n()),i&2){let e=t.$implicit,l=t.$index,a=c(3);r(2),d("innerHTML",l+1+".",w),r(2),d("queryParams",Z(11,Ue,e.VariantID)),r(),S(e.Variant.Name),r(2),S(e.Variant.Code),r(),u(e.Note!=null?8:-1),r(2),S(g(11,9,e.Quantity)),r(2),u(a.isItemHasUom()?12:-1),r(),u(!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.Cost?13:-1),r(),u(!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.Cost?14:-1)}}function ki(i,t){i&1&&_(0,"td",47)}function Li(i,t){i&1&&_(0,"td",47)}function Bi(i,t){if(i&1&&(o(0,"td",37),m(1),f(2,"sumMultiply"),f(3,"number"),n()),i&2){let e=c(3);r(),b(" ",g(3,5,z(2,1,e.data().Data.Materials,"Quantity","Cost"))," ")}}function ji(i,t){if(i&1&&(o(0,"table",27)(1,"thead",31)(2,"tr")(3,"th",32),m(4,"No"),n(),o(5,"th"),m(6,"Name"),n(),o(7,"th",33),m(8,"Qty"),n(),s(9,Oi,2,0,"th",34),s(10,Ei,4,1,"th",46),s(11,Ti,4,1,"th",46),n()(),o(12,"tbody"),G(13,Fi,15,13,"tr",null,q),n(),o(15,"tfoot")(16,"tr",35),_(17,"td",47),o(18,"td",37),m(19,"Total"),n(),o(20,"td",37),m(21),f(22,"sum"),n(),s(23,ki,1,0,"td",47),s(24,Li,1,0,"td",47),s(25,Bi,4,7,"td",37),n()()()),i&2){let e=c(2);r(9),u(e.isItemHasUom()?9:-1),r(),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?10:-1),r(),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?11:-1),r(2),K(e.data().Data.Materials),r(8),b(" ",ee(22,7,e.data().Data.Materials,"Quantity")," "),r(2),u(e.isItemHasUom()?23:-1),r(),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?24:-1),r(),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?25:-1)}}function Ai(i,t){i&1&&(o(0,"th",34),m(1,"Uom"),n())}function Hi(i,t){if(i&1&&(o(0,"th",46),m(1," Cost ("),_(2,"span",21),m(3,") "),n()),i&2){let e=c(3);r(2),d("innerHTML",e.data().CurrencySymbol,w)}}function Ji(i,t){if(i&1&&(o(0,"th",46),m(1," Total ("),_(2,"span",21),m(3,") "),n()),i&2){let e=c(3);r(2),d("innerHTML",e.data().CurrencySymbol,w)}}function Qi(i,t){if(i&1&&(_(0,"p",21),f(1,"newlines")),i&2){let e=c().$implicit;d("innerHTML",g(1,1,e.Note),w)}}function Ri(i,t){if(i&1&&(o(0,"td"),m(1),n()),i&2){let e=c().$implicit;r(),S(e.Variant.UOMName)}}function Wi(i,t){if(i&1&&(o(0,"td",49),_(1,"span",21),f(2,"number"),n()),i&2){let e=c().$implicit;r(),d("innerHTML",g(2,1,e.Cost),w)}}function Ui(i,t){if(i&1&&(o(0,"td",49),_(1,"span",21),f(2,"number"),n()),i&2){let e=c().$implicit;r(),d("innerHTML",g(2,1,e.Cost*e.Quantity),w)}}function $i(i,t){if(i&1&&(o(0,"tr")(1,"td"),_(2,"span",21),n(),o(3,"td")(4,"a",48),m(5),n(),o(6,"div"),m(7),n(),s(8,Qi,2,3,"p",21),n(),o(9,"td",49),m(10),f(11,"number"),n(),s(12,Ri,2,1,"td"),s(13,Wi,3,3,"td",49),s(14,Ui,3,3,"td",49),n()),i&2){let e=t.$implicit,l=t.$index,a=c(3);r(2),d("innerHTML",l+1+".",w),r(2),d("queryParams",Z(11,Ue,e.VariantID)),r(),S(e.Variant.Name),r(2),S(e.Variant.Code),r(),u(e.Note!=null?8:-1),r(2),S(g(11,9,e.Quantity)),r(2),u(a.isExpenseItemHasUom()?12:-1),r(),u(!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.Cost?13:-1),r(),u(!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.Cost?14:-1)}}function zi(i,t){if(i&1&&(o(0,"td",38),m(1),f(2,"sumMultiply"),f(3,"number"),n()),i&2){let e=c(3);d("colSpan",e.isExpenseItemHasUom()?3:2),r(),b(" ",g(3,6,z(2,2,e.data().Data.Expenses,"Quantity","Cost"))," ")}}function qi(i,t){if(i&1&&(o(0,"div",8)(1,"div",25)(2,"h2",26),m(3,"Expense Items"),n()(),o(4,"div",18)(5,"table",27)(6,"thead",31)(7,"tr")(8,"th",32),m(9,"No"),n(),o(10,"th"),m(11,"Name"),n(),o(12,"th",33),m(13,"Qty"),n(),s(14,Ai,2,0,"th",34),s(15,Hi,4,1,"th",46),s(16,Ji,4,1,"th",46),n()(),o(17,"tbody"),G(18,$i,15,13,"tr",null,q),n(),o(20,"tfoot")(21,"tr",35)(22,"td",36),m(23,"Total"),n(),o(24,"td",37),m(25),f(26,"sum"),f(27,"number"),n(),s(28,zi,4,8,"td",38),n()()()()()),i&2){let e=c(2);r(14),u(e.isExpenseItemHasUom()?14:-1),r(),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?15:-1),r(),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?16:-1),r(2),K(e.data().Data.Expenses),r(7),b(" ",g(27,8,ee(26,5,e.data().Data.Expenses,"Quantity"))," "),r(3),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?28:-1)}}function Gi(i,t){if(i&1&&(o(0,"small",30),m(1),f(2,"sumMultiply"),f(3,"sumMultiply"),f(4,"number"),n()),i&2){let e=c(2);r(),b(" (Differences ",g(4,9,e.totalOutputCost()-z(2,1,e.data().Data.Materials,"Quantity","Cost")-z(3,5,e.data().Data.Expenses,"Quantity","Cost")),") ")}}function Ki(i,t){i&1&&(o(0,"th",34),m(1,"Uom"),n())}function Yi(i,t){if(i&1&&(o(0,"th",46),m(1," Cost ("),_(2,"span",21),m(3,") "),n(),o(4,"th",46),m(5," Total ("),_(6,"span",21),m(7,") "),n()),i&2){let e=c(2);r(2),d("innerHTML",e.data().CurrencySymbol,w),r(4),d("innerHTML",e.data().CurrencySymbol,w)}}function Xi(i,t){if(i&1&&(_(0,"p",21),f(1,"newlines")),i&2){let e=c().$implicit;d("innerHTML",g(1,1,e.Note),w)}}function Zi(i,t){if(i&1&&(o(0,"td"),m(1),n()),i&2){let e=c().$implicit;r(),b(" ",e.Variant==null?null:e.Variant.UOMName," ")}}function en(i,t){if(i&1&&(o(0,"td",49),m(1),f(2,"number"),n(),o(3,"td",49),m(4),f(5,"number"),n()),i&2){let e=c().$implicit;r(),b(" ",g(2,2,e.Cost)," "),r(3),b(" ",g(5,4,e.Cost*e.Quantity)," ")}}function tn(i,t){if(i&1&&(o(0,"tr")(1,"td"),_(2,"span",21),n(),o(3,"td")(4,"a",48),m(5),n(),o(6,"div"),m(7),n(),s(8,Xi,2,3,"p",21),n(),o(9,"td",49),m(10),f(11,"number"),n(),s(12,Zi,2,1,"td"),s(13,en,6,6),n()),i&2){let e=t.$implicit,l=t.$index,a=c(2);r(2),d("innerHTML",l+1+".",w),r(2),d("queryParams",Z(10,Ue,e.VariantID)),r(),S(e.Variant==null?null:e.Variant.Name),r(2),b(" ",e.Variant==null?null:e.Variant.Code," "),r(),u(e.Note!=null?8:-1),r(2),b(" ",g(11,8,e.Quantity)," "),r(2),u(a.isOutputItemHasUom()?12:-1),r(),u(!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.Cost?13:-1)}}function nn(i,t){if(i&1&&(o(0,"td",38),m(1),f(2,"number"),n()),i&2){let e=c(2);d("colSpan",e.isOutputItemHasUom()?3:2),r(),b(" ",g(2,2,e.totalOutputCost())," ")}}function on(i,t){if(i&1&&(o(0,"mainpanel-cmp",0)(1,"actions"),s(2,Si,3,1,"a",1),o(3,"div",2),s(4,Mi,3,5,"a",3),s(5,Di,3,0,"a",4),n()(),o(6,"content")(7,"div",5)(8,"div",6)(9,"div",7)(10,"div",8)(11,"div",9)(12,"h2",10),_(13,"i",11),m(14),f(15,"TruncateText"),n(),o(16,"div",2)(17,"button",12),_(18,"b",13),n(),o(19,"ul",14)(20,"li",15)(21,"a",16),_(22,"i",17),m(23," Print "),n()(),s(24,Ii,4,0,"li",15),n()()(),o(25,"div",18)(26,"table",19)(27,"tr")(28,"th",20),m(29,"Name"),n(),o(30,"td"),m(31," : "),_(32,"span",21),n()(),o(33,"tr")(34,"th"),m(35,"Sales Order"),n(),o(36,"td"),m(37," : "),o(38,"a",22),m(39),n()()(),o(40,"tr")(41,"th"),m(42,"Date"),n(),o(43,"td"),m(44," : "),_(45,"span",21),f(46,"date"),n()(),o(47,"tr")(48,"th"),m(49,"State"),n(),o(50,"td"),m(51," : "),_(52,"span",21),n()(),o(53,"tr")(54,"th",23),m(55,"Note"),n(),o(56,"td",23),m(57," : "),_(58,"span",21),n()()()()()(),o(59,"div",24)(60,"div",8)(61,"div",25)(62,"h2",26),m(63,"Material Items"),n()(),o(64,"div",18),s(65,ji,26,10,"table",27),n()(),s(66,qi,29,10,"div",8),o(67,"div",8)(68,"div",25)(69,"div",28)(70,"h2",29),m(71," Output Items "),s(72,Gi,5,11,"small",30),f(73,"sumMultiply"),n()()(),o(74,"div",18)(75,"table",27)(76,"thead",31)(77,"tr")(78,"th",32),m(79,"No"),n(),o(80,"th"),m(81,"Name"),n(),o(82,"th",33),m(83,"Qty"),n(),s(84,Ki,2,0,"th",34),s(85,Yi,8,2),n()(),o(86,"tbody"),G(87,tn,14,12,"tr",null,q),n(),o(89,"tfoot")(90,"tr",35)(91,"td",36),m(92,"Total"),n(),o(93,"td",37),m(94),f(95,"sum"),f(96,"number"),n(),s(97,nn,3,4,"td",38),n()()()()()()()()()()),i&2){let e,l,a,p=c();d("pageData",p.menuData())("hideSearchBox",!0)("hideSearchDropdown",!0),r(2),u(p.data().Data.Order.State!=3?2:-1),r(2),u(p.data().Data.Order.State===1&&(!(p.roleService==null||p.roleService.manufacture==null)&&p.roleService.manufacture.Edit)?4:-1),r(),u(!(p.roleService==null||p.roleService.manufacture==null)&&p.roleService.manufacture.Delete?5:-1),r(9),b(" ",g(15,24,(e=p.data().Data)==null||e.Order==null?null:e.Order.EntityName)," "),r(7),d("routerLink",p.data().Data.Order.PrintUrl)("queryParams",Se(38,vi,p.data().Data.Order.ID,p.data().Data.Order.EntityPrintTemplateID)),r(3),u(!(p.roleService==null||p.roleService.global==null)&&p.roleService.global.Export?24:-1),r(8),d("innerHTML",p.data().Data.Order.Name,w),r(6),d("routerLink",te(41,bi))("queryParams",Z(42,Ue,p.data().Data.Order.SalesOrderID)),r(),S(p.data().Data.Order.SalesOrderNumber),r(6),d("innerHTML",ee(46,26,p.data().Data.Order.Date,"dd MMM yyyy"),w),r(7),d("innerHTML",p.data().Data.Order.StateDisplay,w),r(6),d("innerHTML",p.data().Data.Order.Note,w),r(7),u(p.data().Data.Materials.length?65:-1),r(),u(((l=p.data().Data)==null||l.Expenses==null?null:l.Expenses.length)>0?66:-1),r(6),u(p.Math.floor(p.totalOutputCost()-z(73,29,p.data().Data.Materials,"Quantity","Cost"))!=0?72:-1),r(12),u(p.isOutputItemHasUom()?84:-1),r(),u(!(p.roleService==null||p.roleService.product==null)&&p.roleService.product.Cost?85:-1),r(2),K((a=p.data().Data)==null?null:a.Outputs),r(7),b(" ",g(96,36,ee(95,33,p.data().Data.Outputs,"Quantity"))," "),r(3),u(!(p.roleService==null||p.roleService.product==null)&&p.roleService.product.Cost?97:-1)}}var Ct=class i extends Fe{constructor(e,l,a,p,M,j,J){super(e,l,"Manufacture/Info",void 0,p,a);this.toastr=p;this.router=M;this.csvConverter=j;this.roleService=J}toastr;router;csvConverter;roleService;Math=Math;isItemHasUom=E(!1);isOutputItemHasUom=E(!1);isExpenseItemHasUom=E(!1);totalOutputCost=E(0);preGetList(){let e=this.route?.snapshot.queryParams;this.pageData().Filter.ID=e?.ID}postInit(e){this.menuData.update(l=>I(h({},l),{H:e.PageTitle})),this.checkItemHasUom(e.Data?.Materials),this.checkOutputItemHasUom(e.Data?.Outputs),this.calculateTotalOutputCost(e.Data?.Outputs),this.checkExpenseItemHasUom(e.Data?.Expenses)}checkItemHasUom(e=[]){let l=e.some(a=>D.IsNotEmpty(a.Variant?.UOMName));this.isItemHasUom.set(l)}checkOutputItemHasUom(e=[]){let l=e.some(a=>D.IsNotEmpty(a.Variant?.UOMName));this.isOutputItemHasUom.set(l)}checkExpenseItemHasUom(e=[]){let l=e.some(a=>D.IsNotEmpty(a.Variant?.UOMName));this.isExpenseItemHasUom.set(l)}calculateTotalOutputCost(e=[]){let l=e.reduce((a,p)=>a+p.Cost*p.Quantity,0);this.totalOutputCost.set(l)}process(e){let l=this.data().Data.Order.State===1?"API/Manufacture/ProcessInProgress":"/API/Manufacture/ProcessOrder";this.httpService.post(l,e).subscribe({next:a=>{this.toastr.success(a.Message,xe.Success),this.getListData()},error:a=>{this.toastr.error(a,xe.Error)}})}delete(e,l){confirm("Are you sure you want to delete this job order?")&&this.httpService.delete(e,{params:[{key:"ID",value:l}]}).subscribe({next:a=>{this.router.navigate(["/menu/Manufacture/Job_Order/Archive"])},error:a=>{this.toastr.error(a,xe.Error)}})}static \u0275fac=function(l){return new(l||i)(O(ye),O(W),O(mt),O(ge),O(Ut),O(je),O(U))};static \u0275cmp=A({type:i,selectors:[["POS-job-order-info"]],standalone:!1,features:[Pe],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-4"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],[1,"title","mb-0"],["aria-hidden","true",1,"fa","fa-location-dot"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end","cursor","text-dark"],[1,"dropdown-item"],["role","button","target","_blank","matTooltipPosition","above","matTooltip","Print",3,"routerLink","queryParams"],[1,"fa","fa-print"],[1,"card-body"],[1,"table-sm","table-borderless"],[2,"width","75px"],[3,"innerHTML"],["target","_blank",3,"routerLink","queryParams"],["valign","top"],[1,"col-sm-8"],[1,"card-header"],[1,"title"],[1,"table","custom-table"],[1,"me-auto","d-sm-block","mt-3"],[1,"d-inline"],[1,"text-danger","fst-italic"],[1,"thead-light"],[2,"width","20px"],[1,"text-end",2,"width","40px"],[2,"width","50px"],[1,"table-footer"],["colspan","2",1,"empty-column","text-end"],[1,"empty-column","text-end"],[1,"empty-column","text-end",3,"colSpan"],[1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa-solid","fa-industry"],[1,"fa-solid","fa-pen-to-square"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash"],[3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"text-end",2,"width","90px"],[1,"empty-column"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"text-end"]],template:function(l,a){l&1&&s(0,on,98,44,"mainpanel-cmp",0),l&2&&u(a.data()?0:-1)},dependencies:[Ce,be,Ve,ie,rt,Ae,oi,ve,ai],encapsulation:2,changeDetection:0})};var pn=()=>["/menu/Manufacture/Job_Order/Archive/Form"],cn=()=>["/menu/Manufacture/Job_Order/Archive/Info"],dn=i=>({ID:i}),sn=()=>["/print/JobOrderMini"],un=(i,t)=>({ID:i,Template:t});function fn(i,t){if(i&1){let e=T();o(0,"a",18),v("click",function(){x(e);let a=c(2);return y(a.httpPostListID("Manufacture/Delete"))}),_(1,"i",19),m(2,"Delete "),n()}}function _n(i,t){if(i&1){let e=T();o(0,"button",20),v("click",function(){x(e);let a=c(2);return y(a.openExportModal())}),_(1,"i",21),m(2," Export "),n()}}function Cn(i,t){i&1&&(o(0,"a",5),m(1,"New"),n()),i&2&&d("routerLink",te(1,pn))}function gn(i,t){if(i&1){let e=T();o(0,"div",22)(1,"div",23)(2,"h6"),m(3,"Outlet"),n(),o(4,"outlet-selector",24),B("ngModelChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.ListIDs,a)||(p.pageData().Filter.ListIDs=a),y(a)}),n()(),o(5,"div",23)(6,"h6"),m(7,"Output"),n(),o(8,"autocompleteV2",25),v("onInputChange",function(a){x(e);let p=c(2);return y(p.checkTextEmpty(a))})("onSelect",function(a){x(e);let p=c(2);return y(p.selectOutput(a))}),n()(),o(9,"div",23)(10,"h6"),m(11,"From Date"),n(),o(12,"datepicker",26),B("dateChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.From,a)||(p.pageData().Filter.From=a),y(a)}),n()(),o(13,"div",23)(14,"h6"),m(15,"To Date"),n(),o(16,"datepicker",27),B("dateChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.To,a)||(p.pageData().Filter.To=a),y(a)}),n()(),o(17,"div",23)(18,"h6"),m(19,"State"),n(),o(20,"ng-select",28),B("ngModelChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.State,a)||(p.pageData().Filter.State=a),y(a)}),n()(),o(21,"div",23)(22,"h6"),m(23,"Order"),n(),o(24,"ng-select",29),B("ngModelChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.Order,a)||(p.pageData().Filter.Order=a),y(a)}),n()(),o(25,"div",23)(26,"h6"),m(27,"Page Size"),n(),o(28,"input",30),B("ngModelChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.RowCount,a)||(p.pageData().Filter.RowCount=a),y(a)}),n()()()}if(i&2){let e=c(2);r(4),d("accessType",2),k("ngModel",e.pageData().Filter.ListIDs),d("multiple",!0),r(4),d("renderThumbnail",!0),r(4),d("isFloatingLabel",!1),k("date",e.pageData().Filter.From),r(4),d("isFloatingLabel",!1),k("date",e.pageData().Filter.To),r(4),d("items",e.pageData().Options.States),k("ngModel",e.pageData().Filter.State),r(4),d("items",e.order),k("ngModel",e.pageData().Filter.Order),d("clearable",!1),r(4),d("max",1e4),k("ngModel",e.pageData().Filter.RowCount)}}function xn(i,t){if(i&1){let e=T();o(0,"th",10)(1,"input",31),v("change",function(a){x(e);let p=c(2);return y(p.onSelectAllData(a.target.checked))}),n()()}}function yn(i,t){if(i&1){let e=T();o(0,"td")(1,"input",36),B("ngModelChange",function(a){x(e);let p=c().$implicit;return L(p.selected,a)||(p.selected=a),y(a)}),n()()}if(i&2){let e=c().$implicit;r(),k("ngModel",e.selected)}}function vn(i,t){if(i&1&&(o(0,"tr"),s(1,yn,2,1,"td"),o(2,"td"),m(3),n(),o(4,"td"),m(5),f(6,"date"),n(),o(7,"td")(8,"a",32),m(9),n()(),_(10,"td",33),o(11,"td"),m(12),n(),o(13,"td")(14,"a",34),_(15,"i",35),n()()()),i&2){let e=t.$implicit,l=c(2);r(),u(l.roleService.manufacture.Delete?1:-1),r(2),S(e.EntityName),r(2),S(ee(6,10,e.Date,"dd MMM yyyy")),r(3),d("routerLink",te(13,cn))("queryParams",Z(14,dn,e.ID)),r(),S(e.Number),r(),d("innerHTML",e.Note,w),r(2),S(e.StateDisplay),r(2),d("routerLink",te(16,sn))("queryParams",Se(17,un,e.ID,e.EntityPrintTemplateID))}}function bn(i,t){if(i&1){let e=T();o(0,"mat-paginator",37),v("page",function(a){x(e);let p=c(2);return y(p.onPaginationChange(a))}),n()}if(i&2){let e=c(2);d("length",e.pagination.listTotal())("pageSize",e.pagination.pageSize())("pageIndex",e.pageData().Filter.PageNumber==0?0:e.pageData().Filter.PageNumber-1)}}function hn(i,t){if(i&1){let e=T();o(0,"mainpanel-cmp",2),B("textChange",function(a){x(e);let p=c();return L(p.pageData().Filter.Number,a)||(p.pageData().Filter.Number=a),y(a)}),v("onSubmit",function(){x(e);let a=c();return y(a.searchFromPageOne())}),B("filterChange",function(a){x(e);let p=c();return L(p.pageData().Filter,a)||(p.pageData().Filter=a),y(a)}),o(1,"actions"),s(2,fn,3,0,"a",3),s(3,_n,3,0,"button",4),s(4,Cn,2,2,"a",5),n(),o(5,"filters"),nt(6,gn,29,15,"ng-template",null,0,ot),n(),o(8,"content")(9,"div",6)(10,"div",7)(11,"table",8),v("matSortChange",function(a){x(e);let p=c();return y(p.sortData(a))}),o(12,"thead",9)(13,"tr"),s(14,xn,2,0,"th",10),o(15,"th",11),m(16,"Outlet"),n(),o(17,"th",12),m(18,"Date"),n(),o(19,"th",13),m(20,"Number"),n(),o(21,"th",14),m(22,"Production Output"),n(),o(23,"th",15),m(24,"State"),n(),_(25,"th",16),n()(),o(26,"tbody"),G(27,vn,16,20,"tr",null,q),n()()(),o(29,"div"),s(30,bn,1,3,"mat-paginator",17),n()()()()}if(i&2){let e=c();d("pageData",e.menuData()),k("text",e.pageData().Filter.Number),d("isFilterOnDropdown",!1),k("filter",e.pageData().Filter),r(2),u(e.getSelectedData().length>0?2:-1),r(),u(e.roleService.global.Export?3:-1),r(),u(e.roleService.manufacture.Create?4:-1),r(10),u(e.roleService.manufacture.Delete?14:-1),r(13),K(e.data().Data),r(3),u(e.pagination.listTotal()>0?30:-1)}}var gt=class i extends Fe{constructor(e,l,a,p,M,j){super(e,l,"Manufacture/List","Manufacture/ListLoader",a);this.csvConverter=p;this.roleService=M;this.matDialog=j}csvConverter;roleService;matDialog;originalData=E(null);order=E([{Value:"Ascending",Key:0},{Value:"Descending",Key:1}]);postInit(e){this.originalData=e.Data}selectOutput(e){this.pageData().Filter.Output=e}checkTextEmpty(e){e==""&&(this.pageData().Filter.Output=null)}sortData(e){let l=this.data().Data.slice();if(!e.active||e.direction===""){this.data().Data=this.originalData;return}this.data().Data=l.sort((a,p)=>{let M=e.direction==="asc";switch(e.active){case"date":return this.compare(a.Date,p.Date,M);case"number":return this.compare(a.Number,p.Number,M);case"production":return this.compare(a.Note,p.Note,M);default:return 0}})}openExportModal(){this.matDialog.open(dt,{data:{title:"Manufacture",exportTypes:[{ID:"Manufacture/ListExport",Value:"Default",FileName:"Manufacture List"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!0}})}static \u0275fac=function(l){return new(l||i)(O(ye),O(W),O(ge),O(je),O(U),O(pe))};static \u0275cmp=A({type:i,selectors:[["POS-job-order-list"]],standalone:!1,features:[Pe],decls:1,vars:1,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"pageData","text","isFilterOnDropdown","filter"],["filterDialogWidth","600px",3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-5"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","24px"],[2,"width","80px"],["mat-sort-header","date",2,"width","100px"],["mat-sort-header","number",2,"width","120px"],["mat-sort-header","production"],[2,"width","60px"],[2,"width","26px"],[3,"length","pageSize","pageIndex"],[1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100","ac-filter",3,"onInputChange","onSelect","renderThumbnail"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose..",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel","clearable"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["type","checkbox",3,"change"],[3,"routerLink","queryParams"],[3,"innerHTML"],["target","_blank",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa","fa-print"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"page","length","pageSize","pageIndex"]],template:function(l,a){l&1&&s(0,hn,31,9,"mainpanel-cmp",1),l&2&&u(a.data()?0:-1)},dependencies:[pt,$t,Y,X,Zt,Ce,Je,Be,st,be,Kt,Yt,ct,He,rt],encapsulation:2,changeDetection:0})};var _i=()=>["/menu/Products/Catalog/Variants/Info"],Ci=i=>({ID:i});function Sn(i,t){if(i&1){let e=T();o(0,"button",21),v("click",function(){x(e);let a=c(2);return y(a.openExportModal())}),_(1,"i",22),m(2," Export "),n()}}function Mn(i,t){if(i&1){let e=T();o(0,"div",23)(1,"h6"),m(2,"Outlet"),n(),o(3,"outlet-selector",24),B("ngModelChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.EntityID,a)||(p.pageData().Filter.EntityID=a),y(a)}),n(),o(4,"h6"),m(5,"From"),n(),o(6,"datepicker",25),B("dateChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.From,a)||(p.pageData().Filter.From=a),y(a)}),n(),o(7,"h6"),m(8,"To"),n(),o(9,"datepicker",26),B("dateChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.To,a)||(p.pageData().Filter.To=a),y(a)}),n()()}if(i&2){let e=c(2);r(3),d("accessType",4),k("ngModel",e.pageData().Filter.EntityID),d("multiple",!1),r(3),d("isFloatingLabel",!1),k("date",e.pageData().Filter.From),r(3),d("isFloatingLabel",!1),k("date",e.pageData().Filter.To)}}function Dn(i,t){if(i&1&&(o(0,"tr")(1,"td"),m(2),n(),o(3,"td")(4,"a",27),m(5),n()(),o(6,"td",28),m(7),n()()),i&2){let e=t.$implicit;r(2),S(e.VariantCode),r(2),d("routerLink",te(5,_i))("queryParams",Z(6,Ci,e.VariantID)),r(),S(e.VariantName),r(2),b(" ",e.Quantity," ")}}function In(i,t){if(i&1&&(o(0,"tr")(1,"td"),m(2),n(),o(3,"td")(4,"a",27),m(5),n()(),o(6,"td",29),m(7),n()()),i&2){let e=t.$implicit;r(2),S(e.VariantCode),r(2),d("routerLink",te(5,_i))("queryParams",Z(6,Ci,e.VariantID)),r(),S(e.VariantName),r(2),b(" ",e.Quantity," ")}}function On(i,t){if(i&1){let e=T();o(0,"mainpanel-cmp",2),v("onSubmit",function(){x(e);let a=c();return y(a.searchFromPageOne())}),B("filterChange",function(a){x(e);let p=c();return L(p.pageData().Filter,a)||(p.pageData().Filter=a),y(a)}),o(1,"actions"),s(2,Sn,3,0,"button",3),n(),o(3,"filters"),nt(4,Mn,10,7,"ng-template",null,0,ot),n(),o(6,"content")(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h2",9),m(13,"Material Used"),n()(),o(14,"div",10)(15,"table",11)(16,"thead",12)(17,"tr")(18,"th"),m(19,"Code"),n(),o(20,"th"),m(21,"Name"),n(),o(22,"th",13),m(23,"Quantity"),n()()(),o(24,"tbody"),G(25,Dn,8,8,"tr",null,q),n()(),o(27,"div",14)(28,"table",15)(29,"tr")(30,"th"),m(31,"Total"),n(),o(32,"td",16),m(33,":"),n(),o(34,"td",17),m(35),f(36,"sum"),f(37,"number"),n()()()()()()(),o(38,"div",18)(39,"div",7)(40,"div",8)(41,"h2",9),m(42,"Output"),n()(),o(43,"div",10)(44,"table",11)(45,"thead",12)(46,"tr")(47,"th"),m(48,"Code"),n(),o(49,"th"),m(50,"Name"),n(),o(51,"th",19),m(52,"Quantity"),n()()(),o(53,"tbody"),G(54,In,8,8,"tr",null,q),n()(),o(56,"div",14)(57,"table",15)(58,"tr")(59,"th"),m(60,"Total"),n(),o(61,"td",16),m(62,":"),n(),o(63,"td",20),m(64),f(65,"sum"),f(66,"number"),n()()()()()()()()()()()}if(i&2){let e=c();d("pageData",e.menuData())("hideSearchBox",!0)("isFilterOnDropdown",!1),k("filter",e.pageData().Filter),r(2),u(e.roleService.global.Export?2:-1),r(23),K(e.data().Material),r(10),b(" ",g(37,10,ee(36,7,e.data().Material,"Quantity"))," "),r(19),K(e.data().Output),r(10),b(" ",g(66,15,ee(65,12,e.data().Output,"Quantity"))," ")}}var yt=class i extends Fe{constructor(e,l,a,p,M){super(e,l,"Manufacture/ManufactureProduction","ManufactureLoader/ManufactureProduction");this.csvConverter=a;this.roleService=p;this.matDialog=M}csvConverter;roleService;matDialog;openExportModal(){this.matDialog.open(dt,{data:{title:"Manufacture Report",exportTypes:[{ID:"Manufacture/ExportManufacture",Value:"Default",FileName:"Manufacture Report"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!0}})}static \u0275fac=function(l){return new(l||i)(O(ye),O(W),O(je),O(U),O(pe))};static \u0275cmp=A({type:i,selectors:[["POS-manufacture-production"]],standalone:!1,features:[Pe],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-5"],[1,"card"],[1,"card-header"],[1,"title"],[1,"card-body"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"d-flex","justify-content-end","mt-8","me-2"],["cellspacing","0","cellpadding","0",1,"form-horizontal",2,"width","64px"],[2,"width","10px"],[2,"color","red"],[1,"col-sm-7"],[1,"text-end",2,"width","20px"],[1,"text-primary"],[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",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[3,"routerLink","queryParams"],[1,"text-end",2,"color","red"],[1,"text-end","text-primary"]],template:function(l,a){l&1&&s(0,On,67,17,"mainpanel-cmp",1),l&2&&u(a.data()?0:-1)},dependencies:[Y,X,Ce,Je,be,He,ie,Ae],encapsulation:2,changeDetection:0})};var P=class i{state=ci({isEdit:!1,manufactureMaterialMode:0,submitWithMismatch:!1,loadFormData:null,expenses:[],materials:[],outputs:[],outlet:{Name:"Choose an Outlet",ID:D.GuidEmpty,PrintTemplateID:0},outlets:[],invoiceDate:new Date,invoiceNumber:"",jobDescription:"",incompleteOrders:[],SalesOrderNumber:void 0,note:"",completeData:null});isEdit=this.state.select(t=>t.isEdit());manufactureMaterialMode=this.state.select(t=>t.manufactureMaterialMode());submitWithMismatch=this.state.select(t=>t.submitWithMismatch());loadFormData=this.state.select(t=>t.loadFormData());expenses=this.state.select(t=>t.expenses());materials=this.state.select(t=>t.materials());outputs=this.state.select(t=>t.outputs());outlet=this.state.select(t=>t.outlet());outlets=this.state.select(t=>t.outlets());invoiceDate=this.state.select(t=>t.invoiceDate());invoiceNumber=this.state.select(t=>t.invoiceNumber());jobDescription=this.state.select(t=>t.jobDescription());incompleteOrders=this.state.select(t=>t.incompleteOrders());SalesOrderNumber=this.state.select(t=>t.SalesOrderNumber());note=this.state.select(t=>t.note());completeData=this.state.select(t=>t.completeData());constructor(){}updateIsEdit(t){this.state.update("isEdit",t)}updateManufactureMaterialMode(t){this.state.update("manufactureMaterialMode",t)}updateLoadFormData(t){this.state.update("loadFormData",t)}updateSubmitWithMismatch(t){this.state.update("submitWithMismatch",t)}updateExpenses(t){this.state.update("expenses",t)}updateMaterials(t){this.state.update("materials",t)}updateOutputs(t){this.state.update("outputs",t)}updateOutlet(t){this.state.update("outlet",t)}updateOutlets(t){this.state.update("outlets",t)}updateInvoiceDate(t){this.state.update("invoiceDate",t)}updateInvoiceNumber(t){this.state.update("invoiceNumber",t)}updateJobDescription(t){this.state.update("jobDescription",t)}updateIncompleteOrders(t){this.state.update("incompleteOrders",t)}updateSalesOrderNumber(t){this.state.update("SalesOrderNumber",t)}updateNote(t){this.state.update("note",t)}updateCompleteData(t){this.state.update("completeData",t)}getCart(t){if(t==="Expenses")return this.expenses();if(t==="Materials")return this.materials();if(t==="Outputs")return this.outputs()}updateCart(t,e){t==="Expenses"?this.updateExpenses(e):t==="Materials"?this.updateMaterials(e):t==="Outputs"&&this.updateOutputs(e)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var Te=class i{store=C(P);isOpenOutletDialog=E(!0);updateIsOpenOutletDialog$=Q(this.store.isEdit).pipe(V(t=>!t),N(t=>this.isOpenOutletDialog.set(t)),jt(1));constructor(){this.updateIsOpenOutletDialog$.subscribe()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var $e=class i{store=C(P);http=C(W);assignGeneratedInvoiceNumber$=Re(Q(this.store.outlet).pipe(F(t=>!this.store.isEdit()&&D.IsNotEmpty(t.ID))),Q(this.store.completeData).pipe(F(t=>D.IsNotEmpty(t)),V(()=>this.store.outlet()))).pipe(V(t=>t.ID),re(t=>this.http.post("/API/Transaction/GenerateNumber",{entityID:t,typeID:14})),N(t=>this.store.updateInvoiceNumber(t)),le());assignInvoiceNumberOnEdit$=Q(this.store.loadFormData).pipe(F(()=>this.store.isEdit()),N(t=>this.updateInvoiceNumber(t?.Order.Number)));constructor(){this.assignGeneratedInvoiceNumber$.subscribe(),this.assignInvoiceNumberOnEdit$.subscribe()}updateInvoiceNumber(t){this.store.updateInvoiceNumber(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var ze=class i{route=C(mt);store=C(P);http=C(W);loadForm$=Bt(this.route.snapshot.queryParams).pipe(N(t=>this.store.updateIsEdit(D.IsNotEmpty(t?.ID))),re(t=>this.http.post("/api/Manufacture/FormLoad",{ID:t?.ID})),N(t=>{this.store.updateManufactureMaterialMode(t.Configs.ManufactureMaterialMode),this.store.updateSubmitWithMismatch(t.Configs.SubmitWithMismatch),this.store.updateLoadFormData(t.Data),this.store.updateOutlets(t.Options.Entities),this.store.updateIncompleteOrders(t.Options.IncompleteOrders),this.store.updateSalesOrderNumber(t.Data.Order.SalesOrderID),this.store.updateNote(t.Data.Order.Note),this.store.updateOutputs(t.Data?.Outputs?.map(e=>I(h({},e),{ManufacturedComponent:e.Variant.ManufacturedComponent}))??[]),this.store.updateExpenses(t.Data.Expenses??[]),this.store.updateMaterials(t.Data.Materials??[]),this.store.updateJobDescription(t.Data.Order.Name)}),le());constructor(){this.loadForm$.subscribe()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var qe=class i{store=C(P);assignOutletOnEdit$=Q(this.store.loadFormData).pipe(F(t=>this.store.isEdit()&&D.IsNotEmpty(t?.Order.EntityID)),N(t=>this.updateOutlet({ID:t.Order.EntityID,Name:t.Order.EntityName,PrintTemplateID:0})),le());constructor(){this.assignOutletOnEdit$.subscribe()}updateOutlet(t){this.store.updateOutlet(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var we=class i{store=C(P);isOpen=C(Te);assignIsEdit$=Q(this.store.loadFormData).pipe(F(t=>D.IsNotEmpty(t)),V(t=>D.IsNotEmpty(t?.Order.ID)));constructor(){}createNewTransaction(){this.store.updateIsEdit(!1),this.isOpen.isOpenOutletDialog.set(!1),this.store.updateExpenses([]),this.store.updateMaterials([]),this.store.updateOutputs([]),this.store.updateInvoiceDate(new Date),this.store.updateJobDescription(""),this.store.updateSalesOrderNumber(void 0),this.store.updateCompleteData(null)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};function wn(i,t){if(i&1&&(o(0,"h5",9),m(1),n()),i&2){let e=c(2);r(),b(" ",e.extraTitle()," ")}}function Pn(i,t){if(i&1){let e=T();o(0,"a",11),v("click",function(){x(e);let a=c(2);return y(a.requestUnitInStock())}),_(1,"i",12),n()}}function Nn(i,t){if(i&1&&(o(0,"header"),s(1,wn,2,1,"h5",9),s(2,Pn,2,0,"a",10),n()),i&2){let e=c();r(),u(e.toggleInventory()?1:-1),r(),u(e.toggleInventory()?-1:2)}}function Vn(i,t){if(i&1){let e=T();o(0,"autocompleteV2",13),v("onSelect",function(a){x(e);let p=c();return y(p.selectItem(a))})("onInputEnter",function(a){x(e);let p=c();return y(p.scanCode(a))})("keyup.enter",function(a){return a.stopPropagation()}),n()}i&2&&d("renderThumbnail",!0)}function Fn(i,t){if(i&1){let e=T();o(0,"input",6),B("ngModelChange",function(a){x(e);let p=c(2);return L(p.item().Cost,a)||(p.item().Cost=a),y(a)}),n()}if(i&2){let e=c(2);k("ngModel",e.item().Cost)}}function kn(i,t){if(i&1&&_(0,"input",15),i&2){let e=c(2);d("ngModel",e.item().Cost)}}function Ln(i,t){if(i&1&&(o(0,"div",5)(1,"h6"),m(2,"Cost:"),n(),s(3,Fn,1,1,"input",14),s(4,kn,1,1,"input",15),n()),i&2){let e=c();r(3),u(e.data.isDisableCost?-1:3),r(),u(e.data.isDisableCost?4:-1)}}var vt=class i{constructor(t,e,l,a,p){this.data=t;this.httpService=e;this.dialogRef=l;this.toastr=a;this.roleService=p;this.config.update(M=>I(h({},M),{customWidth:"420px"})),this.item.set(Object.assign({},t.item)),this.entityID.set(t.entityID),D.IsEmpty(this.item().Variant)?(this.config.update(M=>I(h({},M),{title:"Add Item"})),this.item.set({})):(this.isEdit.set(!0),this.config.update(M=>I(h({},M),{title:this.item().Variant.Name})),this.previousQuantity.set(this.item().Quantity))}data;httpService;dialogRef;toastr;roleService;extraTitle=E("");isEdit=E(!1);item=E(void 0);config=E(new Ie);entityID=E("");toggleInventory=E(!1);previousQuantity=E(0);selectItem(t){this.httpService.get(De.GetVariantByID,[{key:"ID",value:t},{key:"EntityID",value:this.entityID},{key:"Promotion",value:!1}]).subscribe(e=>{this.config.update(l=>I(h({},l),{title:e.Name})),this.item.update(l=>({Title:e.Name,Variant:e,Cost:e.UnitCost,Quantity:1}))})}onOk(){if(D.IsEmpty(this.item().Quantity)||this.item().Quantity==0){this.toastr.error("Quantity must be greater than zero and can not be empty.",xe.Error);return}if(D.IsEmpty(this.item().Cost)&&this.item().Cost!=0){this.toastr.error("Cost is required.",xe.Error);return}this.dialogRef.close(I(h({},this.item()),{PreviousQuantity:this.previousQuantity()}))}requestUnitInStock(){if(D.IsEmpty(this.entityID())){this.toastr.error("Please select outlet before proceeding..",xe.Error);return}this.httpService.get(De.GetVariantStockByID,[{key:"ID",value:this.item().Variant?.ID},{key:"EntityID",value:this.entityID()}]).subscribe(t=>{this.item().Variant.OnHand=t.OnHand,this.extraTitle.set(` Inventory: ${t.OnHand}`),t.Ordered!==void 0&&(this.item().Variant.Ordered=t.Ordered,this.extraTitle.set(`${this.extraTitle()} , Ordered: ${t.Ordered}`)),this.toggleInventory.set(!0)})}scanCode(t){this.httpService.get(De.GetVariantByCode,[{key:"Code",value:t},{key:"EntityID",value:this.entityID},{key:"BarcodeSerial",value:!1},{key:"Promotion",value:!0}]).subscribe(e=>{this.config.update(l=>I(h({},l),{title:e.Name})),this.item.update(l=>I(h({},l),{Title:e.Name,Variant:e,Cost:e.UnitCost,Quantity:1}))})}static \u0275fac=function(e){return new(e||i)(O(Le),O(W),O(ke),O(ge),O(U))};static \u0275cmp=A({type:i,selectors:[["POS-modal-item"]],standalone:!1,decls:16,vars:6,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row"],[1,"col-12"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"renderThumbnail"],[1,"col-4","mt-5"],["type","text","autoNum","",1,"w-75","form-control",3,"ngModelChange","ngModel"],[1,"col-12","mt-5"],["height","220px",3,"ngModelChange","ngModel"],[1,"ms-5","fw-normal",2,"padding-top","3px"],["matTooltip","Click to view current on-hand inventory","matTooltipPosition","above",1,"ms-5",2,"cursor","pointer"],["matTooltip","Click to view current on-hand inventory","matTooltipPosition","above",1,"ms-5",2,"cursor","pointer",3,"click"],[1,"fa-solid","fa-circle-question","mt-1",2,"font-size","20px","color","white"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"onSelect","onInputEnter","keyup.enter","renderThumbnail"],["type","text","autoNum","",1,"w-75","form-control",3,"ngModel"],["readonly","","type","text","autoNum","",1,"w-75","form-control",2,"background-color","#e9ecef",3,"ngModel"]],template:function(e,l){e&1&&(o(0,"modal-material",0),v("onOk",function(){return l.onOk()})("onCancel",function(){return l.dialogRef.close()})("onClose",function(){return l.dialogRef.close()}),s(1,Nn,3,2,"header"),o(2,"content")(3,"div",1)(4,"div",2)(5,"div",3),s(6,Vn,1,1,"autocompleteV2",4),n(),o(7,"div",5)(8,"h6"),m(9,"Qty:"),n(),o(10,"input",6),B("ngModelChange",function(p){return L(l.item().Quantity,p)||(l.item().Quantity=p),p}),n()(),s(11,Ln,5,2,"div",5),o(12,"div",7)(13,"h6"),m(14,"Note:"),n(),o(15,"POS-tinymce-editor",8),B("ngModelChange",function(p){return L(l.item().Note,p)||(l.item().Note=p),p}),n()()()()()()),e&2&&(d("config",l.config()),r(),u(l.isEdit()?1:-1),r(5),u(l.isEdit()?-1:6),r(4),k("ngModel",l.item().Quantity),r(),u(l.roleService.product.Cost?11:-1),r(4),k("ngModel",l.item().Note))},dependencies:[pt,Y,X,st,ue,ct,Ve,he],styles:["autocompletev2[_ngcontent-%COMP%] input{font-size:14px}"],changeDetection:0})};var fe=class i{matDialog=C(pe);http=C(W);store=C(P);_cartAction=new Lt;cartAction$=this._cartAction.asObservable();outputSearchFilter=E(null);materialSearchFilter=E(null);expenseSearchFilter=E(null);variantFromAutocompleteCode$=Re(Q(this.outputSearchFilter).pipe(V(t=>I(h({},t),{cartType:"Outputs"}))),Q(this.materialSearchFilter).pipe(V(t=>I(h({},t),{cartType:"Materials"}))),Q(this.expenseSearchFilter).pipe(V(t=>I(h({},t),{cartType:"Expenses"})))).pipe(F(t=>D.IsNotEmpty(t)&&t.type=="Code"),V(t=>({code:t.str,cartType:t.cartType})),re(t=>this.http.get(De.GetVariantByCode,[{key:"Code",value:t.code},{key:"EntityID",value:this.store.outlet().ID}]).pipe(V(e=>I(h({},e),{Cost:e.UnitCost,Quantity:1,Variant:h({},e)})),V(e=>({item:e,cartType:t.cartType})),Ze(()=>Xe))),N(t=>this.add(t.item,t.cartType)));variantFromAutocompleteID$=Re(Q(this.outputSearchFilter).pipe(V(t=>I(h({},t),{cartType:"Outputs"}))),Q(this.materialSearchFilter).pipe(V(t=>I(h({},t),{cartType:"Materials"}))),Q(this.expenseSearchFilter).pipe(V(t=>I(h({},t),{cartType:"Expenses"})))).pipe(F(t=>D.IsNotEmpty(t)&&t.type=="ID"),V(t=>({id:t.str,cartType:t.cartType})),re(t=>this.http.get(De.GetVariantByID,[{key:"ID",value:t.id},{key:"EntityID",value:this.store.outlet().ID}]).pipe(V(e=>I(h({},e),{Cost:e.UnitCost,Quantity:1,Variant:h({},e)})),V(e=>({item:e,cartType:t.cartType})),Ze(()=>Xe))),N(t=>this.add(t.item,t.cartType)));manipulateCart$=this.cartAction$.pipe(F(t=>t.action=="remove"||t.action=="replaceCart"||t.action=="emptyCart"),N(t=>{let e=[],l=[...this.store.getCart(t.type)],a=t.action;if(a=="remove"){let p=t.index;e=l.filter((M,j)=>j!=p)}else a=="replaceCart"?e=[...t.items]:a=="emptyCart"&&(e=[]);this.store.updateCart(t.type,e)}),Ht([]),At(1));generateMaterial$=this.cartAction$.pipe(F(t=>t.action=="add"||t.action=="update"),N(t=>{let e=t.action,l=[...this.store.getCart(t.type)],a=[];if(e=="add"){let M=t.item;l.find(J=>J.Variant.ID===M.Variant.ID)?a=l.map(J=>J.Variant.ID===M.Variant.ID?I(h({},J),{Quantity:J.Quantity+M.Quantity}):J):a=[...l,I(h({},M),{ID:D.GuidEmpty,VariantID:M.Variant.ID})]}else if(e=="update"){let M=t.item,j=t.index;a=l.map(($,de)=>de==j?h({},M):$),console.log(M),console.log(a);let J=M.ManufacturedComponent;if(J&&J.length){let de=[...this.store.getCart("Materials")];J.forEach(oe=>{de=de.map(Ye=>Ye.Variant.ID===oe.ID?I(h({},Ye),{Quantity:Ye.Quantity+oe.Quantity*(M.Quantity-M.PreviousQuantity)}):Ye)}),console.log(de,"updatedMaterials"),this.store.updateCart("Materials",de)}}let p=this.store.getCart("Outputs");if(t.type!="Outputs"&&p.length==1){let M=t.type=="Expenses"?this.store.getCart("Materials").reduce((J,$)=>J+$.Cost*$.Quantity,0):this.store.getCart("Expenses").reduce((J,$)=>J+$.Cost*$.Quantity,0),j=[I(h({},p[0]),{Cost:this.truncateTo4Decimals((M+a.reduce((J,$)=>J+$.Cost*$.Quantity,0))/p[0].Quantity)})];console.log("UPDATED OUTPUT CART",j),this.store.updateCart("Outputs",j)}if(t.type=="Outputs"&&p.length==1){let M=this.store.getCart("Materials"),j=this.store.getCart("Expenses"),$=[...M,...j].reduce((de,oe)=>de+oe.Cost*oe.Quantity,0)/a[0]?.Quantity;a[0].Cost=$}this.store.updateCart(t.type,a)}),F(t=>t.action=="add"&&(t.type=="Outputs"&&this.store.manufactureMaterialMode()==0||t.type=="Materials"&&this.store.manufactureMaterialMode()==1)),re(t=>(console.log("GENERATE MATERIAL",t),this.generateMaterial(t.type,t.item))),N(t=>this.store.updateCart(t.type,t.items)));truncateTo4Decimals(t){return t&&Math.trunc(t*1e4)/1e4}constructor(){this.manipulateCart$.subscribe(),this.generateMaterial$.subscribe(),this.variantFromAutocompleteCode$.subscribe(),this.variantFromAutocompleteID$.subscribe()}remove(t,e){this._cartAction.next({action:"remove",index:t,type:e})}add(t,e){this._cartAction.next({action:"add",item:t,type:e})}replaceCart(t,e){this._cartAction.next({action:"replaceCart",items:t,type:e})}openDialogItem(t,e,l){this.matDialog.open(vt,{data:{item:e,isDisableCost:t==="Outputs"&&this.store.outputs().length==1,entityID:this.store.outlet().ID}}).afterClosed().pipe(F(a=>D.IsNotEmpty(a))).subscribe(a=>l===void 0?this.add(a,t):this._cartAction.next({action:"update",item:a,index:l,type:t}))}generateMaterial(t,e){let l=[{ID:e.Variant.ID,Quantity:e.Quantity}],a="Outputs";t=="Outputs"&&(a="Materials");let p=this.store.getCart(a);return this.http.post("/API/catalog/variant/GetComponentVariantByCode",l).pipe(V(M=>{let j=p;M&&M.length&&M.forEach($=>{j.find(oe=>oe.Variant.ID===$.Variant.ID)?j=j.map(oe=>oe.Variant.ID===$.Variant.ID?I(h({},oe),{Quantity:oe.Quantity+$.Quantity}):oe):j=[...j,h({},$)]});let J={type:a,items:j};return console.log(J,"generated"),J}),Ze(()=>Xe))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ge=class i{store=C(P);assignInvoiceDateOnEdit$=Q(this.store.loadFormData).pipe(F(()=>this.store.isEdit()),N(t=>this.updateInvoiceDate(t?.Order.Date)),le());constructor(){this.assignInvoiceDateOnEdit$.subscribe()}updateInvoiceDate(t){this.store.updateInvoiceDate(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ke=class i{store=C(P);assignJobDescriptionOnEdit$=Q(this.store.jobDescription).pipe(F(()=>this.store.isEdit()),N(t=>this.updateJobDescription(t)),le());constructor(){this.assignJobDescriptionOnEdit$.subscribe()}updateJobDescription(t){this.store.updateJobDescription(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};function Bn(i,t){if(i&1&&(o(0,"div",14),_(1,"img",23),n()),i&2){let e=c().$implicit;r(),d("src",e.ThumbnailUrl||e.Variant.ThumbnailUrl,tt)}}function jn(i,t){i&1&&(o(0,"div",15),_(1,"i",24),n())}function An(i,t){if(i&1&&(o(0,"span"),m(1),f(2,"number"),n()),i&2){let e=c().$implicit,l=c(2);Ne("marg-right-100",!l.role.product.Cost),r(),S(g(2,3,e.Quantity))}}function Hn(i,t){i&1&&(o(0,"span",25),m(1," x "),n())}function Jn(i,t){if(i&1&&(o(0,"span"),m(1),f(2,"number"),n()),i&2){let e=c(2).$implicit;r(),S(g(2,1,e.Cost))}}function Qn(i,t){if(i&1&&(s(0,Hn,2,0,"span",25),s(1,Jn,3,3,"span")),i&2){let e=c().$implicit,l=c(2);u((e.Quantity>1||e.Quantity<-1)&&l.role.product.Cost?0:-1),r(),u((e.Quantity>1||e.Quantity<-1)&&l.role.product.Cost?1:-1)}}function Rn(i,t){i&1&&m(0," - ")}function Wn(i,t){if(i&1&&(m(0),f(1,"number")),i&2){let e=c(2).$implicit;b(" ",g(1,1,e.Quantity*e.Cost)," ")}}function Un(i,t){i&1&&m(0," - ")}function $n(i,t){if(i&1&&(o(0,"td",19),s(1,Wn,2,3)(2,Un,1,0),n()),i&2){let e=c(3);r(),u(e.role.product.Cost?1:2)}}function zn(i,t){if(i&1){let e=T();o(0,"tr",11),v("click",function(){let a=x(e),p=a.$implicit,M=a.$index,j=c(2);return y(j.update(p,M))}),o(1,"td",12)(2,"div",13),s(3,Bn,2,1,"div",14)(4,jn,2,0,"div",15),o(5,"div",16)(6,"div"),m(7),n(),o(8,"span",17),m(9),n(),_(10,"small",18),n()()(),o(11,"td",19),s(12,An,3,5,"span",20),s(13,Qn,2,2)(14,Rn,1,0),n(),s(15,$n,3,1,"td",19),o(16,"td",21)(17,"i",22),v("click",function(){let a=x(e).$index,p=c(2);return y(p.deleteVariant(a))}),n()()()}if(i&2){let e=t.$implicit,l=c(2);r(3),u(e.ThumbnailUrl||e.Variant.ThumbnailUrl?3:4),r(4),S(e.Variant.Name),r(2),S(e.Variant.Code),r(),d("innerHtml",e.Note,w),r(2),u(e.Quantity!=1||e.UnitQuantity>1?12:-1),r(),u(l.role.product.Cost?13:14),r(2),u(l.role.product.Cost?15:-1)}}function qn(i,t){if(i&1&&(o(0,"div",6)(1,"table",9)(2,"tbody"),G(3,zn,18,7,"tr",10,q),n()()()),i&2){let e=c();r(3),K(e.carts())}}function Gn(i,t){i&1&&(o(0,"div",7)(1,"div",26)(2,"div",27)(3,"div",28)(4,"div",29),_(5,"i",30),n(),o(6,"div",31)(7,"span"),m(8,"Empty Cart"),n(),_(9,"br"),o(10,"span"),m(11,"Add products to the cart"),n()()()()()())}function Kn(i,t){if(i&1&&(o(0,"div",8)(1,"div",32)(2,"div",33)(3,"div",34),m(4,"Total Output Cost:"),n(),o(5,"div",35),m(6),f(7,"sumMultiply"),f(8,"number"),n()()()()),i&2){let e=c();r(6),b(" ",g(8,5,z(7,1,e.carts(),"Quantity","Cost"))," ")}}var bt=class i{store=C(P);carts=_e(()=>this.store.outputs());outletId=_e(()=>this.store.outlet()?.ID);sf;cartService=C(fe);role=C(U);update(t,e){this.cartService.openDialogItem("Outputs",t,e)}deleteVariant(t){this.cartService.remove(t,"Outputs")}addItem(t){this.sf=t,D.IsNotEmpty(t)&&this.cartService.outputSearchFilter.set(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=A({type:i,selectors:[["POS-output-cart"]],decls:10,vars:5,consts:[[1,"d-flex","flex-column",2,"height","calc(100vh - 140px)"],[1,"card-header","d-flex","justify-content-between","px-6","pt-2","align-items-center"],[1,"title",2,"font-size","1rem"],[1,"row","w-100","ms-0","mt-3"],[1,"col-12","px-0"],["autocompleteEndpoint","/api/ac/GetVariantSuggestionByCodeAndNameWithOutletForManufacture","amountProperty","VariantCost",3,"ngModelChange","ngModel","outletID"],["PinScrollingBottom","",1,"table-responsive","overflow-y-auto","flex-grow-1"],[1,"row","g-0","h-100",2,"margin-bottom","64.6px"],[1,"p-6"],[1,"table","table-borderless"],[1,"border-bottom"],[1,"border-bottom",3,"click"],[1,"ps-6",2,"width","50%"],[1,"d-flex"],[1,"ratio","ratio-1x1",2,"width","55px"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"ms-4","d-flex","flex-column","justify-content-center",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",2,"word-break","break-all",3,"innerHtml"],[1,"text-end"],[3,"marg-right-100"],[1,"text-end","pe-6",2,"width","75px"],[1,"fa-solid","fa-trash","fs-4","text-danger","pointer",3,"click"],[1,"item-image",3,"src"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6"],[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"],[1,"p-6",2,"background-color","#f8f9fa","border-radius","10px"],[1,"d-flex","justify-content-between","mt-2","pb-4"],[1,"col-6","text-start"],[1,"col-6","text-end"]],template:function(e,l){if(e&1&&(o(0,"div",0)(1,"div",1)(2,"h2",2),m(3),n()(),o(4,"div",3)(5,"div",4)(6,"POS-variant-autocomplete",5),v("ngModelChange",function(p){return l.addItem(p)}),n()()(),s(7,qn,5,0,"div",6)(8,Gn,12,0,"div",7),s(9,Kn,9,7,"div",8),n()),e&2){let a,p;r(3),b(" Output (",(a=l.carts())==null?null:a.length,") "),r(3),d("ngModel",l.sf)("outletID",l.outletId()),r(),u((p=l.carts())!=null&&p.length?7:8),r(2),u(l.role.product.Cost?9:-1)}},dependencies:[ne,ft,me,Y,X,_t,ae,ie,ve],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}"],changeDetection:0})};function Yn(i,t){if(i&1){let e=T();o(0,"POS-variant-autocomplete",13),v("ngModelChange",function(a){x(e);let p=c();return y(p.addItem(a))}),n()}if(i&2){let e=c();d("ngModel",e.sfm())("outletID",e.outletId())}}function Xn(i,t){if(i&1){let e=T();o(0,"POS-variant-autocomplete",13),v("ngModelChange",function(a){x(e);let p=c();return y(p.addItem(a))}),n()}if(i&2){let e=c();d("ngModel",e.sfe())("outletID",e.outletId())}}function Zn(i,t){if(i&1&&(o(0,"div",19),_(1,"img",28),n()),i&2){let e=c().$implicit;r(),d("src",e.ThumbnailUrl||e.Variant.ThumbnailUrl,tt)}}function eo(i,t){i&1&&(o(0,"div",20),_(1,"i",29),n())}function to(i,t){if(i&1&&(o(0,"span"),m(1),f(2,"number"),n()),i&2){let e=c().$implicit,l=c(2);Ne("marg-right-100",!l.role.product.Cost),r(),S(g(2,3,e.Quantity))}}function io(i,t){i&1&&(o(0,"span",30),m(1," x "),n())}function no(i,t){if(i&1&&(o(0,"span"),m(1),f(2,"number"),n()),i&2){let e=c(2).$implicit;r(),S(g(2,1,e.Cost))}}function oo(i,t){if(i&1&&(s(0,io,2,0,"span",30),s(1,no,3,3,"span")),i&2){let e=c().$implicit,l=c(2);u((e.Quantity>1||e.Quantity<-1)&&l.role.product.Cost?0:-1),r(),u((e.Quantity>1||e.Quantity<-1)&&l.role.product.Cost?1:-1)}}function ao(i,t){i&1&&m(0," - ")}function ro(i,t){if(i&1&&(m(0),f(1,"number")),i&2){let e=c(2).$implicit;b(" ",g(1,1,e.Quantity*e.Cost)," ")}}function lo(i,t){i&1&&m(0," - ")}function mo(i,t){if(i&1&&(o(0,"td",24),s(1,ro,2,3)(2,lo,1,0),n()),i&2){let e=c(3);r(),u(e.role.product.Cost?1:2)}}function po(i,t){if(i&1){let e=T();o(0,"tr",16),v("click",function(){let a=x(e),p=a.$implicit,M=a.$index,j=c(2);return y(j.update(p,M))}),o(1,"td",17)(2,"div",18),s(3,Zn,2,1,"div",19)(4,eo,2,0,"div",20),o(5,"div",21)(6,"div"),m(7),n(),o(8,"span",22),m(9),n(),_(10,"small",23),n()()(),o(11,"td",24),s(12,to,3,5,"span",25),s(13,oo,2,2)(14,ao,1,0),n(),s(15,mo,3,1,"td",24),o(16,"td",26)(17,"i",27),v("click",function(){let a=x(e).$index,p=c(2);return y(p.deleteVariant(a))}),n()()()}if(i&2){let e=t.$implicit,l=c(2);r(3),u(e.ThumbnailUrl||e.Variant.ThumbnailUrl?3:4),r(4),S(e.Variant.Name),r(2),S(e.Variant.Code),r(),d("innerHtml",e.Note,w),r(2),u(e.Quantity!=1||e.UnitQuantity>1?12:-1),r(),u(l.role.product.Cost?13:14),r(2),u(l.role.product.Cost?15:-1)}}function co(i,t){if(i&1&&(o(0,"div",10)(1,"table",14)(2,"tbody"),G(3,po,18,7,"tr",15,q),n()()()),i&2){let e=c();r(3),K(e.currentCart())}}function so(i,t){i&1&&(o(0,"div",11)(1,"div",31)(2,"div",32)(3,"div",33)(4,"div",34),_(5,"i",35),n(),o(6,"div",36)(7,"span"),m(8,"Empty cart"),n(),_(9,"br"),o(10,"span"),m(11,"Add products to the cart"),n()()()()()())}function uo(i,t){if(i&1&&(o(0,"div",12)(1,"div",37)(2,"div",38)(3,"div",39),m(4),n(),o(5,"div",40),m(6),f(7,"sumMultiply"),f(8,"sumMultiply"),f(9,"number"),n()(),o(10,"div",38)(11,"div",39),m(12,"Total Input Cost:"),n(),o(13,"div",40),m(14),f(15,"sumMultiply"),f(16,"sumMultiply"),f(17,"number"),n()()()()),i&2){let e=c();r(4),b(" Total ",e.currentState()==="m"?"Materials":"Expenses"," Cost: "),r(2),b(" ",g(9,11,e.currentState()==="m"?z(7,3,e.materials(),"Quantity","Cost"):z(8,7,e.expenses(),"Quantity","Cost"))," "),r(8),b(" ",g(17,21,z(15,13,e.materials(),"Quantity","Cost")+z(16,17,e.expenses(),"Quantity","Cost"))," ")}}var ht=class i{currentState=E("m");options=[{label:"Materials",value:0},{label:"Expenses",value:1}];materials=se([]);expenses=se([]);outletId=se("");sfm=E(null);sfe=E(null);cartService=C(fe);role=C(U);currentCart=_e(()=>this.currentState()=="m"?this.materials():this.expenses());update(t,e){this.cartService.openDialogItem(this.currentState()=="m"?"Materials":"Expenses",t,e)}deleteVariant(t){this.cartService.remove(t,this.currentState()=="m"?"Materials":"Expenses")}addItem(t){this.currentState()=="m"?(this.sfm.set(t),D.IsNotEmpty(t)&&this.cartService.materialSearchFilter.set(t)):(this.sfe.set(t),D.IsNotEmpty(t)&&this.cartService.expenseSearchFilter.set(t))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=A({type:i,selectors:[["POS-material-cart"]],inputs:{materials:[1,"materials"],expenses:[1,"expenses"],outletId:[1,"outletId"]},decls:17,vars:7,consts:[[1,"d-flex","flex-column",2,"height","calc(100vh - 140px)"],[1,"card-header","d-flex","justify-content-between","px-6","pt-2","align-items-center"],[1,"title",2,"font-size","1rem"],[1,"d-flex","w-100","ms-0","mt-3"],[1,"flex-grow-1","px-0"],["autocompleteEndpoint","/api/ac/GetVariantSuggestionByCodeAndNameWithOutletForManufacture","amountProperty","VariantCost",3,"ngModel","outletID"],[1,"me-6","ps-0"],["name","fontStyle","aria-label","Font Style",2,"height","38px","align-items","center",3,"ngModelChange","hideSingleSelectionIndicator","ngModel"],["value","m"],["value","e"],["PinScrollingBottom","",1,"table-responsive","overflow-y-auto","flex-grow-1"],[1,"row","g-0","h-100"],[1,"p-6"],["autocompleteEndpoint","/api/ac/GetVariantSuggestionByCodeAndNameWithOutletForManufacture","amountProperty","VariantCost",3,"ngModelChange","ngModel","outletID"],[1,"table","table-borderless"],[1,"border-bottom"],[1,"border-bottom",3,"click"],[1,"ps-6",2,"width","50%"],[1,"d-flex"],[1,"ratio","ratio-1x1",2,"width","55px"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"ms-4","d-flex","flex-column","justify-content-center",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",2,"word-break","break-all",3,"innerHtml"],[1,"text-end"],[3,"marg-right-100"],[1,"text-end","pe-6",2,"width","75px"],[1,"fa-solid","fa-trash","fs-4","text-danger","pointer",3,"click"],[1,"item-image",3,"src"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6"],[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"],[1,"p-6",2,"background-color","#f8f9fa","border-radius","10px"],[1,"d-flex","justify-content-between","mt-2","pb-4"],[1,"col-6","text-start"],[1,"col-6","text-end"]],template:function(e,l){if(e&1&&(o(0,"div",0)(1,"div",1)(2,"h2",2),m(3),n()(),o(4,"div",3)(5,"div",4),s(6,Yn,1,2,"POS-variant-autocomplete",5),s(7,Xn,1,2,"POS-variant-autocomplete",5),n(),o(8,"div",6)(9,"mat-button-toggle-group",7),v("ngModelChange",function(p){return l.currentState.set(p)}),o(10,"mat-button-toggle",8),m(11,"Materials"),n(),o(12,"mat-button-toggle",9),m(13,"Expenses"),n()()()(),s(14,co,5,0,"div",10)(15,so,12,0,"div",11),s(16,uo,18,23,"div",12),n()),e&2){let a,p;r(3),b(" Input (",(a=l.currentCart())==null?null:a.length,") "),r(3),u(l.currentState()=="m"?6:-1),r(),u(l.currentState()=="e"?7:-1),r(2),d("hideSingleSelectionIndicator",!0)("ngModel",l.currentState()),r(5),u((p=l.currentCart())!=null&&p.length?14:15),r(2),u(l.role.product.Cost?16:-1)}},dependencies:[ne,_t,ft,me,Y,X,ni,ti,ii,ae,ie,ve],styles:[".item-image[_ngcontent-%COMP%]{height:50px;width:56px;display:block;border:solid 1px #dddddd;border-radius:5px;object-fit:contain}.marg-right-100[_ngcontent-%COMP%]{margin-right:100px}.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} mat-button-toggle-group, mat-button-toggle{width:100%}"],changeDetection:0})};var fo=()=>["/menu/Manufacture/Job_Order/Archive/Info"],_o=i=>({ID:i}),Co=()=>["/print/JobOrder"],gi=(i,t)=>({ID:i,Template:t}),go=()=>["/print/JobOrderMini"];function xo(i,t){if(i&1&&(o(0,"a",13),_(1,"i",21),m(2,"Print "),n()),i&2){let e=c();d("routerLink",te(2,Co))("queryParams",Se(3,gi,e.afterProcessData().OrderID,e.printTemplateID()))}}function yo(i,t){if(i&1&&(o(0,"a",13),_(1,"i",21),m(2,"Print "),n()),i&2){let e=c();d("routerLink",te(2,go))("queryParams",Se(3,gi,e.afterProcessData().OrderID,e.printTemplateID()))}}function vo(i,t){if(i&1&&(m(0),f(1,"number")),i&2){let e=c().$implicit;b(" ",g(1,1,e.Cost)," ")}}function bo(i,t){i&1&&m(0," - ")}function ho(i,t){if(i&1&&(o(0,"div",19)(1,"div",20),m(2),n(),o(3,"div",20),m(4),f(5,"number"),n(),o(6,"div",20),s(7,vo,2,3)(8,bo,1,0),n()()),i&2){let e=t.$implicit,l=c();r(2),S(e.Variant.Name),r(2),S(g(5,3,e.Quantity)),r(3),u(l.role.product.Cost?7:8)}}function So(i,t){if(i&1&&(m(0),f(1,"sum"),f(2,"number")),i&2){let e=c();b(" ",g(2,4,ee(1,1,e.materials(),"Cost"))," ")}}function Mo(i,t){i&1&&m(0," - ")}function Do(i,t){if(i&1&&(m(0),f(1,"number")),i&2){let e=c().$implicit;b(" ",g(1,1,e.Cost)," ")}}function Io(i,t){i&1&&m(0," - ")}function Oo(i,t){if(i&1&&(o(0,"div",19)(1,"div",20),m(2),n(),o(3,"div",20),m(4),f(5,"number"),n(),o(6,"div",20),s(7,Do,2,3)(8,Io,1,0),n()()),i&2){let e=t.$implicit,l=c();r(2),S(e.Variant.Name),r(2),S(g(5,3,e.Quantity)),r(3),u(l.role.product.Cost?7:8)}}function Eo(i,t){if(i&1&&(m(0),f(1,"sum"),f(2,"number")),i&2){let e=c();b(" ",g(2,4,ee(1,1,e.expenses(),"Cost"))," ")}}function To(i,t){i&1&&m(0," - ")}var St=class i{handleF8(){this.createNewTransaction()}afterProcessData=se({});printTemplateID=se(0);materials=se([]);expenses=se([]);pageSetup=C(ye);title=C(lt);isEdit=C(we);role=C(U);menu$;constructor(){this.pageSetup.setMenu$(),this.menu$=this.pageSetup.menu$.pipe(V(t=>I(h({},t),{H:"Job Order",T:t.T.replace("undefined","Job Order")})),N(t=>this.title.setTitle(t.T)))}createNewTransaction(){this.isEdit.createNewTransaction()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=A({type:i,selectors:[["POS-complete"]],hostBindings:function(e,l){e&1&&v("keydown.F8",function(){return l.handleF8()},Jt)},inputs:{afterProcessData:[1,"afterProcessData"],printTemplateID:[1,"printTemplateID"],materials:[1,"materials"],expenses:[1,"expenses"]},decls:54,vars:27,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"row","px-6","pt-6"],[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","py-4"],[1,"d-flex","justify-content-between"],["target","_blank",1,"btn","bg-light-gray","btn-secondary",3,"routerLink","queryParams"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],[3,"routerLink","queryParams"],[1,"card-body"],[1,"ps-5","row","justify-content-between","mb-5"],[1,"col","text-start"],["aria-hidden","true",1,"fa","fa-print","me-3"]],template:function(e,l){e&1&&(o(0,"mainpanel-cmp",0),f(1,"async"),o(2,"content")(3,"div",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"h1",5),_(8,"i",6),m(9,"Job Order Complete "),n()(),o(10,"div",7)(11,"div",8)(12,"div",9)(13,"a",10),v("click",function(){return l.createNewTransaction()}),m(14,"New Job Order (F8)"),n()()()(),o(15,"div",11)(16,"div",12),s(17,xo,3,6,"a",13),s(18,yo,3,6,"a",13),n()()()(),o(19,"div",14)(20,"div",3)(21,"div",15)(22,"h2",16)(23,"a",17),m(24),n()()(),o(25,"div",18)(26,"h2"),m(27,"Material"),n(),G(28,ho,9,5,"div",19,q),o(30,"div",19)(31,"span",20),m(32,"Total:"),n(),o(33,"span",20),m(34),f(35,"sum"),f(36,"number"),n(),o(37,"span",20),s(38,So,3,6)(39,Mo,1,0),n()(),o(40,"h2"),m(41,"Output"),n(),G(42,Oo,9,5,"div",19,q),o(44,"div",19)(45,"span",20),m(46,"Total:"),n(),o(47,"span",20),m(48),f(49,"sum"),f(50,"number"),n(),o(51,"span",20),s(52,Eo,3,6)(53,To,1,0),n()()()()()()()()),e&2&&(d("pageData",g(1,12,l.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),r(17),u(l.afterProcessData().printMode==1?17:-1),r(),u(l.afterProcessData().printMode!=1?18:-1),r(5),d("routerLink",te(24,fo))("queryParams",Z(25,_o,l.afterProcessData().OrderID)),r(),b("#",l.afterProcessData().InvoiceNumber),r(4),K(l.materials()),r(6),S(g(36,17,ee(35,14,l.materials(),"Quantity"))),r(4),u(l.role.product.Cost?38:39),r(4),K(l.expenses()),r(6),S(g(50,22,ee(49,19,l.expenses(),"Quantity"))),r(4),u(l.role.product.Cost?52:53))},dependencies:[ne,Me,Ce,ut,be,ae,at,ie,Ae],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} #full-container{padding-top:60px!important}"],changeDetection:0})};var Mt=class i{constructor(t,e){this.data=t;this.dialogRef=e;this.config.update(l=>I(h({},l),{title:"Submit Job Order Note",customWidth:"520px"})),this.note.set(t)}data;dialogRef;config=E(new Ie);note=E("");ok(){this.dialogRef.close({note:this.note()})}static \u0275fac=function(e){return new(e||i)(O(Le),O(ke))};static \u0275cmp=A({type:i,selectors:[["POS-modal-order-note"]],standalone:!1,decls:4,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],["height","220px",3,"ngModelChange","ngModel"]],template:function(e,l){e&1&&(o(0,"modal-material",0),v("onOk",function(){return l.ok()})("onCancel",function(){return l.dialogRef.close()})("onClose",function(){return l.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"POS-tinymce-editor",2),B("ngModelChange",function(p){return L(l.note,p)||(l.note=p),p}),n()()()()),e&2&&(d("config",l.config()),r(3),k("ngModel",l.note))},dependencies:[Y,X,ue,he],encapsulation:2,changeDetection:0})};var Qe=class i{matDialog=C(pe);store=C(P);http=C(W);toastr=C(ge);constructor(){}submit(){if(this.store.outputs().length==0||this.store.materials().length==0){this.toastr.info("Output and Material must not be empty","Info");return}this.matDialog.open(Mt,{data:this.store.note()}).afterClosed().pipe(F(t=>D.IsNotEmpty(t)),N(t=>this.store.updateNote(t?.note)),re(t=>{let e={Order:I(h({},this.store.loadFormData().Order),{Note:t.note,Date:this.store.invoiceDate(),EntityID:this.store.outlet().ID,EntityName:this.store.outlet().Name,Number:this.store.invoiceNumber().toString(),SalesOrderID:this.store.SalesOrderNumber(),Name:this.store.jobDescription()}),Outputs:this.store.outputs(),Expenses:this.store.expenses(),Materials:this.store.materials()};return this.http.post("/api/Manufacture/Submit",e)}),N(t=>this.store.updateCompleteData(t))).subscribe()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var Dt=class i{constructor(t,e){this.data=t;this.dialogRef=e;this.config.set(new Ie),this.config.update(l=>I(h({},l),{title:"Submit Job Order Name",customWidth:"520px"})),this.description.set(t.description)}data;dialogRef;config=E(new Ie);description=E("");ok(){this.dialogRef.close({description:this.description})}static \u0275fac=function(e){return new(e||i)(O(Le),O(ke))};static \u0275cmp=A({type:i,selectors:[["POS-dialog-sales-order"]],decls:4,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],["height","220px",3,"ngModelChange","ngModel"]],template:function(e,l){e&1&&(o(0,"modal-material",0),v("onOk",function(){return l.ok()})("onCancel",function(){return l.dialogRef.close()})("onClose",function(){return l.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"POS-tinymce-editor",2),B("ngModelChange",function(p){return L(l.description,p)||(l.description=p),p}),n()()()()),e&2&&(d("config",l.config()),r(3),k("ngModel",l.description))},dependencies:[ue,me,Y,X,ne,he],encapsulation:2,changeDetection:0})};var It=class i{submitService=C(Qe);store=C(P);roleService=C(U);matDialog=C(pe);role=C(U);http=C(W);submit(){this.submitService.submit()}openSalesOrderDialog(){this.matDialog.open(Dt,{data:{description:this.store.jobDescription()}}).afterClosed().pipe(F(t=>D.IsNotEmpty(t?.description))).subscribe(t=>this.store.updateJobDescription(t.description))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=A({type:i,selectors:[["POS-cart-action"]],decls:12,vars:17,consts:[[1,"row","g-0"],[1,"col-4","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],[1,"btn","btn-gray","w-100","fs-3","px-0","py-6",3,"click"],[1,"col-8"],["type","button",1,"btn","btn-success","w-100","fs-3","px-0","py-6",2,"border-left","0.1px solid #fff","height","100%",3,"click","disabled"]],template:function(e,l){e&1&&(Tt(0,"div",0)(1,"div",1)(2,"button",2),Pt("click",function(){return l.openSalesOrderDialog()}),m(3," Description "),wt()(),Tt(4,"div",3)(5,"button",4),f(6,"sumMultiply"),f(7,"sumMultiply"),f(8,"number"),f(9,"sumMultiply"),f(10,"number"),Pt("click",function(){return l.submit()}),m(11," Submit "),wt()()()),e&2&&(r(5),Qt("disabled",!(l.store.submitWithMismatch()||!l.store.submitWithMismatch()&&g(8,9,z(6,1,l.store.materials(),"Quantity","Cost")+z(7,5,l.store.expenses(),"Quantity","Cost"))==g(10,15,z(9,11,l.store.outputs(),"Quantity","Cost")))))},dependencies:[ne,ae,ie,ve],styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;font-family:Roboto Slab,serif!important;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"],changeDetection:0})};var wo=i=>({"background-color":i});function Po(i,t){if(i&1&&(m(0),f(1,"number")),i&2){let e=c(2);b(" ",g(1,1,e.differences())," ")}}function No(i,t){i&1&&(o(0,"span"),m(1,"Mismatch Cost Detected"),n(),_(2,"i",28))}function Vo(i,t){i&1&&(o(0,"span"),m(1,"Unauthorized"),n(),_(2,"i",28))}function Fo(i,t){if(i&1&&(o(0,"div",27),s(1,No,3,0)(2,Vo,3,0),n()),i&2){let e=c(2);r(),u(e.differences()!==0?1:2)}}function ko(i,t){if(i&1){let e=T();o(0,"div",0)(1,"div",2)(2,"div",3)(3,"div",4)(4,"POS-select-outlet-form",5),v("ngModelChange",function(a){x(e);let p=c();return y(p.store.updateOutlet(a))}),n(),o(5,"POS-invoice-number-form",6),v("ngModelChange",function(a){x(e);let p=c();return y(p.store.updateInvoiceNumber(a))}),n(),o(6,"POS-invoice-date",7),v("ngModelChange",function(a){x(e);let p=c();return y(p.store.updateInvoiceDate(a))}),n()()(),o(7,"div",8)(8,"div",9)(9,"div",10)(10,"ng-select",11),v("ngModelChange",function(a){x(e);let p=c();return y(p.store.updateSalesOrderNumber(a))})("click",function(){x(e);let a=c();return y(a.getIncompleteOrders(a.store.outlet().ID))}),n()(),o(11,"div",12)(12,"div",13)(13,"button",14),f(14,"async"),v("click",function(){x(e);let a=c();return y(a.toggle.toggleSidebar())}),_(15,"span",15)(16,"span",15)(17,"span",15),n()()()()()(),o(18,"div",16)(19,"div",17),_(20,"POS-output-cart"),n(),o(21,"div",18),_(22,"POS-material-cart",19),n()(),o(23,"div",20)(24,"div",21)(25,"div",22)(26,"div",23)(27,"div",24)(28,"div",25),m(29," Differences: "),n(),o(30,"div",26),s(31,Po,2,3)(32,Fo,3,1,"div",27),n()()(),o(33,"div",23),_(34,"POS-cart-action"),n()()()()()}if(i&2){let e=c();r(4),d("outlets",e.store.outlets())("isOpenAfterLoad",e.isOpen.isOpenOutletDialog())("ngModel",e.store.outlet()),r(),d("ngModel",e.store.invoiceNumber())("isEdit",e.store.isEdit())("disabled",!e.role.global.Number),r(),d("ngModel",e.store.invoiceDate())("disabled",!(e.role.global!=null&&e.role.global.Date))("tooltip",e.role.global!=null&&e.role.global.Date?"":"Date role is required"),r(4),d("items",e.incompleteOrders)("ngModel",e.store.SalesOrderNumber()),r(3),Ne("change",g(14,18,e.toggle.toggleState$)),r(9),d("expenses",e.store.expenses())("materials",e.store.materials())("outletId",e.store.outlet().ID),r(5),d("ngStyle",Z(20,wo,e.differences()===0?"#f8f9fa":"#FDEAEA")),r(4),u(e.role.product.Cost?31:32)}}function Lo(i,t){if(i&1&&_(0,"POS-complete",1),i&2){let e=c();d("afterProcessData",e.store.completeData())("printTemplateID",e.printTemplateID())("materials",e.store.materials())("expenses",e.store.outputs())}}var Ot=class i{incompleteOrders=[];intercom=C(zt);isOpen=C(Te);store=C(P);invNumber=C($e);ld=C(ze);outlet=C(qe);isEdit=C(we);cart=C(fe);invDate=C(Ge);jobDesc=C(Ke);toggle=C(qt);role=C(U);http=C(W);printTemplateID=_e(()=>this.store.outlets().find(t=>t.ID===this.store.outlet().ID)?.PrintTemplateID);constructor(){let t=C(lt);t.setTitle(t.getTitle()+" | Manufacture")}ngAfterViewInit(){this.intercom.hideLauncher()}ngOnDestroy(){this.intercom.showLauncher()}getIncompleteOrders(t){this.http.get("/API/Manufacture/GetUnfulfilledOrdersByOutletID?OutletID="+t).subscribe(e=>this.incompleteOrders=e)}differences=_e(()=>Math.floor(Math.abs(this.store.outputs().map(t=>t.Quantity*t.Cost).reduce((t,e)=>t+e,0)-(this.store.materials().map(t=>t.Quantity*t.Cost).reduce((t,e)=>t+e,0)+this.store.expenses().map(t=>t.Quantity*t.Cost).reduce((t,e)=>t+e,0)))));static \u0275fac=function(e){return new(e||i)};static \u0275cmp=A({type:i,selectors:[["POS-manufacture-v2"]],features:[Rt([Te,P,$e,ze,qe,we,fe,Ge,Ke,Qe])],decls:2,vars:1,consts:[[1,"container-fluid"],[3,"afterProcessData","printTemplateID","materials","expenses"],[1,"row","header","border-bottom"],[1,"col-6","border-end"],[1,"left-toolbar-container","h-100","d-flex","align-items-center","justify-content-between"],[3,"ngModelChange","outlets","isOpenAfterLoad","ngModel"],["transactionType","Manufacture",3,"ngModelChange","ngModel","isEdit","disabled"],[3,"ngModelChange","ngModel","disabled","tooltip"],[1,"col-6","d-flex","align-items-center"],[1,"row","flex-grow-1"],[1,"col-lg-7","col-5","d-flex","align-items-center"],["appendTo","body","bindLabel","Option","bindValue","ID","placeholder","Search Unsent Invoice",2,"width","250px",3,"ngModelChange","click","items","ngModel"],[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"],[1,"col-6","border-end","px-0"],[1,"col-6","px-0","d-flex","flex-column","justify-content-between"],[1,"flex-grow-1",3,"expenses","materials","outletId"],[1,"row","footer","border-top"],[1,"col-12","d-flex","flex-column","justify-content-between","py-6","h-100"],[1,"row"],[1,"col-6"],[1,"d-flex","justify-content-between","align-items-center","h-100","p-6",2,"border-radius","10px",3,"ngStyle"],[1,"col-6","text-start","fw-semibold"],[1,"col-6","text-end","fw-semibold"],[1,"d-inline-flex","align-items-center","gap-1"],["matTooltip","Need Product Cost Role to View","matTooltipPosition","above",1,"fa","fa-info-circle","ms-1",2,"font-size","12px","cursor","pointer"]],template:function(e,l){e&1&&s(0,ko,35,22,"div",0)(1,Lo,1,4,"POS-complete",1),e&2&&u(l.store.completeData()?1:0)},dependencies:[ne,Wt,me,Y,X,mi,pi,li,bt,ht,St,It,Me,Be,ae,Ve,at,ie],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 - 140px)}.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;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:8px}.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} .sales-order-number .ng-select-container{border:none} .sales-order-number.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border:none;box-shadow:none}"],changeDetection:0})};var Bo=[{path:"Job_Order/Archive",component:gt},{path:"Job_Order/Archive/Info",component:Ct},{path:"Job_Order/Archive/Form",component:Ot},{path:"Job_Order/Report",component:yt},{path:"Job_Order/Report_Detail",loadComponent(){return import("./chunk-UQ7T4O2W.js").then(i=>i.ManufactureDetailComponent)}},{path:"",redirectTo:"Job_Order/Archive",pathMatch:"full"}],Et=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=it({type:i});static \u0275inj=et({imports:[Me.forChild(Bo),Me]})};var xi=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=it({type:i});static \u0275inj=et({imports:[ne,di,me,ei,Et,Je,Be,ae,ri,ue,ut,Xt,ue,He,Gt,he]})};export{xi as ManufactureModule};
1
+ import{a as di}from"./chunk-2XH6Q6LN.js";import{a as _t}from"./chunk-R66XDGNJ.js";import{a as ft}from"./chunk-YSXS53LW.js";import{a as mi}from"./chunk-JUJAXTRW.js";import{a as ci}from"./chunk-PWBZSXWH.js";import{a as pi}from"./chunk-ZF4BACNU.js";import"./chunk-PUCBYEX7.js";import{a as Zt,b as ei}from"./chunk-N6UN5VE7.js";import"./chunk-GSNMJQ66.js";import"./chunk-6W3NA43S.js";import{b as li}from"./chunk-NYZ4INHA.js";import"./chunk-C6T3QJYH.js";import{a as he}from"./chunk-64VNFDF5.js";import{p as Je}from"./chunk-MBGAESMM.js";import"./chunk-HKSZBGAA.js";import"./chunk-NJMXSMGX.js";import"./chunk-OLQFDT22.js";import"./chunk-EBUYDS2Y.js";import"./chunk-NNQ7YV45.js";import"./chunk-6P2JYVLD.js";import"./chunk-6QHW2WTF.js";import"./chunk-EIELIV2M.js";import{b as Kt,c as Yt,d as Xt}from"./chunk-Z5EKWBMJ.js";import{a as He}from"./chunk-A2I2QMXC.js";import"./chunk-PZN4IDFD.js";import{b as dt}from"./chunk-FLWBWEFM.js";import{a as Fe}from"./chunk-BKMUM2RM.js";import"./chunk-ZLK3WUVC.js";import"./chunk-2GXU77LM.js";import"./chunk-QHETYXUX.js";import"./chunk-MEYOCIHN.js";import"./chunk-VZUG3XWW.js";import{a as je}from"./chunk-AFSEESTO.js";import{g as be,h as ut}from"./chunk-EOJKGSOK.js";import{a as ti,b as ii,c as ni}from"./chunk-LCKY37ME.js";import{a as ct}from"./chunk-V45IFCCW.js";import"./chunk-FJAZ5KHI.js";import"./chunk-TECII4TC.js";import"./chunk-N7XFZYAR.js";import"./chunk-NHMVI3RX.js";import"./chunk-CER4VIHT.js";import"./chunk-KVRVSMPL.js";import"./chunk-EXCHBF25.js";import"./chunk-SVRHZOWH.js";import"./chunk-IHQOHLPL.js";import"./chunk-BFQOLYHL.js";import"./chunk-K2NOGF3I.js";import"./chunk-PG62QDNS.js";import{a as ye}from"./chunk-QENSRIHN.js";import{a as qt}from"./chunk-JQBXKYC5.js";import"./chunk-QAEDK7B5.js";import{b as st,c as ri}from"./chunk-IYVMMQUJ.js";import"./chunk-73C77AIF.js";import"./chunk-BOBU77RE.js";import"./chunk-XSPKXHFT.js";import{a as Ve,b as Gt}from"./chunk-SWU6BBBD.js";import"./chunk-PPMQE2JW.js";import{L as ai,N as ae,g as Ae,k as ve,o as oi}from"./chunk-WCOJ74AX.js";import"./chunk-IN35LCD3.js";import"./chunk-IMSMZYLG.js";import"./chunk-OKQYRKDJ.js";import{d as Be}from"./chunk-NCJEZXKF.js";import"./chunk-STKAHNNR.js";import"./chunk-IWXBFNID.js";import{a as ke,b as Le,c as pe}from"./chunk-QX4FSLL5.js";import"./chunk-YXX2TH5I.js";import"./chunk-M36GLXBG.js";import"./chunk-CVOK5ITC.js";import"./chunk-J27WSAUU.js";import{a as le,b as Q}from"./chunk-4KUDABAJ.js";import{a as De}from"./chunk-HTWZXTKN.js";import"./chunk-L22C7OZ4.js";import"./chunk-SFD3J3OH.js";import"./chunk-N3XC43X2.js";import{a as xe,b as Ie,c as ue}from"./chunk-FNEABRAQ.js";import"./chunk-OSHL72QK.js";import"./chunk-3A7EKFZY.js";import"./chunk-POOTZU2L.js";import"./chunk-MMZCS6WY.js";import{F as me,b as $t,c as pt,h as Y,p as X}from"./chunk-F2ZXIBKA.js";import"./chunk-IGP2V3PT.js";import{a as zt}from"./chunk-KTF3ZITG.js";import"./chunk-FQIRVQPI.js";import{b as U}from"./chunk-36E5M6EH.js";import{a as D}from"./chunk-PPTZHIIZ.js";import"./chunk-RTFMOBMR.js";import{n as ge,q as W}from"./chunk-WE775XUV.js";import{Ac as te,Bb as u,Bc as Z,Cc as Se,D as Re,Db as q,Ea as E,Eb as G,F,Fb as K,Gb as d,Hb as o,Ib as n,Ic as f,J as Ze,Jb as _,Jc as g,Kb as Tt,Kc as ee,Lb as wt,Lc as z,Nd as lt,O as jt,Oc as ot,Qa as w,Rc as _e,Rd as mt,Sa as tt,Sb as T,Tb as Qt,Td as Ut,Ud as Ce,Va as Jt,Vb as v,Wb as Pt,Wc as se,Wd as Me,Xa as r,Xb as c,_ as At,ba as Ht,ca as re,cb as O,e as Lt,ga as N,gb as A,hb as it,hc as Ne,j as Xe,kc as m,lb as Pe,lc as S,m as Bt,ma as R,mb as nt,mc as b,na as et,pc as k,qa as C,qc as L,qd as Wt,rc as B,sd as at,t as V,ua as x,ud as rt,va as y,wd as ie,zb as s,zc as Rt,zd as ne}from"./chunk-T7N5CA5W.js";import{a as h,b as I}from"./chunk-NF7PG5F2.js";var vi=(i,t)=>({ID:i,Template:t}),bi=()=>["/menu/Orders/Order/Sales_Order/Info"],Ue=i=>({ID:i}),hi=()=>["/menu/Manufacture/Job_Order/Archive/Form"];function Si(i,t){if(i&1){let e=T();o(0,"a",39),v("click",function(){x(e);let a=c(2);return y(a.process({ID:a.data().Data.Order.ID}))}),_(1,"i",40),m(2),n()}if(i&2){let e=c(2);r(2),b(" ",e.data().Data.Order.State===1?"Execute Plan":"Finish Order"," ")}}function Mi(i,t){if(i&1&&(o(0,"a",3),_(1,"i",41),m(2," Edit "),n()),i&2){let e=c(2);d("routerLink",te(2,hi))("queryParams",Z(3,Ue,e.data().Data.Order.ID))}}function Di(i,t){if(i&1){let e=T();o(0,"a",42),v("click",function(){x(e);let a=c(2);return y(a.delete("/API/Manufacture/DeleteOrder",a.data().Data.Order.ID))}),_(1,"i",43),m(2," Delete "),n()}}function Ii(i,t){if(i&1){let e=T();o(0,"li",15)(1,"a",44),v("click",function(){x(e);let a=c(2);return y(a.exportCSV(a.csvConverter,"Manufacture/ExportDetail",a.data().ExportFileName+".csv"))}),_(2,"i",45),m(3," Export "),n()()}}function Oi(i,t){i&1&&(o(0,"th",34),m(1,"Uom"),n())}function Ei(i,t){if(i&1&&(o(0,"th",46),m(1," Cost ("),_(2,"span",21),m(3,") "),n()),i&2){let e=c(3);r(2),d("innerHTML",e.data().CurrencySymbol,w)}}function Ti(i,t){if(i&1&&(o(0,"th",46),m(1," Total ("),_(2,"span",21),m(3,") "),n()),i&2){let e=c(3);r(2),d("innerHTML",e.data().CurrencySymbol,w)}}function wi(i,t){if(i&1&&(_(0,"p",21),f(1,"newlines")),i&2){let e=c().$implicit;d("innerHTML",g(1,1,e.Note),w)}}function Pi(i,t){if(i&1&&(o(0,"td"),m(1),n()),i&2){let e=c().$implicit;r(),S(e.Variant==null?null:e.Variant.UOMName)}}function Ni(i,t){if(i&1&&(o(0,"td",49),_(1,"span",21),f(2,"number"),n()),i&2){let e=c().$implicit;r(),d("innerHTML",g(2,1,e.Cost),w)}}function Vi(i,t){if(i&1&&(o(0,"td",49),_(1,"span",21),f(2,"number"),n()),i&2){let e=c().$implicit;r(),d("innerHTML",g(2,1,e.Cost*e.Quantity),w)}}function Fi(i,t){if(i&1&&(o(0,"tr")(1,"td"),_(2,"span",21),n(),o(3,"td")(4,"a",48),m(5),n(),o(6,"div"),m(7),n(),s(8,wi,2,3,"p",21),n(),o(9,"td",49),m(10),f(11,"number"),n(),s(12,Pi,2,1,"td"),s(13,Ni,3,3,"td",49),s(14,Vi,3,3,"td",49),n()),i&2){let e=t.$implicit,l=t.$index,a=c(3);r(2),d("innerHTML",l+1+".",w),r(2),d("queryParams",Z(11,Ue,e.VariantID)),r(),S(e.Variant.Name),r(2),S(e.Variant.Code),r(),u(e.Note!=null?8:-1),r(2),S(g(11,9,e.Quantity)),r(2),u(a.isItemHasUom()?12:-1),r(),u(!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.Cost?13:-1),r(),u(!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.Cost?14:-1)}}function ki(i,t){i&1&&_(0,"td",47)}function Li(i,t){i&1&&_(0,"td",47)}function Bi(i,t){if(i&1&&(o(0,"td",37),m(1),f(2,"sumMultiply"),f(3,"number"),n()),i&2){let e=c(3);r(),b(" ",g(3,5,z(2,1,e.data().Data.Materials,"Quantity","Cost"))," ")}}function ji(i,t){if(i&1&&(o(0,"table",27)(1,"thead",31)(2,"tr")(3,"th",32),m(4,"No"),n(),o(5,"th"),m(6,"Name"),n(),o(7,"th",33),m(8,"Qty"),n(),s(9,Oi,2,0,"th",34),s(10,Ei,4,1,"th",46),s(11,Ti,4,1,"th",46),n()(),o(12,"tbody"),G(13,Fi,15,13,"tr",null,q),n(),o(15,"tfoot")(16,"tr",35),_(17,"td",47),o(18,"td",37),m(19,"Total"),n(),o(20,"td",37),m(21),f(22,"sum"),n(),s(23,ki,1,0,"td",47),s(24,Li,1,0,"td",47),s(25,Bi,4,7,"td",37),n()()()),i&2){let e=c(2);r(9),u(e.isItemHasUom()?9:-1),r(),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?10:-1),r(),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?11:-1),r(2),K(e.data().Data.Materials),r(8),b(" ",ee(22,7,e.data().Data.Materials,"Quantity")," "),r(2),u(e.isItemHasUom()?23:-1),r(),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?24:-1),r(),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?25:-1)}}function Ai(i,t){i&1&&(o(0,"th",34),m(1,"Uom"),n())}function Hi(i,t){if(i&1&&(o(0,"th",46),m(1," Cost ("),_(2,"span",21),m(3,") "),n()),i&2){let e=c(3);r(2),d("innerHTML",e.data().CurrencySymbol,w)}}function Ji(i,t){if(i&1&&(o(0,"th",46),m(1," Total ("),_(2,"span",21),m(3,") "),n()),i&2){let e=c(3);r(2),d("innerHTML",e.data().CurrencySymbol,w)}}function Qi(i,t){if(i&1&&(_(0,"p",21),f(1,"newlines")),i&2){let e=c().$implicit;d("innerHTML",g(1,1,e.Note),w)}}function Ri(i,t){if(i&1&&(o(0,"td"),m(1),n()),i&2){let e=c().$implicit;r(),S(e.Variant.UOMName)}}function Wi(i,t){if(i&1&&(o(0,"td",49),_(1,"span",21),f(2,"number"),n()),i&2){let e=c().$implicit;r(),d("innerHTML",g(2,1,e.Cost),w)}}function Ui(i,t){if(i&1&&(o(0,"td",49),_(1,"span",21),f(2,"number"),n()),i&2){let e=c().$implicit;r(),d("innerHTML",g(2,1,e.Cost*e.Quantity),w)}}function $i(i,t){if(i&1&&(o(0,"tr")(1,"td"),_(2,"span",21),n(),o(3,"td")(4,"a",48),m(5),n(),o(6,"div"),m(7),n(),s(8,Qi,2,3,"p",21),n(),o(9,"td",49),m(10),f(11,"number"),n(),s(12,Ri,2,1,"td"),s(13,Wi,3,3,"td",49),s(14,Ui,3,3,"td",49),n()),i&2){let e=t.$implicit,l=t.$index,a=c(3);r(2),d("innerHTML",l+1+".",w),r(2),d("queryParams",Z(11,Ue,e.VariantID)),r(),S(e.Variant.Name),r(2),S(e.Variant.Code),r(),u(e.Note!=null?8:-1),r(2),S(g(11,9,e.Quantity)),r(2),u(a.isExpenseItemHasUom()?12:-1),r(),u(!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.Cost?13:-1),r(),u(!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.Cost?14:-1)}}function zi(i,t){if(i&1&&(o(0,"td",38),m(1),f(2,"sumMultiply"),f(3,"number"),n()),i&2){let e=c(3);d("colSpan",e.isExpenseItemHasUom()?3:2),r(),b(" ",g(3,6,z(2,2,e.data().Data.Expenses,"Quantity","Cost"))," ")}}function qi(i,t){if(i&1&&(o(0,"div",8)(1,"div",25)(2,"h2",26),m(3,"Expense Items"),n()(),o(4,"div",18)(5,"table",27)(6,"thead",31)(7,"tr")(8,"th",32),m(9,"No"),n(),o(10,"th"),m(11,"Name"),n(),o(12,"th",33),m(13,"Qty"),n(),s(14,Ai,2,0,"th",34),s(15,Hi,4,1,"th",46),s(16,Ji,4,1,"th",46),n()(),o(17,"tbody"),G(18,$i,15,13,"tr",null,q),n(),o(20,"tfoot")(21,"tr",35)(22,"td",36),m(23,"Total"),n(),o(24,"td",37),m(25),f(26,"sum"),f(27,"number"),n(),s(28,zi,4,8,"td",38),n()()()()()),i&2){let e=c(2);r(14),u(e.isExpenseItemHasUom()?14:-1),r(),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?15:-1),r(),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?16:-1),r(2),K(e.data().Data.Expenses),r(7),b(" ",g(27,8,ee(26,5,e.data().Data.Expenses,"Quantity"))," "),r(3),u(!(e.roleService==null||e.roleService.product==null)&&e.roleService.product.Cost?28:-1)}}function Gi(i,t){if(i&1&&(o(0,"small",30),m(1),f(2,"sumMultiply"),f(3,"sumMultiply"),f(4,"number"),n()),i&2){let e=c(2);r(),b(" (Differences ",g(4,9,e.totalOutputCost()-z(2,1,e.data().Data.Materials,"Quantity","Cost")-z(3,5,e.data().Data.Expenses,"Quantity","Cost")),") ")}}function Ki(i,t){i&1&&(o(0,"th",34),m(1,"Uom"),n())}function Yi(i,t){if(i&1&&(o(0,"th",46),m(1," Cost ("),_(2,"span",21),m(3,") "),n(),o(4,"th",46),m(5," Total ("),_(6,"span",21),m(7,") "),n()),i&2){let e=c(2);r(2),d("innerHTML",e.data().CurrencySymbol,w),r(4),d("innerHTML",e.data().CurrencySymbol,w)}}function Xi(i,t){if(i&1&&(_(0,"p",21),f(1,"newlines")),i&2){let e=c().$implicit;d("innerHTML",g(1,1,e.Note),w)}}function Zi(i,t){if(i&1&&(o(0,"td"),m(1),n()),i&2){let e=c().$implicit;r(),b(" ",e.Variant==null?null:e.Variant.UOMName," ")}}function en(i,t){if(i&1&&(o(0,"td",49),m(1),f(2,"number"),n(),o(3,"td",49),m(4),f(5,"number"),n()),i&2){let e=c().$implicit;r(),b(" ",g(2,2,e.Cost)," "),r(3),b(" ",g(5,4,e.Cost*e.Quantity)," ")}}function tn(i,t){if(i&1&&(o(0,"tr")(1,"td"),_(2,"span",21),n(),o(3,"td")(4,"a",48),m(5),n(),o(6,"div"),m(7),n(),s(8,Xi,2,3,"p",21),n(),o(9,"td",49),m(10),f(11,"number"),n(),s(12,Zi,2,1,"td"),s(13,en,6,6),n()),i&2){let e=t.$implicit,l=t.$index,a=c(2);r(2),d("innerHTML",l+1+".",w),r(2),d("queryParams",Z(10,Ue,e.VariantID)),r(),S(e.Variant==null?null:e.Variant.Name),r(2),b(" ",e.Variant==null?null:e.Variant.Code," "),r(),u(e.Note!=null?8:-1),r(2),b(" ",g(11,8,e.Quantity)," "),r(2),u(a.isOutputItemHasUom()?12:-1),r(),u(!(a.roleService==null||a.roleService.product==null)&&a.roleService.product.Cost?13:-1)}}function nn(i,t){if(i&1&&(o(0,"td",38),m(1),f(2,"number"),n()),i&2){let e=c(2);d("colSpan",e.isOutputItemHasUom()?3:2),r(),b(" ",g(2,2,e.totalOutputCost())," ")}}function on(i,t){if(i&1&&(o(0,"mainpanel-cmp",0)(1,"actions"),s(2,Si,3,1,"a",1),o(3,"div",2),s(4,Mi,3,5,"a",3),s(5,Di,3,0,"a",4),n()(),o(6,"content")(7,"div",5)(8,"div",6)(9,"div",7)(10,"div",8)(11,"div",9)(12,"h2",10),_(13,"i",11),m(14),f(15,"TruncateText"),n(),o(16,"div",2)(17,"button",12),_(18,"b",13),n(),o(19,"ul",14)(20,"li",15)(21,"a",16),_(22,"i",17),m(23," Print "),n()(),s(24,Ii,4,0,"li",15),n()()(),o(25,"div",18)(26,"table",19)(27,"tr")(28,"th",20),m(29,"Name"),n(),o(30,"td"),m(31," : "),_(32,"span",21),n()(),o(33,"tr")(34,"th"),m(35,"Sales Order"),n(),o(36,"td"),m(37," : "),o(38,"a",22),m(39),n()()(),o(40,"tr")(41,"th"),m(42,"Date"),n(),o(43,"td"),m(44," : "),_(45,"span",21),f(46,"date"),n()(),o(47,"tr")(48,"th"),m(49,"State"),n(),o(50,"td"),m(51," : "),_(52,"span",21),n()(),o(53,"tr")(54,"th",23),m(55,"Note"),n(),o(56,"td",23),m(57," : "),_(58,"span",21),n()()()()()(),o(59,"div",24)(60,"div",8)(61,"div",25)(62,"h2",26),m(63,"Material Items"),n()(),o(64,"div",18),s(65,ji,26,10,"table",27),n()(),s(66,qi,29,10,"div",8),o(67,"div",8)(68,"div",25)(69,"div",28)(70,"h2",29),m(71," Output Items "),s(72,Gi,5,11,"small",30),f(73,"sumMultiply"),n()()(),o(74,"div",18)(75,"table",27)(76,"thead",31)(77,"tr")(78,"th",32),m(79,"No"),n(),o(80,"th"),m(81,"Name"),n(),o(82,"th",33),m(83,"Qty"),n(),s(84,Ki,2,0,"th",34),s(85,Yi,8,2),n()(),o(86,"tbody"),G(87,tn,14,12,"tr",null,q),n(),o(89,"tfoot")(90,"tr",35)(91,"td",36),m(92,"Total"),n(),o(93,"td",37),m(94),f(95,"sum"),f(96,"number"),n(),s(97,nn,3,4,"td",38),n()()()()()()()()()()),i&2){let e,l,a,p=c();d("pageData",p.menuData())("hideSearchBox",!0)("hideSearchDropdown",!0),r(2),u(p.data().Data.Order.State!=3?2:-1),r(2),u(p.data().Data.Order.State===1&&(!(p.roleService==null||p.roleService.manufacture==null)&&p.roleService.manufacture.Edit)?4:-1),r(),u(!(p.roleService==null||p.roleService.manufacture==null)&&p.roleService.manufacture.Delete?5:-1),r(9),b(" ",g(15,24,(e=p.data().Data)==null||e.Order==null?null:e.Order.EntityName)," "),r(7),d("routerLink",p.data().Data.Order.PrintUrl)("queryParams",Se(38,vi,p.data().Data.Order.ID,p.data().Data.Order.EntityPrintTemplateID)),r(3),u(!(p.roleService==null||p.roleService.global==null)&&p.roleService.global.Export?24:-1),r(8),d("innerHTML",p.data().Data.Order.Name,w),r(6),d("routerLink",te(41,bi))("queryParams",Z(42,Ue,p.data().Data.Order.SalesOrderID)),r(),S(p.data().Data.Order.SalesOrderNumber),r(6),d("innerHTML",ee(46,26,p.data().Data.Order.Date,"dd MMM yyyy"),w),r(7),d("innerHTML",p.data().Data.Order.StateDisplay,w),r(6),d("innerHTML",p.data().Data.Order.Note,w),r(7),u(p.data().Data.Materials.length?65:-1),r(),u(((l=p.data().Data)==null||l.Expenses==null?null:l.Expenses.length)>0?66:-1),r(6),u(p.Math.floor(p.totalOutputCost()-z(73,29,p.data().Data.Materials,"Quantity","Cost"))!=0?72:-1),r(12),u(p.isOutputItemHasUom()?84:-1),r(),u(!(p.roleService==null||p.roleService.product==null)&&p.roleService.product.Cost?85:-1),r(2),K((a=p.data().Data)==null?null:a.Outputs),r(7),b(" ",g(96,36,ee(95,33,p.data().Data.Outputs,"Quantity"))," "),r(3),u(!(p.roleService==null||p.roleService.product==null)&&p.roleService.product.Cost?97:-1)}}var Ct=class i extends Fe{constructor(e,l,a,p,M,j,J){super(e,l,"Manufacture/Info",void 0,p,a);this.toastr=p;this.router=M;this.csvConverter=j;this.roleService=J}toastr;router;csvConverter;roleService;Math=Math;isItemHasUom=E(!1);isOutputItemHasUom=E(!1);isExpenseItemHasUom=E(!1);totalOutputCost=E(0);preGetList(){let e=this.route?.snapshot.queryParams;this.pageData().Filter.ID=e?.ID}postInit(e){this.menuData.update(l=>I(h({},l),{H:e.PageTitle})),this.checkItemHasUom(e.Data?.Materials),this.checkOutputItemHasUom(e.Data?.Outputs),this.calculateTotalOutputCost(e.Data?.Outputs),this.checkExpenseItemHasUom(e.Data?.Expenses)}checkItemHasUom(e=[]){let l=e.some(a=>D.IsNotEmpty(a.Variant?.UOMName));this.isItemHasUom.set(l)}checkOutputItemHasUom(e=[]){let l=e.some(a=>D.IsNotEmpty(a.Variant?.UOMName));this.isOutputItemHasUom.set(l)}checkExpenseItemHasUom(e=[]){let l=e.some(a=>D.IsNotEmpty(a.Variant?.UOMName));this.isExpenseItemHasUom.set(l)}calculateTotalOutputCost(e=[]){let l=e.reduce((a,p)=>a+p.Cost*p.Quantity,0);this.totalOutputCost.set(l)}process(e){let l=this.data().Data.Order.State===1?"API/Manufacture/ProcessInProgress":"/API/Manufacture/ProcessOrder";this.httpService.post(l,e).subscribe({next:a=>{this.toastr.success(a.Message,xe.Success),this.getListData()},error:a=>{this.toastr.error(a,xe.Error)}})}delete(e,l){confirm("Are you sure you want to delete this job order?")&&this.httpService.delete(e,{params:[{key:"ID",value:l}]}).subscribe({next:a=>{this.router.navigate(["/menu/Manufacture/Job_Order/Archive"])},error:a=>{this.toastr.error(a,xe.Error)}})}static \u0275fac=function(l){return new(l||i)(O(ye),O(W),O(mt),O(ge),O(Ut),O(je),O(U))};static \u0275cmp=A({type:i,selectors:[["POS-job-order-info"]],standalone:!1,features:[Pe],decls:1,vars:1,consts:[[3,"pageData","hideSearchBox","hideSearchDropdown"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn-group"],["role","button",1,"btn","btn-outline-secondary",3,"routerLink","queryParams"],[1,"btn","btn-outline-secondary"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-4"],[1,"card"],[1,"card-header","d-flex","justify-content-between","align-items-center"],[1,"title","mb-0"],["aria-hidden","true",1,"fa","fa-location-dot"],["data-bs-toggle","dropdown",1,"btn","btn-outline-secondary","dropdown-toggle"],[1,"caret"],[1,"dropdown-menu","dropdown-menu-end","cursor","text-dark"],[1,"dropdown-item"],["role","button","target","_blank","matTooltipPosition","above","matTooltip","Print",3,"routerLink","queryParams"],[1,"fa","fa-print"],[1,"card-body"],[1,"table-sm","table-borderless"],[2,"width","75px"],[3,"innerHTML"],["target","_blank",3,"routerLink","queryParams"],["valign","top"],[1,"col-sm-8"],[1,"card-header"],[1,"title"],[1,"table","custom-table"],[1,"me-auto","d-sm-block","mt-3"],[1,"d-inline"],[1,"text-danger","fst-italic"],[1,"thead-light"],[2,"width","20px"],[1,"text-end",2,"width","40px"],[2,"width","50px"],[1,"table-footer"],["colspan","2",1,"empty-column","text-end"],[1,"empty-column","text-end"],[1,"empty-column","text-end",3,"colSpan"],[1,"btn","btn-outline-secondary","me-3",3,"click"],[1,"fa-solid","fa-industry"],[1,"fa-solid","fa-pen-to-square"],[1,"btn","btn-outline-secondary",3,"click"],[1,"fa","fa-trash"],[3,"click"],["aria-hidden","true",1,"fa","fa-upload"],[1,"text-end",2,"width","90px"],[1,"empty-column"],["routerLink","/menu/Products/Catalog/Variants/Info","target","_blank",3,"queryParams"],[1,"text-end"]],template:function(l,a){l&1&&s(0,on,98,44,"mainpanel-cmp",0),l&2&&u(a.data()?0:-1)},dependencies:[Ce,be,Ve,ie,rt,Ae,oi,ve,ai],encapsulation:2,changeDetection:0})};var pn=()=>["/menu/Manufacture/Job_Order/Archive/Form"],cn=()=>["/menu/Manufacture/Job_Order/Archive/Info"],dn=i=>({ID:i}),sn=()=>["/print/JobOrderMini"],un=(i,t)=>({ID:i,Template:t});function fn(i,t){if(i&1){let e=T();o(0,"a",18),v("click",function(){x(e);let a=c(2);return y(a.httpPostListID("Manufacture/Delete"))}),_(1,"i",19),m(2,"Delete "),n()}}function _n(i,t){if(i&1){let e=T();o(0,"button",20),v("click",function(){x(e);let a=c(2);return y(a.openExportModal())}),_(1,"i",21),m(2," Export "),n()}}function Cn(i,t){i&1&&(o(0,"a",5),m(1,"New"),n()),i&2&&d("routerLink",te(1,pn))}function gn(i,t){if(i&1){let e=T();o(0,"div",22)(1,"div",23)(2,"h6"),m(3,"Outlet"),n(),o(4,"outlet-selector",24),B("ngModelChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.ListIDs,a)||(p.pageData().Filter.ListIDs=a),y(a)}),n()(),o(5,"div",23)(6,"h6"),m(7,"Output"),n(),o(8,"autocompleteV2",25),v("onInputChange",function(a){x(e);let p=c(2);return y(p.checkTextEmpty(a))})("onSelect",function(a){x(e);let p=c(2);return y(p.selectOutput(a))}),n()(),o(9,"div",23)(10,"h6"),m(11,"From Date"),n(),o(12,"datepicker",26),B("dateChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.From,a)||(p.pageData().Filter.From=a),y(a)}),n()(),o(13,"div",23)(14,"h6"),m(15,"To Date"),n(),o(16,"datepicker",27),B("dateChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.To,a)||(p.pageData().Filter.To=a),y(a)}),n()(),o(17,"div",23)(18,"h6"),m(19,"State"),n(),o(20,"ng-select",28),B("ngModelChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.State,a)||(p.pageData().Filter.State=a),y(a)}),n()(),o(21,"div",23)(22,"h6"),m(23,"Order"),n(),o(24,"ng-select",29),B("ngModelChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.Order,a)||(p.pageData().Filter.Order=a),y(a)}),n()(),o(25,"div",23)(26,"h6"),m(27,"Page Size"),n(),o(28,"input",30),B("ngModelChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.RowCount,a)||(p.pageData().Filter.RowCount=a),y(a)}),n()()()}if(i&2){let e=c(2);r(4),d("accessType",2),k("ngModel",e.pageData().Filter.ListIDs),d("multiple",!0),r(4),d("renderThumbnail",!0),r(4),d("isFloatingLabel",!1),k("date",e.pageData().Filter.From),r(4),d("isFloatingLabel",!1),k("date",e.pageData().Filter.To),r(4),d("items",e.pageData().Options.States),k("ngModel",e.pageData().Filter.State),r(4),d("items",e.order),k("ngModel",e.pageData().Filter.Order),d("clearable",!1),r(4),d("max",1e4),k("ngModel",e.pageData().Filter.RowCount)}}function xn(i,t){if(i&1){let e=T();o(0,"th",10)(1,"input",31),v("change",function(a){x(e);let p=c(2);return y(p.onSelectAllData(a.target.checked))}),n()()}}function yn(i,t){if(i&1){let e=T();o(0,"td")(1,"input",36),B("ngModelChange",function(a){x(e);let p=c().$implicit;return L(p.selected,a)||(p.selected=a),y(a)}),n()()}if(i&2){let e=c().$implicit;r(),k("ngModel",e.selected)}}function vn(i,t){if(i&1&&(o(0,"tr"),s(1,yn,2,1,"td"),o(2,"td"),m(3),n(),o(4,"td"),m(5),f(6,"date"),n(),o(7,"td")(8,"a",32),m(9),n()(),_(10,"td",33),o(11,"td"),m(12),n(),o(13,"td")(14,"a",34),_(15,"i",35),n()()()),i&2){let e=t.$implicit,l=c(2);r(),u(l.roleService.manufacture.Delete?1:-1),r(2),S(e.EntityName),r(2),S(ee(6,10,e.Date,"dd MMM yyyy")),r(3),d("routerLink",te(13,cn))("queryParams",Z(14,dn,e.ID)),r(),S(e.Number),r(),d("innerHTML",e.Note,w),r(2),S(e.StateDisplay),r(2),d("routerLink",te(16,sn))("queryParams",Se(17,un,e.ID,e.EntityPrintTemplateID))}}function bn(i,t){if(i&1){let e=T();o(0,"mat-paginator",37),v("page",function(a){x(e);let p=c(2);return y(p.onPaginationChange(a))}),n()}if(i&2){let e=c(2);d("length",e.pagination.listTotal())("pageSize",e.pagination.pageSize())("pageIndex",e.pageData().Filter.PageNumber==0?0:e.pageData().Filter.PageNumber-1)}}function hn(i,t){if(i&1){let e=T();o(0,"mainpanel-cmp",2),B("textChange",function(a){x(e);let p=c();return L(p.pageData().Filter.Number,a)||(p.pageData().Filter.Number=a),y(a)}),v("onSubmit",function(){x(e);let a=c();return y(a.searchFromPageOne())}),B("filterChange",function(a){x(e);let p=c();return L(p.pageData().Filter,a)||(p.pageData().Filter=a),y(a)}),o(1,"actions"),s(2,fn,3,0,"a",3),s(3,_n,3,0,"button",4),s(4,Cn,2,2,"a",5),n(),o(5,"filters"),nt(6,gn,29,15,"ng-template",null,0,ot),n(),o(8,"content")(9,"div",6)(10,"div",7)(11,"table",8),v("matSortChange",function(a){x(e);let p=c();return y(p.sortData(a))}),o(12,"thead",9)(13,"tr"),s(14,xn,2,0,"th",10),o(15,"th",11),m(16,"Outlet"),n(),o(17,"th",12),m(18,"Date"),n(),o(19,"th",13),m(20,"Number"),n(),o(21,"th",14),m(22,"Production Output"),n(),o(23,"th",15),m(24,"State"),n(),_(25,"th",16),n()(),o(26,"tbody"),G(27,vn,16,20,"tr",null,q),n()()(),o(29,"div"),s(30,bn,1,3,"mat-paginator",17),n()()()()}if(i&2){let e=c();d("pageData",e.menuData()),k("text",e.pageData().Filter.Number),d("isFilterOnDropdown",!1),k("filter",e.pageData().Filter),r(2),u(e.getSelectedData().length>0?2:-1),r(),u(e.roleService.global.Export?3:-1),r(),u(e.roleService.manufacture.Create?4:-1),r(10),u(e.roleService.manufacture.Delete?14:-1),r(13),K(e.data().Data),r(3),u(e.pagination.listTotal()>0?30:-1)}}var gt=class i extends Fe{constructor(e,l,a,p,M,j){super(e,l,"Manufacture/List","Manufacture/ListLoader",a);this.csvConverter=p;this.roleService=M;this.matDialog=j}csvConverter;roleService;matDialog;originalData=E(null);order=E([{Value:"Ascending",Key:0},{Value:"Descending",Key:1}]);postInit(e){this.originalData=e.Data}selectOutput(e){this.pageData().Filter.Output=e}checkTextEmpty(e){e==""&&(this.pageData().Filter.Output=null)}sortData(e){let l=this.data().Data.slice();if(!e.active||e.direction===""){this.data().Data=this.originalData;return}this.data().Data=l.sort((a,p)=>{let M=e.direction==="asc";switch(e.active){case"date":return this.compare(a.Date,p.Date,M);case"number":return this.compare(a.Number,p.Number,M);case"production":return this.compare(a.Note,p.Note,M);default:return 0}})}openExportModal(){this.matDialog.open(dt,{data:{title:"Manufacture",exportTypes:[{ID:"Manufacture/ListExport",Value:"Default",FileName:"Manufacture List"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!0}})}static \u0275fac=function(l){return new(l||i)(O(ye),O(W),O(ge),O(je),O(U),O(pe))};static \u0275cmp=A({type:i,selectors:[["POS-job-order-list"]],standalone:!1,features:[Pe],decls:1,vars:1,consts:[["pageFilterTemplate",""],["filterDialogWidth","600px",3,"pageData","text","isFilterOnDropdown","filter"],["filterDialogWidth","600px",3,"textChange","onSubmit","filterChange","pageData","text","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-5"],[1,"btn","btn-outline-secondary","me-3"],[1,"btn","btn-success",3,"routerLink"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid","matSort","",1,"table","border-bottom",3,"matSortChange"],[1,"thead-light","sticky-top-thead"],[2,"width","24px"],[2,"width","80px"],["mat-sort-header","date",2,"width","100px"],["mat-sort-header","number",2,"width","120px"],["mat-sort-header","production"],[2,"width","60px"],[2,"width","26px"],[3,"length","pageSize","pageIndex"],[1,"btn","btn-outline-secondary","me-5",3,"click"],[1,"fa-solid","fa-trash","me-3"],[1,"btn","btn-outline-secondary","me-3",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter","grid-filter"],[1,"filter-item"],["placeholder","Choose an Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","multiple"],["requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"w-100","ac-filter",3,"onInputChange","onSelect","renderThumbnail"],["placeholder","From","appearance","outline",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose..",3,"ngModelChange","items","ngModel"],["appendTo","body","bindLabel","Value","bindValue","Key",3,"ngModelChange","items","ngModel","clearable"],["type","text","autoNum","",1,"form-control","input-filter",3,"ngModelChange","max","ngModel"],["type","checkbox",3,"change"],[3,"routerLink","queryParams"],[3,"innerHTML"],["target","_blank",3,"routerLink","queryParams"],["aria-hidden","true",1,"fa","fa-print"],["type","checkbox",3,"ngModelChange","ngModel"],[3,"page","length","pageSize","pageIndex"]],template:function(l,a){l&1&&s(0,hn,31,9,"mainpanel-cmp",1),l&2&&u(a.data()?0:-1)},dependencies:[pt,$t,Y,X,Zt,Ce,Je,Be,st,be,Kt,Yt,ct,He,rt],encapsulation:2,changeDetection:0})};var _i=()=>["/menu/Products/Catalog/Variants/Info"],Ci=i=>({ID:i});function Sn(i,t){if(i&1){let e=T();o(0,"button",21),v("click",function(){x(e);let a=c(2);return y(a.openExportModal())}),_(1,"i",22),m(2," Export "),n()}}function Mn(i,t){if(i&1){let e=T();o(0,"div",23)(1,"h6"),m(2,"Outlet"),n(),o(3,"outlet-selector",24),B("ngModelChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.EntityID,a)||(p.pageData().Filter.EntityID=a),y(a)}),n(),o(4,"h6"),m(5,"From"),n(),o(6,"datepicker",25),B("dateChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.From,a)||(p.pageData().Filter.From=a),y(a)}),n(),o(7,"h6"),m(8,"To"),n(),o(9,"datepicker",26),B("dateChange",function(a){x(e);let p=c(2);return L(p.pageData().Filter.To,a)||(p.pageData().Filter.To=a),y(a)}),n()()}if(i&2){let e=c(2);r(3),d("accessType",4),k("ngModel",e.pageData().Filter.EntityID),d("multiple",!1),r(3),d("isFloatingLabel",!1),k("date",e.pageData().Filter.From),r(3),d("isFloatingLabel",!1),k("date",e.pageData().Filter.To)}}function Dn(i,t){if(i&1&&(o(0,"tr")(1,"td"),m(2),n(),o(3,"td")(4,"a",27),m(5),n()(),o(6,"td",28),m(7),n()()),i&2){let e=t.$implicit;r(2),S(e.VariantCode),r(2),d("routerLink",te(5,_i))("queryParams",Z(6,Ci,e.VariantID)),r(),S(e.VariantName),r(2),b(" ",e.Quantity," ")}}function In(i,t){if(i&1&&(o(0,"tr")(1,"td"),m(2),n(),o(3,"td")(4,"a",27),m(5),n()(),o(6,"td",29),m(7),n()()),i&2){let e=t.$implicit;r(2),S(e.VariantCode),r(2),d("routerLink",te(5,_i))("queryParams",Z(6,Ci,e.VariantID)),r(),S(e.VariantName),r(2),b(" ",e.Quantity," ")}}function On(i,t){if(i&1){let e=T();o(0,"mainpanel-cmp",2),v("onSubmit",function(){x(e);let a=c();return y(a.searchFromPageOne())}),B("filterChange",function(a){x(e);let p=c();return L(p.pageData().Filter,a)||(p.pageData().Filter=a),y(a)}),o(1,"actions"),s(2,Sn,3,0,"button",3),n(),o(3,"filters"),nt(4,Mn,10,7,"ng-template",null,0,ot),n(),o(6,"content")(7,"div",4)(8,"div",5)(9,"div",6)(10,"div",7)(11,"div",8)(12,"h2",9),m(13,"Material Used"),n()(),o(14,"div",10)(15,"table",11)(16,"thead",12)(17,"tr")(18,"th"),m(19,"Code"),n(),o(20,"th"),m(21,"Name"),n(),o(22,"th",13),m(23,"Quantity"),n()()(),o(24,"tbody"),G(25,Dn,8,8,"tr",null,q),n()(),o(27,"div",14)(28,"table",15)(29,"tr")(30,"th"),m(31,"Total"),n(),o(32,"td",16),m(33,":"),n(),o(34,"td",17),m(35),f(36,"sum"),f(37,"number"),n()()()()()()(),o(38,"div",18)(39,"div",7)(40,"div",8)(41,"h2",9),m(42,"Output"),n()(),o(43,"div",10)(44,"table",11)(45,"thead",12)(46,"tr")(47,"th"),m(48,"Code"),n(),o(49,"th"),m(50,"Name"),n(),o(51,"th",19),m(52,"Quantity"),n()()(),o(53,"tbody"),G(54,In,8,8,"tr",null,q),n()(),o(56,"div",14)(57,"table",15)(58,"tr")(59,"th"),m(60,"Total"),n(),o(61,"td",16),m(62,":"),n(),o(63,"td",20),m(64),f(65,"sum"),f(66,"number"),n()()()()()()()()()()()}if(i&2){let e=c();d("pageData",e.menuData())("hideSearchBox",!0)("isFilterOnDropdown",!1),k("filter",e.pageData().Filter),r(2),u(e.roleService.global.Export?2:-1),r(23),K(e.data().Material),r(10),b(" ",g(37,10,ee(36,7,e.data().Material,"Quantity"))," "),r(19),K(e.data().Output),r(10),b(" ",g(66,15,ee(65,12,e.data().Output,"Quantity"))," ")}}var yt=class i extends Fe{constructor(e,l,a,p,M){super(e,l,"Manufacture/ManufactureProduction","ManufactureLoader/ManufactureProduction");this.csvConverter=a;this.roleService=p;this.matDialog=M}csvConverter;roleService;matDialog;openExportModal(){this.matDialog.open(dt,{data:{title:"Manufacture Report",exportTypes:[{ID:"Manufacture/ExportManufacture",Value:"Default",FileName:"Manufacture Report"}],filterExport:this.pageData().Filter,getAllDataLengthAPI:"",pagination:!0}})}static \u0275fac=function(l){return new(l||i)(O(ye),O(W),O(je),O(U),O(pe))};static \u0275cmp=A({type:i,selectors:[["POS-manufacture-production"]],standalone:!1,features:[Pe],decls:1,vars:1,consts:[["pageFilterTemplate",""],[3,"pageData","hideSearchBox","isFilterOnDropdown","filter"],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn","btn-outline-secondary","me-3"],[1,"container-fluid","mt-5"],[1,"row"],[1,"col-sm-5"],[1,"card"],[1,"card-header"],[1,"title"],[1,"card-body"],["id","tableGrid",1,"table","border-bottom"],[1,"thead-light","sticky-top-thead"],[1,"text-end"],[1,"d-flex","justify-content-end","mt-8","me-2"],["cellspacing","0","cellpadding","0",1,"form-horizontal",2,"width","64px"],[2,"width","10px"],[2,"color","red"],[1,"col-sm-7"],[1,"text-end",2,"width","20px"],[1,"text-primary"],[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",3,"dateChange","isFloatingLabel","date"],["placeholder","To","appearance","outline",3,"dateChange","isFloatingLabel","date"],[3,"routerLink","queryParams"],[1,"text-end",2,"color","red"],[1,"text-end","text-primary"]],template:function(l,a){l&1&&s(0,On,67,17,"mainpanel-cmp",1),l&2&&u(a.data()?0:-1)},dependencies:[Y,X,Ce,Je,be,He,ie,Ae],encapsulation:2,changeDetection:0})};var P=class i{state=ci({isEdit:!1,manufactureMaterialMode:0,submitWithMismatch:!1,loadFormData:null,expenses:[],materials:[],outputs:[],outlet:{Name:"Choose an Outlet",ID:D.GuidEmpty,PrintTemplateID:0},outlets:[],invoiceDate:new Date,invoiceNumber:"",jobDescription:"",incompleteOrders:[],SalesOrderNumber:void 0,note:"",completeData:null});isEdit=this.state.select(t=>t.isEdit());manufactureMaterialMode=this.state.select(t=>t.manufactureMaterialMode());submitWithMismatch=this.state.select(t=>t.submitWithMismatch());loadFormData=this.state.select(t=>t.loadFormData());expenses=this.state.select(t=>t.expenses());materials=this.state.select(t=>t.materials());outputs=this.state.select(t=>t.outputs());outlet=this.state.select(t=>t.outlet());outlets=this.state.select(t=>t.outlets());invoiceDate=this.state.select(t=>t.invoiceDate());invoiceNumber=this.state.select(t=>t.invoiceNumber());jobDescription=this.state.select(t=>t.jobDescription());incompleteOrders=this.state.select(t=>t.incompleteOrders());SalesOrderNumber=this.state.select(t=>t.SalesOrderNumber());note=this.state.select(t=>t.note());completeData=this.state.select(t=>t.completeData());constructor(){}updateIsEdit(t){this.state.update("isEdit",t)}updateManufactureMaterialMode(t){this.state.update("manufactureMaterialMode",t)}updateLoadFormData(t){this.state.update("loadFormData",t)}updateSubmitWithMismatch(t){this.state.update("submitWithMismatch",t)}updateExpenses(t){this.state.update("expenses",t)}updateMaterials(t){this.state.update("materials",t)}updateOutputs(t){this.state.update("outputs",t)}updateOutlet(t){this.state.update("outlet",t)}updateOutlets(t){this.state.update("outlets",t)}updateInvoiceDate(t){this.state.update("invoiceDate",t)}updateInvoiceNumber(t){this.state.update("invoiceNumber",t)}updateJobDescription(t){this.state.update("jobDescription",t)}updateIncompleteOrders(t){this.state.update("incompleteOrders",t)}updateSalesOrderNumber(t){this.state.update("SalesOrderNumber",t)}updateNote(t){this.state.update("note",t)}updateCompleteData(t){this.state.update("completeData",t)}getCart(t){if(t==="Expenses")return this.expenses();if(t==="Materials")return this.materials();if(t==="Outputs")return this.outputs()}updateCart(t,e){t==="Expenses"?this.updateExpenses(e):t==="Materials"?this.updateMaterials(e):t==="Outputs"&&this.updateOutputs(e)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var Te=class i{store=C(P);isOpenOutletDialog=E(!0);updateIsOpenOutletDialog$=Q(this.store.isEdit).pipe(V(t=>!t),N(t=>this.isOpenOutletDialog.set(t)),jt(1));constructor(){this.updateIsOpenOutletDialog$.subscribe()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var $e=class i{store=C(P);http=C(W);assignGeneratedInvoiceNumber$=Re(Q(this.store.outlet).pipe(F(t=>!this.store.isEdit()&&D.IsNotEmpty(t.ID))),Q(this.store.completeData).pipe(F(t=>D.IsNotEmpty(t)),V(()=>this.store.outlet()))).pipe(V(t=>t.ID),re(t=>this.http.post("/API/Transaction/GenerateNumber",{entityID:t,typeID:14})),N(t=>this.store.updateInvoiceNumber(t)),le());assignInvoiceNumberOnEdit$=Q(this.store.loadFormData).pipe(F(()=>this.store.isEdit()),N(t=>this.updateInvoiceNumber(t?.Order.Number)));constructor(){this.assignGeneratedInvoiceNumber$.subscribe(),this.assignInvoiceNumberOnEdit$.subscribe()}updateInvoiceNumber(t){this.store.updateInvoiceNumber(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var ze=class i{route=C(mt);store=C(P);http=C(W);loadForm$=Bt(this.route.snapshot.queryParams).pipe(N(t=>this.store.updateIsEdit(D.IsNotEmpty(t?.ID))),re(t=>this.http.post("/api/Manufacture/FormLoad",{ID:t?.ID})),N(t=>{this.store.updateManufactureMaterialMode(t.Configs.ManufactureMaterialMode),this.store.updateSubmitWithMismatch(t.Configs.SubmitWithMismatch),this.store.updateLoadFormData(t.Data),this.store.updateOutlets(t.Options.Entities),this.store.updateIncompleteOrders(t.Options.IncompleteOrders),this.store.updateSalesOrderNumber(t.Data.Order.SalesOrderID),this.store.updateNote(t.Data.Order.Note),this.store.updateOutputs(t.Data?.Outputs?.map(e=>I(h({},e),{ManufacturedComponent:e.Variant.ManufacturedComponent}))??[]),this.store.updateExpenses(t.Data.Expenses??[]),this.store.updateMaterials(t.Data.Materials??[]),this.store.updateJobDescription(t.Data.Order.Name)}),le());constructor(){this.loadForm$.subscribe()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var qe=class i{store=C(P);assignOutletOnEdit$=Q(this.store.loadFormData).pipe(F(t=>this.store.isEdit()&&D.IsNotEmpty(t?.Order.EntityID)),N(t=>this.updateOutlet({ID:t.Order.EntityID,Name:t.Order.EntityName,PrintTemplateID:0})),le());constructor(){this.assignOutletOnEdit$.subscribe()}updateOutlet(t){this.store.updateOutlet(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var we=class i{store=C(P);isOpen=C(Te);assignIsEdit$=Q(this.store.loadFormData).pipe(F(t=>D.IsNotEmpty(t)),V(t=>D.IsNotEmpty(t?.Order.ID)));constructor(){}createNewTransaction(){this.store.updateIsEdit(!1),this.isOpen.isOpenOutletDialog.set(!1),this.store.updateExpenses([]),this.store.updateMaterials([]),this.store.updateOutputs([]),this.store.updateInvoiceDate(new Date),this.store.updateJobDescription(""),this.store.updateSalesOrderNumber(void 0),this.store.updateCompleteData(null)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};function wn(i,t){if(i&1&&(o(0,"h5",9),m(1),n()),i&2){let e=c(2);r(),b(" ",e.extraTitle()," ")}}function Pn(i,t){if(i&1){let e=T();o(0,"a",11),v("click",function(){x(e);let a=c(2);return y(a.requestUnitInStock())}),_(1,"i",12),n()}}function Nn(i,t){if(i&1&&(o(0,"header"),s(1,wn,2,1,"h5",9),s(2,Pn,2,0,"a",10),n()),i&2){let e=c();r(),u(e.toggleInventory()?1:-1),r(),u(e.toggleInventory()?-1:2)}}function Vn(i,t){if(i&1){let e=T();o(0,"autocompleteV2",13),v("onSelect",function(a){x(e);let p=c();return y(p.selectItem(a))})("onInputEnter",function(a){x(e);let p=c();return y(p.scanCode(a))})("keyup.enter",function(a){return a.stopPropagation()}),n()}i&2&&d("renderThumbnail",!0)}function Fn(i,t){if(i&1){let e=T();o(0,"input",6),B("ngModelChange",function(a){x(e);let p=c(2);return L(p.item().Cost,a)||(p.item().Cost=a),y(a)}),n()}if(i&2){let e=c(2);k("ngModel",e.item().Cost)}}function kn(i,t){if(i&1&&_(0,"input",15),i&2){let e=c(2);d("ngModel",e.item().Cost)}}function Ln(i,t){if(i&1&&(o(0,"div",5)(1,"h6"),m(2,"Cost:"),n(),s(3,Fn,1,1,"input",14),s(4,kn,1,1,"input",15),n()),i&2){let e=c();r(3),u(e.data.isDisableCost?-1:3),r(),u(e.data.isDisableCost?4:-1)}}var vt=class i{constructor(t,e,l,a,p){this.data=t;this.httpService=e;this.dialogRef=l;this.toastr=a;this.roleService=p;this.config.update(M=>I(h({},M),{customWidth:"420px"})),this.item.set(Object.assign({},t.item)),this.entityID.set(t.entityID),D.IsEmpty(this.item().Variant)?(this.config.update(M=>I(h({},M),{title:"Add Item"})),this.item.set({})):(this.isEdit.set(!0),this.config.update(M=>I(h({},M),{title:this.item().Variant.Name})),this.previousQuantity.set(this.item().Quantity))}data;httpService;dialogRef;toastr;roleService;extraTitle=E("");isEdit=E(!1);item=E(void 0);config=E(new Ie);entityID=E("");toggleInventory=E(!1);previousQuantity=E(0);selectItem(t){this.httpService.get(De.GetVariantByID,[{key:"ID",value:t},{key:"EntityID",value:this.entityID},{key:"Promotion",value:!1}]).subscribe(e=>{this.config.update(l=>I(h({},l),{title:e.Name})),this.item.update(l=>({Title:e.Name,Variant:e,Cost:e.UnitCost,Quantity:1}))})}onOk(){if(D.IsEmpty(this.item().Quantity)||this.item().Quantity==0){this.toastr.error("Quantity must be greater than zero and can not be empty.",xe.Error);return}if(D.IsEmpty(this.item().Cost)&&this.item().Cost!=0){this.toastr.error("Cost is required.",xe.Error);return}this.dialogRef.close(I(h({},this.item()),{PreviousQuantity:this.previousQuantity()}))}requestUnitInStock(){if(D.IsEmpty(this.entityID())){this.toastr.error("Please select outlet before proceeding..",xe.Error);return}this.httpService.get(De.GetVariantStockByID,[{key:"ID",value:this.item().Variant?.ID},{key:"EntityID",value:this.entityID()}]).subscribe(t=>{this.item().Variant.OnHand=t.OnHand,this.extraTitle.set(` Inventory: ${t.OnHand}`),t.Ordered!==void 0&&(this.item().Variant.Ordered=t.Ordered,this.extraTitle.set(`${this.extraTitle()} , Ordered: ${t.Ordered}`)),this.toggleInventory.set(!0)})}scanCode(t){this.httpService.get(De.GetVariantByCode,[{key:"Code",value:t},{key:"EntityID",value:this.entityID},{key:"BarcodeSerial",value:!1},{key:"Promotion",value:!0}]).subscribe(e=>{this.config.update(l=>I(h({},l),{title:e.Name})),this.item.update(l=>I(h({},l),{Title:e.Name,Variant:e,Cost:e.UnitCost,Quantity:1}))})}static \u0275fac=function(e){return new(e||i)(O(Le),O(W),O(ke),O(ge),O(U))};static \u0275cmp=A({type:i,selectors:[["POS-modal-item"]],standalone:!1,decls:16,vars:6,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],[1,"row"],[1,"col-12"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"renderThumbnail"],[1,"col-4","mt-5"],["type","text","autoNum","",1,"w-75","form-control",3,"ngModelChange","ngModel"],[1,"col-12","mt-5"],["height","220px",3,"ngModelChange","ngModel"],[1,"ms-5","fw-normal",2,"padding-top","3px"],["matTooltip","Click to view current on-hand inventory","matTooltipPosition","above",1,"ms-5",2,"cursor","pointer"],["matTooltip","Click to view current on-hand inventory","matTooltipPosition","above",1,"ms-5",2,"cursor","pointer",3,"click"],[1,"fa-solid","fa-circle-question","mt-1",2,"font-size","20px","color","white"],["placeholder","Search product by name / code","requestUrl","/API/AC/GetVariantSuggestionByCodeNName",1,"input-left","w-100",3,"onSelect","onInputEnter","keyup.enter","renderThumbnail"],["type","text","autoNum","",1,"w-75","form-control",3,"ngModel"],["readonly","","type","text","autoNum","",1,"w-75","form-control",2,"background-color","#e9ecef",3,"ngModel"]],template:function(e,l){e&1&&(o(0,"modal-material",0),v("onOk",function(){return l.onOk()})("onCancel",function(){return l.dialogRef.close()})("onClose",function(){return l.dialogRef.close()}),s(1,Nn,3,2,"header"),o(2,"content")(3,"div",1)(4,"div",2)(5,"div",3),s(6,Vn,1,1,"autocompleteV2",4),n(),o(7,"div",5)(8,"h6"),m(9,"Qty:"),n(),o(10,"input",6),B("ngModelChange",function(p){return L(l.item().Quantity,p)||(l.item().Quantity=p),p}),n()(),s(11,Ln,5,2,"div",5),o(12,"div",7)(13,"h6"),m(14,"Note:"),n(),o(15,"POS-tinymce-editor",8),B("ngModelChange",function(p){return L(l.item().Note,p)||(l.item().Note=p),p}),n()()()()()()),e&2&&(d("config",l.config()),r(),u(l.isEdit()?1:-1),r(5),u(l.isEdit()?-1:6),r(4),k("ngModel",l.item().Quantity),r(),u(l.roleService.product.Cost?11:-1),r(4),k("ngModel",l.item().Note))},dependencies:[pt,Y,X,st,ue,ct,Ve,he],styles:["autocompletev2[_ngcontent-%COMP%] input{font-size:14px}"],changeDetection:0})};var fe=class i{matDialog=C(pe);http=C(W);store=C(P);_cartAction=new Lt;cartAction$=this._cartAction.asObservable();outputSearchFilter=E(null);materialSearchFilter=E(null);expenseSearchFilter=E(null);variantFromAutocompleteCode$=Re(Q(this.outputSearchFilter).pipe(V(t=>I(h({},t),{cartType:"Outputs"}))),Q(this.materialSearchFilter).pipe(V(t=>I(h({},t),{cartType:"Materials"}))),Q(this.expenseSearchFilter).pipe(V(t=>I(h({},t),{cartType:"Expenses"})))).pipe(F(t=>D.IsNotEmpty(t)&&t.type=="Code"),V(t=>({code:t.str,cartType:t.cartType})),re(t=>this.http.get(De.GetVariantByCode,[{key:"Code",value:t.code},{key:"EntityID",value:this.store.outlet().ID}]).pipe(V(e=>I(h({},e),{Cost:e.UnitCost,Quantity:1,Variant:h({},e)})),V(e=>({item:e,cartType:t.cartType})),Ze(()=>Xe))),N(t=>this.add(t.item,t.cartType)));variantFromAutocompleteID$=Re(Q(this.outputSearchFilter).pipe(V(t=>I(h({},t),{cartType:"Outputs"}))),Q(this.materialSearchFilter).pipe(V(t=>I(h({},t),{cartType:"Materials"}))),Q(this.expenseSearchFilter).pipe(V(t=>I(h({},t),{cartType:"Expenses"})))).pipe(F(t=>D.IsNotEmpty(t)&&t.type=="ID"),V(t=>({id:t.str,cartType:t.cartType})),re(t=>this.http.get(De.GetVariantByID,[{key:"ID",value:t.id},{key:"EntityID",value:this.store.outlet().ID}]).pipe(V(e=>I(h({},e),{Cost:e.UnitCost,Quantity:1,Variant:h({},e)})),V(e=>({item:e,cartType:t.cartType})),Ze(()=>Xe))),N(t=>this.add(t.item,t.cartType)));manipulateCart$=this.cartAction$.pipe(F(t=>t.action=="remove"||t.action=="replaceCart"||t.action=="emptyCart"),N(t=>{let e=[],l=[...this.store.getCart(t.type)],a=t.action;if(a=="remove"){let p=t.index;e=l.filter((M,j)=>j!=p)}else a=="replaceCart"?e=[...t.items]:a=="emptyCart"&&(e=[]);this.store.updateCart(t.type,e)}),Ht([]),At(1));generateMaterial$=this.cartAction$.pipe(F(t=>t.action=="add"||t.action=="update"),N(t=>{let e=t.action,l=[...this.store.getCart(t.type)],a=[];if(e=="add"){let M=t.item;l.find(J=>J.Variant.ID===M.Variant.ID)?a=l.map(J=>J.Variant.ID===M.Variant.ID?I(h({},J),{Quantity:J.Quantity+M.Quantity}):J):a=[...l,I(h({},M),{ID:D.GuidEmpty,VariantID:M.Variant.ID})]}else if(e=="update"){let M=t.item,j=t.index;a=l.map(($,de)=>de==j?h({},M):$),console.log(M),console.log(a);let J=M.ManufacturedComponent;if(J&&J.length){let de=[...this.store.getCart("Materials")];J.forEach(oe=>{de=de.map(Ye=>Ye.Variant.ID===oe.ID?I(h({},Ye),{Quantity:Ye.Quantity+oe.Quantity*(M.Quantity-M.PreviousQuantity)}):Ye)}),console.log(de,"updatedMaterials"),this.store.updateCart("Materials",de)}}let p=this.store.getCart("Outputs");if(t.type!="Outputs"&&p.length==1){let M=t.type=="Expenses"?this.store.getCart("Materials").reduce((J,$)=>J+$.Cost*$.Quantity,0):this.store.getCart("Expenses").reduce((J,$)=>J+$.Cost*$.Quantity,0),j=[I(h({},p[0]),{Cost:this.truncateTo4Decimals((M+a.reduce((J,$)=>J+$.Cost*$.Quantity,0))/p[0].Quantity)})];console.log("UPDATED OUTPUT CART",j),this.store.updateCart("Outputs",j)}if(t.type=="Outputs"&&p.length==1){let M=this.store.getCart("Materials"),j=this.store.getCart("Expenses"),$=[...M,...j].reduce((de,oe)=>de+oe.Cost*oe.Quantity,0)/a[0]?.Quantity;a[0].Cost=$}this.store.updateCart(t.type,a)}),F(t=>t.action=="add"&&(t.type=="Outputs"&&this.store.manufactureMaterialMode()==0||t.type=="Materials"&&this.store.manufactureMaterialMode()==1)),re(t=>(console.log("GENERATE MATERIAL",t),this.generateMaterial(t.type,t.item))),N(t=>this.store.updateCart(t.type,t.items)));truncateTo4Decimals(t){return t&&Math.trunc(t*1e4)/1e4}constructor(){this.manipulateCart$.subscribe(),this.generateMaterial$.subscribe(),this.variantFromAutocompleteCode$.subscribe(),this.variantFromAutocompleteID$.subscribe()}remove(t,e){this._cartAction.next({action:"remove",index:t,type:e})}add(t,e){this._cartAction.next({action:"add",item:t,type:e})}replaceCart(t,e){this._cartAction.next({action:"replaceCart",items:t,type:e})}openDialogItem(t,e,l){this.matDialog.open(vt,{data:{item:e,isDisableCost:t==="Outputs"&&this.store.outputs().length==1,entityID:this.store.outlet().ID}}).afterClosed().pipe(F(a=>D.IsNotEmpty(a))).subscribe(a=>l===void 0?this.add(a,t):this._cartAction.next({action:"update",item:a,index:l,type:t}))}generateMaterial(t,e){let l=[{ID:e.Variant.ID,Quantity:e.Quantity}],a="Outputs";t=="Outputs"&&(a="Materials");let p=this.store.getCart(a);return this.http.post("/API/catalog/variant/GetComponentVariantByCode",l).pipe(V(M=>{let j=p;M&&M.length&&M.forEach($=>{j.find(oe=>oe.Variant.ID===$.Variant.ID)?j=j.map(oe=>oe.Variant.ID===$.Variant.ID?I(h({},oe),{Quantity:oe.Quantity+$.Quantity}):oe):j=[...j,h({},$)]});let J={type:a,items:j};return console.log(J,"generated"),J}),Ze(()=>Xe))}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ge=class i{store=C(P);assignInvoiceDateOnEdit$=Q(this.store.loadFormData).pipe(F(()=>this.store.isEdit()),N(t=>this.updateInvoiceDate(t?.Order.Date)),le());constructor(){this.assignInvoiceDateOnEdit$.subscribe()}updateInvoiceDate(t){this.store.updateInvoiceDate(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var Ke=class i{store=C(P);assignJobDescriptionOnEdit$=Q(this.store.jobDescription).pipe(F(()=>this.store.isEdit()),N(t=>this.updateJobDescription(t)),le());constructor(){this.assignJobDescriptionOnEdit$.subscribe()}updateJobDescription(t){this.store.updateJobDescription(t)}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};function Bn(i,t){if(i&1&&(o(0,"div",14),_(1,"img",23),n()),i&2){let e=c().$implicit;r(),d("src",e.ThumbnailUrl||e.Variant.ThumbnailUrl,tt)}}function jn(i,t){i&1&&(o(0,"div",15),_(1,"i",24),n())}function An(i,t){if(i&1&&(o(0,"span"),m(1),f(2,"number"),n()),i&2){let e=c().$implicit,l=c(2);Ne("marg-right-100",!l.role.product.Cost),r(),S(g(2,3,e.Quantity))}}function Hn(i,t){i&1&&(o(0,"span",25),m(1," x "),n())}function Jn(i,t){if(i&1&&(o(0,"span"),m(1),f(2,"number"),n()),i&2){let e=c(2).$implicit;r(),S(g(2,1,e.Cost))}}function Qn(i,t){if(i&1&&(s(0,Hn,2,0,"span",25),s(1,Jn,3,3,"span")),i&2){let e=c().$implicit,l=c(2);u((e.Quantity>1||e.Quantity<-1)&&l.role.product.Cost?0:-1),r(),u((e.Quantity>1||e.Quantity<-1)&&l.role.product.Cost?1:-1)}}function Rn(i,t){i&1&&m(0," - ")}function Wn(i,t){if(i&1&&(m(0),f(1,"number")),i&2){let e=c(2).$implicit;b(" ",g(1,1,e.Quantity*e.Cost)," ")}}function Un(i,t){i&1&&m(0," - ")}function $n(i,t){if(i&1&&(o(0,"td",19),s(1,Wn,2,3)(2,Un,1,0),n()),i&2){let e=c(3);r(),u(e.role.product.Cost?1:2)}}function zn(i,t){if(i&1){let e=T();o(0,"tr",11),v("click",function(){let a=x(e),p=a.$implicit,M=a.$index,j=c(2);return y(j.update(p,M))}),o(1,"td",12)(2,"div",13),s(3,Bn,2,1,"div",14)(4,jn,2,0,"div",15),o(5,"div",16)(6,"div"),m(7),n(),o(8,"span",17),m(9),n(),_(10,"small",18),n()()(),o(11,"td",19),s(12,An,3,5,"span",20),s(13,Qn,2,2)(14,Rn,1,0),n(),s(15,$n,3,1,"td",19),o(16,"td",21)(17,"i",22),v("click",function(){let a=x(e).$index,p=c(2);return y(p.deleteVariant(a))}),n()()()}if(i&2){let e=t.$implicit,l=c(2);r(3),u(e.ThumbnailUrl||e.Variant.ThumbnailUrl?3:4),r(4),S(e.Variant.Name),r(2),S(e.Variant.Code),r(),d("innerHtml",e.Note,w),r(2),u(e.Quantity!=1||e.UnitQuantity>1?12:-1),r(),u(l.role.product.Cost?13:14),r(2),u(l.role.product.Cost?15:-1)}}function qn(i,t){if(i&1&&(o(0,"div",6)(1,"table",9)(2,"tbody"),G(3,zn,18,7,"tr",10,q),n()()()),i&2){let e=c();r(3),K(e.carts())}}function Gn(i,t){i&1&&(o(0,"div",7)(1,"div",26)(2,"div",27)(3,"div",28)(4,"div",29),_(5,"i",30),n(),o(6,"div",31)(7,"span"),m(8,"Empty Cart"),n(),_(9,"br"),o(10,"span"),m(11,"Add products to the cart"),n()()()()()())}function Kn(i,t){if(i&1&&(o(0,"div",8)(1,"div",32)(2,"div",33)(3,"div",34),m(4,"Total Output Cost:"),n(),o(5,"div",35),m(6),f(7,"sumMultiply"),f(8,"number"),n()()()()),i&2){let e=c();r(6),b(" ",g(8,5,z(7,1,e.carts(),"Quantity","Cost"))," ")}}var bt=class i{store=C(P);carts=_e(()=>this.store.outputs());outletId=_e(()=>this.store.outlet()?.ID);sf;cartService=C(fe);role=C(U);update(t,e){this.cartService.openDialogItem("Outputs",t,e)}deleteVariant(t){this.cartService.remove(t,"Outputs")}addItem(t){this.sf=t,D.IsNotEmpty(t)&&this.cartService.outputSearchFilter.set(t)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=A({type:i,selectors:[["POS-output-cart"]],decls:10,vars:5,consts:[[1,"d-flex","flex-column",2,"height","calc(100vh - 140px)"],[1,"card-header","d-flex","justify-content-between","px-6","pt-2","align-items-center"],[1,"title",2,"font-size","1rem"],[1,"row","w-100","ms-0","mt-3"],[1,"col-12","px-0"],["autocompleteEndpoint","/api/ac/GetVariantSuggestionByCodeAndNameWithOutletForManufacture","amountProperty","VariantCost",3,"ngModelChange","ngModel","outletID"],["PinScrollingBottom","",1,"table-responsive","overflow-y-auto","flex-grow-1"],[1,"row","g-0","h-100",2,"margin-bottom","64.6px"],[1,"p-6"],[1,"table","table-borderless"],[1,"border-bottom"],[1,"border-bottom",3,"click"],[1,"ps-6",2,"width","50%"],[1,"d-flex"],[1,"ratio","ratio-1x1",2,"width","55px"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"ms-4","d-flex","flex-column","justify-content-center",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",2,"word-break","break-all",3,"innerHtml"],[1,"text-end"],[3,"marg-right-100"],[1,"text-end","pe-6",2,"width","75px"],[1,"fa-solid","fa-trash","fs-4","text-danger","pointer",3,"click"],[1,"item-image",3,"src"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6"],[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"],[1,"p-6",2,"background-color","#f8f9fa","border-radius","10px"],[1,"d-flex","justify-content-between","mt-2","pb-4"],[1,"col-6","text-start"],[1,"col-6","text-end"]],template:function(e,l){if(e&1&&(o(0,"div",0)(1,"div",1)(2,"h2",2),m(3),n()(),o(4,"div",3)(5,"div",4)(6,"POS-variant-autocomplete",5),v("ngModelChange",function(p){return l.addItem(p)}),n()()(),s(7,qn,5,0,"div",6)(8,Gn,12,0,"div",7),s(9,Kn,9,7,"div",8),n()),e&2){let a,p;r(3),b(" Output (",(a=l.carts())==null?null:a.length,") "),r(3),d("ngModel",l.sf)("outletID",l.outletId()),r(),u((p=l.carts())!=null&&p.length?7:8),r(2),u(l.role.product.Cost?9:-1)}},dependencies:[ne,ft,me,Y,X,_t,ae,ie,ve],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}"],changeDetection:0})};function Yn(i,t){if(i&1){let e=T();o(0,"POS-variant-autocomplete",13),v("ngModelChange",function(a){x(e);let p=c();return y(p.addItem(a))}),n()}if(i&2){let e=c();d("ngModel",e.sfm())("outletID",e.outletId())}}function Xn(i,t){if(i&1){let e=T();o(0,"POS-variant-autocomplete",13),v("ngModelChange",function(a){x(e);let p=c();return y(p.addItem(a))}),n()}if(i&2){let e=c();d("ngModel",e.sfe())("outletID",e.outletId())}}function Zn(i,t){if(i&1&&(o(0,"div",19),_(1,"img",28),n()),i&2){let e=c().$implicit;r(),d("src",e.ThumbnailUrl||e.Variant.ThumbnailUrl,tt)}}function eo(i,t){i&1&&(o(0,"div",20),_(1,"i",29),n())}function to(i,t){if(i&1&&(o(0,"span"),m(1),f(2,"number"),n()),i&2){let e=c().$implicit,l=c(2);Ne("marg-right-100",!l.role.product.Cost),r(),S(g(2,3,e.Quantity))}}function io(i,t){i&1&&(o(0,"span",30),m(1," x "),n())}function no(i,t){if(i&1&&(o(0,"span"),m(1),f(2,"number"),n()),i&2){let e=c(2).$implicit;r(),S(g(2,1,e.Cost))}}function oo(i,t){if(i&1&&(s(0,io,2,0,"span",30),s(1,no,3,3,"span")),i&2){let e=c().$implicit,l=c(2);u((e.Quantity>1||e.Quantity<-1)&&l.role.product.Cost?0:-1),r(),u((e.Quantity>1||e.Quantity<-1)&&l.role.product.Cost?1:-1)}}function ao(i,t){i&1&&m(0," - ")}function ro(i,t){if(i&1&&(m(0),f(1,"number")),i&2){let e=c(2).$implicit;b(" ",g(1,1,e.Quantity*e.Cost)," ")}}function lo(i,t){i&1&&m(0," - ")}function mo(i,t){if(i&1&&(o(0,"td",24),s(1,ro,2,3)(2,lo,1,0),n()),i&2){let e=c(3);r(),u(e.role.product.Cost?1:2)}}function po(i,t){if(i&1){let e=T();o(0,"tr",16),v("click",function(){let a=x(e),p=a.$implicit,M=a.$index,j=c(2);return y(j.update(p,M))}),o(1,"td",17)(2,"div",18),s(3,Zn,2,1,"div",19)(4,eo,2,0,"div",20),o(5,"div",21)(6,"div"),m(7),n(),o(8,"span",22),m(9),n(),_(10,"small",23),n()()(),o(11,"td",24),s(12,to,3,5,"span",25),s(13,oo,2,2)(14,ao,1,0),n(),s(15,mo,3,1,"td",24),o(16,"td",26)(17,"i",27),v("click",function(){let a=x(e).$index,p=c(2);return y(p.deleteVariant(a))}),n()()()}if(i&2){let e=t.$implicit,l=c(2);r(3),u(e.ThumbnailUrl||e.Variant.ThumbnailUrl?3:4),r(4),S(e.Variant.Name),r(2),S(e.Variant.Code),r(),d("innerHtml",e.Note,w),r(2),u(e.Quantity!=1||e.UnitQuantity>1?12:-1),r(),u(l.role.product.Cost?13:14),r(2),u(l.role.product.Cost?15:-1)}}function co(i,t){if(i&1&&(o(0,"div",10)(1,"table",14)(2,"tbody"),G(3,po,18,7,"tr",15,q),n()()()),i&2){let e=c();r(3),K(e.currentCart())}}function so(i,t){i&1&&(o(0,"div",11)(1,"div",31)(2,"div",32)(3,"div",33)(4,"div",34),_(5,"i",35),n(),o(6,"div",36)(7,"span"),m(8,"Empty cart"),n(),_(9,"br"),o(10,"span"),m(11,"Add products to the cart"),n()()()()()())}function uo(i,t){if(i&1&&(o(0,"div",12)(1,"div",37)(2,"div",38)(3,"div",39),m(4),n(),o(5,"div",40),m(6),f(7,"sumMultiply"),f(8,"sumMultiply"),f(9,"number"),n()(),o(10,"div",38)(11,"div",39),m(12,"Total Input Cost:"),n(),o(13,"div",40),m(14),f(15,"sumMultiply"),f(16,"sumMultiply"),f(17,"number"),n()()()()),i&2){let e=c();r(4),b(" Total ",e.currentState()==="m"?"Materials":"Expenses"," Cost: "),r(2),b(" ",g(9,11,e.currentState()==="m"?z(7,3,e.materials(),"Quantity","Cost"):z(8,7,e.expenses(),"Quantity","Cost"))," "),r(8),b(" ",g(17,21,z(15,13,e.materials(),"Quantity","Cost")+z(16,17,e.expenses(),"Quantity","Cost"))," ")}}var ht=class i{currentState=E("m");options=[{label:"Materials",value:0},{label:"Expenses",value:1}];materials=se([]);expenses=se([]);outletId=se("");sfm=E(null);sfe=E(null);cartService=C(fe);role=C(U);currentCart=_e(()=>this.currentState()=="m"?this.materials():this.expenses());update(t,e){this.cartService.openDialogItem(this.currentState()=="m"?"Materials":"Expenses",t,e)}deleteVariant(t){this.cartService.remove(t,this.currentState()=="m"?"Materials":"Expenses")}addItem(t){this.currentState()=="m"?(this.sfm.set(t),D.IsNotEmpty(t)&&this.cartService.materialSearchFilter.set(t)):(this.sfe.set(t),D.IsNotEmpty(t)&&this.cartService.expenseSearchFilter.set(t))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=A({type:i,selectors:[["POS-material-cart"]],inputs:{materials:[1,"materials"],expenses:[1,"expenses"],outletId:[1,"outletId"]},decls:17,vars:7,consts:[[1,"d-flex","flex-column",2,"height","calc(100vh - 140px)"],[1,"card-header","d-flex","justify-content-between","px-6","pt-2","align-items-center"],[1,"title",2,"font-size","1rem"],[1,"d-flex","w-100","ms-0","mt-3"],[1,"flex-grow-1","px-0"],["autocompleteEndpoint","/api/ac/GetVariantSuggestionByCodeAndNameWithOutletForManufacture","amountProperty","VariantCost",3,"ngModel","outletID"],[1,"me-6","ps-0"],["name","fontStyle","aria-label","Font Style",2,"height","38px","align-items","center",3,"ngModelChange","hideSingleSelectionIndicator","ngModel"],["value","m"],["value","e"],["PinScrollingBottom","",1,"table-responsive","overflow-y-auto","flex-grow-1"],[1,"row","g-0","h-100"],[1,"p-6"],["autocompleteEndpoint","/api/ac/GetVariantSuggestionByCodeAndNameWithOutletForManufacture","amountProperty","VariantCost",3,"ngModelChange","ngModel","outletID"],[1,"table","table-borderless"],[1,"border-bottom"],[1,"border-bottom",3,"click"],[1,"ps-6",2,"width","50%"],[1,"d-flex"],[1,"ratio","ratio-1x1",2,"width","55px"],[1,"item-image","d-flex","justify-content-center","align-items-center","text-center","fs-1"],[1,"ms-4","d-flex","flex-column","justify-content-center",2,"line-height","18px"],[1,"fw-normal","fs-6","text-muted"],["title","Note",1,"special-TinyMCE","m-0","fst-italic","d-block",2,"word-break","break-all",3,"innerHtml"],[1,"text-end"],[3,"marg-right-100"],[1,"text-end","pe-6",2,"width","75px"],[1,"fa-solid","fa-trash","fs-4","text-danger","pointer",3,"click"],[1,"item-image",3,"src"],[1,"fa-solid","fa-image",2,"color","#b4b4b4c2"],[1,"fs-6"],[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"],[1,"p-6",2,"background-color","#f8f9fa","border-radius","10px"],[1,"d-flex","justify-content-between","mt-2","pb-4"],[1,"col-6","text-start"],[1,"col-6","text-end"]],template:function(e,l){if(e&1&&(o(0,"div",0)(1,"div",1)(2,"h2",2),m(3),n()(),o(4,"div",3)(5,"div",4),s(6,Yn,1,2,"POS-variant-autocomplete",5),s(7,Xn,1,2,"POS-variant-autocomplete",5),n(),o(8,"div",6)(9,"mat-button-toggle-group",7),v("ngModelChange",function(p){return l.currentState.set(p)}),o(10,"mat-button-toggle",8),m(11,"Materials"),n(),o(12,"mat-button-toggle",9),m(13,"Expenses"),n()()()(),s(14,co,5,0,"div",10)(15,so,12,0,"div",11),s(16,uo,18,23,"div",12),n()),e&2){let a,p;r(3),b(" Input (",(a=l.currentCart())==null?null:a.length,") "),r(3),u(l.currentState()=="m"?6:-1),r(),u(l.currentState()=="e"?7:-1),r(2),d("hideSingleSelectionIndicator",!0)("ngModel",l.currentState()),r(5),u((p=l.currentCart())!=null&&p.length?14:15),r(2),u(l.role.product.Cost?16:-1)}},dependencies:[ne,_t,ft,me,Y,X,ni,ti,ii,ae,ie,ve],styles:[".item-image[_ngcontent-%COMP%]{height:50px;width:56px;display:block;border:solid 1px #dddddd;border-radius:5px;object-fit:contain}.marg-right-100[_ngcontent-%COMP%]{margin-right:100px}.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} mat-button-toggle-group, mat-button-toggle{width:100%}"],changeDetection:0})};var fo=()=>["/menu/Manufacture/Job_Order/Archive/Info"],_o=i=>({ID:i}),Co=()=>["/print/JobOrder"],gi=(i,t)=>({ID:i,Template:t}),go=()=>["/print/JobOrderMini"];function xo(i,t){if(i&1&&(o(0,"a",13),_(1,"i",21),m(2,"Print "),n()),i&2){let e=c();d("routerLink",te(2,Co))("queryParams",Se(3,gi,e.afterProcessData().OrderID,e.printTemplateID()))}}function yo(i,t){if(i&1&&(o(0,"a",13),_(1,"i",21),m(2,"Print "),n()),i&2){let e=c();d("routerLink",te(2,go))("queryParams",Se(3,gi,e.afterProcessData().OrderID,e.printTemplateID()))}}function vo(i,t){if(i&1&&(m(0),f(1,"number")),i&2){let e=c().$implicit;b(" ",g(1,1,e.Cost)," ")}}function bo(i,t){i&1&&m(0," - ")}function ho(i,t){if(i&1&&(o(0,"div",19)(1,"div",20),m(2),n(),o(3,"div",20),m(4),f(5,"number"),n(),o(6,"div",20),s(7,vo,2,3)(8,bo,1,0),n()()),i&2){let e=t.$implicit,l=c();r(2),S(e.Variant.Name),r(2),S(g(5,3,e.Quantity)),r(3),u(l.role.product.Cost?7:8)}}function So(i,t){if(i&1&&(m(0),f(1,"sum"),f(2,"number")),i&2){let e=c();b(" ",g(2,4,ee(1,1,e.materials(),"Cost"))," ")}}function Mo(i,t){i&1&&m(0," - ")}function Do(i,t){if(i&1&&(m(0),f(1,"number")),i&2){let e=c().$implicit;b(" ",g(1,1,e.Cost)," ")}}function Io(i,t){i&1&&m(0," - ")}function Oo(i,t){if(i&1&&(o(0,"div",19)(1,"div",20),m(2),n(),o(3,"div",20),m(4),f(5,"number"),n(),o(6,"div",20),s(7,Do,2,3)(8,Io,1,0),n()()),i&2){let e=t.$implicit,l=c();r(2),S(e.Variant.Name),r(2),S(g(5,3,e.Quantity)),r(3),u(l.role.product.Cost?7:8)}}function Eo(i,t){if(i&1&&(m(0),f(1,"sum"),f(2,"number")),i&2){let e=c();b(" ",g(2,4,ee(1,1,e.expenses(),"Cost"))," ")}}function To(i,t){i&1&&m(0," - ")}var St=class i{handleF8(){this.createNewTransaction()}afterProcessData=se({});printTemplateID=se(0);materials=se([]);expenses=se([]);pageSetup=C(ye);title=C(lt);isEdit=C(we);role=C(U);menu$;constructor(){this.pageSetup.setMenu$(),this.menu$=this.pageSetup.menu$.pipe(V(t=>I(h({},t),{H:"Job Order",T:t.T.replace("undefined","Job Order")})),N(t=>this.title.setTitle(t.T)))}createNewTransaction(){this.isEdit.createNewTransaction()}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=A({type:i,selectors:[["POS-complete"]],hostBindings:function(e,l){e&1&&v("keydown.F8",function(){return l.handleF8()},Jt)},inputs:{afterProcessData:[1,"afterProcessData"],printTemplateID:[1,"printTemplateID"],materials:[1,"materials"],expenses:[1,"expenses"]},decls:54,vars:27,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],[1,"row","px-6","pt-6"],[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","py-4"],[1,"d-flex","justify-content-between"],["target","_blank",1,"btn","bg-light-gray","btn-secondary",3,"routerLink","queryParams"],[1,"col-4"],[1,"card-header","bg-light-gray",2,"padding-bottom","15px"],[1,"fst-italic"],[3,"routerLink","queryParams"],[1,"card-body"],[1,"ps-5","row","justify-content-between","mb-5"],[1,"col","text-start"],["aria-hidden","true",1,"fa","fa-print","me-3"]],template:function(e,l){e&1&&(o(0,"mainpanel-cmp",0),f(1,"async"),o(2,"content")(3,"div",1)(4,"div",2)(5,"div",3)(6,"div",4)(7,"h1",5),_(8,"i",6),m(9,"Job Order Complete "),n()(),o(10,"div",7)(11,"div",8)(12,"div",9)(13,"a",10),v("click",function(){return l.createNewTransaction()}),m(14,"New Job Order (F8)"),n()()()(),o(15,"div",11)(16,"div",12),s(17,xo,3,6,"a",13),s(18,yo,3,6,"a",13),n()()()(),o(19,"div",14)(20,"div",3)(21,"div",15)(22,"h2",16)(23,"a",17),m(24),n()()(),o(25,"div",18)(26,"h2"),m(27,"Material"),n(),G(28,ho,9,5,"div",19,q),o(30,"div",19)(31,"span",20),m(32,"Total:"),n(),o(33,"span",20),m(34),f(35,"sum"),f(36,"number"),n(),o(37,"span",20),s(38,So,3,6)(39,Mo,1,0),n()(),o(40,"h2"),m(41,"Output"),n(),G(42,Oo,9,5,"div",19,q),o(44,"div",19)(45,"span",20),m(46,"Total:"),n(),o(47,"span",20),m(48),f(49,"sum"),f(50,"number"),n(),o(51,"span",20),s(52,Eo,3,6)(53,To,1,0),n()()()()()()()()),e&2&&(d("pageData",g(1,12,l.menu$))("hideSearchDropdown",!0)("hideSearchBox",!0),r(17),u(l.afterProcessData().printMode==1?17:-1),r(),u(l.afterProcessData().printMode!=1?18:-1),r(5),d("routerLink",te(24,fo))("queryParams",Z(25,_o,l.afterProcessData().OrderID)),r(),b("#",l.afterProcessData().InvoiceNumber),r(4),K(l.materials()),r(6),S(g(36,17,ee(35,14,l.materials(),"Quantity"))),r(4),u(l.role.product.Cost?38:39),r(4),K(l.expenses()),r(6),S(g(50,22,ee(49,19,l.expenses(),"Quantity"))),r(4),u(l.role.product.Cost?52:53))},dependencies:[ne,Me,Ce,ut,be,ae,at,ie,Ae],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} #full-container{padding-top:60px!important}"],changeDetection:0})};var Mt=class i{constructor(t,e){this.data=t;this.dialogRef=e;this.config.update(l=>I(h({},l),{title:"Submit Job Order Note",customWidth:"520px"})),this.note.set(t)}data;dialogRef;config=E(new Ie);note=E("");ok(){this.dialogRef.close({note:this.note()})}static \u0275fac=function(e){return new(e||i)(O(Le),O(ke))};static \u0275cmp=A({type:i,selectors:[["POS-modal-order-note"]],standalone:!1,decls:4,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],["height","220px",3,"ngModelChange","ngModel"]],template:function(e,l){e&1&&(o(0,"modal-material",0),v("onOk",function(){return l.ok()})("onCancel",function(){return l.dialogRef.close()})("onClose",function(){return l.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"POS-tinymce-editor",2),B("ngModelChange",function(p){return L(l.note,p)||(l.note=p),p}),n()()()()),e&2&&(d("config",l.config()),r(3),k("ngModel",l.note))},dependencies:[Y,X,ue,he],encapsulation:2,changeDetection:0})};var Qe=class i{matDialog=C(pe);store=C(P);http=C(W);toastr=C(ge);constructor(){}submit(){if(this.store.outputs().length==0||this.store.materials().length==0){this.toastr.info("Output and Material must not be empty","Info");return}this.matDialog.open(Mt,{data:this.store.note()}).afterClosed().pipe(F(t=>D.IsNotEmpty(t)),N(t=>this.store.updateNote(t?.note)),re(t=>{let e={Order:I(h({},this.store.loadFormData().Order),{Note:t.note,Date:this.store.invoiceDate(),EntityID:this.store.outlet().ID,EntityName:this.store.outlet().Name,Number:this.store.invoiceNumber().toString(),SalesOrderID:this.store.SalesOrderNumber(),Name:this.store.jobDescription()}),Outputs:this.store.outputs(),Expenses:this.store.expenses(),Materials:this.store.materials()};return this.http.post("/api/Manufacture/Submit",e)}),N(t=>this.store.updateCompleteData(t))).subscribe()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=R({token:i,factory:i.\u0275fac,providedIn:"root"})};var Dt=class i{constructor(t,e){this.data=t;this.dialogRef=e;this.config.set(new Ie),this.config.update(l=>I(h({},l),{title:"Submit Job Order Name",customWidth:"520px"})),this.description.set(t.description)}data;dialogRef;config=E(new Ie);description=E("");ok(){this.dialogRef.close({description:this.description})}static \u0275fac=function(e){return new(e||i)(O(Le),O(ke))};static \u0275cmp=A({type:i,selectors:[["POS-dialog-sales-order"]],decls:4,vars:2,consts:[[3,"onOk","onCancel","onClose","config"],[1,"container-fluid"],["height","220px",3,"ngModelChange","ngModel"]],template:function(e,l){e&1&&(o(0,"modal-material",0),v("onOk",function(){return l.ok()})("onCancel",function(){return l.dialogRef.close()})("onClose",function(){return l.dialogRef.close()}),o(1,"content")(2,"div",1)(3,"POS-tinymce-editor",2),B("ngModelChange",function(p){return L(l.description,p)||(l.description=p),p}),n()()()()),e&2&&(d("config",l.config()),r(3),k("ngModel",l.description))},dependencies:[ue,me,Y,X,ne,he],encapsulation:2,changeDetection:0})};var It=class i{submitService=C(Qe);store=C(P);roleService=C(U);matDialog=C(pe);role=C(U);http=C(W);submit(){this.submitService.submit()}openSalesOrderDialog(){this.matDialog.open(Dt,{data:{description:this.store.jobDescription()}}).afterClosed().pipe(F(t=>D.IsNotEmpty(t?.description))).subscribe(t=>this.store.updateJobDescription(t.description))}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=A({type:i,selectors:[["POS-cart-action"]],decls:12,vars:17,consts:[[1,"row","g-0"],[1,"col-4","d-flex","justify-content-between","pe-5",2,"column-gap","12px"],[1,"btn","btn-gray","w-100","fs-3","px-0","py-6",3,"click"],[1,"col-8"],["type","button",1,"btn","btn-success","w-100","fs-3","px-0","py-6",2,"border-left","0.1px solid #fff","height","100%",3,"click","disabled"]],template:function(e,l){e&1&&(Tt(0,"div",0)(1,"div",1)(2,"button",2),Pt("click",function(){return l.openSalesOrderDialog()}),m(3," Description "),wt()(),Tt(4,"div",3)(5,"button",4),f(6,"sumMultiply"),f(7,"sumMultiply"),f(8,"number"),f(9,"sumMultiply"),f(10,"number"),Pt("click",function(){return l.submit()}),m(11," Submit "),wt()()()),e&2&&(r(5),Qt("disabled",!(l.store.submitWithMismatch()||!l.store.submitWithMismatch()&&g(8,9,z(6,1,l.store.materials(),"Quantity","Cost")+z(7,5,l.store.expenses(),"Quantity","Cost"))==g(10,15,z(9,11,l.store.outputs(),"Quantity","Cost")))))},dependencies:[ne,ae,ie,ve],styles:[".btn-gray[_ngcontent-%COMP%]{border:1px solid #d6d6d6;font-family:Roboto Slab,serif!important;color:#545454!important;background:linear-gradient(to bottom,#fff,#eee)}"],changeDetection:0})};var wo=i=>({"background-color":i});function Po(i,t){if(i&1&&(m(0),f(1,"number")),i&2){let e=c(2);b(" ",g(1,1,e.differences())," ")}}function No(i,t){i&1&&(o(0,"span"),m(1,"Mismatch Cost Detected"),n(),_(2,"i",28))}function Vo(i,t){i&1&&(o(0,"span"),m(1,"Unauthorized"),n(),_(2,"i",28))}function Fo(i,t){if(i&1&&(o(0,"div",27),s(1,No,3,0)(2,Vo,3,0),n()),i&2){let e=c(2);r(),u(e.differences()!==0?1:2)}}function ko(i,t){if(i&1){let e=T();o(0,"div",0)(1,"div",2)(2,"div",3)(3,"div",4)(4,"POS-select-outlet-form",5),v("ngModelChange",function(a){x(e);let p=c();return y(p.store.updateOutlet(a))}),n(),o(5,"POS-invoice-number-form",6),v("ngModelChange",function(a){x(e);let p=c();return y(p.store.updateInvoiceNumber(a))}),n(),o(6,"POS-invoice-date",7),v("ngModelChange",function(a){x(e);let p=c();return y(p.store.updateInvoiceDate(a))}),n()()(),o(7,"div",8)(8,"div",9)(9,"div",10)(10,"ng-select",11),v("ngModelChange",function(a){x(e);let p=c();return y(p.store.updateSalesOrderNumber(a))})("click",function(){x(e);let a=c();return y(a.getIncompleteOrders(a.store.outlet().ID))}),n()(),o(11,"div",12)(12,"div",13)(13,"button",14),f(14,"async"),v("click",function(){x(e);let a=c();return y(a.toggle.toggleSidebar())}),_(15,"span",15)(16,"span",15)(17,"span",15),n()()()()()(),o(18,"div",16)(19,"div",17),_(20,"POS-output-cart"),n(),o(21,"div",18),_(22,"POS-material-cart",19),n()(),o(23,"div",20)(24,"div",21)(25,"div",22)(26,"div",23)(27,"div",24)(28,"div",25),m(29," Differences: "),n(),o(30,"div",26),s(31,Po,2,3)(32,Fo,3,1,"div",27),n()()(),o(33,"div",23),_(34,"POS-cart-action"),n()()()()()}if(i&2){let e=c();r(4),d("outlets",e.store.outlets())("isOpenAfterLoad",e.isOpen.isOpenOutletDialog())("ngModel",e.store.outlet()),r(),d("ngModel",e.store.invoiceNumber())("isEdit",e.store.isEdit())("disabled",!e.role.global.Number),r(),d("ngModel",e.store.invoiceDate())("disabled",!(e.role.global!=null&&e.role.global.Date))("tooltip",e.role.global!=null&&e.role.global.Date?"":"Date role is required"),r(4),d("items",e.incompleteOrders)("ngModel",e.store.SalesOrderNumber()),r(3),Ne("change",g(14,18,e.toggle.toggleState$)),r(9),d("expenses",e.store.expenses())("materials",e.store.materials())("outletId",e.store.outlet().ID),r(5),d("ngStyle",Z(20,wo,e.differences()===0?"#f8f9fa":"#FDEAEA")),r(4),u(e.role.product.Cost?31:32)}}function Lo(i,t){if(i&1&&_(0,"POS-complete",1),i&2){let e=c();d("afterProcessData",e.store.completeData())("printTemplateID",e.printTemplateID())("materials",e.store.materials())("expenses",e.store.outputs())}}var Ot=class i{incompleteOrders=[];intercom=C(zt);isOpen=C(Te);store=C(P);invNumber=C($e);ld=C(ze);outlet=C(qe);isEdit=C(we);cart=C(fe);invDate=C(Ge);jobDesc=C(Ke);toggle=C(qt);role=C(U);http=C(W);printTemplateID=_e(()=>this.store.outlets().find(t=>t.ID===this.store.outlet().ID)?.PrintTemplateID);constructor(){let t=C(lt);t.setTitle(t.getTitle()+" | Manufacture")}ngAfterViewInit(){this.intercom.hideLauncher()}ngOnDestroy(){this.intercom.showLauncher()}getIncompleteOrders(t){this.http.get("/API/Manufacture/GetUnfulfilledOrdersByOutletID?OutletID="+t).subscribe(e=>this.incompleteOrders=e)}differences=_e(()=>Math.floor(Math.abs(this.store.outputs().map(t=>t.Quantity*t.Cost).reduce((t,e)=>t+e,0)-(this.store.materials().map(t=>t.Quantity*t.Cost).reduce((t,e)=>t+e,0)+this.store.expenses().map(t=>t.Quantity*t.Cost).reduce((t,e)=>t+e,0)))));static \u0275fac=function(e){return new(e||i)};static \u0275cmp=A({type:i,selectors:[["POS-manufacture-v2"]],features:[Rt([Te,P,$e,ze,qe,we,fe,Ge,Ke,Qe])],decls:2,vars:1,consts:[[1,"container-fluid"],[3,"afterProcessData","printTemplateID","materials","expenses"],[1,"row","header","border-bottom"],[1,"col-6","border-end"],[1,"left-toolbar-container","h-100","d-flex","align-items-center","justify-content-between"],[3,"ngModelChange","outlets","isOpenAfterLoad","ngModel"],["transactionType","Manufacture",3,"ngModelChange","ngModel","isEdit","disabled"],[3,"ngModelChange","ngModel","disabled","tooltip"],[1,"col-6","d-flex","align-items-center"],[1,"row","flex-grow-1"],[1,"col-lg-7","col-5","d-flex","align-items-center"],["appendTo","body","bindLabel","Option","bindValue","ID","placeholder","Search Unsent Invoice",2,"width","250px",3,"ngModelChange","click","items","ngModel"],[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"],[1,"col-6","border-end","px-0"],[1,"col-6","px-0","d-flex","flex-column","justify-content-between"],[1,"flex-grow-1",3,"expenses","materials","outletId"],[1,"row","footer","border-top"],[1,"col-12","d-flex","flex-column","justify-content-between","py-6","h-100"],[1,"row"],[1,"col-6"],[1,"d-flex","justify-content-between","align-items-center","h-100","p-6",2,"border-radius","10px",3,"ngStyle"],[1,"col-6","text-start","fw-semibold"],[1,"col-6","text-end","fw-semibold"],[1,"d-inline-flex","align-items-center","gap-1"],["matTooltip","Need Product Cost Role to View","matTooltipPosition","above",1,"fa","fa-info-circle","ms-1",2,"font-size","12px","cursor","pointer"]],template:function(e,l){e&1&&s(0,ko,35,22,"div",0)(1,Lo,1,4,"POS-complete",1),e&2&&u(l.store.completeData()?1:0)},dependencies:[ne,Wt,me,Y,X,mi,pi,li,bt,ht,St,It,Me,Be,ae,Ve,at,ie],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 - 140px)}.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;padding-left:32px}input[_ngcontent-%COMP%]::placeholder{color:#ced4da}i[_ngcontent-%COMP%]{font-size:16px;top:10.6px;left:8px}.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} .sales-order-number .ng-select-container{border:none} .sales-order-number.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border:none;box-shadow:none}"],changeDetection:0})};var Bo=[{path:"Job_Order/Archive",component:gt},{path:"Job_Order/Archive/Info",component:Ct},{path:"Job_Order/Archive/Form",component:Ot},{path:"Job_Order/Report",component:yt},{path:"Job_Order/Report_Detail",loadComponent(){return import("./chunk-63MASJFY.js").then(i=>i.ManufactureDetailComponent)}},{path:"",redirectTo:"Job_Order/Archive",pathMatch:"full"}],Et=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=it({type:i});static \u0275inj=et({imports:[Me.forChild(Bo),Me]})};var xi=class i{static \u0275fac=function(e){return new(e||i)};static \u0275mod=it({type:i});static \u0275inj=et({imports:[ne,di,me,ei,Et,Je,Be,ae,ri,ue,ut,Xt,ue,He,Gt,he]})};export{xi as ManufactureModule};
@@ -1 +1 @@
1
- import{a as K}from"./chunk-5PWFCP3M.js";import"./chunk-N2GXH4AT.js";import{g as U,h as X}from"./chunk-2G3P6XQB.js";import{h as J}from"./chunk-SVRHZOWH.js";import"./chunk-K2NOGF3I.js";import"./chunk-CQROPDKC.js";import{a as Q}from"./chunk-RVMD3V6N.js";import"./chunk-JQBXKYC5.js";import"./chunk-QAEDK7B5.js";import"./chunk-7H6MB2FG.js";import"./chunk-73C77AIF.js";import"./chunk-BOBU77RE.js";import"./chunk-XSPKXHFT.js";import{a as G,b as z}from"./chunk-SWU6BBBD.js";import"./chunk-PPMQE2JW.js";import"./chunk-WCOJ74AX.js";import"./chunk-KGCOWF6B.js";import"./chunk-QX4FSLL5.js";import"./chunk-YXX2TH5I.js";import"./chunk-M36GLXBG.js";import"./chunk-CVOK5ITC.js";import"./chunk-J27WSAUU.js";import"./chunk-4KUDABAJ.js";import"./chunk-HTWZXTKN.js";import"./chunk-FNEABRAQ.js";import"./chunk-OSHL72QK.js";import"./chunk-3A7EKFZY.js";import"./chunk-POOTZU2L.js";import"./chunk-MMZCS6WY.js";import{F as $,b as B,h as H,p as W}from"./chunk-F2ZXIBKA.js";import"./chunk-DGTLHFF6.js";import"./chunk-MXUH3H6O.js";import"./chunk-FQIRVQPI.js";import{b as q}from"./chunk-36E5M6EH.js";import"./chunk-PPTZHIIZ.js";import"./chunk-PWTUOV6H.js";import{n as j,q as A}from"./chunk-WE775XUV.js";import{Ac as y,Bb as s,Bc as P,Db as T,Eb as M,Fb as E,Gb as f,Hb as i,Ib as r,Jb as O,Nb as h,Ob as b,Sb as S,Ud as N,Vb as g,Wd as R,Xa as a,Xb as d,bd as F,cb as u,gb as D,kc as c,lb as L,lc as v,pc as k,qa as x,qc as w,rc as I,ua as C,va as _,zb as m,zd as V}from"./chunk-T7N5CA5W.js";import"./chunk-NF7PG5F2.js";var Z=()=>["/menu/Setup/Tag/Landed_Cost/Form"],ee=e=>({ID:e});function te(e,l){if(e&1){let n=S();i(0,"button",13),g("click",function(){C(n);let t=d();return _(t.httpPostListID("Setup/Tag/RemoveLandedCostTag"))}),O(1,"i",14),c(2," Delete "),r()}}function ne(e,l){e&1&&(i(0,"a",4),c(1,"Add"),r()),e&2&&f("routerLink",y(1,Z))}function ie(e,l){if(e&1){let n=S();i(0,"th",10)(1,"input",15),g("change",function(t){C(n);let p=d();return _(p.onSelectAllData(t.target.checked))}),r()()}}function oe(e,l){if(e&1){let n=S();i(0,"td",10)(1,"input",17),I("ngModelChange",function(t){C(n);let p=d().$implicit;return w(p.selected,t)||(p.selected=t),_(t)}),r()()}if(e&2){let n=d().$implicit;a(),k("ngModel",n.selected)}}function re(e,l){if(e&1&&(i(0,"a",16)(1,"span"),c(2),r()()),e&2){let n=d().$implicit;f("routerLink",y(3,Z))("queryParams",P(4,ee,n.ID)),a(2),v(n.Name)}}function ae(e,l){if(e&1&&(i(0,"span"),c(1),r()),e&2){let n=d().$implicit;a(),v(n.Name)}}function le(e,l){if(e&1&&(i(0,"tr",12),m(1,oe,2,1,"td",10),i(2,"td"),m(3,re,3,6,"a",16)(4,ae,2,1,"span"),r(),i(5,"td"),c(6),r()()),e&2){let n=l.$implicit,o=d();a(),s(o.roleService.setup!=null&&o.roleService.setup.Delete?1:-1),a(2),s(o.roleService.setup!=null&&o.roleService.setup.Edit?3:4),a(3),v(n.Description)}}var Y=class e extends K{constructor(n,o,t,p){super(n,o,"Setup/Tag/LandedCostTag",void 0,t,void 0,void 0,"get");this.httpService=o;this.roleService=p}httpService;roleService;cdr=x(F);postInit(n){super.postInit(n),this.cdr.markForCheck()}static \u0275fac=function(o){return new(o||e)(u(Q),u(A),u(j),u(q))};static \u0275cmp=D({type:e,selectors:[["pos-landed-cost-option"]],features:[L],decls:18,vars:6,consts:[[3,"onSubmit","pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","actions",5,["actions"]],[1,"d-flex","gap-4"],["type","button",1,"btn","btn-outline-secondary"],["matTooltipPosition","above","matTooltip","Add Landed Cost Option",1,"button","btn","btn-success",3,"routerLink"],["ngProjectAs","content",5,["content"]],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","14px"],[2,"width","400px"],[1,"border-bottom"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash"],["type","checkbox",3,"change"],[3,"routerLink","queryParams"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(o,t){o&1&&(i(0,"mainpanel-cmp",0),g("onSubmit",function(){return t.searchFromPageOne()}),h(1,1),i(2,"div",2),m(3,te,3,0,"button",3),m(4,ne,2,2,"a",4),r(),b(),h(5,5),i(6,"div",6)(7,"table",7)(8,"thead",8)(9,"tr",9),m(10,ie,2,0,"th",10),i(11,"th",11),c(12,"NAME"),r(),i(13,"th"),c(14,"DESCRIPTION"),r()()(),i(15,"tbody"),M(16,le,7,3,"tr",12,T),r()()(),b(),r()),o&2&&(f("pageData",t.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),a(3),s(t.roleService.setup!=null&&t.roleService.setup.Delete&&t.getSelectedData().length>0?3:-1),a(),s(t.roleService.setup!=null&&t.roleService.setup.Create?4:-1),a(6),s(t.roleService.setup!=null&&t.roleService.setup.Delete?10:-1),a(6),E(t.data==null?null:t.data.Data))},dependencies:[V,$,B,H,W,R,N,J,z,G,X,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{Y as LandedCostOptionComponent};
1
+ import{a as K}from"./chunk-2GXU77LM.js";import"./chunk-QHETYXUX.js";import{g as U,h as X}from"./chunk-EOJKGSOK.js";import{h as J}from"./chunk-SVRHZOWH.js";import"./chunk-K2NOGF3I.js";import"./chunk-PG62QDNS.js";import{a as Q}from"./chunk-QENSRIHN.js";import"./chunk-JQBXKYC5.js";import"./chunk-QAEDK7B5.js";import"./chunk-IYVMMQUJ.js";import"./chunk-73C77AIF.js";import"./chunk-BOBU77RE.js";import"./chunk-XSPKXHFT.js";import{a as G,b as z}from"./chunk-SWU6BBBD.js";import"./chunk-PPMQE2JW.js";import"./chunk-WCOJ74AX.js";import"./chunk-IWXBFNID.js";import"./chunk-QX4FSLL5.js";import"./chunk-YXX2TH5I.js";import"./chunk-M36GLXBG.js";import"./chunk-CVOK5ITC.js";import"./chunk-J27WSAUU.js";import"./chunk-4KUDABAJ.js";import"./chunk-HTWZXTKN.js";import"./chunk-FNEABRAQ.js";import"./chunk-OSHL72QK.js";import"./chunk-3A7EKFZY.js";import"./chunk-POOTZU2L.js";import"./chunk-MMZCS6WY.js";import{F as $,b as B,h as H,p as W}from"./chunk-F2ZXIBKA.js";import"./chunk-IGP2V3PT.js";import"./chunk-KTF3ZITG.js";import"./chunk-FQIRVQPI.js";import{b as q}from"./chunk-36E5M6EH.js";import"./chunk-PPTZHIIZ.js";import"./chunk-RTFMOBMR.js";import{n as j,q as A}from"./chunk-WE775XUV.js";import{Ac as y,Bb as s,Bc as P,Db as T,Eb as M,Fb as E,Gb as f,Hb as i,Ib as r,Jb as O,Nb as h,Ob as b,Sb as S,Ud as N,Vb as g,Wd as R,Xa as a,Xb as d,bd as F,cb as u,gb as D,kc as c,lb as L,lc as v,pc as k,qa as x,qc as w,rc as I,ua as C,va as _,zb as m,zd as V}from"./chunk-T7N5CA5W.js";import"./chunk-NF7PG5F2.js";var Z=()=>["/menu/Setup/Tag/Landed_Cost/Form"],ee=e=>({ID:e});function te(e,l){if(e&1){let n=S();i(0,"button",13),g("click",function(){C(n);let t=d();return _(t.httpPostListID("Setup/Tag/RemoveLandedCostTag"))}),O(1,"i",14),c(2," Delete "),r()}}function ne(e,l){e&1&&(i(0,"a",4),c(1,"Add"),r()),e&2&&f("routerLink",y(1,Z))}function ie(e,l){if(e&1){let n=S();i(0,"th",10)(1,"input",15),g("change",function(t){C(n);let p=d();return _(p.onSelectAllData(t.target.checked))}),r()()}}function oe(e,l){if(e&1){let n=S();i(0,"td",10)(1,"input",17),I("ngModelChange",function(t){C(n);let p=d().$implicit;return w(p.selected,t)||(p.selected=t),_(t)}),r()()}if(e&2){let n=d().$implicit;a(),k("ngModel",n.selected)}}function re(e,l){if(e&1&&(i(0,"a",16)(1,"span"),c(2),r()()),e&2){let n=d().$implicit;f("routerLink",y(3,Z))("queryParams",P(4,ee,n.ID)),a(2),v(n.Name)}}function ae(e,l){if(e&1&&(i(0,"span"),c(1),r()),e&2){let n=d().$implicit;a(),v(n.Name)}}function le(e,l){if(e&1&&(i(0,"tr",12),m(1,oe,2,1,"td",10),i(2,"td"),m(3,re,3,6,"a",16)(4,ae,2,1,"span"),r(),i(5,"td"),c(6),r()()),e&2){let n=l.$implicit,o=d();a(),s(o.roleService.setup!=null&&o.roleService.setup.Delete?1:-1),a(2),s(o.roleService.setup!=null&&o.roleService.setup.Edit?3:4),a(3),v(n.Description)}}var Y=class e extends K{constructor(n,o,t,p){super(n,o,"Setup/Tag/LandedCostTag",void 0,t,void 0,void 0,"get");this.httpService=o;this.roleService=p}httpService;roleService;cdr=x(F);postInit(n){super.postInit(n),this.cdr.markForCheck()}static \u0275fac=function(o){return new(o||e)(u(Q),u(A),u(j),u(q))};static \u0275cmp=D({type:e,selectors:[["pos-landed-cost-option"]],features:[L],decls:18,vars:6,consts:[[3,"onSubmit","pageData","hideSearchBox","hideSearchDropdown"],["ngProjectAs","actions",5,["actions"]],[1,"d-flex","gap-4"],["type","button",1,"btn","btn-outline-secondary"],["matTooltipPosition","above","matTooltip","Add Landed Cost Option",1,"button","btn","btn-success",3,"routerLink"],["ngProjectAs","content",5,["content"]],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],[2,"width","14px"],[2,"width","400px"],[1,"border-bottom"],["type","button",1,"btn","btn-outline-secondary",3,"click"],[1,"fa-solid","fa-trash"],["type","checkbox",3,"change"],[3,"routerLink","queryParams"],["type","checkbox",3,"ngModelChange","ngModel"]],template:function(o,t){o&1&&(i(0,"mainpanel-cmp",0),g("onSubmit",function(){return t.searchFromPageOne()}),h(1,1),i(2,"div",2),m(3,te,3,0,"button",3),m(4,ne,2,2,"a",4),r(),b(),h(5,5),i(6,"div",6)(7,"table",7)(8,"thead",8)(9,"tr",9),m(10,ie,2,0,"th",10),i(11,"th",11),c(12,"NAME"),r(),i(13,"th"),c(14,"DESCRIPTION"),r()()(),i(15,"tbody"),M(16,le,7,3,"tr",12,T),r()()(),b(),r()),o&2&&(f("pageData",t.menuData)("hideSearchBox",!0)("hideSearchDropdown",!0),a(3),s(t.roleService.setup!=null&&t.roleService.setup.Delete&&t.getSelectedData().length>0?3:-1),a(),s(t.roleService.setup!=null&&t.roleService.setup.Create?4:-1),a(6),s(t.roleService.setup!=null&&t.roleService.setup.Delete?10:-1),a(6),E(t.data==null?null:t.data.Data))},dependencies:[V,$,B,H,W,R,N,J,z,G,X,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})};export{Y as LandedCostOptionComponent};