HRM-10/HRM.UI/ClientApp/src/app/adhoc-feature/approve-financial-data/approve-financial-data.component.html
Mohaimen Hasan 838b8d4480 first commit
2026-11-03 13:06:00 +06:00

334 lines
10 KiB
HTML

<app-loading-panel></app-loading-panel>
<!-- ================= Pending Approval Summary Cards ================= -->
<div class="summary-cards">
<div class="summary-card"
[class.active]="selectedFinancialDataType === EnumApprovalFinancialData.Allowance"
(click)="onSummaryCardClick(EnumApprovalFinancialData.Allowance)">
<div class="summary-card-title">Allowance</div>
<div class="summary-card-count">
{{ loadingPendingSummary ? '…' : pendingSummary.allowance }}
</div>
<div class="summary-card-label">Pending</div>
</div>
<div class="summary-card"
[class.active]="selectedFinancialDataType === EnumApprovalFinancialData.Deduction"
(click)="onSummaryCardClick(EnumApprovalFinancialData.Deduction)">
<div class="summary-card-title">Deduction</div>
<div class="summary-card-count">
{{ loadingPendingSummary ? '…' : pendingSummary.deduction }}
</div>
<div class="summary-card-label">Pending</div>
</div>
<div class="summary-card"
[class.active]="selectedFinancialDataType === EnumApprovalFinancialData.BankAccountHistory"
(click)="onSummaryCardClick(EnumApprovalFinancialData.BankAccountHistory)">
<div class="summary-card-title">Bank</div>
<div class="summary-card-count">
{{ loadingPendingSummary ? '…' : pendingSummary.bank }}
</div>
<div class="summary-card-label">Pending</div>
</div>
<div class="summary-card"
[class.active]="selectedFinancialDataType === EnumApprovalFinancialData.Lifecycle"
(click)="onSummaryCardClick(EnumApprovalFinancialData.Lifecycle)">
<div class="summary-card-title">Life Cycle</div>
<div class="summary-card-count">
{{ loadingPendingSummary ? '…' : pendingSummary.lifeCycle }}
</div>
<div class="summary-card-label">Pending</div>
</div>
</div>
<!-- ================= Financial Data Type ================= -->
<fieldset>
<div class="grid" style="margin: auto;">
<div class="col-4 col-md-4 col-lg-4">
<label>Financial Data Type</label>
<kendo-dropdownlist [(ngModel)]="selectedFinancialDataType"
[data]="enumApproveFinancialData"
[defaultItem]="{ name: 'Select Data Type..', value: null }"
[textField]="'name'"
[valueField]="'value'"
(valueChange)="financialDataTyeValueChange($event)"
[valuePrimitive]="true"
style="width: 100%;">
</kendo-dropdownlist>
</div>
<div class="col-4 col-md-4 col-lg-4"
align="right"
style="margin-top: 20px;">
<button kendoButton
(click)="onRefresh()"
class="k-primary"
style="width: 40%;">
Refresh
</button>
</div>
</div>
</fieldset>
<!-- ================= Approval Data Grid ================= -->
<div class="p-col-12 p-md-12 p-lg-12">
<kendo-grid [data]="gridItems"
[resizable]="true"
[pageSize]="state.take"
[skip]="state.skip"
[sort]="state.sort"
[sortable]="true"
[selectable]="true"
[selectedKeys]="mySelection"
(selectedKeysChange)="onSelectedKeysChange($event)"
[kendoGridSelectBy]="'id'"
style="max-height: 400px;"
(dataStateChange)="dataStateChange($event)">
<!-- ================= Grid Toolbar ================= -->
<ng-template kendoGridToolbarTemplate>
<div class="financial-grid-toolbar">
<div class="financial-grid-search">
<!-- Native input is used here so legacy Kendo/PrimeNG CSS cannot hide
the kendo-textbox component. It still uses the same search logic. -->
<input type="text"
class="financial-search-input"
[(ngModel)]="searchText"
(ngModelChange)="onFilter($event)"
placeholder="Search all columns..."
autocomplete="off" />
@if (searchText) {
<button kendoButton
type="button"
class="financial-clear-button"
(click)="clearSearch()">
Clear
</button>
}
</div>
<button kendoGridExcelCommand
type="button"
icon="file-excel"
class="financial-export-button">
Export to Excel
</button>
</div>
</ng-template>
<!-- ================= Excel Export ================= -->
<kendo-grid-excel [fileName]="excelFileName"></kendo-grid-excel>
<!-- ================= Selection ================= -->
<kendo-grid-checkbox-column width="50"
showSelectAll="true">
</kendo-grid-checkbox-column>
<!-- ================= Common Columns ================= -->
<kendo-grid-column field="employeeNo"
title="Employee ID"
width="180">
</kendo-grid-column>
<kendo-grid-column field="name"
title="Name"
width="220">
</kendo-grid-column>
<!-- ================= Life Cycle Columns ================= -->
@if (selectedFinancialDataType === EnumApprovalFinancialData.Lifecycle) {
<kendo-grid-column field="eventName"
title="Event Name"
width="200"
>
</kendo-grid-column>
}
@if (selectedFinancialDataType === EnumApprovalFinancialData.Lifecycle) {
<kendo-grid-column field="description"
title="Description"
width="250"
>
</kendo-grid-column>
}
<!-- ================= Bank Columns ================= -->
@if (selectedFinancialDataType === EnumApprovalFinancialData.BankAccountHistory) {
<kendo-grid-column field="accountNumber"
title="Account Number"
width="250"
>
</kendo-grid-column>
}
<!-- ================= Common Date Column ================= -->
<kendo-grid-column field="effectMonth"
title="Effect Month"
width="200">
</kendo-grid-column>
<!-- ================= Allowance / Deduction Columns ================= -->
@if (selectedFinancialDataType === EnumApprovalFinancialData.Allowance || selectedFinancialDataType === EnumApprovalFinancialData.Deduction) {
<kendo-grid-column field="adDescription"
title="Description"
width="180"
>
</kendo-grid-column>
}
@if (selectedFinancialDataType === EnumApprovalFinancialData.Allowance || selectedFinancialDataType === EnumApprovalFinancialData.Deduction) {
<kendo-grid-column field="amount"
title="Amount"
width="180"
>
</kendo-grid-column>
}
<!-- ================= Approval Information ================= -->
<kendo-grid-column field="createdBy"
title="Created By"
width="200">
</kendo-grid-column>
<kendo-grid-column field="approvalStatus"
title="Approval Status"
width="180">
<ng-template kendoGridCellTemplate let-dataItem>
{{ approvalStatusString(dataItem.approvalStatus) }}
</ng-template>
</kendo-grid-column>
<kendo-grid-column field="status"
title="Employee Status"
width="180">
<ng-template kendoGridCellTemplate let-dataItem>
{{ statusString(dataItem.status) }}
</ng-template>
</kendo-grid-column>
<!-- ================= Life Cycle History ================= -->
@if (selectedFinancialDataType === EnumApprovalFinancialData.Lifecycle) {
<kendo-grid-command-column title="History"
width="105"
>
<ng-template kendoGridCellTemplate let-dataItem>
<button kendoButton
icon="eye"
(click)="viewHistory(dataItem)"
themeColor="primary">
History
</button>
</ng-template>
</kendo-grid-command-column>
}
</kendo-grid>
</div>
<!-- ================= Selected Count / Total Amount ================= -->
<div class="selection-summary">
<div class="selection-count">
Selected Count: {{ selectedCount }}
</div>
@if (isAmountApplicable()) {
<div class="selection-total"
>
Selected Amount: {{ selectedAmount | number:'1.2-2' }}
</div>
}
@if (isAmountApplicable()) {
<div class="total-amount"
>
Total Amount: {{ totalAmount | number:'1.2-2' }}
</div>
}
</div>
<!-- ================= Approve / Decline ================= -->
<div class="p-col-12 p-md-12 p-lg-12"
align="right"
style="margin-top:5px;">
<button kendoButton
style="width: 180px"
class="k-primary"
(click)="onApprove()"
[disabled]="isApproved">
Approve
</button>
<button kendoButton
style="margin-left: 10px; width: 180px"
(click)="onReject()">
Decline
</button>
</div>
<!-- ================= Career History Dialog ================= -->
<!-- <div class="card blur-background"
*ngIf="isShowCarrerHistoryReport">
<kendo-dialog [height]="700"
[width]="1400"
class="window-viewer"
title="Career History Report"
(close)="closeForm()">
<app-career-history-report [GetEmployee]="_employee">
</app-career-history-report>
</kendo-dialog>
</div> -->
@if (isShowCarrerHistoryReport) {
<div class="card" class="blur-background">
@if (isShowCarrerHistoryReport) {
<kendo-dialog [height]="700" [width]="1400" class='window-viewer' title="Career History Report" (close)="closeForm()">
<app-career-history-report [GetEmployee]="_employee"></app-career-history-report>
</kendo-dialog>
}
</div>
}
<!-- ================= Mandatory Remarks Dialog for Decline ================= -->
@if (isShowRemarksDialog) {
<kendo-dialog
title="Remarks"
[width]="450"
[height]="260"
(close)="onRemarksCancel()">
<div style="padding: 10px;">
<label>
Remarks <span style="color:red;">*</span>
</label>
<textarea [(ngModel)]="remarksText"
rows="4"
style="width: 100%; margin-top: 5px; resize: vertical;"
placeholder="Please enter remarks for decline">
</textarea>
@if (remarksValidationError) {
<div
style="color:red; margin-top:5px; font-size:12px;">
{{ remarksValidationError }}
</div>
}
</div>
<kendo-dialog-actions>
<button kendoButton
(click)="onRemarksCancel()">
Cancel
</button>
<button kendoButton
class="k-primary"
(click)="onRemarksSubmit()">
Submit
</button>
</kendo-dialog-actions>
</kendo-dialog>
}