feat: wire cashbox export and subscription dialogs into Cashbox page
Adds an Export button (opens CashboxExportDialog directly) plus a secondary menu (opens CashboxExportSubscriptionDialog) to the journal toolbar, gated by the existing canBook permission signal.
This commit is contained in:
@@ -10,6 +10,7 @@ import { MatDialog } from '@angular/material/dialog';
|
||||
import { MatFormFieldModule } from '@angular/material/form-field';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { MatInputModule } from '@angular/material/input';
|
||||
import { MatMenuModule } from '@angular/material/menu';
|
||||
import { MatSelectModule } from '@angular/material/select';
|
||||
import { MatSnackBar, MatSnackBarModule } from '@angular/material/snack-bar';
|
||||
import { AgGridAngular } from 'ag-grid-angular';
|
||||
@@ -38,6 +39,8 @@ import {
|
||||
} from '../../../models/transaction.model';
|
||||
import { ConfirmDialog, ConfirmDialogData } from '../../../shared/confirm-dialog/confirm-dialog';
|
||||
import { ContextHelp } from '../../../shared/context-help/context-help';
|
||||
import { CashboxExportDialog } from './cashbox-export-dialog/cashbox-export-dialog';
|
||||
import { CashboxExportSubscriptionDialog } from './cashbox-export-subscription-dialog/cashbox-export-subscription-dialog';
|
||||
import '../../../shared/ag-grid/ag-grid-modules';
|
||||
import { teamwalletGridTheme } from '../../../shared/ag-grid/ag-grid-theme';
|
||||
import { AmountCellRenderer } from '../../../shared/ag-grid/amount-cell-renderer';
|
||||
@@ -72,6 +75,7 @@ const JOURNAL_TYPE_OPTIONS: { value: string; label: string }[] = [
|
||||
MatFormFieldModule,
|
||||
MatIconModule,
|
||||
MatInputModule,
|
||||
MatMenuModule,
|
||||
MatSelectModule,
|
||||
MatSnackBarModule,
|
||||
ContextHelp,
|
||||
@@ -396,6 +400,18 @@ export class Cashbox {
|
||||
});
|
||||
}
|
||||
|
||||
protected openExportDialog(): void {
|
||||
const teamId = this.team()?.id;
|
||||
if (!teamId) return;
|
||||
this.dialog.open(CashboxExportDialog, { data: { teamId } });
|
||||
}
|
||||
|
||||
protected openExportSubscriptionDialog(): void {
|
||||
const teamId = this.team()?.id;
|
||||
if (!teamId) return;
|
||||
this.dialog.open(CashboxExportSubscriptionDialog, { data: { teamId } });
|
||||
}
|
||||
|
||||
protected typeLabel(type: string): string {
|
||||
return (
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user