Compare commits

..

9 Commits

15 changed files with 302 additions and 189 deletions

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, %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

@ -246,6 +246,12 @@
</GroupExpressions> </GroupExpressions>
</Group> </Group>
<SortExpressions> <SortExpressions>
<SortExpression>
<Value>=Year(Fields!Date.Value)</Value>
</SortExpression>
<SortExpression>
<Value>=Month(Fields!Date.Value)</Value>
</SortExpression>
<SortExpression> <SortExpression>
<Value>=Fields!Date.Value</Value> <Value>=Fields!Date.Value</Value>
</SortExpression> </SortExpression>

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

@ -13,7 +13,7 @@ export class ApiService {
public isSSO = false; public isSSO = false;
public versionDeployement = false; public versionDeployement = false;
public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2024, 7, 18))}-`+"01"; public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2024, 9, 31))}-`+"01";
public static BASE_URL = ''; public static BASE_URL = '';
public base_url = ''; public base_url = '';
// public currentLink = ''; // public currentLink = '';

View File

@ -1,4 +1,4 @@
<app-loading-panel></app-loading-panel> <app-loading-panel> </app-loading-panel>
<div class="p-grid card"> <div class="p-grid card">
<div class="p-col-6 p-md-1 label-ailgn"> <div class="p-col-6 p-md-1 label-ailgn">
<label>Design Date</label> <label>Design Date</label>
@ -85,12 +85,12 @@
<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" (click)="onClickRemoveAll()">
Remove All Remove All
</button> </button>
<kendo-grid-spacer></kendo-grid-spacer> <kendo-grid-spacer></kendo-grid-spacer>
@ -116,21 +116,21 @@
<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=" Multiple"></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=" Single"></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]="employeeSelection==='commonEmployee'" (keydown)="onKeyDown($event)" ></app-employee-picker>
<!-- [MultiSelect]="employeeSelection==='commonEmployee'"></app-employee-picker> --> <!-- [MultiSelect]="false" (keydown)="onKeyDown($event)" *ngIf="allEmps.length!=0"></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;
@ -167,6 +179,10 @@ export class ProductionBonusAttendanceComponent implements OnInit {
this.productionBonusSetup.fromDate = new Date(this.productionBonusSetup.fromDate); this.productionBonusSetup.fromDate = new Date(this.productionBonusSetup.fromDate);
this.productionBonusSetup.toDate = new Date(this.productionBonusSetup.toDate); this.productionBonusSetup.toDate = new Date(this.productionBonusSetup.toDate);
this.loadingPanelService.ShowLoadingPanel = false; this.loadingPanelService.ShowLoadingPanel = false;
this.startTime = this.setTime(this.startTime, 6, 0, 0);
this.endTime = this.setTime(this.endTime, 23, 59, 0);
this.selectedLine = undefined;
} }
) )
} }
@ -196,7 +212,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,7 +222,9 @@ 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;
this.employeeList.forEach(x => this.AddEmployeeGridData(x.id, false));
// console.log('employee List', this.employeeList); // console.log('employee List', this.employeeList);
}, },
(err) => { (err) => {
@ -252,31 +270,31 @@ export class ProductionBonusAttendanceComponent implements OnInit {
this.notificationService.showWarning('Please Select an Employee'); this.notificationService.showWarning('Please Select an Employee');
return; return;
} }
// if (this.employeeSelection === 'commonEmployee') { if (this.employeeSelection === 'commonEmployee') {
// if (this.selectedEmps !== null || this.selectedEmps !== undefined) { if (this.selectedEmps !== null || this.selectedEmps !== undefined) {
// // console.log(this.selectedEmps); // console.log(this.selectedEmps);
// // console.log(this.employeeList); // console.log(this.employeeList);
// // for (let i = 0; i < this.selectedEmps.length; i++) { // for (let i = 0; i < this.selectedEmps.length; i++) {
// // this.AddEmployeebyId(this.selectedEmps[i].employeeID);
// // }
// for (let i = 0, isNew = true; i < this.selectedEmps.length; i++, isNew = true) {
// for (let j = 0; j < this.employeeList.length; j++) {
// if (this.selectedEmps[i].employeeID == this.employeeList[j].id) {
// this.notificationService.showWarning("EmployeeNo " + this.employeeList[j].employeeNo + " Already Exists");
// isNew = false;
// break;
// }
// }
// if (isNew) {
// this.AddEmployeebyId(this.selectedEmps[i].employeeID); // this.AddEmployeebyId(this.selectedEmps[i].employeeID);
// this.AddEmployeeGridData(this.selectedEmps[i].employeeID, true);
// } // }
for (let i = 0, isNew = true; i < this.selectedEmps.length; i++, isNew = true) {
for (let j = 0; j < this.employeeList.length; j++) {
if (this.selectedEmps[i].employeeID == this.employeeList[j].id) {
this.notificationService.showWarning("EmployeeNo " + this.employeeList[j].employeeNo + " Already Exists");
isNew = false;
break;
}
}
if (isNew) {
this.AddEmployeebyId(this.selectedEmps[i].employeeID);
this.AddEmployeeGridData(this.selectedEmps[i].employeeID, true);
}
// debugger; debugger;
// } }
// } }
// } }
// else { else {
let sid: number; let sid: number;
const emp = this.employeeList.find((e1) => e1.id === this.selectedEmps['employeeID']); const emp = this.employeeList.find((e1) => e1.id === this.selectedEmps['employeeID']);
const att = this.prodBonusAttn.find((e1) => e1.employeeID === this.selectedEmps['employeeID']); const att = this.prodBonusAttn.find((e1) => e1.employeeID === this.selectedEmps['employeeID']);
@ -304,26 +322,25 @@ export class ProductionBonusAttendanceComponent implements OnInit {
else { else {
this.notificationService.showWarning('Employee already exist ! Can\'t Add'); this.notificationService.showWarning('Employee already exist ! Can\'t Add');
} }
// } }
} }
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();
@ -336,11 +353,11 @@ export class ProductionBonusAttendanceComponent implements OnInit {
outTime: this.selectedDate, outTime: this.selectedDate,
bonusHour: 0, bonusHour: 0,
employeeID: empId, employeeID: empId,
isCommon: isCommonValue isCommon: false
}; };
this.prodBonusAttn.push(newProdBonusAttn); this.prodBonusAttn.push(newProdBonusAttn);
// console.log('emplist ' + this.employeeList.length + '\n PbAttn ' + this.prodBonusAttn.length); // console.log('emplist ' + this.employeeList.length + '\n PbAttn ' + this.prodBonusAttn.length);
this.selectedEmps = undefined; // this.selectedEmps = undefined;
} }
// GetSelectedEmployee(sremployee: SearchEmployee) { // GetSelectedEmployee(sremployee: SearchEmployee) {
// if (sremployee === undefined) { // if (sremployee === undefined) {
@ -406,7 +423,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);
@ -416,18 +432,24 @@ export class ProductionBonusAttendanceComponent implements OnInit {
this.prodBonusAttn.splice(index, 1); this.prodBonusAttn.splice(index, 1);
} }
} }
public onClickRemoveAll(){
this.employeeList = [];
this.prodBonusAttn = [];
}
clear() { public clear() {
this.productionBonusSetup = new ProductionBonusSetup(); this.productionBonusSetup = new ProductionBonusSetup();
this.employeeList = []; this.employeeList = [];
this.selectedLine = undefined; this.selectedLine = undefined;
} }
public onKeyDown(pressedKey) { public onKeyDown(pressedKey) {
if (pressedKey.key==="Enter") { debugger;
if (pressedKey.key === "Enter") {
// this.onSave(pressedKey); // this.onSave(pressedKey);
this.onClickAdd(); this.onClickAdd();
this.scrollToBottom(); this.scrollToBottom();
this.selectedEmps = undefined;
} }
} }
@ -443,7 +465,7 @@ export class ProductionBonusAttendanceComponent implements OnInit {
this.gridScrollableElement.scrollTop = this.gridScrollableElement.scrollHeight; this.gridScrollableElement.scrollTop = this.gridScrollableElement.scrollHeight;
} }
public setTime(date: Date, hour: number, min: number, sec: number): Date{ public setTime(date: Date, hour: number, min: number, sec: number): Date {
date.setHours(hour); date.setHours(hour);
date.setMinutes(min); date.setMinutes(min);
date.setSeconds(sec); date.setSeconds(sec);

View File

@ -1,88 +1,88 @@
<app-loading-panel></app-loading-panel> <app-loading-panel></app-loading-panel>
<!-- <form [formGroup]="productionBonousSetupForm"> --> <!-- <form [formGroup]="productionBonousSetupForm"> -->
<div class="p-grid card"> <div class="p-grid card">
<div class="p-col-1 label-ailgn"> <div class="p-col-12 p-lg-1 label-ailgn">
<input type="checkbox" kendoCheckBox id="disabled" (change)="OnclickCheckbox()" [checked]="isNewLayout" <input type="checkbox" kendoCheckBox id="disabled" (change)="OnclickCheckbox()" [checked]="isNewLayout"
style="margin-top: -3px ;" /> style="margin-top: -3px ;" />
<label style="padding-left: 1%; margin: auto;" for="disabled"> <label style="padding-left: 1%; margin: auto;" for="disabled">
New Layout</label> New Layout</label>
</div> </div>
<div class="p-col-1 label-ailgn" align="right"> <div class="p-col-12 p-lg-1 label-ailgn">
<label>Salary Month</label> <label>Salary Month</label>
</div> </div>
<div class="p-col-2"> <div class="p-col-12 p-lg-2">
<kendo-datepicker [(ngModel)]="selectedSalaryDate" [format]="'dd MMMM yyyy'" <kendo-datepicker [(ngModel)]="selectedSalaryDate" [format]="'dd MMMM yyyy'"
style="width:100%"></kendo-datepicker> style="width:100%"></kendo-datepicker>
</div> </div>
<div class="p-col-2" align="right"> <div class="p-col-12 p-lg-2">
<button icon="reload" kendoButton [primary]="true" style="width:60%" *ngIf="!isNewLayout" for="disabled" <button icon="reload" kendoButton [primary]="true" style="width: fit-content" *ngIf="!isNewLayout" for="disabled"
(click)="Loadlayout()">Refresh</button> (click)="Loadlayout()">Refresh</button>
</div> </div>
<div class="p-col-1 label-ailgn" align="right"> <div class="p-col-12 p-lg-1 label-ailgn">
<label>Layout No.</label> <label>Layout No.</label>
</div> </div>
<div class="p-col-3" align="right"> <div class="p-col-12 p-lg-3">
<kendo-dropdownlist [data]="filteredProdBSdata" [(ngModel)]="selectedProdBSdata" [filterable]="true" <kendo-dropdownlist [data]="filteredProdBSdata" [(ngModel)]="selectedProdBSdata" [filterable]="true"
textField="design" valueField="id" style="width:95%" (filterChange)="handleFilter($event)" textField="design" valueField="id" style="width:100%" (filterChange)="handleFilter($event)"
*ngIf="!isNewLayout" [defaultItem]="{ design: 'Select layout no..'}" [disabled]="prodBSdata===undefined"> *ngIf="!isNewLayout" [defaultItem]="{ design: 'Select layout no..'}" [disabled]="prodBSdata===undefined"(valueChange)="LayoutDetails()">
</kendo-dropdownlist> </kendo-dropdownlist>
<input [(ngModel)]="layoutNo" type="text" style="width:95%" pInputText *ngIf="isNewLayout"> <input [(ngModel)]="layoutNo" type="text" style="width:100%" pInputText *ngIf="isNewLayout">
</div> </div>
<div class="p-col-2" align="right"> <div class="p-col-12 p-lg-2">
<button icon="information" kendoButton [primary]="true" style="width:60%" *ngIf="selectedProdBSdata!==undefined" <!-- <button icon="information" kendoButton [primary]="true" style="width:60%" *ngIf="selectedProdBSdata!==undefined"
(click)="LayoutDetails()" [disabled]="selectedProdBSdata===undefined">Details</button> (click)="LayoutDetails()" [disabled]="selectedProdBSdata===undefined">Details</button> -->
</div> </div>
<!-- <div class="p-col-3"></div> --> <!-- <div class="p-col-12 p-lg-3"></div> -->
<kendo-card class="p-col-12 p-md-12 p-lg-12" width="100%" *ngIf="isNewLayout || editDetails" for="disabled"> <kendo-card class="p-col-12 p-lg-12 p-md-12 p-lg-12" width="100%" *ngIf="isNewLayout || editDetails" for="disabled">
<div class="p-grid"> <div class="p-grid">
<div class="p-col-1 label-ailgn"> <div class="p-col-12 p-lg-1 label-ailgn">
<label>Program Name</label> <label>Program Name</label>
</div> </div>
<div class="p-col-3"> <div class="p-col-12 p-lg-3">
<input [(ngModel)]="productionBonusSetup.programName" style="width:100%" type="text" pInputText> <input [(ngModel)]="productionBonusSetup.programName" style="width:100%" type="text" pInputText>
</div> </div>
<div class="p-col-1 label-ailgn" align="right"> <div class="p-col-12 p-lg-1 label-ailgn">
<label>Max Persons</label> <label>Max Persons</label>
</div> </div>
<div class="p-col-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-1 label-ailgn" align="right"> <div class="p-col-12 p-lg-1 label-ailgn">
<label>Achieved %</label> <label>Achieved %</label>
</div> </div>
<div class="p-col-3"> <div class="p-col-12 p-lg-3">
<kendo-numerictextbox [(ngModel)]="productionBonusSetup.achivedPercent" [decimals]="2" <kendo-numerictextbox [(ngModel)]="productionBonusSetup.achivedPercent" [decimals]="2"
style="width:100%"></kendo-numerictextbox> style="width:100%"></kendo-numerictextbox>
</div> </div>
<div class="p-col-1 label-ailgn"> <div class="p-col-12 p-lg-1 label-ailgn">
<label>Bonus Type</label> <label>Bonus Type</label>
</div> </div>
<div class="p-col-2"> <div class="p-col-12 p-lg-2">
<kendo-dropdownlist [data]="bonusType" [(ngModel)]="selectedBonusType" [textField]="'label'" <kendo-dropdownlist [data]="bonusType" [(ngModel)]="selectedBonusType" [textField]="'label'"
[defaultItem]="{ label: 'Select Bonus Type...', value: null }" [valueField]="'value'" style="width:100%"> [defaultItem]="{ label: 'Select Bonus Type...', value: null }" [valueField]="'value'" style="width:100%">
</kendo-dropdownlist> </kendo-dropdownlist>
</div> </div>
<div class="p-col-1 label-ailgn" align="right"> <div class="p-col-12 p-lg-1 label-ailgn">
<label>From Date</label> <label>From Date</label>
</div> </div>
<div class="p-col-2"> <div class="p-col-12 p-lg-2">
<kendo-datepicker [(ngModel)]="productionBonusSetup.fromDate" [format]="'dd MMMM yyyy'" <kendo-datepicker [(ngModel)]="productionBonusSetup.fromDate" [format]="'dd MMMM yyyy'"
style="width:100%"></kendo-datepicker> style="width:100%"></kendo-datepicker>
</div> </div>
<div class="p-col-1 label-ailgn" align="right"> <div class="p-col-12 p-lg-1 label-ailgn">
<label>To Date</label> <label>To Date</label>
</div> </div>
<div class="p-col-2"> <div class="p-col-12 p-lg-2">
<kendo-datepicker [(ngModel)]="productionBonusSetup.toDate" [format]="'dd MMMM yyyy'" <kendo-datepicker [(ngModel)]="productionBonusSetup.toDate" [format]="'dd MMMM yyyy'"
style="width:100%"></kendo-datepicker> style="width:100%"></kendo-datepicker>
</div> </div>
<div class="p-col-1 label-ailgn" align="right"> <div class="p-col-12 p-lg-1 label-ailgn">
<label>Bonus Hours</label> <label>Bonus Hours</label>
</div> </div>
<div class="p-col-2"> <div class="p-col-12 p-lg-2">
<kendo-numerictextbox [(ngModel)]="productionBonusSetup.otHour" [decimals]="2" <kendo-numerictextbox [(ngModel)]="productionBonusSetup.otHour" [decimals]="2"
style="width:100%"></kendo-numerictextbox> style="width:100%"></kendo-numerictextbox>
</div> </div>
@ -97,105 +97,106 @@
</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>
<button kendoButton icon="plus" [primary]="true" style="width: 10%; padding: 7px;" <button kendoButton icon="plus" [primary]="true" style="width: fit-content"
(click)="onClickAddLine()">Add (click)="onClickAddLine()">Add
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 kendoButton icon="delete" [primary]="true" 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>
<div class="p-col-12" align="right"> <div class="p-col-12 p-lg-12" align="right">
<button kendoButton icon="save" [primary]="true" style="width: 10%; padding: 7px;" (click)="onClickSubmit()">Submit</button> <button kendoButton icon="save" [primary]="true" style="width: fit-content" (click)="onClickSubmit()">Submit</button>
</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>
</kendo-dialog-titlebar> </kendo-dialog-titlebar>
<kendo-dialog-content> <kendo-dialog-content>
<app-hr-notification-list></app-hr-notification-list> <app-hr-notification-list></app-hr-notification-list>
<div class="p-col-12 p-md-12"> <div class="p-col-12 p-lg-12 p-md-12">
<div class="p-grid"> <div class="p-grid">
<div class="p-col-1 label-ailgn"> <div class="p-col-12 p-lg-1 label-ailgn">
<label>Line Name</label> <label>Line Name</label>
</div> </div>
<div class="p-col-5" *ngIf="isNewLine"> <div class="p-col-12 p-lg-5" *ngIf="isNewLine">
<app-dynamic-picker [dynamicPickerView]="_departmentPicker"></app-dynamic-picker> <app-dynamic-picker [dynamicPickerView]="_departmentPicker"></app-dynamic-picker>
</div> </div>
<div class="p-col-5" *ngIf="!isNewLine"> <div class="p-col-12 p-lg-5" *ngIf="!isNewLine">
<input [(ngModel)]="selectedRow.lineName" [readonly]="!isNewLine" type="text" <input [(ngModel)]="selectedRow.lineName" [readonly]="!isNewLine" type="text"
style="width:100%" pInputText> style="width:100%" pInputText>
</div> </div>
<div class="p-col-2"> <div class="p-col-12 p-lg-2">
</div> </div>
<div class="p-col-2 label-ailgn"> <div class="p-col-12 p-lg-2 label-ailgn">
<label>Scheduled Hours</label> <label>Scheduled Hours</label>
</div> </div>
<div class="p-col-2"> <div class="p-col-12 p-lg-2">
<kendo-numerictextbox [(ngModel)]="scheduledHours" [decimals]="2" <kendo-numerictextbox [(ngModel)]="selectedRow.scheduledHour" [decimals]="2" style="width: 100%;"(ngModelChange)="onScheduledHoursChange($event)"></kendo-numerictextbox>
[readonly]="!isNewLine" style="width: 100%;"></kendo-numerictextbox>
</div> </div>
</div> </div>
<p-tabView> <p-tabView>
<p-tabPanel header="Supervisor/Line Chief/Common Worker" leftIcon="pi pi-user"> <p-tabPanel header="Supervisor/Line Chief/Common Worker" leftIcon="pi pi-user">
<div class="p-grid"> <div class="p-grid">
<div class="p-col-3 label-ailgn"> <div class="p-col-12 p-lg-3 label-ailgn">
<label>Supervisor/Line Chief/Common Worker</label> <label>Supervisor/Line Chief/Common Worker</label>
</div> </div>
<div class="p-col-3"> <div class="p-col-12 p-lg-3">
<app-employee-picker (ItemSelected)="GetSelectedEmployee($event)" <app-employee-picker (ItemSelected)="GetSelectedEmployee($event)"
[setSelectedEmp]="_pickerSelecteEmp" [setSelectedEmp]="_pickerSelecteEmp"
[isActive]="empPickerActive"></app-employee-picker> [isActive]="empPickerActive"></app-employee-picker>
</div> </div>
<div class="p-col-2 label-ailgn" align="right"> <div class="p-col-12 p-lg-2 label-ailgn" align="right">
<label>Bonus Percent</label> <label>Bonus Percent</label>
</div> </div>
<div class="p-col-2"> <div class="p-col-12 p-lg-2">
<kendo-numerictextbox [(ngModel)]="bonusPercent" <kendo-numerictextbox [(ngModel)]="bonusPercent"
[decimals]="2"></kendo-numerictextbox> [decimals]="2"></kendo-numerictextbox>
</div> </div>
<div class="p-col-2" align="right"> <div class="p-col-12 p-lg-2" align="right">
<button icon="plus" kendoButton [primary]="true" (click)="newLine()" <button icon="plus" kendoButton [primary]="true" (click)="newLine()"
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 kendoButton icon="delete" [primary]="true" <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>
@ -204,18 +205,30 @@
<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>
</kendo-grid-column> </kendo-grid-column>
<!-- <kendo-grid-column field="startDateTime" title="Start Time" width="100">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
{{dataItem.startDateTime | date: 'hh:mm a'}}
</ng-template>
</kendo-grid-column>
<kendo-grid-column field="endDateTime" title="End Time" width="100">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
{{dataItem.endDateTime | date: 'hh:mm a'}}
</ng-template>
</kendo-grid-column> -->
</kendo-grid> </kendo-grid>
</p-tabPanel> </p-tabPanel>
</p-tabView> </p-tabView>
</div> </div>
</kendo-dialog-content> </kendo-dialog-content>
<kendo-dialog-actions> <kendo-dialog-actions>
<div class="p-col-12" align="right"> <div class="p-col-12 p-lg-12" align="right">
<button kendoButton icon="save" (click)="onClickOk()" [primary]="true" <button kendoButton icon="save" (click)="onClickOk()" [primary]="true"
style="margin: 5px; width: 15%;">Ok</button> style="margin: 5px; width: 15%;">Ok</button>
<button kendoButton icon="close" (click)="close()" [primary]="true" <button kendoButton icon="close" (click)="close()" [primary]="true"

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]
@ -272,6 +272,8 @@ export class ProductionBonusSetupComponent implements OnInit {
debugger; debugger;
// this.onEdit = false; // this.onEdit = false;
this.isNewLine = true; this.isNewLine = true;
this.selectedRow = new ProdBonusLine();
this._departmentPicker = new DynamicPicker(EnumDynamicpickerType.Department, false); this._departmentPicker = new DynamicPicker(EnumDynamicpickerType.Department, false);
this.prodBonusLine = new ProdBonusLine(); this.prodBonusLine = new ProdBonusLine();
this.prodBonusWork = new ProdBonusWorkSchedule(); this.prodBonusWork = new ProdBonusWorkSchedule();
@ -281,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) {
@ -300,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 = [];
@ -330,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;
@ -369,7 +371,6 @@ export class ProductionBonusSetupComponent implements OnInit {
} }
newLine() { newLine() {
debugger;
if ((this._departmentPicker.selectedID === undefined || this._departmentPicker.selectedID === 0) && if ((this._departmentPicker.selectedID === undefined || this._departmentPicker.selectedID === 0) &&
(this.prodBonusLine.lineName === '' || this.prodBonusLine.lineName === undefined)) { (this.prodBonusLine.lineName === '' || this.prodBonusLine.lineName === undefined)) {
this.notificationService.showWarning('Please Select a Line'); this.notificationService.showWarning('Please Select a Line');
@ -389,6 +390,13 @@ export class ProductionBonusSetupComponent implements OnInit {
// this.notificationService.showWarning('Please Select Bonus Percentage'); // this.notificationService.showWarning('Please Select Bonus Percentage');
// return; // return;
// } // }
debugger;
this._employee;
this.prodBonusLine.prodBonusSupervisors;
if (this.scheduledHours < 0 || this.bonusPercent < 0) { if (this.scheduledHours < 0 || this.bonusPercent < 0) {
this.notificationService.showWarning('Scheduled Hours and Bonus Percentage can\'t be negative'); this.notificationService.showWarning('Scheduled Hours and Bonus Percentage can\'t be negative');
return; return;
@ -399,6 +407,10 @@ export class ProductionBonusSetupComponent implements OnInit {
var newlineParameter: ProdBonusParameter = new ProdBonusParameter(); var newlineParameter: ProdBonusParameter = new ProdBonusParameter();
// var newLayoutWork: ProdBonusWorkSchedule = new ProdBonusWorkSchedule(); // var newLayoutWork: ProdBonusWorkSchedule = new ProdBonusWorkSchedule();
const index = this.prodBonusLine.prodBonusSupervisors.findIndex(sv=> sv.employeeID == this._employee.id);
if (index !== -1) {
this.prodBonusLine.prodBonusSupervisors.splice(index, 1);
}
//Supervisor //Supervisor
newlineSupervisor.employeeID = this._employee.id; newlineSupervisor.employeeID = this._employee.id;
newlineSupervisor.employeeNo = this._employee.employeeNo; newlineSupervisor.employeeNo = this._employee.employeeNo;
@ -406,8 +418,6 @@ export class ProductionBonusSetupComponent implements OnInit {
newlineSupervisor.bonusPercent = this.bonusPercent; newlineSupervisor.bonusPercent = this.bonusPercent;
newlineSupervisor.prodBonusSetupID = this.productionBonusSetup.id; newlineSupervisor.prodBonusSetupID = this.productionBonusSetup.id;
if (this.isNewLine) { if (this.isNewLine) {
newlineParameter.itemID = this._departmentPicker.selectedID; newlineParameter.itemID = this._departmentPicker.selectedID;
newlineParameter.itemType = 0; newlineParameter.itemType = 0;
@ -464,7 +474,6 @@ export class ProductionBonusSetupComponent implements OnInit {
this.prodBonusLine.id = this.selectedRow.id; this.prodBonusLine.id = this.selectedRow.id;
this.prodBonusLine.lineName = this.selectedRow.lineName; this.prodBonusLine.lineName = this.selectedRow.lineName;
this.prodBonusLine.scheduledHour = this.selectedRow.scheduledHours; this.prodBonusLine.scheduledHour = this.selectedRow.scheduledHours;
this.prodBonusLine.prodBonusSupervisors.push(newlineSupervisor); this.prodBonusLine.prodBonusSupervisors.push(newlineSupervisor);
// this.prodBonusLine.prodBonusParameters.push(newlineParameter); // this.prodBonusLine.prodBonusParameters.push(newlineParameter);
@ -487,7 +496,12 @@ export class ProductionBonusSetupComponent implements OnInit {
} }
onClickOk() { onClickOk() {
debugger;
if (this.isNewLine) { if (this.isNewLine) {
if(this._departmentPicker.selectedID == undefined){
this.notificationService.showWarning('Please Select a Line'); return;
}
this.prodBonusLine.lineName = this._departmentPicker.selectedObjects[0]['name'];
this.productionBonusSetup.productionBonusLines.push(this.prodBonusLine); // for new this.productionBonusSetup.productionBonusLines.push(this.prodBonusLine); // for new
this.notificationService.showSuccess('New Line added'); this.notificationService.showSuccess('New Line added');
} }
@ -511,7 +525,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');
@ -520,12 +534,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();
@ -535,8 +549,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);
@ -565,4 +579,10 @@ export class ProductionBonusSetupComponent implements OnInit {
this.editDetails = false; this.editDetails = false;
this.prodBSdata = undefined; this.prodBSdata = undefined;
} }
onScheduledHoursChange(value: number){
debugger;
this.prodBonusLine.scheduledHour = value;
this.scheduledHours;
this.productionBonusSetup.productionBonusLines
}
} }

View File

@ -230,6 +230,7 @@ export class ProductionBonusReportsComponent implements OnInit {
this.showDate = true; this.showDate = true;
this.showDesign = true; this.showDesign = true;
this.salaryMonth = new Date(); this.salaryMonth = new Date();
this.Loadlayout(this.salaryMonth);
} }
else { else {
this.showDate = false; this.showDate = false;

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);
@ -547,7 +547,8 @@ namespace HRM.UI.Controllers.Payroll
DateTime date = (DateTime)item["date"].ToObject<DateTime>(); DateTime date = (DateTime)item["date"].ToObject<DateTime>();
ProdBonusLine _oProdBonusLine = (ProdBonusLine)item["prodLine"].ToObject<ProdBonusLine>(); ProdBonusLine _oProdBonusLine = (ProdBonusLine)item["prodLine"].ToObject<ProdBonusLine>();
List<Employee> _oEmployees = new List<Employee>(); CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
List<Employee> _oEmployees = new EmployeeService().Get(EnumEmployeeStatus.Live, (int)currentUser.PayrollTypeID);
List<Employee> _oFinalEmployees = new List<Employee>(); List<Employee> _oFinalEmployees = new List<Employee>();
List<ProdBonusParameter> _oProdBonusParameters = new List<ProdBonusParameter>(); List<ProdBonusParameter> _oProdBonusParameters = new List<ProdBonusParameter>();
List<ProdBonusSupervisor> _oProdBonusSupervisors = new List<ProdBonusSupervisor>(); List<ProdBonusSupervisor> _oProdBonusSupervisors = new List<ProdBonusSupervisor>();