Compare commits

...

4 Commits

6 changed files with 120 additions and 65 deletions

View File

@ -662,7 +662,8 @@ namespace HRM.DA
foreach (ProductionBonusSetup oProductionBonusSetup in _oProductionBonusSetups) foreach (ProductionBonusSetup oProductionBonusSetup in _oProductionBonusSetups)
{ {
//if (oProductionBonusSetup.ID != 12583)
//{ continue; }
prodAttn = prodAttns.Where(x => x.ProdBonusSetupID == oProductionBonusSetup.ID).ToList();//ToObjectsTemplate(); prodAttn = prodAttns.Where(x => x.ProdBonusSetupID == oProductionBonusSetup.ID).ToList();//ToObjectsTemplate();
ProdBonusProcessItem oProcessItem = null; ProdBonusProcessItem oProcessItem = null;
foreach (ProdBonusLine oLine in oProductionBonusSetup.ProductionBonusLinesNew) foreach (ProdBonusLine oLine in oProductionBonusSetup.ProductionBonusLinesNew)
@ -689,7 +690,8 @@ namespace HRM.DA
} }
} }
//if (item.Key == 2991)
//{ }
bool isSuperVisor = allProdBonusSupervisors.FindIndex(x => x.EmployeeID == item.Key bool isSuperVisor = allProdBonusSupervisors.FindIndex(x => x.EmployeeID == item.Key
&& x.ProdBonusLineID == oLine.ID) == -1 ? false : true; && x.ProdBonusLineID == oLine.ID) == -1 ? false : true;

View File

@ -334,7 +334,8 @@ namespace HRM.Report
List<Shift> oShifts = new ShiftService().GetAllShift(); List<Shift> oShifts = new ShiftService().GetAllShift();
Shift oShift = null; Shift oShift = null;
DateTime? bonusIntime = DateTime.MinValue;
DateTime? bonusOuttime = DateTime.MinValue;
List<ProdBonusAttn> prodAttn = new ProdBonusAttnService().GetBySetupID(designId); List<ProdBonusAttn> prodAttn = new ProdBonusAttnService().GetBySetupID(designId);
string empIds = string.Empty; string empIds = string.Empty;
empIds = prodAttn.Select(x => x.EmployeeID).Distinct().Aggregate(new StringBuilder(), (sb, empid) => sb.Append(empid + ","), sb => sb.ToString().Trim(',')); empIds = prodAttn.Select(x => x.EmployeeID).Distinct().Aggregate(new StringBuilder(), (sb, empid) => sb.Append(empid + ","), sb => sb.ToString().Trim(','));
@ -362,6 +363,7 @@ namespace HRM.Report
double hour = 0; double hour = 0;
foreach (ProdBonusAttn tAtt in tempAttn) foreach (ProdBonusAttn tAtt in tempAttn)
{ {
DailyAttnProcess dailyAtt = oDailyAttnProsess.FirstOrDefault(o => o.AttnDate.Date == tAtt.InTime.Date && DailyAttnProcess dailyAtt = oDailyAttnProsess.FirstOrDefault(o => o.AttnDate.Date == tAtt.InTime.Date &&
o.EmployeeID == item.ID && o.EmployeeID == item.ID &&
(o.AttenType == EnumAttendanceType.Present || (o.AttenType == EnumAttendanceType.Present ||
@ -370,20 +372,36 @@ namespace HRM.Report
o.AttenType == EnumAttendanceType.Early || o.AttenType == EnumAttendanceType.Early ||
o.AttenType == EnumAttendanceType.Late || o.AttenType == EnumAttendanceType.Late ||
o.AttenType == EnumAttendanceType.OutSideDuty)); o.AttenType == EnumAttendanceType.OutSideDuty));
double wh = 0; double wh = 0;
if (dailyAtt != null) if (dailyAtt != null)
{ {
if (dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue) if (dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue)
{ {
bonusIntime = dailyAtt.InTime;
bonusOuttime = dailyAtt.OutTime;
oShift = oShifts.FirstOrDefault(x => x.ID == dailyAtt.ShiftID); oShift = oShifts.FirstOrDefault(x => x.ID == dailyAtt.ShiftID);
if (design.FromDate.Date == dailyAtt.AttnDate.Date) //if (design.FromDate.Date == dailyAtt.AttnDate.Date)
dailyAtt.InTime = design.FromDate > dailyAtt.InTime ? design.FromDate : dailyAtt.InTime; // dailyAtt.InTime = design.FromDate > dailyAtt.InTime ? design.FromDate : dailyAtt.InTime;
else if (design.ToDate.Date == dailyAtt.AttnDate.Date) //else if (design.ToDate.Date == dailyAtt.AttnDate.Date)
dailyAtt.OutTime = design.ToDate < dailyAtt.OutTime ? design.ToDate : dailyAtt.OutTime; // dailyAtt.OutTime = design.ToDate < dailyAtt.OutTime ? design.ToDate : dailyAtt.OutTime;
else if (oShift != null && dailyAtt.InTime.Value.TimeOfDay < oShift.InTime.TimeOfDay) //else if (oShift != null && dailyAtt.InTime.Value.TimeOfDay < oShift.InTime.TimeOfDay)
dailyAtt.InTime = dailyAtt.InTime.Value.Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute); // dailyAtt.InTime = dailyAtt.InTime.Value.Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute);
TimeSpan ts = dailyAtt.OutTime.Value - dailyAtt.InTime.Value; if (design.FromDate.Date == dailyAtt.AttnDate.Date)
bonusIntime = design.FromDate > dailyAtt.InTime ? design.FromDate : dailyAtt.InTime;
else if (dailyAtt.InTime.GetValueOrDefault().TimeOfDay < tAtt.InTime.TimeOfDay)
bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(tAtt.InTime.Hour).AddMinutes(tAtt.InTime.Minute);
if (design.ToDate.Date == dailyAtt.AttnDate.Date)
bonusOuttime = design.ToDate < dailyAtt.OutTime ? design.ToDate : dailyAtt.OutTime;
else if (dailyAtt.OutTime.GetValueOrDefault().TimeOfDay > tAtt.OutTime.TimeOfDay)
bonusOuttime = dailyAtt.OutTime.GetValueOrDefault().Date.AddHours(tAtt.OutTime.Hour).AddMinutes(tAtt.OutTime.Minute);
//else if (oShift != null && dailyAtt.InTime.GetValueOrDefault().TimeOfDay < oShift.InTime.TimeOfDay)
// bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute);
//TimeSpan ts = dailyAtt.OutTime.Value - dailyAtt.InTime.Value;
TimeSpan ts = (TimeSpan)(bonusOuttime - bonusIntime);
if (ts.Minutes < 16 && ts.Hours < 5) if (ts.Minutes < 16 && ts.Hours < 5)
wh = ts.Hours; wh = ts.Hours;
else if (ts.Minutes < 16) else if (ts.Minutes < 16)

View File

@ -208,9 +208,10 @@
<Paragraph> <Paragraph>
<TextRuns> <TextRuns>
<TextRun> <TextRun>
<Value>=Sum(Fields!WorkingHour.Value)</Value> <Value>=Sum(CDBL(Fields!WorkingHour.Value))</Value>
<Style> <Style>
<FontSize>8pt</FontSize> <FontSize>8pt</FontSize>
<Format>N2</Format>
</Style> </Style>
</TextRun> </TextRun>
</TextRuns> </TextRuns>
@ -245,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

@ -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"
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>
@ -101,7 +101,7 @@
<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>
@ -116,14 +116,14 @@
<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: 40%; 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: 40%;" (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>
@ -134,49 +134,48 @@
</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>
@ -194,7 +193,7 @@
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-column title="Actions" width="30%"> <kendo-grid-column title="Actions" width="30%">
<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: 40%;" (click)="onClickRemoveSupervisors(dataItem)">Remove</button>
</ng-template> </ng-template>
</kendo-grid-column> </kendo-grid-column>
@ -204,18 +203,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="100">
<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

@ -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();
@ -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,6 +496,7 @@ export class ProductionBonusSetupComponent implements OnInit {
} }
onClickOk() { onClickOk() {
debugger;
if (this.isNewLine) { if (this.isNewLine) {
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');
@ -565,4 +575,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;