Compare commits
No commits in common. "d897acd8fe20f0cd2496882da0cf8930c7119d38" and "ce4c5d8f07c6338f0604e4c9fffaffcd60d3f51d" have entirely different histories.
d897acd8fe
...
ce4c5d8f07
|
@ -283,13 +283,12 @@ namespace HRM.BO
|
|||
|
||||
List<ProdBonusAttn> Get(int setupID, int ScheduleID);
|
||||
List<ProdBonusAttn> Get(int setupID, DateTime dateTime);
|
||||
List<ProdBonusAttn> GetBySetupLineDate(int setupID, int lineID, DateTime dateTime);
|
||||
|
||||
List<ProdBonusAttn> GetBySetupID(int iD);
|
||||
List<ProdBonusAttn> GetBySetupIDs(string iDs);
|
||||
|
||||
List<ProdBonusAttn> GetByLineID(int lineID);
|
||||
List<ProdBonusAttn> GetbySetupAndLineID(int setupID, int lineID);
|
||||
DateTime? GetMaxDate(int setupID, int lineID, DateTime date);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -78,10 +78,8 @@ namespace HRM.BO
|
|||
}
|
||||
|
||||
#endregion
|
||||
public string devName { get; set; }
|
||||
public string devParentName{ get; set; }
|
||||
public string devGrantParentName{ get; set; }
|
||||
public string EmployeeNo { get; set; }
|
||||
|
||||
public string EmployeeNo { get; set; }
|
||||
public string EmpName { get; set; }
|
||||
|
||||
//public Employee Employee { get; set; }
|
||||
|
|
|
@ -90,24 +90,7 @@ namespace HRM.DA
|
|||
return tc.ExecuteReader(sql);
|
||||
//return tc.ExecuteReader("SELECT * FROM ProdBonusAttn WHERE ProdBonusSetupID=%n AND CAST(InTime AS date)=%d", setupID, dateTime);
|
||||
}
|
||||
internal static IDataReader GetBySetupLineDate(TransactionContext tc, int setupID, int lineID, DateTime dateTime)
|
||||
{
|
||||
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 PBA.ProdBonusLineID=%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, lineID, dateTime.Year, dateTime.Month,dateTime.Day);
|
||||
return tc.ExecuteReader(sql);
|
||||
}
|
||||
|
||||
internal static DateTime? GetMaxDate(TransactionContext tc, int setupID, int lineID, DateTime date)
|
||||
{
|
||||
DateTime? value = null;
|
||||
object obj = tc.ExecuteScalar("SELECT max(intime) FROM ProdBonusAttn WHERE ProdBonusSetupID=%n AND ProdBonusLineID = %n AND OutTime < %d", setupID, lineID, date);
|
||||
|
||||
if (obj is not DBNull)
|
||||
{
|
||||
value = Convert.ToDateTime(obj);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Delete function
|
||||
|
|
|
@ -55,20 +55,6 @@ namespace HRM.DA
|
|||
{
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -159,32 +159,6 @@ namespace HRM.DA
|
|||
|
||||
return ProdBonusAttns;
|
||||
}
|
||||
public List<ProdBonusAttn> GetBySetupLineDate(int setupID, int lineID, DateTime dateTime)
|
||||
{
|
||||
|
||||
List<ProdBonusAttn> ProdBonusAttns = new List<ProdBonusAttn>();
|
||||
|
||||
TransactionContext tc = null;
|
||||
try
|
||||
{
|
||||
tc = TransactionContext.Begin();
|
||||
DataReader dr = new DataReader(ProdBonusAttnDA.GetBySetupLineDate(tc, setupID, lineID, dateTime));
|
||||
ProdBonusAttns = this.CreateObjects<ProdBonusAttn>(dr);
|
||||
dr.Close();
|
||||
tc.End();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
#region Handle Exception
|
||||
if (tc != null)
|
||||
tc.HandleError();
|
||||
ExceptionLog.Write(e);
|
||||
throw new ServiceException(e.Message, e);
|
||||
#endregion
|
||||
}
|
||||
|
||||
return ProdBonusAttns;
|
||||
}
|
||||
|
||||
public List<ProdBonusAttn> GetBySetupID(int setupID)
|
||||
{
|
||||
|
@ -321,31 +295,6 @@ namespace HRM.DA
|
|||
|
||||
return ProdBonusAttns;
|
||||
}
|
||||
public DateTime? GetMaxDate(int setupID, int lineID, DateTime date)
|
||||
{
|
||||
TransactionContext tc = null;
|
||||
try
|
||||
{
|
||||
DateTime? dateValue = null;
|
||||
|
||||
tc = TransactionContext.Begin();
|
||||
dateValue = ProdBonusAttnDA.GetMaxDate(tc, setupID, lineID, date);
|
||||
tc.End();
|
||||
|
||||
return dateValue;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
#region Handle Exception
|
||||
|
||||
if (tc != null)
|
||||
tc.HandleError();
|
||||
ExceptionLog.Write(e);
|
||||
throw new ServiceException(e.Message, e);
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
public int Save(ProdBonusAttn oProdBonusAttn)
|
||||
{
|
||||
TransactionContext tc = null;
|
||||
|
|
|
@ -717,8 +717,8 @@ namespace HRM.DA
|
|||
bonusIntime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.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 (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date)
|
||||
// bonusOuttime = oProductionBonusSetup.ToDate < dailyAtt.OutTime ? oProductionBonusSetup.ToDate : dailyAtt.OutTime;
|
||||
if (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date)
|
||||
bonusOuttime = oProductionBonusSetup.ToDate < dailyAtt.OutTime ? oProductionBonusSetup.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)
|
||||
|
@ -780,8 +780,8 @@ namespace HRM.DA
|
|||
bonusIntime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.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 (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date)
|
||||
// bonusOuttime = oProductionBonusSetup.ToDate < dailyAtt.OutTime ? oProductionBonusSetup.ToDate : dailyAtt.OutTime;
|
||||
if (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date)
|
||||
bonusOuttime = oProductionBonusSetup.ToDate < dailyAtt.OutTime ? oProductionBonusSetup.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)
|
||||
|
|
|
@ -129,31 +129,6 @@ namespace HRM.DA
|
|||
|
||||
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)
|
||||
{
|
||||
List<ProdBonusWorkSchedule> ProdBonusWorkSchedules = null;
|
||||
|
|
|
@ -393,9 +393,9 @@ namespace HRM.Report
|
|||
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;
|
||||
if (dailyAtt.OutTime.GetValueOrDefault().TimeOfDay > tAtt.OutTime.TimeOfDay)
|
||||
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);
|
||||
|
|
|
@ -40,8 +40,8 @@ namespace HRM.Report
|
|||
oDR["PARMANENTADDRESS"] = oDRow["PARMANENTADDRESS"];
|
||||
oDR["PRESENTADDRESS"] = oDRow["PRESENTADDRESS"];
|
||||
oDR["BIRTHDATE"] = Convert.ToDateTime(oDRow["BIRTHDATE"]).ToString("dd/MM/yyyy");
|
||||
//if (oDRow["PHOTO"] is not DBNull)
|
||||
// oDR["PHOTO"] = Convert.ToBase64String((byte[])oDRow["PHOTO"]);
|
||||
if (oDRow["PHOTO"] is not DBNull)
|
||||
oDR["PHOTO"] = Convert.ToBase64String((byte[])oDRow["PHOTO"]);
|
||||
oDR["NIDNO"] = oDRow["NIDNO"];
|
||||
oDR["HEIGHT"] = oDRow["HEIGHT"];
|
||||
oDR["BLOODGROUP"] = GlobalExtensions.BloodGroupToFriendlyName((EnumBloodGroup)Enum.Parse(typeof(EnumBloodGroup),
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
<None Remove="Attendence\RDLC\rptMonthlyKPI.rdlc" />
|
||||
<None Remove="RDLC\ActiveEmployeeDetail.rdlc" />
|
||||
<None Remove="RDLC\Advice.rdlc" />
|
||||
<None Remove="RDLC\AllDigitalServiceBook.rdlc" />
|
||||
<None Remove="RDLC\AllEmpTaxInfo.rdlc" />
|
||||
<None Remove="RDLC\AllMedicalClaim.rdlc" />
|
||||
<None Remove="RDLC\ApointmentLetterForStuff.rdlc" />
|
||||
|
@ -311,7 +310,6 @@
|
|||
<EmbeddedResource Include="Attendence\RDLC\MultipleJobCardSub.rdlc" />
|
||||
<EmbeddedResource Include="Attendence\RDLC\rptMonthlyKPI.rdlc" />
|
||||
<EmbeddedResource Include="RDLC\ActiveEmployeeDetail.rdlc" />
|
||||
<EmbeddedResource Include="RDLC\AllDigitalServiceBook.rdlc" />
|
||||
<EmbeddedResource Include="RDLC\AllEmpTaxInfo.rdlc" />
|
||||
<EmbeddedResource Include="RDLC\AllMedicalClaim.rdlc" />
|
||||
<EmbeddedResource Include="RDLC\ApointmentLetterForStuff.rdlc" />
|
||||
|
|
|
@ -11,9 +11,7 @@ export class ProdBonusSupervisor {
|
|||
employeeNo:string; // view purpose
|
||||
empName:string; // view purpose
|
||||
// employee: Employee;
|
||||
devName: string;
|
||||
devParentName: string;
|
||||
devGrantParentName: string;
|
||||
|
||||
constructor() {
|
||||
// super();
|
||||
this.id = 0;
|
||||
|
|
|
@ -7,8 +7,6 @@ var ProdBonusWorkSchedule = /** @class */ (function () {
|
|||
this.prodBonusLineID = 0;
|
||||
this.startDateTime = new Date();
|
||||
this.endDateTime = new Date();
|
||||
this.inTime = undefined;
|
||||
this.outTime = undefined;
|
||||
}
|
||||
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;
|
||||
startDateTime: Date;
|
||||
endDateTime: Date;
|
||||
inTime?: Date;
|
||||
outTime?: Date;
|
||||
totalCount?: number;
|
||||
|
||||
constructor(){
|
||||
this.id = 0;
|
||||
this.prodBonusLineID = 0;
|
||||
this.startDateTime = new Date();
|
||||
this.endDateTime = new Date();
|
||||
this.inTime = undefined;
|
||||
this.outTime = undefined;
|
||||
}
|
||||
}
|
|
@ -111,10 +111,6 @@ export class BonusService {
|
|||
getLayoutDetails(setUpid: number) {
|
||||
return this.apiService.httpGet<any>('/Bonus/getLayoutDetails/'+ setUpid);
|
||||
}
|
||||
GetschedulewithTime(lineid: number) {
|
||||
return this.apiService.httpGet<any>('/Bonus/GetschedulewithTime/' + lineid);
|
||||
}
|
||||
|
||||
getLines(setupid: number) {
|
||||
return this.apiService.httpGet<ProdBonusLine[]>('/Bonus/getLines/'+ setupid);
|
||||
}
|
||||
|
@ -124,9 +120,6 @@ export class BonusService {
|
|||
getProdBonusAttnEmployeeList(item: any) {
|
||||
return this.apiService.httpPost<Employee[]>('/Bonus/getProdBonusAttnEmployeeList', item);
|
||||
}
|
||||
getProdBonusAttnEmployeeListSwingAndPrinting(item: any) {
|
||||
return this.apiService.httpPost<Employee[]>('/Bonus/getProdBonusAttnEmployeeListSwingAndPrinting', item);
|
||||
}
|
||||
saveAllProdBonusAttn(item: any) {
|
||||
return this.apiService.httpPost<any[]>('/Bonus/saveAllProdBonusAttn', item);
|
||||
}
|
||||
|
|
|
@ -247,12 +247,10 @@
|
|||
</div>
|
||||
<div class="p-col-12 p-md-12 p-lg-8">
|
||||
<input [(ngModel)]="hrEmployee.nationalID" formControlName="nationalId"
|
||||
id="txtNationalId" pInputText style="width:84%" type="text">
|
||||
<!-- [readonly]="!active" -->
|
||||
id="txtNationalId" pInputText style="width:84%" type="text" [readonly]="!active">
|
||||
<button class="k-button k-primary" kendoButton icon="k-i-attachment-45 k-i-clip-45"
|
||||
style="width: 15.5%; vertical-align: bottom; padding: 16px;"
|
||||
style="width: 15.5%; vertical-align: bottom; padding: 16px;" [disabled]="!active"
|
||||
(click)="popUpAttachment('NID')"></button>
|
||||
<!-- [disabled]="!active" -->
|
||||
</div>
|
||||
<div class="p-col-12 p-md-12 p-lg-4">
|
||||
<label for="txtPassportNo">Passport No</label>
|
||||
|
|
|
@ -84,7 +84,7 @@
|
|||
</div>
|
||||
|
||||
<div class="p-col-12" align="right">
|
||||
<button icon="refresh" kendoButton [primary]="true" style="width: fit-content" (click)="onClickLoad()"
|
||||
<button icon="refresh" kendoButton [primary]="true" style="width: fit-content" (click)="onClickRefresh()"
|
||||
[disabled]="selectedProdBSdata===undefined||selectedLine===undefined||selectedDate===undefined">Load</button>
|
||||
</div>
|
||||
<div class="p-col-12">
|
||||
|
@ -94,7 +94,6 @@
|
|||
Remove All
|
||||
</button>
|
||||
<kendo-grid-spacer></kendo-grid-spacer>
|
||||
<label>Attendance Count: {{employeeList.length}} </label>
|
||||
<!--<button kendoGridExcelCommand type="button" icon="file-excel">Export to
|
||||
Excel</button>class="customButton"-->
|
||||
</ng-template>
|
||||
|
|
|
@ -187,7 +187,7 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
|||
)
|
||||
}
|
||||
|
||||
onClickLoad() {
|
||||
onClickRefresh() {
|
||||
// debugger;
|
||||
const fromDate = new Date(this.productionBonusSetup.fromDate.setHours(0, 0, 0, 0));
|
||||
const toDate = new Date(this.productionBonusSetup.toDate.setHours(0, 0, 0, 0));
|
||||
|
@ -195,7 +195,6 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
|||
if (selectedDate >= fromDate && selectedDate <= toDate) {
|
||||
var dataForAttn = {
|
||||
setupId: this.productionBonusSetup.id,
|
||||
lineId: this.selectedLine.id,
|
||||
date: this.selectedDate
|
||||
}
|
||||
// console.log(dataForAttn);
|
||||
|
@ -226,6 +225,7 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
|||
debugger
|
||||
this.employeeList = resp;
|
||||
this.employeeList.forEach(x => this.AddEmployeeGridData(x.id, false));
|
||||
// console.log('employee List', this.employeeList);
|
||||
},
|
||||
(err) => {
|
||||
this.notificationService.showError(err.error);
|
||||
|
@ -246,31 +246,6 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
|||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
//New For Swing And Printig
|
||||
if (this.prodBonusAttn.length <= 0 && (this.productionBonusSetup.productionBonusType == EnumProductionBonusType.Sewing ||
|
||||
this.productionBonusSetup.productionBonusType == EnumProductionBonusType.Printing)) {
|
||||
let data = {
|
||||
prodLine: this.selectedLine,
|
||||
date: this.selectedDate
|
||||
}
|
||||
this.loadingPanelService.ShowLoadingPanel = true;
|
||||
this.bonusService.getProdBonusAttnEmployeeListSwingAndPrinting(data).subscribe(
|
||||
(resp) => {
|
||||
debugger
|
||||
this.employeeList = resp;
|
||||
this.employeeList.forEach(x => this.AddEmployeeGridData(x.id, false));
|
||||
},
|
||||
(err) => {
|
||||
this.notificationService.showError(err.error);
|
||||
this.loadingPanelService.ShowLoadingPanel = false;
|
||||
},
|
||||
() => {
|
||||
this.loadingPanelService.ShowLoadingPanel = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
if (this.prodBonusAttn.length > 0) {
|
||||
debugger;
|
||||
for (let i = 0; i < this.prodBonusAttn.length; i++) {
|
||||
|
@ -285,7 +260,7 @@ export class ProductionBonusAttendanceComponent implements OnInit {
|
|||
);
|
||||
}
|
||||
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() {
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<label>Line Name</label>
|
||||
</div>
|
||||
<div class="p-col-12 p-lg-5" *ngIf="isNewLine">
|
||||
<app-dynamic-picker [dynamicPickerView]="_departmentPicker" (onSelectCompleted)="createWorkSchedule($event)"></app-dynamic-picker>
|
||||
<app-dynamic-picker [dynamicPickerView]="_departmentPicker"></app-dynamic-picker>
|
||||
</div>
|
||||
<div class="p-col-12 p-lg-5" *ngIf="!isNewLine">
|
||||
<input [(ngModel)]="selectedRow.lineName" [readonly]="!isNewLine" type="text"
|
||||
|
@ -181,54 +181,27 @@
|
|||
</div>
|
||||
</div>
|
||||
<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)">-->
|
||||
<kendo-grid-column field="empName" title="Supervisor/Line Chief/Common Worker" [width]="150">
|
||||
<kendo-grid-column field="empName" title="Supervisor/Line Chief/Common Worker" [width]="170">
|
||||
<!-- <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
||||
</ng-template> -->
|
||||
</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> -->
|
||||
</kendo-grid-column>
|
||||
|
||||
<kendo-grid-column field="devGrantParentName" title="top Parent (section)" [width]="120">
|
||||
</kendo-grid-column>
|
||||
<kendo-grid-column field="devParentName" title="parent (floor)" [width]="120">
|
||||
</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">
|
||||
<kendo-grid-column title="Actions" [width]="200">
|
||||
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
||||
<button type="button" kendoButton icon="delete" class="kt-delete"
|
||||
style="width: fit-content;" (click)="onClickRemoveSupervisors(dataItem)">
|
||||
Remove
|
||||
</button>
|
||||
style="width: fit-content;" (click)="onClickRemoveSupervisors(dataItem)">Remove</button>
|
||||
</ng-template>
|
||||
</kendo-grid-column>
|
||||
</kendo-grid>
|
||||
</p-tabPanel>
|
||||
<p-tabPanel header="Work Schedule" leftIcon="pi pi-briefcase">
|
||||
|
||||
<app-loading-panel></app-loading-panel>
|
||||
<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"
|
||||
[sortable]="true" [reorderable]="true" [resizable]="true">
|
||||
|
||||
|
@ -238,25 +211,20 @@
|
|||
</ng-template>
|
||||
</kendo-grid-column>
|
||||
|
||||
<kendo-grid-column field="inTime" title="Start Time" width="100">
|
||||
<!-- <kendo-grid-column field="startDateTime" title="Start Time" width="100">
|
||||
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
||||
{{dataItem?.inTime | date: 'hh:mm'}}
|
||||
{{dataItem.startDateTime | date: 'hh:mm a'}}
|
||||
</ng-template>
|
||||
</kendo-grid-column>
|
||||
|
||||
<kendo-grid-column field="outTime" title="End Time" width="100">
|
||||
<kendo-grid-column field="endDateTime" title="End Time" width="100">
|
||||
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
|
||||
{{dataItem?.outTime | date: 'hh:mm'}}
|
||||
</ng-template>
|
||||
</kendo-grid-column>
|
||||
<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>
|
||||
</ng-template>
|
||||
</kendo-grid-column> -->
|
||||
</kendo-grid>
|
||||
</p-tabPanel>
|
||||
</p-tabView>
|
||||
</p-tabView>
|
||||
</div>
|
||||
</kendo-dialog-content>
|
||||
<kendo-dialog-actions>
|
||||
|
|
|
@ -28,7 +28,6 @@ import { numberSymbols } from '@progress/kendo-angular-intl';
|
|||
import { process, State } from '@progress/kendo-data-query';
|
||||
import { DataStateChangeEvent } from '@progress/kendo-angular-grid';
|
||||
import { noUndefined } from '@angular/compiler/src/util';
|
||||
import { EnumStatus } from '../../_models/enums';
|
||||
|
||||
|
||||
|
||||
|
@ -72,7 +71,6 @@ export class ProductionBonusSetupComponent implements OnInit {
|
|||
prodBonusParameter: ProdBonusParameter;
|
||||
|
||||
prodBonusAttn: ProdBonusAttn[];
|
||||
depts: Department[] = [];
|
||||
layoutNo: string;
|
||||
// programName: string;
|
||||
// maxPerson: number;
|
||||
|
@ -106,7 +104,7 @@ export class ProductionBonusSetupComponent implements OnInit {
|
|||
department: Department;
|
||||
|
||||
selectedRow: any;
|
||||
scheduleTime: any;
|
||||
|
||||
|
||||
|
||||
editDetails: boolean = false;
|
||||
|
@ -126,9 +124,7 @@ export class ProductionBonusSetupComponent implements OnInit {
|
|||
this.prodBonusParameter = new ProdBonusParameter();
|
||||
this.prodBonusWork = new ProdBonusWorkSchedule();
|
||||
this.getBonusType();
|
||||
|
||||
|
||||
|
||||
// this.createForm();
|
||||
}
|
||||
|
||||
OnclickCheckbox() {
|
||||
|
@ -317,52 +313,29 @@ export class ProductionBonusSetupComponent implements OnInit {
|
|||
this.loadingPanelService.ShowLoadingPanel = true;
|
||||
debugger;
|
||||
if (this.prodBonusLine.id !== 0) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
GetScheduleTime(dataItem: any) {
|
||||
console.log('line');
|
||||
console.log(this.prodBonusLine.prodBonusWorkSchedules);
|
||||
this.loadingPanelService.ShowLoadingPanel = true;
|
||||
this.bonusService.GetschedulewithTime(this.prodBonusLine.prodBonusWorkSchedules[0].prodBonusLineID).subscribe(
|
||||
this.bonusService.getProdBonusAttenbyLineId(this.prodBonusLine.id).subscribe(
|
||||
(resp) => {
|
||||
this.scheduleTime = resp;
|
||||
this.prodBonusAttn = 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) {
|
||||
|
||||
// console.log(dataItem);
|
||||
this.isNewLine = false;
|
||||
this.prodBonusLine = new ProdBonusLine();
|
||||
|
||||
debugger;
|
||||
// if (this.isNewLayout) { //ADD Line
|
||||
// this.prodBonusLine.prodBonusSupervisors = [];
|
||||
// this.prodBonusLine.prodBonusWorkSchedules = [];
|
||||
|
@ -434,7 +407,7 @@ export class ProductionBonusSetupComponent implements OnInit {
|
|||
var newlineParameter: ProdBonusParameter = new ProdBonusParameter();
|
||||
// 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) {
|
||||
this.prodBonusLine.prodBonusSupervisors.splice(index, 1);
|
||||
}
|
||||
|
@ -461,12 +434,11 @@ export class ProductionBonusSetupComponent implements OnInit {
|
|||
() => {
|
||||
//newlineItem.amount
|
||||
this.prodBonusLine.prodBonusSupervisors.push(newlineSupervisor);
|
||||
|
||||
//Commented For Test
|
||||
// this.prodBonusLine.prodBonusParameters.push(newlineParameter);
|
||||
this.prodBonusLine.prodBonusParameters.push(newlineParameter);
|
||||
|
||||
this.prodBonusLine.scheduledHour = this.scheduledHours;
|
||||
this.prodBonusLine.lineName = this.department.name;
|
||||
// console.log(this.prodBonusLine);
|
||||
this.clearProdbonusLine();
|
||||
// this.notificationService.showSuccess('Supervisor added to the line');
|
||||
}
|
||||
|
@ -484,19 +456,17 @@ export class ProductionBonusSetupComponent implements OnInit {
|
|||
// this.prodBonusLine.prodBonusWorkSchedules.push(newLayoutWork);
|
||||
// currentDate.setDate(currentDate.getDate() + 1);
|
||||
// }
|
||||
|
||||
// //Commented For Test
|
||||
// for (let i = 0; currentDate <= this.productionBonusSetup.toDate; i++) {
|
||||
// let newLayoutWork: ProdBonusWorkSchedule = {
|
||||
// prodBonusSetupID: 0,
|
||||
// prodBonusLineID: 0,
|
||||
// id: 0,
|
||||
// startDateTime: new Date(currentDate.setHours(0, 0, 0, 0)),
|
||||
// endDateTime: new Date(currentDate.setHours(23, 59, 59, 999))
|
||||
// };
|
||||
// this.prodBonusLine.prodBonusWorkSchedules.push(newLayoutWork);
|
||||
// currentDate.setDate(currentDate.getDate() + 1);
|
||||
// }
|
||||
for (let i = 0; currentDate <= this.productionBonusSetup.toDate; i++) {
|
||||
let newLayoutWork: ProdBonusWorkSchedule = {
|
||||
prodBonusSetupID: 0,
|
||||
prodBonusLineID: 0,
|
||||
id: 0,
|
||||
startDateTime: new Date(currentDate.setHours(0, 0, 0, 0)),
|
||||
endDateTime: new Date(currentDate.setHours(23, 59, 59, 999))
|
||||
};
|
||||
this.prodBonusLine.prodBonusWorkSchedules.push(newLayoutWork);
|
||||
currentDate.setDate(currentDate.getDate() + 1);
|
||||
}
|
||||
}
|
||||
else {
|
||||
debugger;
|
||||
|
@ -528,7 +498,7 @@ export class ProductionBonusSetupComponent implements OnInit {
|
|||
onClickOk() {
|
||||
debugger;
|
||||
if (this.isNewLine) {
|
||||
if (this._departmentPicker.selectedID == undefined) {
|
||||
if(this._departmentPicker.selectedID == undefined){
|
||||
this.notificationService.showWarning('Please Select a Line'); return;
|
||||
}
|
||||
this.prodBonusLine.lineName = this._departmentPicker.selectedObjects[0]['name'];
|
||||
|
@ -609,38 +579,10 @@ export class ProductionBonusSetupComponent implements OnInit {
|
|||
this.editDetails = false;
|
||||
this.prodBSdata = undefined;
|
||||
}
|
||||
onScheduledHoursChange(value: number) {
|
||||
onScheduledHoursChange(value: number){
|
||||
debugger;
|
||||
this.prodBonusLine.scheduledHour = value;
|
||||
this.scheduledHours;
|
||||
this.productionBonusSetup.productionBonusLines
|
||||
}
|
||||
|
||||
|
||||
createWorkSchedule(data: any) {
|
||||
debugger;
|
||||
var newlineParameter: ProdBonusParameter = new ProdBonusParameter();
|
||||
if (this.isNewLine){
|
||||
newlineParameter.itemID = this._departmentPicker.selectedID;
|
||||
newlineParameter.itemType = 0;
|
||||
newlineParameter.prodBonusSetupID = this.productionBonusSetup.id;
|
||||
this.prodBonusLine.prodBonusParameters.push(newlineParameter);
|
||||
|
||||
const currentDate = new Date(this.productionBonusSetup.fromDate);
|
||||
const maxDate = new Date(this.productionBonusSetup.toDate);
|
||||
maxDate.setDate(this.productionBonusSetup.toDate.getDate() + 1);
|
||||
|
||||
for (let i = 0; currentDate <= maxDate; i++) {
|
||||
let newLayoutWork: ProdBonusWorkSchedule = {
|
||||
prodBonusSetupID: 0,
|
||||
prodBonusLineID: 0,
|
||||
id: 0,
|
||||
startDateTime: new Date(currentDate.setHours(0, 0, 0, 0)),
|
||||
endDateTime: new Date(currentDate.setHours(23, 59, 59, 999))
|
||||
};
|
||||
this.prodBonusLine.prodBonusWorkSchedules.push(newLayoutWork);
|
||||
currentDate.setDate(currentDate.getDate() + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ using NPOI.SS.Formula.Eval;
|
|||
using System.Globalization;
|
||||
using Payroll.BO;
|
||||
using Ease.Core.Model;
|
||||
using Microsoft.AspNetCore.Mvc.ViewFeatures;
|
||||
|
||||
namespace HRM.UI.Controllers.Payroll
|
||||
{
|
||||
|
@ -464,7 +463,6 @@ namespace HRM.UI.Controllers.Payroll
|
|||
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
||||
ProductionBonusSetup item = new ProductionBonusSetup();
|
||||
//ProdBonusLine item = new ProdBonusLine();
|
||||
List<Department> detps = new DepartmentService().Get(EnumStatus.Regardless, (int)currentUser.PayrollTypeID);
|
||||
try
|
||||
{
|
||||
item = _productionBonusSetupService.Get(ID);
|
||||
|
@ -476,33 +474,7 @@ namespace HRM.UI.Controllers.Payroll
|
|||
foreach (ProdBonusSupervisor prodSupervisor in prodLine.ProdBonusSupervisors)
|
||||
{
|
||||
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.EmployeeNo = oEmp.EmployeeNo;
|
||||
|
||||
|
@ -524,25 +496,6 @@ namespace HRM.UI.Controllers.Payroll
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -569,7 +522,6 @@ namespace HRM.UI.Controllers.Payroll
|
|||
{
|
||||
var item = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(processItems));
|
||||
int setupID = (int)item["setupId"].ToObject<int>();
|
||||
int lineID = (int)item["lineId"].ToObject<int>();
|
||||
DateTime date = (DateTime)item["date"].ToObject<DateTime>();
|
||||
|
||||
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
||||
|
@ -577,7 +529,7 @@ namespace HRM.UI.Controllers.Payroll
|
|||
List<ProdBonusAttn> AttnItems = new List<ProdBonusAttn>();
|
||||
try
|
||||
{
|
||||
AttnItems = _prodBonusAttnService.GetBySetupLineDate(setupID, lineID, date);
|
||||
AttnItems = _prodBonusAttnService.Get(setupID, date);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -657,52 +609,6 @@ namespace HRM.UI.Controllers.Payroll
|
|||
|
||||
return Ok(_oFinalEmployees);
|
||||
}
|
||||
[HttpPost]
|
||||
[Route("getProdBonusAttnEmployeeListSwingAndPrinting")]
|
||||
public ActionResult getProdBonusAttnEmployeeListSwingAndPrinting(dynamic pItem)
|
||||
{
|
||||
var item = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(pItem));
|
||||
DateTime date = (DateTime)item["date"].ToObject<DateTime>();
|
||||
ProdBonusLine _oProdBonusLine = (ProdBonusLine)item["prodLine"].ToObject<ProdBonusLine>();
|
||||
|
||||
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
||||
List<Employee> _oEmployees = new EmployeeService().Get(EnumEmployeeStatus.Live, (int)currentUser.PayrollTypeID);
|
||||
List<Employee> _oFinalEmployees = new List<Employee>();
|
||||
List<ProdBonusParameter> _oProdBonusParameters = new List<ProdBonusParameter>();
|
||||
List<ProdBonusSupervisor> _oProdBonusSupervisors = new List<ProdBonusSupervisor>();
|
||||
List<DailyAttnProcess> _oDailyAttnProsess = new List<DailyAttnProcess>();
|
||||
List<ProdBonusAttn> _oProdBonusAttns = null;
|
||||
try
|
||||
{
|
||||
DateTime? maxDate = _prodBonusAttnService.GetMaxDate(_oProdBonusLine.ProdBonusSetupID, _oProdBonusLine.ID, date);
|
||||
|
||||
if(maxDate != null)
|
||||
_oProdBonusAttns = _prodBonusAttnService.GetBySetupLineDate(_oProdBonusLine.ProdBonusSetupID, _oProdBonusLine.ID, (DateTime)maxDate);
|
||||
|
||||
List<ProdBonusParameter> desigparam = _oProdBonusParameters.Where(o => o.ItemType == EnumBonusItemType.Designation).ToList();
|
||||
if(_oProdBonusAttns != null && _oProdBonusAttns.Count > 0)
|
||||
{
|
||||
foreach (var pda in _oProdBonusAttns)
|
||||
{
|
||||
Employee emp = _oEmployees.Find(o => o.ID == pda.EmployeeID);
|
||||
|
||||
if (emp != null) _oFinalEmployees.Add(emp);
|
||||
}
|
||||
}
|
||||
string emIds = _oFinalEmployees.Aggregate(new StringBuilder(), (sb, x) => sb.Append(x.ID + ","), sb => sb.ToString().Trim(','));
|
||||
if (emIds != "")
|
||||
{
|
||||
_oDailyAttnProsess = new DailyAttnProcessService().Get(emIds, date.Date, date.Date.AddHours(23.9));
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return StatusCode(StatusCodes.Status500InternalServerError, e.Message);
|
||||
}
|
||||
|
||||
return Ok(_oFinalEmployees);
|
||||
}
|
||||
[HttpGet("getByLineID/{lineID}")]
|
||||
public ActionResult getByLineID(int lineID)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user