diff --git a/src/app/cashier/transaction-entry/transaction-entry.component.html b/src/app/cashier/transaction-entry/transaction-entry.component.html index 0f00f9fd3..2ed9f8abc 100644 --- a/src/app/cashier/transaction-entry/transaction-entry.component.html +++ b/src/app/cashier/transaction-entry/transaction-entry.component.html @@ -330,7 +330,7 @@ Approved by: {{ activeWithdrawalRequest.manager_name || '—' }}
- After transaction succeeds, this request will be automatically marked DISBURSED. + After transaction succeeds, this request will be automatically marked WITHDRAWN.
← Back to Inbox @@ -63,11 +63,11 @@ - +
account_balance - GL Debit (Source) + {{ isCollectionMode ? 'GL Credit (Target)' : 'GL Debit (Source)' }}
@@ -79,7 +79,7 @@ {{ request.gl_account_name }}
- DR Amount + {{ isCollectionMode ? 'CR Amount' : 'DR Amount' }} ₹{{ request.dr_amount | number: '1.2-2' }}
@@ -95,11 +95,15 @@
- +
account_balance_wallet - Credit Entries ({{ creditEntries.length }} account{{ creditEntries.length !== 1 ? 's' : '' }}) + @if (isCollectionMode) { + Debit Entries ({{ drEntries.length }} account{{ drEntries.length !== 1 ? 's' : '' }} — collect from) + } @else { + Credit Entries ({{ crEntries.length }} account{{ crEntries.length !== 1 ? 's' : '' }}) + }
@@ -108,11 +112,11 @@ - + - @for (entry of creditEntries; track entry.accountId; let i = $index) { + @for (entry of isCollectionMode ? drEntries : crEntries; track entry.accountNo; let i = $index) { @@ -124,7 +128,7 @@ } - + @@ -167,7 +171,7 @@ @if (!showRejectForm) { @@ -136,6 +141,46 @@ {{ statusLabel(r.status) }} + @if (expandedIds.has(r.id)) { + + + + } @if (r.status === 'REJECTED' && r.rejection_reason) { @@ -140,7 +140,7 @@ {{ r.rejection_reason | slice: 0 : 60 }}{{ r.rejection_reason?.length > 60 ? '…' : '' }} - } @else if (r.status === 'DISBURSED') { + } @else if (r.status === 'WITHDRAWN') {
{{ r.disbursed_by || '—' }} {{ formatDateTime(r.disbursed_at) }} diff --git a/src/app/clerk/my-requests/my-requests.component.ts b/src/app/clerk/my-requests/my-requests.component.ts index abdd5b805..b6f63be83 100644 --- a/src/app/clerk/my-requests/my-requests.component.ts +++ b/src/app/clerk/my-requests/my-requests.component.ts @@ -81,7 +81,7 @@ export class MyRequestsComponent implements OnInit { { value: 'PENDING', label: 'Pending' }, { value: 'APPROVED', label: 'Approved' }, { value: 'REJECTED', label: 'Rejected' }, - { value: 'DISBURSED', label: 'Disbursed' } + { value: 'WITHDRAWN', label: 'Disbursed' } ]; } @@ -191,7 +191,7 @@ export class MyRequestsComponent implements OnInit { PENDING: 'myr-status--pending', APPROVED: 'myr-status--approved', REJECTED: 'myr-status--rejected', - DISBURSED: 'myr-status--disbursed' + WITHDRAWN: 'myr-status--disbursed' }; return map[status] ?? ''; } @@ -201,7 +201,7 @@ export class MyRequestsComponent implements OnInit { PENDING: 'Pending Approval', APPROVED: 'Approved', REJECTED: 'Rejected', - DISBURSED: 'Disbursed' + WITHDRAWN: 'Withdrawn' }; return map[status] ?? status; } diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/withdrawal-requests/withdrawal-requests.component.html b/src/app/tasks/checker-inbox-and-tasks-tabs/withdrawal-requests/withdrawal-requests.component.html index 3f0a25aae..a74ed81e5 100644 --- a/src/app/tasks/checker-inbox-and-tasks-tabs/withdrawal-requests/withdrawal-requests.component.html +++ b/src/app/tasks/checker-inbox-and-tasks-tabs/withdrawal-requests/withdrawal-requests.component.html @@ -121,7 +121,7 @@
@for (r of requests; track r.id) { - + @@ -131,7 +131,7 @@
Account No Account Name TypeAmount (CR){{ isCollectionMode ? 'Amount (DR)' : 'Amount (CR)' }}
{{ i + 1 }} {{ entry.accountNo }}
Total Credit{{ isCollectionMode ? 'Total Debit' : 'Total Credit' }} ₹{{ totalCreditAmount() | number: '1.2-2' }}
₹{{ r.dr_amount | number: '1.2-2' }} - {{ creditCount(r) }} account{{ creditCount(r) !== 1 ? 's' : '' }} + {{ r.payment_type_name || 'Transfer' }} {{ r.manager_name || r.manager_username || '—' }}
+
+ + + + + + + + + + + + @for (ce of getCreditEntries(r); track ce.accountNo) { + + + + + + + + } + +
DR/CRAccount NoAccount NameTypeAmount (₹)
+ + {{ ce.dbCr || 'CR' }} + + {{ ce.accountNo || '—' }}{{ ce.accountName || '—' }} + {{ ce.accountType || '—' }} + {{ ce.amount | number: '1.2-2' }}
+
+
diff --git a/src/app/clerk/my-disbursement-requests/my-disbursement-requests.component.scss b/src/app/clerk/my-disbursement-requests/my-disbursement-requests.component.scss index 20984fe7d..3593f134a 100644 --- a/src/app/clerk/my-disbursement-requests/my-disbursement-requests.component.scss +++ b/src/app/clerk/my-disbursement-requests/my-disbursement-requests.component.scss @@ -341,6 +341,91 @@ color: #0369a1; font-size: 11px; font-weight: 600; + + &--btn { + border: none; + cursor: pointer; + gap: 2px; + font-family: inherit; + transition: background 0.15s; + + &:hover { + background: #bae6fd; + } + } +} + +.mdr-credit-chevron { + font-size: 14px; + width: 14px; + height: 14px; + transition: transform 0.2s; + + &--open { + transform: rotate(180deg); + } +} + +.mdr-expand-row td { + padding: 0; + background: #f0f9ff; + border-bottom: 2px solid #bae6fd; +} + +.mdr-expand-cell { + padding: 0 !important; +} + +.mdr-credit-preview { + padding: 10px 24px 12px 40px; +} + +.mdr-credit-table { + width: 100%; + border-collapse: collapse; + font-size: 12px; + + th, + td { + padding: 6px 10px; + text-align: left; + border-bottom: 1px solid #e0f2fe; + } + + th { + font-size: 10px; + font-weight: 700; + color: #0369a1; + text-transform: uppercase; + letter-spacing: 0.06em; + background: #e0f2fe; + white-space: nowrap; + } + + .num { + text-align: right; + } + + tr:last-child td { + border-bottom: none; + } +} + +.mdr-ce-amount { + font-weight: 700; + color: #0f4f3c; +} + +.mdr-actype { + display: inline-block; + padding: 1px 7px; + border-radius: 10px; + background: #f1f5f9; + color: #475569; + font-size: 10px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.04em; } .mdr-reason-row td { diff --git a/src/app/clerk/my-disbursement-requests/my-disbursement-requests.component.ts b/src/app/clerk/my-disbursement-requests/my-disbursement-requests.component.ts index 1e4059b8f..207f96317 100644 --- a/src/app/clerk/my-disbursement-requests/my-disbursement-requests.component.ts +++ b/src/app/clerk/my-disbursement-requests/my-disbursement-requests.component.ts @@ -45,6 +45,7 @@ export class MyDisbursementRequestsComponent implements OnInit { requests: any[] = []; totalRecords = 0; + expandedIds = new Set(); pageSize = 20; pageIndex = 0; pageSizeOptions = [ @@ -164,15 +165,27 @@ export class MyDisbursementRequestsComponent implements OnInit { this.router.navigate(['/clerk/dashboard']); } - creditCount(req: any): number { + toggleExpand(id: number): void { + if (this.expandedIds.has(id)) { + this.expandedIds.delete(id); + } else { + this.expandedIds.add(id); + } + } + + getCreditEntries(req: any): any[] { try { const arr = typeof req.credit_entries === 'string' ? JSON.parse(req.credit_entries) : req.credit_entries; - return Array.isArray(arr) ? arr.length : 0; + return Array.isArray(arr) ? arr.map((e: any) => ({ ...e, amount: parseFloat(e.amount) || 0 })) : []; } catch { - return 0; + return []; } } + creditCount(req: any): number { + return this.getCreditEntries(req).length; + } + statusClass(status: string): string { const map: Record = { PENDING: 'mdr-status--pending', diff --git a/src/app/clerk/my-requests/my-requests.component.html b/src/app/clerk/my-requests/my-requests.component.html index d4f59c8c1..14ec9ccc7 100644 --- a/src/app/clerk/my-requests/my-requests.component.html +++ b/src/app/clerk/my-requests/my-requests.component.html @@ -120,7 +120,7 @@ [class.myr-row--pending]="r.status === 'PENDING'" [class.myr-row--approved]="r.status === 'APPROVED'" [class.myr-row--rejected]="r.status === 'REJECTED'" - [class.myr-row--disbursed]="r.status === 'DISBURSED'" + [class.myr-row--disbursed]="r.status === 'WITHDRAWN'" > {{ r.voucher_no || '—' }} {{ r.tok_no || '—' }}
{{ r.voucher_no || '—' }} {{ r.tok_no || '—' }} {{ r.account_no }}{{ r.clerk_name }} {{ r.manager_name || r.manager_username || '—' }} - @if (r.status === 'DISBURSED') { + @if (r.status === 'WITHDRAWN') {
{{ r.disbursed_by }} {{ formatDateTime(r.disbursed_at) }} diff --git a/src/app/tasks/checker-inbox-and-tasks-tabs/withdrawal-requests/withdrawal-requests.component.ts b/src/app/tasks/checker-inbox-and-tasks-tabs/withdrawal-requests/withdrawal-requests.component.ts index cc560172d..cfc996a34 100644 --- a/src/app/tasks/checker-inbox-and-tasks-tabs/withdrawal-requests/withdrawal-requests.component.ts +++ b/src/app/tasks/checker-inbox-and-tasks-tabs/withdrawal-requests/withdrawal-requests.component.ts @@ -77,7 +77,7 @@ export class WithdrawalRequestsComponent implements OnInit { { value: 'PENDING', label: 'Pending' }, { value: 'APPROVED', label: 'Approved' }, { value: 'REJECTED', label: 'Rejected' }, - { value: 'DISBURSED', label: 'Disbursed' } + { value: 'WITHDRAWN', label: 'Withdrawn' } ]; } @@ -177,7 +177,7 @@ export class WithdrawalRequestsComponent implements OnInit { PENDING: 'wri-status--pending', APPROVED: 'wri-status--approved', REJECTED: 'wri-status--rejected', - DISBURSED: 'wri-status--disbursed' + WITHDRAWN: 'wri-status--disbursed' }; return map[status] ?? ''; } @@ -187,7 +187,7 @@ export class WithdrawalRequestsComponent implements OnInit { PENDING: 'Pending', APPROVED: 'Approved', REJECTED: 'Rejected', - DISBURSED: 'Disbursed' + WITHDRAWN: 'Withdrawn' }; return map[status] ?? status; }