dealpos 25.49.4 → 25.49.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/{chunk-WZWXE6GT.js → chunk-234VD4PN.js} +1 -1
- package/browser/{chunk-CLO7U3RB.js → chunk-2M6MJMM7.js} +1 -1
- package/browser/{chunk-UJ63ZNAO.js → chunk-3SIDOYEU.js} +1 -1
- package/browser/{chunk-XTU3LHA6.js → chunk-3ZZJHIUG.js} +1 -1
- package/browser/{chunk-KWFL5YOV.js → chunk-55DB5BOP.js} +1 -1
- package/browser/{chunk-7V2CY4DW.js → chunk-5QMBTXFS.js} +1 -1
- package/browser/{chunk-LX26RD3F.js → chunk-5YHDDJI4.js} +1 -1
- package/browser/{chunk-ASHEF37H.js → chunk-63B7VXCP.js} +1 -1
- package/browser/{chunk-IFKUMLMD.js → chunk-6ESMI6WH.js} +1 -1
- package/browser/{chunk-WP2FVSCM.js → chunk-6G74X2UP.js} +1 -1
- package/browser/chunk-6UC76HYF.js +4 -0
- package/browser/{chunk-34X4ZZD5.js → chunk-72YVHXTD.js} +1 -1
- package/browser/{chunk-TLLI6Z5X.js → chunk-7MMDSCS7.js} +1 -1
- package/browser/{chunk-5DNDULL7.js → chunk-7PVAZYM4.js} +1 -1
- package/browser/{chunk-GNIF2YD2.js → chunk-7SAEXKAX.js} +1 -1
- package/browser/{chunk-3RQ35Y7Q.js → chunk-A4Y2ZLGW.js} +1 -1
- package/browser/{chunk-RULBTV6L.js → chunk-AGJ3GOR7.js} +1 -1
- package/browser/{chunk-3Y2TKGP4.js → chunk-BCGIIVLI.js} +1 -1
- package/browser/{chunk-C777CYT4.js → chunk-BEIHC6NO.js} +1 -1
- package/browser/{chunk-52ONOTHS.js → chunk-BGT22RIZ.js} +1 -1
- package/browser/{chunk-FQVYXDHS.js → chunk-CEVAKZDN.js} +2 -2
- package/browser/{chunk-IQ5KAZ7I.js → chunk-CIJROL7R.js} +1 -1
- package/browser/{chunk-3PJCCDIY.js → chunk-CLWGVNBY.js} +2 -2
- package/browser/{chunk-3YFVIHNY.js → chunk-CNHLZU3Z.js} +2 -2
- package/browser/chunk-D3KDSFJU.js +1 -0
- package/browser/{chunk-WYRHUSXS.js → chunk-D3QY3EBZ.js} +1 -1
- package/browser/{chunk-ZEI66KM2.js → chunk-DG6Y623Z.js} +1 -1
- package/browser/{chunk-6LSNTX2C.js → chunk-DHKZDGY6.js} +1 -1
- package/browser/{chunk-TBBZ7RAN.js → chunk-DYI547BZ.js} +1 -1
- package/browser/{chunk-RGO36X34.js → chunk-EV422BEJ.js} +1 -1
- package/browser/{chunk-APHRANVH.js → chunk-FBHH3WPM.js} +1 -1
- package/browser/{chunk-YTXYAEFO.js → chunk-FBN34CVL.js} +1 -1
- package/browser/{chunk-FTZZHFXM.js → chunk-FHL5KFJX.js} +1 -1
- package/browser/{chunk-INWLOCX3.js → chunk-FQNL3TLZ.js} +1 -1
- package/browser/{chunk-JZFX4FNK.js → chunk-FXPNLU4X.js} +1 -1
- package/browser/{chunk-Y4XWHUVX.js → chunk-G5NXVDID.js} +1 -1
- package/browser/{chunk-XBRNDXDZ.js → chunk-G6PEAZWA.js} +1 -1
- package/browser/{chunk-QOCGWG6L.js → chunk-GIPUEMTC.js} +1 -1
- package/browser/{chunk-OWK34F6X.js → chunk-GLOUVXOJ.js} +1 -1
- package/browser/{chunk-NTCQH6TH.js → chunk-H6UWRJHQ.js} +1 -1
- package/browser/{chunk-WFSJDUCV.js → chunk-IDZHSRCH.js} +2 -2
- package/browser/{chunk-D2OMTDKS.js → chunk-IK4DEQSO.js} +1 -1
- package/browser/{chunk-H4U5GDQZ.js → chunk-IRQYLVRP.js} +1 -1
- package/browser/{chunk-V3KYBOFM.js → chunk-LC7GFFEX.js} +1 -1
- package/browser/{chunk-XFJYJSZU.js → chunk-LJJMNCST.js} +1 -1
- package/browser/{chunk-GT5IX3D6.js → chunk-LSC2CYCL.js} +1 -1
- package/browser/{chunk-P2R2O6GD.js → chunk-MFNPIWGR.js} +2 -2
- package/browser/{chunk-BSV3Y4MG.js → chunk-MOXEW4DH.js} +1 -1
- package/browser/{chunk-KJ5BS7KR.js → chunk-MVJSAD2O.js} +1 -1
- package/browser/{chunk-HCMW3RC5.js → chunk-N5IOOG55.js} +1 -1
- package/browser/{chunk-TAVEJBKL.js → chunk-NENPGICH.js} +1 -1
- package/browser/{chunk-FD7ICK7T.js → chunk-NKQHQCUV.js} +1 -1
- package/browser/{chunk-SY463GX6.js → chunk-NPQFE4EO.js} +1 -1
- package/browser/{chunk-R2Y4JAXW.js → chunk-OOKDKXRB.js} +1 -1
- package/browser/{chunk-N7M4OSQZ.js → chunk-OUOI5WK2.js} +1 -1
- package/browser/{chunk-OYEU5L3I.js → chunk-OZLXHOG4.js} +1 -1
- package/browser/{chunk-46D5QBZT.js → chunk-P6DRDJVZ.js} +1 -1
- package/browser/{chunk-OETRAGYY.js → chunk-P75DFAMB.js} +1 -1
- package/browser/{chunk-QE5OFO56.js → chunk-PFF34SZG.js} +1 -1
- package/browser/{chunk-F3YWM4BJ.js → chunk-PXFCSUBN.js} +1 -1
- package/browser/{chunk-BVMFVFGN.js → chunk-Q3FMCFAP.js} +1 -1
- package/browser/{chunk-V45WTUQ2.js → chunk-QHP7VC2R.js} +1 -1
- package/browser/{chunk-K3V25WUQ.js → chunk-QLMHWHUW.js} +1 -1
- package/browser/{chunk-ROVDZJVT.js → chunk-R546P6WC.js} +1 -1
- package/browser/{chunk-QVI22QDX.js → chunk-RJNG3PZF.js} +1 -1
- package/browser/{chunk-N6JQHXKN.js → chunk-RXPEUS2G.js} +1 -1
- package/browser/{chunk-QS32TZGB.js → chunk-SMDHPNT7.js} +1 -1
- package/browser/{chunk-SFXDXOSB.js → chunk-SRAJGU6Y.js} +1 -1
- package/browser/{chunk-LI6G74I7.js → chunk-T6SZ4L7O.js} +1 -1
- package/browser/{chunk-7V6NCJRQ.js → chunk-TXPKRCHR.js} +1 -1
- package/browser/{chunk-YZY45SFB.js → chunk-U57PBUPN.js} +1 -1
- package/browser/{chunk-HOZ6XJ4Z.js → chunk-UNZLSKV5.js} +1 -1
- package/browser/{chunk-KJF3M7DY.js → chunk-V3FPQMVB.js} +1 -1
- package/browser/{chunk-6H5XBM35.js → chunk-VFQES62Q.js} +1 -1
- package/browser/{chunk-ADQOH7YA.js → chunk-WVMPGK5K.js} +1 -1
- package/browser/{chunk-XOQUXJ6S.js → chunk-WW4UBOYF.js} +1 -1
- package/browser/{chunk-NZBKYR7R.js → chunk-WXEEGAH5.js} +1 -1
- package/browser/{chunk-NFODKKJI.js → chunk-Y67EVUWI.js} +2 -2
- package/browser/{chunk-743523SK.js → chunk-Y7D34HYN.js} +1 -1
- package/browser/{chunk-XWXXETJY.js → chunk-Y7KMZ7BT.js} +1 -1
- package/browser/{chunk-LNZY3GKF.js → chunk-YVO66RJF.js} +1 -1
- package/browser/{chunk-T4E5A3KH.js → chunk-YZCJFJZL.js} +2 -2
- package/browser/{chunk-OXMLRZZ4.js → chunk-Z3UTJURO.js} +1 -1
- package/browser/index.html +2 -2
- package/browser/{main-DAVMX2B6.js → main-FS6A5G45.js} +2 -2
- package/package.json +1 -1
- package/browser/chunk-CD6ZWSFG.js +0 -1
- package/browser/chunk-SO3RL6QR.js +0 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as _e}from"./chunk-K3V25WUQ.js";import{a as Pe}from"./chunk-T7XU5W5A.js";import{a as Oe}from"./chunk-NTCQH6TH.js";import{a as Se}from"./chunk-BT7NN7PT.js";import{b as Me,c as Ce}from"./chunk-JBS5UYZC.js";import{a as me}from"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import"./chunk-7P3L3ODB.js";import{F as ve,b as fe,h as he,o as ge}from"./chunk-DWZ5JTI2.js";import{a as T,c as f}from"./chunk-743523SK.js";import{a as be}from"./chunk-46D5QBZT.js";import"./chunk-36GWLMZX.js";import{b as I}from"./chunk-WFQIMZGL.js";import{a as M}from"./chunk-WUV22SZ4.js";import{a as ue}from"./chunk-SO3RL6QR.js";import{p as de}from"./chunk-LGOSIAUC.js";import{$ as Y,Cb as j,Db as F,E,Eb as V,Fb as h,Fc as ne,Gb as o,Hb as s,Hc as re,Ib as u,Md as se,Od as le,Pd as b,Qd as ce,Rd as pe,Sa as W,Sb as C,Sd as G,Ub as K,Xa as p,d as q,da as D,eb as v,ec as X,gc as $,gd as oe,hc as m,ib as Q,ic as B,jb as x,jc as z,la as d,ma as y,oa as _,pa as c,tc as ee,vd as ae,wb as Z,yc as te,zc as ie}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as J}from"./chunk-SNAKHGZS.js";var r=class e{constructor(n,t){this.authService=n;this.router=t}canLoad(n,t){return this.authService.isTokenExpired()?(this.authService.returnUrl=this.getUrlRedirect(t),this.router.navigate(["/"]),!1):!0}getUrlRedirect(n){let t="/menu";n.forEach(a=>t+=`/${a.path}`);let i=this.router.currentNavigation().extractedUrl.queryParams;return Object.keys(i).forEach((a,g)=>{g==0?t=`${t}?${a}=${i[a]}`:t=`${t}&${a}=${i[a]}`}),t}static \u0275fac=function(t){return new(t||e)(_(f),_(b))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var w=class e{constructor(n){this.toastrService=n;this.initPermissionToastr=!1}isPermissionGranted;initPermissionToastr;initPermission(){try{this.initPermissionToastr||Notification.requestPermission().then(t=>{this.isPermissionGranted=!1,t=="granted"&&(this.isPermissionGranted=!0),this.initPermissionToastr=!0})}catch(n){console.error(n)}}showAlert(n,t,i,l){let a=6e4;if(this.isPermissionGranted)try{let g=new Notification(t,{body:n,icon:l});g.onerror=(N=>{this.toastrService.info(this.setBody(n,i),t,{timeOut:a,enableHtml:this.hasUrl(i)})})}catch(g){console.error(g)}else this.toastrService.info(this.setBody(n,i),t,{timeOut:a,enableHtml:this.hasUrl(i)})}setBody(n,t){return this.hasUrl(t)&&(n=`<a href="${t}" target="_blank" class="ps-0">${n}</a>`),n}hasUrl(n){return!!(n&&n.length!==0)}static \u0275fac=function(t){return new(t||e)(_(de))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var ye=[{T:"Dashboard",U:"/menu/Dashboard",I:"fa-solid fa-chart-pie"},{T:"Products",U:"/menu/Products",I:"fa-solid fa-tag"},{T:"Estimate",U:"/menu/Estimate",I:"fa-solid fa-clipboard"},{T:"Sell",U:"/menu/Sell",I:"fa-solid fa-cart-shopping"},{T:"Shift",U:"/menu/Shift/",I:"fa-solid fa-user-clock"},{T:"Reports",U:"/menu/Reports",I:"fa-solid fa-chart-area"},{T:"Contacts",U:"/menu/Contacts",I:"fas fa-address-book"},{T:"Orders",U:"/menu/Orders",I:"fas fa-file-invoice"},{T:"Payment",U:"/menu/Payment",I:"fas fa-money-bill-alt"},{T:"Debt",U:"/menu/Debt",I:"fas fa-dollar-sign"},{T:"Inventory",U:"/menu/Inventory",I:"fas fa-archive"},{T:"Adjustment",U:"/menu/Adjustment",I:"fas fa-scanner-gun"},{T:"Buy",U:"/menu/Buy",I:"fa-solid fa-cart-arrow-down"},{T:"Logistics",U:"/menu/Logistics",I:"fas fa-truck"},{T:"Fulfillment",U:"/menu/Fulfillment",I:"fas fa-dolly"},{T:"Manufacture",U:"/menu/Manufacture",I:"fas fa-industry"},{T:"Prepaid Package",U:"/menu/Prepaid_Package",I:"fa-solid fa-id-card"},{T:"Promotion",U:"/menu/Promotion",I:"fas fa-bullhorn"},{T:"Users",U:"/menu/Users",I:"fas fa-user"},{T:"Outlets",U:"/menu/Outlets",I:"fas fa-map-marker-alt"},{T:"Setup",U:"/menu/Setup",I:"fas fa-gear"},{T:"Developer",U:"/menu/Developer",I:"fas fa-code"}];var k=class e{role=c(I);authService=c(f);menu=ye;filteredMenu=[];initFilteredMenu(){let n=this.menu.map(i=>J({},i)),t=n.findIndex(i=>i.T==="Reports");if(t!==-1){let i=!!this.role.report?.View,l=!!this.role.report?.Advanced,a=!!this.role.report?.Periodic;i?n[t].U="/menu/Reports":l?n[t].U="/menu/Reports/Sales_Report/Standard/Top_Customers":a?n[t].U="/menu/Reports/Sales_Report/Standard/Daily":n[t].U="/menu/Reports"}this.filteredMenu=n.filter(i=>i.T==="Dashboard"?this.role.dashboard.View:i.T==="Products"?this.role.product.View:i.T==="Estimate"?this.role.estimate.Create:i.T==="Sell"?this.role.sell.Create:i.T==="Shift"?this.role.sell.Create:i.T==="Reports"?!!this.role.report?.View||!!this.role.report?.Advanced||!!this.role.report?.Periodic:i.T==="Contacts"?this.role.contact.View:i.T==="Orders"?this.role.order.View:i.T==="Payment"?this.role.payment.View:i.T==="Debt"?this.role.debt.View:i.T==="Inventory"?this.role.inventory.View:i.T==="Adjustment"?this.role.adjustment.View:i.T==="Buy"?this.role.buy.Create:i.T==="Logistics"?this.role.logistic.View:i.T==="Manufacture"?this.role.manufacture.View:i.T==="Fulfillment"?this.role.fulfillment.View:i.T==="Prepaid Package"?this.role.prepaidPackage.View:i.T==="Promotion"?this.role.promotion.View:i.T==="Users"?this.role.users.View:i.T==="Outlets"?this.role.outlets.View:i.T==="Setup"?this.role.setup.View:i.T==="Developer"?this.role.developer.View:!0),this.filterBySubscriptionStatus()}filterBySubscriptionStatus(){let n=this.authService.getSubscriptionStatus();this.filteredMenu=this.filteredMenu.filter(t=>{switch(n){case 2:return t.T=="Sell"||t.T=="Shift";case 3:return!1;default:return!0}})}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var xe=[{T:"My Profile",U:"Profile/Main/My_Profile",I:"fas fa-user"},{T:"My Subscription",U:"Profile/Main/My_Subscription",I:"fa-solid fa-credit-card"},{T:"Notification",U:"Profile/Notification/Push",I:"fas fa-bell"},{T:"My Sales",U:"Profile/Main/My_Sales",I:"fas fa-history"}];var A=class e{role=c(I);authService=c(f);filteredMenu=[];initFilteredMenu(){let n=this.authService.getSubscriptionStatus();this.filteredMenu=xe.filter(t=>t.T=="My Profile"?this.role.profile.View:t.T=="My Subscription"?this.role.profile.Subscription:t.T=="Notification"?this.role.profile.Notification&&n!=2&&n!=3:t.T=="My Sales"?n!=2&&n!=3:!0)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var Le=(e,n)=>({"full-container":e,"subscription-bar-visible":n}),Ne=e=>[e];function Ee(e,n){if(e&1&&(o(0,"a",11),u(1,"i",35),o(2,"span"),m(3),s()()),e&2){let t=n.$implicit;h("routerLink",t==null?null:t.U),p(),$((t==null?null:t.I)+" me-2"),p(2),B(t==null?null:t.T)}}function De(e,n){if(e&1&&(o(0,"li",33,0)(2,"a",36),u(3,"i"),o(4,"p"),m(5),s()()()),e&2){let t=n.$implicit,i=K();h("routerLinkActiveOptions",i.isActiveMatchOptions),Z("data-cy",t==null?null:t.T),p(2),h("matTooltip",i.toggleSideMenu?t==null?null:t.T:"")("routerLink",te(7,Ne,t==null?null:t.U)),p(),$(t==null?null:t.I),p(2),B(t==null?null:t.T)}}var P=class e{constructor(n,t,i,l,a,g,N,H){this.toggleSidebar=n;this.signalRClientService=t;this.notificationAlertService=i;this.router=l;this.authService=a;this.intercomService=g;N.initFilteredMenu(),H.initFilteredMenu(),this.leftSidebarMenu=N.filteredMenu,this.topMenu=H.filteredMenu,this.accountInfo=JSON.parse(localStorage.getItem("AccountInfo")),this.toggleSidebar.toggleState$.subscribe(Ie=>this.isNavOpen=Ie),this.destroy$=new q,this.initNotificationPermission()}isActiveMatchOptions={matrixParams:"subset",queryParams:"subset",paths:"subset",fragment:"exact"};toggleSideMenu=!1;isNavOpen;destroy$;activeMenu;appVersion=ue.version;currentSubStatus;subsStatusEnum=T;isFullContainer=!1;isHideIntercomLauncher;leftSidebarMenu;topMenu;accountInfo;ngOnInit(){this.subscribeToPushNotification(),this.getCurrentSubscriptionStatus(),this.initFullContainer()}initFullContainer(){this.router.events.pipe(E(n=>n instanceof se),Y(null),D(this.destroy$)).subscribe(n=>{this.isFullContainer=!1,(this.router.url.includes("Sell")&&!this.router.url.includes("v2")&&!this.router.url.includes("Offline")||this.router.url.includes("Buy")||this.router.url.includes("menu/Estimate")||this.router.url.includes("Transfer_Order/Form")||this.router.url.includes("Adjustment/Archive/Form")||this.router.url.includes("Job_Order/Archive/Form")||this.router.url.includes("/menu/Debt/Debt/Join_Invoice/Form")||this.router.url.includes("/menu/Debt/Debt/Join_Bill/New_Join_Bill"))&&(this.isFullContainer=!0)})}initNotificationPermission(){this.notificationAlertService.initPermission()}getCurrentSubscriptionStatus(){this.currentSubStatus=this.authService.getSubscriptionStatus()}subscribeToPushNotification(){let n=localStorage.getItem("NotificationOutletID");M.IsNotEmpty(n)&&M.isGuid(n)?this.signalRClientService.SubscribeGroup(n):this.signalRClientService.startConnection(),this.signalRClientService.OnReceivePushNotification.pipe(D(this.destroy$),E(t=>M.IsNotEmpty(t))).subscribe(t=>{if(M.IsNotEmpty(t)){let i=JSON.parse(t),l="https://cdn.dealpos.xyz/web-image/info-new.png";M.IsNotEmpty(i.Icon)&&(l=i.Icon),this.notificationAlertService.showAlert(i.Body,i.Header,i.URL,l)}})}ngAfterViewInit(){this.intercomService.inititalizeIntercom()}toggleMenu(){this.toggleSideMenu=!this.toggleSideMenu}logout(){this.authService.logout()}isNotEmpty(n){return M.IsNotEmpty(n)}onShowDropdown(){this.isHideIntercomLauncher=this.intercomService.isHideLauncher()}chatToggleChange(){this.isHideIntercomLauncher==!1?this.intercomService.hideLauncher():this.intercomService.showLauncher(),this.onShowDropdown()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(t){return new(t||e)(v(Se),v(me),v(w),v(b),v(f),v(be),v(k),v(A))};static \u0275cmp=Q({type:e,selectors:[["POS-menu-master"]],standalone:!1,decls:54,vars:17,consts:[["rla","routerLinkActive"],[1,"wrapper"],["data-color","blue",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-lg-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fa-solid",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-cy","companyName","data-bs-toggle","dropdown","aria-expanded","false","matTooltipPosition","above",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center",2,"cursor","pointer",3,"click","matTooltip"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",3,"routerLink"],[1,"dropdown-item","h5",2,"cursor","pointer"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fa-solid","fa-comment-dots","me-2"],[1,"checkbox_toggle","ms-3",3,"click"],["type","checkbox","id","chatToggle","name","ChatToggle",3,"ngModelChange","ngModel"],["for","chatToggle",1,"position-relative","rounded-pill","pointer"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-sign-out-alt","me-2"],[1,"divider"],[1,"dropdown-header","border-top"],["target","_blank",1,"dropdown-item","h5","changelog",3,"href"],["aria-hidden","true",1,"fa-solid","fa-sparkles","me-2"],[1,"fa-solid","fa-circle-exclamation","ms-2",2,"font-size","16px"],["target","_blank","href","http://support.dealpos.com",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-solid","fa-book","me-2"],["target","_blank","href","https://www.dealpos.app/",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-solid","fa-table-cells-large","me-2"],["target","_blank","href","http://blog.dealpos.com",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-brands","fa-blogger","me-2"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",3,"routerLinkActiveOptions"],["id","full-container",1,"main-panel",3,"ngClass"],["aria-hidden","true"],["matTooltipPosition","above",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(t,i){t&1&&(o(0,"div",1)(1,"div",2)(2,"button",3),C("click",function(){return i.toggleMenu()}),u(3,"i",4),s(),o(4,"div",5)(5,"div",6)(6,"a",7),C("click",function(){return i.onShowDropdown()}),m(7),ne(8,"limitText"),s(),o(9,"div",8)(10,"div",9),m(11),s(),u(12,"div",10),F(13,Ee,4,4,"a",11,j),o(15,"a",12)(16,"div",13)(17,"div"),u(18,"i",14),o(19,"span"),m(20,"Chat Support"),s()(),o(21,"div",15),C("click",function(a){return a.stopPropagation()}),o(22,"input",16),C("ngModelChange",function(){return i.chatToggleChange()}),s(),u(23,"label",17),s()()(),o(24,"a",18),C("click",function(){return i.logout()}),u(25,"i",19),o(26,"span"),m(27,"Log Out"),s()(),u(28,"div",20),o(29,"div",21),m(30," Links "),s(),o(31,"a",22),u(32,"i",23),o(33,"span"),m(34,"What's New"),u(35,"i",24),s()(),o(36,"a",25),u(37,"i",26),o(38,"span"),m(39,"Help Center"),s()(),o(40,"a",27),u(41,"i",28),o(42,"span"),m(43,"App Store"),s()(),o(44,"a",29),u(45,"i",30),o(46,"span"),m(47,"Company Blog"),s()()()()(),o(48,"div",31)(49,"ul",32),F(50,De,6,9,"li",33,j),s()()(),o(52,"div",34),u(53,"router-outlet"),s()()),t&2&&(X("nav-open",i.isNavOpen),p(),h("ngClass",i.toggleSideMenu?"collapses":""),p(2),h("ngClass",i.toggleSideMenu?"fa-angle-left cursor":"fa-angle-right cursor"),p(3),h("matTooltip",i.accountInfo==null?null:i.accountInfo.BrandName),p(),z(" ",re(8,11,i.accountInfo==null?null:i.accountInfo.BrandName,12)," "),p(4),z("",i.accountInfo==null?null:i.accountInfo.UserName," "),p(2),V(i.topMenu),p(9),h("ngModel",!i.isHideIntercomLauncher),p(9),h("href",ee("https://changelog.dealpos.com/?categories=cat_gAZdRhBYU7QVl&view=complete&v=",i.appVersion),W),p(19),V(i.leftSidebarMenu),p(2),h("ngClass",ie(14,Le,i.isFullContainer,i.isNotEmpty(i.currentSubStatus)&&i.currentSubStatus!==i.subsStatusEnum.PAID)))},dependencies:[Me,le,ce,pe,fe,he,ge,oe,Pe],styles:['.sidebar[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%], body[_ngcontent-%COMP%] > .navbar-collapse[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important}.sidebar-wrapper[_ngcontent-%COMP%]{max-height:calc(100% - 61px)!important;min-height:calc(100% - 61px)!important}@media (max-width: 991px){.sidebar-wrapper[_ngcontent-%COMP%]{overflow-y:scroll!important}}@media (pointer: coarse){.sidebar-wrapper[_ngcontent-%COMP%]{overflow-y:scroll!important}}@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}}.full-container[_ngcontent-%COMP%]{padding-top:0!important}.changelog[_ngcontent-%COMP%]{color:#0006b1!important}.changelog[_ngcontent-%COMP%]:visited{color:#2e2e2e!important}.changelog[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{position:relative}.changelog[_ngcontent-%COMP%] span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important;position:absolute;top:-4px;right:-18px}.changelog[_ngcontent-%COMP%]:visited span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fff!important;position:absolute;top:-4px;right:-18px}.changelog[_ngcontent-%COMP%]:visited:hover span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#e9ecef!important;position:absolute;top:-4px;right:-18px}.subscription-bar-visible[_ngcontent-%COMP%]{padding-top:98px}.checkbox_toggle[_ngcontent-%COMP%]{position:relative}.checkbox_toggle[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#868686;display:inline-block;padding-right:38px}.checkbox_toggle[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{width:23px;height:14px;background-color:#ccc;top:2.2px;right:0}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background-color:#1f77d0}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]:after{left:10px}.checkbox_toggle[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:after{content:"";width:12px;height:12px;border-radius:50%;position:absolute;top:.8px;left:1px;transition:all .1s;background-color:#fff}']})};function je(e){let n=c(b),t="/menu";e.forEach(a=>t+=`/${a.path}`);let i=n.currentNavigation().extractedUrl.queryParams;return Object.keys(i).forEach((a,g)=>{g==0?t=`${t}?${a}=${i[a]}`:t=`${t}&${a}=${i[a]}`}),t}var O=(e,n)=>{let t=c(f),i=t.isTokenExpired(),l=c(b);return i?(t.returnUrl=je(n),l.navigate(["/"]),!1):e.path=="Dashboard"?Fe():!0};function Fe(){let e=c(b),n=c(f),t=!1,i=n.getRedirectUrl();return t=i.includes("Dashboard"),t==!1&&e.navigate([i]),t}var U=class e{paymentStorageService=c(_e);canActivate(n,t){return this.paymentStorageService.clear(),!0}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var R=class e{reportService=c(Oe);canActivate(n,t){return this.reportService.resetFilter(),!0}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ve=[{path:"",component:P,children:[{path:"Inventory",loadChildren:()=>import("./chunk-V3KYBOFM.js").then(e=>e.InventoryModule),canLoad:[r]},{path:"Reports",loadChildren:()=>import("./chunk-TAVEJBKL.js").then(e=>e.ReportsModule),canLoad:[r],canActivate:[R]},{path:"Sell",loadChildren:()=>import("./chunk-WFSJDUCV.js").then(e=>e.routes),canLoad:[r]},{path:"Print",loadChildren:()=>import("./chunk-DTX2BFBV.js").then(e=>e.PrintModule),canLoad:[r]},{path:"Buy",loadComponent:()=>import("./chunk-H4U5GDQZ.js").then(e=>e.BuyV2Component),canMatch:[O]},{path:"Sell/V2",loadComponent:()=>import("./chunk-OXMLRZZ4.js").then(e=>e.SellV2Component),canMatch:[O]},{path:"Dashboard",loadComponent:()=>import("./chunk-WP2FVSCM.js").then(e=>e.DashboardV2Component),canMatch:[O]},{path:"Products",loadChildren:()=>import("./chunk-T4E5A3KH.js").then(e=>e.ProductModule),canLoad:[r]},{path:"Shift",loadChildren:()=>import("./chunk-XTU3LHA6.js").then(e=>e.ShiftModule),canLoad:[r]},{path:"Debt",loadChildren:()=>import("./chunk-ZEI66KM2.js").then(e=>e.DebtModule),canLoad:[r]},{path:"Logistics",loadChildren:()=>import("./chunk-FQVYXDHS.js").then(e=>e.DeliveryModule),canLoad:[r]},{path:"Users",loadChildren:()=>import("./chunk-3YFVIHNY.js").then(e=>e.UsersModule),canLoad:[r]},{path:"Setup",loadChildren:()=>import("./chunk-NFODKKJI.js").then(e=>e.SetupModule),canLoad:[r]},{path:"Developer",loadChildren:()=>import("./chunk-52ONOTHS.js").then(e=>e.DeveloperModule),canLoad:[r]},{path:"Contacts",loadChildren:()=>import("./chunk-NZBKYR7R.js").then(e=>e.ContactsModule),canLoad:[r]},{path:"Outlets",loadChildren:()=>import("./chunk-P2R2O6GD.js").then(e=>e.OutletsModule),canLoad:[r]},{path:"Orders",loadChildren:()=>import("./chunk-3PJCCDIY.js").then(e=>e.OrdersModule),canLoad:[r]},{path:"Profile",loadChildren:()=>import("./chunk-SY463GX6.js").then(e=>e.ProfileModule),canLoad:[r]},{path:"Estimate",loadComponent:()=>import("./chunk-WZWXE6GT.js").then(e=>e.EstimateV2Component),canMatch:[O]},{path:"Adjustment",loadChildren:()=>import("./chunk-N6JQHXKN.js").then(e=>e.AdjustmentModule),canLoad:[r]},{path:"Payment",loadChildren:()=>import("./chunk-BSV3Y4MG.js").then(e=>e.PaymentModule),canLoad:[r],canActivate:[U]},{path:"Promotion",loadChildren:()=>import("./chunk-QOCGWG6L.js").then(e=>e.PromotionModule),canLoad:[r]},{path:"Manufacture",loadChildren:()=>import("./chunk-OWK34F6X.js").then(e=>e.ManufactureModule),canLoad:[r]},{path:"Prepaid_Package",loadChildren:()=>import("./chunk-6LSNTX2C.js").then(e=>e.PrepaidPackageModule),canLoad:[r]},{path:"Fulfillment",loadChildren:()=>import("./chunk-KWFL5YOV.js").then(e=>e.FulfillmentModule),canLoad:[r]},{path:"Unauthorized",loadChildren:()=>import("./chunk-YTXYAEFO.js").then(e=>e.UnauthorizedModule),canLoad:[r]},{path:"Not_Found",loadChildren:()=>import("./chunk-KJ5BS7KR.js").then(e=>e.NotFoundModule),canLoad:[r]},{path:"",redirectTo:"/menu/Dashboard",pathMatch:"full"},{path:"**",redirectTo:"Not_Found"}]}],L=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=x({type:e});static \u0275inj=y({imports:[G.forChild(Ve),G]})};var Te=class e{constructor(){}static \u0275fac=function(t){return new(t||e)};static \u0275mod=x({type:e,bootstrap:[P]});static \u0275inj=y({imports:[Ce,L,ve,ae]})};export{Te as MenuMasterModule};
|
|
1
|
+
import{a as _e}from"./chunk-QLMHWHUW.js";import{a as Pe}from"./chunk-T7XU5W5A.js";import{a as Oe}from"./chunk-H6UWRJHQ.js";import{a as Se}from"./chunk-BT7NN7PT.js";import{b as Me,c as Ce}from"./chunk-JBS5UYZC.js";import{a as me}from"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import"./chunk-7P3L3ODB.js";import{F as ve,b as fe,h as he,o as ge}from"./chunk-DWZ5JTI2.js";import{a as T,c as f}from"./chunk-Y7D34HYN.js";import{a as be}from"./chunk-P6DRDJVZ.js";import"./chunk-36GWLMZX.js";import{b as I}from"./chunk-WFQIMZGL.js";import{a as M}from"./chunk-WUV22SZ4.js";import{a as ue}from"./chunk-6UC76HYF.js";import{p as de}from"./chunk-LGOSIAUC.js";import{$ as Y,Cb as j,Db as F,E,Eb as V,Fb as h,Fc as ne,Gb as o,Hb as s,Hc as re,Ib as u,Md as se,Od as le,Pd as b,Qd as ce,Rd as pe,Sa as W,Sb as C,Sd as G,Ub as K,Xa as p,d as q,da as D,eb as v,ec as X,gc as $,gd as oe,hc as m,ib as Q,ic as B,jb as x,jc as z,la as d,ma as y,oa as _,pa as c,tc as ee,vd as ae,wb as Z,yc as te,zc as ie}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as J}from"./chunk-SNAKHGZS.js";var r=class e{constructor(n,t){this.authService=n;this.router=t}canLoad(n,t){return this.authService.isTokenExpired()?(this.authService.returnUrl=this.getUrlRedirect(t),this.router.navigate(["/"]),!1):!0}getUrlRedirect(n){let t="/menu";n.forEach(a=>t+=`/${a.path}`);let i=this.router.currentNavigation().extractedUrl.queryParams;return Object.keys(i).forEach((a,g)=>{g==0?t=`${t}?${a}=${i[a]}`:t=`${t}&${a}=${i[a]}`}),t}static \u0275fac=function(t){return new(t||e)(_(f),_(b))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var w=class e{constructor(n){this.toastrService=n;this.initPermissionToastr=!1}isPermissionGranted;initPermissionToastr;initPermission(){try{this.initPermissionToastr||Notification.requestPermission().then(t=>{this.isPermissionGranted=!1,t=="granted"&&(this.isPermissionGranted=!0),this.initPermissionToastr=!0})}catch(n){console.error(n)}}showAlert(n,t,i,l){let a=6e4;if(this.isPermissionGranted)try{let g=new Notification(t,{body:n,icon:l});g.onerror=(N=>{this.toastrService.info(this.setBody(n,i),t,{timeOut:a,enableHtml:this.hasUrl(i)})})}catch(g){console.error(g)}else this.toastrService.info(this.setBody(n,i),t,{timeOut:a,enableHtml:this.hasUrl(i)})}setBody(n,t){return this.hasUrl(t)&&(n=`<a href="${t}" target="_blank" class="ps-0">${n}</a>`),n}hasUrl(n){return!!(n&&n.length!==0)}static \u0275fac=function(t){return new(t||e)(_(de))};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var ye=[{T:"Dashboard",U:"/menu/Dashboard",I:"fa-solid fa-chart-pie"},{T:"Products",U:"/menu/Products",I:"fa-solid fa-tag"},{T:"Estimate",U:"/menu/Estimate",I:"fa-solid fa-clipboard"},{T:"Sell",U:"/menu/Sell",I:"fa-solid fa-cart-shopping"},{T:"Shift",U:"/menu/Shift/",I:"fa-solid fa-user-clock"},{T:"Reports",U:"/menu/Reports",I:"fa-solid fa-chart-area"},{T:"Contacts",U:"/menu/Contacts",I:"fas fa-address-book"},{T:"Orders",U:"/menu/Orders",I:"fas fa-file-invoice"},{T:"Payment",U:"/menu/Payment",I:"fas fa-money-bill-alt"},{T:"Debt",U:"/menu/Debt",I:"fas fa-dollar-sign"},{T:"Inventory",U:"/menu/Inventory",I:"fas fa-archive"},{T:"Adjustment",U:"/menu/Adjustment",I:"fas fa-scanner-gun"},{T:"Buy",U:"/menu/Buy",I:"fa-solid fa-cart-arrow-down"},{T:"Logistics",U:"/menu/Logistics",I:"fas fa-truck"},{T:"Fulfillment",U:"/menu/Fulfillment",I:"fas fa-dolly"},{T:"Manufacture",U:"/menu/Manufacture",I:"fas fa-industry"},{T:"Prepaid Package",U:"/menu/Prepaid_Package",I:"fa-solid fa-id-card"},{T:"Promotion",U:"/menu/Promotion",I:"fas fa-bullhorn"},{T:"Users",U:"/menu/Users",I:"fas fa-user"},{T:"Outlets",U:"/menu/Outlets",I:"fas fa-map-marker-alt"},{T:"Setup",U:"/menu/Setup",I:"fas fa-gear"},{T:"Developer",U:"/menu/Developer",I:"fas fa-code"}];var k=class e{role=c(I);authService=c(f);menu=ye;filteredMenu=[];initFilteredMenu(){let n=this.menu.map(i=>J({},i)),t=n.findIndex(i=>i.T==="Reports");if(t!==-1){let i=!!this.role.report?.View,l=!!this.role.report?.Advanced,a=!!this.role.report?.Periodic;i?n[t].U="/menu/Reports":l?n[t].U="/menu/Reports/Sales_Report/Standard/Top_Customers":a?n[t].U="/menu/Reports/Sales_Report/Standard/Daily":n[t].U="/menu/Reports"}this.filteredMenu=n.filter(i=>i.T==="Dashboard"?this.role.dashboard.View:i.T==="Products"?this.role.product.View:i.T==="Estimate"?this.role.estimate.Create:i.T==="Sell"?this.role.sell.Create:i.T==="Shift"?this.role.sell.Create:i.T==="Reports"?!!this.role.report?.View||!!this.role.report?.Advanced||!!this.role.report?.Periodic:i.T==="Contacts"?this.role.contact.View:i.T==="Orders"?this.role.order.View:i.T==="Payment"?this.role.payment.View:i.T==="Debt"?this.role.debt.View:i.T==="Inventory"?this.role.inventory.View:i.T==="Adjustment"?this.role.adjustment.View:i.T==="Buy"?this.role.buy.Create:i.T==="Logistics"?this.role.logistic.View:i.T==="Manufacture"?this.role.manufacture.View:i.T==="Fulfillment"?this.role.fulfillment.View:i.T==="Prepaid Package"?this.role.prepaidPackage.View:i.T==="Promotion"?this.role.promotion.View:i.T==="Users"?this.role.users.View:i.T==="Outlets"?this.role.outlets.View:i.T==="Setup"?this.role.setup.View:i.T==="Developer"?this.role.developer.View:!0),this.filterBySubscriptionStatus()}filterBySubscriptionStatus(){let n=this.authService.getSubscriptionStatus();this.filteredMenu=this.filteredMenu.filter(t=>{switch(n){case 2:return t.T=="Sell"||t.T=="Shift";case 3:return!1;default:return!0}})}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var xe=[{T:"My Profile",U:"Profile/Main/My_Profile",I:"fas fa-user"},{T:"My Subscription",U:"Profile/Main/My_Subscription",I:"fa-solid fa-credit-card"},{T:"Notification",U:"Profile/Notification/Push",I:"fas fa-bell"},{T:"My Sales",U:"Profile/Main/My_Sales",I:"fas fa-history"}];var A=class e{role=c(I);authService=c(f);filteredMenu=[];initFilteredMenu(){let n=this.authService.getSubscriptionStatus();this.filteredMenu=xe.filter(t=>t.T=="My Profile"?this.role.profile.View:t.T=="My Subscription"?this.role.profile.Subscription:t.T=="Notification"?this.role.profile.Notification&&n!=2&&n!=3:t.T=="My Sales"?n!=2&&n!=3:!0)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var Le=(e,n)=>({"full-container":e,"subscription-bar-visible":n}),Ne=e=>[e];function Ee(e,n){if(e&1&&(o(0,"a",11),u(1,"i",35),o(2,"span"),m(3),s()()),e&2){let t=n.$implicit;h("routerLink",t==null?null:t.U),p(),$((t==null?null:t.I)+" me-2"),p(2),B(t==null?null:t.T)}}function De(e,n){if(e&1&&(o(0,"li",33,0)(2,"a",36),u(3,"i"),o(4,"p"),m(5),s()()()),e&2){let t=n.$implicit,i=K();h("routerLinkActiveOptions",i.isActiveMatchOptions),Z("data-cy",t==null?null:t.T),p(2),h("matTooltip",i.toggleSideMenu?t==null?null:t.T:"")("routerLink",te(7,Ne,t==null?null:t.U)),p(),$(t==null?null:t.I),p(2),B(t==null?null:t.T)}}var P=class e{constructor(n,t,i,l,a,g,N,H){this.toggleSidebar=n;this.signalRClientService=t;this.notificationAlertService=i;this.router=l;this.authService=a;this.intercomService=g;N.initFilteredMenu(),H.initFilteredMenu(),this.leftSidebarMenu=N.filteredMenu,this.topMenu=H.filteredMenu,this.accountInfo=JSON.parse(localStorage.getItem("AccountInfo")),this.toggleSidebar.toggleState$.subscribe(Ie=>this.isNavOpen=Ie),this.destroy$=new q,this.initNotificationPermission()}isActiveMatchOptions={matrixParams:"subset",queryParams:"subset",paths:"subset",fragment:"exact"};toggleSideMenu=!1;isNavOpen;destroy$;activeMenu;appVersion=ue.version;currentSubStatus;subsStatusEnum=T;isFullContainer=!1;isHideIntercomLauncher;leftSidebarMenu;topMenu;accountInfo;ngOnInit(){this.subscribeToPushNotification(),this.getCurrentSubscriptionStatus(),this.initFullContainer()}initFullContainer(){this.router.events.pipe(E(n=>n instanceof se),Y(null),D(this.destroy$)).subscribe(n=>{this.isFullContainer=!1,(this.router.url.includes("Sell")&&!this.router.url.includes("v2")&&!this.router.url.includes("Offline")||this.router.url.includes("Buy")||this.router.url.includes("menu/Estimate")||this.router.url.includes("Transfer_Order/Form")||this.router.url.includes("Adjustment/Archive/Form")||this.router.url.includes("Job_Order/Archive/Form")||this.router.url.includes("/menu/Debt/Debt/Join_Invoice/Form")||this.router.url.includes("/menu/Debt/Debt/Join_Bill/New_Join_Bill"))&&(this.isFullContainer=!0)})}initNotificationPermission(){this.notificationAlertService.initPermission()}getCurrentSubscriptionStatus(){this.currentSubStatus=this.authService.getSubscriptionStatus()}subscribeToPushNotification(){let n=localStorage.getItem("NotificationOutletID");M.IsNotEmpty(n)&&M.isGuid(n)?this.signalRClientService.SubscribeGroup(n):this.signalRClientService.startConnection(),this.signalRClientService.OnReceivePushNotification.pipe(D(this.destroy$),E(t=>M.IsNotEmpty(t))).subscribe(t=>{if(M.IsNotEmpty(t)){let i=JSON.parse(t),l="https://cdn.dealpos.xyz/web-image/info-new.png";M.IsNotEmpty(i.Icon)&&(l=i.Icon),this.notificationAlertService.showAlert(i.Body,i.Header,i.URL,l)}})}ngAfterViewInit(){this.intercomService.inititalizeIntercom()}toggleMenu(){this.toggleSideMenu=!this.toggleSideMenu}logout(){this.authService.logout()}isNotEmpty(n){return M.IsNotEmpty(n)}onShowDropdown(){this.isHideIntercomLauncher=this.intercomService.isHideLauncher()}chatToggleChange(){this.isHideIntercomLauncher==!1?this.intercomService.hideLauncher():this.intercomService.showLauncher(),this.onShowDropdown()}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(t){return new(t||e)(v(Se),v(me),v(w),v(b),v(f),v(be),v(k),v(A))};static \u0275cmp=Q({type:e,selectors:[["POS-menu-master"]],standalone:!1,decls:54,vars:17,consts:[["rla","routerLinkActive"],[1,"wrapper"],["data-color","blue",1,"sidebar",3,"ngClass"],[1,"btn-minimize","d-lg-block","d-none","p-0","border-0","bg-white",3,"click"],[1,"fa-solid",3,"ngClass"],[1,"logo"],[1,"navbar","dropdown","bg-transparent","border-0"],["data-cy","companyName","data-bs-toggle","dropdown","aria-expanded","false","matTooltipPosition","above",1,"simple-text","text-start","dropdown-toggle","d-flex","align-items-center","justify-content-center",2,"cursor","pointer",3,"click","matTooltip"],[1,"dropdown-menu"],[1,"dropdown-header","text-dark","border-bottom"],[1,"divider","m-0"],[1,"dropdown-item","h5",3,"routerLink"],[1,"dropdown-item","h5",2,"cursor","pointer"],[1,"d-flex","align-items-center","justify-content-between"],[1,"fa-solid","fa-comment-dots","me-2"],[1,"checkbox_toggle","ms-3",3,"click"],["type","checkbox","id","chatToggle","name","ChatToggle",3,"ngModelChange","ngModel"],["for","chatToggle",1,"position-relative","rounded-pill","pointer"],[1,"dropdown-item","h5",2,"cursor","pointer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-sign-out-alt","me-2"],[1,"divider"],[1,"dropdown-header","border-top"],["target","_blank",1,"dropdown-item","h5","changelog",3,"href"],["aria-hidden","true",1,"fa-solid","fa-sparkles","me-2"],[1,"fa-solid","fa-circle-exclamation","ms-2",2,"font-size","16px"],["target","_blank","href","http://support.dealpos.com",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-solid","fa-book","me-2"],["target","_blank","href","https://www.dealpos.app/",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-solid","fa-table-cells-large","me-2"],["target","_blank","href","http://blog.dealpos.com",1,"dropdown-item","h5"],["aria-hidden","true",1,"fa-brands","fa-blogger","me-2"],[1,"sidebar-wrapper"],[1,"nav"],["routerLinkActive","active",3,"routerLinkActiveOptions"],["id","full-container",1,"main-panel",3,"ngClass"],["aria-hidden","true"],["matTooltipPosition","above",1,"nav-link","position-relative","d-block",3,"matTooltip","routerLink"]],template:function(t,i){t&1&&(o(0,"div",1)(1,"div",2)(2,"button",3),C("click",function(){return i.toggleMenu()}),u(3,"i",4),s(),o(4,"div",5)(5,"div",6)(6,"a",7),C("click",function(){return i.onShowDropdown()}),m(7),ne(8,"limitText"),s(),o(9,"div",8)(10,"div",9),m(11),s(),u(12,"div",10),F(13,Ee,4,4,"a",11,j),o(15,"a",12)(16,"div",13)(17,"div"),u(18,"i",14),o(19,"span"),m(20,"Chat Support"),s()(),o(21,"div",15),C("click",function(a){return a.stopPropagation()}),o(22,"input",16),C("ngModelChange",function(){return i.chatToggleChange()}),s(),u(23,"label",17),s()()(),o(24,"a",18),C("click",function(){return i.logout()}),u(25,"i",19),o(26,"span"),m(27,"Log Out"),s()(),u(28,"div",20),o(29,"div",21),m(30," Links "),s(),o(31,"a",22),u(32,"i",23),o(33,"span"),m(34,"What's New"),u(35,"i",24),s()(),o(36,"a",25),u(37,"i",26),o(38,"span"),m(39,"Help Center"),s()(),o(40,"a",27),u(41,"i",28),o(42,"span"),m(43,"App Store"),s()(),o(44,"a",29),u(45,"i",30),o(46,"span"),m(47,"Company Blog"),s()()()()(),o(48,"div",31)(49,"ul",32),F(50,De,6,9,"li",33,j),s()()(),o(52,"div",34),u(53,"router-outlet"),s()()),t&2&&(X("nav-open",i.isNavOpen),p(),h("ngClass",i.toggleSideMenu?"collapses":""),p(2),h("ngClass",i.toggleSideMenu?"fa-angle-left cursor":"fa-angle-right cursor"),p(3),h("matTooltip",i.accountInfo==null?null:i.accountInfo.BrandName),p(),z(" ",re(8,11,i.accountInfo==null?null:i.accountInfo.BrandName,12)," "),p(4),z("",i.accountInfo==null?null:i.accountInfo.UserName," "),p(2),V(i.topMenu),p(9),h("ngModel",!i.isHideIntercomLauncher),p(9),h("href",ee("https://changelog.dealpos.com/?categories=cat_gAZdRhBYU7QVl&view=complete&v=",i.appVersion),W),p(19),V(i.leftSidebarMenu),p(2),h("ngClass",ie(14,Le,i.isFullContainer,i.isNotEmpty(i.currentSubStatus)&&i.currentSubStatus!==i.subsStatusEnum.PAID)))},dependencies:[Me,le,ce,pe,fe,he,ge,oe,Pe],styles:['.sidebar[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%], body[_ngcontent-%COMP%] > .navbar-collapse[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important}.sidebar-wrapper[_ngcontent-%COMP%]{max-height:calc(100% - 61px)!important;min-height:calc(100% - 61px)!important}@media (max-width: 991px){.sidebar-wrapper[_ngcontent-%COMP%]{overflow-y:scroll!important}}@media (pointer: coarse){.sidebar-wrapper[_ngcontent-%COMP%]{overflow-y:scroll!important}}@media (max-width: 468px){.navbar[_ngcontent-%COMP%] .navbar-brand[_ngcontent-%COMP%]{white-space:nowrap;max-width:7em;overflow:hidden;text-overflow:ellipsis}}@media only screen and (min-width: 992px){.sidebar[_ngcontent-%COMP%]{z-index:1050!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{transition:all .3s}.sidebar[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%], .sidebar.collapses[_ngcontent-%COMP%] .sidebar-wrapper[_ngcontent-%COMP%]{width:70px;transition:all .3s}.sidebar.collapses[_ngcontent-%COMP%] .logo[_ngcontent-%COMP%] .simple-text[_ngcontent-%COMP%]{background-color:#ffffff3b;border-radius:20px;height:40px;width:40px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%]{padding:10px 0 10px 10px!important;height:50px;text-align:center;margin:10px}.sidebar.collapses[_ngcontent-%COMP%] .nav[_ngcontent-%COMP%] li[_ngcontent-%COMP%] .nav-link[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:none}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%]{padding-left:70px}.sidebar.collapses[_ngcontent-%COMP%] + .main-panel[_ngcontent-%COMP%] .navbar.fixed-top[_ngcontent-%COMP%]{left:70px!important;transition:all .3s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]{position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%] .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1;background-color:#fff;position:absolute;top:17px;right:-20px;z-index:7;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);border:0;border-radius:50%;box-shadow:0 0 0 1px #091e4214,0 2px 4px 1px #091e4214;color:#000;cursor:pointer;height:24px;opacity:0;outline:0;padding:0;width:24px;-webkit-transform-origin:7px;-ms-transform-origin:7px;transform-origin:7px;transition:opacity .5s;-webkit-transition:opacity .5s}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{cursor:pointer}.sidebar[_ngcontent-%COMP%]:hover .btn-minimize[_ngcontent-%COMP%]:hover{color:#2996cc}.sidebar[_ngcontent-%COMP%]:hover:hover .btn-minimize[_ngcontent-%COMP%]{opacity:1}}.full-container[_ngcontent-%COMP%]{padding-top:0!important}.changelog[_ngcontent-%COMP%]{color:#0006b1!important}.changelog[_ngcontent-%COMP%]:visited{color:#2e2e2e!important}.changelog[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{position:relative}.changelog[_ngcontent-%COMP%] span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fe3a00!important;position:absolute;top:-4px;right:-18px}.changelog[_ngcontent-%COMP%]:visited span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#fff!important;position:absolute;top:-4px;right:-18px}.changelog[_ngcontent-%COMP%]:visited:hover span[_ngcontent-%COMP%] i[_ngcontent-%COMP%]{color:#e9ecef!important;position:absolute;top:-4px;right:-18px}.subscription-bar-visible[_ngcontent-%COMP%]{padding-top:98px}.checkbox_toggle[_ngcontent-%COMP%]{position:relative}.checkbox_toggle[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:#868686;display:inline-block;padding-right:38px}.checkbox_toggle[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{width:23px;height:14px;background-color:#ccc;top:2.2px;right:0}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]{display:none}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]{background-color:#1f77d0}.checkbox_toggle[_ngcontent-%COMP%] input[type=checkbox][_ngcontent-%COMP%]:checked + label[_ngcontent-%COMP%]:after{left:10px}.checkbox_toggle[_ngcontent-%COMP%] label[_ngcontent-%COMP%]:after{content:"";width:12px;height:12px;border-radius:50%;position:absolute;top:.8px;left:1px;transition:all .1s;background-color:#fff}']})};function je(e){let n=c(b),t="/menu";e.forEach(a=>t+=`/${a.path}`);let i=n.currentNavigation().extractedUrl.queryParams;return Object.keys(i).forEach((a,g)=>{g==0?t=`${t}?${a}=${i[a]}`:t=`${t}&${a}=${i[a]}`}),t}var O=(e,n)=>{let t=c(f),i=t.isTokenExpired(),l=c(b);return i?(t.returnUrl=je(n),l.navigate(["/"]),!1):e.path=="Dashboard"?Fe():!0};function Fe(){let e=c(b),n=c(f),t=!1,i=n.getRedirectUrl();return t=i.includes("Dashboard"),t==!1&&e.navigate([i]),t}var U=class e{paymentStorageService=c(_e);canActivate(n,t){return this.paymentStorageService.clear(),!0}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var R=class e{reportService=c(Oe);canActivate(n,t){return this.reportService.resetFilter(),!0}static \u0275fac=function(t){return new(t||e)};static \u0275prov=d({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ve=[{path:"",component:P,children:[{path:"Inventory",loadChildren:()=>import("./chunk-LC7GFFEX.js").then(e=>e.InventoryModule),canLoad:[r]},{path:"Reports",loadChildren:()=>import("./chunk-NENPGICH.js").then(e=>e.ReportsModule),canLoad:[r],canActivate:[R]},{path:"Sell",loadChildren:()=>import("./chunk-IDZHSRCH.js").then(e=>e.routes),canLoad:[r]},{path:"Print",loadChildren:()=>import("./chunk-DTX2BFBV.js").then(e=>e.PrintModule),canLoad:[r]},{path:"Buy",loadComponent:()=>import("./chunk-IRQYLVRP.js").then(e=>e.BuyV2Component),canMatch:[O]},{path:"Sell/V2",loadComponent:()=>import("./chunk-Z3UTJURO.js").then(e=>e.SellV2Component),canMatch:[O]},{path:"Dashboard",loadComponent:()=>import("./chunk-6G74X2UP.js").then(e=>e.DashboardV2Component),canMatch:[O]},{path:"Products",loadChildren:()=>import("./chunk-YZCJFJZL.js").then(e=>e.ProductModule),canLoad:[r]},{path:"Shift",loadChildren:()=>import("./chunk-3ZZJHIUG.js").then(e=>e.ShiftModule),canLoad:[r]},{path:"Debt",loadChildren:()=>import("./chunk-DG6Y623Z.js").then(e=>e.DebtModule),canLoad:[r]},{path:"Logistics",loadChildren:()=>import("./chunk-CEVAKZDN.js").then(e=>e.DeliveryModule),canLoad:[r]},{path:"Users",loadChildren:()=>import("./chunk-CNHLZU3Z.js").then(e=>e.UsersModule),canLoad:[r]},{path:"Setup",loadChildren:()=>import("./chunk-Y67EVUWI.js").then(e=>e.SetupModule),canLoad:[r]},{path:"Developer",loadChildren:()=>import("./chunk-BGT22RIZ.js").then(e=>e.DeveloperModule),canLoad:[r]},{path:"Contacts",loadChildren:()=>import("./chunk-WXEEGAH5.js").then(e=>e.ContactsModule),canLoad:[r]},{path:"Outlets",loadChildren:()=>import("./chunk-MFNPIWGR.js").then(e=>e.OutletsModule),canLoad:[r]},{path:"Orders",loadChildren:()=>import("./chunk-CLWGVNBY.js").then(e=>e.OrdersModule),canLoad:[r]},{path:"Profile",loadChildren:()=>import("./chunk-NPQFE4EO.js").then(e=>e.ProfileModule),canLoad:[r]},{path:"Estimate",loadComponent:()=>import("./chunk-234VD4PN.js").then(e=>e.EstimateV2Component),canMatch:[O]},{path:"Adjustment",loadChildren:()=>import("./chunk-RXPEUS2G.js").then(e=>e.AdjustmentModule),canLoad:[r]},{path:"Payment",loadChildren:()=>import("./chunk-MOXEW4DH.js").then(e=>e.PaymentModule),canLoad:[r],canActivate:[U]},{path:"Promotion",loadChildren:()=>import("./chunk-GIPUEMTC.js").then(e=>e.PromotionModule),canLoad:[r]},{path:"Manufacture",loadChildren:()=>import("./chunk-GLOUVXOJ.js").then(e=>e.ManufactureModule),canLoad:[r]},{path:"Prepaid_Package",loadChildren:()=>import("./chunk-DHKZDGY6.js").then(e=>e.PrepaidPackageModule),canLoad:[r]},{path:"Fulfillment",loadChildren:()=>import("./chunk-55DB5BOP.js").then(e=>e.FulfillmentModule),canLoad:[r]},{path:"Unauthorized",loadChildren:()=>import("./chunk-FBN34CVL.js").then(e=>e.UnauthorizedModule),canLoad:[r]},{path:"Not_Found",loadChildren:()=>import("./chunk-MVJSAD2O.js").then(e=>e.NotFoundModule),canLoad:[r]},{path:"",redirectTo:"/menu/Dashboard",pathMatch:"full"},{path:"**",redirectTo:"Not_Found"}]}],L=class e{static \u0275fac=function(t){return new(t||e)};static \u0275mod=x({type:e});static \u0275inj=y({imports:[G.forChild(Ve),G]})};var Te=class e{constructor(){}static \u0275fac=function(t){return new(t||e)};static \u0275mod=x({type:e,bootstrap:[P]});static \u0275inj=y({imports:[Ce,L,ve,ae]})};export{Te as MenuMasterModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as Z}from"./chunk-J6M7UWVR.js";import{e as R,f as ie}from"./chunk-LNZY3GKF.js";import"./chunk-QE5OFO56.js";import{a as B,b as j}from"./chunk-KJF3M7DY.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import{D as Q}from"./chunk-26YFRPR2.js";import"./chunk-JBS5UYZC.js";import{F as ee,N as te}from"./chunk-TEGIL5RZ.js";import"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-FU2ZGMX4.js";import"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import"./chunk-DWZ5JTI2.js";import"./chunk-743523SK.js";import"./chunk-46D5QBZT.js";import"./chunk-36GWLMZX.js";import{b as Y}from"./chunk-WFQIMZGL.js";import"./chunk-WUV22SZ4.js";import"./chunk-SO3RL6QR.js";import{p as X,s as L}from"./chunk-LGOSIAUC.js";import{Ab as m,Cb as x,Db as v,Eb as C,Fb as k,Fc as u,Gb as n,Gc as b,Hb as i,Hc as T,Ib as O,Ic as J,Pb as D,Sb as y,Sd as z,Ub as c,Xa as o,d as F,da as _,eb as f,hc as r,ib as w,ic as S,jb as M,jc as p,kc as q,ma as P,mb as $,qd as V,sd as N,ta as g,ua as E,vd as K,yb as s}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";function ue(t,a){if(t&1){let e=D();n(0,"a",18),y("click",function(){g(e);let l=c();return E(l.convertToCsv())}),O(1,"i",19),r(2," Export Fail"),i()}}function _e(t,a){if(t&1){let e=D();n(0,"a",20),y("click",function(){g(e);let l=c();return E(l.uploadOrders())}),O(1,"i",21),r(2," Send Transaction"),i()}}function fe(t,a){t&1&&(n(0,"th",13)(1,"i"),r(2,"Actions"),i()())}function xe(t,a){if(t&1&&(n(0,"span"),r(1),i()),t&2){let e=c().$implicit;o(),S(e==null||e.Variant==null?null:e.Variant.Name)}}function ve(t,a){if(t&1&&(n(0,"div",22),s(1,xe,2,1,"span"),i()),t&2){let e=a.$implicit;o(),m(e!=null?1:-1)}}function Ce(t,a){if(t&1&&(n(0,"span"),r(1),i()),t&2){let e=c().$implicit;o(),p(" ",e==null?null:e.Quantity," ")}}function Se(t,a){if(t&1&&(n(0,"div",23),s(1,Ce,2,1,"span"),i()),t&2){let e=a.$implicit;o(),m(e!=null?1:-1)}}function he(t,a){if(t&1&&(n(0,"span"),r(1),u(2,"number"),i()),t&2){let e=c().$implicit;o(),p(" ",b(2,1,e.Price)," ")}}function Oe(t,a){if(t&1&&(n(0,"div",23),s(1,he,3,3,"span"),i()),t&2){let e=a.$implicit;o(),m(e!=null?1:-1)}}function ye(t,a){if(t&1&&(n(0,"span"),r(1),u(2,"number"),i()),t&2){let e=c().$implicit;o(),p(" ",b(2,1,e.Quantity*e.UnitQuantity*e.Price*(1-e.Discount/100)-e.DiscountAmount)," ")}}function be(t,a){if(t&1&&(n(0,"div",23),s(1,ye,3,3,"span"),i()),t&2){let e=a.$implicit;o(),m(e!=null?1:-1)}}function ge(t,a){if(t&1){let e=D();n(0,"td",24)(1,"i",25),y("click",function(){g(e);let l=c().$implicit,h=c(2);return E(h.removeOrder(l))}),i()()}}function Ee(t,a){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),u(5,"date"),i(),n(6,"td"),v(7,ve,2,1,"div",22,x),i(),n(9,"td"),v(10,Se,2,1,"div",23,x),i(),n(12,"td"),v(13,Oe,2,1,"div",23,x),i(),n(15,"td"),v(16,be,2,1,"div",23,x),i(),s(18,ge,2,0,"td",24),i()),t&2){let e=a.$implicit,d=c(2);o(2),S(e.Order.Number),o(2),S(T(5,3,e.Order.Date,"dd MMM yyyy")),o(3),C(e.CartItems),o(3),C(e.CartItems),o(3),C(e.CartItems),o(3),C(e.CartItems),o(2),m(d.roleService.sell.Delete?18:-1)}}function De(t,a){if(t&1&&v(0,Ee,19,6,"tr",null,x),t&2){let e=c();C(e.offlineOrders)}}function Te(t,a){t&1&&(n(0,"td",14)(1,"h4",26),r(2,"There is no Offline Order"),i()())}function Ie(t,a){if(t&1&&(n(0,"span"),r(1),n(2,"strong"),r(3),i(),n(4,"strong"),r(5),u(6,"number"),i(),n(7,"strong"),r(8),u(9,"number"),i()()),t&2){let e=c().$implicit;o(),p("",e==null||e.Variant==null?null:e.Variant.Name," "),o(2),p(" ",e.Quantity+" x"," "),o(2),p(" ",b(6,4,e.Price)+" ="," "),o(3),p(" ",b(9,6,e.Quantity*e.UnitQuantity*e.Price*(1-e.Discount/100)-e.DiscountAmount)," ")}}function Fe(t,a){if(t&1&&(n(0,"div",27),s(1,Ie,10,8,"span"),i()),t&2){let e=a.$implicit;o(),m(e!=null?1:-1)}}function Pe(t,a){if(t&1&&(n(0,"div",28),r(1),i()),t&2){let e=c().$implicit;o(),p(" ",e.Message," ")}}function we(t,a){if(t&1){let e=D();n(0,"a",33),y("click",function(){g(e);let l=c().$implicit,h=c(2);return E(h.removeFailedOrder(l))}),O(1,"i",34),i()}}function Me(t,a){if(t&1){let e=D();n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),u(5,"date"),i(),n(6,"td"),v(7,Fe,2,1,"div",27,x),i(),n(9,"td"),s(10,Pe,2,1,"div",28),i(),n(11,"td",29)(12,"a",30),y("click",function(){let l=g(e).$implicit,h=c(2);return E(h.uploadFailedOrder(l))}),O(13,"i",31),i(),s(14,we,2,0,"a",32),i()()}if(t&2){let e=a.$implicit,d=c(2);o(2),S(e.Order.Number),o(2),S(T(5,4,e.Order.Date,"dd MMM yyyy")),o(3),C(e.CartItems),o(3),m(e.Message?10:-1),o(4),m(d.roleService.sell.Delete?14:-1)}}function $e(t,a){if(t&1&&v(0,Me,15,7,"tr",null,x),t&2){let e=c();C(e.failedOrders)}}function ke(t,a){t&1&&(n(0,"td",17)(1,"h4",26),r(2,"There is no Failed Order"),i()())}var H=class t extends B{constructor(e,d,l,h,I,W){super(e);this.httpService=d;this.localData=l;this.csvConverter=h;this.toastr=I;this.roleService=W;this.destroy$=new F,this.pageData={Header:"Offline Orders"}}pageData;offlineOrders=[];failedOrders=[];destroy$;ngOnInit(){this.menuData$.pipe(_(this.destroy$)).subscribe(()=>{this.getOfflineOrders(),this.getFailedOrders()})}removeOrder(e){this.localData.removeOrder(e.id).subscribe({next:()=>{this.toastr.success("Successfully removed order "+e.Order.Number,"Offline Order Deleted!"),this.getOfflineOrders()},error:d=>{this.toastr.warning("Failed to remove order "+e.Order.Number,"Failed to delete order!")}})}getOfflineOrders(){this.localData.findAllOrders().pipe(_(this.destroy$)).subscribe({next:e=>{this.offlineOrders=e},error:e=>{this.toastr.error(e.message,"Error!")}})}getFailedOrders(){this.localData.getFailedOrders().pipe(_(this.destroy$)).subscribe({next:e=>{this.failedOrders=e},error:e=>{this.toastr.error(e.message,"Error!")}})}uploadFailedOrder(e){this.localData.uploadFailedOrder(e).pipe(_(this.destroy$)).subscribe({next:()=>{this.toastr.success("Successfully uploaded order "+e.Order.Number,"Sync Successful!"),this.getFailedOrders()},error:()=>{this.toastr.error("Failed to sync failed order "+e.Order.Number,"Error!")}})}removeFailedOrder(e){this.localData.removeFailedOrder(e.id).pipe(_(this.destroy$)).subscribe({next:d=>{this.toastr.success("Success to remove failed offline order","Error!"),this.getFailedOrders()},error:d=>{this.toastr.error("Failed to remove failed offline order","Error!")}})}uploadOrders(){this.localData.uploadOrders().pipe(_(this.destroy$)).subscribe({next:e=>{e?this.getOfflineOrders():(this.getOfflineOrders(),this.getFailedOrders())},error:e=>{this.getOfflineOrders(),this.getFailedOrders()}})}convertToCsv(){this.csvConverter.convertToCSV(this.getExportData(),"Fail_Transaction.csv")}getExportData(){let e=[["Number","Date","Item","Qty","Price","Total"]];return this.failedOrders.forEach(d=>{d.Items.forEach(l=>{let h=d.Order.Number.toString(),I=d.Order.Date.toLocaleString(),W=l.Quantity.toString(),re=l.Price.toString(),oe=(l.Quantity*l.UnitQuantity*(l.Price*(1-l.Discount/100))-l.DiscountAmount).toString(),ae=[h,I,l.Variant.Name,W,re,oe];e.push(ae)})}),e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(d){return new(d||t)(f(j),f(L),f(Q),f(Z),f(X),f(Y))};static \u0275cmp=w({type:t,selectors:[["pos-orders"]],standalone:!1,features:[$],decls:52,vars:8,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],["matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6"],["value","Send Transaction","matTooltipPosition","above","matTooltip","Send Transaction",1,"btn","btn-outline-secondary"],[1,"container-fluid"],[1,"row","mt-10","mb-12"],[1,"col-md"],[1,"table","mt-5"],[1,"thead-light","sticky-top-thead"],[1,"border-end",2,"width","130px"],[1,"border-end",2,"width","90px"],[1,"border-end"],[1,"border-end","text-end",2,"width","103px"],[1,"border-end","text-end",2,"width","200px"],[1,"text-center",2,"width","90px"],["colspan","7"],[1,"row","mt-12"],[1,"border-end",2,"width","102px"],["colSpan","5"],["matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],["value","Send Transaction","matTooltipPosition","above","matTooltip","Send Transaction",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-paper-plane"],[1,"list-unstyled","text-start"],[1,"list-unstyled","text-end"],[1,"text-center","text-danger"],[1,"fa-solid","fa-xmark","fa-2x","cursor-pointer",3,"click"],[1,"text-center","mt-2"],[1,"list-inline","text-start"],[1,"text-danger"],[1,"d-flex","justify-content-center"],["matTooltipPosition","above","matTooltip","Sync",1,"ms-2","me-2","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-cloud-arrow-up","text-primary","fa-2x"],["matTooltipPosition","above","matTooltip","Remove",1,"ms-5","cursor-pointer"],["matTooltipPosition","above","matTooltip","Remove",1,"ms-5","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa-regular","fa-xmark-circle","text-primary","fa-2x"]],template:function(d,l){d&1&&(n(0,"mainpanel-cmp",0)(1,"actions"),s(2,ue,3,0,"a",1),s(3,_e,3,0,"a",2),i(),n(4,"content")(5,"div",3)(6,"div",4)(7,"div",5)(8,"h5"),r(9,"Offline Orders"),i(),n(10,"i"),r(11,"Waiting to be uploaded to the server!"),i(),n(12,"table",6)(13,"thead",7)(14,"tr")(15,"th",8),r(16,"Number"),i(),n(17,"th",9),r(18,"Date"),i(),n(19,"th",10),r(20,"item"),i(),n(21,"th",11),r(22,"Qty"),i(),n(23,"th",12),r(24,"Price"),i(),n(25,"th",12),r(26,"Total"),i(),s(27,fe,3,0,"th",13),i()(),n(28,"tbody"),s(29,De,2,0)(30,Te,3,0,"td",14),i()()()(),n(31,"div",15)(32,"div",5)(33,"h5"),r(34,"Synchronization Errors"),i(),n(35,"i"),r(36,"Exception occured when trying to upload these orders"),i(),n(37,"table",6)(38,"thead",7)(39,"tr")(40,"th",9),r(41,"Number"),i(),n(42,"th",9),r(43,"Date"),i(),n(44,"th",10),r(45,"item"),i(),n(46,"th",10),r(47,"Sync exception"),i(),O(48,"th",16),i()(),n(49,"tbody"),s(50,$e,2,0)(51,ke,3,0,"td",17),i()()()()()()()),d&2&&(k("pageData",l.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),o(2),m((l.failedOrders==null?null:l.failedOrders.length)>0?2:-1),o(),m(l.offlineOrders.length>0?3:-1),o(24),m(l.roleService.sell.Delete?27:-1),o(2),m(l.offlineOrders.length>0?29:30),o(21),m(l.failedOrders.length>0?50:51))},dependencies:[R,N,V],styles:[".cursor-pointer[_ngcontent-%COMP%]{cursor:pointer}"]})};function Ve(t,a){if(t&1&&(n(0,"div",1),O(1,"i",5),r(2),u(3,"date"),i()),t&2){let e=c();o(2),p(" ",T(3,1,e.LastSync,"dd MMM yyyy HH:mm:ss")," ")}}function Ne(t,a){if(t&1&&(n(0,"tr")(1,"td",12),r(2),i(),n(3,"td",13),r(4),i(),n(5,"td"),r(6),i(),n(7,"td",9),r(8),u(9,"number"),i()()),t&2){let e=a.$implicit,d=c(2);o(2),S(e.ID),o(2),S(e.Name),o(2),S(e.Code),o(2),q(" ",d.currency," ",T(9,5,e.UnitPrice,"1.0-4")," ")}}function Le(t,a){if(t&1&&(n(0,"table",3)(1,"thead",6)(2,"tr",7)(3,"th",8),r(4,"ID"),i(),n(5,"th",8),r(6,"Name"),i(),n(7,"th",8),r(8,"Code"),i(),n(9,"th",9),r(10,"Unit Price"),i()()(),n(11,"tbody"),v(12,Ne,10,8,"tr",null,x),u(14,"sortBy"),i(),n(15,"tfoot")(16,"tr",10)(17,"td",11)(18,"strong"),r(19),u(20,"number"),i()()()()()),t&2){let e=c();o(12),C(J(14,1,e.variantList,"asc","Name")),o(7),p("",b(20,5,e.variantList.length)," Product ")}}function Be(t,a){t&1&&(n(0,"h3",4),r(1,"Product has not been synced yet!"),i())}var A=class t extends B{constructor(e,d,l){super(e);this.httpService=d;this._localDataService=l;this.destroy$=new F}variantList=[];OriginalList=[];LastSync;currency;destroy$;ngOnInit(){this.menuData$.subscribe(e=>{this.getVariants(),this.getSyncDate(),this.getCurrency()})}getVariants(){this._localDataService.findAllVariant().pipe(_(this.destroy$)).subscribe({next:e=>{this.OriginalList=e,this.variantList=this.OriginalList},error:e=>{console.error(e)}})}getSyncDate(){this._localDataService.getSyncTime().pipe(_(this.destroy$)).subscribe(e=>{this.LastSync=new Date(e.time)})}getCurrency(){this._localDataService.getPOSStorage().pipe(_(this.destroy$)).subscribe(e=>{e&&(this.currency=e.Currencies[0].Symbol)})}filterList(e){this.variantList=this.OriginalList.filter(d=>d.Name.includes(e))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(d){return new(d||t)(f(j),f(L),f(Q))};static \u0275cmp=w({type:t,selectors:[["pos-products"]],standalone:!1,features:[$],decls:7,vars:4,consts:[[3,"textChange","pageData","hideSearchDropdown"],[1,"h5"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"text-center","mt-4"],[1,"fa-solid","fa-sync-alt"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-start"],[1,"text-end"],[1,"table-footer"],["colspan","4",1,"text-start","empty-column"],[2,"max-width","100px"],[2,"max-width","300px"]],template:function(d,l){d&1&&(n(0,"mainpanel-cmp",0),y("textChange",function(I){return l.filterList(I)}),n(1,"actions"),s(2,Ve,4,4,"div",1),i(),n(3,"content")(4,"div",2),s(5,Le,21,7,"table",3)(6,Be,2,0,"h3",4),i()()()),d&2&&(k("pageData",l.menuData)("hideSearchDropdown",!0),o(2),m(l.LastSync?2:-1),o(3),m(l.variantList.length>0?5:6))},dependencies:[R,N,V,ee],encapsulation:2})};var je=[{path:"Products",component:A},{path:"Orders",component:H},{path:"**",redirectTo:"Products",pathMatch:"full"}],U=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=M({type:t});static \u0275inj=P({imports:[z.forChild(je),z]})};var ne=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=M({type:t});static \u0275inj=P({imports:[K,U,ie,te]})};export{ne as OfflineModule};
|
|
1
|
+
import{a as Z}from"./chunk-J6M7UWVR.js";import{e as R,f as ie}from"./chunk-YVO66RJF.js";import"./chunk-PFF34SZG.js";import{a as B,b as j}from"./chunk-V3FPQMVB.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import{D as Q}from"./chunk-26YFRPR2.js";import"./chunk-JBS5UYZC.js";import{F as ee,N as te}from"./chunk-TEGIL5RZ.js";import"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-FU2ZGMX4.js";import"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import"./chunk-DWZ5JTI2.js";import"./chunk-Y7D34HYN.js";import"./chunk-P6DRDJVZ.js";import"./chunk-36GWLMZX.js";import{b as Y}from"./chunk-WFQIMZGL.js";import"./chunk-WUV22SZ4.js";import"./chunk-6UC76HYF.js";import{p as X,s as L}from"./chunk-LGOSIAUC.js";import{Ab as m,Cb as x,Db as v,Eb as C,Fb as k,Fc as u,Gb as n,Gc as b,Hb as i,Hc as T,Ib as O,Ic as J,Pb as D,Sb as y,Sd as z,Ub as c,Xa as o,d as F,da as _,eb as f,hc as r,ib as w,ic as S,jb as M,jc as p,kc as q,ma as P,mb as $,qd as V,sd as N,ta as g,ua as E,vd as K,yb as s}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";function ue(t,a){if(t&1){let e=D();n(0,"a",18),y("click",function(){g(e);let l=c();return E(l.convertToCsv())}),O(1,"i",19),r(2," Export Fail"),i()}}function _e(t,a){if(t&1){let e=D();n(0,"a",20),y("click",function(){g(e);let l=c();return E(l.uploadOrders())}),O(1,"i",21),r(2," Send Transaction"),i()}}function fe(t,a){t&1&&(n(0,"th",13)(1,"i"),r(2,"Actions"),i()())}function xe(t,a){if(t&1&&(n(0,"span"),r(1),i()),t&2){let e=c().$implicit;o(),S(e==null||e.Variant==null?null:e.Variant.Name)}}function ve(t,a){if(t&1&&(n(0,"div",22),s(1,xe,2,1,"span"),i()),t&2){let e=a.$implicit;o(),m(e!=null?1:-1)}}function Ce(t,a){if(t&1&&(n(0,"span"),r(1),i()),t&2){let e=c().$implicit;o(),p(" ",e==null?null:e.Quantity," ")}}function Se(t,a){if(t&1&&(n(0,"div",23),s(1,Ce,2,1,"span"),i()),t&2){let e=a.$implicit;o(),m(e!=null?1:-1)}}function he(t,a){if(t&1&&(n(0,"span"),r(1),u(2,"number"),i()),t&2){let e=c().$implicit;o(),p(" ",b(2,1,e.Price)," ")}}function Oe(t,a){if(t&1&&(n(0,"div",23),s(1,he,3,3,"span"),i()),t&2){let e=a.$implicit;o(),m(e!=null?1:-1)}}function ye(t,a){if(t&1&&(n(0,"span"),r(1),u(2,"number"),i()),t&2){let e=c().$implicit;o(),p(" ",b(2,1,e.Quantity*e.UnitQuantity*e.Price*(1-e.Discount/100)-e.DiscountAmount)," ")}}function be(t,a){if(t&1&&(n(0,"div",23),s(1,ye,3,3,"span"),i()),t&2){let e=a.$implicit;o(),m(e!=null?1:-1)}}function ge(t,a){if(t&1){let e=D();n(0,"td",24)(1,"i",25),y("click",function(){g(e);let l=c().$implicit,h=c(2);return E(h.removeOrder(l))}),i()()}}function Ee(t,a){if(t&1&&(n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),u(5,"date"),i(),n(6,"td"),v(7,ve,2,1,"div",22,x),i(),n(9,"td"),v(10,Se,2,1,"div",23,x),i(),n(12,"td"),v(13,Oe,2,1,"div",23,x),i(),n(15,"td"),v(16,be,2,1,"div",23,x),i(),s(18,ge,2,0,"td",24),i()),t&2){let e=a.$implicit,d=c(2);o(2),S(e.Order.Number),o(2),S(T(5,3,e.Order.Date,"dd MMM yyyy")),o(3),C(e.CartItems),o(3),C(e.CartItems),o(3),C(e.CartItems),o(3),C(e.CartItems),o(2),m(d.roleService.sell.Delete?18:-1)}}function De(t,a){if(t&1&&v(0,Ee,19,6,"tr",null,x),t&2){let e=c();C(e.offlineOrders)}}function Te(t,a){t&1&&(n(0,"td",14)(1,"h4",26),r(2,"There is no Offline Order"),i()())}function Ie(t,a){if(t&1&&(n(0,"span"),r(1),n(2,"strong"),r(3),i(),n(4,"strong"),r(5),u(6,"number"),i(),n(7,"strong"),r(8),u(9,"number"),i()()),t&2){let e=c().$implicit;o(),p("",e==null||e.Variant==null?null:e.Variant.Name," "),o(2),p(" ",e.Quantity+" x"," "),o(2),p(" ",b(6,4,e.Price)+" ="," "),o(3),p(" ",b(9,6,e.Quantity*e.UnitQuantity*e.Price*(1-e.Discount/100)-e.DiscountAmount)," ")}}function Fe(t,a){if(t&1&&(n(0,"div",27),s(1,Ie,10,8,"span"),i()),t&2){let e=a.$implicit;o(),m(e!=null?1:-1)}}function Pe(t,a){if(t&1&&(n(0,"div",28),r(1),i()),t&2){let e=c().$implicit;o(),p(" ",e.Message," ")}}function we(t,a){if(t&1){let e=D();n(0,"a",33),y("click",function(){g(e);let l=c().$implicit,h=c(2);return E(h.removeFailedOrder(l))}),O(1,"i",34),i()}}function Me(t,a){if(t&1){let e=D();n(0,"tr")(1,"td"),r(2),i(),n(3,"td"),r(4),u(5,"date"),i(),n(6,"td"),v(7,Fe,2,1,"div",27,x),i(),n(9,"td"),s(10,Pe,2,1,"div",28),i(),n(11,"td",29)(12,"a",30),y("click",function(){let l=g(e).$implicit,h=c(2);return E(h.uploadFailedOrder(l))}),O(13,"i",31),i(),s(14,we,2,0,"a",32),i()()}if(t&2){let e=a.$implicit,d=c(2);o(2),S(e.Order.Number),o(2),S(T(5,4,e.Order.Date,"dd MMM yyyy")),o(3),C(e.CartItems),o(3),m(e.Message?10:-1),o(4),m(d.roleService.sell.Delete?14:-1)}}function $e(t,a){if(t&1&&v(0,Me,15,7,"tr",null,x),t&2){let e=c();C(e.failedOrders)}}function ke(t,a){t&1&&(n(0,"td",17)(1,"h4",26),r(2,"There is no Failed Order"),i()())}var H=class t extends B{constructor(e,d,l,h,I,W){super(e);this.httpService=d;this.localData=l;this.csvConverter=h;this.toastr=I;this.roleService=W;this.destroy$=new F,this.pageData={Header:"Offline Orders"}}pageData;offlineOrders=[];failedOrders=[];destroy$;ngOnInit(){this.menuData$.pipe(_(this.destroy$)).subscribe(()=>{this.getOfflineOrders(),this.getFailedOrders()})}removeOrder(e){this.localData.removeOrder(e.id).subscribe({next:()=>{this.toastr.success("Successfully removed order "+e.Order.Number,"Offline Order Deleted!"),this.getOfflineOrders()},error:d=>{this.toastr.warning("Failed to remove order "+e.Order.Number,"Failed to delete order!")}})}getOfflineOrders(){this.localData.findAllOrders().pipe(_(this.destroy$)).subscribe({next:e=>{this.offlineOrders=e},error:e=>{this.toastr.error(e.message,"Error!")}})}getFailedOrders(){this.localData.getFailedOrders().pipe(_(this.destroy$)).subscribe({next:e=>{this.failedOrders=e},error:e=>{this.toastr.error(e.message,"Error!")}})}uploadFailedOrder(e){this.localData.uploadFailedOrder(e).pipe(_(this.destroy$)).subscribe({next:()=>{this.toastr.success("Successfully uploaded order "+e.Order.Number,"Sync Successful!"),this.getFailedOrders()},error:()=>{this.toastr.error("Failed to sync failed order "+e.Order.Number,"Error!")}})}removeFailedOrder(e){this.localData.removeFailedOrder(e.id).pipe(_(this.destroy$)).subscribe({next:d=>{this.toastr.success("Success to remove failed offline order","Error!"),this.getFailedOrders()},error:d=>{this.toastr.error("Failed to remove failed offline order","Error!")}})}uploadOrders(){this.localData.uploadOrders().pipe(_(this.destroy$)).subscribe({next:e=>{e?this.getOfflineOrders():(this.getOfflineOrders(),this.getFailedOrders())},error:e=>{this.getOfflineOrders(),this.getFailedOrders()}})}convertToCsv(){this.csvConverter.convertToCSV(this.getExportData(),"Fail_Transaction.csv")}getExportData(){let e=[["Number","Date","Item","Qty","Price","Total"]];return this.failedOrders.forEach(d=>{d.Items.forEach(l=>{let h=d.Order.Number.toString(),I=d.Order.Date.toLocaleString(),W=l.Quantity.toString(),re=l.Price.toString(),oe=(l.Quantity*l.UnitQuantity*(l.Price*(1-l.Discount/100))-l.DiscountAmount).toString(),ae=[h,I,l.Variant.Name,W,re,oe];e.push(ae)})}),e}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(d){return new(d||t)(f(j),f(L),f(Q),f(Z),f(X),f(Y))};static \u0275cmp=w({type:t,selectors:[["pos-orders"]],standalone:!1,features:[$],decls:52,vars:8,consts:[[3,"pageData","hideSearchDropdown","hideSearchBox"],["matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6"],["value","Send Transaction","matTooltipPosition","above","matTooltip","Send Transaction",1,"btn","btn-outline-secondary"],[1,"container-fluid"],[1,"row","mt-10","mb-12"],[1,"col-md"],[1,"table","mt-5"],[1,"thead-light","sticky-top-thead"],[1,"border-end",2,"width","130px"],[1,"border-end",2,"width","90px"],[1,"border-end"],[1,"border-end","text-end",2,"width","103px"],[1,"border-end","text-end",2,"width","200px"],[1,"text-center",2,"width","90px"],["colspan","7"],[1,"row","mt-12"],[1,"border-end",2,"width","102px"],["colSpan","5"],["matTooltipPosition","above","matTooltip","Export",1,"btn","btn-outline-secondary","me-6",3,"click"],["aria-hidden","true",1,"fa","fa-upload"],["value","Send Transaction","matTooltipPosition","above","matTooltip","Send Transaction",1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa","fa-paper-plane"],[1,"list-unstyled","text-start"],[1,"list-unstyled","text-end"],[1,"text-center","text-danger"],[1,"fa-solid","fa-xmark","fa-2x","cursor-pointer",3,"click"],[1,"text-center","mt-2"],[1,"list-inline","text-start"],[1,"text-danger"],[1,"d-flex","justify-content-center"],["matTooltipPosition","above","matTooltip","Sync",1,"ms-2","me-2","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa-solid","fa-cloud-arrow-up","text-primary","fa-2x"],["matTooltipPosition","above","matTooltip","Remove",1,"ms-5","cursor-pointer"],["matTooltipPosition","above","matTooltip","Remove",1,"ms-5","cursor-pointer",3,"click"],["aria-hidden","true",1,"fa-regular","fa-xmark-circle","text-primary","fa-2x"]],template:function(d,l){d&1&&(n(0,"mainpanel-cmp",0)(1,"actions"),s(2,ue,3,0,"a",1),s(3,_e,3,0,"a",2),i(),n(4,"content")(5,"div",3)(6,"div",4)(7,"div",5)(8,"h5"),r(9,"Offline Orders"),i(),n(10,"i"),r(11,"Waiting to be uploaded to the server!"),i(),n(12,"table",6)(13,"thead",7)(14,"tr")(15,"th",8),r(16,"Number"),i(),n(17,"th",9),r(18,"Date"),i(),n(19,"th",10),r(20,"item"),i(),n(21,"th",11),r(22,"Qty"),i(),n(23,"th",12),r(24,"Price"),i(),n(25,"th",12),r(26,"Total"),i(),s(27,fe,3,0,"th",13),i()(),n(28,"tbody"),s(29,De,2,0)(30,Te,3,0,"td",14),i()()()(),n(31,"div",15)(32,"div",5)(33,"h5"),r(34,"Synchronization Errors"),i(),n(35,"i"),r(36,"Exception occured when trying to upload these orders"),i(),n(37,"table",6)(38,"thead",7)(39,"tr")(40,"th",9),r(41,"Number"),i(),n(42,"th",9),r(43,"Date"),i(),n(44,"th",10),r(45,"item"),i(),n(46,"th",10),r(47,"Sync exception"),i(),O(48,"th",16),i()(),n(49,"tbody"),s(50,$e,2,0)(51,ke,3,0,"td",17),i()()()()()()()),d&2&&(k("pageData",l.menuData)("hideSearchDropdown",!0)("hideSearchBox",!0),o(2),m((l.failedOrders==null?null:l.failedOrders.length)>0?2:-1),o(),m(l.offlineOrders.length>0?3:-1),o(24),m(l.roleService.sell.Delete?27:-1),o(2),m(l.offlineOrders.length>0?29:30),o(21),m(l.failedOrders.length>0?50:51))},dependencies:[R,N,V],styles:[".cursor-pointer[_ngcontent-%COMP%]{cursor:pointer}"]})};function Ve(t,a){if(t&1&&(n(0,"div",1),O(1,"i",5),r(2),u(3,"date"),i()),t&2){let e=c();o(2),p(" ",T(3,1,e.LastSync,"dd MMM yyyy HH:mm:ss")," ")}}function Ne(t,a){if(t&1&&(n(0,"tr")(1,"td",12),r(2),i(),n(3,"td",13),r(4),i(),n(5,"td"),r(6),i(),n(7,"td",9),r(8),u(9,"number"),i()()),t&2){let e=a.$implicit,d=c(2);o(2),S(e.ID),o(2),S(e.Name),o(2),S(e.Code),o(2),q(" ",d.currency," ",T(9,5,e.UnitPrice,"1.0-4")," ")}}function Le(t,a){if(t&1&&(n(0,"table",3)(1,"thead",6)(2,"tr",7)(3,"th",8),r(4,"ID"),i(),n(5,"th",8),r(6,"Name"),i(),n(7,"th",8),r(8,"Code"),i(),n(9,"th",9),r(10,"Unit Price"),i()()(),n(11,"tbody"),v(12,Ne,10,8,"tr",null,x),u(14,"sortBy"),i(),n(15,"tfoot")(16,"tr",10)(17,"td",11)(18,"strong"),r(19),u(20,"number"),i()()()()()),t&2){let e=c();o(12),C(J(14,1,e.variantList,"asc","Name")),o(7),p("",b(20,5,e.variantList.length)," Product ")}}function Be(t,a){t&1&&(n(0,"h3",4),r(1,"Product has not been synced yet!"),i())}var A=class t extends B{constructor(e,d,l){super(e);this.httpService=d;this._localDataService=l;this.destroy$=new F}variantList=[];OriginalList=[];LastSync;currency;destroy$;ngOnInit(){this.menuData$.subscribe(e=>{this.getVariants(),this.getSyncDate(),this.getCurrency()})}getVariants(){this._localDataService.findAllVariant().pipe(_(this.destroy$)).subscribe({next:e=>{this.OriginalList=e,this.variantList=this.OriginalList},error:e=>{console.error(e)}})}getSyncDate(){this._localDataService.getSyncTime().pipe(_(this.destroy$)).subscribe(e=>{this.LastSync=new Date(e.time)})}getCurrency(){this._localDataService.getPOSStorage().pipe(_(this.destroy$)).subscribe(e=>{e&&(this.currency=e.Currencies[0].Symbol)})}filterList(e){this.variantList=this.OriginalList.filter(d=>d.Name.includes(e))}ngOnDestroy(){this.destroy$.next(!0),this.destroy$.complete()}static \u0275fac=function(d){return new(d||t)(f(j),f(L),f(Q))};static \u0275cmp=w({type:t,selectors:[["pos-products"]],standalone:!1,features:[$],decls:7,vars:4,consts:[[3,"textChange","pageData","hideSearchDropdown"],[1,"h5"],[1,"container-fluid","mt-5"],["id","tableGrid",1,"table"],[1,"text-center","mt-4"],[1,"fa-solid","fa-sync-alt"],[1,"thead-light","sticky-top-thead"],[1,"header"],[1,"text-start"],[1,"text-end"],[1,"table-footer"],["colspan","4",1,"text-start","empty-column"],[2,"max-width","100px"],[2,"max-width","300px"]],template:function(d,l){d&1&&(n(0,"mainpanel-cmp",0),y("textChange",function(I){return l.filterList(I)}),n(1,"actions"),s(2,Ve,4,4,"div",1),i(),n(3,"content")(4,"div",2),s(5,Le,21,7,"table",3)(6,Be,2,0,"h3",4),i()()()),d&2&&(k("pageData",l.menuData)("hideSearchDropdown",!0),o(2),m(l.LastSync?2:-1),o(3),m(l.variantList.length>0?5:6))},dependencies:[R,N,V,ee],encapsulation:2})};var je=[{path:"Products",component:A},{path:"Orders",component:H},{path:"**",redirectTo:"Products",pathMatch:"full"}],U=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=M({type:t});static \u0275inj=P({imports:[z.forChild(je),z]})};var ne=class t{static \u0275fac=function(e){return new(e||t)};static \u0275mod=M({type:t});static \u0275inj=P({imports:[K,U,ie,te]})};export{ne as OfflineModule};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as J}from"./chunk-
|
|
1
|
+
import{c as J}from"./chunk-SRAJGU6Y.js";import{a as G}from"./chunk-OOKDKXRB.js";import"./chunk-H6UWRJHQ.js";import"./chunk-L6PKNRWO.js";import"./chunk-SIQZO2WM.js";import{e as q,f as z}from"./chunk-YVO66RJF.js";import"./chunk-5QMBTXFS.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-6P2ASCNY.js";import"./chunk-PFF34SZG.js";import{b as A}from"./chunk-V3FPQMVB.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import"./chunk-26YFRPR2.js";import{b as j,c as k}from"./chunk-JBS5UYZC.js";import"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-S7FOJJP2.js";import"./chunk-FU2ZGMX4.js";import"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import{F as W,h as B,o as H}from"./chunk-DWZ5JTI2.js";import"./chunk-Y7D34HYN.js";import"./chunk-P6DRDJVZ.js";import"./chunk-36GWLMZX.js";import"./chunk-WFQIMZGL.js";import"./chunk-WUV22SZ4.js";import"./chunk-6UC76HYF.js";import{p as V,s as R}from"./chunk-LGOSIAUC.js";import{Bb as x,Db as M,Eb as w,Fb as d,Fc as C,Gb as i,Gc as F,Hb as n,Hc as T,Lc as E,Pb as v,Sb as N,Ub as S,Xa as l,eb as c,hc as o,ib as D,ic as u,mb as y,mc as _,nc as b,ob as I,oc as h,qd as P,sd as L,ta as p,ua as s,vd as O}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";function U(r,g){if(r&1){let e=v();i(0,"div")(1,"div",9)(2,"h6"),o(3,"Outlet"),n(),i(4,"outlet-selector",10),h("ngModelChange",function(t){p(e);let m=S();return b(m.pageData.Filter.ListIDs,t)||(m.pageData.Filter.ListIDs=t),s(t)}),n()()()}if(r&2){let e=S();l(4),d("accessType",2),_("ngModel",e.pageData.Filter.ListIDs),d("multiple",!0)}}function X(r,g){if(r&1&&(i(0,"tr")(1,"td"),o(2),n(),i(3,"td"),o(4),C(5,"number"),n(),i(6,"td"),o(7),C(8,"date"),n()()),r&2){let e=g.$implicit;l(2),u(e==null?null:e.EntityName),l(2),u(F(5,3,e==null?null:e.Number)),l(3),u(T(8,5,e==null?null:e.Modified,"dd MMM yyyy HH:mm"))}}var K=class r extends G{constructor(e,a,t){super(e,a,"Setup/Data/TransactionInvoiceNumber",null,t);this.httpService=a}preGetList(){let e=this.pageData.Filter?.ListIDs?this.pageData.Filter?.ListIDs:[];this.pageData.Filter={ListIDs:e}}static \u0275fac=function(a){return new(a||r)(c(A),c(R),c(V))};static \u0275cmp=D({type:r,selectors:[["app-invoice-numbering"]],features:[y],decls:19,vars:4,consts:[["pageFilterTemplate",""],[3,"onSubmit","filterChange","pageData","isFilterOnDropdown","hideSearchBox","filter"],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[1,"header"],["matTooltip","Next invoice number index to be generated",2,"width","200px"],[2,"width","200px"],[1,"dialog-filter"],["placeholder","Choose Outlet",3,"ngModelChange","accessType","ngModel","multiple"]],template:function(a,t){if(a&1){let m=v();i(0,"mainpanel-cmp",1),N("onSubmit",function(){return p(m),s(t.searchFromPageOne())}),h("filterChange",function(f){return p(m),b(t.pageData.Filter,f)||(t.pageData.Filter=f),s(f)}),i(1,"filters"),I(2,U,5,3,"ng-template",null,0,E),n(),i(4,"content")(5,"div",2)(6,"div",3)(7,"table",4)(8,"thead",5)(9,"tr",6)(10,"th"),o(11,"Outlet"),n(),i(12,"th",7),o(13," Next Number "),n(),i(14,"th",8),o(15,"Modified"),n()()(),i(16,"tbody"),M(17,X,9,8,"tr",null,x),n()()()()()()}a&2&&(d("pageData",t.menuData)("isFilterOnDropdown",!1)("hideSearchBox",!0),_("filter",t.pageData.Filter),l(17),w(t.data==null?null:t.data.Data))},dependencies:[O,z,q,J,W,B,H,k,j,L,P],encapsulation:2})};export{K as InvoiceNumberingComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as O,b as Ve}from"./chunk-PS7477UG.js";import"./chunk-GDRHD33K.js";import{c as Fe}from"./chunk-NSNUUKNK.js";import{c as Ee}from"./chunk-SFXDXOSB.js";import"./chunk-L6PKNRWO.js";import"./chunk-SIQZO2WM.js";import{e as Oe,f as Pe}from"./chunk-LNZY3GKF.js";import"./chunk-7V2CY4DW.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-QE5OFO56.js";import{a as Te,b as ve}from"./chunk-KJF3M7DY.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import"./chunk-26YFRPR2.js";import{b as ye,c as Se}from"./chunk-JBS5UYZC.js";import{N as we}from"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-S7FOJJP2.js";import"./chunk-FU2ZGMX4.js";import"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import{F as xe,h as De,o as be}from"./chunk-DWZ5JTI2.js";import"./chunk-743523SK.js";import"./chunk-46D5QBZT.js";import"./chunk-36GWLMZX.js";import{b as Z}from"./chunk-WFQIMZGL.js";import{a as fe}from"./chunk-WUV22SZ4.js";import"./chunk-SO3RL6QR.js";import"./chunk-LGOSIAUC.js";import{$ as Y,Ab as u,Ac as he,Cb as de,Db as pe,Eb as ce,Fb as p,Fc as c,Gb as o,Gc as v,Ha as re,Hb as r,Hc as _,Ib as y,Lc as w,Ob as B,Pb as T,Qd as Ce,Sb as V,Sd as ge,Tc as ue,Ub as d,Xa as l,Y as P,Ya as le,aa as E,cc as g,eb as F,gd as j,hc as s,ib as A,ic as W,jc as C,kc as me,mb as se,mc as Q,nc as X,nd as L,ob as S,oc as ee,od as M,pb as k,qd as _e,sd as G,t as D,ta as b,tb as R,ua as x,ub as N,vd as $,wc as U,xc as f,yb as h,yc as I,zc as te}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as ne,b as oe}from"./chunk-SNAKHGZS.js";var H=class{Cost;Profit;Sales;SalesWithTax;Tax;Count;TopOutlet};var ae=t=>({"border-bottom":t}),ie=()=>["/menu/Reports/Sales_Report/Standard/Summary"],Be=(t,a,e)=>({From:t,To:a,ListIDs:e}),Le=t=>({today:t}),We=(t,a)=>({From:t,To:a});function $e(t,a){if(t&1){let e=T();o(0,"div",6)(1,"a",15),s(2),r(),o(3,"ul",16)(4,"li")(5,"a",17),V("click",function(){b(e);let n=d();return n.isTodayFilter=!n.isTodayFilter,x(n.onChangeFilterPeriod())}),s(6),r()()()()}if(t&2){let e=d();l(2),C(" ",e.isTodayFilter?"Today":"Last 7 Days"," "),l(),p("ngClass",I(3,Le,!e.isTodayFilter)),l(3),C(" ",e.isTodayFilter?"Last 7 Days":"Today"," ")}}function He(t,a){t&1&&(o(0,"span",7),s(1,"Today"),r())}function Ye(t,a){if(t&1&&(o(0,"div",18)(1,"a",9),c(2,"date"),c(3,"date"),o(4,"div",10),s(5,"Tax"),r(),o(6,"div",19)(7,"small",20),s(8),r(),o(9,"h2",11),s(10),c(11,"number"),r()()()(),o(12,"div",8)(13,"a",9),c(14,"date"),c(15,"date"),o(16,"div",10),s(17,"Sales + Tax"),r(),o(18,"div",19)(19,"small",20),s(20),r(),o(21,"h2",11),s(22),c(23,"number"),r()()()()),t&2){let e=d();l(),p("routerLink",f(27,ie))("queryParams",te(28,We,_(2,9,e.isTodayFilter?e.today:e.chartData==null?null:e.chartData.From,"yyyy-MM-dd"),_(3,12,e.isTodayFilter?e.today:e.dateTo,"yyyy-MM-dd"))),l(7),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(11,15,e.salesData==null?null:e.salesData.Tax,"1.0-0")," "),l(2),p("ngClass",I(31,ae,e.role.product.Cost)),l(),p("routerLink",f(33,ie))("queryParams",te(34,We,_(14,18,e.isTodayFilter?e.today:e.chartData==null?null:e.chartData.From,"yyyy-MM-dd"),_(15,21,e.isTodayFilter?e.today:e.dateTo,"yyyy-MM-dd"))),l(7),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(23,24,e.salesData==null?null:e.salesData.SalesWithTax,"1.0-0")," ")}}function Ue(t,a){if(t&1&&(o(0,"div",8)(1,"div")(2,"div",21),s(3,"Cost"),r(),o(4,"div",19)(5,"small",20),s(6),r(),o(7,"h2",11),s(8),c(9,"number"),r()()()()),t&2){let e=d();p("ngClass",I(6,ae,e.role.report.Profit)),l(6),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(9,3,e.salesData==null?null:e.salesData.Cost,"1.0-0")," ")}}function je(t,a){if(t&1&&(o(0,"div",12)(1,"div")(2,"div",22),s(3),r(),o(4,"div",23)(5,"small",20),s(6),r(),o(7,"h2",11),s(8),c(9,"number"),r()()()()),t&2){let e=d();l(3),C(" ",e.includeTax?"Gross Profit":"Profit"," "),l(3),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(9,3,e.salesData==null?null:e.salesData.Profit,"1.0-0")," ")}}var K=class t{constructor(a,e){this.dashboardService=a;this.role=e;this.chartConfig=this.dashboardService.getLineChartConfig()}chartData;salesData;dashboardConfig;filterSalesWidget=new le;chartConfig;todaySalesData;weeklySalesData;isTodayFilter=!0;showPeriodFilter;includeTax;today=new Date;dateTo;filterByOutletIds=ue([]);ngOnChanges(a){if(a.chartData&&a.chartData.currentValue){this.initSalesData();let e=a?.chartData?.currentValue?.Series;e=this.setChartLineColor(e),e=this.setSalesTaxLegend(e),this.chartConfig=oe(ne({},this.chartConfig),{series:e}),this.chartConfig=this.dashboardService.setSeriesPointStart(this.chartData.From,this.chartConfig),this.initPeriodFilter(e),this.getDateTo()}}initPeriodFilter(a){this.showPeriodFilter=a[0]?.data?.length>=7}initSalesData(){this.salesData=new H,this.includeTax=this.isIncludeTax(),this.salesData.Sales=this.dashboardService.getTotalData("Sales",this.chartData.Series,1),this.salesData.SalesWithTax=this.dashboardService.getTotalData("Sales + Tax",this.chartData.Series,1),this.salesData.Cost=this.dashboardService.getTotalData("Cost",this.chartData.Series,1),this.salesData.Tax=this.salesData.SalesWithTax-this.salesData.Sales,this.salesData.Profit=(this.includeTax?this.salesData.SalesWithTax:this.salesData.Sales)-this.salesData.Cost,this.salesData.Count=this.dashboardService.getTotalData("Count",this.chartData.Series,1),this.todaySalesData=Fe(H,this.salesData)}setChartLineColor(a=[]){return a?.map(e=>(e.name=="Sales"&&(e.color="rgb(44, 175, 254)",e.fillColor=this.dashboardService.getLinierGradient("rgb(44, 175, 254)")),e.name=="Cost"&&(e.color="#fb404b",e.fillColor=this.dashboardService.getLinierGradient("#fb404b")),e.name=="Sales + Tax"&&(e.color="#2ECC71",e.fillColor=this.dashboardService.getLinierGradient("#2ECC71")),e))}onChangeFilterPeriod(){this.isTodayFilter?this.salesData=this.todaySalesData:(this.generateWeeklySalesData(),this.salesData=this.weeklySalesData),this.filterSalesWidget.emit({period:this.isTodayFilter?"TODAY":"WEEKLY"})}getDateTo(){let a=new Date,e=new Date(this.chartData.From);a.setDate(e.getDate()+7),this.dateTo=a}generateWeeklySalesData(){if(fe.IsEmpty(this.weeklySalesData)){let a=this.dashboardService.getTotalData("Sales",this.chartData.Series,7),e=this.dashboardService.getTotalData("Sales + Tax",this.chartData.Series,7),i=this.dashboardService.getTotalData("Cost",this.chartData.Series,7),n=this.dashboardService.getTotalData("Count",this.chartData.Series,7),m=e-a,z=(this.includeTax?e:a)-i;this.weeklySalesData=this.weeklySalesData?this.weeklySalesData:new H,this.weeklySalesData.Sales=a,this.weeklySalesData.SalesWithTax=e,this.weeklySalesData.Cost=i,this.weeklySalesData.Profit=z,this.weeklySalesData.Tax=m,this.weeklySalesData.Count=n}}isIncludeTax(){let a=this.chartData.Series;return this.dashboardService.filterSeriesByName("Sales + Tax",a).visible}setSalesTaxLegend(a){return a=a.map(e=>(e.name=="Sales + Tax"&&(e.showInLegend=this.salesData.Tax>0),e)),a}static \u0275fac=function(e){return new(e||t)(F(O),F(Z))};static \u0275cmp=A({type:t,selectors:[["app-sales-widget"]],inputs:{chartData:"chartData",dashboardConfig:"dashboardConfig",filterByOutletIds:[1,"filterByOutletIds"]},outputs:{filterSalesWidget:"onFilter"},features:[U([O]),re],decls:25,vars:30,consts:[[1,"d-flex","flex-row","flex-wrap","mt-8","justify-content-between"],[1,"chart-widget"],["containerId","salesChart",3,"config"],[1,"sales-card-widget"],[1,"border","rounded","rounded-bottom-0","px-8","py-4","w-100","h-auto"],[1,"border-bottom","d-flex","align-items-center","justify-content-end",2,"height","42px"],[1,"btn-group"],[1,"link-dark","fs-2","headings-font-family"],[1,"text-end","card-row","d-flex","align-items-center","justify-content-end",3,"ngClass"],["target","_blank",1,"link-dark",3,"routerLink","queryParams"],[1,"fs-5"],[1,"fw-normal"],[1,"text-end","d-flex","align-items-center","justify-content-end","card-row"],[1,"card-footer","border","rounded-bottom","border-top-0","text-end","p-3"],["routerLink","/menu/Setup/Configuration/Application"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"dropdown-toggle","link-dark","fs-2","headings-font-family"],[1,"dropdown-menu","p-0",2,"position","absolute","right","20px !important",3,"ngClass"],["role","button",1,"dropdown-item","fs-4",3,"click"],[1,"text-end","border-bottom","card-row","d-flex","align-items-center","justify-content-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"me-2"],[1,"fs-5","text-danger"],[1,"fs-5","text-success"],[1,"d-flex","align-items-center"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"div",1),y(2,"app-chart-container",2),r(),o(3,"div",3)(4,"div",4)(5,"div",5),h(6,$e,7,5,"div",6)(7,He,2,0,"span",7),r(),o(8,"div",8)(9,"a",9),c(10,"date"),c(11,"date"),o(12,"div",10),s(13,"Order"),r(),o(14,"h2",11),s(15),c(16,"number"),r()()(),h(17,Ye,24,37),h(18,Ue,10,8,"div",8),h(19,je,10,6,"div",12),r(),o(20,"div",13)(21,"a",14)(22,"small"),s(23),c(24,"date"),r()()()()()),e&2&&(l(2),p("config",i.chartConfig),l(4),u(!(i.role==null||i.role.dashboard==null)&&i.role.dashboard.View&&i.showPeriodFilter?6:7),l(2),p("ngClass",I(23,ae,(i.salesData==null?null:i.salesData.Tax)||i.role.product.Cost)),l(),p("routerLink",f(25,ie))("queryParams",he(26,Be,_(10,11,i.isTodayFilter?i.today:i.chartData==null?null:i.chartData.From,"yyyy-MM-dd"),_(11,14,i.isTodayFilter?i.today:i.dateTo,"yyyy-MM-dd"),i.filterByOutletIds())),l(6),W(_(16,17,i.salesData==null?null:i.salesData.Count,"1.0-0")),l(2),u((i.salesData==null?null:i.salesData.Tax)>0?17:-1),l(),u(i.role.product.Cost?18:-1),l(),u(i.role.report.Profit&&i.role.product.Cost?19:-1),l(4),me("",_(24,20,i.dashboardConfig==null?null:i.dashboardConfig.SpanConfigTime,"dd MMM HH:mm")," ",i.dashboardConfig==null?null:i.dashboardConfig.SmallTimeZone))},dependencies:[$,j,Ve,ge,Ce,we,G,_e],styles:[".chart-widget[_ngcontent-%COMP%]{width:80%}.link-dark[_ngcontent-%COMP%]{color:#333!important}.dropdown-menu.show.today[_ngcontent-%COMP%]{inset:0 auto auto -34px!important}.sales-card-widget[_ngcontent-%COMP%]{width:19%}.sales-card-widget[_ngcontent-%COMP%] .card-row[_ngcontent-%COMP%]{height:64px}@media only screen and (max-width: 767px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}@media only screen and (min-width: 768px) and (max-width: 991px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}"]})};var Ge=t=>({active:t});function Ze(t,a){if(t&1&&(o(0,"div",1),s(1),r(),o(2,"div",2)(3,"small",3),s(4),r(),o(5,"h2",4),s(6),r()()),t&2){let e=d();l(),W(e.title),l(3),W(e.currencySymbol),l(2),W(e.value)}}function Ke(t,a){if(t&1&&(o(0,"div",1),s(1),r(),o(2,"h2",4),s(3,"-"),r()),t&2){let e=d();l(),W(e.title)}}var q=class t{title;isActive;currencySymbol;value;showValue;constructor(){}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=A({type:t,selectors:[["app-card-widget"]],inputs:{title:"title",isActive:"isActive",currencySymbol:"currencySymbol",value:"value",showValue:"showValue"},decls:3,vars:4,consts:[[1,"card-widget","pe-0",3,"ngClass"],[1,"fs-4","headings-font-family"],[1,"d-flex","justify-content-start","align-items-center"],[1,"fw-normal","me-2"],[1,"fw-normal"]],template:function(e,i){e&1&&(o(0,"div",0),h(1,Ze,7,3)(2,Ke,4,1),r()),e&2&&(p("ngClass",I(2,Ge,i.isActive)),l(),u(i.showValue?1:2))},dependencies:[$,j],styles:[".card-widget[_ngcontent-%COMP%]{padding:20px;border-radius:6px;min-height:95px;border:.5px solid #e4e4e4;width:100%}.active[_ngcontent-%COMP%]{background-color:#f0f0f0}@media only screen and (max-width: 767px){.card-widget[_ngcontent-%COMP%]{width:200px}}@media only screen and (min-width: 768px) and (max-width: 991px){.card-widget[_ngcontent-%COMP%]{width:200px}}"]})};var qe=()=>[L,import("./chunk-VZUPDSBH.js").then(t=>t.PaymentWidgetComponent),M],ze=()=>[L,import("./chunk-3CSCTT6I.js").then(t=>t.PurchaseWidgetComponent),M],Je=()=>[L,import("./chunk-PQ6W7KXC.js").then(t=>t.DebtWidgetComponent),M],Qe=()=>[L,import("./chunk-2MPRVJXH.js").then(t=>t.ProductWidgetComponent),M],Xe=()=>[L,import("./chunk-WM2DGNWH.js").then(t=>t.InventoryWidgetComponent),M],et=()=>({role:"Payment View Role"}),tt=()=>({role:"Buy Report Role"}),it=()=>({role:"Debt View Role"}),at=()=>({role:"Report View Role"}),nt=()=>({role:"Inventory View Role"});function ot(t,a){if(t&1){let e=T();o(0,"div",13)(1,"h6"),s(2,"Outlet"),r(),o(3,"outlet-selector",14),ee("ngModelChange",function(n){b(e);let m=d();return X(m.dashboardFilter.Outlets,n)||(m.dashboardFilter.Outlets=n),x(n)}),r()()}if(t&2){let e=d();l(3),p("multiple",!0)("accessType",e.outletAccess),Q("ngModel",e.dashboardFilter.Outlets)}}function rt(t,a){if(t&1){let e=T();o(0,"div",19),V("click",function(){let n=b(e).$implicit,m=d(2);return x(m.onClickCardWidget(n))}),y(1,"app-card-widget",20),c(2,"number"),r()}if(t&2){let e=a.$implicit,i=d(),n=d();l(),p("title",e.title)("matTooltip",e.tooltip)("currencySymbol",i==null||i.ConfigData==null?null:i.ConfigData.CurrencySymbol)("value",e.value==null?"-":_(2,6,e.value,"1.0-0"))("showValue",e.showValue)("isActive",e.id==n.activeTab)}}function lt(t,a){if(t&1){let e=T();o(0,"app-sales-widget",21),V("onFilter",function(n){b(e);let m=d(2);return x(m.onFilterSalesWidget(n))}),r()}if(t&2){let e=d(),i=d();p("dashboardConfig",e==null?null:e.ConfigData)("chartData",e==null?null:e.HighChartData)("filterByOutletIds",i.dashboardFilter.Outlets)}}function st(t,a){t&1&&B(0)}function dt(t,a){if(t&1){let e=T();o(0,"app-payment-widget",23),c(1,"async"),V("onFilter",function(n){b(e);let m=d(4);return x(m.onFilterPaymentWidget(n))}),r()}if(t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("chartData",(e=v(1,2,n.paymentData$))==null?null:e.Data)}}function pt(t,a){if(t&1&&S(0,st,1,0,"ng-container",22)(1,dt,2,4,"ng-template",null,2,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.payment.View?e:n)("ngTemplateOutletContext",f(2,et))}}function ct(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function mt(t,a){t&1&&(k(0,pt,3,3)(1,ct,2,0),R(2,0,qe,null,1),N(0,-1))}function ht(t,a){t&1&&B(0)}function ut(t,a){if(t&1&&(y(0,"app-purchase-widget",18),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("chartData",(e=v(1,3,n.purchaseData$))==null?null:e.HighChartData)("filterByOutletIds",n.dashboardFilter.Outlets)}}function _t(t,a){if(t&1&&S(0,ht,1,0,"ng-container",22)(1,ut,2,5,"ng-template",null,3,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.buy.Report?e:n)("ngTemplateOutletContext",f(2,tt))}}function Ct(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function gt(t,a){t&1&&(k(0,_t,3,3)(1,Ct,2,0),R(2,0,ze,null,1),N(0,-1))}function ft(t,a){t&1&&B(0)}function Dt(t,a){if(t&1&&(y(0,"app-debt-widget",25),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("debtData",(e=v(1,2,n.debtData$))==null?null:e.PageData)}}function bt(t,a){if(t&1&&S(0,ft,1,0,"ng-container",22)(1,Dt,2,4,"ng-template",null,4,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.debt.View?e:n)("ngTemplateOutletContext",f(2,it))}}function xt(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function yt(t,a){t&1&&(k(0,bt,3,3)(1,xt,2,0),R(2,0,Je,null,1),N(0,-1))}function St(t,a){t&1&&B(0)}function Tt(t,a){if(t&1&&(y(0,"app-product-widget",26),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("productData",(e=v(1,2,n.productData$))==null?null:e.PageData)}}function vt(t,a){if(t&1&&S(0,St,1,0,"ng-container",22)(1,Tt,2,4,"ng-template",null,5,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.report.View?e:n)("ngTemplateOutletContext",f(2,at))}}function wt(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function Ot(t,a){t&1&&(k(0,vt,3,3)(1,wt,2,0),R(2,0,Qe,null,1),N(0,-1))}function Pt(t,a){t&1&&B(0)}function Et(t,a){if(t&1&&(y(0,"app-inventory-widget",27),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("inventoryData",(e=v(1,2,n.inventoryData$))==null?null:e.PageData)}}function Ft(t,a){if(t&1&&S(0,Pt,1,0,"ng-container",22)(1,Et,2,4,"ng-template",null,6,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.inventory.View?e:n)("ngTemplateOutletContext",f(2,nt))}}function Vt(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function Wt(t,a){t&1&&(k(0,Ft,3,3)(1,Vt,2,0),R(2,0,Xe,null,1),N(0,-1))}function It(t,a){if(t&1&&(o(0,"div",12)(1,"div",15)(2,"div",16),pe(3,rt,3,9,"div",17,de),c(5,"async"),r(),h(6,lt,1,3,"app-sales-widget",18),h(7,mt,4,0),h(8,gt,4,0),h(9,yt,4,0),h(10,Ot,4,0),h(11,Wt,4,0),r()()),t&2){let e=d();l(3),ce(v(5,6,e.cardWidget$)),l(3),u(e.activeTab=="SALES"?6:-1),l(),u(e.activeTab=="PAYMENT"?7:-1),l(),u(e.activeTab=="PURCHASE"?8:-1),l(),u(e.activeTab=="DEBT"?9:-1),l(),u(e.activeTab=="PRODUCT"?10:-1),l(),u(e.activeTab=="INVENTORY"?11:-1)}}function Mt(t,a){if(t&1&&(o(0,"div",24)(1,"div",28)(2,"div"),y(3,"img",29),r(),o(4,"h1",30),s(5,"You are not authorized"),r(),o(6,"p"),s(7," This page requires role "),o(8,"span",31),s(9),r(),s(10," to be accessed. Please contact your Administrator to gain access! "),r()()()),t&2){let e=a.role;l(9),C("[",e,"]")}}var ke=class t extends Te{constructor(e,i,n){super(e);this.dashboardService=i;this.role=n;this.menuData$.subscribe(),this.initSalesData(),this.initCardWidget(),this.initPaymentData(),this.initPurchaseData(),this.initInventoryData(),this.initDebtData(),this.initProductData()}cardWidget$;outletAccess=2;dashboardFilter={Outlets:[]};salesData$;paymentData$;purchaseData$;debtData$;productData$;inventoryData$;activeTab="SALES";initSalesData(){this.salesData$=this.dashboardService.getDashboardSales(this.dashboardFilter).pipe(P(1))}initPaymentData(){this.paymentData$=this.dashboardService.getDashboardPayment(this.dashboardFilter).pipe(P(1))}initPurchaseData(){this.purchaseData$=this.dashboardService.getDashboardPurchase(this.dashboardFilter).pipe(P(1))}initDebtData(){this.debtData$=this.dashboardService.getDashboardDebt(this.dashboardFilter).pipe(P(1))}initProductData(){this.productData$=this.dashboardService.getDashboardProduct(this.dashboardFilter).pipe(P(1))}initInventoryData(){this.inventoryData$=this.dashboardService.getDashboardInventory(this.dashboardFilter).pipe(P(1))}initCardWidget(){switch(this.activeTab){case"SALES":this.cardWidget$=this.salesData$.pipe(D(e=>this.dashboardService.getTotalData("Sales",e.HighChartData.Series,1)),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break;case"PAYMENT":this.cardWidget$=this.paymentData$.pipe(D(e=>this.dashboardService.getTotalData("All",e.Data.Series,1)),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break;case"PURCHASE":this.cardWidget$=this.purchaseData$.pipe(D(e=>this.dashboardService.getTotalData("Purchase",e.HighChartData.Series,1)),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break;case"DEBT":this.cardWidget$=this.debtData$.pipe(D(e=>e.PageData.Receivable),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break}}onFilterByOutlet(){switch(this.activeTab){case"SALES":this.initSalesData(),this.initCardWidget();break;case"PURCHASE":this.initPurchaseData(),this.initCardWidget();break;case"DEBT":this.initDebtData(),this.initCardWidget();break;case"PRODUCT":this.initProductData();break;case"INVENTORY":this.initInventoryData();break;case"PAYMENT":this.initPaymentData();break}}onClickCardWidget(e){this.activeTab=e.id,this.initCardWidget()}onFilterSalesWidget(e){this.cardWidget$=this.salesData$.pipe(D(i=>e.period=="WEEKLY"?this.dashboardService.getTotalData("Sales",i.HighChartData.Series,7):this.dashboardService.getTotalData("Sales",i.HighChartData.Series,1)),E(i=>(this.dashboardService.setWidgetData(i,"SALES"),this.dashboardService.widgets$)),D(i=>i.map(n=>(n.id=="SALES"&&(n.tooltip=e.period=="TODAY"?"Total Sales Today":"Total Sales last 7 days"),n))))}onFilterPaymentWidget(e){this.cardWidget$=this.paymentData$.pipe(D(i=>e.period=="WEEKLY"?this.dashboardService.getTotalData("All",i.Data.Series,7):this.dashboardService.getTotalData("All",i.Data.Series,1)),E(i=>(this.dashboardService.setWidgetData(i,"PAYMENT"),this.dashboardService.widgets$)),D(i=>i.map(n=>(n.id=="PAYMENT"&&(n.tooltip=e.period=="TODAY"?"Total Payment Today":"Total Payment last 7 days"),n))))}static \u0275fac=function(i){return new(i||t)(F(ve),F(O),F(Z))};static \u0275cmp=A({type:t,selectors:[["POS-dashboard-v2"]],features:[U([O]),se],decls:13,vars:7,consts:[["pageFilterTemplate",""],["NOT_AUTHORIZED",""],["PAYMENT",""],["BUY",""],["DEBT",""],["PRODUCT",""],["INVENTORY",""],[3,"onSubmit","filterChange","hideSearchBox","pageData","isFilterOnDropdown","filter"],[1,"content"],[1,"container-fluid","bg-light-gray","p-8"],[1,"row"],[1,"col-12"],[1,"card","mb-0"],[1,"dialog-filter"],["appendTo","body","placeholder","Select Outlets",3,"ngModelChange","multiple","accessType","ngModel"],[1,"card-body"],[1,"d-flex","flex-row","flex-nowrap","justify-content-between","align-items-center","overflow-auto",2,"column-gap","18px"],[1,"cursor-pointer","card-widget-tab"],[3,"dashboardConfig","chartData","filterByOutletIds"],[1,"cursor-pointer","card-widget-tab",3,"click"],["matTooltipPosition","above",3,"title","matTooltip","currencySymbol","value","showValue","isActive"],[3,"onFilter","dashboardConfig","chartData","filterByOutletIds"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"onFilter","dashboardConfig","chartData"],[1,"d-flex","align-items-center","justify-content-center","mt-8",2,"height","350px"],[3,"dashboardConfig","debtData"],[3,"dashboardConfig","productData"],[3,"dashboardConfig","inventoryData"],[1,"text-center"],["src","https://cdn.dealpos.xyz/web-image/locked.svg",2,"width","160px"],[1,"mt-2","mb-6"],[1,"fw-bold"]],template:function(i,n){if(i&1){let m=T();o(0,"mainpanel-cmp",7),V("onSubmit",function(){return b(m),x(n.onFilterByOutlet())}),ee("filterChange",function(J){return b(m),X(n.dashboardFilter,J)||(n.dashboardFilter=J),x(J)}),o(1,"filters"),S(2,ot,4,3,"ng-template",null,0,w),r(),o(4,"content")(5,"div",8)(6,"div",9)(7,"div",10)(8,"div",11),h(9,It,12,8,"div",12),c(10,"async"),r()()()()()(),S(11,Mt,11,1,"ng-template",null,1,w)}if(i&2){let m;p("hideSearchBox",!0)("pageData",n.menuData)("isFilterOnDropdown",!1),Q("filter",n.dashboardFilter),l(9),u((m=v(10,5,n.salesData$))?9:-1,m)}},dependencies:[$,Pe,Oe,xe,De,be,K,q,Ee,Se,ye,M,G],styles:[".card-widget-tab[_ngcontent-%COMP%]{flex:1 1 0px}@media only screen and (max-width: 767px){.card-widget-tab[_ngcontent-%COMP%]{margin-right:1rem;margin-top:.5rem;width:auto}}@media only screen and (min-width: 768px) and (max-width: 991px){.card-widget-tab[_ngcontent-%COMP%]{margin-right:1rem;margin-top:.5rem;width:auto}}"]})};export{ke as DashboardV2Component};
|
|
1
|
+
import{a as O,b as Ve}from"./chunk-PS7477UG.js";import"./chunk-GDRHD33K.js";import{c as Fe}from"./chunk-NSNUUKNK.js";import{c as Ee}from"./chunk-SRAJGU6Y.js";import"./chunk-L6PKNRWO.js";import"./chunk-SIQZO2WM.js";import{e as Oe,f as Pe}from"./chunk-YVO66RJF.js";import"./chunk-5QMBTXFS.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-PFF34SZG.js";import{a as Te,b as ve}from"./chunk-V3FPQMVB.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import"./chunk-26YFRPR2.js";import{b as ye,c as Se}from"./chunk-JBS5UYZC.js";import{N as we}from"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-S7FOJJP2.js";import"./chunk-FU2ZGMX4.js";import"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import{F as xe,h as De,o as be}from"./chunk-DWZ5JTI2.js";import"./chunk-Y7D34HYN.js";import"./chunk-P6DRDJVZ.js";import"./chunk-36GWLMZX.js";import{b as Z}from"./chunk-WFQIMZGL.js";import{a as fe}from"./chunk-WUV22SZ4.js";import"./chunk-6UC76HYF.js";import"./chunk-LGOSIAUC.js";import{$ as Y,Ab as u,Ac as he,Cb as de,Db as pe,Eb as ce,Fb as p,Fc as c,Gb as o,Gc as v,Ha as re,Hb as r,Hc as _,Ib as y,Lc as w,Ob as B,Pb as T,Qd as Ce,Sb as V,Sd as ge,Tc as ue,Ub as d,Xa as l,Y as P,Ya as le,aa as E,cc as g,eb as F,gd as j,hc as s,ib as A,ic as W,jc as C,kc as me,mb as se,mc as Q,nc as X,nd as L,ob as S,oc as ee,od as M,pb as k,qd as _e,sd as G,t as D,ta as b,tb as R,ua as x,ub as N,vd as $,wc as U,xc as f,yb as h,yc as I,zc as te}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import{a as ne,b as oe}from"./chunk-SNAKHGZS.js";var H=class{Cost;Profit;Sales;SalesWithTax;Tax;Count;TopOutlet};var ae=t=>({"border-bottom":t}),ie=()=>["/menu/Reports/Sales_Report/Standard/Summary"],Be=(t,a,e)=>({From:t,To:a,ListIDs:e}),Le=t=>({today:t}),We=(t,a)=>({From:t,To:a});function $e(t,a){if(t&1){let e=T();o(0,"div",6)(1,"a",15),s(2),r(),o(3,"ul",16)(4,"li")(5,"a",17),V("click",function(){b(e);let n=d();return n.isTodayFilter=!n.isTodayFilter,x(n.onChangeFilterPeriod())}),s(6),r()()()()}if(t&2){let e=d();l(2),C(" ",e.isTodayFilter?"Today":"Last 7 Days"," "),l(),p("ngClass",I(3,Le,!e.isTodayFilter)),l(3),C(" ",e.isTodayFilter?"Last 7 Days":"Today"," ")}}function He(t,a){t&1&&(o(0,"span",7),s(1,"Today"),r())}function Ye(t,a){if(t&1&&(o(0,"div",18)(1,"a",9),c(2,"date"),c(3,"date"),o(4,"div",10),s(5,"Tax"),r(),o(6,"div",19)(7,"small",20),s(8),r(),o(9,"h2",11),s(10),c(11,"number"),r()()()(),o(12,"div",8)(13,"a",9),c(14,"date"),c(15,"date"),o(16,"div",10),s(17,"Sales + Tax"),r(),o(18,"div",19)(19,"small",20),s(20),r(),o(21,"h2",11),s(22),c(23,"number"),r()()()()),t&2){let e=d();l(),p("routerLink",f(27,ie))("queryParams",te(28,We,_(2,9,e.isTodayFilter?e.today:e.chartData==null?null:e.chartData.From,"yyyy-MM-dd"),_(3,12,e.isTodayFilter?e.today:e.dateTo,"yyyy-MM-dd"))),l(7),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(11,15,e.salesData==null?null:e.salesData.Tax,"1.0-0")," "),l(2),p("ngClass",I(31,ae,e.role.product.Cost)),l(),p("routerLink",f(33,ie))("queryParams",te(34,We,_(14,18,e.isTodayFilter?e.today:e.chartData==null?null:e.chartData.From,"yyyy-MM-dd"),_(15,21,e.isTodayFilter?e.today:e.dateTo,"yyyy-MM-dd"))),l(7),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(23,24,e.salesData==null?null:e.salesData.SalesWithTax,"1.0-0")," ")}}function Ue(t,a){if(t&1&&(o(0,"div",8)(1,"div")(2,"div",21),s(3,"Cost"),r(),o(4,"div",19)(5,"small",20),s(6),r(),o(7,"h2",11),s(8),c(9,"number"),r()()()()),t&2){let e=d();p("ngClass",I(6,ae,e.role.report.Profit)),l(6),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(9,3,e.salesData==null?null:e.salesData.Cost,"1.0-0")," ")}}function je(t,a){if(t&1&&(o(0,"div",12)(1,"div")(2,"div",22),s(3),r(),o(4,"div",23)(5,"small",20),s(6),r(),o(7,"h2",11),s(8),c(9,"number"),r()()()()),t&2){let e=d();l(3),C(" ",e.includeTax?"Gross Profit":"Profit"," "),l(3),C(" ",e.dashboardConfig==null?null:e.dashboardConfig.CurrencySymbol," "),l(2),C(" ",_(9,3,e.salesData==null?null:e.salesData.Profit,"1.0-0")," ")}}var K=class t{constructor(a,e){this.dashboardService=a;this.role=e;this.chartConfig=this.dashboardService.getLineChartConfig()}chartData;salesData;dashboardConfig;filterSalesWidget=new le;chartConfig;todaySalesData;weeklySalesData;isTodayFilter=!0;showPeriodFilter;includeTax;today=new Date;dateTo;filterByOutletIds=ue([]);ngOnChanges(a){if(a.chartData&&a.chartData.currentValue){this.initSalesData();let e=a?.chartData?.currentValue?.Series;e=this.setChartLineColor(e),e=this.setSalesTaxLegend(e),this.chartConfig=oe(ne({},this.chartConfig),{series:e}),this.chartConfig=this.dashboardService.setSeriesPointStart(this.chartData.From,this.chartConfig),this.initPeriodFilter(e),this.getDateTo()}}initPeriodFilter(a){this.showPeriodFilter=a[0]?.data?.length>=7}initSalesData(){this.salesData=new H,this.includeTax=this.isIncludeTax(),this.salesData.Sales=this.dashboardService.getTotalData("Sales",this.chartData.Series,1),this.salesData.SalesWithTax=this.dashboardService.getTotalData("Sales + Tax",this.chartData.Series,1),this.salesData.Cost=this.dashboardService.getTotalData("Cost",this.chartData.Series,1),this.salesData.Tax=this.salesData.SalesWithTax-this.salesData.Sales,this.salesData.Profit=(this.includeTax?this.salesData.SalesWithTax:this.salesData.Sales)-this.salesData.Cost,this.salesData.Count=this.dashboardService.getTotalData("Count",this.chartData.Series,1),this.todaySalesData=Fe(H,this.salesData)}setChartLineColor(a=[]){return a?.map(e=>(e.name=="Sales"&&(e.color="rgb(44, 175, 254)",e.fillColor=this.dashboardService.getLinierGradient("rgb(44, 175, 254)")),e.name=="Cost"&&(e.color="#fb404b",e.fillColor=this.dashboardService.getLinierGradient("#fb404b")),e.name=="Sales + Tax"&&(e.color="#2ECC71",e.fillColor=this.dashboardService.getLinierGradient("#2ECC71")),e))}onChangeFilterPeriod(){this.isTodayFilter?this.salesData=this.todaySalesData:(this.generateWeeklySalesData(),this.salesData=this.weeklySalesData),this.filterSalesWidget.emit({period:this.isTodayFilter?"TODAY":"WEEKLY"})}getDateTo(){let a=new Date,e=new Date(this.chartData.From);a.setDate(e.getDate()+7),this.dateTo=a}generateWeeklySalesData(){if(fe.IsEmpty(this.weeklySalesData)){let a=this.dashboardService.getTotalData("Sales",this.chartData.Series,7),e=this.dashboardService.getTotalData("Sales + Tax",this.chartData.Series,7),i=this.dashboardService.getTotalData("Cost",this.chartData.Series,7),n=this.dashboardService.getTotalData("Count",this.chartData.Series,7),m=e-a,z=(this.includeTax?e:a)-i;this.weeklySalesData=this.weeklySalesData?this.weeklySalesData:new H,this.weeklySalesData.Sales=a,this.weeklySalesData.SalesWithTax=e,this.weeklySalesData.Cost=i,this.weeklySalesData.Profit=z,this.weeklySalesData.Tax=m,this.weeklySalesData.Count=n}}isIncludeTax(){let a=this.chartData.Series;return this.dashboardService.filterSeriesByName("Sales + Tax",a).visible}setSalesTaxLegend(a){return a=a.map(e=>(e.name=="Sales + Tax"&&(e.showInLegend=this.salesData.Tax>0),e)),a}static \u0275fac=function(e){return new(e||t)(F(O),F(Z))};static \u0275cmp=A({type:t,selectors:[["app-sales-widget"]],inputs:{chartData:"chartData",dashboardConfig:"dashboardConfig",filterByOutletIds:[1,"filterByOutletIds"]},outputs:{filterSalesWidget:"onFilter"},features:[U([O]),re],decls:25,vars:30,consts:[[1,"d-flex","flex-row","flex-wrap","mt-8","justify-content-between"],[1,"chart-widget"],["containerId","salesChart",3,"config"],[1,"sales-card-widget"],[1,"border","rounded","rounded-bottom-0","px-8","py-4","w-100","h-auto"],[1,"border-bottom","d-flex","align-items-center","justify-content-end",2,"height","42px"],[1,"btn-group"],[1,"link-dark","fs-2","headings-font-family"],[1,"text-end","card-row","d-flex","align-items-center","justify-content-end",3,"ngClass"],["target","_blank",1,"link-dark",3,"routerLink","queryParams"],[1,"fs-5"],[1,"fw-normal"],[1,"text-end","d-flex","align-items-center","justify-content-end","card-row"],[1,"card-footer","border","rounded-bottom","border-top-0","text-end","p-3"],["routerLink","/menu/Setup/Configuration/Application"],["type","button","data-bs-toggle","dropdown","aria-expanded","false",1,"dropdown-toggle","link-dark","fs-2","headings-font-family"],[1,"dropdown-menu","p-0",2,"position","absolute","right","20px !important",3,"ngClass"],["role","button",1,"dropdown-item","fs-4",3,"click"],[1,"text-end","border-bottom","card-row","d-flex","align-items-center","justify-content-end"],[1,"d-flex","align-items-center","justify-content-end"],[1,"me-2"],[1,"fs-5","text-danger"],[1,"fs-5","text-success"],[1,"d-flex","align-items-center"]],template:function(e,i){e&1&&(o(0,"div",0)(1,"div",1),y(2,"app-chart-container",2),r(),o(3,"div",3)(4,"div",4)(5,"div",5),h(6,$e,7,5,"div",6)(7,He,2,0,"span",7),r(),o(8,"div",8)(9,"a",9),c(10,"date"),c(11,"date"),o(12,"div",10),s(13,"Order"),r(),o(14,"h2",11),s(15),c(16,"number"),r()()(),h(17,Ye,24,37),h(18,Ue,10,8,"div",8),h(19,je,10,6,"div",12),r(),o(20,"div",13)(21,"a",14)(22,"small"),s(23),c(24,"date"),r()()()()()),e&2&&(l(2),p("config",i.chartConfig),l(4),u(!(i.role==null||i.role.dashboard==null)&&i.role.dashboard.View&&i.showPeriodFilter?6:7),l(2),p("ngClass",I(23,ae,(i.salesData==null?null:i.salesData.Tax)||i.role.product.Cost)),l(),p("routerLink",f(25,ie))("queryParams",he(26,Be,_(10,11,i.isTodayFilter?i.today:i.chartData==null?null:i.chartData.From,"yyyy-MM-dd"),_(11,14,i.isTodayFilter?i.today:i.dateTo,"yyyy-MM-dd"),i.filterByOutletIds())),l(6),W(_(16,17,i.salesData==null?null:i.salesData.Count,"1.0-0")),l(2),u((i.salesData==null?null:i.salesData.Tax)>0?17:-1),l(),u(i.role.product.Cost?18:-1),l(),u(i.role.report.Profit&&i.role.product.Cost?19:-1),l(4),me("",_(24,20,i.dashboardConfig==null?null:i.dashboardConfig.SpanConfigTime,"dd MMM HH:mm")," ",i.dashboardConfig==null?null:i.dashboardConfig.SmallTimeZone))},dependencies:[$,j,Ve,ge,Ce,we,G,_e],styles:[".chart-widget[_ngcontent-%COMP%]{width:80%}.link-dark[_ngcontent-%COMP%]{color:#333!important}.dropdown-menu.show.today[_ngcontent-%COMP%]{inset:0 auto auto -34px!important}.sales-card-widget[_ngcontent-%COMP%]{width:19%}.sales-card-widget[_ngcontent-%COMP%] .card-row[_ngcontent-%COMP%]{height:64px}@media only screen and (max-width: 767px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}@media only screen and (min-width: 768px) and (max-width: 991px){.chart-widget[_ngcontent-%COMP%]{width:100%}.sales-card-widget[_ngcontent-%COMP%]{width:100%;margin-top:12px}}"]})};var Ge=t=>({active:t});function Ze(t,a){if(t&1&&(o(0,"div",1),s(1),r(),o(2,"div",2)(3,"small",3),s(4),r(),o(5,"h2",4),s(6),r()()),t&2){let e=d();l(),W(e.title),l(3),W(e.currencySymbol),l(2),W(e.value)}}function Ke(t,a){if(t&1&&(o(0,"div",1),s(1),r(),o(2,"h2",4),s(3,"-"),r()),t&2){let e=d();l(),W(e.title)}}var q=class t{title;isActive;currencySymbol;value;showValue;constructor(){}ngOnInit(){}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=A({type:t,selectors:[["app-card-widget"]],inputs:{title:"title",isActive:"isActive",currencySymbol:"currencySymbol",value:"value",showValue:"showValue"},decls:3,vars:4,consts:[[1,"card-widget","pe-0",3,"ngClass"],[1,"fs-4","headings-font-family"],[1,"d-flex","justify-content-start","align-items-center"],[1,"fw-normal","me-2"],[1,"fw-normal"]],template:function(e,i){e&1&&(o(0,"div",0),h(1,Ze,7,3)(2,Ke,4,1),r()),e&2&&(p("ngClass",I(2,Ge,i.isActive)),l(),u(i.showValue?1:2))},dependencies:[$,j],styles:[".card-widget[_ngcontent-%COMP%]{padding:20px;border-radius:6px;min-height:95px;border:.5px solid #e4e4e4;width:100%}.active[_ngcontent-%COMP%]{background-color:#f0f0f0}@media only screen and (max-width: 767px){.card-widget[_ngcontent-%COMP%]{width:200px}}@media only screen and (min-width: 768px) and (max-width: 991px){.card-widget[_ngcontent-%COMP%]{width:200px}}"]})};var qe=()=>[L,import("./chunk-VZUPDSBH.js").then(t=>t.PaymentWidgetComponent),M],ze=()=>[L,import("./chunk-3CSCTT6I.js").then(t=>t.PurchaseWidgetComponent),M],Je=()=>[L,import("./chunk-PQ6W7KXC.js").then(t=>t.DebtWidgetComponent),M],Qe=()=>[L,import("./chunk-2MPRVJXH.js").then(t=>t.ProductWidgetComponent),M],Xe=()=>[L,import("./chunk-WM2DGNWH.js").then(t=>t.InventoryWidgetComponent),M],et=()=>({role:"Payment View Role"}),tt=()=>({role:"Buy Report Role"}),it=()=>({role:"Debt View Role"}),at=()=>({role:"Report View Role"}),nt=()=>({role:"Inventory View Role"});function ot(t,a){if(t&1){let e=T();o(0,"div",13)(1,"h6"),s(2,"Outlet"),r(),o(3,"outlet-selector",14),ee("ngModelChange",function(n){b(e);let m=d();return X(m.dashboardFilter.Outlets,n)||(m.dashboardFilter.Outlets=n),x(n)}),r()()}if(t&2){let e=d();l(3),p("multiple",!0)("accessType",e.outletAccess),Q("ngModel",e.dashboardFilter.Outlets)}}function rt(t,a){if(t&1){let e=T();o(0,"div",19),V("click",function(){let n=b(e).$implicit,m=d(2);return x(m.onClickCardWidget(n))}),y(1,"app-card-widget",20),c(2,"number"),r()}if(t&2){let e=a.$implicit,i=d(),n=d();l(),p("title",e.title)("matTooltip",e.tooltip)("currencySymbol",i==null||i.ConfigData==null?null:i.ConfigData.CurrencySymbol)("value",e.value==null?"-":_(2,6,e.value,"1.0-0"))("showValue",e.showValue)("isActive",e.id==n.activeTab)}}function lt(t,a){if(t&1){let e=T();o(0,"app-sales-widget",21),V("onFilter",function(n){b(e);let m=d(2);return x(m.onFilterSalesWidget(n))}),r()}if(t&2){let e=d(),i=d();p("dashboardConfig",e==null?null:e.ConfigData)("chartData",e==null?null:e.HighChartData)("filterByOutletIds",i.dashboardFilter.Outlets)}}function st(t,a){t&1&&B(0)}function dt(t,a){if(t&1){let e=T();o(0,"app-payment-widget",23),c(1,"async"),V("onFilter",function(n){b(e);let m=d(4);return x(m.onFilterPaymentWidget(n))}),r()}if(t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("chartData",(e=v(1,2,n.paymentData$))==null?null:e.Data)}}function pt(t,a){if(t&1&&S(0,st,1,0,"ng-container",22)(1,dt,2,4,"ng-template",null,2,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.payment.View?e:n)("ngTemplateOutletContext",f(2,et))}}function ct(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function mt(t,a){t&1&&(k(0,pt,3,3)(1,ct,2,0),R(2,0,qe,null,1),N(0,-1))}function ht(t,a){t&1&&B(0)}function ut(t,a){if(t&1&&(y(0,"app-purchase-widget",18),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("chartData",(e=v(1,3,n.purchaseData$))==null?null:e.HighChartData)("filterByOutletIds",n.dashboardFilter.Outlets)}}function _t(t,a){if(t&1&&S(0,ht,1,0,"ng-container",22)(1,ut,2,5,"ng-template",null,3,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.buy.Report?e:n)("ngTemplateOutletContext",f(2,tt))}}function Ct(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function gt(t,a){t&1&&(k(0,_t,3,3)(1,Ct,2,0),R(2,0,ze,null,1),N(0,-1))}function ft(t,a){t&1&&B(0)}function Dt(t,a){if(t&1&&(y(0,"app-debt-widget",25),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("debtData",(e=v(1,2,n.debtData$))==null?null:e.PageData)}}function bt(t,a){if(t&1&&S(0,ft,1,0,"ng-container",22)(1,Dt,2,4,"ng-template",null,4,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.debt.View?e:n)("ngTemplateOutletContext",f(2,it))}}function xt(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function yt(t,a){t&1&&(k(0,bt,3,3)(1,xt,2,0),R(2,0,Je,null,1),N(0,-1))}function St(t,a){t&1&&B(0)}function Tt(t,a){if(t&1&&(y(0,"app-product-widget",26),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("productData",(e=v(1,2,n.productData$))==null?null:e.PageData)}}function vt(t,a){if(t&1&&S(0,St,1,0,"ng-container",22)(1,Tt,2,4,"ng-template",null,5,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.report.View?e:n)("ngTemplateOutletContext",f(2,at))}}function wt(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function Ot(t,a){t&1&&(k(0,vt,3,3)(1,wt,2,0),R(2,0,Qe,null,1),N(0,-1))}function Pt(t,a){t&1&&B(0)}function Et(t,a){if(t&1&&(y(0,"app-inventory-widget",27),c(1,"async")),t&2){let e,i=d(3),n=d();p("dashboardConfig",i==null?null:i.ConfigData)("inventoryData",(e=v(1,2,n.inventoryData$))==null?null:e.PageData)}}function Ft(t,a){if(t&1&&S(0,Pt,1,0,"ng-container",22)(1,Et,2,4,"ng-template",null,6,w),t&2){let e=g(2),i=d(3),n=g(12);p("ngTemplateOutlet",i.role.inventory.View?e:n)("ngTemplateOutletContext",f(2,nt))}}function Vt(t,a){t&1&&(o(0,"div",24),s(1," LOADING... "),r())}function Wt(t,a){t&1&&(k(0,Ft,3,3)(1,Vt,2,0),R(2,0,Xe,null,1),N(0,-1))}function It(t,a){if(t&1&&(o(0,"div",12)(1,"div",15)(2,"div",16),pe(3,rt,3,9,"div",17,de),c(5,"async"),r(),h(6,lt,1,3,"app-sales-widget",18),h(7,mt,4,0),h(8,gt,4,0),h(9,yt,4,0),h(10,Ot,4,0),h(11,Wt,4,0),r()()),t&2){let e=d();l(3),ce(v(5,6,e.cardWidget$)),l(3),u(e.activeTab=="SALES"?6:-1),l(),u(e.activeTab=="PAYMENT"?7:-1),l(),u(e.activeTab=="PURCHASE"?8:-1),l(),u(e.activeTab=="DEBT"?9:-1),l(),u(e.activeTab=="PRODUCT"?10:-1),l(),u(e.activeTab=="INVENTORY"?11:-1)}}function Mt(t,a){if(t&1&&(o(0,"div",24)(1,"div",28)(2,"div"),y(3,"img",29),r(),o(4,"h1",30),s(5,"You are not authorized"),r(),o(6,"p"),s(7," This page requires role "),o(8,"span",31),s(9),r(),s(10," to be accessed. Please contact your Administrator to gain access! "),r()()()),t&2){let e=a.role;l(9),C("[",e,"]")}}var ke=class t extends Te{constructor(e,i,n){super(e);this.dashboardService=i;this.role=n;this.menuData$.subscribe(),this.initSalesData(),this.initCardWidget(),this.initPaymentData(),this.initPurchaseData(),this.initInventoryData(),this.initDebtData(),this.initProductData()}cardWidget$;outletAccess=2;dashboardFilter={Outlets:[]};salesData$;paymentData$;purchaseData$;debtData$;productData$;inventoryData$;activeTab="SALES";initSalesData(){this.salesData$=this.dashboardService.getDashboardSales(this.dashboardFilter).pipe(P(1))}initPaymentData(){this.paymentData$=this.dashboardService.getDashboardPayment(this.dashboardFilter).pipe(P(1))}initPurchaseData(){this.purchaseData$=this.dashboardService.getDashboardPurchase(this.dashboardFilter).pipe(P(1))}initDebtData(){this.debtData$=this.dashboardService.getDashboardDebt(this.dashboardFilter).pipe(P(1))}initProductData(){this.productData$=this.dashboardService.getDashboardProduct(this.dashboardFilter).pipe(P(1))}initInventoryData(){this.inventoryData$=this.dashboardService.getDashboardInventory(this.dashboardFilter).pipe(P(1))}initCardWidget(){switch(this.activeTab){case"SALES":this.cardWidget$=this.salesData$.pipe(D(e=>this.dashboardService.getTotalData("Sales",e.HighChartData.Series,1)),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break;case"PAYMENT":this.cardWidget$=this.paymentData$.pipe(D(e=>this.dashboardService.getTotalData("All",e.Data.Series,1)),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break;case"PURCHASE":this.cardWidget$=this.purchaseData$.pipe(D(e=>this.dashboardService.getTotalData("Purchase",e.HighChartData.Series,1)),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break;case"DEBT":this.cardWidget$=this.debtData$.pipe(D(e=>e.PageData.Receivable),Y(0),E(e=>this.dashboardService.setWidgetData(e,this.activeTab)));break}}onFilterByOutlet(){switch(this.activeTab){case"SALES":this.initSalesData(),this.initCardWidget();break;case"PURCHASE":this.initPurchaseData(),this.initCardWidget();break;case"DEBT":this.initDebtData(),this.initCardWidget();break;case"PRODUCT":this.initProductData();break;case"INVENTORY":this.initInventoryData();break;case"PAYMENT":this.initPaymentData();break}}onClickCardWidget(e){this.activeTab=e.id,this.initCardWidget()}onFilterSalesWidget(e){this.cardWidget$=this.salesData$.pipe(D(i=>e.period=="WEEKLY"?this.dashboardService.getTotalData("Sales",i.HighChartData.Series,7):this.dashboardService.getTotalData("Sales",i.HighChartData.Series,1)),E(i=>(this.dashboardService.setWidgetData(i,"SALES"),this.dashboardService.widgets$)),D(i=>i.map(n=>(n.id=="SALES"&&(n.tooltip=e.period=="TODAY"?"Total Sales Today":"Total Sales last 7 days"),n))))}onFilterPaymentWidget(e){this.cardWidget$=this.paymentData$.pipe(D(i=>e.period=="WEEKLY"?this.dashboardService.getTotalData("All",i.Data.Series,7):this.dashboardService.getTotalData("All",i.Data.Series,1)),E(i=>(this.dashboardService.setWidgetData(i,"PAYMENT"),this.dashboardService.widgets$)),D(i=>i.map(n=>(n.id=="PAYMENT"&&(n.tooltip=e.period=="TODAY"?"Total Payment Today":"Total Payment last 7 days"),n))))}static \u0275fac=function(i){return new(i||t)(F(ve),F(O),F(Z))};static \u0275cmp=A({type:t,selectors:[["POS-dashboard-v2"]],features:[U([O]),se],decls:13,vars:7,consts:[["pageFilterTemplate",""],["NOT_AUTHORIZED",""],["PAYMENT",""],["BUY",""],["DEBT",""],["PRODUCT",""],["INVENTORY",""],[3,"onSubmit","filterChange","hideSearchBox","pageData","isFilterOnDropdown","filter"],[1,"content"],[1,"container-fluid","bg-light-gray","p-8"],[1,"row"],[1,"col-12"],[1,"card","mb-0"],[1,"dialog-filter"],["appendTo","body","placeholder","Select Outlets",3,"ngModelChange","multiple","accessType","ngModel"],[1,"card-body"],[1,"d-flex","flex-row","flex-nowrap","justify-content-between","align-items-center","overflow-auto",2,"column-gap","18px"],[1,"cursor-pointer","card-widget-tab"],[3,"dashboardConfig","chartData","filterByOutletIds"],[1,"cursor-pointer","card-widget-tab",3,"click"],["matTooltipPosition","above",3,"title","matTooltip","currencySymbol","value","showValue","isActive"],[3,"onFilter","dashboardConfig","chartData","filterByOutletIds"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[3,"onFilter","dashboardConfig","chartData"],[1,"d-flex","align-items-center","justify-content-center","mt-8",2,"height","350px"],[3,"dashboardConfig","debtData"],[3,"dashboardConfig","productData"],[3,"dashboardConfig","inventoryData"],[1,"text-center"],["src","https://cdn.dealpos.xyz/web-image/locked.svg",2,"width","160px"],[1,"mt-2","mb-6"],[1,"fw-bold"]],template:function(i,n){if(i&1){let m=T();o(0,"mainpanel-cmp",7),V("onSubmit",function(){return b(m),x(n.onFilterByOutlet())}),ee("filterChange",function(J){return b(m),X(n.dashboardFilter,J)||(n.dashboardFilter=J),x(J)}),o(1,"filters"),S(2,ot,4,3,"ng-template",null,0,w),r(),o(4,"content")(5,"div",8)(6,"div",9)(7,"div",10)(8,"div",11),h(9,It,12,8,"div",12),c(10,"async"),r()()()()()(),S(11,Mt,11,1,"ng-template",null,1,w)}if(i&2){let m;p("hideSearchBox",!0)("pageData",n.menuData)("isFilterOnDropdown",!1),Q("filter",n.dashboardFilter),l(9),u((m=v(10,5,n.salesData$))?9:-1,m)}},dependencies:[$,Pe,Oe,xe,De,be,K,q,Ee,Se,ye,M,G],styles:[".card-widget-tab[_ngcontent-%COMP%]{flex:1 1 0px}@media only screen and (max-width: 767px){.card-widget-tab[_ngcontent-%COMP%]{margin-right:1rem;margin-top:.5rem;width:auto}}@media only screen and (min-width: 768px) and (max-width: 991px){.card-widget-tab[_ngcontent-%COMP%]{margin-right:1rem;margin-top:.5rem;width:auto}}"]})};export{ke as DashboardV2Component};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var e={production:!0,firebaseConfig:{apiKey:"AIzaSyDnnitFXpM8TglWKNpzu4ChgF98n25Rgvw",authDomain:"auth.dealpos.com",projectId:"devops-signin",storageBucket:"devops-signin.appspot.com",messagingSenderId:"412465165194",appId:"1:412465165194:web:03d806f6b6ab6f8b460e73",measurementId:"G-MNDBRJ5XZD"},pos:{indexedDBVersion:3,submitOrderTimeout:2e4,fileSizeLimit:9e5},version:"25495",outletMaximumSubscription:10,midtransClientKey:"Mid-client-rdi5ridKhHfeIvTj",ngHttpLoaderDebounceDelay:175,news:"https://changelog.dealpos.app/umbraco/delivery/api/v2/content?fetch=children:web&sort=sortOrder:asc",changelog:[],uppy:{invoicePayment:25e5,receiptTemplate:25e5},intercom:{appId:"xv1oomgl"},whatsappTemplateMessage:`Thank you for shopping at {Brand}
|
|
2
|
+
Here is the receipt for your purchase {Number} - {Currency} {Amount}
|
|
3
|
+
{ReceiptLink}
|
|
4
|
+
Please let us know about your shopping experience using the receipt link.`,FALLBACK_PRODUCT_IMAGE_URL:"https://cdn.dealpos.app/template/products_thumb.png",files:{csv:{sales_person_import:"https://cdn.dealpos.xyz/web-import-template/SalesPerson_DealPOS.csv",supplier_import:"https://cdn.dealpos.xyz/web-import-template/Import_Supplier_DealPOS.csv",customer_import:"https://cdn.dealpos.xyz/web-import-template/Customer_Import_TemplateV2.csv",courier_import:"https://cdn.dealpos.xyz/web-import-template/Courier-Import-Template.csv",customer_invoice_import:"https://cdn.dealpos.xyz/web-import-template/Import-Invoice-Template.csv",estimate_import:"https://cdn.dealpos.xyz/web-import-template/Estimate_DealPOS_New.csv",supplier_bill_import:"https://cdn.dealpos.xyz/web-import-template/SupplierBill_Import_TemplateV2.csv",outlet_import:"https://cdn.dealpos.xyz/web-import-template/Outlet_Import_Template.csv",payment_import:"https://cdn.dealpos.xyz/web-import-template/Import-Payment.csv",product_import:"https://cdn.dealpos.xyz/web-import-template/Product_Import_TemplateV2.csv",pricebook_import:"https://res.cloudinary.com/pos/raw/upload/v1647931293/POS/CSV/Pricebook.csv",promotion_coupon_import:"https://cdn.dealpos.xyz/web-import-template/Promotion-Coupon-Import-TemplateV3.csv",adjustment_item_import:"https://cdn.dealpos.xyz/web-import-template/ImportItem_Adjustment_TemplateV2.csv",transfer_order_import:"https://res.cloudinary.com/pos/raw/upload/v1699867624/POS/CSV/ImportTransferOrder_DealPOS_New.csv",buy_import:"https://cdn.dealpos.xyz/web-import-template/ImportBuyV2_DealPOS_New.csv",sell_import:"https://res.cloudinary.com/pos/raw/upload/v1699867624/POS/CSV/ImportSell_DealPOS_New.csv",promotion_event_import:"https://cdn.dealpos.xyz/web-import-template/PromotionEvent_Import_TemplateV2.csv",promotion_event_item_requirement_import:"https://cdn.dealpos.xyz/web-import-template/PromotionEvent_ItemRequirement_Import_TemplateV2.csv",promotion_coupon_item_requirement_import:"https://cdn.dealpos.xyz/web-import-template/PromotionCoupon_ItemRequirement_Import_TemplateV2.csv"}}};export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./chunk-
|
|
1
|
+
import{a as r}from"./chunk-V3FPQMVB.js";import{K as a}from"./chunk-IEVGW2RT.js";var s=class extends r{constructor(t,e,o,n){super(t);this.httpService=e;let p=this.getInfoID(n);this.menuData$.pipe(a(()=>this.getBindDataObservable(o,p))).subscribe({next:i=>{this.bindData(i),this.postBindData(i)}})}data;getInfoID(t){return t.snapshot.queryParams.ID}getBindDataObservable(t,e){return this.httpService.post(`/API/${t}`,{ID:e})}bindData(t){this.data=t}postBindData(t){}};export{s as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as ue}from"./chunk-MLBTUOHX.js";import{d as me,e as pe}from"./chunk-WMZLH4YK.js";import"./chunk-72RZBOHX.js";import"./chunk-3RK6DDJD.js";import"./chunk-M3DKYPGC.js";import"./chunk-6WATOQG3.js";import"./chunk-VM4K4MNV.js";import"./chunk-XTCEZONP.js";import"./chunk-LNDHYAFW.js";import"./chunk-ZZBF7AOW.js";import{a as $}from"./chunk-3Y2TKGP4.js";import{c as re}from"./chunk-SFXDXOSB.js";import{b as ne}from"./chunk-VXPORXGI.js";import"./chunk-R2Y4JAXW.js";import"./chunk-NTCQH6TH.js";import"./chunk-L6PKNRWO.js";import"./chunk-SIQZO2WM.js";import{e as oe,f as le}from"./chunk-LNZY3GKF.js";import"./chunk-7V2CY4DW.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-IKKPP4JS.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-KZFNI67M.js";import"./chunk-4BXCIT62.js";import"./chunk-D4FCXEV4.js";import"./chunk-6P2ASCNY.js";import"./chunk-QE5OFO56.js";import{b as ie}from"./chunk-KJF3M7DY.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import"./chunk-26YFRPR2.js";import"./chunk-JBS5UYZC.js";import{N as ae}from"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import{d as te}from"./chunk-THT6CY5E.js";import{g as ee}from"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-S7FOJJP2.js";import"./chunk-FU2ZGMX4.js";import"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import{F as X,h as K,o as z}from"./chunk-DWZ5JTI2.js";import"./chunk-743523SK.js";import"./chunk-46D5QBZT.js";import"./chunk-36GWLMZX.js";import{b as Z}from"./chunk-WFQIMZGL.js";import"./chunk-WUV22SZ4.js";import"./chunk-SO3RL6QR.js";import{s as Y}from"./chunk-LGOSIAUC.js";import{Ab as f,Bb as O,Bc as E,Db as P,Eb as L,Fb as x,Fc as C,Gb as a,Gc as b,Hb as n,Hc as H,Ib as N,Lc as V,Ob as y,Pb as T,Qd as G,Sb as h,Sd as J,Ub as p,Xa as o,cc as w,eb as I,hc as m,ib as R,ic as k,jc as d,mb as B,mc as D,nc as M,nd as q,ob as g,oc as S,pa as F,qd as Q,sd as j,ta as c,ua as s,vd as U,xc as A,yb as _,yc as W}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var ce=(t,l,e,i)=>({title:"Materials",items:t,summary:l,manufacture:e,quantity:i}),se=(t,l,e,i)=>({title:"Expenses",items:t,summary:l,manufacture:e,quantity:i}),_e=(t,l,e,i)=>({title:"Outputs",items:t,summary:l,manufacture:e,quantity:i}),fe=()=>["/menu/Manufacture/Job_Order/Archive/Info"],xe=t=>({ID:t});function Ce(t,l){if(t&1){let e=T();a(0,"button",16),h("click",function(){c(e);let r=p(2);return s(r.openExportModal())}),N(1,"i",17),m(2," Export "),n()}}function ge(t,l){if(t&1&&(a(0,"div",3),_(1,Ce,3,0,"button",15),n()),t&2){let e=p();o(),f(e.role.global!=null&&e.role.global.Export?1:-1)}}function De(t,l){if(t&1){let e=T();a(0,"div",18)(1,"h6"),m(2,"Outlet"),n(),a(3,"outlet-selector",19),S("ngModelChange",function(r){c(e);let u=p();return M(u.pageData.Filter.OutletId,r)||(u.pageData.Filter.OutletId=r),s(r)}),n(),a(4,"h6"),m(5,"From - To"),n(),a(6,"datepicker",20),S("dateChange",function(r){c(e);let u=p();return M(u.pageData.Filter.From,r)||(u.pageData.Filter.From=r),s(r)}),n(),a(7,"div",21)(8,"datepicker",22),S("dateChange",function(r){c(e);let u=p();return M(u.pageData.Filter.To,r)||(u.pageData.Filter.To=r),s(r)}),n()(),a(9,"h6"),m(10,"State"),n(),a(11,"ng-select",23),S("ngModelChange",function(r){c(e);let u=p();return M(u.pageData.Filter.State,r)||(u.pageData.Filter.State=r),s(r)}),n()()}if(t&2){let e=p();o(3),x("accessType",2),D("ngModel",e.pageData.Filter.OutletId),x("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),D("date",e.pageData.Filter.From),o(2),D("date",e.pageData.Filter.To),o(3),x("items",e.pageData.Options.States),D("ngModel",e.pageData.Filter.State)}}function Me(t,l){t&1&&(a(0,"th",24),m(1,"@ Cost"),n(),a(2,"th",25),m(3,"Total"),n())}function Se(t,l){t&1&&y(0)}function be(t,l){if(t&1&&(a(0,"div"),g(1,Se,1,0,"ng-container",26),n()),t&2){let e=p().$implicit;p();let i=w(28);o(),x("ngTemplateOutlet",i)("ngTemplateOutletContext",E(2,ce,e.MaterialItems,e.MaterialsSummary,e,e==null?null:e.MaterialsTotalQuantity))}}function ye(t,l){t&1&&y(0)}function Te(t,l){if(t&1&&(a(0,"div"),g(1,ye,1,0,"ng-container",26),n()),t&2){let e=p().$implicit;p();let i=w(28);o(),x("ngTemplateOutlet",i)("ngTemplateOutletContext",E(2,se,e.ExpenseItems,e.ExpensesSummary,e,e==null?null:e.ExpensesTotalQuantity))}}function he(t,l){t&1&&y(0)}function we(t,l){if(t&1&&(a(0,"div"),g(1,he,1,0,"ng-container",26),n()),t&2){let e=p().$implicit;p();let i=w(28);o(),x("ngTemplateOutlet",i)("ngTemplateOutletContext",E(2,_e,e.OutputItems,e.OutputsSummary,e,e==null?null:e.OutputsTotalQuantity))}}function Ee(t,l){if(t&1&&(_(0,be,2,7,"div"),_(1,Te,2,7,"div"),_(2,we,2,7,"div")),t&2){let e=l.$implicit;f((e==null||e.MaterialItems==null?null:e.MaterialItems.length)>0?0:-1),o(),f((e==null||e.ExpenseItems==null?null:e.ExpenseItems.length)>0?1:-1),o(),f((e==null||e.OutputItems==null?null:e.OutputItems.length)>0?2:-1)}}function ve(t,l){if(t&1&&(a(0,"div")(1,"a",38)(2,"span",39),m(3),n()(),a(4,"span"),m(5),C(6,"date"),n()()),t&2){let e=p().manufacture;o(),x("routerLink",A(7,fe))("queryParams",W(8,xe,e.ID)),o(2),d(" ",e.OutletName+" # "+e.Number),o(2),d(" "," - "+H(6,4,e.Date,"dd MMM yyyy")," ")}}function Fe(t,l){if(t&1&&(a(0,"div",30),m(1),n()),t&2){let e=p().manufacture;o(),d(" ",e.State," ")}}function Ie(t,l){if(t&1&&(a(0,"td",44),m(1),C(2,"number"),n(),a(3,"td",45),m(4),C(5,"number"),n()),t&2){let e=p().$implicit;o(),d(" ",b(2,2,e.UnitCost)," "),o(3),d(" ",b(5,4,e.UnitCost*e.Quantity)," ")}}function Oe(t,l){if(t&1&&(a(0,"tr",33)(1,"td",40),m(2),n(),a(3,"td",41),m(4),n(),a(5,"td",42),m(6),C(7,"number"),n(),a(8,"td",43),m(9),n(),_(10,Ie,6,6),n()),t&2){let e=l.$implicit,i=p(2);o(2),k(e.Name),o(2),d(" ",e.Code," "),o(2),d(" ",b(7,5,e.Quantity)," "),o(3),d(" ",e.UOM," "),o(),f(i.role.product.Cost?10:-1)}}function Pe(t,l){if(t&1&&(a(0,"td",37)(1,"span",46),m(2),n(),a(3,"span"),m(4),C(5,"number"),n()()),t&2){let e=p().summary;o(2),d(" ",e==null?null:e.CurrencySymbol," "),o(2),d(" ",b(5,2,e==null?null:e.Amount)," ")}}function Le(t,l){if(t&1&&(a(0,"div",27)(1,"div",28),_(2,ve,7,10,"div"),a(3,"div")(4,"strong",29),m(5),n()()(),_(6,Fe,2,1,"div",30),n(),a(7,"table",31)(8,"tbody",32),P(9,Oe,11,7,"tr",33,O),n(),a(11,"tfoot")(12,"tr",34)(13,"td",35),m(14,"Total :"),n(),a(15,"td",36),m(16),C(17,"number"),n(),_(18,Pe,6,4,"td",37),n()()()),t&2){let e=l.title,i=l.items,r=l.quantity,u=p();o(2),f(e=="Materials"?2:-1),o(3),d(" ",e," "),o(),f(e=="Materials"?6:-1),o(3),L(i),o(7),d(" ",b(17,5,r)," "),o(2),f(u.role.product.Cost?18:-1)}}var de=class t extends ${role=F(Z);dialog=F(ee);constructor(l,e){super(l,e,"Manufacture/ReportDetail","ManufactureLoader/ReportDetail",null,null,!0)}openExportModal(){this.dialog.open(ne,{data:{title:"Manufacture Detail",exportTypes:[{ID:"ManufactureExport/ReportDetail",Value:"Default",FileName:"Manufacture Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Manufacture/ReportDetailCount",pagination:!0}})}static \u0275fac=function(e){return new(e||t)(I(ie),I(Y))};static \u0275cmp=R({type:t,selectors:[["app-manufacture-detail"]],features:[B],decls:29,vars:12,consts:[["pageFilterTemplate",""],["CHILD_TABLE",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["filters",""],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],["colspan","6",1,"px-0",2,"border-bottom-width","0px !important"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose State",3,"ngModelChange","items","ngModel"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-columnmb-5","ps-1"],[1,"text-danger"],[1,"mt-5","mb-5","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table-footer"],["colspan","2",1,"text-end","fw-bold"],[1,"text-end","fw-bold","pe-3"],["colspan","3",1,"text-end","fw-bold","pe-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[2,"width","620px"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"border-start","border-end","text-end",2,"width","30px"],[1,"border-start","border-end",2,"width","40px"],[1,"text-end","border-start","border-end",2,"width","80px"],[1,"text-end","border-start","border-end",2,"width","90px"],[1,"me-4"]],template:function(e,i){if(e&1){let r=T();a(0,"mainpanel-cmp",2),h("onSubmit",function(){return c(r),s(i.searchFromPageOne())}),S("filterChange",function(v){return c(r),M(i.pageData.Filter,v)||(i.pageData.Filter=v),s(v)}),a(1,"actions"),_(2,ge,2,1,"div",3),n(),a(3,"div",4),g(4,De,12,7,"ng-template",null,0,V),n(),a(6,"content")(7,"div",5)(8,"div",6)(9,"table",7)(10,"thead",8)(11,"tr")(12,"th",9),m(13,"Name"),n(),a(14,"th",10),m(15,"Code"),n(),a(16,"th",11),m(17,"Qty"),n(),a(18,"th",12),m(19,"UOM"),n(),_(20,Me,4,0),n()(),a(21,"tbody")(22,"tr")(23,"td",13),P(24,Ee,3,3,null,null,O),n()()()(),a(26,"infinite-pagination",14),h("nextPage",function(){return c(r),s(i.NextPage(!0))})("fetchTotalData",function(){return c(r),s(i.StoreRowsCountAPIResult("Manufacture/ReportDetailCount"))})("concatAllData",function(){return c(r),s(i.StoreRowsCountAPIResult("Manufacture/ReportDetailCount",!0))}),n()()(),g(27,Le,19,7,"ng-template",null,1,V),n()()}e&2&&(x("pageData",i.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),D("filter",i.pageData.Filter),o(2),f(i.role.global!=null&&i.role.global.Export?2:-1),o(18),f(i.role.product.Cost?20:-1),o(4),L(i.infiniteList),o(2),x("totalData",i.listTotal)("totalCurrentRow",i.infiniteList==null?null:i.infiniteList.length)("pageNumber",i.pageData.Filter.PageNumber)("nextPageDisabled",i.nextPageDisabled)("isFetchTotalData",i.pageData.HideStoreApiCount)("goToLast",i.goToLast))},dependencies:[U,q,le,oe,re,X,K,z,pe,me,te,J,G,ue,ae,j,Q],encapsulation:2})};export{de as ManufactureDetailComponent};
|
|
1
|
+
import{a as ue}from"./chunk-MLBTUOHX.js";import{d as me,e as pe}from"./chunk-WMZLH4YK.js";import"./chunk-72RZBOHX.js";import"./chunk-3RK6DDJD.js";import"./chunk-M3DKYPGC.js";import"./chunk-6WATOQG3.js";import"./chunk-VM4K4MNV.js";import"./chunk-XTCEZONP.js";import"./chunk-LNDHYAFW.js";import"./chunk-ZZBF7AOW.js";import{a as $}from"./chunk-BCGIIVLI.js";import{c as re}from"./chunk-SRAJGU6Y.js";import{b as ne}from"./chunk-VXPORXGI.js";import"./chunk-OOKDKXRB.js";import"./chunk-H6UWRJHQ.js";import"./chunk-L6PKNRWO.js";import"./chunk-SIQZO2WM.js";import{e as oe,f as le}from"./chunk-YVO66RJF.js";import"./chunk-5QMBTXFS.js";import"./chunk-7YUPYNWQ.js";import"./chunk-2CL5FM3P.js";import"./chunk-IKKPP4JS.js";import"./chunk-QPAUI5EG.js";import"./chunk-45E6XCHN.js";import"./chunk-SIDUUVNA.js";import"./chunk-KZFNI67M.js";import"./chunk-4BXCIT62.js";import"./chunk-D4FCXEV4.js";import"./chunk-6P2ASCNY.js";import"./chunk-PFF34SZG.js";import{b as ie}from"./chunk-V3FPQMVB.js";import"./chunk-R2GUMKAU.js";import"./chunk-BT7NN7PT.js";import"./chunk-26YFRPR2.js";import"./chunk-JBS5UYZC.js";import{N as ae}from"./chunk-TEGIL5RZ.js";import"./chunk-B7AC4RMR.js";import"./chunk-EQLHPWVB.js";import{d as te}from"./chunk-THT6CY5E.js";import{g as ee}from"./chunk-ZTD4APMR.js";import"./chunk-7P3L3ODB.js";import"./chunk-S7FOJJP2.js";import"./chunk-FU2ZGMX4.js";import"./chunk-2FWFPV5I.js";import"./chunk-SLX34TWD.js";import{F as X,h as K,o as z}from"./chunk-DWZ5JTI2.js";import"./chunk-Y7D34HYN.js";import"./chunk-P6DRDJVZ.js";import"./chunk-36GWLMZX.js";import{b as Z}from"./chunk-WFQIMZGL.js";import"./chunk-WUV22SZ4.js";import"./chunk-6UC76HYF.js";import{s as Y}from"./chunk-LGOSIAUC.js";import{Ab as f,Bb as O,Bc as E,Db as P,Eb as L,Fb as x,Fc as C,Gb as a,Gc as b,Hb as n,Hc as H,Ib as N,Lc as V,Ob as y,Pb as T,Qd as G,Sb as h,Sd as J,Ub as p,Xa as o,cc as w,eb as I,hc as m,ib as R,ic as k,jc as d,mb as B,mc as D,nc as M,nd as q,ob as g,oc as S,pa as F,qd as Q,sd as j,ta as c,ua as s,vd as U,xc as A,yb as _,yc as W}from"./chunk-IEVGW2RT.js";import"./chunk-WFMAM73Y.js";import"./chunk-SNAKHGZS.js";var ce=(t,l,e,i)=>({title:"Materials",items:t,summary:l,manufacture:e,quantity:i}),se=(t,l,e,i)=>({title:"Expenses",items:t,summary:l,manufacture:e,quantity:i}),_e=(t,l,e,i)=>({title:"Outputs",items:t,summary:l,manufacture:e,quantity:i}),fe=()=>["/menu/Manufacture/Job_Order/Archive/Info"],xe=t=>({ID:t});function Ce(t,l){if(t&1){let e=T();a(0,"button",16),h("click",function(){c(e);let r=p(2);return s(r.openExportModal())}),N(1,"i",17),m(2," Export "),n()}}function ge(t,l){if(t&1&&(a(0,"div",3),_(1,Ce,3,0,"button",15),n()),t&2){let e=p();o(),f(e.role.global!=null&&e.role.global.Export?1:-1)}}function De(t,l){if(t&1){let e=T();a(0,"div",18)(1,"h6"),m(2,"Outlet"),n(),a(3,"outlet-selector",19),S("ngModelChange",function(r){c(e);let u=p();return M(u.pageData.Filter.OutletId,r)||(u.pageData.Filter.OutletId=r),s(r)}),n(),a(4,"h6"),m(5,"From - To"),n(),a(6,"datepicker",20),S("dateChange",function(r){c(e);let u=p();return M(u.pageData.Filter.From,r)||(u.pageData.Filter.From=r),s(r)}),n(),a(7,"div",21)(8,"datepicker",22),S("dateChange",function(r){c(e);let u=p();return M(u.pageData.Filter.To,r)||(u.pageData.Filter.To=r),s(r)}),n()(),a(9,"h6"),m(10,"State"),n(),a(11,"ng-select",23),S("ngModelChange",function(r){c(e);let u=p();return M(u.pageData.Filter.State,r)||(u.pageData.Filter.State=r),s(r)}),n()()}if(t&2){let e=p();o(3),x("accessType",2),D("ngModel",e.pageData.Filter.OutletId),x("outlets",e.pageData.Options==null?null:e.pageData.Options.Entities),o(3),D("date",e.pageData.Filter.From),o(2),D("date",e.pageData.Filter.To),o(3),x("items",e.pageData.Options.States),D("ngModel",e.pageData.Filter.State)}}function Me(t,l){t&1&&(a(0,"th",24),m(1,"@ Cost"),n(),a(2,"th",25),m(3,"Total"),n())}function Se(t,l){t&1&&y(0)}function be(t,l){if(t&1&&(a(0,"div"),g(1,Se,1,0,"ng-container",26),n()),t&2){let e=p().$implicit;p();let i=w(28);o(),x("ngTemplateOutlet",i)("ngTemplateOutletContext",E(2,ce,e.MaterialItems,e.MaterialsSummary,e,e==null?null:e.MaterialsTotalQuantity))}}function ye(t,l){t&1&&y(0)}function Te(t,l){if(t&1&&(a(0,"div"),g(1,ye,1,0,"ng-container",26),n()),t&2){let e=p().$implicit;p();let i=w(28);o(),x("ngTemplateOutlet",i)("ngTemplateOutletContext",E(2,se,e.ExpenseItems,e.ExpensesSummary,e,e==null?null:e.ExpensesTotalQuantity))}}function he(t,l){t&1&&y(0)}function we(t,l){if(t&1&&(a(0,"div"),g(1,he,1,0,"ng-container",26),n()),t&2){let e=p().$implicit;p();let i=w(28);o(),x("ngTemplateOutlet",i)("ngTemplateOutletContext",E(2,_e,e.OutputItems,e.OutputsSummary,e,e==null?null:e.OutputsTotalQuantity))}}function Ee(t,l){if(t&1&&(_(0,be,2,7,"div"),_(1,Te,2,7,"div"),_(2,we,2,7,"div")),t&2){let e=l.$implicit;f((e==null||e.MaterialItems==null?null:e.MaterialItems.length)>0?0:-1),o(),f((e==null||e.ExpenseItems==null?null:e.ExpenseItems.length)>0?1:-1),o(),f((e==null||e.OutputItems==null?null:e.OutputItems.length)>0?2:-1)}}function ve(t,l){if(t&1&&(a(0,"div")(1,"a",38)(2,"span",39),m(3),n()(),a(4,"span"),m(5),C(6,"date"),n()()),t&2){let e=p().manufacture;o(),x("routerLink",A(7,fe))("queryParams",W(8,xe,e.ID)),o(2),d(" ",e.OutletName+" # "+e.Number),o(2),d(" "," - "+H(6,4,e.Date,"dd MMM yyyy")," ")}}function Fe(t,l){if(t&1&&(a(0,"div",30),m(1),n()),t&2){let e=p().manufacture;o(),d(" ",e.State," ")}}function Ie(t,l){if(t&1&&(a(0,"td",44),m(1),C(2,"number"),n(),a(3,"td",45),m(4),C(5,"number"),n()),t&2){let e=p().$implicit;o(),d(" ",b(2,2,e.UnitCost)," "),o(3),d(" ",b(5,4,e.UnitCost*e.Quantity)," ")}}function Oe(t,l){if(t&1&&(a(0,"tr",33)(1,"td",40),m(2),n(),a(3,"td",41),m(4),n(),a(5,"td",42),m(6),C(7,"number"),n(),a(8,"td",43),m(9),n(),_(10,Ie,6,6),n()),t&2){let e=l.$implicit,i=p(2);o(2),k(e.Name),o(2),d(" ",e.Code," "),o(2),d(" ",b(7,5,e.Quantity)," "),o(3),d(" ",e.UOM," "),o(),f(i.role.product.Cost?10:-1)}}function Pe(t,l){if(t&1&&(a(0,"td",37)(1,"span",46),m(2),n(),a(3,"span"),m(4),C(5,"number"),n()()),t&2){let e=p().summary;o(2),d(" ",e==null?null:e.CurrencySymbol," "),o(2),d(" ",b(5,2,e==null?null:e.Amount)," ")}}function Le(t,l){if(t&1&&(a(0,"div",27)(1,"div",28),_(2,ve,7,10,"div"),a(3,"div")(4,"strong",29),m(5),n()()(),_(6,Fe,2,1,"div",30),n(),a(7,"table",31)(8,"tbody",32),P(9,Oe,11,7,"tr",33,O),n(),a(11,"tfoot")(12,"tr",34)(13,"td",35),m(14,"Total :"),n(),a(15,"td",36),m(16),C(17,"number"),n(),_(18,Pe,6,4,"td",37),n()()()),t&2){let e=l.title,i=l.items,r=l.quantity,u=p();o(2),f(e=="Materials"?2:-1),o(3),d(" ",e," "),o(),f(e=="Materials"?6:-1),o(3),L(i),o(7),d(" ",b(17,5,r)," "),o(2),f(u.role.product.Cost?18:-1)}}var de=class t extends ${role=F(Z);dialog=F(ee);constructor(l,e){super(l,e,"Manufacture/ReportDetail","ManufactureLoader/ReportDetail",null,null,!0)}openExportModal(){this.dialog.open(ne,{data:{title:"Manufacture Detail",exportTypes:[{ID:"ManufactureExport/ReportDetail",Value:"Default",FileName:"Manufacture Detail"}],filterExport:this.pageData.Filter,getAllDataLengthAPI:"Manufacture/ReportDetailCount",pagination:!0}})}static \u0275fac=function(e){return new(e||t)(I(ie),I(Y))};static \u0275cmp=R({type:t,selectors:[["app-manufacture-detail"]],features:[B],decls:29,vars:12,consts:[["pageFilterTemplate",""],["CHILD_TABLE",""],[3,"onSubmit","filterChange","pageData","hideSearchBox","isFilterOnDropdown","filter"],[1,"btn-group"],["filters",""],[1,"container-fluid","mt-5"],[1,"table-responsive"],["id","tableGrid",1,"table"],[1,"thead-light","sticky-top-thead"],[2,"width","645px"],[2,"width","75px"],[2,"width","30px"],[1,"fst-italic","small",2,"width","40px"],["colspan","6",1,"px-0",2,"border-bottom-width","0px !important"],[3,"nextPage","fetchTotalData","concatAllData","totalData","totalCurrentRow","pageNumber","nextPageDisabled","isFetchTotalData","goToLast"],[1,"btn","btn-outline-secondary"],[1,"btn","btn-outline-secondary",3,"click"],["aria-hidden","true",1,"fa-solid","fa-upload"],[1,"dialog-filter"],["appendTo","body","bindLabel","Name","bindValue","ID","placeholder","Choose Outlet",1,"ng-select-multiple",3,"ngModelChange","accessType","ngModel","outlets"],["name","From",3,"dateChange","date"],[1,"mt-4"],["name","To",3,"dateChange","date"],["appendTo","body","bindLabel","Value","bindValue","Key","placeholder","Choose State",3,"ngModelChange","items","ngModel"],[1,"text-end",2,"width","80px"],[1,"text-end",2,"width","90px"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"d-flex","justify-content-end","mt-sm-0"],[1,"me-auto","d-sm-block","d-flex","flex-columnmb-5","ps-1"],[1,"text-danger"],[1,"mt-5","mb-5","fw-bold","fst-italic","me-2"],[1,"w-100"],[1,"table","table-sm","table-bordered","table-striped"],[1,"border-start","border-end"],[1,"table-footer"],["colspan","2",1,"text-end","fw-bold"],[1,"text-end","fw-bold","pe-3"],["colspan","3",1,"text-end","fw-bold","pe-2"],[1,"h5","text-primary","fw-bold",3,"routerLink","queryParams"],["id","PONumber"],[2,"width","620px"],[1,"fw-normal","border-start","border-end",2,"width","75px"],[1,"border-start","border-end","text-end",2,"width","30px"],[1,"border-start","border-end",2,"width","40px"],[1,"text-end","border-start","border-end",2,"width","80px"],[1,"text-end","border-start","border-end",2,"width","90px"],[1,"me-4"]],template:function(e,i){if(e&1){let r=T();a(0,"mainpanel-cmp",2),h("onSubmit",function(){return c(r),s(i.searchFromPageOne())}),S("filterChange",function(v){return c(r),M(i.pageData.Filter,v)||(i.pageData.Filter=v),s(v)}),a(1,"actions"),_(2,ge,2,1,"div",3),n(),a(3,"div",4),g(4,De,12,7,"ng-template",null,0,V),n(),a(6,"content")(7,"div",5)(8,"div",6)(9,"table",7)(10,"thead",8)(11,"tr")(12,"th",9),m(13,"Name"),n(),a(14,"th",10),m(15,"Code"),n(),a(16,"th",11),m(17,"Qty"),n(),a(18,"th",12),m(19,"UOM"),n(),_(20,Me,4,0),n()(),a(21,"tbody")(22,"tr")(23,"td",13),P(24,Ee,3,3,null,null,O),n()()()(),a(26,"infinite-pagination",14),h("nextPage",function(){return c(r),s(i.NextPage(!0))})("fetchTotalData",function(){return c(r),s(i.StoreRowsCountAPIResult("Manufacture/ReportDetailCount"))})("concatAllData",function(){return c(r),s(i.StoreRowsCountAPIResult("Manufacture/ReportDetailCount",!0))}),n()()(),g(27,Le,19,7,"ng-template",null,1,V),n()()}e&2&&(x("pageData",i.menuData)("hideSearchBox",!0)("isFilterOnDropdown",!1),D("filter",i.pageData.Filter),o(2),f(i.role.global!=null&&i.role.global.Export?2:-1),o(18),f(i.role.product.Cost?20:-1),o(4),L(i.infiniteList),o(2),x("totalData",i.listTotal)("totalCurrentRow",i.infiniteList==null?null:i.infiniteList.length)("pageNumber",i.pageData.Filter.PageNumber)("nextPageDisabled",i.nextPageDisabled)("isFetchTotalData",i.pageData.HideStoreApiCount)("goToLast",i.goToLast))},dependencies:[U,q,le,oe,re,X,K,z,pe,me,te,J,G,ue,ae,j,Q],encapsulation:2})};export{de as ManufactureDetailComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as W,d as X}from"./chunk-
|
|
1
|
+
import{c as W,d as X}from"./chunk-Q3FMCFAP.js";import{a as Y,b as Z}from"./chunk-L6PKNRWO.js";import{b as Q,c as U}from"./chunk-JBS5UYZC.js";import{a as B}from"./chunk-B7AC4RMR.js";import{oa as K}from"./chunk-SLX34TWD.js";import{F as J,h as q,o as G}from"./chunk-DWZ5JTI2.js";import{a as d}from"./chunk-WUV22SZ4.js";import{s as C}from"./chunk-LGOSIAUC.js";import{Ab as V,Fb as l,Fc as k,Gb as c,Gc as F,Hb as m,Lc as N,Ob as L,Pb as j,Sb as E,Ub as n,Xa as _,Y as f,Ya as M,ca as S,cc as I,d as x,eb as b,fa as T,ga as u,hc as v,ib as $,jc as R,la as w,nd as P,o as h,oa as O,ob as a,od as z,pa as D,ta as p,ua as g,vd as A,yb as H}from"./chunk-IEVGW2RT.js";var y=class o{signalRClient=D(B);continuedCategories$;allCategories$;_onOpenTreeSelector=new x;onOpenTreeSelector$=this._onOpenTreeSelector.asObservable();constructor(t){this.continuedCategories$=this.onOpenTreeSelector$.pipe(u(this.signalRClient.recacheCategory$),S((e,[i,r])=>r||!e.length?(this.signalRClient.resetCategoryCache(),t.post("/api/catalog/product/GetProductStorageOptions")):h(e),[]),f(1)),this.allCategories$=this.onOpenTreeSelector$.pipe(u(this.signalRClient.recacheCategory$),S((e,[i,r])=>r||!e.length?t.get("/API/catalog/category/SelectOptions"):h(e),[]),f(1))}onOpenTreeSelector(){this._onOpenTreeSelector.next(!0)}forceLoadCategories(){this._onOpenTreeSelector.next(!0)}static \u0275fac=function(e){return new(e||o)(O(C))};static \u0275prov=w({token:o,factory:o.\u0275fac,providedIn:"root"})};function re(o,t){o&1&&L(0)}function ne(o,t){if(o&1&&(c(0,"p-floatLabel",1),a(1,re,1,0,"ng-container",2),c(2,"label",3),v(3,"Category"),m()()),o&2){n();let e=I(3);_(),l("ngTemplateOutlet",e)}}function ae(o,t){o&1&&L(0)}function le(o,t){if(o&1&&a(0,ae,1,0,"ng-container",2),o&2){n();let e=I(3);l("ngTemplateOutlet",e)}}function ce(o,t){if(o&1&&(c(0,"div",6),v(1),m()),o&2){let e=n(2);l("matTooltip",e.selectedCategoryLabel),_(),R(" ",e.selectedCategoryLabel," ")}}function se(o,t){if(o&1){let e=j();c(0,"p-treeSelect",4),k(1,"async"),E("click",function(){p(e);let r=n();return g(r.loadCategories())})("ngModelChange",function(r){p(e);let s=n();return g(s.onSelectCategory(r))})("onClear",function(){p(e);let r=n();return g(r.onClear())}),a(2,ce,2,2,"ng-template",5),m()}if(o&2){let e=n();l("options",F(1,4,e.categories$))("ngModel",e.selectedCategory)("showClear",e.showClear)("placeholder",e.placeholder)}}var ee=class o{constructor(t,e){this.http=t;this.treeSelector=e}continuedCategoriesOnly=!0;categories=[];showClear=!1;showLabel=!1;isInitializedCategoryLabel=!1;placeholder="Select Storage Location";selectedCategory;selectedCategoryID;selectedCategoryIDChange=new M;selectedCategoryLabel;top=0;isLoadCategories=!1;categories$;ngAfterViewInit(){let t=document.querySelector("body");this.top=t.getBoundingClientRect().top*-1}ngOnInit(){this.isInitializedCategoryLabel&&(d.IsEmpty(this.selectedCategoryID)&&d.IsNotEmpty(this.categories)&&(this.selectedCategoryID=this.categories[0]?.key),this.selectedCategory=this.findSelectedCategory(this.categories,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)),this.categories$=this.continuedCategoriesOnly?this.treeSelector.continuedCategories$:this.treeSelector.allCategories$,this.categories$=this.categories$.pipe(T(t=>{this.selectedCategory=this.findSelectedCategory(t,this.selectedCategoryID),this.generateLabelSelectedCategory(this.selectedCategory)}))}onSelectCategory(t){this.selectedCategory=t,this.generateLabelSelectedCategory(this.selectedCategory),this.selectedCategoryID=t?.key,this.selectedCategoryIDChange.emit(this.selectedCategoryID)}generateLabelSelectedCategory(t){if(t){let e=[];this.selectedCategoryLabel="";do e=[...e,t.label],t=t.parent;while(t!==void 0);this.selectedCategoryLabel=e.reverse().join("/")}else this.selectedCategoryLabel=this.placeholder}findSelectedCategory(t,e){if(d.IsNotEmpty(e))for(let i of t){if(i.key===e)return i;{i.children=i.children?i.children:[],i.children=i.children.map(s=>(s.parent=i,s));let r=this.findSelectedCategory(i.children,e);if(r)return r}}else return null}loadCategories(){this.treeSelector.onOpenTreeSelector()}onClear(){this.selectedCategoryID=null,this.selectedCategoryIDChange.emit(this.selectedCategoryID)}static \u0275fac=function(e){return new(e||o)(b(C),b(y))};static \u0275cmp=$({type:o,selectors:[["POS-storage-location-select"]],inputs:{continuedCategoriesOnly:"continuedCategoriesOnly",categories:"categories",showClear:"showClear",showLabel:"showLabel",isInitializedCategoryLabel:"isInitializedCategoryLabel",placeholder:"placeholder",selectedCategoryID:"selectedCategoryID"},outputs:{selectedCategoryIDChange:"selectedCategoryIDChange"},decls:4,vars:1,consts:[["categorySelectTemplate",""],["variant","on",1,"w-100"],[4,"ngTemplateOutlet"],["for","selectCategory",1,"tree-category-label"],["appendTo","body","selectionMode","single","filter","true","filterInputAutoFocus","true","scrollHeight","250px","inputId","selectCategory",3,"click","ngModelChange","onClear","options","ngModel","showClear","placeholder"],["pTemplate","value"],["matTooltipPosition","above",3,"matTooltip"]],template:function(e,i){e&1&&(H(0,ne,4,1,"p-floatLabel",1)(1,le,1,1,"ng-container"),a(2,se,3,6,"ng-template",null,0,N)),e&2&&V(i.showLabel?0:1)},dependencies:[A,P,U,Q,X,W,K,J,q,G,Z,Y,z],styles:[".p-popover.p-component{z-index:10000000000000000000000!important} .p-treeselect-panel .p-treeselect-items-wrapper .p-tree{padding-left:4px!important} .p-float-label .p-inputwrapper-filled~label.tree-category-label{left:.5rem!important}"]})};export{ee as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as Re,b as Fe,c as Ae,d as Oe,e as Ue}from"./chunk-DTVCBHPA.js";import{a as je}from"./chunk-5USF4MRW.js";import{d as Qe}from"./chunk-
|
|
1
|
+
import{a as Re,b as Fe,c as Ae,d as Oe,e as Ue}from"./chunk-DTVCBHPA.js";import{a as je}from"./chunk-5USF4MRW.js";import{d as Qe}from"./chunk-5QMBTXFS.js";import{a as Ge}from"./chunk-2CL5FM3P.js";import{a as ze}from"./chunk-45E6XCHN.js";import{a as $e}from"./chunk-SIDUUVNA.js";import{a as Le,d as Ne}from"./chunk-S7FOJJP2.js";import{c as ae,d as Ee,k as E,l as Me}from"./chunk-FU2ZGMX4.js";import{I as De,oa as G,pa as U,xa as re}from"./chunk-SLX34TWD.js";import{F as Ve,a as Pe,g as ke,h as Be,o as Se}from"./chunk-DWZ5JTI2.js";import{$c as T,Fb as o,Gb as b,Hb as x,Ia as J,Ib as C,Mb as N,Nb as R,Ob as z,Oc as we,Pb as v,Sb as w,Tc as ye,Ub as l,Xa as u,Xb as S,Ya as O,Yb as _e,Zb as k,_b as B,ad as j,dc as he,eb as ge,gc as f,gd as Te,hc as Z,ib as H,ic as pe,id as Ce,jb as W,jc as fe,jd as te,ka as me,la as Q,ma as K,mb as X,mc as be,md as ve,na as q,nb as Y,nc as xe,nd as ne,ob as c,oc as Ie,pa as A,ta as m,ua as d,va as V,vd as ie,wb as P,wc as ee,xa as de,yc as $}from"./chunk-IEVGW2RT.js";import{a as ue,b as ce}from"./chunk-SNAKHGZS.js";var Ke=`
|
|
2
2
|
.p-inputnumber {
|
|
3
3
|
display: inline-flex;
|
|
4
4
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./chunk-
|
|
1
|
+
import{a as e}from"./chunk-BCGIIVLI.js";import{a as t}from"./chunk-SNAKHGZS.js";var i=class extends e{constructor(r,a,o,l,s,p,F){super(r,a,o,l,s,p,F)}preInitLoader(){this.loaderPayload=t({ListIDs:this.reportFilterService.initOutletFilter([])},this.loaderPayload)}preInitList(){this.pageData.Filter.ListIDs=this.loaderPayload.ListIDs,this.pageData.Filter.From=this.reportFilterService.initDateFromFilter(this.pageData?.Filter?.From),this.pageData.Filter.To=this.reportFilterService.initDateToFilter(this.pageData?.Filter?.To)}onFilterOutlets(){this.reportFilterService.setOutletFilter(this.pageData.Filter.ListIDs)}onFilterFromDate(){this.reportFilterService.setDateFromFilter(this.pageData?.Filter?.From)}onFilterToDate(){this.reportFilterService.setDateToFilter(this.pageData?.Filter?.To)}};export{i as a};
|