Compare commits

..

4 Commits

10 changed files with 143 additions and 33 deletions

View File

@ -842,6 +842,21 @@ namespace HRM.DA
}
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)
{

View File

@ -1564,6 +1564,37 @@ namespace HRM.DA
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)
{

View File

@ -524,21 +524,21 @@ namespace HRM.DA
{
bulkCopy.BulkCopyTimeout = 6000; // in seconds
bulkCopy.ColumnMappings.Add("PROCESSID", "PROCESSID");
bulkCopy.ColumnMappings.Add("PROCESSMONTH", "PROCESSMONTH");
bulkCopy.ColumnMappings.Add("EMPID", "EMPID");
bulkCopy.ColumnMappings.Add("AMOUNT", "AMOUNT");
bulkCopy.ColumnMappings.Add("TERMID", "TERMID");
bulkCopy.ColumnMappings.Add("HOURS", "HOURS");
bulkCopy.ColumnMappings.Add("CREATEDBY", "CREATEDBY");
bulkCopy.ColumnMappings.Add("CREATIONDATE", "CREATIONDATE");
bulkCopy.ColumnMappings.Add("MODIFIEDBY", "MODIFIEDBY");
bulkCopy.ColumnMappings.Add("MODIFIEDDATE", "MODIFIEDDATE");
bulkCopy.ColumnMappings.Add("TERMPARAMETERID", "TERMPARAMETERID");
bulkCopy.ColumnMappings.Add("EMPOVERTIMEID", "EMPOVERTIMEID");
bulkCopy.ColumnMappings.Add("ARREARAMOUNT", "ARREARAMOUNT");
bulkCopy.ColumnMappings.Add("OTMONTH", "OTMONTH");
bulkCopy.ColumnMappings.Add("PAYROLLTYPEID", "PAYROLLTYPEID");
bulkCopy.ColumnMappings.Add("PROCESSID", "ProcessId");
bulkCopy.ColumnMappings.Add("PROCESSMONTH", "ProcessMonth");
bulkCopy.ColumnMappings.Add("EMPID", "EmpID");
bulkCopy.ColumnMappings.Add("AMOUNT", "Amount");
bulkCopy.ColumnMappings.Add("TERMID", "TermID");
bulkCopy.ColumnMappings.Add("HOURS", "Hours");
bulkCopy.ColumnMappings.Add("CREATEDBY", "CreatedBy");
bulkCopy.ColumnMappings.Add("CREATIONDATE", "CreationDate");
bulkCopy.ColumnMappings.Add("MODIFIEDBY", "ModifiedBy");
bulkCopy.ColumnMappings.Add("MODIFIEDDATE", "ModifiedDate");
bulkCopy.ColumnMappings.Add("TERMPARAMETERID", "TermParameterID");
bulkCopy.ColumnMappings.Add("EMPOVERTIMEID", "EmpOverTimeID");
bulkCopy.ColumnMappings.Add("ARREARAMOUNT", "ArrearAmount");
bulkCopy.ColumnMappings.Add("OTMONTH", "OTMonth");
bulkCopy.ColumnMappings.Add("PAYROLLTYPEID", "PayrollTypeID");
bulkCopy.DestinationTableName = "OTProcess";
@ -614,7 +614,7 @@ namespace HRM.DA
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");
int basicOnMonth = Convert.ToInt32(new SystemConfigarationService().GetconfigValue(EnumConfigurationType.Logic, "overtime", "basicondate"));
bool fixedotmonth = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "overtime", "fixedotmonth");
@ -623,7 +623,7 @@ namespace HRM.DA
PayrollType ptype = new PayrollTypeService().Get(payrolltypeid);
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>();
_EmpOvertimes = new EmployeeOverTimeService().Get(ptype.NextPayProcessDate, payrolltypeid);
double basicSalary = 0;
@ -835,13 +835,16 @@ namespace HRM.DA
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:"
+ ot.Employee.EmployeeNo + " " + ot.Employee.Name);
double nHour = ot.OTHours;
//if ((ot.OTHours - nHour) == 0)
//{
// throw new Exception("Monthly OT hours can be zero");
//}
nHour = Math.Floor(ot.OTHours);
nHour += (ot.OTHours - nHour) * 100 / 60;
//double nHour = ot.OTHours;
////if ((ot.OTHours - nHour) == 0)
////{
//// throw new Exception("Monthly OT hours can be zero");
////}
//nHour = Math.Floor(ot.OTHours);
//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)
{
case EnumOverTimeType.AnyAmount:
@ -853,7 +856,7 @@ namespace HRM.DA
case EnumOverTimeType.FixedAmount:
return ot.OTHours ;
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:
return ot.OTHours * tparam.Amount;
case EnumOverTimeType.HoursOfMonth:
@ -911,8 +914,8 @@ namespace HRM.DA
process.OTMonth = GlobalFunctions.LastDateOfMonth(ot.OTMonth);
process.TermID = ot.TermID;
process.TermParameterID = ot.TermParameterID;
process.TotalHour = ot.OTHours;
process.Amount = this.GetPayableAmount(ot, nBasic);
process.TotalHour = Math.Round(ot.OTHours, 2);
process.Amount = Math.Round(this.GetPayableAmount(ot, Math.Round(nBasic)));
process.PayrollTypeID = ot.PayrollTypeID;
return process;

View File

@ -13,7 +13,8 @@ export class ApiService {
public isSSO = 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 base_url = '';
// public currentLink = '';

View File

@ -59,13 +59,21 @@
<div class="p-col-12 p-md-5">
<div class="p-col-12">
<!-- <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 class="p-col-12" *ngIf="lastProcessDate != null">
<label style="color: red;" for="txtWP">Last Process date : {{ lastProcessDate != null ? (lastProcessDate | date: 'dd MMM yyyy') : '' }}</label>
</div>
<div class="p-col-12">
<button icon="rotate"
<button icon="cogs"
kendoButton
class="k-button k-primary"
(click)="onSave($event)">
@ -79,3 +87,26 @@
</div>
</div>
</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>

View File

@ -26,6 +26,7 @@ export class AttendanceProcessComponent {
lastProcessDate: Date;
processStatus: string = "";
withEmployee: boolean = false;
showModal: boolean = false;
constructor(public attnService: AttendanceServices, public datatransferservice: DataTransferService,
public loadingPanel: loadingPanelService,
public notificationService: HRMNotificationService,
@ -43,6 +44,7 @@ export class AttendanceProcessComponent {
this.attnService.getNotYetAssiged().subscribe(
(x) => {
this.employees = x;
debugger
},
(x) => {
},
@ -137,4 +139,7 @@ export class AttendanceProcessComponent {
this.withEmployee = true;
}
public onClickNotInWorkPlanEmployee() {
this.showModal = true;
}
}

View File

@ -6,6 +6,8 @@ import { InputsModule, TextBoxModule } from '@progress/kendo-angular-inputs';
import { ChartsModule } from '@progress/kendo-angular-charts';
import { CardModule as kendoCardModule } from '@progress/kendo-angular-layout';
import { DialogsModule } from '@progress/kendo-angular-dialog';
import { DialogModule } from 'primeng/dialog';
import { ScrollPanelModule } from 'primeng/scrollpanel';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { PanelModule } from 'primeng/panel';
import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
@ -81,6 +83,8 @@ import { OrganizationManagementModule } from '../organization-management/organiz
FormsModule,
ReactiveFormsModule,
DialogsModule,
DialogModule,
ScrollPanelModule,
CommonModule,
GridModule,
InputsModule,

View File

@ -3954,7 +3954,7 @@ p-treeselect.ng-invalid.ng-dirty > .p-treeselect {
border-bottom: 0 none;
/* background: #ffffff;
color: #495057; */
padding: 12px 16px;
padding: 10px 16px;
border-top-right-radius: 4px;
border-top-left-radius: 4px;
background: #52527a;
@ -3990,7 +3990,7 @@ p-treeselect.ng-invalid.ng-dirty > .p-treeselect {
.p-dialog .p-dialog-content {
background: #ffffff;
color: #495057;
padding: 0 1.5rem 2rem 1.5rem;
padding: 1rem 1.5rem 1rem 1.5rem;
}
.p-dialog .p-dialog-footer {
border-top: 0 none;

View File

@ -437,3 +437,12 @@ Menu Custom Code End
/* max-height: 100%;
background-color: white !important; */
}
.link-button {
background: none;
border: none;
color: #007bff;
text-decoration: underline;
cursor: pointer;
padding: 0;
font-size: inherit;
}

View File

@ -950,6 +950,17 @@ namespace HRM.UI.Controllers.Attendance
{
//items = _employeeWorkPlanSetupService.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)
{