Compare commits
4 Commits
dddeb8fbed
...
a0150b0eed
Author | SHA1 | Date | |
---|---|---|---|
a0150b0eed | |||
3ed751441d | |||
13d197b2e3 | |||
5e569492ba |
|
@ -842,7 +842,22 @@ namespace HRM.DA
|
||||||
}
|
}
|
||||||
return tc.ExecuteReader(strSQLQuery);
|
return tc.ExecuteReader(strSQLQuery);
|
||||||
}
|
}
|
||||||
|
internal static IDataReader GetForOTprocess(TransactionContext tc, EnumEmployeeStatus status, int payrollTypeID, DateTime salarymonth )
|
||||||
|
{
|
||||||
|
string strSQLQuery = string.Empty;
|
||||||
|
|
||||||
|
if (status == EnumEmployeeStatus.Regardless)
|
||||||
|
{
|
||||||
|
strSQLQuery = SQLParser.MakeSQL("SELECT * FROM Employee WHERE PAYROLLTYPEID = %n ", payrollTypeID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
strSQLQuery = SQLParser.MakeSQL("SELECT * FROM Employee WHERE (Status = %n or endofcontractdate between %d and %d) AND PAYROLLTYPEID = %n ",
|
||||||
|
(int)status,GlobalFunctions.FirstDateOfMonth(salarymonth), GlobalFunctions.LastDateOfMonth(salarymonth), payrollTypeID);
|
||||||
|
}
|
||||||
|
return tc.ExecuteReader(strSQLQuery);
|
||||||
|
}
|
||||||
|
|
||||||
internal static DataSet GetEmpIDsOfManager(TransactionContext tc, int status, DateTime lastDateOfYear)
|
internal static DataSet GetEmpIDsOfManager(TransactionContext tc, int status, DateTime lastDateOfYear)
|
||||||
{
|
{
|
||||||
string strSQLQuery =
|
string strSQLQuery =
|
||||||
|
|
|
@ -1564,6 +1564,37 @@ namespace HRM.DA
|
||||||
|
|
||||||
return employees;
|
return employees;
|
||||||
}
|
}
|
||||||
|
public List<Employee> GetForOTprocess(EnumEmployeeStatus status, int payrollTypeID, DateTime salarymonth)
|
||||||
|
{
|
||||||
|
List<Employee> employees = new List<Employee>();
|
||||||
|
|
||||||
|
TransactionContext tc = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
tc = TransactionContext.Begin();
|
||||||
|
|
||||||
|
DataReader dr = new DataReader(EmployeeDA.GetForOTprocess(tc, status, payrollTypeID, salarymonth));
|
||||||
|
employees = this.CreateObjects<Employee>(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 employees;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public DataTable GetEmpIDsOfManager(int status, DateTime lastDateOfYear)
|
public DataTable GetEmpIDsOfManager(int status, DateTime lastDateOfYear)
|
||||||
{
|
{
|
||||||
|
|
|
@ -524,21 +524,21 @@ namespace HRM.DA
|
||||||
{
|
{
|
||||||
bulkCopy.BulkCopyTimeout = 6000; // in seconds
|
bulkCopy.BulkCopyTimeout = 6000; // in seconds
|
||||||
|
|
||||||
bulkCopy.ColumnMappings.Add("PROCESSID", "PROCESSID");
|
bulkCopy.ColumnMappings.Add("PROCESSID", "ProcessId");
|
||||||
bulkCopy.ColumnMappings.Add("PROCESSMONTH", "PROCESSMONTH");
|
bulkCopy.ColumnMappings.Add("PROCESSMONTH", "ProcessMonth");
|
||||||
bulkCopy.ColumnMappings.Add("EMPID", "EMPID");
|
bulkCopy.ColumnMappings.Add("EMPID", "EmpID");
|
||||||
bulkCopy.ColumnMappings.Add("AMOUNT", "AMOUNT");
|
bulkCopy.ColumnMappings.Add("AMOUNT", "Amount");
|
||||||
bulkCopy.ColumnMappings.Add("TERMID", "TERMID");
|
bulkCopy.ColumnMappings.Add("TERMID", "TermID");
|
||||||
bulkCopy.ColumnMappings.Add("HOURS", "HOURS");
|
bulkCopy.ColumnMappings.Add("HOURS", "Hours");
|
||||||
bulkCopy.ColumnMappings.Add("CREATEDBY", "CREATEDBY");
|
bulkCopy.ColumnMappings.Add("CREATEDBY", "CreatedBy");
|
||||||
bulkCopy.ColumnMappings.Add("CREATIONDATE", "CREATIONDATE");
|
bulkCopy.ColumnMappings.Add("CREATIONDATE", "CreationDate");
|
||||||
bulkCopy.ColumnMappings.Add("MODIFIEDBY", "MODIFIEDBY");
|
bulkCopy.ColumnMappings.Add("MODIFIEDBY", "ModifiedBy");
|
||||||
bulkCopy.ColumnMappings.Add("MODIFIEDDATE", "MODIFIEDDATE");
|
bulkCopy.ColumnMappings.Add("MODIFIEDDATE", "ModifiedDate");
|
||||||
bulkCopy.ColumnMappings.Add("TERMPARAMETERID", "TERMPARAMETERID");
|
bulkCopy.ColumnMappings.Add("TERMPARAMETERID", "TermParameterID");
|
||||||
bulkCopy.ColumnMappings.Add("EMPOVERTIMEID", "EMPOVERTIMEID");
|
bulkCopy.ColumnMappings.Add("EMPOVERTIMEID", "EmpOverTimeID");
|
||||||
bulkCopy.ColumnMappings.Add("ARREARAMOUNT", "ARREARAMOUNT");
|
bulkCopy.ColumnMappings.Add("ARREARAMOUNT", "ArrearAmount");
|
||||||
bulkCopy.ColumnMappings.Add("OTMONTH", "OTMONTH");
|
bulkCopy.ColumnMappings.Add("OTMONTH", "OTMonth");
|
||||||
bulkCopy.ColumnMappings.Add("PAYROLLTYPEID", "PAYROLLTYPEID");
|
bulkCopy.ColumnMappings.Add("PAYROLLTYPEID", "PayrollTypeID");
|
||||||
|
|
||||||
bulkCopy.DestinationTableName = "OTProcess";
|
bulkCopy.DestinationTableName = "OTProcess";
|
||||||
|
|
||||||
|
@ -614,7 +614,7 @@ namespace HRM.DA
|
||||||
public void Process(List<Employee> emps, int userid, int payrolltypeid)
|
public void Process(List<Employee> emps, int userid, int payrolltypeid)
|
||||||
{
|
{
|
||||||
|
|
||||||
// TermParameter.EntryType = ConfigurationManager.GetStringValue("overtime", "entrytype", EnumConfigurationType.Logic);
|
TermParameter.EntryType = new SystemConfigarationService().GetconfigStringValue(EnumConfigurationType.Logic,"overtime", "entrytype");
|
||||||
bool calOnEarnedBasic = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "overtime", "earnedbasic");
|
bool calOnEarnedBasic = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "overtime", "earnedbasic");
|
||||||
int basicOnMonth = Convert.ToInt32(new SystemConfigarationService().GetconfigValue(EnumConfigurationType.Logic, "overtime", "basicondate"));
|
int basicOnMonth = Convert.ToInt32(new SystemConfigarationService().GetconfigValue(EnumConfigurationType.Logic, "overtime", "basicondate"));
|
||||||
bool fixedotmonth = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "overtime", "fixedotmonth");
|
bool fixedotmonth = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "overtime", "fixedotmonth");
|
||||||
|
@ -623,7 +623,7 @@ namespace HRM.DA
|
||||||
|
|
||||||
PayrollType ptype = new PayrollTypeService().Get(payrolltypeid);
|
PayrollType ptype = new PayrollTypeService().Get(payrolltypeid);
|
||||||
List<Employee> omployees = emps;
|
List<Employee> omployees = emps;
|
||||||
if (emps == null) omployees = new EmployeeService().Get(EnumEmployeeStatus.Live, payrolltypeid);
|
if (emps == null) omployees = new EmployeeService().GetForOTprocess(EnumEmployeeStatus.Live, payrolltypeid, ptype.NextPayProcessDate);
|
||||||
_OtProcess = new List<OTProcess>();
|
_OtProcess = new List<OTProcess>();
|
||||||
_EmpOvertimes = new EmployeeOverTimeService().Get(ptype.NextPayProcessDate, payrolltypeid);
|
_EmpOvertimes = new EmployeeOverTimeService().Get(ptype.NextPayProcessDate, payrolltypeid);
|
||||||
double basicSalary = 0;
|
double basicSalary = 0;
|
||||||
|
@ -835,13 +835,16 @@ namespace HRM.DA
|
||||||
TermParameter tparam = TermParameter.GetParameter(this._termParameters, (int)ot.Employee.GradeID, ot.TermID);
|
TermParameter tparam = TermParameter.GetParameter(this._termParameters, (int)ot.Employee.GradeID, ot.TermID);
|
||||||
if (tparam == null) throw new Exception("OT parameter/Policy not found for the employee:"
|
if (tparam == null) throw new Exception("OT parameter/Policy not found for the employee:"
|
||||||
+ ot.Employee.EmployeeNo + " " + ot.Employee.Name);
|
+ ot.Employee.EmployeeNo + " " + ot.Employee.Name);
|
||||||
double nHour = ot.OTHours;
|
//double nHour = ot.OTHours;
|
||||||
//if ((ot.OTHours - nHour) == 0)
|
////if ((ot.OTHours - nHour) == 0)
|
||||||
//{
|
////{
|
||||||
// throw new Exception("Monthly OT hours can be zero");
|
//// throw new Exception("Monthly OT hours can be zero");
|
||||||
//}
|
////}
|
||||||
nHour = Math.Floor(ot.OTHours);
|
//nHour = Math.Floor(ot.OTHours);
|
||||||
nHour += (ot.OTHours - nHour) * 100 / 60;
|
//nHour += (ot.OTHours - nHour) * 100 / 60;
|
||||||
|
double nHour = TermParameter.EntryType.ToUpper() == "MINUTE" ? // Means decimal part is in minutes
|
||||||
|
Math.Round(Math.Floor(ot.OTHours) + (((ot.OTHours - Math.Floor(ot.OTHours)) * 100.00) / 60.00), 2)
|
||||||
|
: Math.Round(ot.OTHours, 2);
|
||||||
switch (tparam.Type)
|
switch (tparam.Type)
|
||||||
{
|
{
|
||||||
case EnumOverTimeType.AnyAmount:
|
case EnumOverTimeType.AnyAmount:
|
||||||
|
@ -853,7 +856,7 @@ namespace HRM.DA
|
||||||
case EnumOverTimeType.FixedAmount:
|
case EnumOverTimeType.FixedAmount:
|
||||||
return ot.OTHours ;
|
return ot.OTHours ;
|
||||||
case EnumOverTimeType.HourlyBasicPercent:
|
case EnumOverTimeType.HourlyBasicPercent:
|
||||||
return this.ConvertToHourlyRate(nBasic, ot.OTMonth, tparam.housInMonth) * ot.OTHours * (tparam.Amount/100);
|
return this.ConvertToHourlyRate(nBasic, ot.OTMonth, _hoursInMonth) * nHour * (tparam.Amount/100);
|
||||||
case EnumOverTimeType.HourlyFlatAmount:
|
case EnumOverTimeType.HourlyFlatAmount:
|
||||||
return ot.OTHours * tparam.Amount;
|
return ot.OTHours * tparam.Amount;
|
||||||
case EnumOverTimeType.HoursOfMonth:
|
case EnumOverTimeType.HoursOfMonth:
|
||||||
|
@ -911,8 +914,8 @@ namespace HRM.DA
|
||||||
process.OTMonth = GlobalFunctions.LastDateOfMonth(ot.OTMonth);
|
process.OTMonth = GlobalFunctions.LastDateOfMonth(ot.OTMonth);
|
||||||
process.TermID = ot.TermID;
|
process.TermID = ot.TermID;
|
||||||
process.TermParameterID = ot.TermParameterID;
|
process.TermParameterID = ot.TermParameterID;
|
||||||
process.TotalHour = ot.OTHours;
|
process.TotalHour = Math.Round(ot.OTHours, 2);
|
||||||
process.Amount = this.GetPayableAmount(ot, nBasic);
|
process.Amount = Math.Round(this.GetPayableAmount(ot, Math.Round(nBasic)));
|
||||||
process.PayrollTypeID = ot.PayrollTypeID;
|
process.PayrollTypeID = ot.PayrollTypeID;
|
||||||
|
|
||||||
return process;
|
return process;
|
||||||
|
|
|
@ -13,7 +13,8 @@ export class ApiService {
|
||||||
|
|
||||||
public isSSO = false;
|
public isSSO = false;
|
||||||
public versionDeployement = false;
|
public versionDeployement = false;
|
||||||
public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2025, 1, 25))}-`+"01";
|
// public versionNumber = `V-${GlobalfunctionExtension.generateVersionNumber(new Date(2025, 1, 25))}-`+"01";
|
||||||
|
public versionNumber = `V-20250421-`+"01";
|
||||||
public static BASE_URL = '';
|
public static BASE_URL = '';
|
||||||
public base_url = '';
|
public base_url = '';
|
||||||
// public currentLink = '';
|
// public currentLink = '';
|
||||||
|
|
|
@ -59,13 +59,21 @@
|
||||||
<div class="p-col-12 p-md-5">
|
<div class="p-col-12 p-md-5">
|
||||||
<div class="p-col-12">
|
<div class="p-col-12">
|
||||||
<!-- <label for="txtLE">(Number of Attendance Employees : {{ employees.length }})</label> -->
|
<!-- <label for="txtLE">(Number of Attendance Employees : {{ employees.length }})</label> -->
|
||||||
<label for="txtWP">Number of Employees not in Work Plan : {{ employees.length }}</label>
|
<!-- <label for="txtWP">Number of Employees not in Work Plan : {{ employees.length }}</label> -->
|
||||||
|
<button class="link-button"
|
||||||
|
icon="window"
|
||||||
|
kendoButton
|
||||||
|
(click)="onClickNotInWorkPlanEmployee()"
|
||||||
|
[disabled]="employees.length == 0"
|
||||||
|
style="text-decoration: none; font-weight: bold;">
|
||||||
|
Number of Employees not in Work Plan : {{ employees.length }}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-col-12" *ngIf="lastProcessDate != null">
|
<div class="p-col-12" *ngIf="lastProcessDate != null">
|
||||||
<label style="color: red;" for="txtWP">Last Process date : {{ lastProcessDate != null ? (lastProcessDate | date: 'dd MMM yyyy') : '' }}</label>
|
<label style="color: red;" for="txtWP">Last Process date : {{ lastProcessDate != null ? (lastProcessDate | date: 'dd MMM yyyy') : '' }}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-col-12">
|
<div class="p-col-12">
|
||||||
<button icon="rotate"
|
<button icon="cogs"
|
||||||
kendoButton
|
kendoButton
|
||||||
class="k-button k-primary"
|
class="k-button k-primary"
|
||||||
(click)="onSave($event)">
|
(click)="onSave($event)">
|
||||||
|
@ -79,3 +87,26 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
<p-dialog header="Not in Work Plan Employees" [(visible)]="showModal" modal="modal"
|
||||||
|
showEffect="fade" [style]="{width: '60%', maxHeight:'475px', position: 'absolute'}">
|
||||||
|
<p-scrollPanel mode="native">
|
||||||
|
<div class="p-grid">
|
||||||
|
<div class="p-col-12">
|
||||||
|
<fieldset>
|
||||||
|
<kendo-grid [data]="employees" [pageable]="false" [sortable]="true" [reorderable]="true" [resizable]="true">
|
||||||
|
|
||||||
|
<kendo-grid-column field="sortOrder" title="SL" width="15%">
|
||||||
|
</kendo-grid-column>
|
||||||
|
<kendo-grid-column field="employeeNo" title="Employee No" width="20%">
|
||||||
|
</kendo-grid-column>
|
||||||
|
<kendo-grid-column field="name" title="Employee Name" width="25%">
|
||||||
|
</kendo-grid-column>
|
||||||
|
<kendo-grid-column field="gradeName" title="Grade" width="30%">
|
||||||
|
</kendo-grid-column>
|
||||||
|
</kendo-grid>
|
||||||
|
</fieldset>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p-scrollPanel>
|
||||||
|
</p-dialog>
|
|
@ -26,6 +26,7 @@ export class AttendanceProcessComponent {
|
||||||
lastProcessDate: Date;
|
lastProcessDate: Date;
|
||||||
processStatus: string = "";
|
processStatus: string = "";
|
||||||
withEmployee: boolean = false;
|
withEmployee: boolean = false;
|
||||||
|
showModal: boolean = false;
|
||||||
constructor(public attnService: AttendanceServices, public datatransferservice: DataTransferService,
|
constructor(public attnService: AttendanceServices, public datatransferservice: DataTransferService,
|
||||||
public loadingPanel: loadingPanelService,
|
public loadingPanel: loadingPanelService,
|
||||||
public notificationService: HRMNotificationService,
|
public notificationService: HRMNotificationService,
|
||||||
|
@ -43,6 +44,7 @@ export class AttendanceProcessComponent {
|
||||||
this.attnService.getNotYetAssiged().subscribe(
|
this.attnService.getNotYetAssiged().subscribe(
|
||||||
(x) => {
|
(x) => {
|
||||||
this.employees = x;
|
this.employees = x;
|
||||||
|
debugger
|
||||||
},
|
},
|
||||||
(x) => {
|
(x) => {
|
||||||
},
|
},
|
||||||
|
@ -137,4 +139,7 @@ export class AttendanceProcessComponent {
|
||||||
this.withEmployee = true;
|
this.withEmployee = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public onClickNotInWorkPlanEmployee() {
|
||||||
|
this.showModal = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ import { InputsModule, TextBoxModule } from '@progress/kendo-angular-inputs';
|
||||||
import { ChartsModule } from '@progress/kendo-angular-charts';
|
import { ChartsModule } from '@progress/kendo-angular-charts';
|
||||||
import { CardModule as kendoCardModule } from '@progress/kendo-angular-layout';
|
import { CardModule as kendoCardModule } from '@progress/kendo-angular-layout';
|
||||||
import { DialogsModule } from '@progress/kendo-angular-dialog';
|
import { DialogsModule } from '@progress/kendo-angular-dialog';
|
||||||
|
import { DialogModule } from 'primeng/dialog';
|
||||||
|
import { ScrollPanelModule } from 'primeng/scrollpanel';
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
||||||
import { PanelModule } from 'primeng/panel';
|
import { PanelModule } from 'primeng/panel';
|
||||||
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
|
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
|
||||||
|
@ -81,6 +83,8 @@ import { OrganizationManagementModule } from '../organization-management/organiz
|
||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
DialogsModule,
|
DialogsModule,
|
||||||
|
DialogModule,
|
||||||
|
ScrollPanelModule,
|
||||||
CommonModule,
|
CommonModule,
|
||||||
GridModule,
|
GridModule,
|
||||||
InputsModule,
|
InputsModule,
|
||||||
|
|
|
@ -3954,7 +3954,7 @@ p-treeselect.ng-invalid.ng-dirty > .p-treeselect {
|
||||||
border-bottom: 0 none;
|
border-bottom: 0 none;
|
||||||
/* background: #ffffff;
|
/* background: #ffffff;
|
||||||
color: #495057; */
|
color: #495057; */
|
||||||
padding: 12px 16px;
|
padding: 10px 16px;
|
||||||
border-top-right-radius: 4px;
|
border-top-right-radius: 4px;
|
||||||
border-top-left-radius: 4px;
|
border-top-left-radius: 4px;
|
||||||
background: #52527a;
|
background: #52527a;
|
||||||
|
@ -3990,7 +3990,7 @@ p-treeselect.ng-invalid.ng-dirty > .p-treeselect {
|
||||||
.p-dialog .p-dialog-content {
|
.p-dialog .p-dialog-content {
|
||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
color: #495057;
|
color: #495057;
|
||||||
padding: 0 1.5rem 2rem 1.5rem;
|
padding: 1rem 1.5rem 1rem 1.5rem;
|
||||||
}
|
}
|
||||||
.p-dialog .p-dialog-footer {
|
.p-dialog .p-dialog-footer {
|
||||||
border-top: 0 none;
|
border-top: 0 none;
|
||||||
|
|
|
@ -436,4 +436,13 @@ Menu Custom Code End
|
||||||
min-height: 700px;
|
min-height: 700px;
|
||||||
/* max-height: 100%;
|
/* max-height: 100%;
|
||||||
background-color: white !important; */
|
background-color: white !important; */
|
||||||
}
|
}
|
||||||
|
.link-button {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
color: #007bff;
|
||||||
|
text-decoration: underline;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 0;
|
||||||
|
font-size: inherit;
|
||||||
|
}
|
|
@ -950,6 +950,17 @@ namespace HRM.UI.Controllers.Attendance
|
||||||
{
|
{
|
||||||
//items = _employeeWorkPlanSetupService.NotYetAssigned((int)currentUser.PayrollTypeID);
|
//items = _employeeWorkPlanSetupService.NotYetAssigned((int)currentUser.PayrollTypeID);
|
||||||
items = _employeeService.NotYetAssigned((int)currentUser.PayrollTypeID);
|
items = _employeeService.NotYetAssigned((int)currentUser.PayrollTypeID);
|
||||||
|
List<Grade> grades = new GradeService().Get(EnumStatus.Regardless);
|
||||||
|
int count = 0;
|
||||||
|
items.ForEach(emp =>
|
||||||
|
{
|
||||||
|
if (emp.GradeID != null)
|
||||||
|
{
|
||||||
|
Grade gr = grades.Find(g => g.ID == emp.GradeID);
|
||||||
|
emp.GradeName = gr.Name != null ? gr.Name : "";
|
||||||
|
emp.SortOrder = ++count;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user