Compare commits
No commits in common. "ba4cdaf6b9f3db292ff4f3e3a29a7e86f7f229d9" and "785e9c24ff6c6b371c6e2574cd33f3ecec0f06bd" have entirely different histories.
ba4cdaf6b9
...
785e9c24ff
|
@ -78,10 +78,8 @@ namespace HRM.BO
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
public string devName { get; set; }
|
|
||||||
public string devParentName{ get; set; }
|
public string EmployeeNo { get; set; }
|
||||||
public string devGrantParentName{ 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; }
|
||||||
|
|
|
@ -55,20 +55,6 @@ namespace HRM.DA
|
||||||
{
|
{
|
||||||
return tc.ExecuteReader("SELECT * FROM ProdBonusWorkSchedule where ProdBonusSetupID=%n", nSetupID);
|
return tc.ExecuteReader("SELECT * FROM ProdBonusWorkSchedule where ProdBonusSetupID=%n", nSetupID);
|
||||||
}
|
}
|
||||||
internal static DataTable GetschedulewithTime(TransactionContext tc, int lineID)
|
|
||||||
{
|
|
||||||
return tc.ExecuteDataTable(@"select a.*,bb.scheduleCount , (select max(ps.InTime) from ProdBonusAttn ps where ps.ProdBonusLineID =%n
|
|
||||||
and DATEADD(dd, 0, DATEDIFF(dd, 0, ps.InTime)) = bb.scheduleDate) as inTime,
|
|
||||||
(select max(ps.OutTime) from ProdBonusAttn ps where ps.ProdBonusLineID =%n
|
|
||||||
and DATEADD(dd, 0, DATEDIFF(dd, 0, ps.InTime)) = bb.scheduleDate) as outTime from
|
|
||||||
(SELECT * FROM ProdBonusWorkSchedule where ProdBonusLineID=%n) a,
|
|
||||||
(
|
|
||||||
select DATEADD(dd, 0, DATEDIFF(dd, 0, InTime)) scheduleDate,COUNT(*) scheduleCount from ProdBonusAttn where
|
|
||||||
ProdBonusLineID =%n group by DATEADD(dd, 0, DATEDIFF(dd, 0, InTime))
|
|
||||||
) bb
|
|
||||||
where bb.scheduleDate = DATEADD(dd, 0, DATEDIFF(dd, 0, a.StartDateTime)) ", lineID, lineID, lineID, lineID);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
internal static IDataReader GetByLineID(TransactionContext tc, int lineID)
|
internal static IDataReader GetByLineID(TransactionContext tc, int lineID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,10 +23,10 @@ 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, MaxPerson, CreatedBy, CreationDate, Status,ProductionBonusType)" +
|
"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, %n, %d, %n,%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.MaxPerson, item.CreatedBy, item.CreatedDate,
|
item.SalaryMonth, item.DesignNo, item.FromDate, item.ToDate, item.MaxPerson, item.CreatedBy, item.CreatedDate,
|
||||||
item.Status, (int)item.ProductionBonusType);
|
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, MaxPerson=%n, Status=%n,ProductionBonusType=%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.MaxPerson, item.Status,(int)item.ProductionBonusType, item.ID);
|
item.FromDate, item.ToDate, item.MaxPerson, item.Status, item.ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -129,31 +129,6 @@ namespace HRM.DA
|
||||||
|
|
||||||
return ProdBonusWorkSchedules;
|
return ProdBonusWorkSchedules;
|
||||||
}
|
}
|
||||||
|
|
||||||
public DataTable GetschedulewithTime(int lineid)
|
|
||||||
{
|
|
||||||
DataTable items = null;
|
|
||||||
TransactionContext tc = null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
tc = TransactionContext.Begin();
|
|
||||||
items = ProdBonusWorkScheduleDA.GetschedulewithTime(tc, lineid);
|
|
||||||
tc.End();
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
#region Handle Exception
|
|
||||||
|
|
||||||
if (tc != null)
|
|
||||||
tc.HandleError();
|
|
||||||
ExceptionLog.Write(e);
|
|
||||||
throw new ServiceException(e.Message, e);
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
|
|
||||||
return items;
|
|
||||||
}
|
|
||||||
public List<ProdBonusWorkSchedule> GetWithSetupID(int nSetupID)
|
public List<ProdBonusWorkSchedule> GetWithSetupID(int nSetupID)
|
||||||
{
|
{
|
||||||
List<ProdBonusWorkSchedule> ProdBonusWorkSchedules = null;
|
List<ProdBonusWorkSchedule> ProdBonusWorkSchedules = null;
|
||||||
|
|
|
@ -11,9 +11,7 @@ export class ProdBonusSupervisor {
|
||||||
employeeNo:string; // view purpose
|
employeeNo:string; // view purpose
|
||||||
empName:string; // view purpose
|
empName:string; // view purpose
|
||||||
// employee: Employee;
|
// employee: Employee;
|
||||||
devName: string;
|
|
||||||
devParentName: string;
|
|
||||||
devGrantParentName: string;
|
|
||||||
constructor() {
|
constructor() {
|
||||||
// super();
|
// super();
|
||||||
this.id = 0;
|
this.id = 0;
|
||||||
|
@ -26,4 +24,4 @@ export class ProdBonusSupervisor {
|
||||||
this.empName =''; // view purpose
|
this.empName =''; // view purpose
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,8 +7,6 @@ var ProdBonusWorkSchedule = /** @class */ (function () {
|
||||||
this.prodBonusLineID = 0;
|
this.prodBonusLineID = 0;
|
||||||
this.startDateTime = new Date();
|
this.startDateTime = new Date();
|
||||||
this.endDateTime = new Date();
|
this.endDateTime = new Date();
|
||||||
this.inTime = undefined;
|
|
||||||
this.outTime = undefined;
|
|
||||||
}
|
}
|
||||||
return ProdBonusWorkSchedule;
|
return ProdBonusWorkSchedule;
|
||||||
}());
|
}());
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
{"version":3,"file":"prodBonusWorkSchedule.js","sourceRoot":"","sources":["prodBonusWorkSchedule.ts"],"names":[],"mappings":";;;AAEA;IASI;QACI,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,IAAI,IAAI,EAAE,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC7B,CAAC;IACL,4BAAC;AAAD,CAAC,AAjBD,IAiBC;AAjBY,sDAAqB"}
|
{"version":3,"file":"prodBonusWorkSchedule.js","sourceRoot":"","sources":["prodBonusWorkSchedule.ts"],"names":[],"mappings":";;;AAEA;IAOI;QACI,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,aAAa,GAAG,IAAI,IAAI,EAAE,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC;IAClC,CAAC;IACL,4BAAC;AAAD,CAAC,AAbD,IAaC;AAbY,sDAAqB"}
|
|
@ -6,15 +6,11 @@ export class ProdBonusWorkSchedule{
|
||||||
prodBonusLineID: number;
|
prodBonusLineID: number;
|
||||||
startDateTime: Date;
|
startDateTime: Date;
|
||||||
endDateTime: Date;
|
endDateTime: Date;
|
||||||
inTime?: Date;
|
|
||||||
outTime?: Date;
|
|
||||||
totalCount?: number;
|
|
||||||
constructor(){
|
constructor(){
|
||||||
this.id = 0;
|
this.id = 0;
|
||||||
this.prodBonusLineID = 0;
|
this.prodBonusLineID = 0;
|
||||||
this.startDateTime = new Date();
|
this.startDateTime = new Date();
|
||||||
this.endDateTime = new Date();
|
this.endDateTime = new Date();
|
||||||
this.inTime = undefined;
|
|
||||||
this.outTime = undefined;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -111,10 +111,6 @@ export class BonusService {
|
||||||
getLayoutDetails(setUpid: number) {
|
getLayoutDetails(setUpid: number) {
|
||||||
return this.apiService.httpGet<any>('/Bonus/getLayoutDetails/'+ setUpid);
|
return this.apiService.httpGet<any>('/Bonus/getLayoutDetails/'+ setUpid);
|
||||||
}
|
}
|
||||||
GetschedulewithTime(lineid: number) {
|
|
||||||
return this.apiService.httpGet<any>('/Bonus/GetschedulewithTime/' + lineid);
|
|
||||||
}
|
|
||||||
|
|
||||||
getLines(setupid: number) {
|
getLines(setupid: number) {
|
||||||
return this.apiService.httpGet<ProdBonusLine[]>('/Bonus/getLines/'+ setupid);
|
return this.apiService.httpGet<ProdBonusLine[]>('/Bonus/getLines/'+ setupid);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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, 10, 3))}-`+"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 = '';
|
||||||
|
|
|
@ -285,7 +285,7 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.notificationService.showWarning('Date did not match with Work Schedule','Schedule not matched!');
|
this.notificationService.showWarning('Date did not match with Work Schedule! Schedule not match');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onClickAdd() {
|
onClickAdd() {
|
||||||
|
|
|
@ -181,82 +181,50 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<kendo-grid [kendoGridBinding]="prodBonusLine.prodBonusSupervisors" [sortable]="true" [style.height.%]="100"
|
<kendo-grid [kendoGridBinding]="prodBonusLine.prodBonusSupervisors" [sortable]="true" [style.height.%]="100"
|
||||||
[reorderable]="true">
|
[reorderable]="true"><!-- [resizable]="true" [pageSize]="state.take" [skip]="state.skip"
|
||||||
<!-- [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]="150">
|
|
||||||
<!-- <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="employeeNo" title="Employee No" [width]="100">
|
<kendo-grid-column field="employeeNo" title="Employee No" [width]="120">
|
||||||
<!-- <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]="100">
|
||||||
<kendo-grid-column field="devGrantParentName" title="top Parent (section)" [width]="120">
|
|
||||||
</kendo-grid-column>
|
</kendo-grid-column>
|
||||||
<kendo-grid-column field="devParentName" title="parent (floor)" [width]="120">
|
<kendo-grid-column title="Actions" [width]="200">
|
||||||
</kendo-grid-column>
|
|
||||||
|
|
||||||
<kendo-grid-column field="devName" title="posted" [width]="120">
|
|
||||||
</kendo-grid-column>
|
|
||||||
|
|
||||||
|
|
||||||
<kendo-grid-column field="bonusPercent" title="Bonus Percent" [width]="100">
|
|
||||||
</kendo-grid-column>
|
|
||||||
<kendo-grid-column title="Actions" [width]="50">
|
|
||||||
<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: fit-content;" (click)="onClickRemoveSupervisors(dataItem)">
|
style="width: fit-content;" (click)="onClickRemoveSupervisors(dataItem)">Remove</button>
|
||||||
Remove
|
|
||||||
</button>
|
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</kendo-grid-column>
|
</kendo-grid-column>
|
||||||
</kendo-grid>
|
</kendo-grid>
|
||||||
</p-tabPanel>
|
</p-tabPanel>
|
||||||
<p-tabPanel header="Work Schedule" leftIcon="pi pi-briefcase">
|
<p-tabPanel header="Work Schedule" leftIcon="pi pi-briefcase">
|
||||||
|
<kendo-grid [kendoGridBinding]="prodBonusLine.prodBonusWorkSchedules" [pageable]="true"
|
||||||
<app-loading-panel></app-loading-panel>
|
[sortable]="true" [reorderable]="true" [resizable]="true">
|
||||||
<div class="p-grid">
|
|
||||||
<div class="p-col-12 p-lg-3 label-ailgn">
|
|
||||||
<button type="button" kendoButton class="kt-delete"
|
|
||||||
style="width: fit-content;" (click)="GetScheduleTime(dataItem)">
|
|
||||||
Load Time Schedule
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="p-col-12 p-lg-5 label-ailgn">
|
|
||||||
this will take around 30 Second or more.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<kendo-grid [kendoGridBinding]="prodBonusLine.prodBonusWorkSchedules" [pageable]="true"
|
<kendo-grid-column field="startDateTime" title="Date" [width]="120">
|
||||||
[sortable]="true" [reorderable]="true" [resizable]="true">
|
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
||||||
|
{{dataItem.startDateTime | date: 'dd MMMM yyyy'}}
|
||||||
<kendo-grid-column field="startDateTime" title="Date" [width]="120">
|
</ng-template>
|
||||||
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
</kendo-grid-column>
|
||||||
{{dataItem.startDateTime | date: 'dd MMMM yyyy'}}
|
|
||||||
</ng-template>
|
<!-- <kendo-grid-column field="startDateTime" title="Start Time" width="100">
|
||||||
</kendo-grid-column>
|
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
||||||
|
{{dataItem.startDateTime | date: 'hh:mm a'}}
|
||||||
<kendo-grid-column field="inTime" title="Start Time" width="100">
|
</ng-template>
|
||||||
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
</kendo-grid-column>
|
||||||
{{dataItem?.inTime | date: 'hh:mm'}}
|
|
||||||
</ng-template>
|
<kendo-grid-column field="endDateTime" title="End Time" width="100">
|
||||||
</kendo-grid-column>
|
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
||||||
|
{{dataItem.endDateTime | date: 'hh:mm a'}}
|
||||||
<kendo-grid-column field="outTime" title="End Time" width="100">
|
</ng-template>
|
||||||
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
</kendo-grid-column> -->
|
||||||
{{dataItem?.outTime | date: 'hh:mm'}}
|
</kendo-grid>
|
||||||
</ng-template>
|
</p-tabPanel>
|
||||||
</kendo-grid-column>
|
</p-tabView>
|
||||||
<kendo-grid-column field="totalCount" title="Count" width="100">
|
|
||||||
<!--<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
|
||||||
{{dataItem.endDateTime | date: 'hh:mm a'}}
|
|
||||||
</ng-template>-->
|
|
||||||
</kendo-grid-column>
|
|
||||||
</kendo-grid>
|
|
||||||
</p-tabPanel>
|
|
||||||
</p-tabView>
|
|
||||||
</div>
|
</div>
|
||||||
</kendo-dialog-content>
|
</kendo-dialog-content>
|
||||||
<kendo-dialog-actions>
|
<kendo-dialog-actions>
|
||||||
|
@ -270,4 +238,4 @@
|
||||||
</kendo-dialog>
|
</kendo-dialog>
|
||||||
</div>
|
</div>
|
||||||
</p-panel>
|
</p-panel>
|
||||||
</div>
|
</div>
|
|
@ -28,7 +28,6 @@ import { numberSymbols } from '@progress/kendo-angular-intl';
|
||||||
import { process, State } from '@progress/kendo-data-query';
|
import { process, State } from '@progress/kendo-data-query';
|
||||||
import { DataStateChangeEvent } from '@progress/kendo-angular-grid';
|
import { DataStateChangeEvent } from '@progress/kendo-angular-grid';
|
||||||
import { noUndefined } from '@angular/compiler/src/util';
|
import { noUndefined } from '@angular/compiler/src/util';
|
||||||
import { EnumStatus } from '../../_models/enums';
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,8 +70,7 @@ export class ProductionBonusSetupComponent implements OnInit {
|
||||||
prodBonusSupervisor: ProdBonusSupervisor;
|
prodBonusSupervisor: ProdBonusSupervisor;
|
||||||
prodBonusParameter: ProdBonusParameter;
|
prodBonusParameter: ProdBonusParameter;
|
||||||
|
|
||||||
prodBonusAttn: ProdBonusAttn[];
|
prodBonusAttn: ProdBonusAttn[];
|
||||||
depts: Department[] = [];
|
|
||||||
layoutNo: string;
|
layoutNo: string;
|
||||||
// programName: string;
|
// programName: string;
|
||||||
// maxPerson: number;
|
// maxPerson: number;
|
||||||
|
@ -106,7 +104,7 @@ export class ProductionBonusSetupComponent implements OnInit {
|
||||||
department: Department;
|
department: Department;
|
||||||
|
|
||||||
selectedRow: any;
|
selectedRow: any;
|
||||||
scheduleTime: any;
|
|
||||||
|
|
||||||
|
|
||||||
editDetails: boolean = false;
|
editDetails: boolean = false;
|
||||||
|
@ -125,39 +123,37 @@ export class ProductionBonusSetupComponent implements OnInit {
|
||||||
this.prodBonusSupervisor = new ProdBonusSupervisor();
|
this.prodBonusSupervisor = new ProdBonusSupervisor();
|
||||||
this.prodBonusParameter = new ProdBonusParameter();
|
this.prodBonusParameter = new ProdBonusParameter();
|
||||||
this.prodBonusWork = new ProdBonusWorkSchedule();
|
this.prodBonusWork = new ProdBonusWorkSchedule();
|
||||||
this.getBonusType();
|
this.getBonusType();
|
||||||
|
// this.createForm();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OnclickCheckbox() {
|
OnclickCheckbox() {
|
||||||
debugger;
|
debugger;
|
||||||
if (this.isNewLayout === false) {
|
if (this.isNewLayout === false) {
|
||||||
this.isNewLayout = true;
|
this.isNewLayout = true;
|
||||||
this.productionBonusSetup = new ProductionBonusSetup();
|
this.productionBonusSetup = new ProductionBonusSetup();
|
||||||
this.prodBonusLine = new ProdBonusLine();
|
this.prodBonusLine = new ProdBonusLine();
|
||||||
this.prodBonusSupervisor = new ProdBonusSupervisor();
|
this.prodBonusSupervisor = new ProdBonusSupervisor();
|
||||||
this.prodBonusParameter = new ProdBonusParameter();
|
this.prodBonusParameter = new ProdBonusParameter();
|
||||||
this.prodBonusWork = new ProdBonusWorkSchedule();
|
this.prodBonusWork = new ProdBonusWorkSchedule();
|
||||||
this.productionBonusSetup.fromDate = new Date();
|
this.productionBonusSetup.fromDate = new Date();
|
||||||
this.productionBonusSetup.toDate = new Date();
|
this.productionBonusSetup.toDate = new Date();
|
||||||
}
|
|
||||||
else {
|
|
||||||
this.isNewLayout = false;
|
|
||||||
this.productionBonusSetup.fromDate = undefined;
|
|
||||||
this.productionBonusSetup.toDate = undefined;
|
|
||||||
|
|
||||||
}
|
|
||||||
this.prodBSdata = undefined;
|
|
||||||
this.filteredProdBSdata = undefined;
|
|
||||||
this.selectedProdBSdata = undefined;
|
|
||||||
this.selectedBonusType = {
|
|
||||||
label: 'Select Bonus Type...',
|
|
||||||
value: null
|
|
||||||
}
|
|
||||||
this.editDetails = false;
|
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
this.isNewLayout = false;
|
||||||
|
this.productionBonusSetup.fromDate = undefined;
|
||||||
|
this.productionBonusSetup.toDate = undefined;
|
||||||
|
|
||||||
|
}
|
||||||
|
this.prodBSdata = undefined;
|
||||||
|
this.filteredProdBSdata = undefined;
|
||||||
|
this.selectedProdBSdata = undefined;
|
||||||
|
this.selectedBonusType = {
|
||||||
|
label: 'Select Bonus Type...',
|
||||||
|
value: null
|
||||||
|
}
|
||||||
|
this.editDetails = false;
|
||||||
|
}
|
||||||
|
|
||||||
handleFilter(value) {
|
handleFilter(value) {
|
||||||
this.filteredProdBSdata = this.prodBSdata.filter(
|
this.filteredProdBSdata = this.prodBSdata.filter(
|
||||||
|
@ -272,97 +268,74 @@ export class ProductionBonusSetupComponent implements OnInit {
|
||||||
this.bonusPercent = 0;
|
this.bonusPercent = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
onClickAddLine(): void {
|
onClickAddLine(): void {
|
||||||
debugger;
|
debugger;
|
||||||
// this.onEdit = false;
|
// this.onEdit = false;
|
||||||
this.isNewLine = true;
|
this.isNewLine = true;
|
||||||
this.selectedRow = new ProdBonusLine();
|
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();
|
||||||
if (this.isNewLayout) {//Add Setup line
|
if (this.isNewLayout) {//Add Setup line
|
||||||
|
|
||||||
if (this.selectedBonusType === undefined || this.selectedBonusType === null) {
|
if (this.selectedBonusType === undefined || this.selectedBonusType === null) {
|
||||||
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) {
|
||||||
this.notificationService.showWarning('Please fill up the information of production bonus setup');
|
this.notificationService.showWarning('Please fill up the information of production bonus setup');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.prodBonusLine.prodBonusSupervisors = [];
|
|
||||||
this.prodBonusLine.prodBonusWorkSchedules = [];
|
|
||||||
|
|
||||||
// console.log(this.prodBonusLine);
|
|
||||||
|
|
||||||
// for (let j = 0; j < this.productionBonusSetup.productionBonusLines.length; j++) {
|
|
||||||
// for (let i = 0; i < this.productionBonusSetup.productionBonusLines[i].prodBonusSupervisors.length; i++)
|
|
||||||
// this.prodBonusLine.prodBonusSupervisors = this.productionBonusSetup.productionBonusLines[i].prodBonusSupervisors;
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
else { //Edit Setup line
|
|
||||||
// console.log(this.productionBonusSetup);
|
|
||||||
debugger;
|
|
||||||
this.prodBonusLine.prodBonusSupervisors = [];
|
|
||||||
this.prodBonusLine.prodBonusWorkSchedules = [];
|
|
||||||
|
|
||||||
}
|
|
||||||
this.opened = true;
|
|
||||||
// create schedule
|
|
||||||
this.loadingPanelService.ShowLoadingPanel = true;
|
|
||||||
debugger;
|
|
||||||
if (this.prodBonusLine.id !== 0) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
this.prodBonusLine.prodBonusSupervisors = [];
|
||||||
|
this.prodBonusLine.prodBonusWorkSchedules = [];
|
||||||
|
|
||||||
|
// console.log(this.prodBonusLine);
|
||||||
|
|
||||||
|
// for (let j = 0; j < this.productionBonusSetup.productionBonusLines.length; j++) {
|
||||||
|
// for (let i = 0; i < this.productionBonusSetup.productionBonusLines[i].prodBonusSupervisors.length; i++)
|
||||||
|
// this.prodBonusLine.prodBonusSupervisors = this.productionBonusSetup.productionBonusLines[i].prodBonusSupervisors;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
else { //Edit Setup line
|
||||||
|
// console.log(this.productionBonusSetup);
|
||||||
|
debugger;
|
||||||
|
this.prodBonusLine.prodBonusSupervisors = [];
|
||||||
|
this.prodBonusLine.prodBonusWorkSchedules = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
this.opened = true;
|
||||||
|
// create schedule
|
||||||
|
this.loadingPanelService.ShowLoadingPanel = true;
|
||||||
|
debugger;
|
||||||
|
if (this.prodBonusLine.id !== 0) {
|
||||||
|
this.bonusService.getProdBonusAttenbyLineId(this.prodBonusLine.id).subscribe(
|
||||||
|
(resp) => {
|
||||||
|
this.prodBonusAttn = resp;
|
||||||
|
},
|
||||||
|
(err: any) => {
|
||||||
|
this.notificationService.showError(err.error);
|
||||||
|
this.loadingPanelService.ShowLoadingPanel = false;
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
|
||||||
GetScheduleTime(dataItem: any) {
|
this.loadingPanelService.ShowLoadingPanel = false;
|
||||||
console.log('line');
|
}
|
||||||
console.log(this.prodBonusLine.prodBonusWorkSchedules);
|
);
|
||||||
this.loadingPanelService.ShowLoadingPanel = true;
|
|
||||||
this.bonusService.GetschedulewithTime(this.prodBonusLine.prodBonusWorkSchedules[0].prodBonusLineID).subscribe(
|
|
||||||
(resp) => {
|
|
||||||
this.scheduleTime = resp;
|
|
||||||
},
|
|
||||||
(err: any) => {
|
|
||||||
this.notificationService.showError(err.error);
|
|
||||||
this.loadingPanelService.ShowLoadingPanel = false;
|
|
||||||
},
|
|
||||||
() => {
|
|
||||||
console.log(this.scheduleTime);
|
|
||||||
if (this.prodBonusLine.prodBonusWorkSchedules != undefined) {
|
|
||||||
var pdrs = this.prodBonusLine.prodBonusWorkSchedules;
|
|
||||||
pdrs.forEach(x => {
|
|
||||||
var item = this.scheduleTime.find(y => y.startDateTime == x.startDateTime);
|
|
||||||
if (item != undefined) {
|
|
||||||
x.inTime = new Date( item.inTime);
|
|
||||||
x.outTime = new Date( item.outTime);
|
|
||||||
x.totalCount = item.scheduleCount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
console.log(this.prodBonusLine.prodBonusWorkSchedules);
|
|
||||||
this.loadingPanelService.ShowLoadingPanel = false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
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;
|
||||||
// if (this.isNewLayout) { //ADD Line
|
// if (this.isNewLayout) { //ADD Line
|
||||||
// this.prodBonusLine.prodBonusSupervisors = [];
|
// this.prodBonusLine.prodBonusSupervisors = [];
|
||||||
// this.prodBonusLine.prodBonusWorkSchedules = [];
|
// this.prodBonusLine.prodBonusWorkSchedules = [];
|
||||||
|
@ -397,26 +370,26 @@ export class ProductionBonusSetupComponent implements OnInit {
|
||||||
this.opened = true;
|
this.opened = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
newLine() {
|
newLine() {
|
||||||
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');
|
||||||
this.close();
|
this.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (this._employee === undefined || this._employee.id === 0) {
|
if (this._employee === undefined || this._employee.id === 0) {
|
||||||
this.notificationService.showWarning('Please Select Supervisor');
|
this.notificationService.showWarning('Please Select Supervisor');
|
||||||
this.close();
|
this.close();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// if (this.scheduledHours === undefined || this.scheduledHours === 0) {
|
// if (this.scheduledHours === undefined || this.scheduledHours === 0) {
|
||||||
// this.notificationService.showWarning('Please Select Scheduled Hours');
|
// this.notificationService.showWarning('Please Select Scheduled Hours');
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
// if (this.bonusPercent === undefined || this.bonusPercent === 0) {
|
// if (this.bonusPercent === undefined || this.bonusPercent === 0) {
|
||||||
// this.notificationService.showWarning('Please Select Bonus Percentage');
|
// this.notificationService.showWarning('Please Select Bonus Percentage');
|
||||||
// return;
|
// return;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
||||||
debugger;
|
debugger;
|
||||||
|
@ -430,9 +403,9 @@ export class ProductionBonusSetupComponent implements OnInit {
|
||||||
}
|
}
|
||||||
// this.isNewLine = true;
|
// this.isNewLine = true;
|
||||||
|
|
||||||
var newlineSupervisor: ProdBonusSupervisor = new ProdBonusSupervisor();
|
var newlineSupervisor: ProdBonusSupervisor = new ProdBonusSupervisor();
|
||||||
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);
|
const index = this.prodBonusLine.prodBonusSupervisors.findIndex(sv => sv.employeeID == this._employee.id);
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
|
@ -445,10 +418,10 @@ 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;
|
||||||
newlineParameter.prodBonusSetupID = this.productionBonusSetup.id;
|
newlineParameter.prodBonusSetupID = this.productionBonusSetup.id;
|
||||||
|
|
||||||
// var department;
|
// var department;
|
||||||
this.basicService.getDepartmentByID(this._departmentPicker.selectedID).subscribe(
|
this.basicService.getDepartmentByID(this._departmentPicker.selectedID).subscribe(
|
||||||
|
@ -508,13 +481,13 @@ export class ProductionBonusSetupComponent implements OnInit {
|
||||||
// this.prodBonusLine.prodBonusParameters.push(newlineParameter);
|
// this.prodBonusLine.prodBonusParameters.push(newlineParameter);
|
||||||
|
|
||||||
|
|
||||||
// console.log(this.prodBonusLine);
|
// console.log(this.prodBonusLine);
|
||||||
this.clearProdbonusLine();
|
this.clearProdbonusLine();
|
||||||
// this.notificationService.showSuccess('Supervisor added to the line');
|
// this.notificationService.showSuccess('Supervisor added to the line');
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
saveProductionBonusSetup(): void {
|
saveProductionBonusSetup(): void {
|
||||||
this.productionBonusSetup.salaryMonth = this.selectedSalaryDate;
|
this.productionBonusSetup.salaryMonth = this.selectedSalaryDate;
|
||||||
if (this.isNewLayout)
|
if (this.isNewLayout)
|
||||||
|
|
|
@ -22,7 +22,6 @@ using NPOI.SS.Formula.Eval;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using Payroll.BO;
|
using Payroll.BO;
|
||||||
using Ease.Core.Model;
|
using Ease.Core.Model;
|
||||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
|
||||||
|
|
||||||
namespace HRM.UI.Controllers.Payroll
|
namespace HRM.UI.Controllers.Payroll
|
||||||
{
|
{
|
||||||
|
@ -464,7 +463,6 @@ namespace HRM.UI.Controllers.Payroll
|
||||||
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
||||||
ProductionBonusSetup item = new ProductionBonusSetup();
|
ProductionBonusSetup item = new ProductionBonusSetup();
|
||||||
//ProdBonusLine item = new ProdBonusLine();
|
//ProdBonusLine item = new ProdBonusLine();
|
||||||
List<Department> detps = new DepartmentService().Get(EnumStatus.Regardless, (int)currentUser.PayrollTypeID);
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
item = _productionBonusSetupService.Get(ID);
|
item = _productionBonusSetupService.Get(ID);
|
||||||
|
@ -476,33 +474,7 @@ namespace HRM.UI.Controllers.Payroll
|
||||||
foreach (ProdBonusSupervisor prodSupervisor in prodLine.ProdBonusSupervisors)
|
foreach (ProdBonusSupervisor prodSupervisor in prodLine.ProdBonusSupervisors)
|
||||||
{
|
{
|
||||||
oEmp = new EmployeeService().Get(prodSupervisor.EmployeeID);
|
oEmp = new EmployeeService().Get(prodSupervisor.EmployeeID);
|
||||||
if (oEmp.DepartmentID != null)
|
|
||||||
{
|
|
||||||
|
|
||||||
var dev = detps.FirstOrDefault(x => x.ID == oEmp.DepartmentID);
|
|
||||||
prodSupervisor.devName = dev.Name;
|
|
||||||
if(dev.ParentsID !=null)
|
|
||||||
{
|
|
||||||
var pr = detps.FirstOrDefault(x => x.ID == dev.ParentID);
|
|
||||||
if (pr != null)
|
|
||||||
{
|
|
||||||
prodSupervisor.devParentName = pr.Name;
|
|
||||||
|
|
||||||
if (pr.ParentsID != null)
|
|
||||||
{
|
|
||||||
var gpr = detps.FirstOrDefault(x => x.ID == pr.ParentID);
|
|
||||||
if (gpr != null)
|
|
||||||
{
|
|
||||||
prodSupervisor.devGrantParentName = gpr.Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
prodSupervisor.EmpName = oEmp.Name;
|
prodSupervisor.EmpName = oEmp.Name;
|
||||||
prodSupervisor.EmployeeNo = oEmp.EmployeeNo;
|
prodSupervisor.EmployeeNo = oEmp.EmployeeNo;
|
||||||
|
|
||||||
|
@ -524,25 +496,6 @@ namespace HRM.UI.Controllers.Payroll
|
||||||
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Ok(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
[HttpGet("GetschedulewithTime/{lineid}")]
|
|
||||||
public ActionResult GetschedulewithTime(int lineid)
|
|
||||||
{
|
|
||||||
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
|
||||||
DataTable item =null;
|
|
||||||
try
|
|
||||||
{
|
|
||||||
item = new ProdBonusWorkScheduleService().GetschedulewithTime(lineid);
|
|
||||||
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok(item);
|
return Ok(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user