diff --git a/src/app/cashier/cash-settlement/cash-settlement.component.html b/src/app/cashier/cash-settlement/cash-settlement.component.html index 7364fc900..cf3a97330 100644 --- a/src/app/cashier/cash-settlement/cash-settlement.component.html +++ b/src/app/cashier/cash-settlement/cash-settlement.component.html @@ -45,14 +45,21 @@ - - Teller - - @for (t of tellers; track t.id) { - {{ t.name }} - } - - + @if (tellers.length === 1) { + + Teller + + + } @else { + + Teller + + @for (t of tellers; track t.id) { + {{ t.name }} + } + + + } Cashier @@ -140,17 +147,24 @@ } - - Teller / Vault (To) * - - @for (t of tellers; track t.id) { - {{ t.name }} - } - @if (tellers.length === 0) { - No tellers configured - } - - + @if (tellers.length === 1) { + + Teller / Vault (To) * + + + } @else { + + Teller / Vault (To) * + + @for (t of tellers; track t.id) { + {{ t.name }} + } + @if (tellers.length === 0) { + No tellers configured + } + + + } Settlement Date diff --git a/src/app/cashier/cash-settlement/cash-settlement.component.ts b/src/app/cashier/cash-settlement/cash-settlement.component.ts index c93a31c64..45d5c0f93 100644 --- a/src/app/cashier/cash-settlement/cash-settlement.component.ts +++ b/src/app/cashier/cash-settlement/cash-settlement.component.ts @@ -97,6 +97,10 @@ export class CashSettlementComponent implements OnInit { .pipe(catchError(() => of([] as any[]))) .subscribe((list: any[]) => { this.tellers = (list || []).map((t: any) => ({ id: t.id, name: t.name })); + if (this.tellers.length === 1) { + this.onTellerSelect(this.tellers[0].id); + this.onSupervisorTellerSelect(this.tellers[0].id); + } }); this.loadData(); } diff --git a/src/app/cashier/cash-transfer/cash-transfer.component.html b/src/app/cashier/cash-transfer/cash-transfer.component.html index d7dcbb54b..82cb5f963 100644 --- a/src/app/cashier/cash-transfer/cash-transfer.component.html +++ b/src/app/cashier/cash-transfer/cash-transfer.component.html @@ -17,17 +17,24 @@
- - From (Teller / Head) - - @for (t of tellers; track t.id) { - {{ t.name }} - } - @if (tellers.length === 0) { - No tellers configured - } - - + @if (tellers.length === 1) { + + From (Teller / Head) + + + } @else { + + From (Teller / Head) + + @for (t of tellers; track t.id) { + {{ t.name }} + } + @if (tellers.length === 0) { + No tellers configured + } + + + } To (Cashier) diff --git a/src/app/cashier/cash-transfer/cash-transfer.component.ts b/src/app/cashier/cash-transfer/cash-transfer.component.ts index ee3aa8a22..84f6ad450 100644 --- a/src/app/cashier/cash-transfer/cash-transfer.component.ts +++ b/src/app/cashier/cash-transfer/cash-transfer.component.ts @@ -95,6 +95,9 @@ export class CashTransferComponent implements OnInit { .pipe(catchError(() => of([] as any[]))) .subscribe((list) => { this.tellers = (list || []).map((t: any) => ({ id: t.id, name: t.name })); + if (this.tellers.length === 1) { + this.onTellerSelect(this.tellers[0].id); + } }); } @@ -116,6 +119,9 @@ export class CashTransferComponent implements OnInit { .subscribe((r: any) => { this.cashiers = (r?.cashiers || []).map((c: any) => ({ id: c.id, label: c.staffName })); this.loadingCashiers = false; + if (this.cashiers.length === 1) { + this.onCashierSelect(this.cashiers[0].id); + } }); } diff --git a/src/app/cashier/cashier-position/cashier-position.component.html b/src/app/cashier/cashier-position/cashier-position.component.html index a7572fbf1..bc931fd1a 100644 --- a/src/app/cashier/cashier-position/cashier-position.component.html +++ b/src/app/cashier/cashier-position/cashier-position.component.html @@ -20,15 +20,22 @@
@if (!isCashierMode) { - - Teller (optional) - - All Tellers - @for (t of tellers; track t.id) { - {{ t.name }} - } - - + @if (tellers.length === 1) { + + Teller + + + } @else { + + Teller (optional) + + All Tellers + @for (t of tellers; track t.id) { + {{ t.name }} + } + + + } Cashier (optional) diff --git a/src/app/cashier/cashier-position/cashier-position.component.ts b/src/app/cashier/cashier-position/cashier-position.component.ts index 04f74efea..1ffa957b1 100644 --- a/src/app/cashier/cashier-position/cashier-position.component.ts +++ b/src/app/cashier/cashier-position/cashier-position.component.ts @@ -85,6 +85,9 @@ export class CashierPositionComponent implements OnInit { .pipe(catchError(() => of([] as any[]))) .subscribe((list) => { this.tellers = (list || []).map((t: any) => ({ id: t.id, name: t.name })); + if (this.tellers.length === 1) { + this.onTellerSelect(this.tellers[0].id); + } }); } } @@ -137,6 +140,9 @@ export class CashierPositionComponent implements OnInit { .pipe(catchError(() => of({ cashiers: [] }))) .subscribe((r: any) => { this.cashiers = (r?.cashiers || []).map((c: any) => ({ id: c.id, label: c.staffName })); + if (this.cashiers.length === 1) { + this.selectedCashierId = this.cashiers[0].id; + } }); } diff --git a/src/app/cashier/inter-cashier-transfer/inter-cashier-transfer.component.html b/src/app/cashier/inter-cashier-transfer/inter-cashier-transfer.component.html index 742ad1269..b87a43472 100644 --- a/src/app/cashier/inter-cashier-transfer/inter-cashier-transfer.component.html +++ b/src/app/cashier/inter-cashier-transfer/inter-cashier-transfer.component.html @@ -17,17 +17,24 @@
- - Teller - - @for (t of tellers; track t.id) { - {{ t.name }} - } - @if (tellers.length === 0) { - No tellers configured - } - - + @if (tellers.length === 1) { + + Teller + + + } @else { + + Teller + + @for (t of tellers; track t.id) { + {{ t.name }} + } + @if (tellers.length === 0) { + No tellers configured + } + + + } From (Cashier) diff --git a/src/app/cashier/inter-cashier-transfer/inter-cashier-transfer.component.ts b/src/app/cashier/inter-cashier-transfer/inter-cashier-transfer.component.ts index f49f02895..047384c84 100644 --- a/src/app/cashier/inter-cashier-transfer/inter-cashier-transfer.component.ts +++ b/src/app/cashier/inter-cashier-transfer/inter-cashier-transfer.component.ts @@ -102,6 +102,9 @@ export class InterCashierTransferComponent implements OnInit { .pipe(catchError(() => of([] as any[]))) .subscribe((list) => { this.tellers = (list || []).map((t: any) => ({ id: t.id, name: t.name })); + if (this.tellers.length === 1) { + this.onTellerSelect(this.tellers[0].id); + } }); } diff --git a/src/app/cashier/reconciliation/reconciliation.component.html b/src/app/cashier/reconciliation/reconciliation.component.html index 55036cb21..24c7280e0 100644 --- a/src/app/cashier/reconciliation/reconciliation.component.html +++ b/src/app/cashier/reconciliation/reconciliation.component.html @@ -20,14 +20,21 @@
- - Teller - - @for (t of tellers; track t.id) { - {{ t.name }} - } - - + @if (tellers.length === 1) { + + Teller + + + } @else { + + Teller + + @for (t of tellers; track t.id) { + {{ t.name }} + } + + + } Cashier diff --git a/src/app/cashier/reconciliation/reconciliation.component.ts b/src/app/cashier/reconciliation/reconciliation.component.ts index 27b8e3ff5..40e4eeae2 100644 --- a/src/app/cashier/reconciliation/reconciliation.component.ts +++ b/src/app/cashier/reconciliation/reconciliation.component.ts @@ -92,6 +92,9 @@ export class ReconciliationComponent implements OnInit { .pipe(catchError(() => of([] as any[]))) .subscribe((list) => { this.tellers = (list || []).map((t: any) => ({ id: t.id, name: t.name })); + if (this.tellers.length === 1) { + this.onTellerSelect(this.tellers[0].id); + } }); this.loadHistory(); } @@ -108,6 +111,9 @@ export class ReconciliationComponent implements OnInit { .pipe(catchError(() => of({ cashiers: [] }))) .subscribe((r: any) => { this.cashiers = (r?.cashiers || []).map((c: any) => ({ id: c.id, label: c.staffName })); + if (this.cashiers.length === 1) { + this.onCashierSelect(this.cashiers[0].id); + } }); } diff --git a/src/app/core/shell/shell.component.html b/src/app/core/shell/shell.component.html index 2a331ead8..9e87b4350 100644 --- a/src/app/core/shell/shell.component.html +++ b/src/app/core/shell/shell.component.html @@ -162,13 +162,6 @@ > My Deposits - - Share Collection - Cash History -