import{a as n}from"./formatters-jmx2pV9o.js";const C={cash:{singular:"caisse",plural:"caisses",title:"Import Caisses",routeBase:"/treasury/cash",importRoute:"/treasury/cash/import",apiBase:"/cash-registers",templateApi:"/cash-registers/template"},bank:{singular:"compte bancaire",plural:"comptes bancaires",title:"Import Banques",routeBase:"/treasury/bank",importRoute:"/treasury/bank/import",apiBase:"/bank-accounts",templateApi:"/bank-accounts/template"}},I=[{value:"credit",label:"Encaissement"},{value:"debit",label:"Décaissement"}],R=[{value:"credit",label:"Crédit"},{value:"debit",label:"Débit"}],A=[{value:"",label:"Tous les sens"},{value:"credit",label:"Entrées / Crédits"},{value:"debit",label:"Sorties / Débits"}],B=["DZD","EUR","USD"],O={open:"border-gold/30 bg-gold/10 text-gold",closed:"border-accent2/30 bg-accent2/10 text-accent2"},g=e=>Number(e||0)>0?"text-accent":Number(e||0)<0?"text-danger":"text-textMuted",E=(e,f,h)=>{var d,k,p;const b=(e==null?void 0:e.bank_movements)||[],m=(e==null?void 0:e.ledger_lines)||[],u=new Set(f.map(Number)),_=new Set(h.map(Number)),l=b.reduce((a,t)=>u.has(Number(t.id))?a+Number(t.balance_effect||0):a,0),N=m.reduce((a,t)=>_.has(Number(t.id))?a+Number(t.balance_effect||0):a,0),o=b.reduce((a,t)=>u.has(Number(t.id))?a:a+Number(t.balance_effect||0),0),c=m.reduce((a,t)=>_.has(Number(t.id))?a:a+Number(t.balance_effect||0),0),r=Number(((d=e==null?void 0:e.reconciliation)==null?void 0:d.bank_balance)||0),s=Number(((k=e==null?void 0:e.summary)==null?void 0:k.book_balance)||((p=e==null?void 0:e.reconciliation)==null?void 0:p.book_balance)||0),i=Number((r-s-o+c).toFixed(2));return{bank_balance:r,book_balance:s,matched_bank_amount:Number(l.toFixed(2)),matched_book_amount:Number(N.toFixed(2)),unmatched_bank_amount:Number(o.toFixed(2)),unmatched_book_amount:Number(c.toFixed(2)),difference:i,formatted_bank_balance:n(r),formatted_book_balance:n(s),formatted_matched_bank_amount:n(l),formatted_matched_book_amount:n(N),formatted_unmatched_bank_amount:n(o),formatted_unmatched_book_amount:n(c),formatted_difference:n(i)}};export{R as B,B as C,O as R,A as S,C as T,I as a,E as c,g};
