Treasury & Bank Transfer Management System — سامانه مدیریت خزانهداری و حوالههای بانکی
phase-7-production-infrastructure-bank-golive
ci/public-windows-bridge-probe-20261017
ci/windows-dispatch-bootstrap-20261016
ci/windows-dual-app-lab-20261016
dev/v7-production-failclosed-20261021
feature/reconciliation-guard-20261013
main
phase-1-foundation
phase-1-implementation
phase-2-treasury-core
phase-3-banking-reconciliation
phase-4-operations-enterprise-ux
phase-5-hardening-release
phase-6-production-platform
phase-7-production-infrastructure-bank-golive
phase-7-sql-readonly-ux-20261015
transfer-exe-to-drive-20261006
| 1 | import {getDesktopTreasuryService} from '../../platform/application/server-service'; |
| 2 | import {runReconciliationAction} from './actions'; |
| 3 | import {ReconciliationResultPanel} from './components'; |
| 4 | import type {Reconciliation} from '../../domain/reconciliation'; |
| 5 | |
| 6 | export const dynamic='force-dynamic'; |
| 7 | |
| 8 | export default async function ReconciliationPage({searchParams}:{searchParams:Promise<{status?:string;paymentId?:string;candidateIds?:string;error?:string}>}){ |
| 9 | const params=await searchParams; |
| 10 | const service=getDesktopTreasuryService(); |
| 11 | const accounts=service.listAccounts(); |
| 12 | let result:Reconciliation|undefined; |
| 13 | if(params.status==='MATCHED'&¶ms.paymentId) result={status:'MATCHED',paymentId:params.paymentId}; |
| 14 | else if(params.status==='AMBIGUOUS') result={status:'AMBIGUOUS',candidateIds:(params.candidateIds??'').split(',').filter(Boolean)}; |
| 15 | else if(params.status==='UNMATCHED') result={status:'UNMATCHED'}; |
| 16 | return <div className="page-stack"> |
| 17 | <section className="page-head"><div><p className="eyebrow">RECONCILIATION</p><h2>مغایرتگیری</h2><p>تطبیق تراکنش بانکی با حوالههای ثبتشده بر اساس حساب، مرجع و مبلغ.</p></div></section> |
| 18 | <section className="recon-layout"> |
| 19 | <article className="panel"> |
| 20 | <div className="section-title"><div><h3>بررسی تراکنش</h3><p>اطلاعات ردیف صورتحساب را وارد کنید.</p></div></div> |
| 21 | {params.error&&<div className="alert-banner danger"><strong>ورودی نامعتبر است.</strong><span>همه فیلدهای الزامی را کنترل کنید.</span></div>} |
| 22 | <form action={runReconciliationAction} className="recon-form"> |
| 23 | <label><span>حساب بانکی</span><select name="accountId" required><option value="">انتخاب حساب</option>{accounts.map(a=><option key={a.id} value={a.id}>{a.name}</option>)}</select></label> |
| 24 | <label><span>مرجع بانکی / داخلی</span><input name="reference" required placeholder="REF-..."/></label> |
| 25 | <label><span>مبلغ تراکنش (ریال)</span><input name="amountIrr" type="number" step="1" required/></label> |
| 26 | <label><span>تاریخ</span><input name="date" type="date" required/></label> |
| 27 | <label><span>شناسه ردیف بانک</span><input name="sourceId" placeholder="اختیاری"/></label> |
| 28 | <button className="btn btn-primary" type="submit" disabled={!accounts.length}>اجرای تطبیق</button> |
| 29 | </form> |
| 30 | </article> |
| 31 | <article className="panel"> |
| 32 | <div className="section-title"><div><h3>نتیجه تطبیق</h3><p>هیچ تطبیق مبهمی بهصورت خودکار نهایی نمیشود.</p></div></div> |
| 33 | {result?<ReconciliationResultPanel result={result}/>:<div className="empty-state"><strong>هنوز تطبیقی اجرا نشده است</strong><span>اطلاعات تراکنش بانکی را وارد کنید تا نتیجه اینجا نمایش داده شود.</span></div>} |
| 34 | </article> |
| 35 | </section> |
| 36 | </div> |
| 37 | } |