dealposbooks 5.50.0 → 5.51.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.
Files changed (91) hide show
  1. package/3rdpartylicenses.txt +10 -10
  2. package/{chunk-SX4XIR77.js → chunk-2UDDXT3B.js} +1 -1
  3. package/{chunk-NHW7GVHK.js → chunk-2Z3VSENH.js} +1 -1
  4. package/{chunk-ZC2ADHDH.js → chunk-3IOJJMQE.js} +1 -1
  5. package/{chunk-KZU3VXLG.js → chunk-3O7NQ6AZ.js} +1 -1
  6. package/chunk-3PM6I5JR.js +1 -0
  7. package/{chunk-3ALAWCRA.js → chunk-4BAARBYV.js} +1 -1
  8. package/chunk-52EMI2TW.js +803 -0
  9. package/{chunk-DAM2WKDY.js → chunk-52PEVPZN.js} +1 -1
  10. package/{chunk-RBNXJUFM.js → chunk-5MLCIFDJ.js} +1 -1
  11. package/{chunk-DM45YT57.js → chunk-5SDFH3ZF.js} +1 -1
  12. package/chunk-6JWBYLFX.js +1 -0
  13. package/{chunk-VNZUZ5UI.js → chunk-7XSFPN5T.js} +1 -1
  14. package/chunk-AAKZYXG3.js +145 -0
  15. package/{chunk-BB2CNXSH.js → chunk-BBR4SZ4S.js} +1 -1
  16. package/{chunk-DAFEIZYQ.js → chunk-E2PHUSPH.js} +1 -1
  17. package/{chunk-GU4FXUJC.js → chunk-EO32GXB6.js} +1 -1
  18. package/{chunk-GAXDMEOS.js → chunk-EZXX3QNG.js} +1 -1
  19. package/chunk-FJM77N3D.js +1 -0
  20. package/{chunk-YU4Q7ASX.js → chunk-FUYYSJF7.js} +1 -1
  21. package/{chunk-KXW5NWRO.js → chunk-G25BIGG3.js} +1 -1
  22. package/{chunk-TOR7QRRB.js → chunk-G3BJCT7T.js} +1 -1
  23. package/{chunk-ON7PMYMV.js → chunk-H7YYGW7V.js} +1 -1
  24. package/{chunk-Z4XRTHAH.js → chunk-HR6W3DC4.js} +1 -1
  25. package/{chunk-PB2MFYIM.js → chunk-I3DG6HPA.js} +1 -1
  26. package/chunk-IWB6L5HR.js +1 -0
  27. package/chunk-IYV5JRCZ.js +1 -0
  28. package/{chunk-YQYRAH7V.js → chunk-JBYPGHPN.js} +1 -1
  29. package/chunk-JNPTKMYO.js +1 -0
  30. package/chunk-JRHKJYE2.js +1 -0
  31. package/chunk-KPSZN2UI.js +1 -0
  32. package/chunk-KU3G54A2.js +129 -0
  33. package/chunk-LP4UYVTQ.js +160 -0
  34. package/{chunk-XGU6GBEK.js → chunk-LZCLNB3T.js} +1 -1
  35. package/chunk-MDE76CBT.js +7 -0
  36. package/chunk-MGEVP222.js +1 -0
  37. package/chunk-N3AQU3B6.js +1 -0
  38. package/{chunk-KORGIX2B.js → chunk-OOCLTY27.js} +1 -1
  39. package/{chunk-3GYSEQ25.js → chunk-OW6NHTGL.js} +1 -1
  40. package/chunk-OZYL2K6P.js +1 -0
  41. package/chunk-PQ2NDMDD.js +202 -0
  42. package/{chunk-IMPGOCFC.js → chunk-PXAENMFN.js} +1 -1
  43. package/chunk-PZCAY2XI.js +1 -0
  44. package/{chunk-ZAMQ4RCL.js → chunk-QCGJB7O7.js} +1 -1
  45. package/{chunk-2JFOEOZ2.js → chunk-QSZKELXB.js} +1 -1
  46. package/chunk-RA2HD63W.js +1 -0
  47. package/{chunk-4IMFKRR6.js → chunk-RCHTOR4U.js} +1 -1
  48. package/{chunk-7DBOORB2.js → chunk-RGVP7KT4.js} +1 -1
  49. package/{chunk-65V5R4TS.js → chunk-RNMAINY3.js} +1 -1
  50. package/{chunk-4AGTFPOU.js → chunk-SOD2BIQR.js} +1 -1
  51. package/chunk-U52NCHP2.js +1 -0
  52. package/chunk-U7I6X4QJ.js +8 -0
  53. package/chunk-UMDFA3TV.js +1 -0
  54. package/{chunk-VKUW7E75.js → chunk-UNKPZO2B.js} +1 -1
  55. package/{chunk-56CZGYL5.js → chunk-V6BSLJMN.js} +1 -1
  56. package/chunk-VANY33VH.js +1 -0
  57. package/{chunk-A6T2KR7U.js → chunk-VYR5D7SO.js} +1 -1
  58. package/{chunk-XULSWUMO.js → chunk-VZHZFGQ2.js} +1 -1
  59. package/chunk-WNEAYP2J.js +1 -0
  60. package/{chunk-SJOOTBQ5.js → chunk-X7I6QMMX.js} +1 -1
  61. package/{chunk-LBXNL7E4.js → chunk-Y4SHAFGQ.js} +1 -1
  62. package/{chunk-J3HFAWXU.js → chunk-YI5IYWUO.js} +1 -1
  63. package/{chunk-SOYJAYJK.js → chunk-YKZN6T5N.js} +1 -1
  64. package/{chunk-RVUOVLL5.js → chunk-YZ76QE4R.js} +1 -1
  65. package/{chunk-SXNOZOOP.js → chunk-Z2MDQN57.js} +1 -1
  66. package/chunk-ZM7C3PCP.js +1 -0
  67. package/index.html +2 -2
  68. package/{main-UCTZ3G6L.js → main-ARGVLXJ4.js} +1 -1
  69. package/package.json +1 -1
  70. package/chunk-27SC6O47.js +0 -1
  71. package/chunk-47G2N7SA.js +0 -1
  72. package/chunk-4RBG4SFN.js +0 -1
  73. package/chunk-5N5QHECN.js +0 -1
  74. package/chunk-6GO647AV.js +0 -1
  75. package/chunk-AF6G72MJ.js +0 -1
  76. package/chunk-BOQI2TMP.js +0 -8
  77. package/chunk-BTFX33U6.js +0 -947
  78. package/chunk-COSMZ2AH.js +0 -1
  79. package/chunk-FHXTQXB7.js +0 -160
  80. package/chunk-HQHEWKLC.js +0 -1
  81. package/chunk-I2OULINE.js +0 -1
  82. package/chunk-JERRSTLA.js +0 -1
  83. package/chunk-OOCCZG53.js +0 -129
  84. package/chunk-SASRJPT7.js +0 -1
  85. package/chunk-URGN4QVD.js +0 -1
  86. package/chunk-UTOLWW4T.js +0 -1
  87. package/chunk-VJROOSEO.js +0 -7
  88. package/chunk-WYLIU52Q.js +0 -1
  89. package/chunk-XN4CDKDI.js +0 -1
  90. package/chunk-Z3ZKNQZS.js +0 -1
  91. package/chunk-ZWNKUBMG.js +0 -202
@@ -0,0 +1 @@
1
+ import{a as Ze,b as et,c as tt,d as nt,e as ot,f as it}from"./chunk-TAN6GLIH.js";import{a as Xe}from"./chunk-YHLRDTIS.js";import{m as Y}from"./chunk-Q4XWXOWE.js";import"./chunk-WL6ZZCYW.js";import{a as fe,b as ge}from"./chunk-3VQUNDVT.js";import{b as se,c as Ke,g as qe,h as Qe,i as ie}from"./chunk-52EMI2TW.js";import"./chunk-AAKZYXG3.js";import"./chunk-BME4Z6DH.js";import"./chunk-VSDW2RJ5.js";import"./chunk-7L5IAWG2.js";import{a as Ne}from"./chunk-BT7Y4ADP.js";import{a as le,b as me}from"./chunk-5U7KZJ3H.js";import"./chunk-MJGBBYIO.js";import"./chunk-CN6AT4LE.js";import{a as j,b as U}from"./chunk-OW2ND5HU.js";import"./chunk-JWNGZMSE.js";import"./chunk-II7KELI4.js";import"./chunk-FTBQKOYS.js";import"./chunk-L4ENW4RK.js";import{a as Re,b as q}from"./chunk-FHJOSHI3.js";import"./chunk-KONCSTVQ.js";import"./chunk-FMAG3RQL.js";import{i as M}from"./chunk-YI5IYWUO.js";import"./chunk-VM56C6ZV.js";import{a as K,b as W}from"./chunk-ISIYG4D5.js";import{b as Z,c as Te,d as we,e as Me,f as De,g as Ae,h as Je}from"./chunk-FNGX2XFA.js";import"./chunk-ALLR2NXQ.js";import"./chunk-BFEM6LX7.js";import{o as Ye,w as N,x as G}from"./chunk-O44DI62I.js";import"./chunk-DTYVTTET.js";import{e as $,f as Pe,j as oe,k as be,m as Oe,n as Ee,o as He,p as Ie,v as Fe,x as J,y as pe}from"./chunk-MGIEURA2.js";import{b as re,d as ze,e as D,l as A}from"./chunk-DZCJWJUG.js";import"./chunk-YZ76QE4R.js";import{a as ye}from"./chunk-G3BJCT7T.js";import"./chunk-JBYPGHPN.js";import"./chunk-GGQ7LRWG.js";import"./chunk-F2X3VGZZ.js";import"./chunk-KL3TPLRB.js";import{m as V,q as Ue,u as w}from"./chunk-DM2JLWKE.js";import{Dc as ve,Eb as f,Ec as H,Fc as ae,Ha as E,Mb as c,Oc as $e,Pb as X,Pc as We,Rb as B,Sb as P,Sc as u,Ub as b,Vb as O,Wb as r,Xb as a,Y as z,Yb as te,_ as F,ac as v,bd as ne,c as _e,ca as Se,cd as je,fc as y,gc as s,ia as C,ib as p,qa as h,ra as S,s as ee,sc as m,tc as g,uc as I,wc as Ve,yb as T}from"./chunk-6QJHEOXN.js";import{a as _,b as x}from"./chunk-YQFG5XE2.js";var R=(()=>{class t{constructor(){this.httpService=C(ye)}getGlobalConfiguration(){return this.httpService.get(void 0,"/api/setup/GlobalConfiguration")}saveGlobalConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitGlobalConfiguration",e)}fetchPOSOutletConfiguration(e){return this.httpService.get(void 0,"/api/Setup/OutletConfiguration",{params:e})}fetchPOSOutletFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/Setup/OutletConfigurationForm",n)}updatePOSOutletConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitOutletConfiguration",e)}fetchPOSPaymentConfiguration(e){return this.httpService.get(void 0,"/api/Setup/PaymentConfiguration",{params:e})}fetchPOSPaymentFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"api/Setup/PaymentConfigurationForm",n)}updatePOSPaymentConfiguration(e){return this.httpService.post(void 0,"/api/Setup/SubmitPaymentConfiguration",e)}fetchPOSTaxConfiguration(){return this.httpService.get(void 0,"/api/setup/TaxConfigurationForm")}updatePOSTaxConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitTaxConfiguration",e)}fetchPOSWriteOffConfiguration(){return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationList")}fetchPOSWriteOffFormConfiguration(e){let n={params:e};return this.httpService.get(void 0,"/api/setup/WriteOffConfigurationForm",n)}updatePOSWriteOffConfiguration(e){return this.httpService.post(void 0,"/api/setup/SubmitWriteOffConfiguration",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Se({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var k=function(t){return t.POSGLOBAL_SELL="Sell",t.POSGLOBAL_BUY="Buy",t.POSGLOBAL_ADJUSTMENT="Adjustment",t.POSGLOBAL_PREPAID="Prepaid",t.POSGLOBAL_RETURN="Return",t.POSGLOBAL_DEBT="Debt",t.POSGLOBAL_PAYMENTFEE="Payment Fee",t.POSGLOBAL_MANUFACTURING="Manufacturing",t.POSGLOBAL_ADVANCE="Advance",t}(k||{});var at={[k.POSGLOBAL_SELL]:[{typeID:2,side:"debit",label:"Account Receivable"},{typeID:1,side:"credit",label:"Sales"},{typeID:4,side:"debit",label:"COGS"},{typeID:3,side:"credit",label:"Sold Inventory"},{typeID:10,side:"debit",label:"Sales Discount"},{typeID:31,side:"credit",label:"Sold Non-Inventory"}],[k.POSGLOBAL_BUY]:[{typeID:27,side:"debit",label:"Pending Paid Inventory"},{typeID:5,side:"credit",label:"Account Payable"},{typeID:28,side:"debit",label:"Inventory Bought"},{typeID:27,side:"credit",label:"Pending Paid Inventory"},{typeID:11,side:"credit",label:"Purchase Discount"}],[k.POSGLOBAL_ADJUSTMENT]:[{typeID:26,side:"debit",label:"Adjustment Asset"},{typeID:21,side:"credit",label:"Adjustment Expense"}],[k.POSGLOBAL_PREPAID]:[{typeID:29,side:"debit",label:"Accounting for Prepaid"},{typeID:30,side:"debit",label:"Sales For Prepaid"}],[k.POSGLOBAL_RETURN]:[{typeID:8,side:"debit",label:"Sales Return"},{typeID:3,side:"debit",label:"Inventory"},{typeID:4,side:"credit",label:"COGS"},{typeID:9,side:"credit",label:"Purchase Return"}],[k.POSGLOBAL_DEBT]:[{typeID:17,side:"debit",label:"Consignment Payable"}],[k.POSGLOBAL_PAYMENTFEE]:[{typeID:19,side:"debit",label:"Payment Fee"},{typeID:20,side:"credit",label:"Surcharge"}],[k.POSGLOBAL_MANUFACTURING]:[{typeID:24,side:"debit",label:"Finished Goods"},{typeID:23,side:"credit",label:"Raw Material"},{typeID:25,side:"credit",label:"Production Expenses"}],[k.POSGLOBAL_ADVANCE]:[{typeID:15,side:"debit",label:"Crossing Account"},{typeID:16,side:"debit",label:"Retained Earnings"},{typeID:18,side:"debit",label:"Current Earnings"}]};function gt(t,i){if(t&1){let e=v();r(0,"p-button",7),y("onClick",function(){h(e);let o=s(2);return S(o.onSubmit())}),a()}}function xt(t,i){if(t&1&&(r(0,"div",5),f(1,gt,1,0,"p-button",6),a()),t&2){let e=s();p(),B(e.roleService.permissions().posSetup.edit?1:-1)}}function Ct(t,i){if(t&1&&(r(0,"p-tab",11),m(1),a()),t&2){let e=i.$implicit;c("value",e.value),p(),g(e.label)}}function ht(t,i){if(t&1&&(r(0,"div",20)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function St(t,i){if(t&1&&(r(0,"div",20)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function vt(t,i){if(t&1&&(r(0,"div",15)(1,"div",16)(2,"div",5)(3,"label",17),m(4),a(),r(5,"span",18),m(6),a()(),r(7,"p-select",19),f(8,ht,7,2,"ng-template",null,2,u)(10,St,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),g(e.entry.value.label),p(2),g(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function yt(t,i){if(t&1&&(r(0,"div",20)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function Pt(t,i){if(t&1&&(r(0,"div",20)(1,"div")(2,"span"),m(3),a()(),r(4,"div")(5,"span"),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function bt(t,i){if(t&1&&(r(0,"div",15)(1,"div",16)(2,"div",5)(3,"label",17),m(4),a(),r(5,"span",21),m(6),a()(),r(7,"p-select",19),f(8,yt,7,2,"ng-template",null,2,u)(10,Pt,7,2,"ng-template",null,3,u),a()()()),t&2){let e=i.$implicit,n=s(4);c("formGroupName",e.index),p(4),g(e.entry.value.label),p(2),g(e.entry.value.side),p(),c("options",n.posIntegration().options.accounts)}}function Ot(t,i){if(t&1&&(r(0,"p-tabpanel",11)(1,"div",12)(2,"div",13)(3,"div",14),b(4,vt,12,4,"div",15,P),a()(),r(6,"div",13)(7,"div",14),b(8,bt,12,4,"div",15,P),a()()()()),t&2){let e=i.$implicit,n=s(3);c("value",e.value),p(),c("formGroupName",e.value),p(3),O(n.getDebitEntries(e.value)),p(4),O(n.getCreditEntries(e.value))}}function Et(t,i){if(t&1){let e=v();r(0,"form",9),y("ngSubmit",function(){h(e);let o=s(2);return S(o.onSubmit())}),r(1,"p-tabs",10)(2,"p-tablist"),b(3,Ct,2,2,"p-tab",11,P),a(),r(5,"p-tabpanels"),b(6,Ot,10,2,"p-tabpanel",11,P),a()()()}if(t&2){let e=s(2);c("formGroup",e.accountForm),p(),c("value",e.tab())("lazy",!0),p(2),O(e.tabs()),p(3),O(e.tabs())}}function It(t,i){if(t&1&&f(0,Et,8,3,"form",8),t&2){let e=s();c("ngIf",e.posIntegration()&&e.accountForm)}}var rt=(()=>{class t{constructor(){this.posConfigService=C(R),this.fb=C(Fe),this.roleService=C(Y),this.tab=E(k.POSGLOBAL_SELL),this.tabs=E(Object.values(k).map(e=>({label:e,value:e}))),this.posIntegration=E(null),this.form=E([]),this.descriptionsMap=new Map,this.objectKeys=Object.keys,this.posGlobalTabEnum=k}ngOnInit(){this.posConfigService.getGlobalConfiguration().pipe(F(e=>{this.posIntegration.set(e),this.form.set(e.form),this.descriptionsMap=new Map(e.descriptions.map(n=>[+n.id,n.name])),this.initializeForm()})).subscribe()}initializeForm(){let e={};this.tabs().forEach(n=>{let o=this.getEntriesForTab(n.value);console.log(`Entries for ${n.value}:`,o),e[n.value]=this.fb.array(o.map(l=>this.createEntryFormGroup(l)))}),this.accountForm=this.fb.group(e)}createEntryFormGroup(e){let n=this.fb.group({typeID:[e.typeID],label:[e.label],side:[e.side],accountID:[this.getAccountIDByTypeID(e.typeID)]});return n.get("accountID").valueChanges.subscribe(o=>{this.syncAccountIDs(e.typeID,o,n)}),n}getAccountIDByTypeID(e){return this.form().find(o=>o.typeID===e)?.accountID||""}getEntriesForTab(e){return at[e]||[]}getTabEntries(e){return this.accountForm.get(e)}onSubmit(){let e=this.accountForm.getRawValue(),n=[],o=new Set;for(let l of Object.values(e))for(let{typeID:d,accountID:L}of l){let de=`${d}_${L}`;o.has(de)||(o.add(de),n.push({typeID:d,accountID:L||Xe}))}console.log("Form submitted with value:",n),this.posConfigService.saveGlobalConfiguration({form:n}).subscribe({next:()=>console.log("Save successful"),error:l=>console.error("Save failed",l)})}getDebitEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="debit")}getCreditEntries(e){return this.getTabEntries(e).controls.map((n,o)=>({entry:n,index:o})).filter(n=>n.entry.value.side==="credit")}syncAccountIDs(e,n,o){Object.values(this.accountForm.controls).forEach(l=>{l.controls.forEach(d=>{d!==o&&d.get("typeID")?.value===e&&d.get("accountID")?.value!==n&&d.get("accountID")?.setValue(n,{emitEvent:!1})})})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-global"]],decls:5,vars:0,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","POS Integration"],[1,"d-flex","gap-2"],["label","Submit"],["label","Submit",3,"onClick"],[3,"formGroup","ngSubmit",4,"ngIf"],[3,"ngSubmit","formGroup"],[1,"border-top",3,"value","lazy"],[3,"value"],[1,"row",3,"formGroupName"],[1,"col"],[1,"row","gap-3"],[1,"col-12",3,"formGroupName"],[1,"form-group","d-flex","flex-column"],["for","",1,"fs-3"],[1,"text-success","fs-3"],["filter","","filterBy","code,name","formControlName","accountID","optionLabel","name","optionValue","id",3,"options"],[1,"d-flex","align-items-center","gap-2"],[1,"text-danger","fs-3"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,xt,2,1,"ng-template",null,0,u)(3,It,1,1,"ng-template",null,1,u),a())},dependencies:[M,it,ot,nt,tt,Ze,et,Ye,U,j,J,be,$,Pe,w,V,A,G,N,pe,Oe,Ie,Ee],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ft=t=>[t];function Tt(t,i){if(t&1&&(r(0,"th",7),m(1),a()),t&2){let e=i.$implicit;p(),g(e.name.slice(0,10))}}function wt(t,i){if(t&1&&(r(0,"tr")(1,"th",6),m(2,"Method"),a()(),r(3,"tr"),b(4,Tt,2,1,"th",7,P),a()),t&2){let e=s(3);p(4),O(e.paymentConfiguration().outlets)}}function Mt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),g(e.accountName)}}function Dt(t,i){if(t&1&&(r(0,"tr")(1,"td",8)(2,"a",9),m(3),a()(),b(4,Mt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",ae(2,Ft,e.id)),p(),g(e.name),p(),O(e.accounts)}}function At(t,i){if(t&1&&(r(0,"p-table",5),f(1,wt,6,0,"ng-template",null,1,u)(3,Dt,6,4,"ng-template",null,2,u),a()),t&2){let e=s(2);c("value",e.paymentConfiguration().payment)}}function Rt(t,i){if(t&1){let e=v();r(0,"app-main-panel",4),y("search",function(o){h(e);let l=s();return S(l.onSearch(o))}),f(1,At,5,1,"ng-template",null,0,u),a()}t&2&&c("isSearchableInput",!0)("scrollable",!0)}var lt=(()=>{class t{constructor(){this.POSSetupService=C(R),this.paymentConfiguration=E(null)}ngOnInit(){this.POSSetupService.fetchPOSPaymentConfiguration({}).pipe(F(e=>{this.paymentConfiguration.set(e)})).subscribe()}onSearch(e){this.POSSetupService.fetchPOSPaymentConfiguration({Search:e}).pipe(F(n=>{this.paymentConfiguration.set(n)})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment"]],decls:1,vars:1,consts:[["content",""],["header",""],["body",""],["pageTitle","Payment Method Accounting",3,"isSearchableInput","scrollable","search",4,"ngIf"],["pageTitle","Payment Method Accounting",3,"search","isSearchableInput","scrollable"],[3,"value"],["rowspan","3",2,"min-width","300px"],[2,"min-width","200px"],["pFrozenColumn",""],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&f(0,Rt,3,2,"app-main-panel",3),n&2&&c("ngIf",o.paymentConfiguration())},dependencies:[M,ie,se,Ke,w,V,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var kt={data:{listOutletAccount:[],listCOAType:[],pageNumber:1,pageSize:20,totalCount:0,totalPages:0},filter:{PageNumber:1,PageSize:20,Search:""}},Ge=Te(Ae(kt),we(t=>({first:ne(()=>(t.filter().PageNumber-1)*t.filter().PageSize+1),end:ne(()=>Math.min(t.filter().PageNumber*t.filter().PageSize,t.data().totalCount))})),De(t=>{let i=C(R);return{updateFilter:n=>{Z(t,o=>x(_({},o),{filter:_(_({},o.filter),n)}))},getPOSOutlets:fe(_e(z(n=>i.fetchPOSOutletConfiguration(n).pipe(ge({next:o=>{Z(t,l=>x(_({},l),{data:o}))},error:o=>{console.error("Error fetching POS outlets:",o)}})))))}}),Me(t=>({onInit:()=>{t.getPOSOutlets(t.filter)}})));var Lt=t=>[t];function Nt(t,i){if(t&1&&(r(0,"th"),m(1),a()),t&2){let e=i.$implicit;p(),g(e.value)}}function Gt(t,i){if(t&1&&(r(0,"tr")(1,"th"),m(2,"Name"),a(),b(3,Nt,2,1,"th",null,P),a()),t&2){let e=s(2);p(3),O(e.store.data().listCOAType)}}function Bt(t,i){if(t&1&&(r(0,"td"),m(1),a()),t&2){let e=i.$implicit;p(),g(e)}}function Vt(t,i){if(t&1&&(r(0,"tr")(1,"td")(2,"a",7),m(3),a()(),b(4,Bt,2,1,"td",null,P),a()),t&2){let e=i.$implicit;p(2),c("routerLink",ae(2,Lt,e.OutletID)),p(),I(" ",e.OutletName,""),p(),O(e.Accounts)}}function $t(t,i){if(t&1&&m(0),t&2){let e=s(2);Ve(" Showing ",e.store.first()," to ",e.store.end()," of ",e.store.data().totalCount," entries ")}}function Wt(t,i){t&1&&(r(0,"tr")(1,"td",8)(2,"span"),m(3," No journal entries found. "),a()()())}function jt(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",6),y("onPage",function(o){h(e);let l=s();return S(l.onPage(o))}),f(2,Gt,5,0,"ng-template",null,1,u)(4,Vt,6,4,"ng-template",null,2,u)(6,$t,1,3,"ng-template",null,3,u)(8,Wt,4,0,"ng-template",null,4,u),a()()}if(t&2){let e=s();p(),c("value",e.store.data().listOutletAccount)("paginator",!0)("rows",e.store.filter().PageSize)("lazy",!0)("totalRecords",e.store.data().totalCount)}}var mt=(()=>{class t{constructor(){this.store=C(Ge)}onSearch(e){this.store.updateFilter({PageNumber:1,PageSize:20,Search:e})}onPage(e){let n=e.first/e.rows+1;this.store.updateFilter(x(_({},this.store.filter()),{PageSize:e.rows,PageNumber:n}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet"]],features:[ve([Ge])],decls:3,vars:2,consts:[["content",""],["header",""],["body",""],["paginatorleft",""],["emptymessage",""],["pageTitle","Outlet Account",3,"search","isSearchableInput","scrollable"],["styleClass","d-flex flex-column justify-content-between h-100",3,"onPage","value","paginator","rows","lazy","totalRecords"],[1,"link","link-primary",3,"routerLink"],["colspan","8"]],template:function(n,o){if(n&1){let l=v();r(0,"app-main-panel",5),y("search",function(L){return h(l),S(o.onSearch(L))}),f(1,jt,10,5,"ng-template",null,0,u),a()}n&2&&c("isSearchableInput",!0)("scrollable",!0)},dependencies:[M,w,q,ie,se,A,D,W,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Ut=()=>({height:"calc(100vh - 100px)"}),zt=()=>({height:"calc(100vh - 150px)"});function Ht(t,i){if(t&1){let e=v();r(0,"p-button",7),y("onClick",function(){h(e);let o=s(2);return S(o.updatePOsOutletConfiguration())}),a()}}function Yt(t,i){if(t&1&&(r(0,"a",5),m(1,"Cancel"),a(),f(2,Ht,1,0,"p-button",6)),t&2){let e=s();p(2),B(e.roleService.permissions().posSetup.edit?2:-1)}}function Jt(t,i){if(t&1&&(r(0,"div",17)(1,"div",18)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",18),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function Kt(t,i){if(t&1&&(r(0,"div",17)(1,"div",18)(2,"span"),m(3),a()(),r(4,"div",19)(5,"span",18),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function qt(t,i){if(t&1&&(r(0,"div",13)(1,"span",15),m(2),a(),r(3,"p-select",16),f(4,Jt,7,2,"ng-template",null,2,u)(6,Kt,7,2,"ng-template",null,3,u),a()()),t&2){let e,n=i.$implicit,o=i.$index,l=s(3);c("formGroupName",o),p(2),g((e=n.get("TypeName"))==null?null:e.value),p(),c("options",l.options.accounts)}}function Qt(t,i){t&1&&te(0,"hr")}function Xt(t,i){if(t&1&&(r(0,"div",10)(1,"h3",11),m(2),$e(3,"titlecase"),a(),r(4,"div",12),b(5,qt,8,3,"div",13,P),a()(),f(7,Qt,1,0,"hr",14)),t&2){let e,n=i.$implicit,o=i.$index,l=i.$index,d=i.$count,L=s(2);c("formGroupName",o),p(2),I(" ",We(3,3,(e=n.get("groupName"))==null?null:e.value)," "),p(3),O(L.getAccountsFormArray(l).controls),p(2),c("ngIf",l!==d-1)}}function Zt(t,i){if(t&1&&(r(0,"p-panel")(1,"p-scroll-panel")(2,"form",8)(3,"div",9),b(4,Xt,8,5,null,null,P),a()()()()),t&2){let e=s();X(H(5,Ut)),p(),X(H(6,zt)),p(),c("formGroup",e.accountsForm),p(2),O(e.accountGroupsArray.controls)}}var st=(()=>{class t{constructor(){this.allAccounts=[],this.options=null,this.outletName="",this.accountGroups=[{name:"sell",typeIds:[1,2,10],accounts:[]},{name:"delivery",typeIds:[3,4],accounts:[]},{name:"buy",typeIds:[27,11,28],accounts:[]},{name:"purchase return",typeIds:[9],accounts:[]},{name:"sales return",typeIds:[8],accounts:[]},{name:"adjustment",typeIds:[21,26],accounts:[]}],this.outletForm=E(null),this.roleService=C(Y),this.route=C(re),this.POSSetupService=C(R),this.fb=C(Fe)}get accountGroupsArray(){return this.accountsForm.get("accountGroups")}ngOnInit(){this.accountsForm=this.fb.group({accountGroups:this.fb.array([])}),this.route.paramMap.pipe(ee(e=>e.get("id")),z(e=>this.POSSetupService.fetchPOSOutletFormConfiguration({outletID:e})),F(e=>{this.allAccounts=e.form,this.options=e.options,this.outletName=e.form[0].OutletName,this.accountGroups.forEach(o=>{o.accounts=this.allAccounts.filter(l=>o.typeIds.includes(l.TypeID))});let n=this.accountsForm.get("accountGroups");this.accountGroups.forEach(o=>{n.push(this.createAccountGroupControl(o))})})).subscribe()}getAccountsFormArray(e){return this.accountGroupsArray.at(e).get("accounts")}updatePOsOutletConfiguration(){let{accountGroups:e}=this.accountsForm.value,n={form:e.flatMap(o=>o.accounts.map(l=>({AccountID:l.AccountID,TypeID:l.TypeID,TypeName:l.TypeName,OutletID:l.OutletID,OutletName:l.OutletName})))};this.POSSetupService.updatePOSOutletConfiguration(n).pipe().subscribe()}createAccountGroupControl(e){return this.fb.group({groupName:[e.name],accounts:this.fb.array(e.accounts.map(n=>this.createAccountControl(n)))})}createAccountControl(e){return this.fb.group({AccountID:[e.AccountID],TypeID:[e.TypeID],TypeName:[e.TypeName],OutletID:[e.OutletID],OutletName:[e.OutletName]})}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-outlet-form"]],decls:5,vars:2,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"hasMainWrapperPadding","pageTitle"],["routerLink","/pages/pos-setup/outlets",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit"],["label","Submit",3,"onClick"],[1,"",3,"formGroup"],["formArrayName","accountGroups",1,"d-flex","flex-column","gap-2"],[1,"row",3,"formGroupName"],[1,"fs-4","fw-semibold"],["formArrayName","accounts",1,"row","row-gap-3"],[1,"col-6",3,"formGroupName"],[4,"ngIf"],[1,"fs-3"],["filter","","filterBy","code,name","formControlName","AccountID","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-100",3,"options"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,Yt,3,1,"ng-template",null,0,u)(3,Zt,6,7,"ng-template",null,1,u),a()),n&2&&c("hasMainWrapperPadding",!0)("pageTitle","Edit "+o.outletName)},dependencies:[M,w,V,Ue,q,pe,be,$,Pe,Oe,Ie,Ee,He,U,j,W,K,le,G,N,A,D],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var nn=()=>({height:"calc(100vh - 100px)"}),on=()=>({width:"100%",height:"calc(100vh - 150px)"}),an=()=>({width:"100%"});function rn(t,i){if(t&1){let e=v();r(0,"p-button",8),y("onClick",function(){h(e);let o=s(4);return S(o.updatePOSOutletConfiguration())}),a()}}function pn(t,i){if(t&1&&(r(0,"a",6),m(1,"Cancel"),a(),f(2,rn,1,0,"p-button",7)),t&2){let e=s(3);p(2),B(e.roleService.permissions().posSetup.edit?2:-1)}}function ln(t,i){if(t&1&&(r(0,"div",17)(1,"div",18)(2,"span"),m(3),a()(),r(4,"div",18)(5,"span",18),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function mn(t,i){if(t&1&&(r(0,"div",17)(1,"div",18)(2,"span"),m(3),a()(),r(4,"div",19)(5,"span",18),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function sn(t,i){if(t&1){let e=v();r(0,"div",10)(1,"div",11)(2,"div",12)(3,"label",13),m(4),a()(),te(5,"div",14),r(6,"div",15)(7,"p-select",16),y("ngModelChange",function(o){let l=h(e).$index,d=s(4);return S(d.updateAccountById(o,l))}),f(8,ln,7,2,"ng-template",null,2,u)(10,mn,7,2,"ng-template",null,3,u),a()()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(4);p(4),g(e.outletName.slice(0,15)),p(3),X(H(7,an)),c("ngModel",o.paymentForm().form.accounts[n].accountID)("options",o.paymentForm().options.chartOfAccount)("virtualScrollItemSize",50)("virtualScroll",!0)}}function cn(t,i){if(t&1&&(r(0,"p-card")(1,"p-scrollpanel")(2,"div",9),b(3,sn,12,8,"div",10,P),a()()()),t&2){let e=s(3);X(H(4,nn)),p(),X(H(5,on)),p(2),O(e.paymentForm().form.accounts)}}function un(t,i){if(t&1&&(r(0,"app-main-panel",4),f(1,pn,3,1,"ng-template",null,0,u)(3,cn,5,6,"ng-template",null,1,u),a()),t&2){let e=s(2);c("hasMainWrapperPadding",!0)("pageTitle",e.paymentForm().form.paymentMethod.name+" Form Accounting")}}function dn(t,i){if(t&1&&f(0,un,5,2,"app-main-panel",5),t&2){let e=s();c("ngIf",e.paymentForm())}}var ct=(()=>{class t{constructor(){this.paymentForm=E(null),this.roleService=C(Y),this.route=C(re),this.POSSetupService=C(R),this.router=C(ze)}ngOnInit(){this.route.paramMap.pipe(ee(e=>+e.get("id")),z(e=>this.POSSetupService.fetchPOSPaymentFormConfiguration({ID:e})),F(e=>{this.paymentForm.set(e)}),Ne("response")).subscribe()}updateAccountById(e,n){let o=this.paymentForm().form.accounts,l=x(_({},this.paymentForm()),{form:x(_({},this.paymentForm().form),{accounts:o.map((d,L)=>L===n?x(_({},d),{accountID:e}):d)})});this.paymentForm.set(l)}updatePOSOutletConfiguration(){let e={form:[...this.paymentForm().form.accounts]};this.POSSetupService.updatePOSPaymentConfiguration(e).pipe(Ne("response"),F(()=>{this.router.navigate(["/pages/pos-setup/payments"])})).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-payment-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"hasMainWrapperPadding","pageTitle"],[3,"hasMainWrapperPadding","pageTitle",4,"ngIf"],["routerLink","/pages/pos-setup/payments",1,"p-button","p-button-outlined","p-button-secondary"],["label","Submit"],["label","Submit",3,"onClick"],[1,"row","row-gap-3"],[1,"col-6","d-flex","flex-column","gap-2"],[1,"row","row-gap-4"],[1,"col-2"],["for",""],[1,"col-3"],[1,"col-7"],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an account",1,"w-full",3,"ngModelChange","ngModel","options","virtualScrollItemSize","virtualScroll"],[1,"d-flex","gap-2"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&f(0,dn,1,1,"app-main-panel",4),n&2&&B(o.paymentForm()?0:-1)},dependencies:[q,Re,M,w,V,me,le,U,j,J,$,oe,A,D,G,N,W],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();function _n(t,i){if(t&1){let e=v();r(0,"p-button",8),y("onClick",function(){h(e);let o=s(2);return S(o.updatePOSTaxConfiguration())}),a()}}function fn(t,i){if(t&1&&(r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),f(3,_n,1,0,"p-button",7),a()),t&2){let e=s();p(3),B(e.roleService.permissions().posSetup.edit?3:-1)}}function gn(t,i){if(t&1&&(r(0,"div",5)(1,"div",16)(2,"span"),m(3),a()(),r(4,"div",16)(5,"span",16),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function xn(t,i){if(t&1&&(r(0,"div",5)(1,"div",16)(2,"span"),m(3),a()(),r(4,"div",17)(5,"span",16),m(6),a()()()),t&2){let e=i.$implicit;p(3),I("(",e.code,")"),p(3),g(e.name)}}function Cn(t,i){if(t&1){let e=v();r(0,"div",12)(1,"div",13)(2,"label",14),m(3),a(),r(4,"p-select",15),y("ngModelChange",function(o){let l=h(e).$index,d=s(2);return S(d.updateAccountID(o,l))}),f(5,gn,7,2,"ng-template",null,2,u)(7,xn,7,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=i.$index,o=s(2);p(3),g(e.name),p(),c("ngModel",o.taxForm().form[n].accountID)("options",o.taxForm().options.chartOfAccount)}}function hn(t,i){if(t&1&&(r(0,"p-panel")(1,"div",9)(2,"div",10)(3,"div",11),b(4,Cn,9,3,"div",12,P),a()()()()),t&2){let e=s();p(4),O(e.taxForm().form)}}var ut=(()=>{class t{constructor(){this.taxForm=E(null),this.roleService=C(Y),this.POSSetupService=C(R)}ngOnInit(){this.POSSetupService.fetchPOSTaxConfiguration().pipe(F(e=>{this.taxForm.set(e)})).subscribe()}updateAccountID(e,n){let o=this.taxForm().form,l=x(_({},this.taxForm()),{form:o.map((d,L)=>L===n?x(_({},d),{accountID:e}):d)});this.taxForm.set(l)}updatePOSTaxConfiguration(){let e={form:[...this.taxForm().form]};this.POSSetupService.updatePOSTaxConfiguration(e).pipe(F(n=>console.log(n))).subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-tax"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Tax Setup",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-4"],[1,"row","row-gap-3"],[1,"col-12"],[1,"d-flex","flex-column"],["for",""],["filter","","filterBy","name,code","optionLabel","name","optionValue","id","placeholder","Select an Account",3,"ngModelChange","ngModel","options"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,fn,4,1,"ng-template",null,0,u)(3,hn,6,0,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,q,w,U,j,me,J,$,oe,A,D,G,N,W,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Sn=()=>({"min-width":"50rem"}),vn=t=>[t];function yn(t,i){t&1&&te(0,"p-button",6)}function Pn(t,i){if(t&1&&f(0,yn,1,0,"p-button",5),t&2){let e=s();c("ngIf",e.hasCheckedItems())}}function bn(t,i){t&1&&(r(0,"tr")(1,"th",8),te(2,"p-tableHeaderCheckbox"),a(),r(3,"th"),m(4,"Name"),a(),r(5,"th"),m(6,"Description"),a()())}function On(t,i){if(t&1&&(r(0,"tr")(1,"td"),te(2,"p-tableCheckbox",9),a(),r(3,"td")(4,"a",10),m(5),a()(),r(6,"td"),m(7),a()()),t&2){let e=i.$implicit;p(2),c("value",e),p(2),c("routerLink",ae(4,vn,e.id)),p(),g(e.name),p(2),g(e.description)}}function En(t,i){if(t&1){let e=v();r(0,"p-panel")(1,"p-table",7),y("onRowSelect",function(o){h(e);let l=s();return S(l.onRowSelect(o))})("onRowUnselect",function(o){h(e);let l=s();return S(l.onRowSelect(o))})("onHeaderCheckboxToggle",function(o){h(e);let l=s();return S(l.onSelectAll(o))}),f(2,bn,7,0,"ng-template",null,2,u)(4,On,8,6,"ng-template",null,3,u),a()()}if(t&2){let e=s();p(),c("value",e.writeoffList().data)("tableStyle",H(2,Sn))}}var dt=(()=>{class t{constructor(){this.POSSetupService=C(R),this.writeoffList=E(null),this.hasCheckedItems=ne(()=>{let e=this.writeoffList();return!e||!e.data||!Array.isArray(e.data)?!1:e.data.some(n=>n&&n.checked===!0)})}ngOnInit(){this.POSSetupService.fetchPOSWriteOffConfiguration().pipe(ee(e=>x(_({},e),{data:e.data.map(n=>x(_({},n),{checked:!1}))})),F(e=>{this.writeoffList.set(e)})).subscribe()}onRowSelect(e){console.log("Selected Row:",e.data);let n=this.writeoffList();if(!n||!n.data)return;let o=n.data.findIndex(l=>l.id===e.data.id);if(o!==-1){let l=[...n.data];l[o]=x(_({},l[o]),{checked:!l[o].checked}),this.writeoffList.set(x(_({},n),{data:l}))}}onSelectAll(e){let n=this.writeoffList();if(!n?.data)return;let o=n.data.map(l=>x(_({},l),{checked:e.checked}));this.writeoffList.set(x(_({},n),{data:o}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff"]],decls:5,vars:1,consts:[["actionButton",""],["content",""],["header",""],["body",""],["pageTitle","Write Off",3,"scrollable"],["severity","danger","label","Delete","icon","fa-solid fa-trash",4,"ngIf"],["severity","danger","label","Delete","icon","fa-solid fa-trash"],["dataKey","id",3,"onRowSelect","onRowUnselect","onHeaderCheckboxToggle","value","tableStyle"],[2,"width","1rem"],[3,"value"],[1,"link-primary",3,"routerLink"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,Pn,1,1,"ng-template",null,0,u)(3,En,6,3,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,w,V,ie,se,qe,Qe,A,D,G,N,W,K],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var In=()=>({witdh:"100%",height:"calc(100vh - 150px)"});function Fn(t,i){if(t&1){let e=v();r(0,"div",6)(1,"a",7),m(2,"Cancel"),a(),r(3,"p-button",8),y("onClick",function(){h(e);let o=s(2);return S(o.updateWriteOffConfiguration())}),a()()}}function Tn(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),I("(",e.code,")"),p(2),g(e.name)}}function wn(t,i){if(t&1&&(r(0,"div",6)(1,"span",16),m(2),a(),r(3,"span",16),m(4),a()()),t&2){let e=i.$implicit;p(2),I("(",e.code,")"),p(2),g(e.name)}}function Mn(t,i){if(t&1){let e=v();r(0,"div",12)(1,"div",13)(2,"label",14),m(3),a(),r(4,"p-select",15),y("ngModelChange",function(o){let l=h(e).$index,d=s(3);return S(d.updateAccountById(o,l))}),f(5,Tn,5,2,"ng-template",null,2,u)(7,wn,5,2,"ng-template",null,3,u),a()()()}if(t&2){let e=i.$implicit,n=s(3);p(3),g(e.name),p(),c("ngModel",e.accountID)("options",n.writeOffForm().options.account)("virtualScroll",!0)("virtualScrollItemSize",50)}}function Dn(t,i){if(t&1&&(r(0,"p-card")(1,"p-scroll-panel")(2,"div",9)(3,"div",10)(4,"div",11),b(5,Mn,9,5,"div",12,P),a()()()()()),t&2){let e=s(2);p(),X(H(2,In)),p(4),O(e.writeOffForm().form)}}function An(t,i){if(t&1&&(r(0,"app-main-panel",5),f(1,Fn,4,0,"ng-template",null,0,u)(3,Dn,7,3,"ng-template",null,1,u),a()),t&2){let e=s();c("pageTitle","Write Off Form "+e.writeOffForm().info.name)("hasMainWrapperPadding",!0)}}var _t=(()=>{class t{constructor(){this.POSSetupService=C(R),this.route=C(re),this.writeOffForm=E(null)}ngOnInit(){this.route.paramMap.pipe(ee(e=>e.get("id")),z(e=>this.POSSetupService.fetchPOSWriteOffFormConfiguration({ID:e})),F(e=>this.writeOffForm.set(e))).subscribe()}updateAccountById(e,n){let o=this.writeOffForm().form,l=x(_({},this.writeOffForm()),{form:o.map((d,L)=>L===n?x(_({},d),{accountID:e}):d)});this.writeOffForm.set(l)}updateWriteOffConfiguration(){let e={form:this.writeOffForm().form};this.POSSetupService.updatePOSWriteOffConfiguration(e).pipe().subscribe()}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-writeoff-form"]],decls:1,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],[3,"pageTitle","hasMainWrapperPadding",4,"ngIf"],[3,"pageTitle","hasMainWrapperPadding"],[1,"d-flex","gap-2"],["routerLink","/pages/pos-setup/writeoff",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit",3,"onClick"],[1,"row"],[1,"col"],[1,"row","row-gap-3"],[1,"col-3"],[1,"d-flex","flex-column"],["for","",1,"d-inline-block","text-truncate",2,"max-width","300px"],["filter","","filterBy","name,code","optionLabel","name","filter","","filterBy","name,code","optionValue","id","placeholder","Select an account",3,"ngModelChange","ngModel","options","virtualScroll","virtualScrollItemSize"],[1,""]],template:function(n,o){n&1&&f(0,An,5,2,"app-main-panel",4),n&2&&c("ngIf",o.writeOffForm())},dependencies:[M,w,V,q,Re,me,le,U,j,J,$,oe,A,D,G,N],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var Le=(()=>{class t{constructor(){this.httpService=C(ye)}getExpenseOptions(){return this.httpService.get(void 0,"/api/SetupExpenseOption/GetExpenseOptions")}getExpenseOptionsLoader(){return this.httpService.get(void 0,"/api/SetupExpenseOptionLoader/GetExpenseOptions")}updatePOSExpenseOptionConfiguration(e){return this.httpService.put(void 0,"/api/SetupExpenseOption/UpdateExpenseAccount",e)}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275prov=Se({token:t,factory:t.\u0275fac,providedIn:"root"})}}return t})();var Rn={data:{expenseOptions:[],options:{chartOfAccountOptions:[]}}},Be=Te(Ae(Rn),Je("POSExpenseOptionStore"),we(t=>({hasCheckedRows:ne(()=>t.data().expenseOptions.some(i=>i.checked)),checkedInvoice:ne(()=>t.data().expenseOptions.filter(i=>i.checked).map(i=>i.id))})),De(t=>{let i=C(Le);return{onRowSelect(n){Z(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?x(_({},d),{checked:!0}):d);return x(_({},o),{data:x(_({},o.data),{expenseOptions:l})})})},onRowUnselect(n){Z(t,o=>{let l=o.data.expenseOptions.map(d=>d.id===n.id?x(_({},d),{checked:!1}):d);return x(_({},o),{data:x(_({},o.data),{expenseOptions:l})})})},onHeaderCheckboxToggle(n){Z(t,o=>{let l=o.data.expenseOptions.map(d=>x(_({},d),{checked:n}));return x(_({},o),{data:x(_({},o.data),{expenseOptions:l})})})},getExpenseOptions:fe(_e(z(()=>i.getExpenseOptions().pipe(ge({next:n=>{Z(t,o=>x(_({},o),{data:x(_({},o.data),{expenseOptions:n.expenseOptions.map(l=>x(_({},l),{checked:!1}))})}))},error:n=>{console.error("Error fetching expense options:",n)}}))))),getExpenseOptionsLoader:fe(_e(z(()=>i.getExpenseOptionsLoader().pipe(ge({next:n=>{Z(t,o=>x(_({},o),{data:x(_({},o.data),{options:{chartOfAccountOptions:n.options.chartOfAccountOptions}})}))},error:n=>{console.error("Error fetching expense options:",n)}})))))}}),Me({onInit:t=>{t.getExpenseOptions(),t.getExpenseOptionsLoader()}}));function kn(t,i){if(t&1){let e=v();r(0,"p-button",8),y("onClick",function(){h(e);let o=s(2);return S(o.updatePOSExpenseOptionConfiguration())}),a()}}function Ln(t,i){if(t&1&&(r(0,"div",5)(1,"a",6),m(2,"Cancel"),a(),f(3,kn,1,0,"p-button",7),a()),t&2){let e=s();p(3),B(e.roleService.permissions().posSetup.edit?3:-1)}}function Nn(t,i){if(t&1&&(r(0,"div",5)(1,"div",15)(2,"span",15),m(3),a()()()),t&2){let e=i.$implicit;p(3),g(e.value)}}function Gn(t,i){if(t&1&&(r(0,"div",5)(1,"div",16)(2,"span",15),m(3),a()()()),t&2){let e=i.$implicit;p(3),g(e.value)}}function Bn(t,i){if(t&1){let e=v();r(0,"div",11)(1,"div",12)(2,"label",13),m(3),a(),r(4,"p-select",14),y("ngModelChange",function(o){let l=h(e).$index,d=s(3);return S(d.updateData(o,l))}),f(5,Nn,4,1,"ng-template",null,2,u)(7,Gn,4,1,"ng-template",null,3,u),a()()()}if(t&2){let e,n=i.$implicit,o=i.$index,l=s(3);p(3),g(n.name),p(),c("ngModel",((e=l.expenseOptForm().ListData[o])==null?null:e.AccountID)||"")("options",l.store.data().options.chartOfAccountOptions)}}function Vn(t,i){if(t&1&&b(0,Bn,9,3,"div",11,P),t&2){let e=s(2);O(e.store.data().expenseOptions)}}function $n(t,i){t&1&&(r(0,"div",10)(1,"p"),m(2,"No expense options available."),a()())}function Wn(t,i){if(t&1&&(r(0,"p-panel")(1,"div",9)(2,"div",10)(3,"div",9),f(4,Vn,2,0)(5,$n,3,0,"div",10),a()()()()),t&2){let e=s();p(4),B(e.store.data().expenseOptions&&e.store.data().expenseOptions.length?4:5)}}var ft=(()=>{class t{constructor(){this.store=C(Be),this.roleService=C(Y),this.expenseOptForm=E({ListData:[]}),this.expenseOptService=C(Le),this.originalData=E([]),je(()=>{let e=this.store.data().expenseOptions;if(e&&e.length>0){let n=e.map(o=>({ID:o.id,AccountID:o.accountID||""}));this.expenseOptForm.set({ListData:n}),this.originalData.set([...n])}})}onRowSelect(e){this.store.onRowSelect(e.data)}onRowUnselect(e){Array.isArray(e.data)?e.data.forEach(n=>{this.store.onRowUnselect(n)}):this.store.onRowUnselect(e.data)}onHeaderCheckboxToggle(e){this.store.onHeaderCheckboxToggle(e.checked)}updatePOSExpenseOptionConfiguration(){let e=this.expenseOptForm().ListData,n=this.originalData(),o=e.filter((d,L)=>{let de=n[L];return de&&d.AccountID!==de.AccountID});if(o.length===0)return;let l={ListData:o};this.expenseOptService.updatePOSExpenseOptionConfiguration(l).pipe(F(d=>{console.log("Update response:",d),this.originalData.set([...e])})).subscribe()}updateData(e,n){let l=[...this.expenseOptForm().ListData];l[n]&&(l[n]=x(_({},l[n]),{AccountID:e}),this.expenseOptForm.set({ListData:l}))}static{this.\u0275fac=function(n){return new(n||t)}}static{this.\u0275cmp=T({type:t,selectors:[["app-pos-expense-option"]],features:[ve([Be])],decls:5,vars:1,consts:[["actionButton",""],["content",""],["selectedItem",""],["item",""],["pageTitle","Expense Option",3,"scrollable"],[1,"d-flex","gap-2"],["routerLink","..",1,"p-button","p-button-secondary","p-button-outlined"],["label","Submit"],["label","Submit",3,"onClick"],[1,"row"],[1,"col-12"],[1,"col-4"],[1,"d-flex","flex-column","card","rounded-3","p-3","border"],["for",""],["filter","","filterBy","key,value","optionLabel","value","optionValue","key","placeholder","Select COA",3,"ngModelChange","ngModel","options"],[1,""],[1,"d-inline-block","text-truncate",2,"max-width","250px"]],template:function(n,o){n&1&&(r(0,"app-main-panel",4),f(1,Ln,4,1,"ng-template",null,0,u)(3,Wn,6,1,"ng-template",null,1,u),a()),n&2&&c("scrollable",!0)},dependencies:[M,ie,W,K,G,N,w,D,U,j,pe,$,J,oe],styles:["[_nghost-%COMP%]{display:block}"],changeDetection:0})}}return t})();var nr=[{path:"",redirectTo:"global",pathMatch:"full"},{path:"",children:[{path:"global",component:rt},{path:"outlets",component:mt},{path:"outlets/:id",component:st},{path:"payments",component:lt},{path:"payments/:id",component:ct},{path:"taxs",component:ut},{path:"writeoff",component:dt},{path:"writeoff/:id",component:_t},{path:"expense-option",component:ft}]}];export{nr as POS_SETUP_ROUTES};
@@ -1 +1 @@
1
- import{a as i}from"./chunk-2JFOEOZ2.js";import{a}from"./chunk-TOR7QRRB.js";import{ca as o,ia as n}from"./chunk-6QJHEOXN.js";var h=(()=>{class e{constructor(){this.#t=n(a),this.authService=n(i)}#t;getJournalEntryLoader(){return this.#t.get("","api/JournalLoader/JournalEntry")}getJournalReceiveMoney(){return this.#t.get("","api/JournalLoader/ReceiveJournal")}getJournalRecordExpenseLoader(){return this.#t.get("","api/JournalLoader/RecordExpense")}getJournalEntryData(t,r={}){return this.#t.post("","api/Journal/JournalEntry",t,r)}getJournalEntryInfo(t){let r={ID:t};return this.#t.get("","/api/Journal/Info",{params:r})}getJournalEntryForm(t){return this.#t.get("",`api/journalloader/form/${t}`).pipe()}getJournalEntryCount(t){return this.#t.post("","api/Journal/JournalEntryCount",t)}getJournalEntryCustomerSuggestions(t){let r={Prefix:t,Count:100};return this.#t.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:r})}getJournalEntrySupplierSuggestions(t){let r={Prefix:t,Count:100};return this.#t.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:r})}submitJournalEntry(t){return this.#t.post(void 0,"api/journal/submit",t,{observe:"response"})}deleteJournalEntry(t){let r={params:{ID:t.join(",")}};return this.#t.delete(void 0,"/api/Journal/delete",r)}fetchCategoryOptions(){return this.#t.get("","api/ChartOfAccount/CategoryOptions")}submitChartAccount(t,r={}){return this.#t.post("","api/ChartOfAccount/Submit",t,r)}getImageFileName(t){return new URL(t).pathname.split("/").pop()||""}importPreviewJournal(t){return this.#t.post(void 0,"api/Journal/ImportPreview",t)}importConfirmJournal(t){return this.#t.post(void 0,"api/Journal/ImportConfirm",t)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{h as a};
1
+ import{a as i}from"./chunk-QSZKELXB.js";import{a}from"./chunk-G3BJCT7T.js";import{ca as o,ia as n}from"./chunk-6QJHEOXN.js";var h=(()=>{class e{constructor(){this.#t=n(a),this.authService=n(i)}#t;getJournalEntryLoader(){return this.#t.get("","api/JournalLoader/JournalEntry")}getJournalReceiveMoney(){return this.#t.get("","api/JournalLoader/ReceiveJournal")}getJournalRecordExpenseLoader(){return this.#t.get("","api/JournalLoader/RecordExpense")}getJournalEntryData(t,r={}){return this.#t.post("","api/Journal/JournalEntry",t,r)}getJournalEntryInfo(t){let r={ID:t};return this.#t.get("","/api/Journal/Info",{params:r})}getJournalEntryForm(t){return this.#t.get("",`api/journalloader/form/${t}`).pipe()}getJournalEntryCount(t){return this.#t.post("","api/Journal/JournalEntryCount",t)}getJournalEntryCustomerSuggestions(t){let r={Prefix:t,Count:100};return this.#t.get(this.authService.getTenantExternalURL(),"/API/AC/GetCustomerSuggestion",{params:r})}getJournalEntrySupplierSuggestions(t){let r={Prefix:t,Count:100};return this.#t.get(this.authService.getTenantExternalURL(),"/API/AC/GetSupplierSuggestion",{params:r})}submitJournalEntry(t){return this.#t.post(void 0,"api/journal/submit",t,{observe:"response"})}deleteJournalEntry(t){let r={params:{ID:t.join(",")}};return this.#t.delete(void 0,"/api/Journal/delete",r)}fetchCategoryOptions(){return this.#t.get("","api/ChartOfAccount/CategoryOptions")}submitChartAccount(t,r={}){return this.#t.post("","api/ChartOfAccount/Submit",t,r)}getImageFileName(t){return new URL(t).pathname.split("/").pop()||""}importPreviewJournal(t){return this.#t.post(void 0,"api/Journal/ImportPreview",t)}importConfirmJournal(t){return this.#t.post(void 0,"api/Journal/ImportConfirm",t)}static{this.\u0275fac=function(r){return new(r||e)}}static{this.\u0275prov=o({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();export{h as a};