52 lines
1.7 KiB
HTML
52 lines
1.7 KiB
HTML
<h2 mat-dialog-title>Contrepasser le règlement</h2>
|
||
<form [formGroup]="form" (ngSubmit)="submit()">
|
||
<mat-dialog-content class="action-dialog-content">
|
||
<p>
|
||
Les affectations de ce règlement de
|
||
<strong>{{ formatEuro(payment.amount) }}</strong> seront annulées. Le règlement restera
|
||
visible dans l’historique.
|
||
</p>
|
||
@if (payment.refundedAmount > 0) {
|
||
<p class="refund-warning" role="note">
|
||
Les remboursements déjà confirmés, pour {{ formatEuro(payment.refundedAmount) }},
|
||
resteront des sorties historiques.
|
||
</p>
|
||
}
|
||
<fieldset class="dialog-fieldset" [disabled]="saving()">
|
||
<mat-form-field appearance="outline">
|
||
<mat-label>Motif de la contrepassation</mat-label>
|
||
<textarea
|
||
matInput
|
||
rows="4"
|
||
formControlName="reason"
|
||
required
|
||
(input)="clearFieldError('reason')"
|
||
></textarea>
|
||
@if (
|
||
form.controls.reason.hasError('required') ||
|
||
form.controls.reason.hasError('not_blank')
|
||
) {
|
||
<mat-error>Le motif est obligatoire.</mat-error>
|
||
} @else if (
|
||
form.controls.reason.hasError('maxlength') ||
|
||
form.controls.reason.hasError('size')
|
||
) {
|
||
<mat-error>Le motif ne peut pas dépasser 500 caractères.</mat-error>
|
||
}
|
||
</mat-form-field>
|
||
</fieldset>
|
||
@if (error()) {
|
||
<p class="dialog-error" role="alert">{{ error() }}</p>
|
||
}
|
||
</mat-dialog-content>
|
||
<mat-dialog-actions align="end">
|
||
<button mat-button mat-dialog-close type="button" [disabled]="saving()">Annuler</button>
|
||
<button mat-flat-button type="submit" class="danger-action" [disabled]="saving()">
|
||
@if (saving()) {
|
||
<mat-spinner diameter="18" aria-label="Contrepassation en cours" />
|
||
}
|
||
Contrepasser
|
||
</button>
|
||
</mat-dialog-actions>
|
||
</form>
|