dealposbooks 5.47.0 → 5.47.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{chunk-5K3KAKU5.js → chunk-3TL7F2KM.js} +1 -1
- package/{chunk-DTFLX2XQ.js → chunk-3TPMIYM6.js} +1 -1
- package/{chunk-ZBO62XAM.js → chunk-53SYMJT3.js} +2 -2
- package/{chunk-ML5KV2U2.js → chunk-55EJL7IR.js} +1 -1
- package/chunk-5N7FOORD.js +1 -0
- package/{chunk-EEJGJ7WF.js → chunk-5PBHMN6G.js} +1 -1
- package/{chunk-C3IOIS5V.js → chunk-5ZBLFL65.js} +1 -1
- package/{chunk-IYFNOI7S.js → chunk-6IZPVRGJ.js} +1 -1
- package/{chunk-OVEQKHUV.js → chunk-7GZBVXWZ.js} +2 -2
- package/{chunk-EIV4TELQ.js → chunk-ABFKSSKO.js} +1 -1
- package/{chunk-WFIXL354.js → chunk-AUZDLI47.js} +1 -1
- package/{chunk-OLLF6BKH.js → chunk-CD46WARP.js} +1 -1
- package/{chunk-CWDU4F7J.js → chunk-CJCMWPPM.js} +1 -1
- package/{chunk-5SYYPB6N.js → chunk-CKQDZ5V3.js} +1 -1
- package/{chunk-OJ2VC4ER.js → chunk-EAFXWJXR.js} +1 -1
- package/{chunk-SS4J7T3N.js → chunk-EE75EMIP.js} +1 -1
- package/{chunk-WGJFR6CK.js → chunk-GLBRPUVN.js} +1 -1
- package/chunk-GXFYCEYY.js +7 -0
- package/{chunk-GJYEM7DL.js → chunk-GY5YPT6L.js} +1 -1
- package/{chunk-DU72RNAU.js → chunk-I23KOE73.js} +1 -1
- package/chunk-IRGC65GN.js +1 -0
- package/{chunk-F5CCLXIY.js → chunk-IZ7ZAVDB.js} +1 -1
- package/{chunk-5YO43YBO.js → chunk-KPHDNZQR.js} +1 -1
- package/{chunk-VL2HEHI5.js → chunk-KSA3KTUZ.js} +1 -1
- package/{chunk-S3FQPUAS.js → chunk-L56Y2VZA.js} +1 -1
- package/{chunk-XDJSQLQN.js → chunk-L6AAVCV5.js} +1 -1
- package/{chunk-CL4EKWSU.js → chunk-LT4TNQWP.js} +1 -1
- package/{chunk-35UWKNGE.js → chunk-MQJPYOYS.js} +1 -1
- package/{chunk-NHHXXJY6.js → chunk-MYREYOSL.js} +1 -1
- package/{chunk-ETFYQ4GV.js → chunk-N4JFV34B.js} +1 -1
- package/{chunk-6ZZZTNIH.js → chunk-NJIJC7GH.js} +2 -2
- package/{chunk-DEOAL7PG.js → chunk-OABNAZCH.js} +1 -1
- package/{chunk-DRTMMJ4Q.js → chunk-OMQE3MLE.js} +1 -1
- package/{chunk-5JZTWUDG.js → chunk-OP5H3EZS.js} +1 -1
- package/{chunk-MT3DTYJO.js → chunk-OT26ZWS2.js} +1 -1
- package/{chunk-L2524E6T.js → chunk-OZYJ4SOH.js} +1 -1
- package/{chunk-TUFQ5JVG.js → chunk-P4DH4OHM.js} +1 -1
- package/{chunk-V4B5LQYD.js → chunk-PE5AWYXZ.js} +1 -1
- package/{chunk-AXU3K2IY.js → chunk-PG45FZTK.js} +1 -1
- package/{chunk-AHX56FH2.js → chunk-PPGOVQXM.js} +1 -1
- package/{chunk-XT4YHL2M.js → chunk-RKFZQV37.js} +1 -1
- package/{chunk-EPLZY6T4.js → chunk-RYNNNPBD.js} +1 -1
- package/{chunk-MBJKUKHJ.js → chunk-SH2QYE6S.js} +1 -1
- package/{chunk-RF27SIL3.js → chunk-SQUBEFKB.js} +1 -1
- package/{chunk-4X3G6MGP.js → chunk-UAZOJSS3.js} +1 -1
- package/{chunk-OW25MQS7.js → chunk-UBPSH6UX.js} +1 -1
- package/{chunk-PXN4RATH.js → chunk-UW7IAYIG.js} +1 -1
- package/{chunk-VTCV67A4.js → chunk-UYWLPZ66.js} +1 -1
- package/{chunk-EQU7DDK6.js → chunk-VEEJ5Z24.js} +1 -1
- package/{chunk-M3TKVRYP.js → chunk-XJ7SJUJ2.js} +1 -1
- package/{chunk-Q47KHO2M.js → chunk-XQB3OGS3.js} +1 -1
- package/{chunk-WPMC3LJJ.js → chunk-Y5V2RWZ2.js} +2 -2
- package/{chunk-6XE7LGUS.js → chunk-Z65OWCDJ.js} +1 -1
- package/index.html +2 -2
- package/{main-Q2T6QX2N.js → main-2FOYJ7E6.js} +1 -1
- package/package.json +1 -1
- package/chunk-2RNKYO2Q.js +0 -1
- package/chunk-5HZBSMCT.js +0 -7
- package/chunk-SN7DLFX2.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as _e}from"./chunk-
|
|
1
|
+
import{b as _e}from"./chunk-I23KOE73.js";import{a as I,b as V}from"./chunk-3A4BFUGD.js";import{d as xe,k as Se}from"./chunk-3IEOINKV.js";import{a as be,b as Ce}from"./chunk-53I5JFOQ.js";import"./chunk-HQMTUZZQ.js";import"./chunk-RXOOTYEO.js";import"./chunk-SEXB43QC.js";import"./chunk-CWFLUFKM.js";import"./chunk-LWYAFMN3.js";import"./chunk-NDLX3ORI.js";import"./chunk-E4MHRZVH.js";import"./chunk-XPRP6AB4.js";import"./chunk-YZTBV6HG.js";import{b as ge}from"./chunk-ZMIVD3SF.js";import"./chunk-DHLFL3KH.js";import"./chunk-QWTGY7FA.js";import{g as he}from"./chunk-P4DH4OHM.js";import"./chunk-ZUDQOT7C.js";import{a as ae,b as re}from"./chunk-BUDZ3ONE.js";import{b as T,c as se,d as me,e as ce,f as de,g as fe,h as ue}from"./chunk-IRGC65GN.js";import"./chunk-V4SH72WU.js";import{y as le,z as pe}from"./chunk-IMVMIXVJ.js";import"./chunk-2D2YD753.js";import{e as Y,f as Z,k as $,l as ee,o as te,u as ie,w as oe,x as ne}from"./chunk-OIBDX2CA.js";import{e as z,l as J}from"./chunk-AOOG6YOT.js";import{a as X}from"./chunk-XJ7SJUJ2.js";import"./chunk-2MKKFLNJ.js";import{q as W,s as q}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as L,Cc as H,D as M,Db as F,Dc as Q,Ec as P,Ha as O,Lb as f,Nc as u,Oc as h,Rc as g,Vb as o,Wb as n,Xb as E,Y as D,bd as B,c as v,ca as N,cd as U,ec as w,fc as k,hb as p,ia as d,qa as x,ra as S,rc as r,sc as y,tc as C,wc as j,xb as R,xc as G,yc as K}from"./chunk-NMCKMUY4.js";import{a as m,b as c}from"./chunk-YQFG5XE2.js";var ke=(()=>{class e{constructor(){this.httpService=d(X)}fetchCashAndBankLoader(){return this.httpService.get("","api/CashAndBankLoader/GetCashAndBank")}fetchCashAndBankData(t){return this.httpService.get("","api/CashAndBank/GetCashAndBank",{params:t})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=N({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var ve={data:{data:[],pageTitle:"",pageSubTitle:""},filter:null,options:{hasGeneralLedger:!1}},A=se(ue("cash-bank-store"),fe(ve),me(e=>({totalBalance:B(()=>e.data().data.reduce((l,t)=>l+t.balance,0)),subTotalDebit:B(()=>e.data().data.reduce((l,t)=>l+t.debit,0)),subTotalCredit:B(()=>e.data().data.reduce((l,t)=>l+t.credit,0))})),de(e=>{let l=d(ke);return{updateFilterQuery(i){T(e,a=>c(m({},a),{filter:c(m({},i),{pageNumber:1})}))},loadCashAndBankLoader:I(v(D(()=>l.fetchCashAndBankLoader().pipe(V({next:i=>{T(e,a=>c(m({},a),{options:i.options,filter:i.filter}))},error:i=>{console.log("error",i)}}))))),loadCashAndBankData:I(v(M(i=>!!i),D(i=>l.fetchCashAndBankData(i).pipe(V({next:a=>{T(e,s=>c(m({},s),{data:a}))},error:a=>{console.log("error",a)}})))))}}),ce({onInit(e){e.loadCashAndBankLoader(),e.loadCashAndBankData(e.filter)}}));var De=["class","page"],Fe=e=>[e],Ee=()=>["/pages/report/general-ledger"],we=e=>({id:e});function Pe(e,l){e&1&&(o(0,"tr")(1,"th"),r(2,"Code"),n(),o(3,"th"),r(4,"Name"),n(),o(5,"th",8)(6,"span",9),r(7," Debit "),n()(),o(8,"th",8)(9,"span",10),r(10," Credit "),n()(),o(11,"th",8)(12,"span",11),r(13," Current Balance"),n()()())}function Ie(e,l){if(e&1&&(o(0,"tr")(1,"td"),r(2),n(),o(3,"td")(4,"a",12),r(5),n()(),o(6,"td",13),r(7),u(8,"number"),n(),o(9,"td",14),r(10),u(11,"number"),n(),o(12,"td",8)(13,"a",15),r(14),u(15,"number"),n()()()),e&2){let t=l.$implicit;p(2),y(t.code),p(2),f("routerLink",P(14,Fe,"/pages/chart-of-account/account/"+t.accountID)),p(),y(t.name),p(2),C(" ",h(8,8,t.debit)," "),p(3),C(" ",h(11,10,t.credit)," "),p(3),f("routerLink",Q(16,Ee))("queryParams",P(17,we,t.accountID)),p(),y(h(15,12,t.balance))}}function Ve(e,l){if(e&1&&(o(0,"tr"),E(1,"td"),o(2,"td",16),r(3,"Total"),n(),o(4,"td",17),r(5),u(6,"number"),n(),o(7,"td",18),r(8),u(9,"number"),n(),o(10,"td",19),r(11),u(12,"number"),n()()),e&2){let t=k(2);p(5),C(" ",h(6,3,t.store.subTotalDebit())," "),p(3),C(" ",h(9,5,t.store.subTotalCredit())," "),p(3),C(" ",h(12,7,t.store.totalBalance())," ")}}function Ae(e,l){e&1&&(o(0,"tr")(1,"td",20)(2,"span"),r(3,"No records found."),n()()())}function Me(e,l){if(e&1&&(o(0,"p-panel")(1,"p-table",7),F(2,Pe,14,0,"ng-template",null,2,g)(4,Ie,16,19,"ng-template",null,3,g)(6,Ve,13,9,"ng-template",null,4,g)(8,Ae,4,0,"ng-template",null,5,g),n()()),e&2){let t=k();p(),f("value",t.store.data().data)}}function Ne(e,l){if(e&1&&(o(0,"form",21)(1,"div",22)(2,"label",23),r(3,"From - To"),n(),o(4,"div",24),E(5,"p-datepicker",25)(6,"p-datepicker",26),n()()()),e&2){let t=k();f("formGroup",t.filterForm),p(5),f("iconDisplay","input")("showIcon",!0),p(),f("iconDisplay","input")("showIcon",!0)}}var ye=(()=>{class e{constructor(){this.store=d(A),this.isDialogFilterVisible=O(!1),this.routeInfo=Be,this.fb=d(ie),this.dayjsService=d(_e),U(()=>{let t=this.store.filter();if(t){let i=Object.entries(t).reduce((a,[s,b])=>(s==="from"||s==="to"?a[s]=b?new Date(b):null:a[s]=b,a),{});this.filterForm?.patchValue(i)}})}ngOnInit(){this.initForm()}initForm(){this.filterForm=this.fb.group({text:this.fb.control(""),listOutletID:this.fb.control([]),listCategoryID:this.fb.control([]),isInRoleEmptyOutlets:this.fb.control(!1),discontinued:this.fb.control("all"),discontinuedValue:this.fb.control(!1),from:this.fb.control(null),to:this.fb.control(null),pageNumber:this.fb.control(1),pageSize:this.fb.control(10),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportPageSize:this.fb.control(10)})}onSearch(t){this.store.updateFilterQuery(c(m({},this.store.filter()),{text:t}))}onFilterOKEvent(){let t=this.filterForm.getRawValue();console.log("\u{1F680} ~ CashBankPageComponent ~ onFilterOKEvent ~ formValue:",t);let i=c(m({},t),{from:t.from?this.dayjsService.format(t.from):void 0,to:t.to?this.dayjsService.format(t.to):void 0});this.store.updateFilterQuery(i),this.isDialogFilterVisible.set(!1)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=R({type:e,selectors:[["app-cash-bank",8,"page"]],features:[H([A])],attrs:De,decls:5,vars:6,consts:[["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"search","isDialogFilterVisibleChange","filterConfirmed","pageTitle","pageSubTitle","scrollable","isSearchableInput","isFilterable","isDialogFilterVisible"],[3,"value"],[1,"text-end"],["pTooltip","Total debit based on the selected date filter","tooltipPosition","top"],["pTooltip","Total credit based on the selected date filter","tooltipPosition","top"],["pTooltip","Current balance based on the selected date filter","tooltipPosition","top"],[1,"link","link-primary",3,"routerLink"],[1,"text-end","text-success"],[1,"text-end","text-danger"],[1,"link","link-primary",3,"routerLink","queryParams"],[1,"fw-bold"],[1,"fw-bold","text-end","text-success"],[1,"fw-bold","text-end","text-danger"],[1,"text-end","fw-bold"],["colspan","5"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["formControlName","from","styleClass","w-100 mb-0","appendTo","body","dataType","string","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"]],template:function(i,a){if(i&1){let s=L();o(0,"app-main-panel",6),w("search",function(_){return x(s),S(a.onSearch(_))}),K("isDialogFilterVisibleChange",function(_){return x(s),G(a.isDialogFilterVisible,_)||(a.isDialogFilterVisible=_),S(_)}),w("filterConfirmed",function(){return x(s),S(a.onFilterOKEvent())}),F(1,Me,10,1,"ng-template",null,0,g)(3,Ne,7,5,"ng-template",null,1,g),n()}i&2&&(f("pageTitle",a.store.data().pageTitle)("pageSubTitle",a.store.data().pageSubTitle)("scrollable",!0)("isSearchableInput",!0)("isFilterable",!0),j("isDialogFilterVisible",a.isDialogFilterVisible))},dependencies:[q,W,he,oe,$,Y,Z,Se,xe,ge,J,z,re,ae,pe,le,ne,ee,te,Ce,be],styles:[".card[_ngcontent-%COMP%]{height:calc(100vh - 120px)}.card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:inherit;overflow-y:auto}"],changeDetection:0})}}return e})();var St=[{path:"",component:ye,children:[]}],Be={path:"cash-of-account",title:"COA",iconName:"fa fa-calculator",class:"",label:"",labelClass:"",extralink:!1,submenu:[]};export{St as CASH_BANK_ROUTES,Be as CASH_BANK_ROUTE_PAGE};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as X}from"./chunk-
|
|
1
|
+
import{a as X}from"./chunk-UBPSH6UX.js";import{d as W,i as q,j as K,k as G}from"./chunk-3IEOINKV.js";import"./chunk-53I5JFOQ.js";import"./chunk-HQMTUZZQ.js";import"./chunk-RXOOTYEO.js";import{a as Q}from"./chunk-QF4D5YPK.js";import"./chunk-SEXB43QC.js";import"./chunk-CWFLUFKM.js";import"./chunk-LWYAFMN3.js";import"./chunk-NDLX3ORI.js";import"./chunk-E4MHRZVH.js";import"./chunk-XPRP6AB4.js";import"./chunk-YZTBV6HG.js";import"./chunk-DHLFL3KH.js";import"./chunk-QWTGY7FA.js";import{g as O}from"./chunk-P4DH4OHM.js";import"./chunk-ZUDQOT7C.js";import"./chunk-IRGC65GN.js";import"./chunk-V4SH72WU.js";import{w as B}from"./chunk-IMVMIXVJ.js";import{a as N,b as U}from"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import{e as L}from"./chunk-AOOG6YOT.js";import"./chunk-XJ7SJUJ2.js";import"./chunk-2MKKFLNJ.js";import{k as I}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as T,Db as h,Ec as A,Ha as b,L as R,Lb as d,Qb as v,Rc as _,Vb as i,Wb as o,Xb as w,Y as J,_ as k,bd as S,cd as H,ec as x,fc as r,hb as f,ia as D,qa as m,ra as c,rc as u,s as j,sc as V,vc as F,wc as M,xb as E,xc as z,yc as P}from"./chunk-NMCKMUY4.js";import{a as s,b as g}from"./chunk-YQFG5XE2.js";var Y=["class","component"],Z=t=>({id:t});function $(t,p){if(t&1){let e=T();i(0,"p-button",13),x("onClick",function(){m(e);let n=r(2);return c(n.onJournalTagDelete())}),o()}}function ee(t,p){if(t&1){let e=T();i(0,"div",8)(1,"p-button",9),x("onClick",function(){m(e);let n=r();return c(n.onMigrate())}),o(),h(2,$,1,0,"p-button",10),i(3,"a",11),w(4,"i",12),u(5," Add"),o()()}if(t&2){let e=r();f(2),d("ngIf",e.journalTagsChecked().length>0)}}function te(t,p){t&1&&(i(0,"div",14)(1,"h3",15),u(2," Are you to sure to copy All Outlet from POS to Journal Tag? "),o()())}function ne(t,p){t&1&&(i(0,"tr")(1,"th",18),w(2,"p-tableHeaderCheckbox"),o(),i(3,"th"),u(4,"Tag"),o(),i(5,"th"),u(6,"Description"),o()())}function ae(t,p){if(t&1&&(i(0,"tr")(1,"td"),w(2,"p-tableCheckbox",19),o(),i(3,"td")(4,"a",20),u(5),o()(),i(6,"td"),u(7),o()()),t&2){let e=p.$implicit;f(2),d("value",e),f(2),d("queryParams",A(4,Z,e.id)),f(),V(e.name),f(2),V(e.description)}}function ie(t,p){if(t&1&&u(0),t&2){let e=r(3);F(" Showing ",e.first()," to ",e.end()," of ",e.journalTags().count," entries ")}}function oe(t,p){t&1&&(i(0,"tr")(1,"td",21)(2,"span"),u(3," No journal entries found. "),o()()())}function le(t,p){if(t&1){let e=T();i(0,"p-table",17),x("onPage",function(n){m(e);let l=r(2);return c(l.onPageChange(n))})("onRowSelect",function(n){m(e);let l=r(2);return c(l.onRowSelect(n))})("onRowUnselect",function(n){m(e);let l=r(2);return c(l.onRowUnselect(n))})("onHeaderCheckboxToggle",function(n){m(e);let l=r(2);return c(l.onHeaderCheckboxToggle(n))}),h(1,ne,7,0,"ng-template",null,3,_)(3,ae,8,6,"ng-template",null,4,_)(5,ie,1,3,"ng-template",null,5,_)(7,oe,4,0,"ng-template",null,6,_),o()}if(t&2){let e=r(2);d("value",e.journalTags().data)("paginator",!0)("totalRecords",e.journalTags().count)("lazy",!0)("rows",e.params().pageSize)("scrollable",!0)}}function re(t,p){if(t&1&&h(0,le,9,6,"p-table",16),t&2){let e=r();v(e.journalTags()?0:-1)}}var we=(()=>{class t{constructor(){this.journalTagService=D(X),this.isDialogFilterVisible=b(!1),this.params=b({pageNumber:1,pageSize:100}),this.first=S(()=>(this.params().pageNumber-1)*this.params().pageSize+1),this.end=S(()=>Math.min(this.params().pageNumber*this.params().pageSize,this.journalTags().count||100)),this.journalTagsSource=U(N(this.params).pipe(R(300),J(e=>this.journalTagService.journalTagList(e).pipe(j(a=>g(s({},a),{data:a.data.map(n=>g(s({},n),{checked:!1}))}))))),{initialValue:null}),this.journalTags=b(null),this.journalTagsChecked=S(()=>this.journalTags()?this.journalTags().data.filter(e=>e.checked):[]),H(()=>{let e=this.journalTagsSource();e&&this.journalTags.set(e)})}ngOnInit(){this.journalTagService.journalTagList({pageNumber:1,pageSize:100}).pipe(Q("response")).subscribe()}onPageChange(e){this.params.update(a=>g(s({},a),{pageNumber:e.first/e.rows+1,pageSize:e.rows}))}onRowSelect(e){if(Array.isArray(e.data)){let a=e.data.map(n=>n.id);this.updateCheckedRows(a,!0)}else e.data&&this.updateCheckedRows([e.data.id],!0)}onRowUnselect(e){if(Array.isArray(e.data)){let a=e.data.map(n=>n.id);this.updateCheckedRows(a,!1)}else e.data&&this.updateCheckedRows([e.data.id],!1)}updateCheckedRows(e,a){this.journalTags.update(n=>{if(!n)return n;let l=n.data.map(C=>e.includes(C.id)?g(s({},C),{checked:a}):C);return g(s({},n),{data:l})})}onHeaderCheckboxToggle(e){this.journalTags.update(a=>g(s({},a),{data:a.data.map(n=>g(s({},n),{checked:e.checked}))}))}onJournalTagDelete(){this.journalTagService.journalTagDelete(this.journalTagsChecked()[0].id).pipe(k(()=>this.params.update(e=>s({},e)))).subscribe()}onMigrate(){this.isDialogFilterVisible.update(e=>!e)}onFilterConfirmed(){this.journalTagService.journalTagMigrate().pipe(k(()=>{this.isDialogFilterVisible.update(e=>!e),this.params.update(e=>s({},e))})).subscribe()}static{this.\u0275fac=function(a){return new(a||t)}}static{this.\u0275cmp=E({type:t,selectors:[["app-journal-tag",8,"component"]],attrs:Y,decls:7,vars:3,consts:[["actionButton",""],["filters",""],["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Journal Tag List","dialogTitle","Migrate Users",3,"isDialogFilterVisibleChange","filterConfirmed","overflowScroll","isDialogFilterVisible","showCancelButton"],[1,"d-flex","gap-2"],["label","Migrate","variant","outlined",3,"onClick"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick",4,"ngIf"],["routerLink","form",1,"p-button"],[1,"fa-solid","fa-plus"],["label","Delete","severity","danger","icon","fa-solid fa-trash",3,"onClick"],[1,"h-full","d-flex","align-items-center"],[1,"fs-3"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"value","paginator","totalRecords","lazy","rows","scrollable"],["dataKey","id","selectionMode","single","styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","paginator","totalRecords","lazy","rows","scrollable"],[2,"width","1rem"],[3,"value"],["routerLink","form",1,"link","link-primary",3,"queryParams"],["colspan","5"]],template:function(a,n){if(a&1){let l=T();i(0,"app-main-panel",7),P("isDialogFilterVisibleChange",function(y){return m(l),z(n.isDialogFilterVisible,y)||(n.isDialogFilterVisible=y),c(y)}),x("filterConfirmed",function(){return m(l),c(n.onFilterConfirmed())}),h(1,ee,6,1,"ng-template",null,0,_)(3,te,3,0,"ng-template",null,1,_)(5,re,1,1,"ng-template",null,2,_),o()}a&2&&(d("overflowScroll",!0),M("isDialogFilterVisible",n.isDialogFilterVisible),d("showCancelButton",!1))},dependencies:[O,G,W,q,K,B,I,L],styles:[".container-wrapper .p-datatable .p-datatable-thead>tr>th{position:sticky;top:0;z-index:1050;background:#f6f6f6!important}"],changeDetection:0})}}return t})();export{we as JournalTagComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as L}from"./chunk-
|
|
1
|
+
import{a as v,b as L}from"./chunk-OP5H3EZS.js";import"./chunk-I23KOE73.js";import{a as E,b as O}from"./chunk-Q7SK53ST.js";import"./chunk-ZMIVD3SF.js";import{g as H}from"./chunk-P4DH4OHM.js";import"./chunk-ZUDQOT7C.js";import{a as R,b as D}from"./chunk-BUDZ3ONE.js";import"./chunk-IRGC65GN.js";import"./chunk-V4SH72WU.js";import{w as V,x as j,y as N,z as G}from"./chunk-IMVMIXVJ.js";import"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import"./chunk-XJ7SJUJ2.js";import{a as I}from"./chunk-2MKKFLNJ.js";import{n as A,s as F}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as P,Cc as $,Db as B,Dc as _,Lb as p,Nc as m,Ob as d,Oc as l,Rc as x,Vb as o,W as y,Wb as n,Xb as c,Y as M,_ as b,ec as h,fc as s,h as T,hb as a,ia as f,qa as g,ra as C,s as u,sa as S,ta as k,xb as w}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var q=()=>({height:"calc(100vh - 100px)"});function J(i,z){if(i&1){let e=P();o(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return C(r.onFormatCOAConfig())}),n(),o(2,"p-button",5),m(3,"async"),m(4,"async"),h("onClick",function(){g(e);let r=s();return C(r.onMigrateCoaConfig())}),n()()}if(i&2){let e=s();a(2),p("disabled",l(3,2,e.countInBooks$)!==0)("pTooltip",l(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function K(i,z){if(i&1&&(o(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),c(3,"app-migration-cards",7),m(4,"async"),S(),o(5,"svg",8),c(6,"path",9),n(),k(),c(7,"app-migration-cards",10),m(8,"async"),n()()()),i&2){let e=s();d(_(12,q)),a(),d(_(13,q)),a(2),p("migrationCount",l(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",l(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var ge=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f(I),this.refresh$=new T(void 0),this.pageTitle="Chart of Account Configuration"}ngOnInit(){let e=this.refresh$.pipe(M(()=>this.migrateService.getCOAConfigurationCount()),b(t=>console.log("API response:",t)),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrateCoaConfig(){this.migrateService.migrateCoaConfig().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormatCOAConfig(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatManualCOAConfig().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=w({type:i,selectors:[["app-coa-configuration"]],features:[$([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(o(0,"app-main-panel",2),B(1,J,5,6,"ng-template",null,0,x)(3,K,9,14,"ng-template",null,1,x),n()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[H,F,A,j,V,O,E,D,R,G,N,L],encapsulation:2})}}return i})();export{ge as CoaConfigurationComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-KPHDNZQR.js";import"./chunk-MYREYOSL.js";import"./chunk-IGWIRCAS.js";import"./chunk-AOOG6YOT.js";import"./chunk-XJ7SJUJ2.js";import"./chunk-2MKKFLNJ.js";import"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var o=[{path:"",canActivate:[a],children:[{path:"",loadComponent:()=>import("./chunk-PE5AWYXZ.js").then(t=>t.Dashboard1Component),data:{title:"Dashboard",headerTemplate:"header"}}]}];export{o as DashboardRoutes};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{a as pt}from"./chunk-FQRRGJBE.js";import{a as De,b as Re}from"./chunk-HZ7BZ72K.js";import{a as Se}from"./chunk-MYREYOSL.js";import{a as qt,b as me}from"./chunk-I23KOE73.js";import{b as rt}from"./chunk-5BXMDXZD.js";import{b as Wt,c as at,d as lt}from"./chunk-SZAGTA5I.js";import{a as de,b as ue}from"./chunk-NM5M567G.js";import"./chunk-T3EH4DR2.js";import"./chunk-LABWETHZ.js";import{a as oe}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import{a as Ie,b as we}from"./chunk-3A4BFUGD.js";import{a as it,b as nt,d as se,k as ce}from"./chunk-3IEOINKV.js";import{a as le,b as pe}from"./chunk-53I5JFOQ.js";import"./chunk-HQMTUZZQ.js";import"./chunk-RXOOTYEO.js";import{a as ot}from"./chunk-CJCMWPPM.js";import{a as Ne}from"./chunk-QF4D5YPK.js";import{b as Ee}from"./chunk-Q7SK53ST.js";import"./chunk-SEXB43QC.js";import{a as Ht,b as Te}from"./chunk-CWFLUFKM.js";import"./chunk-LWYAFMN3.js";import"./chunk-NDLX3ORI.js";import{d as Ue}from"./chunk-E4MHRZVH.js";import"./chunk-XPRP6AB4.js";import"./chunk-YZTBV6HG.js";import{b as ae}from"./chunk-ZMIVD3SF.js";import"./chunk-DHLFL3KH.js";import"./chunk-QWTGY7FA.js";import{e as et,f as tt,g as re}from"./chunk-P4DH4OHM.js";import"./chunk-ZUDQOT7C.js";import{a as $e,b as ne}from"./chunk-BUDZ3ONE.js";import{b as O,c as Ye,d as Xe,e as Je,f as Qe,g as Ze}from"./chunk-IRGC65GN.js";import"./chunk-V4SH72WU.js";import{n as Ot,o as Ke,w as te,x as ie,y as jt,z as zt}from"./chunk-IMVMIXVJ.js";import{b as ye}from"./chunk-2D2YD753.js";import{b as At,c as Gt,e as Y,f as X,g as Pt,i as st,k as J,l as Q,o as Z,u as ve,x as ee}from"./chunk-OIBDX2CA.js";import{b as He,e as U,l as $}from"./chunk-AOOG6YOT.js";import{a as Bt,b as Ce}from"./chunk-XJ7SJUJ2.js";import{a as We}from"./chunk-2MKKFLNJ.js";import{h as ze,k as H,p as qe,q as W,s as K,y as kt,z as Nt}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as D,Ac as mt,Bc as _e,Cc as Oe,D as Ae,Db as g,Dc as L,Ec as F,Fc as Mt,Gc as je,Ha as E,Lb as s,Nc as S,Ob as Pe,Oc as y,Pc as ke,Qb as M,Rb as Fe,Rc as _,Tb as Le,Ub as Ve,Vb as o,W as Dt,Wb as r,X as Rt,Xb as w,Y as be,Yb as z,Zb as q,_ as V,bd as R,c as he,ca as Ft,cb as j,cd as fe,db as Ge,ec as I,fc as c,hb as p,ia as C,ic as Lt,qa as h,ra as b,rc as a,s as Be,sc as x,tc as T,uc as Me,wc as A,xb as N,xc as B,yc as P,zc as Vt}from"./chunk-NMCKMUY4.js";import{a as f,b as v,c as xe,e as Tt}from"./chunk-YQFG5XE2.js";var G=(()=>{class t{constructor(){this.httpService=C(Bt),this.authService=C(Se)}fetchGeneralLedgerLoader(e="single",n={}){return this.httpService.get(void 0,`api/GeneralLedgerLoader/${e==="single"?"GetFilterSingle":"GetFilter"}`,{params:n})}getGLCount(e){return this.httpService.post(void 0,"api/GeneralLedger/GetGeneralLedgerCount",e)}fetchGeneralLedgerReport(e,n="single"){return this.httpService.post(void 0,`api/GeneralLedger/${n==="single"?"GetGeneralLedger":"GetMultiLedger"}`,e)}exportGeneralLedger(e,n={}){let i=f({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetGeneralLedgerExport",e,i)}exportMultiLedger(e,n={}){let i=f({responseType:"blob"},n);return this.httpService.post(void 0,"/api/GeneralLedgerExport/GetMultiLedgerExport",e,i)}getCustomerSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:n})}getSupplierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:n})}getCashierSuggestions(e){let n={Prefix:e,Count:100};return this.httpService.get(this.authService.getTenantExternalURL(),"/api/ac/GetUserSuggestion",{params:n})}getBalanceSheetLoader(){return this.httpService.get(void 0,"/api/BalanceSheetLoader/GetBalanceSheet")}getBalanceSheet(e,n={}){let i=new Nt({fromObject:Object.fromEntries(Object.entries(e).map(([d,k])=>[d,String(k)]))}),l=new kt({"X-Timeout":"50000","X-Retry":"3","X-Retry-Delay":"2000","X-Exponential-Backoff":"true","X-Retry-On-500":"true","X-Retry-On-500-Message":"timeout expired"}),u=f({params:i,headers:l},n);return this.httpService.get(void 0,"/api/BalanceSheet",u)}getIncomeStatementLoader(){return this.httpService.get(void 0,"api/IncomeStatementLoader/Filter")}getIncomeStatement(e,n={}){return this.httpService.post(void 0,"api/IncomeStatement/List",f({},e),n)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var oi=()=>({width:"30vw"}),ri=()=>({"1199px":"75vw","575px":"90vw"}),ai=t=>({"ng-dirty ng-invalid":t}),li=t=>["/pages/journal/journal-entry/",t],pi=t=>({"text-success":t}),mi=t=>({"text-danger":t});function si(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",34)(8,"span",36),a(9),r()()()),t&2){let e=m.$implicit;p(3),T("(",e.code,")"),p(6),x(e.name)}}function ci(t,m){if(t&1&&(o(0,"div",33)(1,"div",34)(2,"span",35),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",34)(8,"span",36),a(9),r()()()),t&2){let e=m.$implicit;p(3),T("(",e.code,")"),p(6),x(e.name)}}function di(t,m){t&1&&(o(0,"div",37),a(1," Account is required. "),r())}function ui(t,m){if(t&1&&(o(0,"div",38)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;p(2),x(e.value)}}function _i(t,m){if(t&1&&(o(0,"div",26)(1,"div",27),w(2,"p-radiobutton",39),o(3,"label",40),a(4),r()()()),t&2){let e=m.$implicit;p(2),s("value",e.key)("inputId",e.key),p(),s("for",e.key),p(),x(e.value)}}function fi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),a(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){h(e);let l=c(3);return b(l.searchCustomer(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.customerSuggestions())}}function gi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),a(2,"Supplier"),r(),o(3,"p-autocomplete",42),I("completeMethod",function(i){h(e);let l=c(3);return b(l.searchSupplier(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.supplierSuggestions())}}function xi(t,m){if(t&1){let e=D();o(0,"div",16)(1,"label",17),a(2,"Customer"),r(),o(3,"p-autocomplete",41),I("completeMethod",function(i){h(e);let l=c(3);return b(l.searchCustomer(i))}),r()()}if(t&2){let e=c(3);p(3),s("suggestions",e.customerSuggestions())}}function hi(t,m){if(t&1&&(o(0,"form",15)(1,"div",16)(2,"label",17),a(3,"Accounts"),r(),o(4,"p-select",18),g(5,si,10,2,"ng-template",null,5,_)(7,ci,10,2,"ng-template",null,6,_),r(),g(9,di,2,0,"div",19),r(),o(10,"div",16)(11,"label",17),a(12,"From"),r(),o(13,"div",20),w(14,"p-datepicker",21)(15,"p-datepicker",22),r()(),o(16,"div",16)(17,"label",17),a(18,"Outlets"),r(),o(19,"p-multiselect",23),g(20,ui,3,1,"ng-template",null,6,_),r()(),o(22,"div",16)(23,"label",24),a(24,"Contact Type"),r(),o(25,"div",25),Le(26,_i,5,4,"div",26,Fe),r()(),g(28,fi,4,1,"div",16)(29,gi,4,1,"div",16)(30,xi,4,1,"div",16),o(31,"div",16)(32,"label",24),a(33,"Sort order"),r(),o(34,"div",25)(35,"div",26)(36,"div",27),w(37,"p-radiobutton",28),o(38,"label",29),a(39,"Asc"),r()()(),o(40,"div",30)(41,"div",27),w(42,"p-radiobutton",31),o(43,"label",32),a(44,"Desc"),r()()()()()()),t&2){let e,n,i,l=c(2);s("formGroup",l.form),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",l.loaderMetadata().options.accounts)("ngClass",F(14,ai,((e=l.form.get("accountID"))==null?null:e.invalid)&&(((e=l.form.get("accountID"))==null?null:e.touched)||((e=l.form.get("accountID"))==null?null:e.dirty)))),p(5),s("ngIf",((n=l.form.get("accountID"))==null?null:n.invalid)&&(((n=l.form.get("accountID"))==null?null:n.touched)||((n=l.form.get("accountID"))==null?null:n.dirty))),p(5),s("showIcon",!0),p(),s("showIcon",!0),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",l.loaderMetadata().options.outlets),p(7),Ve(l.loaderMetadata().options.contactTypeOptions),p(2),M((i=l.form.controls.contactType.value)===1?28:i===2?29:30),p(9),s("value",!0),p(5),s("value",!1)}}function bi(t,m){if(t&1&&g(0,hi,45,16,"form",14),t&2){let e=c();s("ngIf",e.loaderMetadata())}}function Ci(t,m){if(t&1){let e=D();o(0,"p-button",45),I("onClick",function(){h(e);let i=c(2);return b(i.onToggleExportDialog())}),r()}}function Si(t,m){if(t&1&&(o(0,"div",33)(1,"a",43),a(2,"Return to Accounts"),r(),g(3,Ci,1,0,"p-button",44),r()),t&2){let e=c();p(3),s("ngIf",e.roleService.global().export)}}function vi(t,m){t&1&&w(0,"div",52)}function yi(t,m){t&1&&(o(0,"tr")(1,"th",53),a(2,"Outlet"),r(),o(3,"th",54),a(4,"No."),r(),o(5,"th",55),a(6,"Date"),r(),o(7,"th",56),a(8,"Contact / Note"),r(),o(9,"th",57),a(10,"Debit"),r(),o(11,"th",57),a(12,"Credit"),r(),o(13,"th",58),a(14,"Balance"),r()())}function Ei(t,m){if(t&1&&(o(0,"div",16),w(1,"div",66),o(2,"span",67),a(3),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.journalNote,j),p(2),T("",e.note," ")}}function Ii(t,m){if(t&1&&(o(0,"div",16),w(1,"span",66)(2,"div",66),o(3,"span",68),a(4),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.referenceText,j),p(),s("innerHTML",e.journalNote,j),p(2),T("",e.note," ")}}function wi(t,m){if(t&1&&(z(0),a(1),S(2,"number"),q()),t&2){let e=c().$implicit;p(),T(" ",y(2,1,e.debitAmount)," ")}}function Ti(t,m){if(t&1&&(z(0),a(1),S(2,"number"),q()),t&2){let e=c().$implicit;p(),T(" ",y(2,1,e.creditAmount)," ")}}function Di(t,m){if(t&1&&(z(0),a(1),S(2,"number"),q()),t&2){let e=c().$implicit;p(),T(" ",y(2,1,e.balance)," ")}}function Ri(t,m){if(t&1&&(o(0,"tr")(1,"td",59),a(2),r(),o(3,"td",59)(4,"a",60),a(5),r()(),o(6,"td",59)(7,"span",61),S(8,"date"),a(9),S(10,"date"),r()(),o(11,"td",59)(12,"div",16)(13,"a",62),a(14),r(),g(15,Ei,4,2,"div",16)(16,Ii,5,3,"div",16),r()(),o(17,"td",63),g(18,wi,3,3,"ng-container",64),r(),o(19,"td",63),g(20,Ti,3,3,"ng-container",64),r(),o(21,"td",65),g(22,Di,3,3,"ng-container",64),r()()),t&2){let e=m.$implicit,n=c(3);p(2),x(e.outletName),p(2),s("routerLink",F(19,li,e.id)),p(),x(e.number),p(2),s("pTooltip",ke(8,13,e.date,"dd MMM y")),p(2),T(" ",ke(10,16,e.date,"dd MMM y")," "),p(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,Ge),p(),x(e.contactName),p(),M(n.buildReferenceUrl(e)?15:16),p(2),s("ngClass",F(21,pi,e.debitAmount!==0)),p(),s("ngIf",e.debitAmount!==0),p(),s("ngClass",F(23,mi,e.creditAmount!==0)),p(),s("ngIf",e.creditAmount!==0),p(2),s("ngIf",e.balance!==0)}}function Fi(t,m){if(t&1&&(o(0,"tr"),w(1,"td",69),o(2,"td",70),a(3,"Total"),r(),o(4,"td",71),a(5),S(6,"number"),r(),o(7,"td",72),a(8),S(9,"number"),r(),w(10,"td"),r()),t&2){let e=c(3);p(5),T(" ",y(6,2,e.debitSubTotal())," "),p(3),T(" ",y(9,4,e.creditSubTotal())," ")}}function Li(t,m){t&1&&(o(0,"tr")(1,"td",73)(2,"span"),a(3,"No records found."),r()()())}function Vi(t,m){if(t&1){let e=D();o(0,"button",74),I("click",function(){h(e);let i=c(3);return b(i.getGLCount())})("keyup.enter",function(){h(e);let i=c(3);return b(i.getGLCount())}),r()}}function Mi(t,m){if(t&1&&a(0),t&2){let e=c(3);T(" ",e.count()," ")}}function ki(t,m){if(t&1){let e=D();o(0,"p-button",75),I("onClick",function(){h(e);let i=c(3);return b(i.onNextPage())}),r()}}function Ni(t,m){if(t&1&&(o(0,"div",47)(1,"p-table",48),g(2,vi,1,0,"ng-template",null,7,_)(4,yi,15,0,"ng-template",null,8,_)(6,Ri,23,25,"ng-template",null,9,_)(8,Fi,11,6,"ng-template",null,4,_)(10,Li,4,0,"ng-template",null,10,_),r(),o(12,"div",49)(13,"div"),a(14),g(15,Vi,1,0,"button",50)(16,Mi,1,1),a(17," entries "),r(),o(18,"div",33),g(19,ki,1,0,"p-button",51),r()()()),t&2){let e=c(2);p(),s("value",e.items().data.data),p(13),Me(" Showing ",e.pagination().first," to ",e.pagination().end," of "),p(),M(e.totalRecords()===-1?15:16),p(4),M(e.pagination().hasNext?19:-1)}}function Bi(t,m){if(t&1&&g(0,Ni,20,5,"div",46),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Ai(t,m){if(t&1&&(o(0,"div",76)(1,"div",77),w(2,"div",78),r(),o(3,"div",79)(4,"div",27),w(5,"i",80),o(6,"span",81),a(7),S(8,"number"),S(9,"number"),r()()()()),t&2){let e=c();p(),s("formGroup",e.form),p(6),Me("Exporting data from ",y(8,3,e.filter().exportPageNumber)," - ",y(9,5,e.filter().exportPageSize),"")}}function Gi(t,m){if(t&1){let e=D();o(0,"p-button",82),I("onClick",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function Pi(t,m){if(t&1){let e=D();o(0,"p-button",83),I("click",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r(),o(1,"p-button",84),I("click",function(){h(e);let i=c();return b(i.onExport())}),r()}}var Ut=(()=>{class t{getGLCount(){this.reportService.getGLCount(this.filter()).pipe(V(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=C(G),this.route=C(He),this.roleService=C(oe),this.authService=C(Se),this.fb=C(ve),this.coaService=C(ot),this.toastr=C(We),this.dayjsService=C(me),this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.lastGetDataLength=E(0),this.pagination=R(()=>{let e=this.filter(),n=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,i=this.items()?.data?.data?.length||0,l=i==n||this.lastGetDataLength()<e.pageSize;return{first:1,end:e.pageSize>0?i:0,total:n,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:!l}}),this.queryFilter=ye(this.route.queryParamMap.pipe(Be(e=>{let n=e.get("from")?this.dayjsService.format(new Date(e.get("from"))):null,i=e.get("to")?this.dayjsService.format(new Date(e.get("to"))):null,l={},u=e.get("id");return Ce.IsNotEmpty(u)&&(l=v(f({},l),{accountID:u})),Ce.IsNotEmpty(n)&&Ce.IsNotEmpty(i)&&(l=v(f({},l),{from:n,to:i})),l})),{initialValue:null}),this.loaderMetadata=ye(this.reportService.fetchGeneralLedgerLoader("single",this.queryFilter()),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.filter=R(()=>{let e=this.baseFilter(),n=this.localFilter();return e?f(f({},e),n):null}),this.creditSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.creditAmount)||0),0)),this.balanceSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.balance)||0),0)),this.debitSubTotal=R(()=>(this.items()?.data?.data??[]).reduce((n,i)=>n+(Number(i.debitAmount)||0),0)),this.initializeForm(),fe(()=>{let e=this.filter();e&&(Ce.IsEmpty(this.form.value.accountID)||this.form.value.accountID!==e.accountID)&&this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1})}),fe(()=>{let e=this.filter(),n=this.form.value.accountID;!e||Ce.IsEmpty(n)||this.reportService.fetchGeneralLedgerReport(e).subscribe(i=>{this.lastGetDataLength.set(i.data?.data?.length),this.items.update(l=>e.pageNumber===1?i:v(f({},i),{data:v(f({},i.data),{data:[...l?.data.data??[],...i.data.data]})}))})})}buildReferenceUrl(e){return pt(e)}ngOnInit(){this.route.queryParamMap.pipe(Ae(e=>e.keys.length>0)).subscribe({next:()=>this.initDialogVisible.set(!0)})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null,[Gt.required]),from:this.fb.control(null),to:this.fb.control(new Date),contactType:this.fb.control(null),contactID:this.fb.control(""),listOutletID:this.fb.control([]),pageNumber:this.fb.control(1),pageSize:this.fb.control(50),sortAscending:this.fb.control(!0),listAccountID:this.fb.control([]),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportPageSize:this.fb.control(0)})}findNodeByKey(e,n){for(let i of e){if(i.key===n)return i;if(i.children){let l=this.findNodeByKey(i.children,n);if(l)return l}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((n,[i,l])=>{switch(i){case"from":n[i]=l&&(typeof l=="string"||typeof l=="number"||l instanceof Date)?this.dayjsService.from(l)?.toDate():null;break;case"to":n[i]=l&&(typeof l=="string"||typeof l=="number"||l instanceof Date)?this.dayjsService.from(l)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(l)?n[i]=l.map(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):n[i]=[];break;case"listOutletID":case"listAccountID":n[i]=Array.isArray(l)?l:[];break;case"pageNumber":case"pageSize":case"exportPageNumber":case"exportPageSize":n[i]=l!=null?Number(l):0;break;case"sortAscending":case"export":n[i]=!!l;break;case"contactType":n[i]=l!=null?Number(l):null;break;default:n[i]=l}return n},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(V(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(V(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(V(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>=1&&this.toastr.warning("Please select at least 1 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e),this.totalRecords()!==-1&&this.getGLCount()}buildFilterBody(){let l=this.form.getRawValue(),{from:e,to:n}=l,i=xe(l,["from","to"]);return v(f({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportGeneralLedger(e,{responseType:"blob",observe:"response"}).pipe(V(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),l="download.csv";if(i){let d=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);d?.[1]&&(l=decodeURIComponent(d[1].replace(/"/g,"")))}let u=e.body;lt(u,l,u.type)}buildExportBody(){let l=this.form.value,{from:e,to:n}=l,i=xe(l,["from","to"]);return v(f({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(f({},e),{pageNumber:n+1,balance:this.items().data.data[this.items().data.data.length-1]?.balance??0,credit:this.items().data.data[this.items().data.data.length-1]?.creditAmount??0,debit:this.items().data.data[this.items().data.data.length-1]?.debitAmount??0})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(f({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(f({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(l=>v(f({},l),{pageNumber:i}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-general-ledger"]],decls:13,vars:13,consts:[["filters",""],["actionButton",""],["content",""],["closeIconTemplate",""],["footer",""],["selectedItem",""],["item",""],["caption",""],["header",""],["body",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export General Ledger",3,"visibleChange","modal","visible","breakpoints"],["class","d-flex flex-column gap-3",4,"ngIf"],["class","d-flex flex-column row-gap-3",3,"formGroup",4,"ngIf"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","accountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"virtualScroll","virtualScrollItemSize","options","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","iconDisplay","input","inputId","icondisplay",3,"showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["for",""],[1,"row"],[1,"col-4"],[1,"d-flex","align-items-center","gap-2"],["name","sortAscending","formControlName","sortAscending","inputId","asc",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["name","sortAscending","formControlName","sortAscending","inputId","desc",3,"value"],["for","desc",1,"m-0"],[1,"d-flex","gap-2"],[1,""],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"text-danger"],[1,"flex","items-center","gap-2"],["name","contactType","formControlName","contactType",3,"value","inputId"],[1,"m-0",3,"for"],["formControlName","contactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined","fs-3"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],["class","px-3 h-100 bg-white border-top",4,"ngIf"],[1,"px-3","h-100","bg-white","border-top"],[3,"value"],[1,"d-flex","justify-content-between","align-items-center","my-2"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next"],[1,"d-flex","gap-1"],[2,"width","120px"],[2,"width","380px"],[2,"width","240px"],[2,"width","150px"],[1,"text-end",2,"width","120px"],[1,"text-end",2,"width","140px"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],["tooltipPosition","top",3,"pTooltip"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break",3,"ngClass"],[4,"ngIf"],[1,"text-end","text-break"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],[2,"white-space","normal","word-break","break-word"],["colspan","3"],[1,"text-end","fw-semibold"],[1,"text-end","fw-semibold","text-success"],[1,"text-end","fw-semibold","text-danger"],["colspan","8"],["type","button","aria-label","Get journal entry count","tabindex","0",1,"fa-solid","fa-circle-question","cursor-pointer","p-0","border-0","bg-transparent",3,"click","keyup.enter"],["variant","outlined","severity","secondary","icon","fa-solid fa-angle-right","size","small","label","next",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(n,i){if(n&1){let l=D();o(0,"app-main-panel",11),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.initDialogVisible,d)||(i.initDialogVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOKEvent())}),g(1,bi,1,1,"ng-template",null,0,_)(3,Si,4,1,"ng-template",null,1,_)(5,Bi,1,1,"ng-template",null,2,_),r(),o(7,"p-dialog",12),P("visibleChange",function(d){return h(l),B(i.isDialogExportVisible,d)||(i.isDialogExportVisible=d),b(d)}),g(8,Ai,10,7,"div",13)(9,Gi,1,2,"ng-template",null,3,_)(11,Pi,2,0,"ng-template",null,4,_),r()}n&2&&(s("pageTitle",i.pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible),s("isFilterable",!0),A("isInitDialogFilterVisible",i.initDialogVisible),s("scrollable",!0),p(7),Pe(L(11,oi)),s("modal",!0),A("visible",i.isDialogExportVisible),s("breakpoints",L(12,ri)),p(),s("ngIf",i.form&&i.filter()))},dependencies:[re,K,ze,H,W,qe,ae,ce,se,tt,et,ie,te,Te,Ht,pe,le,Re,De,ee,J,Y,X,Q,Z,ue,de,Ee,Ue,at,rt,ne,$,U,nt,it,zt,jt,Ke],styles:["[_nghost-%COMP%] .p-datatable .p-datatable-header{padding:.75rem 1rem .75rem 0}"],changeDetection:0})}}return t})();var Oi={data:{},filter:{EntityID:[],CashierID:null,Text:null,from:null,to:null},isLoading:!0,loader:{options:{outlets:[]},filter:{from:"",to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}}},ht=Ye(Ze(Oi),Xe(t=>{let m={totalCOGS:R(()=>{let e=t.data()?.data?.cogs;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalRevenue:R(()=>{let e=t.data()?.data?.revenue;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),totalExpense:R(()=>{let e=t.data()?.data?.expense;return Array.isArray(e)?e.reduce((n,i)=>n+(i?.amount??0),0):0}),grossProfit:R(()=>Array.isArray(t.data()?.data?.cogs)&&Array.isArray(t.data()?.data?.revenue)?m.totalRevenue()-m.totalCOGS():0),profitOrLoss:R(()=>m.totalRevenue()-m.totalCOGS()-m.totalExpense()),isDataEmpty:R(()=>Object.keys(t.data()?.data??{}).length===0)};return m}),Qe(t=>{let m=C(G),e=C(me),n={updateFilter(i){O(t,l=>v(f({},l),{filter:f(f({},l.filter),i)}))},getLoader:Ie(he(be(()=>m.getIncomeStatementLoader().pipe(we({next:i=>{O(t,l=>v(f({},l),{loader:i,filter:v(f({},l.filter),{from:e.from(i.filter.from).format(),to:e.from(i.filter.to).format()})})),n.getIncomeStatement(t.filter)},error:i=>{console.error(i)}}))))),getIncomeStatement:Ie(he(be(i=>m.getIncomeStatement(i).pipe(Rt(()=>O(t,l=>v(f({},l),{isLoading:!0}))),we({next:l=>{O(t,u=>v(f({},u),{data:l,isLoading:!1}))},error:l=>{console.error(l)}})))))};return n}),Je({onInit:t=>{t.getLoader()}}));var bt=()=>({}),Ct=t=>["/pages/chart-of-account/account/",t],St=()=>["/pages/report/general-ledger"],vt=(t,m,e)=>({id:t,from:m,to:e});function zi(t,m){if(t&1){let e=D();o(0,"p-button",10),I("onClick",function(){h(e);let i=c(2);return b(i.onExport())}),r()}}function qi(t,m){if(t&1&&(o(0,"div",8),g(1,zi,1,0,"p-button",9),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global().export)}}function Hi(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",16),a(6,"Total"),r()())}function Wi(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=_e(0),i=_e(1);p(2),x(e.code),p(2),s("routerLink",F(8,Ct,e.accountID)),p(),x(e.name),p(2),s("routerLink",L(10,St))("queryParams",je(11,vt,e.accountID,n,i)),p(),x(y(9,6,e.amount))}}function Ki(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total Revenue :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()()),t&2){let e=c(3);p(6),x(y(7,1,e.store.totalRevenue()))}}function Ui(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No revenue records available"),r()()())}function $i(t,m){if(t&1&&(o(0,"h6",12),a(1,"Revenue"),r(),o(2,"p-table",13),g(3,Hi,7,0,"ng-template",null,3,_)(5,Wi,10,15,"ng-template",null,4,_)(7,Ki,8,3,"ng-template",null,5,_)(9,Ui,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.revenue)}}function Yi(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",24),a(6,"Total"),r()())}function Xi(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=_e(0),i=_e(1);p(2),x(e.code),p(2),s("routerLink",F(8,Ct,e.accountID)),p(),x(e.name),p(2),s("routerLink",L(10,St))("queryParams",je(11,vt,e.accountID,n,i)),p(),x(y(9,6,e.amount))}}function Ji(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total COGS :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Gross Profit :"),r(),o(13,"span",22),a(14),S(15,"number"),r()()()()),t&2){let e=c(3);p(6),x(y(7,2,e.store.totalCOGS())),p(8),x(y(15,4,e.store.grossProfit()))}}function Qi(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No COGS records available"),r()()())}function Zi(t,m){if(t&1&&(o(0,"h4",12),a(1,"COGS"),r(),o(2,"p-table",13),g(3,Yi,7,0,"ng-template",null,3,_)(5,Xi,10,15,"ng-template",null,4,_)(7,Ji,16,6,"ng-template",null,5,_)(9,Qi,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.cogs)}}function en(t,m){t&1&&(o(0,"tr")(1,"th",14),a(2,"Code"),r(),o(3,"th",15),a(4,"Name"),r(),o(5,"th",16),a(6,"Total"),r()())}function tn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",17),a(5),r()(),o(6,"td",16)(7,"a",18),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;c(2);let n=_e(0),i=_e(1);p(2),x(e.code),p(2),s("routerLink",F(8,Ct,e.accountID)),p(),x(e.name),p(2),s("routerLink",L(10,St))("queryParams",je(11,vt,e.accountID,n,i)),p(),x(y(9,6,e.amount))}}function nn(t,m){if(t&1&&(o(0,"tr")(1,"td",19)(2,"div",20)(3,"span",21),a(4,"Total Expense :"),r(),o(5,"span",22),a(6),S(7,"number"),r()()()(),o(8,"tr")(9,"td",19)(10,"div",20)(11,"span",21),a(12,"Profit / Loss :"),r(),o(13,"span",22),a(14),S(15,"number"),r()()()()),t&2){let e=c(3);p(6),x(y(7,2,e.store.totalExpense())),p(8),x(y(15,4,e.store.profitOrLoss()))}}function on(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No expense records available"),r()()())}function rn(t,m){if(t&1&&(o(0,"h4",12),a(1,"Expense"),r(),o(2,"p-table",13),g(3,en,7,0,"ng-template",null,3,_)(5,tn,10,15,"ng-template",null,4,_)(7,nn,16,6,"ng-template",null,5,_)(9,on,4,0,"ng-template",null,6,_),r()),t&2){let e,n=c(2);p(2),s("value",(e=n.store.data())==null||e.data==null?null:e.data.expense)}}function an(t,m){if(t&1&&(Vt(0)(1),o(2,"p-panel")(3,"div",11),g(4,$i,11,1)(5,Zi,11,1)(6,rn,11,1),r()()),t&2){let e,n,i,l,u,d=c();mt((e=d.store.filter())!=null&&e.from?d.store.filter().from:null),p(),mt((n=d.store.filter())!=null&&n.to?d.store.filter().to:null),p(3),M(d.Object.keys((i=d.store.data().data)!==null&&i!==void 0?i:L(5,bt)).length>0?4:-1),p(),M(d.Object.keys((l=(l=d.store.data().data)==null?null:l.cogs)!==null&&l!==void 0?l:L(6,bt)).length>0?5:-1),p(),M(d.Object.keys((u=(u=d.store.data().data)==null?null:u.expense)!==null&&u!==void 0?u:L(7,bt)).length>0?6:-1)}}function ln(t,m){if(t&1){let e=D();o(0,"form",25)(1,"div",26)(2,"label",27),a(3,"Outlet"),r(),w(4,"p-multiselect",28),r(),o(5,"div",26)(6,"label",27),a(7,"Cashier"),r(),o(8,"p-autocomplete",29),I("completeMethod",function(i){h(e);let l=c();return b(l.onCashierSearch(i))})("onSelect",function(i){h(e);let l=c();return b(l.onCashierSelect(i))}),r()(),o(9,"div",26)(10,"label",30),a(11,"From - To"),r(),o(12,"div",31),w(13,"p-datepicker",32)(14,"p-datepicker",33),r()()()}if(t&2){let e=c();s("formGroup",e.formFilter),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.loader().options.outlets)("showClear",!0),p(4),s("showClear",!0)("suggestions",e.cashierSuggestions())("showClear",!0),p(5),s("iconDisplay","input")("showIcon",!0),p(),s("iconDisplay","input")("showIcon",!0)}}var $t=(()=>{class t{constructor(){this.dayjsService=C(me),this.store=C(ht),this.fb=C(ve),this.reportService=C(G),this.roleService=C(oe),this.isInitDialogFilterVisible=E(!1),this.dialogFilterVisible=E(!1),this.cashierSuggestions=E([]),this.cashierHashMap=new Map,this.Object=Object,fe(()=>{this.store.filter()&&this.initForm()})}ngOnInit(){this.initForm(),console.log(this.cashierHashMap.entries())}onSearch(e){this.store.updateFilter(v(f({},this.store.filter()),{Text:e}))}onCashierSearch(e){this.reportService.getCashierSuggestions(e.query).pipe(Ne("Cashier Suggestions"),V(n=>this.cashierSuggestions.set(n))).subscribe()}initForm(){let e=this.store.filter();console.log("initForm",this.cashierHashMap.get(e.CashierID)),this.formFilter=this.fb.group({EntityID:this.fb.control(e.EntityID??[]),CashierID:this.fb.control(this.cashierHashMap.get(e.CashierID)??""),Text:this.fb.control(e.Text??""),from:this.fb.control(e.from?this.dayjsService.from(e.from).toDate():null),to:this.fb.control(e.to?this.dayjsService.from(e.to).toDate():null)})}onFilterOK(){let e=this.formFilter.getRawValue(),n=Object.entries(e).reduce((i,[l,u])=>(l==="from"||l==="to"?u instanceof Date&&(i[l]=this.dayjsService.from(u).format()):i[l]=u||null,i),{});this.store.updateFilter(f(f({},this.store.filter()),n)),this.dialogFilterVisible.update(i=>!i),console.log("body",e)}onCashierSelect(e){console.log("Cashier selected:",e),!this.cashierHashMap.has(e.value.Key)&&(this.cashierHashMap.set(e.value.Key,e.value.Value),console.log("Cashier HashMap:",this.cashierHashMap))}onExport(){let e=v(f({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.reportService.getIncomeStatement(e,{responseType:"blob"}).pipe(Ne("Export Profit & Loss"),V(n=>{let i=n.type,l=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(l,{type:i}));let d=`profit-and-loss.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-income-statement"]],features:[Oe([ht])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","isFilterable","pageTitle","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold"],[3,"value"],[2,"width","20%"],[2,"width","30%"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","3",1,"text-end","fw-semibold"],[1,"row"],[1,"col"],[1,"col-1","col-lg-2"],["colspan","3",1,""],[1,"text-end",2,"min-width","10%"],[1,"d-flex","flex-column","gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for",""],["formControlName","EntityID","filterBy","value","appendTo","body","display","chip","optionLabel","value","optionValue","key","placeholder","Select an Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["appendTo","body","formControlName","CashierID","optionLabel","Value","optionValue","Key","styleClass","w-100","inputStyleClass","w-100","field","Value","placeholder","Search a cashier",3,"completeMethod","onSelect","showClear","suggestions"],["for","outlet"],[1,"d-flex","flex-column","gap-2"],["formControlName","from","styleClass","w-100 mb-0","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"]],template:function(n,i){if(n&1){let l=D();o(0,"app-main-panel",7),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOK())}),g(1,qi,2,1,"ng-template",null,0,_)(3,an,7,8,"ng-template",null,1,_)(5,ln,15,12,"ng-template",null,2,_),r()}n&2&&(s("isFilterable",!0)("pageTitle",i.store.data().pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[re,K,H,W,Te,pe,le,ee,J,Y,X,Q,Z,ue,de,ae,ce,se,ne,$e,$,U,Re,De,ie,te],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var yt=Tt(qt());var pn={metadata:{options:{outlets:[]},filter:{to:"",outletID:[]},roles:{isInRoleEmptyOutlet:!1}},data:{asset:[],liability:[],equity:[],pageTitle:""},filter:{date:(0,yt.default)().format("YYYY-MM-DD"),listOutletParam:[]}},Et=Ye(Ze(pn),Xe(t=>({totalAsset:R(()=>t.data().asset.reduce((m,e)=>m+ +e.amount,0)),totalLiability:R(()=>t.data().liability.reduce((m,e)=>m+ +e.counterAmount,0)),totalEquity:R(()=>t.data().equity.reduce((m,e)=>m+ +e.counterAmount,0))})),Qe(t=>{let m=C(G),e={updateFilter:n=>{O(t,i=>v(f({},i),{filter:n}))},fetchBalanceSheet:Ie(he(Ae(()=>{let n=t.filter();return Object.entries(n).every(([i,l])=>l!=null&&l!=="")}),be(n=>m.getBalanceSheet(n).pipe(we({next:i=>{O(t,l=>v(f({},l),{data:i}))},error:i=>{console.error(i)}}))),Dt(1))),fetchLoader:Ie(he(be(()=>m.getBalanceSheetLoader().pipe(we({next:n=>{O(t,i=>v(f({},i),{metadata:n,filter:{date:(0,yt.default)(n.filter.to).format("YYYY-MM-DD")}})),e.fetchBalanceSheet(t.filter)},error:n=>{console.error(n)}})))))};return e}),Je(t=>({onInit:()=>{t.fetchLoader()}})));var Yt=Tt(qt());var It=t=>["/pages/chart-of-account/account/",t],wt=()=>["/pages/report/general-ledger"],mn=(t,m)=>({id:t,to:m}),Xt=t=>({id:t});function sn(t,m){if(t&1){let e=D();o(0,"p-button",11),I("onClick",function(){h(e);let i=c(2);return b(i.onExport())}),r()}}function cn(t,m){if(t&1&&(o(0,"div",9),g(1,sn,1,0,"p-button",10),r()),t&2){let e=c();p(),s("ngIf",e.roleService.global().export)}}function dn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Asset"),r(),o(5,"th",17),a(6,"Total"),r()())}function un(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit,n=c(3);p(2),x(e.code),p(2),s("routerLink",F(8,It,e.accountID)),p(),x(e.name),p(2),s("routerLink",L(10,wt))("queryParams",Mt(11,mn,e.accountID,n.store.filter().date)),p(),x(y(9,6,e.amount))}}function _n(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Asset"),r(),o(3,"td",22),a(4),S(5,"number"),r()()),t&2){let e=c(3);p(4),T(" ",y(5,1,e.store.totalAsset())," ")}}function fn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No asset records found."),r()()())}function gn(t,m){if(t&1&&(o(0,"h4",14),a(1,"Asset"),r(),o(2,"p-table",15),g(3,dn,7,0,"ng-template",null,3,_)(5,un,10,14,"ng-template",null,4,_)(7,_n,6,3,"ng-template",null,5,_)(9,fn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().asset)}}function xn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Liability"),r(),o(5,"th",17),a(6,"Total"),r()())}function hn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",25),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),x(e.code),p(2),s("routerLink",F(8,It,e.accountID)),p(),x(e.name),p(2),s("routerLink",L(10,wt))("queryParams",F(11,Xt,e.accountID)),p(),x(y(9,6,e.counterAmount))}}function bn(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2," Total Liability "),r(),o(3,"td",22),a(4),S(5,"number"),r()()),t&2){let e=c(3);p(4),T(" ",y(5,1,e.store.totalLiability())," ")}}function Cn(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No liability records found."),r()()())}function Sn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Liability"),r(),o(2,"p-table",15),g(3,xn,7,0,"ng-template",null,3,_)(5,hn,10,13,"ng-template",null,4,_)(7,bn,6,3,"ng-template",null,5,_)(9,Cn,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().liability)}}function vn(t,m){t&1&&(o(0,"tr")(1,"th",16),a(2,"Code"),r(),o(3,"th"),a(4,"Equity"),r(),o(5,"th",17),a(6,"Total"),r()())}function yn(t,m){if(t&1&&(o(0,"tr")(1,"td"),a(2),r(),o(3,"td")(4,"a",18),a(5),r()(),o(6,"td",19)(7,"a",20),a(8),S(9,"number"),r()()()),t&2){let e=m.$implicit;p(2),x(e.code),p(2),s("routerLink",F(8,It,e.accountID)),p(),x(e.name),p(2),s("routerLink",L(10,wt))("queryParams",F(11,Xt,e.accountID)),p(),x(y(9,6,e.counterAmount))}}function En(t,m){if(t&1&&(o(0,"tr")(1,"td",21),a(2,"Total Equity"),r(),o(3,"td",22),a(4),S(5,"number"),r()(),o(6,"tr")(7,"td",21),a(8," Total Liability + Equity "),r(),o(9,"td",22),a(10),S(11,"number"),r()()),t&2){let e=c(3);p(4),T(" ",y(5,2,e.store.totalEquity())," "),p(6),T(" ",y(11,4,e.store.totalLiability()+e.store.totalEquity())," ")}}function In(t,m){t&1&&(o(0,"tr")(1,"td",23)(2,"span"),a(3,"No equity records found."),r()()())}function wn(t,m){if(t&1&&(o(0,"h4",24),a(1,"Equity"),r(),o(2,"p-table",15),g(3,vn,7,0,"ng-template",null,3,_)(5,yn,10,13,"ng-template",null,4,_),a(7," <"),g(8,En,12,6,"ng-template",null,5,_)(10,In,4,0,"ng-template",null,6,_),r()),t&2){let e=c(2);p(2),s("value",e.store.data().equity)}}function Tn(t,m){if(t&1&&(o(0,"p-panel",12)(1,"div",13),g(2,gn,11,1)(3,Sn,11,1)(4,wn,12,1),r()()),t&2){let e=c();s("showHeader",!1),p(2),M(e.Object.keys(e.store.data().asset).length>0?2:-1),p(),M(e.Object.keys(e.store.data().liability).length>0?3:-1),p(),M(e.Object.keys(e.store.data().equity).length>0?4:-1)}}function Dn(t,m){if(t&1&&(o(0,"div",31)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;p(2),x(e.value)}}function Rn(t,m){if(t&1&&(o(0,"form",26)(1,"div",27)(2,"label",28),a(3,"Outlet"),r(),o(4,"p-multiselect",29),g(5,Dn,3,1,"ng-template",null,7,_),r()(),o(7,"div",27)(8,"label",28),a(9,"From"),r(),w(10,"p-datepicker",30),r()()),t&2){let e=c();s("formGroup",e.filterForm),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",e.store.metadata().options.outlets)("showClear",!0),p(6),s("iconDisplay","input")("showIcon",!0)}}var Jt=(()=>{class t{constructor(){this.store=C(Et),this.ReportServiceStore=C(G),this.dialogFilterVisible=E(!1),this.isInitDialogFilterVisible=E(!1),this.roleService=C(oe),this.Object=Object}ngOnInit(){this.generateFilterForm()}generateFilterForm(){this.filterForm=new Pt({date:new st(new Date),outletID:new st([])})}onFilterOKEvent(){let{date:e,outletID:n}=this.filterForm.value;this.store.updateFilter({date:(0,Yt.default)(e).format("YYYY-MM-DD"),listOutletParam:n}),this.dialogFilterVisible.update(i=>!i)}onExport(){let e=v(f({},this.store.filter()),{export:!0,ExportPageNumber:1,ExportPageSize:1e4});this.ReportServiceStore.getBalanceSheet(e,{responseType:"blob"}).pipe(Ne("Export Balance Sheet"),V(n=>{let i=n.type,l=[n],u=document.createElement("a");u.href=window.URL.createObjectURL(new Blob(l,{type:i}));let d=`balance-sheet.${i.split("/")[1]}`;u.setAttribute("download",d),document.body.appendChild(u),u.click(),document.body.removeChild(u)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-balance-sheet"]],features:[Oe([Et])],decls:7,vars:5,consts:[["actionButton",""],["content",""],["filters",""],["header",""],["body",""],["footer",""],["emptymessage",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isFilterable","isDialogFilterVisible","isInitDialogFilterVisible","scrollable"],[1,"d-flex","gap-2"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],[3,"showHeader"],[1,"d-flex","flex-column","gap-3"],[1,"fs-5","fw-semibold","mt-3"],[3,"value"],[2,"width","20%"],[1,"text-end",2,"width","5%"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"text-end"],["target","_blank",1,"link","link-primary",3,"routerLink","queryParams"],["colspan","2",1,"fw-semibold","text-end"],[1,"text-end","fw-semibold"],["colspan","3",1,""],[1,"fs-5","fw-semibold"],["target","_blank",1,"link","link-primary","d-flex","align-items-center",3,"routerLink"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],[1,"d-flex","flex-column"],["for","outlet"],["formControlName","outletID","display","chip","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlet",3,"virtualScroll","virtualScrollItemSize","options","showClear"],["formControlName","date","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],[1,"flex","items-center","gap-2"]],template:function(n,i){if(n&1){let l=D();o(0,"app-main-panel",8),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.isInitDialogFilterVisible,d)||(i.isInitDialogFilterVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOKEvent())}),g(1,cn,2,1,"ng-template",null,0,_)(3,Tn,5,4,"ng-template",null,1,_)(5,Rn,11,7,"ng-template",null,2,_),r()}n&2&&(s("pageTitle",i.store.data().pageTitle)("isFilterable",!0),A("isDialogFilterVisible",i.dialogFilterVisible)("isInitDialogFilterVisible",i.isInitDialogFilterVisible),s("scrollable",!0))},dependencies:[re,K,H,W,ce,se,ae,ie,te,ee,J,Y,X,Q,Z,ue,de,pe,le,Ee,ne,$e,$,U],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Qt=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-comparative-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),a(1,"report-comparative-balance works!"),r(),a(2,`
|
|
2
|
+
,
|
|
3
|
+
`))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Zt=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-cash-flow"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),a(1,"report-cash-flow works!"),r(),a(2,`
|
|
4
|
+
,
|
|
5
|
+
`))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var ei=(()=>{class t{static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-trial-balance"]],decls:3,vars:0,template:function(n,i){n&1&&(o(0,"p"),a(1,"report-trial-balance works!"),r(),a(2,`
|
|
6
|
+
,
|
|
7
|
+
`))},styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Fn=()=>({width:"30vw"}),Ln=()=>({"1199px":"75vw","575px":"90vw"}),Vn=t=>["/pages/journal/journal-entry/",t],Mn=t=>({"text-success":t}),kn=t=>({"text-danger":t}),Nn=t=>({"ng-dirty ng-invalid":t}),Bn=()=>({scrollHeight:"250px"});function An(t,m){if(t&1){let e=D();o(0,"p-button",27),I("onClick",function(){h(e);let i=c(2);return b(i.onToggleExportDialog())}),r()}}function Gn(t,m){if(t&1&&(o(0,"div",24)(1,"a",25),a(2,"Return to Accounts"),r(),g(3,An,1,0,"p-button",26),r()),t&2){let e=c();p(3),s("ngIf",e.roleService.global().export)}}function Pn(t,m){if(t&1&&(o(0,"div",24)(1,"span",31)(2,"h2",32),a(3),r()(),o(4,"span",31)(5,"h2",32),a(6),r()()()),t&2){let e=c().$implicit;p(3),x(e.name),p(3),T(" (",e.chartOfAccountCode,") ")}}function On(t,m){t&1&&(o(0,"tr")(1,"th",33),a(2,"Outlet"),r(),o(3,"th",33),a(4,"No."),r(),o(5,"th",33),a(6,"Date"),r(),o(7,"th"),a(8,"Contact / Note"),r(),o(9,"th",34),a(10,"Debit"),r(),o(11,"th",35),a(12,"Credit"),r(),o(13,"th",35),a(14,"Balance"),r()())}function jn(t,m){if(t&1&&(o(0,"div",38),w(1,"div",43),o(2,"span",44),a(3),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.journalNote,j),p(2),T("",e.note," ")}}function zn(t,m){if(t&1&&(o(0,"div",38),w(1,"span",43)(2,"div",43),o(3,"span",44),a(4),r()()),t&2){let e=c().$implicit;p(),s("innerHTML",e.referenceText,j),p(),s("innerHTML",e.journalNote,j),p(2),T("",e.note," ")}}function qn(t,m){if(t&1&&(z(0),a(1),S(2,"number"),q()),t&2){let e=c().$implicit;p(),T(" ",y(2,1,e.debitAmount)," ")}}function Hn(t,m){if(t&1&&(z(0),a(1),S(2,"number"),q()),t&2){let e=c().$implicit;p(),T(" ",y(2,1,e.creditAmount)," ")}}function Wn(t,m){if(t&1&&(z(0),a(1),S(2,"number"),q()),t&2){let e=c().$implicit;p(),T(" ",y(2,1,e.balance)," ")}}function Kn(t,m){if(t&1&&(o(0,"tr")(1,"td",36),a(2),r(),o(3,"td",36)(4,"a",37),a(5),r()(),o(6,"td",36),a(7),S(8,"date"),r(),o(9,"td",36)(10,"div",38)(11,"a",39),a(12),r(),g(13,jn,4,2,"div",38)(14,zn,5,3,"div",38),r()(),o(15,"td",40),g(16,qn,3,3,"ng-container",41),r(),o(17,"td",40),g(18,Hn,3,3,"ng-container",41),r(),o(19,"td",42),g(20,Wn,3,3,"ng-container",41),r()()),t&2){let e=m.$implicit,n=c(4);p(2),x(e.outletName),p(2),s("routerLink",F(15,Vn,e.id)),p(),x(e.number),p(2),x(ke(8,12,e.date,"dd MMM yyyy")),p(4),s("href",n.authService.getTenantExternalURL()+"/menu/Contacts/Contact/Customers/Info?ID="+e.contactID,Ge),p(),x(e.contactName),p(),M(n.buildReferenceUrl(e)?13:14),p(2),s("ngClass",F(17,Mn,e.debitAmount!==0)),p(),s("ngIf",e.debitAmount!==0),p(),s("ngClass",F(19,kn,e.creditAmount!==0)),p(),s("ngIf",e.creditAmount!==0),p(2),s("ngIf",e.balance!==0)}}function Un(t,m){if(t&1&&(o(0,"tr"),w(1,"td",45),o(2,"td",46),a(3,"Total"),r(),o(4,"td",47),a(5),S(6,"number"),r(),o(7,"td",48),a(8),S(9,"number"),r(),w(10,"td"),r()),t&2){let e=c().$index,n=c(3);p(5),T(" ",y(6,2,n.items().data[e].debitTotal)," "),p(3),T(" ",y(9,4,n.items().data[e].creditTotal)," ")}}function $n(t,m){t&1&&(o(0,"tr")(1,"td",49)(2,"span"),a(3,"No records found."),r()()())}function Yn(t,m){if(t&1&&(o(0,"p-table",30),g(1,Pn,7,2,"ng-template",null,5,_)(3,On,15,0,"ng-template",null,6,_)(5,Kn,21,21,"ng-template",null,7,_)(7,Un,11,6,"ng-template",null,4,_)(9,$n,4,0,"ng-template",null,8,_),r()),t&2){let e=m.$implicit;s("value",e.data)}}function Xn(t,m){if(t&1&&(o(0,"div",29),Le(1,Yn,11,1,"p-table",30,Fe),r()),t&2){let e=c(2);p(),Ve(e.items().data)}}function Jn(t,m){if(t&1&&g(0,Xn,3,0,"div",28),t&2){let e=c();s("ngIf",e.items()&&e.items().data)}}function Qn(t,m){if(t&1&&(o(0,"div",24)(1,"div",31)(2,"span",65),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",31)(8,"span",66),a(9),r()()()),t&2){let e=m.$implicit;p(3),T("(",e.code,")"),p(6),x(e.name)}}function Zn(t,m){if(t&1&&(o(0,"div",24)(1,"div",31)(2,"span",65),a(3),r()(),o(4,"div")(5,"span"),a(6,"-"),r()(),o(7,"div",31)(8,"span",66),a(9),r()()()),t&2){let e=m.$implicit;p(3),T("(",e.code,")"),p(6),x(e.name)}}function eo(t,m){t&1&&(o(0,"div",67),a(1," Account is required. "),r())}function to(t,m){if(t&1&&(o(0,"div",68)(1,"div"),a(2),r()()),t&2){let e=m.$implicit;p(2),x(e.value)}}function io(t,m){if(t&1&&(o(0,"div",59)(1,"div",21),w(2,"p-radiobutton",69),o(3,"label",70),a(4),r()()()),t&2){let e=m.$implicit;p(2),s("value",e.key)("inputId",e.key),p(),Lt("for",e.key),p(),x(e.value)}}function no(t,m){if(t&1){let e=D();o(0,"div",38)(1,"label",51),a(2,"Customer"),r(),o(3,"p-autocomplete",71),I("completeMethod",function(i){h(e);let l=c(2);return b(l.searchCustomer(i))}),r()()}if(t&2){let e=c(2);p(3),s("suggestions",e.customerSuggestions())}}function oo(t,m){if(t&1){let e=D();o(0,"div",38)(1,"label",51),a(2,"Supplier"),r(),o(3,"p-autocomplete",72),I("completeMethod",function(i){h(e);let l=c(2);return b(l.searchSupplier(i))}),r()()}if(t&2){let e=c(2);p(3),s("suggestions",e.supplierSuggestions())}}function ro(t,m){if(t&1){let e=D();o(0,"div",38)(1,"label",51),a(2,"Customer"),r(),o(3,"p-autocomplete",71),I("completeMethod",function(i){h(e);let l=c(2);return b(l.searchCustomer(i))}),r()()}if(t&2){let e=c(2);p(3),s("suggestions",e.customerSuggestions())}}function ao(t,m){if(t&1){let e=D();o(0,"form",50)(1,"div",38)(2,"label",51),a(3,"Accounts"),r(),o(4,"p-multiselect",52),I("onChange",function(i){h(e);let l=c();return b(l.onAccountChange(i))}),g(5,Qn,10,2,"ng-template",null,9,_)(7,Zn,10,2,"ng-template",null,10,_),r(),g(9,eo,2,0,"div",53),r(),o(10,"div",38)(11,"label",51),a(12,"From"),r(),o(13,"div",54),w(14,"p-datepicker",55)(15,"p-datepicker",56),r()(),o(16,"div",38)(17,"label",51),a(18,"Outlets"),r(),o(19,"p-multiselect",57),g(20,to,3,1,"ng-template",null,10,_),r()(),o(22,"div",38)(23,"label",51),a(24,"Category"),r(),o(25,"p-treeselect",58),I("onFocus",function(){h(e);let i=c();return b(i.onCategoryFocus())}),r()(),o(26,"div",38)(27,"label",18),a(28,"Contact Type"),r(),o(29,"div",16),Le(30,io,5,4,"div",59,Fe),r()(),o(32,"div",38)(33,"label",18),a(34,"Sort order"),r(),o(35,"div",16)(36,"div",59)(37,"div",21),w(38,"p-radiobutton",60),o(39,"label",61),a(40,"Asc"),r()()(),o(41,"div",62)(42,"div",21),w(43,"p-radiobutton",63),o(44,"label",64),a(45,"Desc"),r()()()()(),g(46,no,4,1,"div",38)(47,oo,4,1,"div",38)(48,ro,4,1,"div",38),r()}if(t&2){let e,n,i,l,u,d,k=c();s("formGroup",k.form),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",(e=k.loaderMetadata())==null||e.options==null?null:e.options.accounts)("selectionLimit",5)("ngClass",F(22,Nn,((n=k.form.get("listAccountID"))==null?null:n.invalid)&&(((n=k.form.get("listAccountID"))==null?null:n.touched)||((n=k.form.get("listAccountID"))==null?null:n.dirty)))),p(5),s("ngIf",((i=k.form.get("listAccountID"))==null?null:i.invalid)&&(((i=k.form.get("listAccountID"))==null?null:i.touched)||((i=k.form.get("listAccountID"))==null?null:i.dirty))),p(5),s("iconDisplay","input")("showIcon",!0),p(),s("iconDisplay","input")("showIcon",!0),p(4),s("virtualScroll",!0)("virtualScrollItemSize",50)("options",(l=k.loaderMetadata())==null||l.options==null?null:l.options.outlets),p(6),s("metaKeySelection",!1)("virtualScroll",!0)("virtualScrollItemSize",50)("virtualScrollOptions",L(24,Bn))("options",k.categoriesOptions()),p(5),Ve((u=k.loaderMetadata())==null||u.options==null?null:u.options.contactTypeOptions),p(8),s("value",!0),p(5),s("value",!1),p(3),M((d=k.form.controls.contactType.value)===1?46:d===2?47:48)}}function lo(t,m){if(t&1){let e=D();o(0,"p-button",73),I("onClick",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r()}t&2&&s("rounded",!0)("text",!0)}function po(t,m){if(t&1){let e=D();o(0,"p-button",74),I("click",function(){h(e);let i=c();return b(i.onToggleExportDialog())}),r(),o(1,"p-button",75),I("click",function(){h(e);let i=c();return b(i.onExport())}),r()}}var ti=(()=>{class t{buildReferenceUrl(e){return pt(e)}getGLCount(){this.reportService.getGLCount(this.filter()).pipe(V(({count:e})=>{this.totalRecords.set(e)})).subscribe()}onToggleExportDialog(){this.isDialogExportVisible.update(e=>!e)}get pageTitle(){return this.items()&&this.items().pageTitle?this.items().pageTitle:"General Ledger"}constructor(){this.reportService=C(G),this.route=C(He),this.roleService=C(oe),this.authService=C(Se),this.fb=C(ve),this.coaService=C(ot),this.toastr=C(We),this.dayjsService=C(me),this.infinity=1/0,this.metadata=E(null),this.items=E(null),this.totalRecords=E(-1),this.dialogFilterVisible=E(!0),this.initDialogVisible=E(!1),this.isDialogExportVisible=E(!1),this.customerSuggestions=E([]),this.supplierSuggestions=E([]),this.categoriesOptions=E([]),this.localFilter=E({}),this.count=R(()=>this.totalRecords()<0?1/0:this.totalRecords()),this.pagination=R(()=>{let e=this.filter(),n=this.totalRecords()!=null&&this.totalRecords()>=0?this.totalRecords():1/0,i=Math.min(e.pageNumber*e.pageSize,isFinite(n)?n:e.pageNumber*e.pageSize);return{first:1,end:e.pageSize>0?i:0,total:n,page:e.pageNumber,pageSize:e.pageSize,hasPrev:e.pageNumber>1,hasNext:isFinite(n)?e.pageNumber*e.pageSize<n:!0}}),this.loaderMetadata=ye(this.reportService.fetchGeneralLedgerLoader("multiple"),{initialValue:null}),this.baseFilter=R(()=>{let e=this.loaderMetadata();return e?e.filter:null}),this.exportFileTypes=E([{key:0,value:"CSV"},{key:1,value:"Excel"}]),this.queryFilter=ye(this.route.queryParamMap.pipe(Be(e=>({accountID:e.get("id"),to:e.get("to")}))),{initialValue:null}),this.filter=R(()=>{let e=this.baseFilter(),n=this.queryFilter(),i=this.localFilter();return e?f(f(f({},e),n??{}),i):null}),this.creditSubTotal=R(()=>0),this.debitSubTotal=R(()=>0),this.initializeForm(),fe(()=>{let e=this.filter();if(e){this.form.patchValue(this.transformFilterToFormValue(e),{emitEvent:!1});let n=Array.isArray(e.listAccountID)?e.listAccountID:[],i=Array.isArray(e.listCategoryID)?e.listCategoryID:[];(n.length>0||i.length>0)&&this.reportService.fetchGeneralLedgerReport(e,"multiple").pipe().subscribe(l=>{this.items.set(l)})}})}initializeForm(){this.form=this.fb.group({accountID:this.fb.control(null),from:this.fb.control(null),to:this.fb.control(new Date),contactType:this.fb.control(null),contactID:this.fb.control(""),listOutletID:this.fb.control([]),pageNumber:this.fb.control(1),pageSize:this.fb.control(50),sortAscending:this.fb.control(!0),listCategoryID:this.fb.control([]),listAccountID:this.fb.control([]),export:this.fb.control(!1),exportPageNumber:this.fb.control(1),exportPageSize:this.fb.control(0)})}findNodeByKey(e,n){for(let i of e){if(i.key===n)return i;if(i.children){let l=this.findNodeByKey(i.children,n);if(l)return l}}return null}transformFilterToFormValue(e){return Object.entries(e).reduce((n,[i,l])=>{switch(i){case"from":break;case"to":n[i]=l&&(typeof l=="string"||typeof l=="number"||l instanceof Date)?this.dayjsService.from(l)?.toDate():this.dayjsService.now.toDate();break;case"listCategoryID":Array.isArray(l)?n[i]=l.map(u=>this.findNodeByKey(this.categoriesOptions(),u)).filter(u=>!!u):n[i]=[];break;case"listOutletID":case"listAccountID":n[i]=Array.isArray(l)?l:[];break;case"pageNumber":case"pageSize":case"exportPageNumber":case"exportPageSize":n[i]=l!=null?Number(l):0;break;case"sortAscending":case"export":n[i]=!!l;break;case"contactType":console.log("contactType value:",l),n[i]=l!=null?Number(l):null;break;default:n[i]=l}return n},{})}clearContactValueOnContactTypeChange(){this.form.get("contactType")?.valueChanges.subscribe(()=>this.form.get("contactID")?.setValue(""))}onFormValueChange(){let e=this.form.controls.listAccountID.value,n=this.form.controls.listCategoryID.value;e.length<=0&&n.length<=0?(this.form.controls.listAccountID.enable({emitEvent:!1}),this.form.controls.listCategoryID.enable({emitEvent:!1})):e.length>0?(this.form.controls.listAccountID.enable({emitEvent:!1}),this.form.controls.listCategoryID.disable({emitEvent:!1})):n.length>0&&(this.form.controls.listAccountID.disable({emitEvent:!1}),this.form.controls.listCategoryID.enable({emitEvent:!1}))}isEmpty(e){return e==null||typeof e=="string"&&e.trim().length===0}onCategoryFocus(){this.coaService.getCachedCategoriesOptions().pipe(V(e=>this.categoriesOptions.set(e))).subscribe()}searchCustomer(e){this.reportService.getCustomerSuggestions(e.query).pipe(V(n=>this.customerSuggestions.set(n))).subscribe()}searchSupplier(e){this.reportService.getSupplierSuggestions(e.query).pipe(V(n=>this.supplierSuggestions.set(n))).subscribe()}onAccountChange(e){Array.isArray(e.value)&&e.value.length>5&&this.toastr.warning("Please select at most 5 accounts for the general ledger report.","Warning")}onFilterOKEvent(){if(this.form.invalid){this.form.markAllAsTouched(),this.dialogFilterVisible.set(!0);return}let e=this.buildFilterBody();this.dialogFilterVisible.set(!1),this.localFilter.set(e)}buildFilterBody(){let l=this.form.value,{from:e,to:n}=l,i=xe(l,["from","to"]);return v(f({},this.filter()),{pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,listCategoryID:i.listCategoryID?.map(u=>u.key)??[],contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType})}onExport(){let e=this.buildExportBody();this.performExport(e)}performExport(e){this.reportService.exportMultiLedger(e,{responseType:"blob",observe:"response"}).pipe(V(n=>this.handleExportResponse(n))).subscribe()}handleExportResponse(e){let n=e.headers,i=n.get("Content-Disposition")??n.get("content-disposition"),l="download.csv";if(i){let d=i.match(/filename\*?=(?:UTF-8'')?"?([^;\r\n"]+)/i);d?.[1]&&(l=decodeURIComponent(d[1].replace(/"/g,"")))}let u=e.body;lt(u,l,u.type)}buildExportBody(){let l=this.form.value,{from:e,to:n}=l,i=xe(l,["from","to"]);return v(f({},this.filter()),{exportPageNumber:+i.exportPageNumber,pageNumber:i.pageNumber,pageSize:i.pageSize,sortAscending:i.sortAscending,accountID:i.accountID,listCategoryID:i.listCategoryID?.map(u=>u.key)??[],contactID:i.contactID?.length===0?null:i.contactID,listOutletID:i.listOutletID??[],listAccountID:i.listAccountID??[],from:this.dayjsService.from(e)?this.dayjsService.format(e):null,to:this.dayjsService.from(n)?this.dayjsService.format(n):null,contactType:i.contactType,export:!0})}onNextPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(f({},e),{pageNumber:n+1})})}onPrevPage(){this.localFilter.update(e=>{let n=e.pageNumber??this.baseFilter()?.pageNumber??1;return v(f({},e),{pageNumber:Math.max(1,n-1)})})}goToPage(e){this.localFilter.update(n=>v(f({},n),{pageNumber:e}))}goToLastPage(){let e=this.filter();if(!e)return;let n=this.totalRecords();if(n===-1||!isFinite(n)){this.toastr.info("Please load total records before going to the last page","Info");return}let i=Math.ceil(n/e.pageSize);if(e.pageNumber>=i){this.toastr.warning("You are already on the last page","Warning");return}this.localFilter.update(l=>v(f({},l),{pageNumber:i}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=N({type:t,selectors:[["app-report-multiple-ledger"]],decls:28,vars:19,consts:[["actionButton",""],["content",""],["filters",""],["closeIconTemplate",""],["footer",""],["caption",""],["header",""],["body",""],["emptymessage",""],["selectedItem",""],["item",""],[3,"isDialogFilterVisibleChange","isInitDialogFilterVisibleChange","filterConfirmed","pageTitle","isDialogFilterVisible","isFilterable","isInitDialogFilterVisible","scrollable"],["header","Export Journal Entry",3,"visibleChange","modal","visible","breakpoints"],[1,"d-flex","flex-column","gap-3"],[1,"row",3,"formGroup"],[1,"col-8"],[1,"row"],[1,"col"],["for",""],["type","text","formControlName","exportPageNumber","fluid","","pInputText","","pSize","small"],["role","alert",1,"alert","alert-primary","m-0","p-2"],[1,"d-flex","align-items-center","gap-2"],[1,"fa-solid","fa-circle-info"],[1,"fs-2","text-dark","fw-semibold"],[1,"d-flex","gap-2"],["routerLink","/pages/chart-of-account/account",1,"p-button","p-button-secondary","p-button-outlined","fs-3"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick",4,"ngIf"],["severity","secondary","variant","outlined","icon","fa-solid fa-upload","label","Export",3,"onClick"],["class","px-3 h-100 bg-white border-top",4,"ngIf"],[1,"px-3","h-100","bg-white","border-top"],[3,"value"],[1,""],[1,"fs-5","fw-semibold"],[2,"width","10%"],[1,"text-end",2,"width","10%"],[1,"text-end",2,"width","20%"],[1,"text-break"],["target","_blank",1,"link","link-primary",3,"routerLink"],[1,"d-flex","flex-column"],["target","_blank",1,"link","link-primary",3,"href"],[1,"text-end","text-break",3,"ngClass"],[4,"ngIf"],[1,"text-end","text-break"],[3,"innerHTML"],[2,"width","300px","white-space","normal","word-break","break-word"],["colspan","3"],[1,"text-end","fw-semibold"],[1,"text-end","fw-semibold","text-success"],[1,"text-end","fw-semibold","text-danger"],["colspan","8"],[1,"d-flex","flex-column","row-gap-3",3,"formGroup"],["for","outlet"],["showClear","","filter","","filterBy","code,name","display","chip","formControlName","listAccountID","appendTo","body","optionLabel","name","optionValue","id","placeholder","Select Accounts",3,"onChange","virtualScroll","virtualScrollItemSize","options","selectionLimit","ngClass"],["class","text-danger",4,"ngIf"],[1,"d-flex","flex-column","gap-2"],["showClear","","formControlName","from","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","formControlName","to","styleClass","w-100","appendTo","body","inputId","icondisplay",3,"iconDisplay","showIcon"],["showClear","","display","chip","formControlName","listOutletID","appendTo","body","optionLabel","value","optionValue","key","placeholder","Select Outlets",3,"virtualScroll","virtualScrollItemSize","options"],["showClear","","display","chip","selectionMode","multiple","filter","","filterBy","label","formControlName","listCategoryID","appendTo","body","containerStyleClass","w-100","optionLabel","label","optionValue","key","placeholder","Select Category",3,"onFocus","metaKeySelection","virtualScroll","virtualScrollItemSize","virtualScrollOptions","options"],[1,"col-4"],["name","sortAscending","formControlName","sortAscending","inputId","asc",3,"value"],["for","asc",1,"m-0"],[1,"col-3"],["name","sortAscending","formControlName","sortAscending","inputId","desc",3,"value"],["for","desc",1,"m-0"],[1,"h-full","align-middle"],[1,"text-truncate","d-inline-block","h-full","align-middle"],[1,"text-danger"],[1,"flex","items-center","gap-2"],["name","contactType","formControlName","contactType",3,"value","inputId"],[1,"m-0",3,"for"],["formControlName","contactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["formControlName","ContactID","appendTo","body","styleClass","w-100","optionLabel","Value","optionValue","Key","inputStyleClass","w-100",3,"completeMethod","suggestions"],["severity","secondary","variant","outlined","icon","fa-solid fa-xmark",3,"onClick","rounded","text"],["label","Cancel","severity","secondary","variant","outlined",3,"click"],["label","OK (F2)",3,"click"]],template:function(n,i){if(n&1){let l=D();o(0,"app-main-panel",11),P("isDialogFilterVisibleChange",function(d){return h(l),B(i.dialogFilterVisible,d)||(i.dialogFilterVisible=d),b(d)})("isInitDialogFilterVisibleChange",function(d){return h(l),B(i.initDialogVisible,d)||(i.initDialogVisible=d),b(d)}),I("filterConfirmed",function(){return h(l),b(i.onFilterOKEvent())}),g(1,Gn,4,1,"ng-template",null,0,_)(3,Jn,1,1,"ng-template",null,1,_)(5,ao,49,25,"ng-template",null,2,_),r(),o(7,"p-dialog",12),P("visibleChange",function(d){return h(l),B(i.isDialogExportVisible,d)||(i.isDialogExportVisible=d),b(d)}),o(8,"div",13)(9,"div",14)(10,"div",15)(11,"div",16)(12,"div",17)(13,"label",18),a(14,"Page"),r()(),o(15,"div",17),w(16,"input",19),r()()()(),o(17,"div",20)(18,"div",21),w(19,"i",22),o(20,"span",23),a(21),S(22,"number"),S(23,"number"),r()()()(),g(24,lo,1,2,"ng-template",null,3,_)(26,po,2,0,"ng-template",null,4,_),r()}if(n&2){let l;s("pageTitle",i.pageTitle),A("isDialogFilterVisible",i.dialogFilterVisible),s("isFilterable",!0),A("isInitDialogFilterVisible",i.initDialogVisible),s("scrollable",!0),p(7),Pe(L(17,Fn)),s("modal",!0),A("visible",i.isDialogExportVisible),s("breakpoints",L(18,Ln)),p(2),s("formGroup",i.form),p(12),Me("Exporting data from ",y(22,13,(l=i.filter())==null?null:l.exportPageNumber)," - ",y(23,15,(l=i.filter())==null?null:l.exportPageSize),"")}},dependencies:[re,K,ze,H,W,qe,ae,ce,se,tt,et,ie,te,Te,pe,le,Re,De,ee,J,At,Y,X,Q,Z,ue,de,Ee,Ue,at,Wt,rt,ne,$,U,nt,it,Ke,Ot],styles:["[_nghost-%COMP%]{display:block} .p-datatable .p-datatable-header{padding-left:0!important}"],changeDetection:0})}}return t})();var el=[{path:"",redirectTo:"general-ledger",pathMatch:"full"},{path:"",children:[{path:"general-ledger",component:Ut},{path:"multiple-general-ledger",component:ti},{path:"profit-loss",component:$t},{path:"balance-sheet",component:Jt},{path:"comparative-balance",component:Qt},{path:"trial-balance",component:ei},{path:"cash-flow",component:Zt}]}];export{el as REPORTS_ROUTES};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as v,b as H}from"./chunk-
|
|
1
|
+
import{a as v,b as H}from"./chunk-OP5H3EZS.js";import"./chunk-I23KOE73.js";import{a as F,b as I}from"./chunk-Q7SK53ST.js";import"./chunk-ZMIVD3SF.js";import{g as G}from"./chunk-P4DH4OHM.js";import"./chunk-ZUDQOT7C.js";import{a as O,b as R}from"./chunk-BUDZ3ONE.js";import"./chunk-IRGC65GN.js";import"./chunk-V4SH72WU.js";import{w as V,x as j,y as D,z as N}from"./chunk-IMVMIXVJ.js";import"./chunk-2D2YD753.js";import"./chunk-OIBDX2CA.js";import"./chunk-XJ7SJUJ2.js";import{a as $}from"./chunk-2MKKFLNJ.js";import{n as A,s as P}from"./chunk-VZ5CMS5O.js";import"./chunk-F2X3VGZZ.js";import{$b as w,Cc as B,Db as E,Dc as _,Lb as p,Nc as c,Ob as x,Oc as m,Rc as C,Vb as n,W as y,Wb as o,Xb as l,Y as b,ec as h,fc as s,h as T,hb as a,ia as f,qa as g,ra as d,s as u,sa as M,ta as S,xb as k}from"./chunk-NMCKMUY4.js";import"./chunk-YQFG5XE2.js";var L=()=>({height:"calc(100vh - 100px)"});function z(i,q){if(i&1){let e=w();n(0,"div",3)(1,"p-button",4),h("onClick",function(){g(e);let r=s();return d(r.onFormat())}),o(),n(2,"p-button",5),c(3,"async"),c(4,"async"),h("onClick",function(){g(e);let r=s();return d(r.onMigrate())}),o()()}if(i&2){let e=s();a(2),p("disabled",m(3,2,e.countInBooks$)!==0)("pTooltip",m(4,4,e.countInBooks$)!==0?"Books already has entries. Please format before re-migrating.":null)}}function J(i,q){if(i&1&&(n(0,"p-scroll-panel")(1,"p-panel")(2,"div",6),l(3,"app-migration-cards",7),c(4,"async"),M(),n(5,"svg",8),l(6,"path",9),o(),S(),l(7,"app-migration-cards",10),c(8,"async"),o()()()),i&2){let e=s();x(_(12,L)),a(),x(_(13,L)),a(2),p("migrationCount",m(4,8,e.countInPOS$))("migrationTitle",e.pageTitle),a(4),p("migrationCount",m(8,10,e.countInBooks$))("migrationTitle",e.pageTitle)}}var le=(()=>{class i{constructor(){this.migrateService=f(v),this.toastr=f($),this.refresh$=new T(void 0),this.pageTitle="Expense Account"}ngOnInit(){let e=this.refresh$.pipe(b(()=>this.migrateService.getExpenseAccountCount()),y(1));this.countInPOS$=e.pipe(u(t=>Number(t.pos))),this.countInBooks$=e.pipe(u(t=>Number(t.books)))}onMigrate(){this.migrateService.migrateExpenseAccount().subscribe(e=>{this.refresh$.next(),this.toastr.success(e.message,"Migration Successful")})}onFormat(){window.confirm("Are you sure you want to format this data? This action cannot be undone.")&&this.migrateService.formatExpenseAccount().subscribe(t=>{this.refresh$.next(),this.toastr.success(t.message,"Format Successful")})}static{this.\u0275fac=function(t){return new(t||i)}}static{this.\u0275cmp=k({type:i,selectors:[["app-expense-account"]],features:[B([v])],decls:5,vars:1,consts:[["actionButton",""],["content",""],[3,"pageTitle"],[1,"d-flex","gap-2"],["label","Format","severity","danger",3,"onClick"],["label","Migrate","tooltipPosition","left",3,"onClick","disabled","pTooltip"],[1,"flex","gap-30","flex-wrap",2,"display","flex","justify-content","center","align-items","center","gap","1rem","margin-top","40px"],["migrationPlace","Accounting",3,"migrationCount","migrationTitle"],["width","40","height","40","viewBox","0 0 24 24","fill","none"],["d","M8 5l8 7-8 7","stroke","#007bff","stroke-width","2","stroke-linecap","round","stroke-linejoin","round"],["migrationPlace","Books",3,"migrationCount","migrationTitle"]],template:function(t,r){t&1&&(n(0,"app-main-panel",2),E(1,z,5,6,"ng-template",null,0,C)(3,J,9,14,"ng-template",null,1,C),o()),t&2&&p("pageTitle",r.pageTitle)},dependencies:[G,P,A,I,F,R,O,N,D,H,j,V],encapsulation:2})}}return i})();export{le as ExpenseAccountComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as rt}from"./chunk-M3TKVRYP.js";import{ca as it}from"./chunk-NMCKMUY4.js";import{d as B,e as Q}from"./chunk-YQFG5XE2.js";var st=B((G,K)=>{(function(y,M){typeof G=="object"&&typeof K<"u"?K.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs=M()})(G,function(){"use strict";var y=1e3,M=6e4,v=36e5,k="millisecond",D="second",z="minute",c="hour",H="day",j="week",b="month",d="quarter",$="year",o="date",i="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},g=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},x={s:g,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+g(r,2,"0")+":"+g(e,2,"0")},m:function s(n,t){if(n.date()<t.date())return-s(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,b),u=t-e<0,a=n.clone().add(r+(u?-1:1),b);return+(-(r+(t-e)/(u?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:b,y:$,w:j,d:H,D:o,h:c,m:z,s:D,ms:k,Q:d}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",_={};_[T]=O;var U="$isDayjsObject",Z=function(s){return s instanceof P||!(!s||!s[U])},I=function s(n,t,r){var e;if(!n)return T;if(typeof n=="string"){var u=n.toLowerCase();_[u]&&(e=u),t&&(_[u]=t,e=u);var a=n.split("-");if(!e&&a.length>1)return s(a[0])}else{var l=n.name;_[l]=n,e=l}return!r&&e&&(T=e),e||!r&&T},m=function(s,n){if(Z(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new P(t)},f=x;f.l=I,f.i=Z,f.w=function(s,n){return m(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var P=function(){function s(t){this.$L=I(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[U]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,u=r.utc;if(e===null)return new Date(NaN);if(f.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(h);if(a){var l=a[2]-1||0,p=(a[7]||"0").substring(0,3);return u?new Date(Date.UTC(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)):new Date(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return f},n.isValid=function(){return this.$d.toString()!==i},n.isSame=function(t,r){var e=m(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return m(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<m(t)},n.$g=function(t,r,e){return f.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,u=!!f.u(r)||r,a=f.p(t),l=function(F,C){var N=f.w(e.$u?Date.UTC(e.$y,C,F):new Date(e.$y,C,F),e);return u?N:N.endOf(H)},p=function(F,C){return f.w(e.toDate()[F].apply(e.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(C)),e)},w=this.$W,Y=this.$M,L=this.$D,A="set"+(this.$u?"UTC":"");switch(a){case $:return u?l(1,0):l(31,11);case b:return u?l(1,Y):l(0,Y+1);case j:var W=this.$locale().weekStart||0,V=(w<W?w+7:w)-W;return l(u?L-V:L+(6-V),Y);case H:case o:return p(A+"Hours",0);case c:return p(A+"Minutes",1);case z:return p(A+"Seconds",2);case D:return p(A+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,u=f.p(t),a="set"+(this.$u?"UTC":""),l=(e={},e[H]=a+"Date",e[o]=a+"Date",e[b]=a+"Month",e[$]=a+"FullYear",e[c]=a+"Hours",e[z]=a+"Minutes",e[D]=a+"Seconds",e[k]=a+"Milliseconds",e)[u],p=u===H?this.$D+(r-this.$W):r;if(u===b||u===$){var w=this.clone().set(o,1);w.$d[l](p),w.init(),this.$d=w.set(o,Math.min(this.$D,w.daysInMonth())).$d}else l&&this.$d[l](p);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[f.p(t)]()},n.add=function(t,r){var e,u=this;t=Number(t);var a=f.p(r),l=function(Y){var L=m(u);return f.w(L.date(L.date()+Math.round(Y*t)),u)};if(a===b)return this.set(b,this.$M+t);if(a===$)return this.set($,this.$y+t);if(a===H)return l(1);if(a===j)return l(7);var p=(e={},e[z]=M,e[c]=v,e[D]=y,e)[a]||1,w=this.$d.getTime()+t*p;return f.w(w,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=this,e=this.$locale();if(!this.isValid())return e.invalidDate||i;var u=t||"YYYY-MM-DDTHH:mm:ssZ",a=f.z(this),l=this.$H,p=this.$m,w=this.$M,Y=e.weekdays,L=e.months,A=e.meridiem,W=function(C,N,J,q){return C&&(C[N]||C(r,u))||J[N].slice(0,q)},V=function(C){return f.s(l%12||12,C,"0")},F=A||function(C,N,J){var q=C<12?"AM":"PM";return J?q.toLowerCase():q};return u.replace(S,function(C,N){return N||function(J){switch(J){case"YY":return String(r.$y).slice(-2);case"YYYY":return f.s(r.$y,4,"0");case"M":return w+1;case"MM":return f.s(w+1,2,"0");case"MMM":return W(e.monthsShort,w,L,3);case"MMMM":return W(L,w);case"D":return r.$D;case"DD":return f.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return W(e.weekdaysMin,r.$W,Y,2);case"ddd":return W(e.weekdaysShort,r.$W,Y,3);case"dddd":return Y[r.$W];case"H":return String(l);case"HH":return f.s(l,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return F(l,p,!0);case"A":return F(l,p,!1);case"m":return String(p);case"mm":return f.s(p,2,"0");case"s":return String(r.$s);case"ss":return f.s(r.$s,2,"0");case"SSS":return f.s(r.$ms,3,"0");case"Z":return a}return null}(C)||a.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var u,a=this,l=f.p(r),p=m(t),w=(p.utcOffset()-this.utcOffset())*M,Y=this-p,L=function(){return f.m(a,p)};switch(l){case $:u=L()/12;break;case b:u=L();break;case d:u=L()/3;break;case j:u=(Y-w)/6048e5;break;case H:u=(Y-w)/864e5;break;case c:u=Y/v;break;case z:u=Y/M;break;case D:u=Y/y;break;default:u=Y}return e?u:f.a(u)},n.daysInMonth=function(){return this.endOf(b).$D},n.$locale=function(){return _[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),u=I(t,r,!0);return u&&(e.$L=u),e},n.clone=function(){return f.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},s}(),nt=P.prototype;return m.prototype=nt,[["$ms",k],["$s",D],["$m",z],["$H",c],["$W",H],["$M",b],["$y",$],["$D",o]].forEach(function(s){nt[s[1]]=function(n){return this.$g(n,s[0],s[1])}}),m.extend=function(s,n){return s.$i||(s(n,P,m),s.$i=!0),m},m.locale=I,m.isDayjs=Z,m.unix=function(s){return m(1e3*s)},m.en=_[T],m.Ls=_,m.p={},m})});var ut=B((R,X)=>{(function(y,M){typeof R=="object"&&typeof X<"u"?X.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_timezone=M()})(R,function(){"use strict";var y={year:0,month:1,day:2,hour:3,minute:4,second:5},M={};return function(v,k,D){var z,c=function(d,$,o){o===void 0&&(o={});var i=new Date(d),h=function(S,O){O===void 0&&(O={});var g=O.timeZoneName||"short",x=S+"|"+g,T=M[x];return T||(T=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:g}),M[x]=T),T}($,o);return h.formatToParts(i)},H=function(d,$){for(var o=c(d,$),i=[],h=0;h<o.length;h+=1){var S=o[h],O=S.type,g=S.value,x=y[O];x>=0&&(i[x]=parseInt(g,10))}var T=i[3],_=T===24?0:T,U=i[0]+"-"+i[1]+"-"+i[2]+" "+_+":"+i[4]+":"+i[5]+":000",Z=+d;return(D.utc(U).valueOf()-(Z-=Z%1e3))/6e4},j=k.prototype;j.tz=function(d,$){d===void 0&&(d=z);var o,i=this.utcOffset(),h=this.toDate(),S=h.toLocaleString("en-US",{timeZone:d}),O=Math.round((h-new Date(S))/1e3/60),g=15*-Math.round(h.getTimezoneOffset()/15)-O;if(!Number(g))o=this.utcOffset(0,$);else if(o=D(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),$){var x=o.utcOffset();o=o.add(i-x,"minute")}return o.$x.$timezone=d,o},j.offsetName=function(d){var $=this.$x.$timezone||D.tz.guess(),o=c(this.valueOf(),$,{timeZoneName:d}).find(function(i){return i.type.toLowerCase()==="timezonename"});return o&&o.value};var b=j.startOf;j.startOf=function(d,$){if(!this.$x||!this.$x.$timezone)return b.call(this,d,$);var o=D(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(o,d,$).tz(this.$x.$timezone,!0)},D.tz=function(d,$,o){var i=o&&$,h=o||$||z,S=H(+D(),h);if(typeof d!="string")return D(d).tz(h);var O=function(_,U,Z){var I=_-60*U*1e3,m=H(I,Z);if(U===m)return[I,U];var f=H(I-=60*(m-U)*1e3,Z);return m===f?[I,m]:[_-60*Math.min(m,f)*1e3,Math.max(m,f)]}(D.utc(d,i).valueOf(),S,h),g=O[0],x=O[1],T=D(g).utcOffset(x);return T.$x.$timezone=h,T},D.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},D.tz.setDefault=function(d){z=d}}})});var at=B((tt,et)=>{(function(y,M){typeof tt=="object"&&typeof et<"u"?et.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_utc=M()})(tt,function(){"use strict";var y="minute",M=/[+-]\d\d(?::?\d\d)?/g,v=/([+-]|\d\d)/g;return function(k,D,z){var c=D.prototype;z.utc=function(i){var h={date:i,utc:!0,args:arguments};return new D(h)},c.utc=function(i){var h=z(this.toDate(),{locale:this.$L,utc:!0});return i?h.add(this.utcOffset(),y):h},c.local=function(){return z(this.toDate(),{locale:this.$L,utc:!1})};var H=c.parse;c.parse=function(i){i.utc&&(this.$u=!0),this.$utils().u(i.$offset)||(this.$offset=i.$offset),H.call(this,i)};var j=c.init;c.init=function(){if(this.$u){var i=this.$d;this.$y=i.getUTCFullYear(),this.$M=i.getUTCMonth(),this.$D=i.getUTCDate(),this.$W=i.getUTCDay(),this.$H=i.getUTCHours(),this.$m=i.getUTCMinutes(),this.$s=i.getUTCSeconds(),this.$ms=i.getUTCMilliseconds()}else j.call(this)};var b=c.utcOffset;c.utcOffset=function(i,h){var S=this.$utils().u;if(S(i))return this.$u?0:S(this.$offset)?b.call(this):this.$offset;if(typeof i=="string"&&(i=function(T){T===void 0&&(T="");var _=T.match(M);if(!_)return null;var U=(""+_[0]).match(v)||["-",0,0],Z=U[0],I=60*+U[1]+ +U[2];return I===0?0:Z==="+"?I:-I}(i),i===null))return this;var O=Math.abs(i)<=16?60*i:i,g=this;if(h)return g.$offset=O,g.$u=i===0,g;if(i!==0){var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(g=this.local().add(O+x,y)).$offset=O,g.$x.$localOffset=x}else g=this.utc();return g};var d=c.format;c.format=function(i){var h=i||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,h)},c.valueOf=function(){var i=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*i},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var $=c.toDate;c.toDate=function(i){return i==="s"&&this.$offset?z(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():$.call(this)};var o=c.diff;c.diff=function(i,h,S){if(i&&this.$u===i.$u)return o.call(this,i,h,S);var O=this.local(),g=z(i).local();return o.call(O,g,h,S)}}})});var E=Q(st()),ot=Q(ut()),ft=Q(at());E.default.extend(ft.default);E.default.extend(ot.default);var lt=(()=>{class y{constructor(){this._defaultTimezone=rt.defaultTimezone||"Asia/Jakarta",this.validateTimezone(this._defaultTimezone)}get now(){return(0,E.default)().tz(this._defaultTimezone)}from(v){if(v==null||typeof v=="string"&&v==="0001-01-01T00:00:00")return null;let k=(0,E.default)(v);return k.isValid()?k.tz(this._defaultTimezone):null}get defaultTimezone(){return this._defaultTimezone}setDefaultTimezone(v){this.validateTimezone(v),this._defaultTimezone=v}isValidTimezone(v){try{return Intl.DateTimeFormat(void 0,{timeZone:v}),!0}catch{return!1}}withTimezone(v){return this.setDefaultTimezone(v),this}format(v,k="YYYY-MM-DDTHH:mm:ss"){return this.from(v)?.format(k)||""}validateTimezone(v){if(!this.isValidTimezone(v))throw new Error(`Invalid timezone: ${v}`)}static{this.\u0275fac=function(k){return new(k||y)}}static{this.\u0275prov=it({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})();export{st as a,lt as b};
|
|
1
|
+
import{c as rt}from"./chunk-XJ7SJUJ2.js";import{ca as it}from"./chunk-NMCKMUY4.js";import{d as B,e as Q}from"./chunk-YQFG5XE2.js";var st=B((G,K)=>{(function(y,M){typeof G=="object"&&typeof K<"u"?K.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs=M()})(G,function(){"use strict";var y=1e3,M=6e4,v=36e5,k="millisecond",D="second",z="minute",c="hour",H="day",j="week",b="month",d="quarter",$="year",o="date",i="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,O={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},g=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},x={s:g,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+g(r,2,"0")+":"+g(e,2,"0")},m:function s(n,t){if(n.date()<t.date())return-s(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,b),u=t-e<0,a=n.clone().add(r+(u?-1:1),b);return+(-(r+(t-e)/(u?e-a:a-e))||0)},a:function(s){return s<0?Math.ceil(s)||0:Math.floor(s)},p:function(s){return{M:b,y:$,w:j,d:H,D:o,h:c,m:z,s:D,ms:k,Q:d}[s]||String(s||"").toLowerCase().replace(/s$/,"")},u:function(s){return s===void 0}},T="en",_={};_[T]=O;var U="$isDayjsObject",Z=function(s){return s instanceof P||!(!s||!s[U])},I=function s(n,t,r){var e;if(!n)return T;if(typeof n=="string"){var u=n.toLowerCase();_[u]&&(e=u),t&&(_[u]=t,e=u);var a=n.split("-");if(!e&&a.length>1)return s(a[0])}else{var l=n.name;_[l]=n,e=l}return!r&&e&&(T=e),e||!r&&T},m=function(s,n){if(Z(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new P(t)},f=x;f.l=I,f.i=Z,f.w=function(s,n){return m(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var P=function(){function s(t){this.$L=I(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[U]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,u=r.utc;if(e===null)return new Date(NaN);if(f.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(h);if(a){var l=a[2]-1||0,p=(a[7]||"0").substring(0,3);return u?new Date(Date.UTC(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)):new Date(a[1],l,a[3]||1,a[4]||0,a[5]||0,a[6]||0,p)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return f},n.isValid=function(){return this.$d.toString()!==i},n.isSame=function(t,r){var e=m(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return m(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<m(t)},n.$g=function(t,r,e){return f.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,u=!!f.u(r)||r,a=f.p(t),l=function(F,C){var N=f.w(e.$u?Date.UTC(e.$y,C,F):new Date(e.$y,C,F),e);return u?N:N.endOf(H)},p=function(F,C){return f.w(e.toDate()[F].apply(e.toDate("s"),(u?[0,0,0,0]:[23,59,59,999]).slice(C)),e)},w=this.$W,Y=this.$M,L=this.$D,A="set"+(this.$u?"UTC":"");switch(a){case $:return u?l(1,0):l(31,11);case b:return u?l(1,Y):l(0,Y+1);case j:var W=this.$locale().weekStart||0,V=(w<W?w+7:w)-W;return l(u?L-V:L+(6-V),Y);case H:case o:return p(A+"Hours",0);case c:return p(A+"Minutes",1);case z:return p(A+"Seconds",2);case D:return p(A+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,u=f.p(t),a="set"+(this.$u?"UTC":""),l=(e={},e[H]=a+"Date",e[o]=a+"Date",e[b]=a+"Month",e[$]=a+"FullYear",e[c]=a+"Hours",e[z]=a+"Minutes",e[D]=a+"Seconds",e[k]=a+"Milliseconds",e)[u],p=u===H?this.$D+(r-this.$W):r;if(u===b||u===$){var w=this.clone().set(o,1);w.$d[l](p),w.init(),this.$d=w.set(o,Math.min(this.$D,w.daysInMonth())).$d}else l&&this.$d[l](p);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[f.p(t)]()},n.add=function(t,r){var e,u=this;t=Number(t);var a=f.p(r),l=function(Y){var L=m(u);return f.w(L.date(L.date()+Math.round(Y*t)),u)};if(a===b)return this.set(b,this.$M+t);if(a===$)return this.set($,this.$y+t);if(a===H)return l(1);if(a===j)return l(7);var p=(e={},e[z]=M,e[c]=v,e[D]=y,e)[a]||1,w=this.$d.getTime()+t*p;return f.w(w,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=this,e=this.$locale();if(!this.isValid())return e.invalidDate||i;var u=t||"YYYY-MM-DDTHH:mm:ssZ",a=f.z(this),l=this.$H,p=this.$m,w=this.$M,Y=e.weekdays,L=e.months,A=e.meridiem,W=function(C,N,J,q){return C&&(C[N]||C(r,u))||J[N].slice(0,q)},V=function(C){return f.s(l%12||12,C,"0")},F=A||function(C,N,J){var q=C<12?"AM":"PM";return J?q.toLowerCase():q};return u.replace(S,function(C,N){return N||function(J){switch(J){case"YY":return String(r.$y).slice(-2);case"YYYY":return f.s(r.$y,4,"0");case"M":return w+1;case"MM":return f.s(w+1,2,"0");case"MMM":return W(e.monthsShort,w,L,3);case"MMMM":return W(L,w);case"D":return r.$D;case"DD":return f.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return W(e.weekdaysMin,r.$W,Y,2);case"ddd":return W(e.weekdaysShort,r.$W,Y,3);case"dddd":return Y[r.$W];case"H":return String(l);case"HH":return f.s(l,2,"0");case"h":return V(1);case"hh":return V(2);case"a":return F(l,p,!0);case"A":return F(l,p,!1);case"m":return String(p);case"mm":return f.s(p,2,"0");case"s":return String(r.$s);case"ss":return f.s(r.$s,2,"0");case"SSS":return f.s(r.$ms,3,"0");case"Z":return a}return null}(C)||a.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var u,a=this,l=f.p(r),p=m(t),w=(p.utcOffset()-this.utcOffset())*M,Y=this-p,L=function(){return f.m(a,p)};switch(l){case $:u=L()/12;break;case b:u=L();break;case d:u=L()/3;break;case j:u=(Y-w)/6048e5;break;case H:u=(Y-w)/864e5;break;case c:u=Y/v;break;case z:u=Y/M;break;case D:u=Y/y;break;default:u=Y}return e?u:f.a(u)},n.daysInMonth=function(){return this.endOf(b).$D},n.$locale=function(){return _[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),u=I(t,r,!0);return u&&(e.$L=u),e},n.clone=function(){return f.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},s}(),nt=P.prototype;return m.prototype=nt,[["$ms",k],["$s",D],["$m",z],["$H",c],["$W",H],["$M",b],["$y",$],["$D",o]].forEach(function(s){nt[s[1]]=function(n){return this.$g(n,s[0],s[1])}}),m.extend=function(s,n){return s.$i||(s(n,P,m),s.$i=!0),m},m.locale=I,m.isDayjs=Z,m.unix=function(s){return m(1e3*s)},m.en=_[T],m.Ls=_,m.p={},m})});var ut=B((R,X)=>{(function(y,M){typeof R=="object"&&typeof X<"u"?X.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_timezone=M()})(R,function(){"use strict";var y={year:0,month:1,day:2,hour:3,minute:4,second:5},M={};return function(v,k,D){var z,c=function(d,$,o){o===void 0&&(o={});var i=new Date(d),h=function(S,O){O===void 0&&(O={});var g=O.timeZoneName||"short",x=S+"|"+g,T=M[x];return T||(T=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:g}),M[x]=T),T}($,o);return h.formatToParts(i)},H=function(d,$){for(var o=c(d,$),i=[],h=0;h<o.length;h+=1){var S=o[h],O=S.type,g=S.value,x=y[O];x>=0&&(i[x]=parseInt(g,10))}var T=i[3],_=T===24?0:T,U=i[0]+"-"+i[1]+"-"+i[2]+" "+_+":"+i[4]+":"+i[5]+":000",Z=+d;return(D.utc(U).valueOf()-(Z-=Z%1e3))/6e4},j=k.prototype;j.tz=function(d,$){d===void 0&&(d=z);var o,i=this.utcOffset(),h=this.toDate(),S=h.toLocaleString("en-US",{timeZone:d}),O=Math.round((h-new Date(S))/1e3/60),g=15*-Math.round(h.getTimezoneOffset()/15)-O;if(!Number(g))o=this.utcOffset(0,$);else if(o=D(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(g,!0),$){var x=o.utcOffset();o=o.add(i-x,"minute")}return o.$x.$timezone=d,o},j.offsetName=function(d){var $=this.$x.$timezone||D.tz.guess(),o=c(this.valueOf(),$,{timeZoneName:d}).find(function(i){return i.type.toLowerCase()==="timezonename"});return o&&o.value};var b=j.startOf;j.startOf=function(d,$){if(!this.$x||!this.$x.$timezone)return b.call(this,d,$);var o=D(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return b.call(o,d,$).tz(this.$x.$timezone,!0)},D.tz=function(d,$,o){var i=o&&$,h=o||$||z,S=H(+D(),h);if(typeof d!="string")return D(d).tz(h);var O=function(_,U,Z){var I=_-60*U*1e3,m=H(I,Z);if(U===m)return[I,U];var f=H(I-=60*(m-U)*1e3,Z);return m===f?[I,m]:[_-60*Math.min(m,f)*1e3,Math.max(m,f)]}(D.utc(d,i).valueOf(),S,h),g=O[0],x=O[1],T=D(g).utcOffset(x);return T.$x.$timezone=h,T},D.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},D.tz.setDefault=function(d){z=d}}})});var at=B((tt,et)=>{(function(y,M){typeof tt=="object"&&typeof et<"u"?et.exports=M():typeof define=="function"&&define.amd?define(M):(y=typeof globalThis<"u"?globalThis:y||self).dayjs_plugin_utc=M()})(tt,function(){"use strict";var y="minute",M=/[+-]\d\d(?::?\d\d)?/g,v=/([+-]|\d\d)/g;return function(k,D,z){var c=D.prototype;z.utc=function(i){var h={date:i,utc:!0,args:arguments};return new D(h)},c.utc=function(i){var h=z(this.toDate(),{locale:this.$L,utc:!0});return i?h.add(this.utcOffset(),y):h},c.local=function(){return z(this.toDate(),{locale:this.$L,utc:!1})};var H=c.parse;c.parse=function(i){i.utc&&(this.$u=!0),this.$utils().u(i.$offset)||(this.$offset=i.$offset),H.call(this,i)};var j=c.init;c.init=function(){if(this.$u){var i=this.$d;this.$y=i.getUTCFullYear(),this.$M=i.getUTCMonth(),this.$D=i.getUTCDate(),this.$W=i.getUTCDay(),this.$H=i.getUTCHours(),this.$m=i.getUTCMinutes(),this.$s=i.getUTCSeconds(),this.$ms=i.getUTCMilliseconds()}else j.call(this)};var b=c.utcOffset;c.utcOffset=function(i,h){var S=this.$utils().u;if(S(i))return this.$u?0:S(this.$offset)?b.call(this):this.$offset;if(typeof i=="string"&&(i=function(T){T===void 0&&(T="");var _=T.match(M);if(!_)return null;var U=(""+_[0]).match(v)||["-",0,0],Z=U[0],I=60*+U[1]+ +U[2];return I===0?0:Z==="+"?I:-I}(i),i===null))return this;var O=Math.abs(i)<=16?60*i:i,g=this;if(h)return g.$offset=O,g.$u=i===0,g;if(i!==0){var x=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(g=this.local().add(O+x,y)).$offset=O,g.$x.$localOffset=x}else g=this.utc();return g};var d=c.format;c.format=function(i){var h=i||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,h)},c.valueOf=function(){var i=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*i},c.isUTC=function(){return!!this.$u},c.toISOString=function(){return this.toDate().toISOString()},c.toString=function(){return this.toDate().toUTCString()};var $=c.toDate;c.toDate=function(i){return i==="s"&&this.$offset?z(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():$.call(this)};var o=c.diff;c.diff=function(i,h,S){if(i&&this.$u===i.$u)return o.call(this,i,h,S);var O=this.local(),g=z(i).local();return o.call(O,g,h,S)}}})});var E=Q(st()),ot=Q(ut()),ft=Q(at());E.default.extend(ft.default);E.default.extend(ot.default);var lt=(()=>{class y{constructor(){this._defaultTimezone=rt.defaultTimezone||"Asia/Jakarta",this.validateTimezone(this._defaultTimezone)}get now(){return(0,E.default)().tz(this._defaultTimezone)}from(v){if(v==null||typeof v=="string"&&v==="0001-01-01T00:00:00")return null;let k=(0,E.default)(v);return k.isValid()?k.tz(this._defaultTimezone):null}get defaultTimezone(){return this._defaultTimezone}setDefaultTimezone(v){this.validateTimezone(v),this._defaultTimezone=v}isValidTimezone(v){try{return Intl.DateTimeFormat(void 0,{timeZone:v}),!0}catch{return!1}}withTimezone(v){return this.setDefaultTimezone(v),this}format(v,k="YYYY-MM-DDTHH:mm:ss"){return this.from(v)?.format(k)||""}validateTimezone(v){if(!this.isValidTimezone(v))throw new Error(`Invalid timezone: ${v}`)}static{this.\u0275fac=function(k){return new(k||y)}}static{this.\u0275prov=it({token:y,factory:y.\u0275fac,providedIn:"root"})}}return y})();export{st as a,lt as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as _}from"./chunk-VZ5CMS5O.js";import{Ab as N,Ga as K,Ha as g,La as A,ad as S,bd as m,ca as y,cd as E,fa as T,ia as h,xa as $}from"./chunk-NMCKMUY4.js";import{a as c,b as u}from"./chunk-YQFG5XE2.js";var ce=(()=>{class t{transform(e,o=50,r=!1,a="..."){if(!e||typeof e!="string")return"";if(e.length<=o)return e;let i=e.substring(0,o);if(r){let s=i.lastIndexOf(" ");s>0&&(i=i.substring(0,s))}return i+a}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275pipe=N({name:"truncate",type:t,pure:!0})}}return t})();function R(t){let n=S(()=>t());return J(n)?new Proxy(t,{get(e,o){return o in n?(K(e[o])||Object.defineProperty(e,o,{value:m(()=>e()[o]),configurable:!0}),R(e[o])):e[o]}}):t}var H=[WeakSet,WeakMap,Promise,Date,Error,RegExp,ArrayBuffer,DataView,Function];function J(t){if(t===null||typeof t!="object"||q(t))return!1;let n=Object.getPrototypeOf(t);if(n===Object.prototype)return!0;for(;n&&n!==Object.prototype;){if(H.includes(n.constructor))return!1;n=Object.getPrototypeOf(n)}return n===Object.prototype}function q(t){return typeof t?.[Symbol.iterator]=="function"}var G=new WeakMap,d=Symbol("STATE_SOURCE");function I(t,...n){t[d].update(e=>n.reduce((o,r)=>c(c({},o),typeof r=="function"?r(o):r),e)),Y(t)}function j(t){return t[d]()}function Q(t){return G.get(t[d])||[]}function Y(t){let n=Q(t);for(let e of n){let o=S(()=>j(t));e(o)}}function F(...t){let n=[...t],e=typeof n[0]=="function"?{}:n.shift(),o=n;return(()=>{class a{constructor(){let s=o.reduce((p,X)=>X(p),Z()),{stateSignals:l,props:f,methods:w,hooks:B}=s,M=c(c(c({},l),f),w);this[d]=s[d];for(let p of Reflect.ownKeys(M))this[p]=M[p];let{onInit:x,onDestroy:P}=B;x&&x(),P&&h($).onDestroy(P)}static \u0275fac=function(l){return new(l||a)};static \u0275prov=y({token:a,factory:a.\u0275fac,providedIn:e.providedIn||null})}return a})()}function Z(){return{[d]:g({}),stateSignals:{},props:{},methods:{},hooks:{}}}function k(t,...n){let e=typeof t=="function"?[t,...n]:n;return o=>e.reduce((r,a)=>a(r),o)}function z(t){return n=>{let e=t(c(c(c({[d]:n[d]},n.stateSignals),n.props),n.methods));return Reflect.ownKeys(e),u(c({},n),{props:c(c({},n.props),e)})}}function ee(t){return z(t)}function U(t){return n=>{let e=c(c(c({[d]:n[d]},n.stateSignals),n.props),n.methods),o=typeof t=="function"?t(e):t,r=a=>{let i=o[a],s=n.hooks[a];return i?()=>{s&&s(),i(e)}:s};return u(c({},n),{hooks:{onInit:r("onInit"),onDestroy:r("onDestroy")}})}}function v(t){return n=>{let e=t(c(c(c({[d]:n[d]},n.stateSignals),n.props),n.methods));return Reflect.ownKeys(e),u(c({},n),{methods:c(c({},n.methods),e)})}}function b(t){return n=>{let e=typeof t=="function"?t():t,o=Reflect.ownKeys(e);n[d].update(a=>c(c({},a),e));let r=o.reduce((a,i)=>{let s=m(()=>n[d]()[i]);return u(c({},a),{[i]:R(s)})},{});return u(c({},n),{stateSignals:c(c({},n.stateSignals),r)})}}var D=new Set;function te(t){if(t==null)throw new Error("");return t}var L={send:()=>{}},W=(()=>{class t{#e={};#n=_(h(A));#o=[];#t={};#i=1;#c=this.#n&&window.__REDUX_DEVTOOLS_EXTENSION__?window.__REDUX_DEVTOOLS_EXTENSION__.connect({name:"NgRx SignalStore"}):L;constructor(){if(!this.#n)return;!!window.__REDUX_DEVTOOLS_EXTENSION__||console.info("NgRx Toolkit/DevTools: Redux DevTools Extension is not available.")}ngOnDestroy(){D.clear()}syncToDevTools(e){let o=Object.entries(e).reduce((i,[s,l])=>{let{options:f,name:w}=this.#e[s];return i[w]=f.map(l),i},{});this.#t=c(c({},this.#t),o);let r=Array.from(D),a=r.length?r.join(", "):"Store Update";D.clear(),this.#c.send({type:a},this.#t)}getNextId(){return String(this.#i++)}addStore(e,o,r,a){let i=o,s=Object.values(this.#e).map(f=>f.name);if(s.includes(i)&&!a.indexNames)throw new Error(`An instance of the store ${i} already exists. Enable automatic indexing via withDevTools('${i}', { indexNames: true }), or rename it upon instantiation.`);for(let f=1;s.includes(i);f++)i=`${o}-${f}`;this.#e[e]={name:i,options:a};let l=a.tracker;this.#o.includes(l)||this.#o.push(l),l.onChange(f=>this.syncToDevTools(f)),l.track(e,r)}removeStore(e){let o=this.#e[e].name;this.#e=Object.entries(this.#e).reduce((r,[a,i])=>(a!==e&&(r[a]=i),r),{}),this.#t=Object.entries(this.#t).reduce((r,[a,i])=>(a!==o&&(r[o]=i),r),{});for(let r of this.#o)r.removeStore(e)}renameStore(e,o){let r=Object.values(this.#e).map(i=>i.name),a=te(Object.keys(this.#e).find(i=>this.#e[i].name===e));if(r.includes(o))throw new Error(`NgRx Toolkit/DevTools: cannot rename from ${e} to ${o}. ${o} is already assigned to another SignalStore instance.`);this.#e=Object.entries(this.#e).reduce((i,[s,l])=>(l.name===e?i[s]=u(c({},l),{name:o}):i[s]=l,i),{}),this.#t=Object.entries(this.#t).reduce((i,[s,l])=>(s!==e&&(i[s]=l),i),{}),this.#o.forEach(i=>i.notifyRenamedStore(a))}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),ne=(()=>{class t{#e=g({});get stores(){return this.#e()}#n;#o=E(()=>{if(this.#n===void 0)throw new Error("no callback function defined");let e=this.#e(),o=Object.entries(e).reduce((r,[a,i])=>u(c({},r),{[a]:j(i)}),{});this.#n(o)});track(e,o){this.#e.update(r=>u(c({},r),{[e]:o}))}onChange(e){this.#n=e}removeStore(e){this.#e.update(o=>Object.entries(o).reduce((r,[a,i])=>(a!==e&&(r[a]=i),r),{}))}notifyRenamedStore(e){this.#e()[e]&&this.#e.update(o=>c({},o))}static{this.\u0275fac=function(o){return new(o||t)}}static{this.\u0275prov=y({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})(),oe="___renameDevtoolsName",O="___uniqueDevtoolsId",we=new T("Array contain existing names for the signal stores",{factory:()=>[],providedIn:"root"});function V(t,...n){return k(v(()=>{let e=h(W),o=e.getNextId();return{[oe]:r=>{e.renameStore(t,r)},[O]:()=>o}}),U(e=>{let o=h(W),r=String(e[O]());return{onInit(){let a=String(e[O]()),i={indexNames:!n.some(s=>s.indexNames===!1),map:n.find(s=>s.map)?.map??(s=>s),tracker:h(n.find(s=>s.tracker)?.tracker||ne)};o.addStore(a,t,e,i)},onDestroy(){o.removeStore(r)}}}))}var Ke=Symbol("DEVTOOLS_FEATURE");var Ee=k(b({}));var ie={themeOptions:{theme:"light",dir:"ltr",layout:"vertical",sidebartype:"full",boxed:"boxed",colorTheme:"Blue_Theme",cardType:"shadow"}},Oe=F({providedIn:"root"},b(ie),V("LayoutThemeStore"),v(t=>({updateSidebarType(){I(t,n=>{switch(n.themeOptions.sidebartype){case"full":return u(c({},n),{themeOptions:u(c({},n.themeOptions),{sidebartype:"mini-sidebar"})});case"mini-sidebar":return u(c({},n),{themeOptions:u(c({},n.themeOptions),{sidebartype:"full"})});default:return n}})}})));export{ce as a,I as b,F as c,ee as d,U as e,v as f,b as g,V as h,Oe as i};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ie,b as yt}from"./chunk-
|
|
1
|
+
import{a as ie,b as yt}from"./chunk-UW7IAYIG.js";import{f as Ct}from"./chunk-PKOERZXQ.js";import"./chunk-PTQPB44D.js";import{a as xt}from"./chunk-G4XX7EU2.js";import{a as bt}from"./chunk-XKI7WLHE.js";import{a as wt}from"./chunk-NM5M567G.js";import"./chunk-T3EH4DR2.js";import"./chunk-LABWETHZ.js";import{a as rt}from"./chunk-5CZNOXPC.js";import"./chunk-IGWIRCAS.js";import{a as ee,b as te}from"./chunk-3A4BFUGD.js";import{d as _t,i as ft,j as ht,k as gt}from"./chunk-3IEOINKV.js";import"./chunk-53I5JFOQ.js";import"./chunk-HQMTUZZQ.js";import"./chunk-RXOOTYEO.js";import"./chunk-SEXB43QC.js";import{a as dt,b as ut}from"./chunk-CWFLUFKM.js";import"./chunk-LWYAFMN3.js";import"./chunk-NDLX3ORI.js";import"./chunk-E4MHRZVH.js";import"./chunk-XPRP6AB4.js";import"./chunk-YZTBV6HG.js";import"./chunk-DHLFL3KH.js";import"./chunk-QWTGY7FA.js";import{g as mt}from"./chunk-P4DH4OHM.js";import{a as We}from"./chunk-ZUDQOT7C.js";import{a as it,b as nt}from"./chunk-BUDZ3ONE.js";import{b as E,c as ot,d as at,e as st,f as lt,g as pt,h as ct}from"./chunk-IRGC65GN.js";import"./chunk-V4SH72WU.js";import{a as Je,f as O,k as Ke,m as Xe,o as Ye,s as et,w as Y,x as tt}from"./chunk-IMVMIXVJ.js";import"./chunk-2D2YD753.js";import{A as ze,C as je,K as qe,La as $e,Ma as X,Ua as Ze,c as K,e as Ae,f as Oe,l as Be,ma as Ge,o as Ne,u as He,x as Qe,z as fe}from"./chunk-OIBDX2CA.js";import{b as Pe,d as Le,e as Re}from"./chunk-AOOG6YOT.js";import"./chunk-XJ7SJUJ2.js";import"./chunk-2MKKFLNJ.js";import{h as Z,k as J,m as Ve,s as W}from"./chunk-VZ5CMS5O.js";import{c as Me,d as ce,f as me,h as de,i as ue,k as _e}from"./chunk-F2X3VGZZ.js";import{$b as k,$c as Fe,Aa as H,Bb as z,Cc as $,Db as u,Ec as S,Fc as De,Ha as L,Jc as Ee,Kb as F,Lb as p,Ob as Ce,Pb as ae,Qb as j,Rb as R,Rc as x,Tb as M,Ub as A,Vb as l,Wb as s,Xb as y,Y as N,Yb as ye,Zb as ve,_ as re,_b as U,_c as D,bd as P,c as B,ca as we,cd as Ue,da as be,ec as b,fc as c,gc as Te,hb as a,hc as ke,ia as C,kc as V,lc as q,mc as v,nc as T,qa as _,qc as Ie,ra as f,rc as d,sc as I,tc as G,ua as oe,vc as Se,wc as se,xb as Q,xc as le,yb as xe,yc as pe}from"./chunk-NMCKMUY4.js";import{a as h,b as g}from"./chunk-YQFG5XE2.js";var kt={data:[],count:0,filter:{pagination:1,pageSize:10,groupID:null,text:""},meta:{filter:{pagination:1,pageSize:10,groupID:null,text:""},options:{groups:[]}},metaForm:{form:{id:"",groupID:"",accessTypeID:1,listJournalTagID:[]},options:{users:[],groups:[],accessTypes:[],journalTags:[]}}},he=ot(ct("UserStore"),pt(kt),at(t=>({first:P(()=>(t.filter().pagination-1)*t.filter().pageSize+1),end:P(()=>Math.min(t.filter().pagination*t.filter().pageSize,t.count())),hasCheckedRows:P(()=>t.data().some(o=>o.checked)),checkedData:P(()=>t.data().filter(o=>o.checked).map(o=>o.userID)),selectedID:P(()=>t.data().find(o=>o.checked)?.userID||null)})),lt(t=>{let o=C(ie);return{setFilter(n){E(t,i=>g(h({},i),{filter:n}))},onRowSelect(n){E(t,i=>{let r=i.data.map(m=>m.userID===n.userID?g(h({},m),{checked:!0}):m);return g(h({},i),{data:r})})},onRowUnselect(n){E(t,i=>{let r=i.data.map(m=>m.userID===n.userID?g(h({},m),{checked:!1}):m);return g(h({},i),{data:r})})},onHeaderCheckboxToggle(n){let i=localStorage.getItem("AUTH_USERNAME");E(t,r=>{let m=r.data.map(w=>w.userName!==i?g(h({},w),{checked:n}):g(h({},w),{checked:!1}));return g(h({},r),{data:m})})},getUserLoader:ee(B(N(()=>o.getUserLoaderList().pipe(te({next:n=>{E(t,i=>g(h({},i),{meta:n}))},error:n=>{console.error("Failed to fetch user loader list:",n)}}))))),getUserFormMeta:ee(B(N(n=>o.getUserFormMeta(n).pipe(te({next:i=>{E(t,r=>g(h({},r),{metaForm:i}))},error:i=>{console.error("Failed to fetch user form meta:",i)}}))))),getUsers:ee(B(N(n=>o.getUsers(n).pipe(te({next:i=>{E(t,r=>g(h({},r),{data:i.data.map(m=>g(h({},m),{checked:!1})),count:i.count}))},error:i=>{console.error("Failed to fetch users:",i)}})))))}}),st({onInit:t=>{t.getUserLoader(),t.getUsers(t.filter)}}));var Dt=["header"],Et=["footer"],Ft=["content"],Ut=["closeicon"],Vt=["headless"],Pt=["maskRef"],Lt=["container"],Rt=["closeButton"],Mt=["*"],At=(t,o,e,n,i,r)=>({"p-drawer":!0,"p-drawer-active":t,"p-drawer-left":o,"p-drawer-right":e,"p-drawer-top":n,"p-drawer-bottom":i,"p-drawer-full":r}),Ot=(t,o)=>({transform:t,transition:o}),Bt=t=>({value:"visible",params:t});function Nt(t,o){t&1&&U(0)}function Ht(t,o){if(t&1&&u(0,Nt,1,0,"ng-container",4),t&2){let e=c(2);p("ngTemplateOutlet",e.headlessTemplate||e._headlessTemplate)}}function Qt(t,o){t&1&&U(0)}function zt(t,o){if(t&1&&(l(0,"div"),d(1),s()),t&2){let e=c(3);ae(e.cx("title")),a(),I(e.header)}}function jt(t,o){t&1&&y(0,"TimesIcon"),t&2&&F("data-pc-section","closeicon")}function qt(t,o){}function Gt(t,o){t&1&&u(0,qt,0,0,"ng-template")}function $t(t,o){if(t&1&&u(0,jt,1,1,"TimesIcon",8)(1,Gt,1,0,null,4),t&2){let e=c(4);p("ngIf",!e.closeIconTemplate&&!e._closeIconTemplate),a(),p("ngTemplateOutlet",e.closeIconTemplate||e._closeIconTemplate)}}function Zt(t,o){if(t&1){let e=k();l(0,"p-button",9),b("onClick",function(i){_(e);let r=c(3);return f(r.close(i))})("keydown.enter",function(i){_(e);let r=c(3);return f(r.close(i))}),u(1,$t,2,2,"ng-template",null,1,x),s()}if(t&2){let e=c(3);p("ngClass",e.cx("closeButton"))("buttonProps",e.closeButtonProps)("ariaLabel",e.ariaCloseLabel),F("data-pc-section","closebutton")("data-pc-group-section","iconcontainer")}}function Jt(t,o){t&1&&U(0)}function Wt(t,o){t&1&&U(0)}function Kt(t,o){if(t&1&&(ye(0),l(1,"div",5),u(2,Wt,1,0,"ng-container",4),s(),ve()),t&2){let e=c(3);a(),p("ngClass",e.cx("footer")),F("data-pc-section","footer"),a(),p("ngTemplateOutlet",e.footerTemplate||e._footerTemplate)}}function Xt(t,o){if(t&1&&(l(0,"div",5),u(1,Qt,1,0,"ng-container",4)(2,zt,2,3,"div",6)(3,Zt,3,5,"p-button",7),s(),l(4,"div",5),ke(5),u(6,Jt,1,0,"ng-container",4),s(),u(7,Kt,3,3,"ng-container",8)),t&2){let e=c(2);p("ngClass",e.cx("header")),F("data-pc-section","header"),a(),p("ngTemplateOutlet",e.headerTemplate||e._headerTemplate),a(),p("ngIf",e.header),a(),p("ngIf",e.showCloseIcon&&e.closable),a(),p("ngClass",e.cx("content")),F("data-pc-section","content"),a(2),p("ngTemplateOutlet",e.contentTemplate||e._contentTemplate),a(),p("ngIf",e.footerTemplate||e._footerTemplate)}}function Yt(t,o){if(t&1){let e=k();l(0,"div",3,0),b("@panelState.start",function(i){_(e);let r=c();return f(r.onAnimationStart(i))})("@panelState.done",function(i){_(e);let r=c();return f(r.onAnimationEnd(i))})("keydown",function(i){_(e);let r=c();return f(r.onKeyDown(i))}),u(2,Ht,1,1,"ng-container")(3,Xt,8,9),s()}if(t&2){let e=c();Ce(e.style),ae(e.styleClass),p("ngClass",Ee(9,At,e.visible,e.position==="left"&&!e.fullScreen,e.position==="right"&&!e.fullScreen,e.position==="top"&&!e.fullScreen,e.position==="bottom"&&!e.fullScreen,e.fullScreen||e.position==="full"))("@panelState",S(19,Bt,De(16,Ot,e.transformOptions,e.transitionOptions))),F("data-pc-name","sidebar")("data-pc-section","root"),a(2),j(e.headlessTemplate||e._headlessTemplate?2:3)}}var ei=({dt:t})=>`
|
|
2
2
|
.p-drawer {
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as i}from"./chunk-
|
|
1
|
+
import{a as i}from"./chunk-MYREYOSL.js";import{d as r}from"./chunk-AOOG6YOT.js";import{ia as e}from"./chunk-NMCKMUY4.js";var f=(a,o)=>{let t=e(i),s=e(r),n=t.isAuthenticated(),u=!t.isTokenExpired(),c=t.checkAuthKeysExists();return!n||!u||!c?(s.navigate(["/"],{queryParams:{returnUrl:o.url}}),!1):!0};export{f as a};
|