Prod bonus #7

Merged
chapal merged 1 commits from dev_mashfiq into devqc 2024-10-29 15:00:42 +06:00
12 changed files with 166 additions and 103 deletions
Showing only changes of commit 3cb2fa6696 - Show all commits

View File

@ -79,8 +79,8 @@ namespace HRM.BO
#endregion #endregion
public string employeeNo { get; set; } public string EmployeeNo { get; set; }
public string empName { get; set; } public string EmpName { get; set; }
//public Employee Employee { get; set; } //public Employee Employee { get; set; }

View File

@ -85,7 +85,7 @@ namespace HRM.DA
} }
internal static IDataReader Get(TransactionContext tc, int setupID, DateTime dateTime) internal static IDataReader Get(TransactionContext tc, int setupID, DateTime dateTime)
{ {
string sql = SQLParser.MakeSQL("SELECT * FROM ProdBonusAttn WHERE ProdBonusSetupID=%n AND year(InTime)= %n AND month(InTime)= %n AND day(InTime)= %n", string sql = SQLParser.MakeSQL("SELECT PBA.*, E.EMPLOYEENO FROM ProdBonusAttn PBA Left Join EMPLOYEE E on E.EMPLOYEEID = PBA.EmployeeID WHERE PBA.ProdBonusSetupID=%n AND year(PBA.InTime)= %n AND month(PBA.InTime)= %n AND day(PBA.InTime)= %n ORDER BY TRY_CAST(E.EMPLOYEENO AS INT) ASC",
setupID, dateTime.Year, dateTime.Month,dateTime.Day); setupID, dateTime.Year, dateTime.Month,dateTime.Day);
return tc.ExecuteReader(sql); return tc.ExecuteReader(sql);
//return tc.ExecuteReader("SELECT * FROM ProdBonusAttn WHERE ProdBonusSetupID=%n AND CAST(InTime AS date)=%d", setupID, dateTime); //return tc.ExecuteReader("SELECT * FROM ProdBonusAttn WHERE ProdBonusSetupID=%n AND CAST(InTime AS date)=%d", setupID, dateTime);

View File

@ -23,9 +23,9 @@ namespace HRM.DA
internal static void Insert(TransactionContext tc, ProductionBonusSetup item) internal static void Insert(TransactionContext tc, ProductionBonusSetup item)
{ {
string sql = SQLParser.MakeSQL( string sql = SQLParser.MakeSQL(
"INSERT INTO ProductionBonusSetup(ProductionBonusSetupID, ProgramName, AchivedPercent, OTHour, SalaryMonth, DesignNo, FromDate, ToDate, CreatedBy, CreationDate, Status)" + "INSERT INTO ProductionBonusSetup(ProductionBonusSetupID, ProgramName, AchivedPercent, OTHour, SalaryMonth, DesignNo, FromDate, ToDate, MaxPerson, CreatedBy, CreationDate, Status)" +
" VALUES(%n, %s, %n, %n, %d, %s, %d, %d, %n, %d, %n)", item.ID, item.ProgramName, item.AchivedPercent, item.OTHour, " VALUES(%n, %s, %n, %n, %d, %s, %d, %d, %n, %d, %n)", item.ID, item.ProgramName, item.AchivedPercent, item.OTHour,
item.SalaryMonth, item.DesignNo, item.FromDate, item.ToDate, item.CreatedBy, item.CreatedDate, item.SalaryMonth, item.DesignNo, item.FromDate, item.ToDate, item.MaxPerson, item.CreatedBy, item.CreatedDate,
item.Status); item.Status);
tc.ExecuteNonQuery(sql); tc.ExecuteNonQuery(sql);
} }
@ -37,9 +37,9 @@ namespace HRM.DA
internal static void Update(TransactionContext tc, ProductionBonusSetup item) internal static void Update(TransactionContext tc, ProductionBonusSetup item)
{ {
tc.ExecuteNonQuery( tc.ExecuteNonQuery(
"UPDATE ProductionBonusSetup SET ProgramName=%s, AchivedPercent=%n, OTHour=%n, SalaryMonth=%d, DesignNo=%s, FromDate=%d, ToDate=%d, Status=%n" + "UPDATE ProductionBonusSetup SET ProgramName=%s, AchivedPercent=%n, OTHour=%n, SalaryMonth=%d, DesignNo=%s, FromDate=%d, ToDate=%d, MaxPerson=%n, Status=%n " +
" WHERE ProductionBonusSetupID=%n", item.ProgramName, item.AchivedPercent, item.OTHour, item.SalaryMonth, item.DesignNo, " WHERE ProductionBonusSetupID=%n", item.ProgramName, item.AchivedPercent, item.OTHour, item.SalaryMonth, item.DesignNo,
item.FromDate, item.ToDate, item.Status, item.ID); item.FromDate, item.ToDate, item.MaxPerson, item.Status, item.ID);
} }
#endregion #endregion

View File

@ -4043,6 +4043,11 @@ AND ea.EMPLOYEEID=emp.EMPLOYEEID AND ea.LASTLEVEL=1),'') LastAcademic ,
} }
tc.ExecuteNonQuery(sSQL); tc.ExecuteNonQuery(sSQL);
} }
internal static DataTable GetEmployeeNameAndNo(TransactionContext tc, int payrolltypeid)
{
return tc.ExecuteDataTable(
"SELECT e.employeeId as id, e.employeeNo, e.name FROM employee e WHERE e.payrolltypeid=%n", payrolltypeid);
}
} }
#endregion #endregion

View File

@ -5542,5 +5542,29 @@ namespace HRM.DA
} }
return oGrossPay; return oGrossPay;
} }
public DataTable GetEmployeeNameAndNo(int payrolltypeid)
{
DataTable dt = null;
TransactionContext tc = null;
try
{
tc = TransactionContext.Begin();
dt = EmployeeDA.GetEmployeeNameAndNo(tc, payrolltypeid);
}
catch (Exception e)
{
#region Handle Exception
if (tc != null)
tc.HandleError();
ExceptionLog.Write(e);
throw new ServiceException(e.Message, e);
#endregion
}
return dt;
}
} }
} }

View File

@ -507,4 +507,8 @@ export class EmployeeServices {
getSearchEmployeesByEmpIds(empIds: string) { getSearchEmployeesByEmpIds(empIds: string) {
return this.apiService.httpGet<SearchEmployee[]>('/Employee/getSearchEmployeesByEmpIds/' + empIds); return this.apiService.httpGet<SearchEmployee[]>('/Employee/getSearchEmployeesByEmpIds/' + empIds);
} }
getAllEmployeeNameAndNo() {
return this.apiService.httpGet<Employee[]>('/Employee/getAllEmployeeNameAndNo');
}
} }

View File

@ -85,10 +85,10 @@
<div class="p-col-12" align="right"> <div class="p-col-12" align="right">
<button icon="refresh" kendoButton [primary]="true" style="width: fit-content" (click)="onClickRefresh()" <button icon="refresh" kendoButton [primary]="true" style="width: fit-content" (click)="onClickRefresh()"
[disabled]="selectedProdBSdata===undefined||selectedLine===undefined||selectedDate===undefined">Refresh</button> [disabled]="selectedProdBSdata===undefined||selectedLine===undefined||selectedDate===undefined">Load</button>
</div> </div>
<div class="p-col-12"> <div class="p-col-12">
<kendo-grid #grid [data]="employeeList" [pageable]="true" [sortable]="true" [reorderable]="true" [resizable]="true" [height]="450"> <kendo-grid #grid [data]="employeeList" [pageable]="false" [sortable]="true" [reorderable]="true" [resizable]="true" [height]="450">
<ng-template kendoGridToolbarTemplate> <ng-template kendoGridToolbarTemplate>
<button type="button" kendoButton icon="delete" class="kt-delete"> <button type="button" kendoButton icon="delete" class="kt-delete">
Remove All Remove All
@ -114,23 +114,23 @@
</kendo-grid> </kendo-grid>
</div> </div>
<div class="p-col-2 label-ailgn"> <div class="p-col-2 label-ailgn">
<input type="radio" name="employeeSelection" value="commonEmployee" #commonEmployee <!-- <input type="radio" name="employeeSelection" value="commonEmployee" #commonEmployee
[(ngModel)]="employeeSelection" kendoRadioButton /> [(ngModel)]="employeeSelection" kendoRadioButton />
<kendo-label [for]="commonEmployee" text=" Common Employee"></kendo-label> <kendo-label [for]="commonEmployee" text=" Common Employee"></kendo-label> -->
</div> </div>
<div class="p-col-2 label-ailgn"> <div class="p-col-2 label-ailgn">
<input type="radio" name="employeeSelection" value="supervisor" #supervisor [(ngModel)]="employeeSelection" <!-- <input type="radio" name="employeeSelection" value="supervisor" #supervisor [(ngModel)]="employeeSelection"
kendoRadioButton /> kendoRadioButton />
<kendo-label [for]="supervisor" text=" Supervisor"></kendo-label> <kendo-label [for]="supervisor" text=" Supervisor"></kendo-label> -->
</div> </div>
<div class="p-col-4"> <div class="p-col-4">
<app-employee-picker (ItemSelected)="GetSelectedEmployee($event)" [setSelectedEmp]="selectedEmps" <app-employee-picker (ItemSelected)="GetSelectedEmployee($event)" [setSelectedEmp]="selectedEmps"
[MultiSelect]="false" (keydown)="onKeyDown($event)"></app-employee-picker> [MultiSelect]="false" (keydown)="onKeyDown($event)" *ngIf="allEmps.length!=0"></app-employee-picker>
<!-- [MultiSelect]="employeeSelection==='commonEmployee'"></app-employee-picker> --> <!-- [MultiSelect]="employeeSelection==='commonEmployee'"></app-employee-picker> -->
</div> </div>
<div class="p-col-2"></div> <div class="p-col-2"></div>
<div class="p-col-2" align="right"> <div class="p-col-2" align="right">
<button icon="plus" kendoButton [primary]="true" style="width:80%" (click)="onClickAdd()" <button icon="plus" kendoButton [primary]="true" style="width:fit-content" (click)="onClickAdd()"
[disabled]="false">Add</button> [disabled]="false">Add</button>
</div> </div>
<div class="p-col-10"></div> <div class="p-col-10"></div>

View File

@ -61,6 +61,11 @@ export class ProductionBonusAttendanceComponent implements OnInit {
employeeSelection: string = 'commonEmployee'; employeeSelection: string = 'commonEmployee';
employeeList: Employee[] = [];
allEmps: any[] = [];
value: '';
constructor(public apiService: ApiService, constructor(public apiService: ApiService,
public notificationService: HRMNotificationService, public notificationService: HRMNotificationService,
public dataTransferService: DataTransferService, public dataTransferService: DataTransferService,
@ -72,25 +77,32 @@ export class ProductionBonusAttendanceComponent implements OnInit {
this._departmentPicker = new DynamicPicker(EnumDynamicpickerType.Department, false); this._departmentPicker = new DynamicPicker(EnumDynamicpickerType.Department, false);
} }
ngOnInit(): void { ngOnInit(): void {
// this.Loadlayout(); // this.Loadlayout();
this.GetAllEmployees();
this.productionBonusSetup = new ProductionBonusSetup(); this.productionBonusSetup = new ProductionBonusSetup();
this.showScheduleDate = false; this.showScheduleDate = false;
this.startTime = this.setTime(this.startTime, 6, 0, 0);
this.endTime = this.setTime(this.endTime, 23, 59, 0);
// this.startTime.setHours(6);
// this.startTime.setMinutes(0);
// this.startTime.setSeconds(0);
this.startTime = this.setTime(this.startTime, 6, 0, 0)
// this.endTime.setHours(23);
// this.endTime.setMinutes(0);
// this.endTime.setSeconds(0);
this.endTime = this.setTime(this.endTime, 23, 59, 0)
} }
private GetAllEmployees() {
employeeList: Employee[] = []; debugger
this.loadingPanelService.ShowLoadingPanel = true;
value: ''; this.employeeService.getAllEmployeeNameAndNo().subscribe(
(resp) => {
this.allEmps = resp;
},
(err) => {
this.notificationService.showError(err.error);
this.loadingPanelService.ShowLoadingPanel = false;
},
() => {
this.loadingPanelService.ShowLoadingPanel = false;
}
);
}
public GetSelectedEmployee(childData) { public GetSelectedEmployee(childData) {
this.selectedEmps = childData; this.selectedEmps = childData;
@ -196,7 +208,7 @@ export class ProductionBonusAttendanceComponent implements OnInit {
() => { () => {
this.loadingPanelService.ShowLoadingPanel = false; this.loadingPanelService.ShowLoadingPanel = false;
this.employeeList = []; this.employeeList = [];
debugger; // debugger;
if (this.prodBonusAttn.length <= 0 && (this.productionBonusSetup.productionBonusType == EnumProductionBonusType.Cutting || if (this.prodBonusAttn.length <= 0 && (this.productionBonusSetup.productionBonusType == EnumProductionBonusType.Cutting ||
this.productionBonusSetup.productionBonusType == EnumProductionBonusType.Finishing)) { this.productionBonusSetup.productionBonusType == EnumProductionBonusType.Finishing)) {
let data = { let data = {
@ -206,6 +218,7 @@ export class ProductionBonusAttendanceComponent implements OnInit {
this.loadingPanelService.ShowLoadingPanel = true; this.loadingPanelService.ShowLoadingPanel = true;
this.bonusService.getProdBonusAttnEmployeeList(data).subscribe( this.bonusService.getProdBonusAttnEmployeeList(data).subscribe(
(resp) => { (resp) => {
debugger
this.employeeList = resp; this.employeeList = resp;
// console.log('employee List', this.employeeList); // console.log('employee List', this.employeeList);
}, },
@ -307,23 +320,22 @@ export class ProductionBonusAttendanceComponent implements OnInit {
// } // }
} }
AddEmployeebyId(empId: number) { AddEmployeebyId(empId: number) {
this.loadingPanelService.ShowLoadingPanel = true; // this.loadingPanelService.ShowLoadingPanel = true;
this.employeeService.getEmployeeByID(empId).subscribe( // this.employeeService.getEmployeeByID(empId).subscribe(
(resp) => { // (resp) => {
this.employeeList.push(resp); // this.employeeList.push(resp);
// console.log(this.employeeList); // },
// debugger; // (err) => {
}, // this.notificationService.showError(err.error);
(err) => { // this.loadingPanelService.ShowLoadingPanel = false;
this.notificationService.showError(err.error); // },
this.loadingPanelService.ShowLoadingPanel = false; // () => {
}, // // this.AddEmployeeGridData(empId, isCommonValue);
() => { // // console.log(this.prodBonusAttn);
// this.AddEmployeeGridData(empId, isCommonValue); // this.loadingPanelService.ShowLoadingPanel = false;
// console.log(this.prodBonusAttn); // }
this.loadingPanelService.ShowLoadingPanel = false; // );
} this.employeeList.push(this.allEmps.find(e => e.id == empId));
);
} }
AddEmployeeGridData(empId: number, isCommonValue: boolean) { AddEmployeeGridData(empId: number, isCommonValue: boolean) {
// var newProdBonusAttn: ProdBonusAttn = new ProdBonusAttn(); // var newProdBonusAttn: ProdBonusAttn = new ProdBonusAttn();
@ -406,7 +418,6 @@ export class ProductionBonusAttendanceComponent implements OnInit {
); );
} }
onClickRemove(data: any) { onClickRemove(data: any) {
// console.log(this.prodBonusAttn);
// debugger; // debugger;
const index = this.employeeList.findIndex(item => item.id === data.id); const index = this.employeeList.findIndex(item => item.id === data.id);
const indexAttn = this.prodBonusAttn.findIndex(item => item['employeeID'] === data.id); const indexAttn = this.prodBonusAttn.findIndex(item => item['employeeID'] === data.id);

View File

@ -46,7 +46,7 @@
<label>Max Persons</label> <label>Max Persons</label>
</div> </div>
<div class="p-col-12 p-lg-3"> <div class="p-col-12 p-lg-3">
<kendo-numerictextbox [(ngModel)]="productionBonusSetup.maxPerson" <kendo-numerictextbox [(ngModel)]="productionBonusSetup.maxPerson" [decimals]="0"
style="width:100%"></kendo-numerictextbox> style="width:100%"></kendo-numerictextbox>
</div> </div>
<div class="p-col-12 p-lg-1 label-ailgn"> <div class="p-col-12 p-lg-1 label-ailgn">
@ -97,7 +97,7 @@
</div> </div>
<div class="p-grid"> <div class="p-grid">
<p-panel header="Production Bonus Line" style="width: 100%"> <p-panel header="Production Bonus Line" [style.height.%]="100">
<kendo-grid [data]="productionBonusSetup.productionBonusLines" [pageable]="true" [sortable]="true" <kendo-grid [data]="productionBonusSetup.productionBonusLines" [pageable]="true" [sortable]="true"
[resizable]="true"> [resizable]="true">
<ng-template kendoGridToolbarTemplate> <ng-template kendoGridToolbarTemplate>
@ -106,17 +106,17 @@
Line</button> Line</button>
<kendo-grid-spacer></kendo-grid-spacer> <kendo-grid-spacer></kendo-grid-spacer>
</ng-template> </ng-template>
<kendo-grid-column field="lineName" title="Line Name" width="50%"> <kendo-grid-column field="lineName" title="Line Name" [width]="250">
<!-- <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <!-- <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
</ng-template> --> </ng-template> -->
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-column field="scheduledHour" title="Scheduled Hours" width="30%"> <kendo-grid-column field="scheduledHour" title="Scheduled Hours" [width]="200">
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-column title="Actions" width="20%"> <kendo-grid-column title="Actions" [width]="220">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button kendoButton icon="gear" [primary]="true" (click)="onCellClickEdit(dataItem)" <button kendoButton icon="gear" [primary]="true" (click)="onCellClickEdit(dataItem)"
style="width: 40%; margin-right: 5px;">Edit</button> style="width: fit-content; margin-right: 5px;">Edit</button>
<button type="button" kendoButton icon="delete" class="kt-delete" style="width: 40%;" (click)="onClickRemove(dataItem)">Remove</button> <button type="button" kendoButton icon="delete" class="kt-delete" style="width: fit-content;" (click)="onClickRemove(dataItem)">Remove</button>
</ng-template> </ng-template>
</kendo-grid-column> </kendo-grid-column>
</kendo-grid> </kendo-grid>
@ -127,7 +127,7 @@
</div> </div>
<div> <div>
<kendo-dialog class="blur-background" *ngIf="opened" (close)="close()" [maxHeight]="700" <kendo-dialog class="blur-background" *ngIf="opened" (close)="close()" [minHeight]="400" [maxHeight]="600" [minWidth]="400"
[maxWidth]="1050"> [maxWidth]="1050">
<kendo-dialog-titlebar> <kendo-dialog-titlebar>
<div style="font-size: 18px; line-height: 1.3em;"><span class=""></span>Production Bonus Line</div> <div style="font-size: 18px; line-height: 1.3em;"><span class=""></span>Production Bonus Line</div>
@ -180,21 +180,23 @@
style="width:80%">Add</button> style="width:80%">Add</button>
</div> </div>
</div> </div>
<kendo-grid [kendoGridBinding]="prodBonusLine.prodBonusSupervisors" [sortable]="true" <kendo-grid [kendoGridBinding]="prodBonusLine.prodBonusSupervisors" [sortable]="true" [style.height.%]="100"
[reorderable]="true"><!-- [resizable]="true" [pageSize]="state.take" [skip]="state.skip" [reorderable]="true"><!-- [resizable]="true" [pageSize]="state.take" [skip]="state.skip"
[sort]="state.sort" [pageable]="true" (dataStateChange)="dataStateChange($event)">--> [sort]="state.sort" [pageable]="true" (dataStateChange)="dataStateChange($event)">-->
<kendo-grid-column field="empName" title="Supervisor/Line Chief/Common Worker" [width]="170">
<kendo-grid-column field="empName" title="Supervisor/Line Chief/Common Worker"
width="40%">
<!-- <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <!-- <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
</ng-template> --> </ng-template> -->
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-column field="bonusPercent" title="Bonus Percent" width="30%"> <kendo-grid-column field="employeeNo" title="Employee No" [width]="120">
<!-- <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
</ng-template> -->
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-column title="Actions" width="30%"> <kendo-grid-column field="bonusPercent" title="Bonus Percent" [width]="100">
</kendo-grid-column>
<kendo-grid-column title="Actions" [width]="200">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button type="button" kendoButton icon="delete" class="kt-delete" <button type="button" kendoButton icon="delete" class="kt-delete"
style="width: 40%;" (click)="onClickRemoveSupervisors(dataItem)">Remove</button> style="width: fit-content;" (click)="onClickRemoveSupervisors(dataItem)">Remove</button>
</ng-template> </ng-template>
</kendo-grid-column> </kendo-grid-column>
</kendo-grid> </kendo-grid>
@ -203,7 +205,7 @@
<kendo-grid [kendoGridBinding]="prodBonusLine.prodBonusWorkSchedules" [pageable]="true" <kendo-grid [kendoGridBinding]="prodBonusLine.prodBonusWorkSchedules" [pageable]="true"
[sortable]="true" [reorderable]="true" [resizable]="true"> [sortable]="true" [reorderable]="true" [resizable]="true">
<kendo-grid-column field="startDateTime" title="Date" width="100"> <kendo-grid-column field="startDateTime" title="Date" [width]="120">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
{{dataItem.startDateTime | date: 'dd MMMM yyyy'}} {{dataItem.startDateTime | date: 'dd MMMM yyyy'}}
</ng-template> </ng-template>

View File

@ -198,7 +198,7 @@ export class ProductionBonusSetupComponent implements OnInit {
(resp) => { (resp) => {
this.productionBonusSetup = resp; this.productionBonusSetup = resp;
debugger; debugger;
console.log(this.productionBonusSetup); // console.log(this.productionBonusSetup);
this.selectedBonusType = { this.selectedBonusType = {
value: this.productionBonusSetup.productionBonusType, value: this.productionBonusSetup.productionBonusType,
label: EnumProductionBonusType[this.productionBonusSetup.productionBonusType] label: EnumProductionBonusType[this.productionBonusSetup.productionBonusType]
@ -283,7 +283,7 @@ export class ProductionBonusSetupComponent implements OnInit {
return this.notificationService.showWarning('Please select Bonus Type'); return this.notificationService.showWarning('Please select Bonus Type');
} }
this.saveProductionBonusSetup(); this.saveProductionBonusSetup();
console.log(this.productionBonusSetup); // console.log(this.productionBonusSetup);
debugger; debugger;
if (this.productionBonusSetup.designNo === '' || this.productionBonusSetup.programName === '' || this.productionBonusSetup.fromDate === undefined || if (this.productionBonusSetup.designNo === '' || this.productionBonusSetup.programName === '' || this.productionBonusSetup.fromDate === undefined ||
this.productionBonusSetup.toDate === undefined || this.productionBonusSetup.productionBonusType === null) { this.productionBonusSetup.toDate === undefined || this.productionBonusSetup.productionBonusType === null) {
@ -302,7 +302,7 @@ export class ProductionBonusSetupComponent implements OnInit {
// } // }
} }
else { //Edit Setup line else { //Edit Setup line
console.log(this.productionBonusSetup); // console.log(this.productionBonusSetup);
debugger; debugger;
this.prodBonusLine.prodBonusSupervisors = []; this.prodBonusLine.prodBonusSupervisors = [];
this.prodBonusLine.prodBonusWorkSchedules = []; this.prodBonusLine.prodBonusWorkSchedules = [];
@ -332,7 +332,7 @@ export class ProductionBonusSetupComponent implements OnInit {
onCellClickEdit(dataItem: ProdBonusLine) { onCellClickEdit(dataItem: ProdBonusLine) {
console.log(dataItem); // console.log(dataItem);
this.isNewLine = false; this.isNewLine = false;
this.prodBonusLine = new ProdBonusLine(); this.prodBonusLine = new ProdBonusLine();
debugger; debugger;
@ -521,7 +521,7 @@ export class ProductionBonusSetupComponent implements OnInit {
onClickSubmit() { onClickSubmit() {
debugger; debugger;
this.saveProductionBonusSetup(); this.saveProductionBonusSetup();
console.log(this.productionBonusSetup); // console.log(this.productionBonusSetup);
if (this.productionBonusSetup.designNo === '' || this.productionBonusSetup.programName === '' || this.productionBonusSetup.fromDate === undefined || if (this.productionBonusSetup.designNo === '' || this.productionBonusSetup.programName === '' || this.productionBonusSetup.fromDate === undefined ||
this.productionBonusSetup.toDate === undefined || this.productionBonusSetup.productionBonusType === null) { this.productionBonusSetup.toDate === undefined || this.productionBonusSetup.productionBonusType === null) {
this.notificationService.showWarning('Please fill up the information of production bonus setup'); this.notificationService.showWarning('Please fill up the information of production bonus setup');
@ -530,12 +530,12 @@ export class ProductionBonusSetupComponent implements OnInit {
this.loadingPanelService.ShowLoadingPanel = true; this.loadingPanelService.ShowLoadingPanel = true;
this.bonusService.saveProductionBonusSetup(this.productionBonusSetup).subscribe( this.bonusService.saveProductionBonusSetup(this.productionBonusSetup).subscribe(
(resp) => { (resp) => {
console.log(resp); // console.log(resp);
}, },
(err) => { (err) => {
this.loadingPanelService.ShowLoadingPanel = false; this.loadingPanelService.ShowLoadingPanel = false;
this.notificationService.showError(err.error); this.notificationService.showError(err.error);
console.log(err.error); // console.log(err.error);
}, },
() => { () => {
this.clearFields(); this.clearFields();
@ -545,8 +545,8 @@ export class ProductionBonusSetupComponent implements OnInit {
); );
} }
onClickRemove(data: any) { onClickRemove(data: any) {
console.log(this.productionBonusSetup.productionBonusLines); // console.log(this.productionBonusSetup.productionBonusLines);
console.log(data); // console.log(data);
debugger; debugger;
const index = this.productionBonusSetup.productionBonusLines.findIndex(item => item.id === data.id); const index = this.productionBonusSetup.productionBonusLines.findIndex(item => item.id === data.id);
// const indexAttn = this.prodBonusAttn.findIndex(item => item['employeeID'] === data.id); // const indexAttn = this.prodBonusAttn.findIndex(item => item['employeeID'] === data.id);

View File

@ -2786,5 +2786,22 @@ namespace HRM.UI.Controllers
return Ok(); return Ok();
} }
[HttpGet("getAllEmployeeNameAndNo")]
public ActionResult getAllEmployeeNameAndNo()
{
DataTable dt = new DataTable();
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
try
{
dt = new EmployeeService().GetEmployeeNameAndNo((int)currentUser.PayrollTypeID);
}
catch (Exception ex)
{
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
}
return Ok(dt);
}
} }
} }

View File

@ -475,8 +475,8 @@ namespace HRM.UI.Controllers.Payroll
{ {
oEmp = new EmployeeService().Get(prodSupervisor.EmployeeID); oEmp = new EmployeeService().Get(prodSupervisor.EmployeeID);
prodSupervisor.empName = oEmp.Name; prodSupervisor.EmpName = oEmp.Name;
prodSupervisor.employeeNo = oEmp.EmployeeNo; prodSupervisor.EmployeeNo = oEmp.EmployeeNo;
} }
prodLine.ProdBonusParameters = _prodBonusParameterService.GetByLineID(prodLine.ID); prodLine.ProdBonusParameters = _prodBonusParameterService.GetByLineID(prodLine.ID);