| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <td-steps mode="'vertical'"> |
| <td-step #detailsStep label="{{'Payments' | translate}}" [state]="form.valid ? 'complete' : form.pristine ? 'none' : 'required'"> |
| <form [formGroup]="form"> |
| <fims-account-select title="{{'From account' | translate}}" formControlName="sourceAccountNumber"> |
| <ng-container *ngIf="!form.get('sourceAccountNumber').pristine && form.get('sourceAccountNumber').hasError('required')" translate> |
| Required |
| </ng-container> |
| <ng-container *ngIf="form.get('sourceAccountNumber').hasError('invalidAccount')" translate> |
| Invalid account |
| </ng-container> |
| </fims-account-select> |
| <div layout-gt-xs="column" layout-margin formArrayName="payments"> |
| <h4 translate>Payments</h4> |
| <div *ngFor="let payment of payments; let i=index" layout="row" [formGroupName]="i"> |
| <fims-customer-select title="Member" formControlName="customerIdentifier"> |
| <ng-container *ngIf="!payment.get('customerIdentifier').pristine && payment.get('customerIdentifier').hasError('required')" translate> |
| Required |
| </ng-container> |
| <ng-container *ngIf="payment.get('customerIdentifier').hasError('invalidCustomer')" translate> |
| Invalid member or has no payroll created |
| </ng-container> |
| </fims-customer-select> |
| <fims-text-input [form]="payment" controlName="employer" placeholder="{{'Employer' | translate}}"></fims-text-input> |
| <fims-number-input placeholder="Salary" [form]="payment" controlName="salary"></fims-number-input> |
| <button mat-button (click)="removePayment(i)" [disabled]="i === 0">{{'Remove' | translate}}</button> |
| </div> |
| <button mat-button (click)="addPayment()">{{'Add payment' | translate}}</button> |
| </div> |
| </form> |
| <ng-template td-step-actions> |
| <fims-form-final-action |
| [resourceName]="'PAYMENTS'" |
| [editMode]="editMode" |
| [disabled]="!form.valid" |
| (onCancel)="cancel()" |
| (onSave)="save()"> |
| </fims-form-final-action> |
| </ng-template> |
| </td-step> |
| </td-steps> |