AD Parameter Employee Entry

This commit is contained in:
Mohaimen Hasan 2026-11-15 13:09:32 +06:00
parent 7f1dcadd0c
commit 75e94ddc94
4 changed files with 521 additions and 384 deletions

View File

@ -2,8 +2,179 @@ kendo-numerictextbox{
width: 100%;
}
.checkBoxGrid.grid {
/* .checkBoxGrid.grid {
justify-content: space-evenly;
} */
/* ---- Layout only (alignment / spacing); no behaviour depends on these classes ---- */
.adp-card {
padding: 14px 16px;
margin-bottom: 12px;
}
.adp-section-title {
font-weight: 600;
font-size: 13px;
color: #495057;
padding-bottom: 6px;
margin-bottom: 10px;
border-bottom: 1px solid #e9ecef;
}
.adp-required {
color: #dc3545;
}
/* label + control on one line, labels the same width so the controls line up */
.adp-field {
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 8px;
}
.adp-label {
flex: 0 0 110px;
margin: 0;
white-space: nowrap;
}
.adp-control {
flex: 1 1 auto;
min-width: 0;
}
/* every input on the page the same height, so the rows line up */
.adp-page kendo-dropdownlist,
.adp-page kendo-numerictextbox,
.adp-page kendo-datepicker {
height: 32px;
}
.adp-page kendo-dropdownlist.form-control {
padding: 0;
font-size: inherit;
min-height: 0;
}
/* the four check boxes in two even columns, starting under the inputs (label width + gap) */
.adp-checks {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px 12px;
margin: 4px 0 0 120px;
padding: 10px 12px;
border: 1px solid #dee2e6;
border-radius: 6px;
background: #fafbfc;
}
.adp-check {
display: flex;
align-items: center;
gap: 6px;
margin: 0;
white-space: nowrap;
}
.adp-check .k-checkbox-label {
margin: 0;
}
/* the tab panels on this page are empty (only the headers are used), so drop their padding */
:host ::ng-deep .adp-card .tab-view-compat-panels {
padding: 0 !important;
}
.adp-detail-text {
margin: 12px 0 8px;
}
/* employee entry: label above each control, all on one row */
.adp-entry-row {
display: flex;
flex-wrap: wrap;
align-items: flex-start;
gap: 12px 16px;
margin-bottom: 10px;
}
.adp-entry-item {
display: flex;
flex-direction: column;
gap: 4px;
flex: 0 1 200px;
min-width: 160px;
}
.adp-entry-emp {
flex-basis: 140px;
min-width: 120px;
}
/* the picker (icon + count) sits in a 32px box like the inputs */
.adp-entry-emp app-employee-picker {
display: flex;
align-items: center;
min-height: 32px;
}
/* the picker sizes its search button and count as 15% of its box; on this page give them a fixed size
(this page only — the picker component itself is unchanged) */
/* direct path only, so the buttons inside the picker's pop-up dialog are not touched */
:host ::ng-deep .adp-entry-emp app-employee-picker > div > div > div > button {
width: 32px !important;
max-width: none !important;
height: 32px;
flex: 0 0 32px;
}
:host ::ng-deep .adp-entry-emp app-employee-picker > div > div > div > label {
width: auto !important;
max-width: none !important;
margin: 0 0 0 8px;
white-space: nowrap;
}
:host ::ng-deep .adp-entry-emp app-employee-picker > div > div > div {
display: flex;
align-items: center;
}
/* every label the same height (the To Date one has a check box), so all inputs start on one line */
.adp-entry-label {
display: flex;
align-items: center;
gap: 4px;
height: 22px;
margin: 0;
white-space: nowrap;
}
.adp-entry-label .k-checkbox-label {
margin: 0;
}
/* Sum on the left, buttons on the right */
.adp-action-bar {
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: space-between;
gap: 8px;
padding: 8px 0;
margin-bottom: 8px;
border-top: 1px solid #e9ecef;
}
.adp-sum {
font-weight: bold;
}
.adp-actions {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
@media screen and (max-width: 400px) {
@ -17,4 +188,11 @@ kendo-numerictextbox{
flex-flow: column wrap;
justify-content: flex-start;
}
.adp-checks {
grid-template-columns: 1fr;
margin-left: 0;
}
.adp-entry-item {
flex: 1 1 100%;
}
}

View File

@ -1,13 +1,14 @@
<app-loading-panel></app-loading-panel>
<form [formGroup]="_fromValidator">
<div class="card" style="padding: 1%">
<form [formGroup]="_fromValidator" class="adp-page">
<!-- Setup: layout only was tidied; every control, binding and event is the same as before. -->
<div class="card adp-card">
<div class="topGrid grid">
<div class="col-5">
<div class="grid">
<div class="col-4" style="margin: auto;">
<label class="form-control-label" for="ddlAllowance">Allowance *</label>
</div>
<div class="col-8">
<!-- General -->
<div class="col-12 lg:col-5 adp-section">
<div class="adp-section-title">General</div>
<div class="adp-field">
<label class="adp-label form-control-label" for="ddlAllowance">Allowance <span class="adp-required">*</span></label>
<div class="adp-control">
<kendo-dropdownlist
style="width: 100%"
class="form-control form-control-sm input-sm"
@ -15,14 +16,14 @@
[(ngModel)]="_adPram.allowDeductID"
id="ddlAllowance"
[data]="_allowDeducts"
[defaultItem]="{
name: 'Select Allowance',
id: null
}"
[defaultItem]="{
name: 'Select Allowance',
id: null
}"
[textField]="'name'"
(selectionChange)="
AllowDeductselectionChange($event)
"
(selectionChange)="
AllowDeductselectionChange($event)
"
[valueField]="'id'"
[valuePrimitive]="true"
required
@ -30,20 +31,18 @@
</kendo-dropdownlist>
</div>
</div>
<div class="grid">
<div class="col-4" style="margin: auto;">
<label for="ddlPeriodicity">Periodicity *</label>
</div>
<div class="col-8">
<div class="adp-field">
<label class="adp-label" for="ddlPeriodicity">Periodicity <span class="adp-required">*</span></label>
<div class="adp-control">
<kendo-dropdownlist
class="form-control form-control-sm input-sm"
style="width: 100%"
id="ddlPeriodicity"
[data]="_periodicity"
[defaultItem]="{
name: 'Select Periodicity',
value: null
}"
[defaultItem]="{
name: 'Select Periodicity',
value: null
}"
[textField]="'name'"
[valueField]="'value'"
[valuePrimitive]="true"
@ -54,20 +53,18 @@
</kendo-dropdownlist>
</div>
</div>
<div class="grid">
<div class="col-4" style="margin: auto;">
<label for="ddlGender">Gender</label>
</div>
<div class="col-8">
<div class="adp-field">
<label class="adp-label" for="ddlGender">Gender</label>
<div class="adp-control">
<kendo-dropdownlist
class="form-control form-control-sm input-sm"
style="width: 100%"
id="ddlGender"
[data]="_gender"
[defaultItem]="{
name: 'Select Gender',
value: null
}"
[defaultItem]="{
name: 'Select Gender',
value: null
}"
[textField]="'name'"
[valueField]="'value'"
[valuePrimitive]="true"
@ -76,145 +73,133 @@
</kendo-dropdownlist>
</div>
</div>
<div class="checkBoxGrid" class="grid" style="margin-top: 0px;">
<div class="col-6" style="margin: auto;">
<label class="k-form-field right">
<input
type="checkbox"
formControlName="isForConfirmOnly"
id="enableConfirmCheck"
[(ngModel)]="_adPram.isForConfirmOnly"
kendoCheckBox/>
<label class="k-checkbox-label" for="enableConfirmCheck">Confirmation Required</label>
</label>
</div>
<div class="col-6" style="margin: auto;">
<label class="k-form-field right">
<input
type="checkbox"
formControlName="isDependsOnAttendance"
id="enableDepandentCheck"
[(ngModel)]="_adPram.isDependsOnAttendance"
kendoCheckBox/>
<label class="k-checkbox-label" for="enableDepandentCheck">Is Dependence on Attendance</label>
</label>
</div>
<div class="col-6" style="margin: auto;">
<label class="k-form-field right">
<input
type="checkbox"
formControlName="isFractionateApplicable"
id="enableFractionateCheck"
[(ngModel)]="_adPram.isFractionateApplicable"
kendoCheckBox/>
<label class="k-checkbox-label" for="enableFractionateCheck">Is fractionate Available</label>
</label>
</div>
<div class="col-6" style="margin: auto;">
<label class="k-form-field right">
<input
type="checkbox"
formControlName="isTaxable"
id="enabletaxableCheck"
[(ngModel)]="_adPram.isTaxable"
kendoCheckBox/>
<label class="k-checkbox-label" for="enabletaxableCheck">Taxable</label>
</label>
</div>
</div>
</div>
<div class="col-3">
<div class="grid">
<div class="col-4" style="margin: auto;">
<label for="txtFlatAmount">Flat Amount</label>
</div>
<div class="col-8">
<kendo-numerictextbox
[min]="-10000000"
[max]="10000000"
[(ngModel)]="_adPram.flatAmount"
formControlName="flatAmount"
>
</kendo-numerictextbox>
</div>
</div>
<div class="grid">
<div class="col-4" style="margin: auto;">
<label for="txtBasic">% of Basic</label>
</div>
<div class="col-8">
<kendo-numerictextbox
[min]="-1000"
[max]="1000"
[(ngModel)]="_adPram.percentOfBasic"
formControlName="percentOfBasic"
>
</kendo-numerictextbox>
</div>
</div>
<div class="grid">
<div class="col-4" style="margin: auto;">
<label for="txtGross">% of Gross</label>
</div>
<div class="col-8">
<kendo-numerictextbox
[min]="-1000"
[max]="1000"
[(ngModel)]="_adPram.percentOfGross"
formControlName="percentOfGross"
>
</kendo-numerictextbox>
</div>
</div>
<div class="grid">
<div class="col-4" style="margin: auto;">
<label for="txtMininmum" style="margin: auto;">Mininmum</label>
</div>
<div class="col-8">
<kendo-numerictextbox
[min]="-10000000"
[max]="10000000"
[(ngModel)]="_adPram.minAmount"
formControlName="minAmount"
>
</kendo-numerictextbox>
</div>
</div>
<div class="grid">
<div class="col-4" style="margin: auto;">
<label for="txtMaximum" style="margin: auto;">Maximum</label>
</div>
<div class="col-8">
<kendo-numerictextbox
[min]="-10000000"
[max]="10000000"
[(ngModel)]="_adPram.maxAmount"
formControlName="maxAmount"
>
</kendo-numerictextbox>
</div>
</div>
</div>
<div class="col-4">
<kendo-grid
[data]="_grades"
height="180"
[(selectedKeys)]="_selectedgrades"
[kendoGridSelectBy]="'id'"
>
<kendo-grid-checkbox-column
showSelectAll="true"
[width]="50"
[headerClass]="{ 'text-center': true }"
[class]="{ 'text-center': true }"
></kendo-grid-checkbox-column>
<kendo-grid-column field="code" title="Code">
</kendo-grid-column>
<kendo-grid-column field="name" title="Description">
</kendo-grid-column>
</kendo-grid>
</div>
</div>
<div class="checkBoxGrid adp-checks">
<label class="k-form-field right adp-check">
<input
type="checkbox"
formControlName="isForConfirmOnly"
id="enableConfirmCheck"
[(ngModel)]="_adPram.isForConfirmOnly"
kendoCheckBox/>
<label class="k-checkbox-label" for="enableConfirmCheck">Confirmation Required</label>
</label>
<label class="k-form-field right adp-check">
<input
type="checkbox"
formControlName="isDependsOnAttendance"
id="enableDepandentCheck"
[(ngModel)]="_adPram.isDependsOnAttendance"
kendoCheckBox/>
<label class="k-checkbox-label" for="enableDepandentCheck">Is Dependence on Attendance</label>
</label>
<label class="k-form-field right adp-check">
<input
type="checkbox"
formControlName="isFractionateApplicable"
id="enableFractionateCheck"
[(ngModel)]="_adPram.isFractionateApplicable"
kendoCheckBox/>
<label class="k-checkbox-label" for="enableFractionateCheck">Is fractionate Available</label>
</label>
<label class="k-form-field right adp-check">
<input
type="checkbox"
formControlName="isTaxable"
id="enabletaxableCheck"
[(ngModel)]="_adPram.isTaxable"
kendoCheckBox/>
<label class="k-checkbox-label" for="enabletaxableCheck">Taxable</label>
</label>
</div>
</div>
<!-- Amount -->
<div class="col-12 md:col-6 lg:col-3 adp-section">
<div class="adp-section-title">Amount</div>
<div class="adp-field">
<label class="adp-label" for="txtFlatAmount">Flat Amount</label>
<div class="adp-control">
<kendo-numerictextbox
[min]="-10000000"
[max]="10000000"
[(ngModel)]="_adPram.flatAmount"
formControlName="flatAmount"
>
</kendo-numerictextbox>
</div>
</div>
<div class="adp-field">
<label class="adp-label" for="txtBasic">% of Basic</label>
<div class="adp-control">
<kendo-numerictextbox
[min]="-1000"
[max]="1000"
[(ngModel)]="_adPram.percentOfBasic"
formControlName="percentOfBasic"
>
</kendo-numerictextbox>
</div>
</div>
<div class="adp-field">
<label class="adp-label" for="txtGross">% of Gross</label>
<div class="adp-control">
<kendo-numerictextbox
[min]="-1000"
[max]="1000"
[(ngModel)]="_adPram.percentOfGross"
formControlName="percentOfGross"
>
</kendo-numerictextbox>
</div>
</div>
<div class="adp-field">
<label class="adp-label" for="txtMininmum">Mininmum</label>
<div class="adp-control">
<kendo-numerictextbox
[min]="-10000000"
[max]="10000000"
[(ngModel)]="_adPram.minAmount"
formControlName="minAmount"
>
</kendo-numerictextbox>
</div>
</div>
<div class="adp-field">
<label class="adp-label" for="txtMaximum">Maximum</label>
<div class="adp-control">
<kendo-numerictextbox
[min]="-10000000"
[max]="10000000"
[(ngModel)]="_adPram.maxAmount"
formControlName="maxAmount"
>
</kendo-numerictextbox>
</div>
</div>
</div>
<!-- Grades -->
<div class="col-12 md:col-6 lg:col-4 adp-section">
<div class="adp-section-title">Grade <span class="adp-required">*</span></div>
<kendo-grid
[data]="_grades"
height="220"
[(selectedKeys)]="_selectedgrades"
[kendoGridSelectBy]="'id'"
>
<kendo-grid-checkbox-column
showSelectAll="true"
[width]="50"
[headerClass]="{ 'text-center': true }"
[class]="{ 'text-center': true }"
></kendo-grid-checkbox-column>
<kendo-grid-column field="code" title="Code">
</kendo-grid-column>
<kendo-grid-column field="name" title="Description">
</kendo-grid-column>
</kendo-grid>
</div>
</div>
<!-- <hr>
<div class="checkBoxGrid grid">
@ -278,7 +263,7 @@
</label>
</div>
</div> -->
</div>
</div>
<!-- <div class="card" style="padding: 1%;">
<div class="middleGrid grid">
<div class="col-6">
@ -355,203 +340,177 @@
</div>
</div>
</div> -->
<div class="card" style="padding: 1%">
<div class="grid">
<div class="col-12">
<app-tab-view (onChange)="IndividualChecked($event)">
@if (_selectedPeriodicity == 1) {
<app-tab-panel
header="Exception ( {{
this._adPram.exception?.length
}} )"
leftIcon="pi pi-user"
>
</app-tab-panel>
}
@if (_selectedPeriodicity == 1) {
<app-tab-panel
header="Not Applicable ( {{
this._adPram.notApplicable?.length
}} )"
leftIcon="pi pi-user"
>
</app-tab-panel>
}
@if (_selectedPeriodicity != 1) {
<app-tab-panel
header="Individual ( {{
this._adPram.adParameterEmployees?.length
}} )"
leftIcon="pi pi-user"
>
</app-tab-panel>
}
</app-tab-view>
<div class="grid">
<div class="col-12">
<b> {{ _detailLevelText }}</b>
</div>
</div>
<div class="grid" style="margin-top: 5px;">
<div class="col-2">
<div class="grid">
<div class="col-5" style="margin: auto;">
<label for="txtEmp"> Select Emp</label>
</div>
<div class="col-7" align="left">
<app-employee-picker [MultiSelect]="true"
[fixedGrades]="_selectedgrades"
(ItemSelected)="GetSelectedEmployee($event)"
style="width: 80%;"></app-employee-picker>
<!-- <app-employee-picker for="chkIsnew" id="idself" [isActive]="!newEmployee" [setSelectedEmp]="selectedEmployee"
(ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker> -->
</div>
</div>
</div>
@if (!_ischecknotapplicable) {
<div class="col-10">
<div class="grid">
<div class="col-1" style="margin: auto;" align="right">
<label for="txtEmp">Amount</label>
</div>
<div class="col-3">
<kendo-numerictextbox
[min]="-10000000"
[max]="10000000"
[(ngModel)]="_individualAmount"
[ngModelOptions]="{ standalone: true }"
>
</kendo-numerictextbox>
</div>
@if (!_ischeckException) {
<div class="col-1" style="margin: auto;" align="right">
<label for="dtpFromDate">From Date</label>
</div>
<div class="col-3">
<kendo-datepicker
id="dtpFromDate"
[format]="'dd-MMM-yyyy'"
[readonly]="this._adPram.periodicity == 2"
[(ngModel)]="_individualFromDate"
[ngModelOptions]="{ standalone: true }"
style="width: 100%"
></kendo-datepicker>
</div>
<div class="col-1" style="margin: auto;" align="right">
<label class="k-form-field right">
<input
type="checkbox"
[(ngModel)]="_checkedToDate"
[ngModelOptions]="{ standalone: true }"
[disabled]="this._adPram.periodicity == 2"
(click)="todateclicked()" kendoCheckBox/>
<label
class="k-checkbox-label"
for="isIndividualEmployee"
>
To Date
</label>
</label>
</div>
<div class="col-3">
<kendo-datepicker
id="dtpToDate"
[format]="'dd-MMM-yyyy'"
[(ngModel)]="_individualToDate"
[readonly]="
this._adPram.periodicity == 2 ||
_checkedToDate == false
"
[ngModelOptions]="{ standalone: true }"
style="width: 100%"
></kendo-datepicker>
</div>
}
</div>
</div>
}
</div>
<div class="grid">
<div class="col-2" style="font-weight: bold;">
Sum: {{get2FloatingPoint(sumofIndividualAmount())}}
</div>
<div class="col-10" align="right">
<button kendoButton
[svgIcon]="apiService.KendoSVGIcon['plus']"
class="k-button k-primary"
(click)="AddEmployee()">
Add
</button>
<button kendoButton style="margin-left:3px" [svgIcon]="apiService.KendoSVGIcon['delete']" class="kt-delete" (click)="RemoveAll()">Remove All</button>
<button kendoButton [svgIcon]="apiService.KendoSVGIcon['save']" themeColor="primary" style="margin-left:3px" (click)="Save()" >Save</button>
<!-- Employees -->
<div class="card adp-card">
<app-tab-view (onChange)="IndividualChecked($event)">
@if (_selectedPeriodicity == 1) {
<app-tab-panel
header="Exception ( {{
this._adPram.exception?.length
}} )"
leftIcon="pi pi-user"
>
</app-tab-panel>
}
@if (_selectedPeriodicity == 1) {
<app-tab-panel
header="Not Applicable ( {{
this._adPram.notApplicable?.length
}} )"
leftIcon="pi pi-user"
>
</app-tab-panel>
}
@if (_selectedPeriodicity != 1) {
<app-tab-panel
header="Individual ( {{
this._adPram.adParameterEmployees?.length
}} )"
leftIcon="pi pi-user"
>
</app-tab-panel>
}
</app-tab-view>
</div>
</div>
</div>
<div class="grid">
<div class="col-12">
<kendo-grid [data]="_individualEmplyees"
height="300"
(remove)="removeHandler($event)">
<kendo-grid-column field="employeeNo" title="Emp ID">
</kendo-grid-column>
<kendo-grid-column field="employeeName" title="Name">
</kendo-grid-column>
@if (_ischeckappliedtoInvididual) {
<kendo-grid-column field="formDate" title="From Month">
<ng-template kendoGridCellTemplate let-dataItem>
<kendo-datepicker id="idformDate"
[(ngModel)]="dataItem.formDate"
[ngModelOptions]="{ standalone: true }"
[format]="'dd MMM yyyy'"
name="formDate">
</kendo-datepicker>
</ng-template>
</kendo-grid-column>
<kendo-grid-column field="tillDate"
title="Till Month">
<ng-template kendoGridCellTemplate let-dataItem>
<kendo-datepicker id="idtilldate"
[(ngModel)]="dataItem.tillDate"
[format]="'dd MMM yyyy'"
[ngModelOptions]="{ standalone: true }"
name="tillstartDate">
</kendo-datepicker>
</ng-template>
</kendo-grid-column>
}
@if (!_ischecknotapplicable) {
<kendo-grid-command-column title="Amount">
<ng-template kendoGridCellTemplate let-dataItem>
<kendo-numerictextbox [(ngModel)]="dataItem.monthlyAmount"
[ngModelOptions]="{ standalone: true }"
[autoCorrect]="true"
[spinners]="false">
</kendo-numerictextbox>
</ng-template>
</kendo-grid-command-column>
}
<kendo-grid-column field="approvalStatus"
title="Approval Status">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
{{ statusString(dataItem.approvalStatus)}}
</ng-template>
</kendo-grid-column>
<kendo-grid-command-column title="Action" width="220">
<ng-template kendoGridCellTemplate
let-dataItem
let-rowIndex="rowIndex">
<button kendoGridRemoveCommand [svgIcon]="apiService.KendoSVGIcon['delete']" class="kt-delete"></button>
</ng-template>
</kendo-grid-command-column>
</kendo-grid>
</div>
</div>
</div>
</div>
<div class="grid">
<div class="col-12" align="right">
</div>
</div>
</form>
<div class="adp-detail-text">
<b> {{ _detailLevelText }}</b>
</div>
<div class="adp-entry-row">
<div class="adp-entry-item adp-entry-emp">
<label class="adp-entry-label" for="txtEmp">Select Emp</label>
<app-employee-picker [MultiSelect]="true"
[fixedGrades]="_selectedgrades"
(ItemSelected)="GetSelectedEmployee($event)"
></app-employee-picker>
<!-- <app-employee-picker for="chkIsnew" id="idself" [isActive]="!newEmployee" [setSelectedEmp]="selectedEmployee"
(ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker> -->
</div>
@if (!_ischecknotapplicable) {
<div class="adp-entry-item">
<label class="adp-entry-label" for="txtEmp">Amount</label>
<kendo-numerictextbox
[min]="-10000000"
[max]="10000000"
[(ngModel)]="_individualAmount"
[ngModelOptions]="{ standalone: true }"
>
</kendo-numerictextbox>
</div>
@if (!_ischeckException) {
<div class="adp-entry-item">
<label class="adp-entry-label" for="dtpFromDate">From Date</label>
<kendo-datepicker
id="dtpFromDate"
[format]="'dd-MMM-yyyy'"
[readonly]="this._adPram.periodicity == 2"
[(ngModel)]="_individualFromDate"
[ngModelOptions]="{ standalone: true }"
style="width: 100%"
></kendo-datepicker>
</div>
<div class="adp-entry-item">
<label class="k-form-field right adp-entry-label">
<input
type="checkbox"
[(ngModel)]="_checkedToDate"
[ngModelOptions]="{ standalone: true }"
[disabled]="this._adPram.periodicity == 2"
(click)="todateclicked()" kendoCheckBox/>
<label
class="k-checkbox-label"
for="isIndividualEmployee"
>
To Date
</label>
</label>
<kendo-datepicker
id="dtpToDate"
[format]="'dd-MMM-yyyy'"
[(ngModel)]="_individualToDate"
[readonly]="
this._adPram.periodicity == 2 ||
_checkedToDate == false
"
[ngModelOptions]="{ standalone: true }"
style="width: 100%"
></kendo-datepicker>
</div>
}
}
</div>
<div class="adp-action-bar">
<div class="adp-sum">
Sum: {{get2FloatingPoint(sumofIndividualAmount())}}
</div>
<div class="adp-actions">
<button kendoButton
[svgIcon]="apiService.KendoSVGIcon['plus']"
class="k-button k-primary"
(click)="AddEmployee()">
Add
</button>
<button kendoButton [svgIcon]="apiService.KendoSVGIcon['delete']" class="kt-delete" (click)="RemoveAll()">Remove All</button>
<button kendoButton [svgIcon]="apiService.KendoSVGIcon['save']" themeColor="primary" (click)="Save()" >Save</button>
</div>
</div>
<kendo-grid [data]="_individualEmplyees"
height="300"
(remove)="removeHandler($event)">
<kendo-grid-column field="employeeNo" title="Emp ID">
</kendo-grid-column>
<kendo-grid-column field="employeeName" title="Name">
</kendo-grid-column>
@if (_ischeckappliedtoInvididual) {
<kendo-grid-column field="formDate" title="From Month">
<ng-template kendoGridCellTemplate let-dataItem>
<kendo-datepicker id="idformDate"
[(ngModel)]="dataItem.formDate"
[ngModelOptions]="{ standalone: true }"
[format]="'dd MMM yyyy'"
name="formDate">
</kendo-datepicker>
</ng-template>
</kendo-grid-column>
<kendo-grid-column field="tillDate"
title="Till Month">
<ng-template kendoGridCellTemplate let-dataItem>
<kendo-datepicker id="idtilldate"
[(ngModel)]="dataItem.tillDate"
[format]="'dd MMM yyyy'"
[ngModelOptions]="{ standalone: true }"
name="tillstartDate">
</kendo-datepicker>
</ng-template>
</kendo-grid-column>
}
@if (!_ischecknotapplicable) {
<kendo-grid-command-column title="Amount">
<ng-template kendoGridCellTemplate let-dataItem>
<kendo-numerictextbox [(ngModel)]="dataItem.monthlyAmount"
[ngModelOptions]="{ standalone: true }"
[autoCorrect]="true"
[spinners]="false">
</kendo-numerictextbox>
</ng-template>
</kendo-grid-command-column>
}
<kendo-grid-column field="approvalStatus"
title="Approval Status">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
{{ statusString(dataItem.approvalStatus)}}
</ng-template>
</kendo-grid-column>
<kendo-grid-command-column title="Action" width="120">
<ng-template kendoGridCellTemplate
let-dataItem
let-rowIndex="rowIndex">
<button kendoGridRemoveCommand [svgIcon]="apiService.KendoSVGIcon['delete']" class="kt-delete"></button>
</ng-template>
</kendo-grid-command-column>
</kendo-grid>
</div>
</form>

View File

@ -262,10 +262,16 @@ export class AllowanceDeductionParameterizationEntryComponent implements OnInit
}
RemoveAll() {
if (!confirm("Are you sure to delete all employees allowance entry")) {
return;
}
this._individualEmplyees.splice(0, this._individualEmplyees.length);
// if (!confirm("Are you sure to delete all employees allowance entry")) {
// return;
// }
// this._individualEmplyees.splice(0, this._individualEmplyees.length);
this.notificationService.showActiveConfirm('Confirmation', "Are you sure to delete all employees allowance entry?").then((isConfirmed) => {
if (isConfirmed)
{
this._individualEmplyees.splice(0, this._individualEmplyees.length);
}
});
}
AddEmployee() {
@ -277,7 +283,6 @@ export class AllowanceDeductionParameterizationEntryComponent implements OnInit
this.notificationService.showWarning("Please enter an Amount");
return;
}
if (this._selectedEmps == undefined) return;
this._selectedEmps.forEach(x => {
let newItem: ADParameterEmployee = this._individualEmplyees.find(e => e.employeeID == x.employeeID);
@ -301,19 +306,14 @@ export class AllowanceDeductionParameterizationEntryComponent implements OnInit
newItem.tillDate = this._individualToDate;
newItem.monthlyAmount = this._individualAmount;
newItem.adEmpType = this._adEmpType;
}
});
}
public GetSelectedEmployee(searchEmp: SearchEmployee[]) {
if (searchEmp != null) {
this._selectedEmps = [];
searchEmp.forEach(x => {
this._selectedEmps.push(x);
});
searchEmp.forEach(x => { this._selectedEmps.push(x); });
}
}
PrepareGradeData(usedGrades: ADParameterGrade[]) {

View File

@ -55,7 +55,7 @@ export class DiscontinueEmployeeDetailsComponent implements OnInit {
this.notificationService.showWarning('From Date cannot be after To Date.', 'Warning');
return;
}
debugger;
// debugger;
this.grid.load({ fromDate: this.fromDate, toDate: this.toDate });
}