/** * Copyright since 2025 Mifos Initiative * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ import { Component, OnInit, inject } from '@angular/core'; import { CommonModule } from '@angular/common'; import { FormsModule, ReactiveFormsModule, FormBuilder, FormGroup, Validators } from '@angular/forms'; import { MatDialogModule, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; export interface CashierIssueDdDialogData { leaflet: any; branchName: string; sponsorBankName: string; faceValue: number; chargesAmount: number; gstPercentage: number; gstAmount: number; totalCashPayable: number; /** * How the draft is being paid for. Cash is a walk-in purchaser the bank may know nothing about, * so their name, address and Aadhaar have to be captured here. An account debit is a member whose * account is already on screen — those fields are not asked for, and must not be sent, because * the identity is the account holder's rather than a walk-in's. */ paymentMethod?: 'CASH' | 'ACCOUNT_DEBIT'; /** The account being debited, shown so the clerk can see what is funding the draft. */ accountNo?: string; /** The account holder, for the same reason. */ accountHolderName?: string; } @Component({ selector: 'mifosx-cashier-issue-dd-dialog', standalone: true, imports: [ CommonModule, FormsModule, ReactiveFormsModule, MatDialogModule, MatFormFieldModule, MatInputModule, MatButtonModule, MatIconModule ], template: `
Next available DD leaflet auto-selected · {{ isAccountDebit ? 'Enter beneficiary details' : 'Enter purchaser & beneficiary details' }}