attendance manual entry modified
This commit is contained in:
parent
dc1309640f
commit
999280b906
|
@ -24,19 +24,37 @@ namespace HRM.DA
|
|||
|
||||
#region Insert function
|
||||
|
||||
//internal static void Insert(TransactionContext tc, DailyAttnProcess item)
|
||||
//{
|
||||
// tc.ExecuteNonQuery(
|
||||
// "INSERT INTO DailyAttnProcess(DailyAttnProcessID, EmployeeID, AttnDate, ShiftID, InTime, OutTime,WorkDayType, AttenType, Comments,Reason, IsManualEntry,IsLate, LateHour, EarlyHour, OTHour, ReferenceID, CreatedBy, CreatedDate, OtRemarks, BenefitRemarks, TempShiftID, WFStatus, ApprovedOTHOUR, LMRemarks, DHRemarks, SalaryMonth, ActualInTime, ActualOutTime, CLAIMWFSTATUS)" +
|
||||
// " VALUES(%n, %n, %d, %n, %D, %D, %n, %n, %s,%s,%b, %b, %n, %n, %n, %n, %n, %d, %s, %s, %n,%n,%n, %s, %s, %d,%D,%D, %n)",
|
||||
// item.ID, item.EmployeeID, item.AttnDate, DataReader.GetNullValue(item.ShiftID),
|
||||
// DataReader.GetNullValue(item.EmpInTime), DataReader.GetNullValue(item.EmpOutTime), item.WorkDayType,
|
||||
// item.AttenType, item.Comments, item.Reason, item.IsManualEntry, item.IsLate, item.LateHour,
|
||||
// item.EarlyHour, item.OTHour, DataReader.GetNullValue(item.ReferenceID, 0), item.CreatedBy,
|
||||
// item.CreatedDate, item.OtRemarks, item.BenefitRemarks, item.TempShiftID,
|
||||
// item.WFStatus, item.ApprovedOTHour, item.LMRemarks, item.DHRemarks, item.SalaryMonth, item.ActualInTime,
|
||||
// item.ActualOutTime, (int)EnumClaimWFStatus.None);
|
||||
//}
|
||||
internal static void Insert(TransactionContext tc, DailyAttnProcess item)
|
||||
{
|
||||
//tc.ExecuteNonQuery(
|
||||
// "INSERT INTO DailyAttnProcess(DailyAttnProcessID, EmployeeID, AttnDate, ShiftID, InTime, OutTime,WorkDayType, AttenType, Comments,Reason, IsManualEntry,IsLate, LateHour, EarlyHour, OTHour, ReferenceID, CreatedBy, CreatedDate, OtRemarks, BenefitRemarks, TempShiftID, WFStatus, ApprovedOTHOUR, LMRemarks, DHRemarks, SalaryMonth, ActualInTime, ActualOutTime, CLAIMWFSTATUS)" +
|
||||
// " VALUES(%n, %n, %d, %n, %D, %D, %n, %n, %s,%s,%b, %b, %n, %n, %n, %n, %n, %d, %s, %s, %n,%n,%n, %s, %s, %d,%D,%D, %n)",
|
||||
// item.ID, item.EmployeeID, item.AttnDate, DataReader.GetNullValue(item.ShiftID),
|
||||
// DataReader.GetNullValue(item.EmpInTime), DataReader.GetNullValue(item.EmpOutTime), item.WorkDayType,
|
||||
// item.AttenType, item.Comments, item.Reason, item.IsManualEntry, item.IsLate, item.LateHour,
|
||||
// item.EarlyHour, item.OTHour, DataReader.GetNullValue(item.ReferenceID, 0), item.CreatedBy,
|
||||
// item.CreatedDate, item.OtRemarks, item.BenefitRemarks, item.TempShiftID,
|
||||
// item.WFStatus, item.ApprovedOTHour, item.LMRemarks, item.DHRemarks, item.SalaryMonth, item.ActualInTime,
|
||||
// item.ActualOutTime, (int)EnumClaimWFStatus.None);
|
||||
tc.ExecuteNonQuery(@"INSERT INTO DailyAttnProcess(DailyAttnProcessID, EmployeeID, AttnDate,
|
||||
ShiftID, InTime, OutTime,
|
||||
WorkDayType, ATTENTYPE, Comments,
|
||||
IsManualEntry,OnlyManualInTime,OnlyManualOutTime,
|
||||
LateHour, EarlyHour, OTHour,
|
||||
ReferenceID, CreatedBy, CreatedDate)
|
||||
VALUES(%n, %n, %d,
|
||||
%n, %D, %D,
|
||||
%n, %n, %s,
|
||||
%b, %b, %b,
|
||||
%n, %n, %n,
|
||||
%n, %n, %d)",
|
||||
item.ID, item.EmployeeID, item.AttnDate,
|
||||
DataReader.GetNullValue(item.ShiftID), DataReader.GetNullValue(item.InTime), DataReader.GetNullValue(item.OutTime),
|
||||
item.WorkDayType, item.AttenType, item.Comments,
|
||||
item.IsManualEntry, item.OnlyManualInTime, item.OnlyManualOutTime,
|
||||
item.LateHour, item.EarlyHour, item.OTHour,
|
||||
DataReader.GetNullValue(item.ReferenceID), item.CreatedBy, item.CreatedDate);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -1137,7 +1137,16 @@ namespace HRM.DA
|
|||
tc = TransactionContext.Begin(true);
|
||||
foreach (DailyAttnProcess item in oDAttnProcessess)
|
||||
{
|
||||
DailyAttnProcessDA.ManualEditUpdate(tc, item);
|
||||
if (item.IsNew)
|
||||
{
|
||||
int id = tc.GenerateID("DailyAttnProcess", "DAILYATTNPROCESSID");
|
||||
base.SetObjectID(item, id);
|
||||
DailyAttnProcessDA.Insert(tc, item);
|
||||
}
|
||||
else
|
||||
{
|
||||
DailyAttnProcessDA.ManualEditUpdate(tc, item);
|
||||
}
|
||||
}
|
||||
|
||||
//if (attnMonthlyBenefit.Count > 0)
|
||||
|
|
|
@ -48,6 +48,8 @@ export class DailyAttnProcess extends BaseObject {
|
|||
this.actualOutTime = new Date();
|
||||
this.actualShiftID = null;
|
||||
this.shift= null;
|
||||
this.onlyManualInTime = false;
|
||||
this.onlyManualOutTime = false;
|
||||
}
|
||||
attnDate: Date;
|
||||
inTime: Date;
|
||||
|
@ -90,6 +92,9 @@ export class DailyAttnProcess extends BaseObject {
|
|||
shift: Shift;
|
||||
remarksType: number;
|
||||
|
||||
onlyManualInTime: boolean;
|
||||
onlyManualOutTime: boolean;
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -276,6 +276,9 @@ export class AttendanceServices {
|
|||
getDailyAttnProcessByEmp(empList: any) {
|
||||
return this.apiService.httpPost<DailyAttnProcess[]>('/Attendance' + '/getDailyAttnProcessByEmp', empList);
|
||||
}
|
||||
getDailyAttnProcessByEmpForManualEntry(empList: any) {
|
||||
return this.apiService.httpPost<DailyAttnProcess[]>('/Attendance' + '/getDailyAttnProcessByEmpForManualEntry', empList);
|
||||
}
|
||||
|
||||
// DailyAttnProcess
|
||||
getDailyAttnProcessByEmployeeId(employeeId: number) {
|
||||
|
|
|
@ -14,7 +14,7 @@ export class ApiService {
|
|||
public isSSO = false;
|
||||
public versionDeployement = false;
|
||||
// public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2025, 1, 25))}-`+"01";
|
||||
public versionNumber = `V-20250421-`+"01";
|
||||
public versionNumber = `V-20250427-`+"01";
|
||||
public static BASE_URL = '';
|
||||
public base_url = '';
|
||||
// public currentLink = '';
|
||||
|
|
|
@ -329,7 +329,7 @@
|
|||
<div class="p-col-12" align="right">
|
||||
<button kendoButton icon="arrow-left" style="margin-right: 20px;" class="k-button k-primary" *ngIf="isVisibleCordinatorPicker" (click)="goBack()">
|
||||
Back </button>
|
||||
<button icon="rotate" kendoButton class="k-button k-primary" (click)="update()">
|
||||
<button icon="save" kendoButton class="k-button k-primary" (click)="update()">
|
||||
Update
|
||||
</button>
|
||||
</div>
|
||||
|
|
|
@ -34,7 +34,7 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit
|
|||
approvalRole: string;
|
||||
isVisibleEmpPicker: boolean = false;
|
||||
isVisibleCordinatorPicker: boolean = false;
|
||||
isVisiblelmPicker: boolean= false;
|
||||
isVisiblelmPicker: boolean = false;
|
||||
selectedShiftID: number;
|
||||
selectedStatus: EnumAttendanceType;
|
||||
selectedAttnDate: Date;
|
||||
|
@ -85,7 +85,7 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit
|
|||
this.selectInTime = new Date();
|
||||
this.selectedOutTime = new Date();
|
||||
this.loadDropDownLists();
|
||||
// this.selectedStatus = EnumAttendanceType.Present;
|
||||
// this.selectedStatus = EnumAttendanceType.Present;
|
||||
this.getPendindBillings();
|
||||
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit
|
|||
},
|
||||
() => {
|
||||
if (this.shifts.length > 0) {
|
||||
// this.selectedShiftID = this.shifts[0].id;
|
||||
// this.selectedShiftID = this.shifts[0].id;
|
||||
this.shifts[0].inTime = new Date(this.shifts[0].inTime);
|
||||
this.shifts[0].outTime = new Date(this.shifts[0].outTime);
|
||||
this.dateChange();
|
||||
|
@ -274,7 +274,8 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit
|
|||
|
||||
if (attnRequest.length == 0) return;
|
||||
|
||||
this.attendanceServices.getDailyAttnProcessByEmp(attnRequest).subscribe(
|
||||
// this.attendanceServices.getDailyAttnProcessByEmp(attnRequest).subscribe(
|
||||
this.attendanceServices.getDailyAttnProcessByEmpForManualEntry(attnRequest).subscribe(
|
||||
(resp) => {
|
||||
|
||||
if (this.dailyAttenProcessList == undefined || this.dailyAttenProcessList.length == 0) {
|
||||
|
@ -371,8 +372,17 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit
|
|||
}
|
||||
|
||||
|
||||
if ((x.inTime == null || x.outTime == null) && x.attenType == EnumAttendanceType.Present) {
|
||||
msg = msg + "Employee: " + x.employee.employeeNo + ", Status present is not allowed while inTime and outTime is not entered.; ";
|
||||
if ((x.inTime == null && x.outTime == null) && x.attenType == EnumAttendanceType.Present) {
|
||||
msg = msg + "Employee: " + x.employee.employeeNo + ", Status present is not allowed while In Time and Out Time is not entered.; ";
|
||||
|
||||
}
|
||||
else {
|
||||
if (x.inTime != null && x.outTime == null) {
|
||||
x.onlyManualInTime = true;
|
||||
}
|
||||
if (x.inTime == null && x.outTime != null) {
|
||||
x.onlyManualOutTime = true;
|
||||
}
|
||||
}
|
||||
var bvalid = false;
|
||||
|
||||
|
|
|
@ -1,21 +1,23 @@
|
|||
<app-loading-panel></app-loading-panel>
|
||||
<form [formGroup]="_salaryDaysDeductEdit">
|
||||
<div class="card">
|
||||
<div class="p-grid">
|
||||
<div class="p-col-2">
|
||||
<label>Unauthorized Leave</label>
|
||||
</div>
|
||||
<div class="p-col-10">
|
||||
<kendo-dropdownlist [data]="_unAuthLeaves"
|
||||
[(ngModel)]="_uaLeaveParam.unAhuthorizeLeaveID"
|
||||
[defaultItem]="{ name: 'Select..', value: null }"
|
||||
[textField]="'name'"
|
||||
[valueField]="'id'"
|
||||
[valuePrimitive]="true"
|
||||
class="form-control form-control-sm input-sm"
|
||||
(selectionChange)="paramselectionChange($event)"
|
||||
formControlName="unauthorizedLeaveDropDown">
|
||||
</kendo-dropdownlist>
|
||||
<div class="p-col-12">
|
||||
<div class="p-grid">
|
||||
<div class="p-col-2">
|
||||
<label>Unauthorized Leave</label>
|
||||
</div>
|
||||
<div class="p-col-10">
|
||||
<kendo-dropdownlist [data]="_unAuthLeaves"
|
||||
[(ngModel)]="_uaLeaveParam.unAhuthorizeLeaveID"
|
||||
[defaultItem]="{ name: 'Select..', value: null }"
|
||||
[textField]="'name'"
|
||||
[valueField]="'id'"
|
||||
[valuePrimitive]="true"
|
||||
class="form-control form-control-sm input-sm"
|
||||
(selectionChange)="paramselectionChange($event)"
|
||||
formControlName="unauthorizedLeaveDropDown">
|
||||
</kendo-dropdownlist>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-grid">
|
||||
|
@ -26,7 +28,7 @@
|
|||
[selectable]="{enabled: true, checkboxOnly: true, mode: 'multiple'}"
|
||||
[selectedKeys]="_selectedgrades"
|
||||
[kendoGridSelectBy]="'id'"
|
||||
[height]="200">
|
||||
[height]="500">
|
||||
<kendo-grid-checkbox-column [class]="{'text-center': true}"
|
||||
[columnMenu]="false"
|
||||
[headerClass]="{'text-center': true}"
|
||||
|
@ -43,10 +45,10 @@
|
|||
</div>
|
||||
|
||||
<div class="p-col-6">
|
||||
<h3>salary components</h3>
|
||||
<h3>Salary components</h3>
|
||||
<kendo-grid [data]="_uaLeaveParamDetail"
|
||||
[selectedKeys]="_selectedcomponent"
|
||||
[height]="200"
|
||||
[height]="500"
|
||||
[kendoGridSelectBy]="'allowanceID'">
|
||||
|
||||
<kendo-grid-column field="componenetName" title="Name">
|
||||
|
@ -70,8 +72,14 @@
|
|||
</div>
|
||||
<div class="card">
|
||||
<div class="p-col-12 p-md-12" align="right">
|
||||
<button pButton type="button" label="Go Back" style="margin-bottom: 10px; margin-right: 20px; width: 100px; background:red; color:white" (click)="cancel();" class="ui-button-danger"></button>
|
||||
<button pButton type="submit" label="Save" (click)="Save()" style="margin-bottom: 10px; width: 100px; background:#50AF47; color: white" class="ui-button-success"></button>
|
||||
<!-- <button pButton type="button" label="Go Back" style="margin-bottom: 10px; margin-right: 20px; width: 100px; background:red; color:white" (click)="cancel();" class="ui-button-danger"></button>
|
||||
<button pButton type="submit" label="Save" (click)="Save()" style="margin-bottom: 10px; width: 100px; background:#50AF47; color: white" class="ui-button-success"></button> -->
|
||||
<button icon="undo" kendoButton class="k-button k-primary" (click)="cancel()" style="margin-right: 5px;">
|
||||
Go Back
|
||||
</button>
|
||||
<button icon="save" kendoButton class="k-button k-primary" (click)="Save()">
|
||||
Save
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -211,6 +211,6 @@ export class SalaryDaysDeductEditComponent implements OnInit {
|
|||
}
|
||||
|
||||
cancel() {
|
||||
|
||||
this.router.navigateByUrl('/payroll/absent-deduction-Policy');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
(edit)="editHandler($event)"
|
||||
(remove)="removeHandler($event)">
|
||||
<ng-template kendoGridToolbarTemplate>
|
||||
<button [primary]="true" kendoGridAddCommand (click)="new()">Add New</button>
|
||||
<button icon="plus" [primary]="true" kendoGridAddCommand (click)="new()">Add New</button>
|
||||
</ng-template>
|
||||
<kendo-grid-column field="unAuthLeaveName" title="Name" width="80%">
|
||||
</kendo-grid-column>
|
||||
|
|
|
@ -1335,7 +1335,8 @@ namespace HRM.UI.Controllers.Attendance
|
|||
public ActionResult getDailyAttnProcessByEmpForManualEntry(dynamic data)
|
||||
{
|
||||
List<DailyAttnProcess> _dAttnProcessess = new List<DailyAttnProcess>();
|
||||
DailyAttnProcess _dAttnProcess = new DailyAttnProcess();
|
||||
DailyAttnProcess _dAttnProcess = null;
|
||||
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
||||
try
|
||||
{
|
||||
var items = Newtonsoft.Json.JsonConvert.DeserializeObject(Convert.ToString(data));
|
||||
|
@ -1350,17 +1351,11 @@ namespace HRM.UI.Controllers.Attendance
|
|||
empIdList.Add(empID);
|
||||
}
|
||||
|
||||
if (empids.Length > 0)
|
||||
{
|
||||
empids = empids.Substring(0, empids.Length - 1);
|
||||
}
|
||||
if (empids.Length > 0) empids = empids.Substring(0, empids.Length - 1);
|
||||
|
||||
attnDate = new DateTime(attnDate.Year, attnDate.Month, attnDate.Day);
|
||||
List<DailyAttnProcess> dAttnProcessess = this._dailyAttnProcessService.GetByEmployees(attnDate, empids);
|
||||
|
||||
|
||||
//List<DailyAttnProcess> DailyAttnProcesses = new List<DailyAttnProcess>();
|
||||
|
||||
foreach (var empid in empIdList)
|
||||
{
|
||||
bool existInList = false;
|
||||
|
@ -1389,27 +1384,24 @@ namespace HRM.UI.Controllers.Attendance
|
|||
if (!ExistInSavedData)
|
||||
{
|
||||
_dAttnProcess = new DailyAttnProcess();
|
||||
|
||||
_dAttnProcess.EmployeeID = empid;
|
||||
//_dAttnProcess.Employee.EmployeeNo = sEmp.Employee.EmployeeNo;
|
||||
//_dAttnProcess.Employee.Name = sEmp.Employee.Name;
|
||||
_dAttnProcess.AttnDate = attnDate;
|
||||
_dAttnProcessess.Add(_dAttnProcess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if (_dAttnProcessess != null && _dAttnProcessess.Count > 0)
|
||||
//{
|
||||
// int serial = 1;
|
||||
// foreach (DailyAttnProcess dAttnProcess in _dAttnProcessess)
|
||||
// {
|
||||
// if (dAttnProcess.IsNew)
|
||||
// {
|
||||
|
||||
if (_dAttnProcessess != null && _dAttnProcessess.Count > 0)
|
||||
{
|
||||
int serial = 1;
|
||||
foreach (DailyAttnProcess dAttnProcess in _dAttnProcessess)
|
||||
{
|
||||
if (dAttnProcess.IsNew)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user