Treasury & Bank Transfer Management System — سامانه مدیریت خزانه‌داری و حواله‌های بانکی

1 export type ReportRow={tenantId:string;reference:string;state:string;amountIrr:number}; export function report(t:string,rows:ReportRow[]){const r=rows.filter(x=>x.tenantId===t);return{count:r.length,totalIrr:r.reduce((s,x)=>s+x.amountIrr,0),settledIrr:r.filter(x=>x.state==='SETTLED').reduce((s,x)=>s+x.amountIrr,0)}} export function toCsv(t:string,rows:ReportRow[]){const own=rows.filter(x=>x.tenantId===t);return ['reference,state,amountIrr',...own.map(x=>`${x.reference},${x.state},${x.amountIrr}`)].join('\n')}