Compare commits
5 Commits
1ce3ff8a14
...
bf55c6674a
Author | SHA1 | Date | |
---|---|---|---|
bf55c6674a | |||
6b9726d850 | |||
|
cd9c836c62 | ||
616cb5d748 | |||
ea05eb3440 |
|
@ -370,6 +370,7 @@ namespace HRM.BO
|
||||||
List<SearchEmployee> FindCordinator(int? id, int? payrollTypeID);
|
List<SearchEmployee> FindCordinator(int? id, int? payrollTypeID);
|
||||||
List<SearchEmployee> FindEmpCodeName(int payrolltypeid, string code, string name);
|
List<SearchEmployee> FindEmpCodeName(int payrolltypeid, string code, string name);
|
||||||
List<SearchEmployee> FindEmpCodeNameForEmployeePicker(int userid, int payrolltypeid, string code, string name);
|
List<SearchEmployee> FindEmpCodeNameForEmployeePicker(int userid, int payrolltypeid, string code, string name);
|
||||||
|
List<SearchEmployee> FindEmpCodeNameForEmployeePickerNew(int userid, int payrolltypeid, string code, string name, bool isForLifeCycle);
|
||||||
SearchEmployee get(int empid);
|
SearchEmployee get(int empid);
|
||||||
List<SearchEmployee> GetEmployeeNotYetUser(int payrollTypeID);
|
List<SearchEmployee> GetEmployeeNotYetUser(int payrollTypeID);
|
||||||
List<SearchEmployee> GetTeam(int employeeid);
|
List<SearchEmployee> GetTeam(int employeeid);
|
||||||
|
|
|
@ -391,6 +391,168 @@ END;";
|
||||||
// recurSqlClause, top, sqlClause, recurWhereClause, orderby);
|
// recurSqlClause, top, sqlClause, recurWhereClause, orderby);
|
||||||
|
|
||||||
|
|
||||||
|
string finalSQl = SQLParser.MakeSQL(
|
||||||
|
"%q Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q %q " +
|
||||||
|
" UNION Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q " +
|
||||||
|
" Order by %s",
|
||||||
|
recurSqlClause, top, sqlClause, recurWhereClause, top, sqlClause, orderby);
|
||||||
|
|
||||||
|
return tc.ExecuteReader(finalSQl);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static IDataReader SearchForEmployeePickerNew(TransactionContext tc, int userID, int payrollTypeID, string code, string name, bool isForLifeCycle)
|
||||||
|
{
|
||||||
|
string orderby = "name";
|
||||||
|
string sqlClause = "";
|
||||||
|
string top = "";
|
||||||
|
|
||||||
|
string recurSqlClause = SQLParser.MakeSQL(@"
|
||||||
|
DECLARE @userid INT = %n;
|
||||||
|
DECLARE @payrolltypeid INT = %n;
|
||||||
|
DECLARE @permissionstatus INT = %n;
|
||||||
|
WITH RecursiveCategory AS
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
CATEGORYID
|
||||||
|
FROM
|
||||||
|
dbo.CATEGORY
|
||||||
|
WHERE
|
||||||
|
CATEGORYID IN (
|
||||||
|
SELECT REFERENCEID
|
||||||
|
FROM DATAPERMISSION
|
||||||
|
WHERE USERID = @userid
|
||||||
|
AND PAYROLLTYPEID = @payrolltypeid
|
||||||
|
AND PERMISSIONSTATUS = @permissionstatus
|
||||||
|
AND PERMISSIONTYPE = %n
|
||||||
|
)
|
||||||
|
),
|
||||||
|
RecursiveGrade AS
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
GRADEID
|
||||||
|
FROM
|
||||||
|
dbo.GRADES
|
||||||
|
WHERE
|
||||||
|
GRADEID IN (
|
||||||
|
SELECT REFERENCEID
|
||||||
|
FROM DATAPERMISSION
|
||||||
|
WHERE USERID = @userid
|
||||||
|
AND PAYROLLTYPEID = @payrolltypeid
|
||||||
|
AND PERMISSIONSTATUS = @permissionstatus
|
||||||
|
AND PERMISSIONTYPE = %n
|
||||||
|
)
|
||||||
|
),
|
||||||
|
RecursiveDepartment AS
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
DEPARTMENTID
|
||||||
|
FROM
|
||||||
|
dbo.DEPARTMENT
|
||||||
|
WHERE
|
||||||
|
DEPARTMENTID IN (
|
||||||
|
SELECT REFERENCEID
|
||||||
|
FROM DATAPERMISSION
|
||||||
|
WHERE USERID = @userid
|
||||||
|
AND PAYROLLTYPEID = @payrolltypeid
|
||||||
|
AND PERMISSIONSTATUS = @permissionstatus
|
||||||
|
AND PERMISSIONTYPE = %n
|
||||||
|
)
|
||||||
|
UNION ALL
|
||||||
|
SELECT
|
||||||
|
d.DEPARTMENTID
|
||||||
|
FROM
|
||||||
|
dbo.DEPARTMENT d
|
||||||
|
INNER JOIN
|
||||||
|
RecursiveDepartment rd
|
||||||
|
ON
|
||||||
|
d.PARENTID = rd.DEPARTMENTID
|
||||||
|
),
|
||||||
|
RecursiveLocation AS
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
LOCATIONID
|
||||||
|
FROM
|
||||||
|
dbo.LOCATION
|
||||||
|
WHERE
|
||||||
|
LOCATIONID IN (
|
||||||
|
SELECT REFERENCEID
|
||||||
|
FROM DATAPERMISSION
|
||||||
|
WHERE USERID = @userid
|
||||||
|
AND PAYROLLTYPEID = @payrolltypeid
|
||||||
|
AND PERMISSIONSTATUS = @permissionstatus
|
||||||
|
AND PERMISSIONTYPE = %n
|
||||||
|
)
|
||||||
|
UNION ALL
|
||||||
|
SELECT
|
||||||
|
l.LOCATIONID
|
||||||
|
FROM
|
||||||
|
dbo.LOCATION l
|
||||||
|
INNER JOIN
|
||||||
|
RecursiveLocation rl
|
||||||
|
ON
|
||||||
|
l.PARENTID = rl.LOCATIONID
|
||||||
|
)", userID, payrollTypeID, EnumMenuPermissionStatus.Approved, EnumDataPermissionType.Cagtegory, EnumDataPermissionType.Grade, EnumDataPermissionType.Department, EnumDataPermissionType.Location);
|
||||||
|
string recurWhereClause = SQLParser.MakeSQL(@"
|
||||||
|
AND
|
||||||
|
(
|
||||||
|
(
|
||||||
|
EXISTS (SELECT 1 FROM RecursiveCategory)
|
||||||
|
AND CATEGORYID IN (SELECT CATEGORYID FROM RecursiveCategory)
|
||||||
|
)
|
||||||
|
OR
|
||||||
|
(
|
||||||
|
EXISTS (SELECT 1 FROM RecursiveGrade)
|
||||||
|
AND GRADEID IN (SELECT GRADEID FROM RecursiveGrade)
|
||||||
|
)
|
||||||
|
OR
|
||||||
|
(
|
||||||
|
EXISTS (SELECT 1 FROM RecursiveDepartment)
|
||||||
|
AND DEPARTMENTID IN (SELECT DEPARTMENTID FROM RecursiveDepartment)
|
||||||
|
)
|
||||||
|
OR
|
||||||
|
(
|
||||||
|
EXISTS (SELECT 1 FROM RecursiveLocation)
|
||||||
|
AND LOCATIONID IN (SELECT LOCATIONID FROM RecursiveLocation)
|
||||||
|
)
|
||||||
|
)");
|
||||||
|
|
||||||
|
//Previous Code For only Live Employee
|
||||||
|
//sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("PayrollTypeID =%n AND Status = %n", payrollTypeID, EnumStatus.Active);
|
||||||
|
|
||||||
|
//New Code For live And Waitiong for join Employee
|
||||||
|
if (isForLifeCycle == true)
|
||||||
|
{
|
||||||
|
sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("PayrollTypeID =%n ", payrollTypeID);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("PayrollTypeID =%n AND (Status = %n OR Status = %n)", payrollTypeID, EnumEmployeeStatus.Live, EnumEmployeeStatus.Waitingforjoin);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (code != string.Empty)
|
||||||
|
{
|
||||||
|
//Previous with suggestion
|
||||||
|
//sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("EmployeeNo LIKE %s", ("%" + code + "%"));
|
||||||
|
//orderby = "EmployeeNo";
|
||||||
|
|
||||||
|
//Using TOP
|
||||||
|
//sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("EmployeeNo LIKE %s", ( code + "%")); // Using LIKE Operator
|
||||||
|
sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("EmployeeNo = %s", (code)); // Without Using LIKE Operator
|
||||||
|
orderby = "EmployeeNo";
|
||||||
|
top = "TOP 5";
|
||||||
|
|
||||||
|
//Without suggestion
|
||||||
|
//sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("EmployeeNo = %s", code );
|
||||||
|
//orderby = "EmployeeNo";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (name != string.Empty)
|
||||||
|
sqlClause = SQLParser.TagSQL(sqlClause) + SQLParser.MakeSQL("Name LIKE %s", ("%" + name + "%"));
|
||||||
|
//string finalSQl = SQLParser.MakeSQL(
|
||||||
|
// "%q Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q %q Order by %s",
|
||||||
|
// recurSqlClause, top, sqlClause, recurWhereClause, orderby);
|
||||||
|
|
||||||
|
|
||||||
string finalSQl = SQLParser.MakeSQL(
|
string finalSQl = SQLParser.MakeSQL(
|
||||||
"%q Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q %q " +
|
"%q Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q %q " +
|
||||||
" UNION Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q " +
|
" UNION Select %q EmployeeID, EmployeeNo, Name, categoryID, GradeID, LocationID, designationid, DepartmentID From Employee %q " +
|
||||||
|
|
|
@ -2101,7 +2101,7 @@ namespace HRM.DA
|
||||||
AttnWiseAllowance attnAllow = new AttnWiseAllowance();
|
AttnWiseAllowance attnAllow = new AttnWiseAllowance();
|
||||||
|
|
||||||
// List<Employee> employees = new EmployeeService().GetByEmpIDs("352,70");
|
// List<Employee> employees = new EmployeeService().GetByEmpIDs("352,70");
|
||||||
List<Employee> employees = new EmployeeService().GetAllEmps();
|
List<Employee> employees = new EmployeeService().GetAllLive();
|
||||||
List<ADParameter> oadParameters = new ADParameterService().GetWithDetail(EnumStatus.Active, PayrollTypeId);
|
List<ADParameter> oadParameters = new ADParameterService().GetWithDetail(EnumStatus.Active, PayrollTypeId);
|
||||||
PayrollType oPayrollType = new PayrollTypeService().Get(PayrollTypeId);
|
PayrollType oPayrollType = new PayrollTypeService().Get(PayrollTypeId);
|
||||||
List<TermParameter> termParameters = tps.GetwithDetail(oPayrollType.ID);
|
List<TermParameter> termParameters = tps.GetwithDetail(oPayrollType.ID);
|
||||||
|
@ -2132,7 +2132,7 @@ namespace HRM.DA
|
||||||
Employee oemp = employees.FirstOrDefault(x => x.ID == Convert.ToInt32(oRow["EMPLOYEEID"].ToString()));
|
Employee oemp = employees.FirstOrDefault(x => x.ID == Convert.ToInt32(oRow["EMPLOYEEID"].ToString()));
|
||||||
if (oemp == null)
|
if (oemp == null)
|
||||||
{
|
{
|
||||||
ErrorList.Add(new SalaryProcessStatus("", "", " Employee not found, Internal ID:" + oRow["EMPLOYEEID"].ToString()));
|
// ErrorList.Add(new SalaryProcessStatus("", "", " Employee not found, Internal ID:" + oRow["EMPLOYEEID"].ToString()));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2454,8 +2454,8 @@ namespace HRM.DA
|
||||||
DataSet EmpOTHours = new ShiftTermService().GetEmpOT(oPayrollType.NextPayProcessDate, trm.ID);
|
DataSet EmpOTHours = new ShiftTermService().GetEmpOT(oPayrollType.NextPayProcessDate, trm.ID);
|
||||||
foreach (DataRow Dr in EmpOTHours.Tables[0].Rows)
|
foreach (DataRow Dr in EmpOTHours.Tables[0].Rows)
|
||||||
{
|
{
|
||||||
//if (Convert.ToDouble(Dr["TotalOT"])>0)
|
if (Convert.ToDouble(Dr["TotalOT"]) > 0)
|
||||||
//{
|
{
|
||||||
Employee tempEmployee = employees.Where(emp => emp.ID.ToString() == Dr["EmployeeID"].ToString()).FirstOrDefault();
|
Employee tempEmployee = employees.Where(emp => emp.ID.ToString() == Dr["EmployeeID"].ToString()).FirstOrDefault();
|
||||||
if (tempEmployee == null || tempEmployee.IsEligibleOT == false) continue;
|
if (tempEmployee == null || tempEmployee.IsEligibleOT == false) continue;
|
||||||
|
|
||||||
|
@ -2473,7 +2473,7 @@ namespace HRM.DA
|
||||||
|
|
||||||
EmpOverTimes = MakeEmployeeOvertimeObj(ref EmpOverTimes, ref ErrorList, tempEmployee, termParameters,
|
EmpOverTimes = MakeEmployeeOvertimeObj(ref EmpOverTimes, ref ErrorList, tempEmployee, termParameters,
|
||||||
oPayrollType, trm.ID, Convert.ToDouble(Dr["TotalOT"]), userid);
|
oPayrollType, trm.ID, Convert.ToDouble(Dr["TotalOT"]), userid);
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -326,6 +326,43 @@ namespace HRM.DA
|
||||||
return searchEmployees;
|
return searchEmployees;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<SearchEmployee> FindEmpCodeNameForEmployeePickerNew(int userID, int payrollTypeID, string code, string name, bool isForLifeCycle)
|
||||||
|
{
|
||||||
|
List<SearchEmployee> searchEmployees = new List<SearchEmployee>();
|
||||||
|
|
||||||
|
TransactionContext tc = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
tc = TransactionContext.Begin();
|
||||||
|
|
||||||
|
DataReader dr = new DataReader(SearchEmployeeDA.SearchForEmployeePickerNew(tc, userID, payrollTypeID, code, name, isForLifeCycle));
|
||||||
|
searchEmployees = this.CreateObjects<SearchEmployee>(dr);
|
||||||
|
//while (dr.Read())
|
||||||
|
//{
|
||||||
|
// SearchEmployee item = new SearchEmployee();
|
||||||
|
// item.Name = dr.GetString("name");
|
||||||
|
// item.EmployeeNo = dr.GetString("employeeNo");
|
||||||
|
|
||||||
|
// searchEmployees.Add(item);
|
||||||
|
//}
|
||||||
|
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 searchEmployees;
|
||||||
|
}
|
||||||
|
|
||||||
public List<SearchEmployee> GetEmployeeNotYetUser(int payrollTypeID)
|
public List<SearchEmployee> GetEmployeeNotYetUser(int payrollTypeID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace HRM.Report
|
||||||
oDR["EmoNo"] = oDRow["EmployeeNo"];
|
oDR["EmoNo"] = oDRow["EmployeeNo"];
|
||||||
oDR["Name"] = oDRow["EmpName"];
|
oDR["Name"] = oDRow["EmpName"];
|
||||||
oDR["OTDescription"] = oDRow["TermName"];
|
oDR["OTDescription"] = oDRow["TermName"];
|
||||||
oDR["OTRate"] = oDRow["Hours"];
|
oDR["OTRate"] = GlobalFunctions.ConvertDoubleHourToHourMinute(Convert.ToDouble(oDRow["Hours"])); //oDRow["Hours"];
|
||||||
oDR["OTAmount"] = GlobalFunctions.Round(Convert.ToDouble(oDRow["Amount"])); // Math.Round(oDRow["Amount"]);
|
oDR["OTAmount"] = GlobalFunctions.Round(Convert.ToDouble(oDRow["Amount"])); // Math.Round(oDRow["Amount"]);
|
||||||
//oDR["OTMonth"] = Convert.ToDateTime(oDRow["ProcessMonth"]).ToString("dd MMM yyyy");
|
//oDR["OTMonth"] = Convert.ToDateTime(oDRow["ProcessMonth"]).ToString("dd MMM yyyy");
|
||||||
oDR["OTMonth"] = Convert.ToDateTime(oDRow["OTMonth"]).ToString("dd MMM yyyy");
|
oDR["OTMonth"] = Convert.ToDateTime(oDRow["OTMonth"]).ToString("dd MMM yyyy");
|
||||||
|
|
|
@ -18741,7 +18741,7 @@ namespace HRM.Report.PayrollDataSet {
|
||||||
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
public OTMonthlySheetRow AddOTMonthlySheetRow(string EmoNo, string Name, string OTDescription, double OTRate, double OTAmount, System.DateTime OTMonth, string SLNo, double Basic, string SeqNo) {
|
public OTMonthlySheetRow AddOTMonthlySheetRow(string EmoNo, string Name, string OTDescription, string OTRate, double OTAmount, System.DateTime OTMonth, string SLNo, double Basic, string SeqNo) {
|
||||||
OTMonthlySheetRow rowOTMonthlySheetRow = ((OTMonthlySheetRow)(this.NewRow()));
|
OTMonthlySheetRow rowOTMonthlySheetRow = ((OTMonthlySheetRow)(this.NewRow()));
|
||||||
object[] columnValuesArray = new object[] {
|
object[] columnValuesArray = new object[] {
|
||||||
EmoNo,
|
EmoNo,
|
||||||
|
@ -18795,7 +18795,7 @@ namespace HRM.Report.PayrollDataSet {
|
||||||
base.Columns.Add(this.columnName);
|
base.Columns.Add(this.columnName);
|
||||||
this.columnOTDescription = new global::System.Data.DataColumn("OTDescription", typeof(string), null, global::System.Data.MappingType.Element);
|
this.columnOTDescription = new global::System.Data.DataColumn("OTDescription", typeof(string), null, global::System.Data.MappingType.Element);
|
||||||
base.Columns.Add(this.columnOTDescription);
|
base.Columns.Add(this.columnOTDescription);
|
||||||
this.columnOTRate = new global::System.Data.DataColumn("OTRate", typeof(double), null, global::System.Data.MappingType.Element);
|
this.columnOTRate = new global::System.Data.DataColumn("OTRate", typeof(string), null, global::System.Data.MappingType.Element);
|
||||||
base.Columns.Add(this.columnOTRate);
|
base.Columns.Add(this.columnOTRate);
|
||||||
this.columnOTAmount = new global::System.Data.DataColumn("OTAmount", typeof(double), null, global::System.Data.MappingType.Element);
|
this.columnOTAmount = new global::System.Data.DataColumn("OTAmount", typeof(double), null, global::System.Data.MappingType.Element);
|
||||||
base.Columns.Add(this.columnOTAmount);
|
base.Columns.Add(this.columnOTAmount);
|
||||||
|
@ -94139,10 +94139,10 @@ namespace HRM.Report.PayrollDataSet {
|
||||||
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "17.0.0.0")]
|
||||||
public double OTRate {
|
public string OTRate {
|
||||||
get {
|
get {
|
||||||
try {
|
try {
|
||||||
return ((double)(this[this.tableOTMonthlySheet.OTRateColumn]));
|
return ((string)(this[this.tableOTMonthlySheet.OTRateColumn]));
|
||||||
}
|
}
|
||||||
catch (global::System.InvalidCastException e) {
|
catch (global::System.InvalidCastException e) {
|
||||||
throw new global::System.Data.StrongTypingException("The value for column \'OTRate\' in table \'OTMonthlySheet\' is DBNull.", e);
|
throw new global::System.Data.StrongTypingException("The value for column \'OTRate\' in table \'OTMonthlySheet\' is DBNull.", e);
|
||||||
|
|
|
@ -105,6 +105,12 @@ export class EmployeeServices {
|
||||||
|
|
||||||
return this.apiService.httpGet<SearchEmployee[]>('/Employee/getEmpCodeNameForEmployeePickerInput' + '/' + ncode + '/' + nname);
|
return this.apiService.httpGet<SearchEmployee[]>('/Employee/getEmpCodeNameForEmployeePickerInput' + '/' + ncode + '/' + nname);
|
||||||
}
|
}
|
||||||
|
getEmpCodeNameForEmployeePickerInputNew(code?: string, name?: string, isForLifeCycle? : boolean) {
|
||||||
|
let nname = this.apiService.getApiDefaultData(name);
|
||||||
|
let ncode = this.apiService.getApiDefaultData(code);
|
||||||
|
let nIsForLifeCycle = this.apiService.getApiDefaultBoolData(isForLifeCycle);
|
||||||
|
return this.apiService.httpGet<SearchEmployee[]>('/Employee/getEmpCodeNameForEmployeePickerInputNew' + '/' + ncode + '/' + nname + '/' + nIsForLifeCycle);
|
||||||
|
}
|
||||||
|
|
||||||
getEmployees() {
|
getEmployees() {
|
||||||
return this.apiService.httpGet(this.apiService.base_url + 'getemployees');
|
return this.apiService.httpGet(this.apiService.base_url + 'getemployees');
|
||||||
|
|
|
@ -168,6 +168,10 @@ export class ApiService {
|
||||||
return (str === undefined || str === null || str.trim() === '') ? undefined : str;
|
return (str === undefined || str === null || str.trim() === '') ? undefined : str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getApiDefaultBoolData(value: boolean) {
|
||||||
|
return (value === undefined || value === null) ? false : value;
|
||||||
|
}
|
||||||
|
|
||||||
getApiDateString(dDate: Date) {
|
getApiDateString(dDate: Date) {
|
||||||
if (dDate === undefined || dDate === null) {
|
if (dDate === undefined || dDate === null) {
|
||||||
return dDate;
|
return dDate;
|
||||||
|
|
|
@ -282,6 +282,9 @@
|
||||||
set
|
set
|
||||||
</button>
|
</button>
|
||||||
<kendo-grid-spacer></kendo-grid-spacer>
|
<kendo-grid-spacer></kendo-grid-spacer>
|
||||||
|
<label for="status" style="font-weight: bold;">Remarks</label>
|
||||||
|
<kendo-textbox placeholder="Remarks" [(ngModel)]="_remarks" style="width: 30%;"></kendo-textbox>
|
||||||
|
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<kendo-grid-column field="shiftID" title="Date" width="8%">
|
<kendo-grid-column field="shiftID" title="Date" width="8%">
|
||||||
<ng-template kendoGridCellTemplate let-dataItem>
|
<ng-template kendoGridCellTemplate let-dataItem>
|
||||||
|
|
|
@ -39,6 +39,7 @@ export class AttendanceManualEditForSingleEmployeeComponent implements OnInit {
|
||||||
selectedOutTime: Date;
|
selectedOutTime: Date;
|
||||||
dailyAttenProcessList: DailyAttnProcess[];
|
dailyAttenProcessList: DailyAttnProcess[];
|
||||||
_overTime: number = 0;
|
_overTime: number = 0;
|
||||||
|
_remarks: string = "";
|
||||||
statusList = [
|
statusList = [
|
||||||
{ value: 1, name: 'Present' },
|
{ value: 1, name: 'Present' },
|
||||||
{ value: 2, name: 'Absent' },
|
{ value: 2, name: 'Absent' },
|
||||||
|
@ -223,6 +224,9 @@ export class AttendanceManualEditForSingleEmployeeComponent implements OnInit {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.dailyAttenProcessList.forEach(x => {
|
this.dailyAttenProcessList.forEach(x => {
|
||||||
|
if(this._remarks){
|
||||||
|
x.comments = this._remarks;
|
||||||
|
}
|
||||||
x.isManualEntry = true;
|
x.isManualEntry = true;
|
||||||
if (x.wfStatus != EnumWFAttnStatus.None) {
|
if (x.wfStatus != EnumWFAttnStatus.None) {
|
||||||
this.notificationService.showError(x.attnDate.toDateString() +" is in approval stage, so manual edit is not allowed");
|
this.notificationService.showError(x.attnDate.toDateString() +" is in approval stage, so manual edit is not allowed");
|
||||||
|
|
|
@ -207,7 +207,6 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit
|
||||||
}
|
}
|
||||||
|
|
||||||
updateobject(type: number) {
|
updateobject(type: number) {
|
||||||
debugger;
|
|
||||||
if (this.selectedRemarks != undefined) {
|
if (this.selectedRemarks != undefined) {
|
||||||
if (this.remarksList.find(y => y.value == this.selectedRemarks).name == "Other") {
|
if (this.remarksList.find(y => y.value == this.selectedRemarks).name == "Other") {
|
||||||
this.isOtherRemarks = true;
|
this.isOtherRemarks = true;
|
||||||
|
@ -215,6 +214,13 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit
|
||||||
this.isOtherRemarks = false;
|
this.isOtherRemarks = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (type == 3){
|
||||||
|
let oShift : Shift = this.shifts.find(x => x.id === this.selectedShiftID);
|
||||||
|
if(oShift && oShift.id > 0){
|
||||||
|
this.selectInTime = new Date(oShift.inTime);
|
||||||
|
this.selectedOutTime = new Date(oShift.outTime);
|
||||||
|
}
|
||||||
|
}
|
||||||
this.dailyAttenProcessList.forEach(x => {
|
this.dailyAttenProcessList.forEach(x => {
|
||||||
if (type == 1) {
|
if (type == 1) {
|
||||||
x.actualInTime = x.inTime;
|
x.actualInTime = x.inTime;
|
||||||
|
@ -366,6 +372,12 @@ export class AttendanceManualEditForMultipleEmployeeComponent implements OnInit
|
||||||
}
|
}
|
||||||
var msg: string = "";
|
var msg: string = "";
|
||||||
this.dailyAttenProcessList.forEach(x => {
|
this.dailyAttenProcessList.forEach(x => {
|
||||||
|
if(this.selectedRemarks){
|
||||||
|
let remarks = this.remarksList.find(y => y.value == this.selectedRemarks);
|
||||||
|
if(remarks){
|
||||||
|
x.comments = remarks.name;
|
||||||
|
}
|
||||||
|
}
|
||||||
x.isManualEntry = true;
|
x.isManualEntry = true;
|
||||||
if (x.wfStatus != EnumWFAttnStatus.None) {
|
if (x.wfStatus != EnumWFAttnStatus.None) {
|
||||||
msg = msg + "Employee: " + x.employee.employeeNo + ". Datais in approval stage, so manual edit is not allowed; ";
|
msg = msg + "Employee: " + x.employee.employeeNo + ". Datais in approval stage, so manual edit is not allowed; ";
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!newEmployee" class="p-col-12 p-lg-4">
|
<div *ngIf="!newEmployee" class="p-col-12 p-lg-4">
|
||||||
<app-employee-picker [isActive]="!newEmployee"
|
<app-employee-picker [isActive]="!newEmployee" [ForLifeCycleSearch]="true"
|
||||||
(ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker>
|
(ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="newEmployee" class="p-col-12 p-lg-4">
|
<div *ngIf="newEmployee" class="p-col-12 p-lg-4">
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="p-col-12 p-md-12 p-lg-6" style="margin:auto;">
|
<div class="p-col-12 p-md-12 p-lg-6" style="margin:auto;">
|
||||||
<app-employee-picker for="chkIsnew" id="idself" [isActive]="!newEmployee"
|
<app-employee-picker for="chkIsnew" id="idself" [isActive]="!newEmployee"
|
||||||
[setSelectedEmp]="selectedEmployee"
|
[setSelectedEmp]="selectedEmployee" [ForLifeCycleSearch]="true"
|
||||||
(ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker>
|
(ItemSelected)="GetSelectedEmployee($event)"></app-employee-picker>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
(ItemSelected)="GetSelectedEmployee($event)"
|
(ItemSelected)="GetSelectedEmployee($event)"
|
||||||
[setSelectedEmp]="_pickerSelecteEmp"
|
[setSelectedEmp]="_pickerSelecteEmp"
|
||||||
[isActive]="empPickerActive"
|
[isActive]="empPickerActive"
|
||||||
|
[ForLifeCycleSearch]="true"
|
||||||
></app-employee-picker>
|
></app-employee-picker>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -102,10 +102,10 @@ export class EmployeePickerComponent implements OnInit {
|
||||||
isSpanArrowDown: boolean = true;
|
isSpanArrowDown: boolean = true;
|
||||||
isSpanArrowUp: boolean = false;
|
isSpanArrowUp: boolean = false;
|
||||||
gridHeight: number = 305;
|
gridHeight: number = 305;
|
||||||
|
|
||||||
@Input() public payrollTypeID: number;
|
@Input() public payrollTypeID: number;
|
||||||
@Input() public isRecruitment: number;
|
@Input() public isRecruitment: number;
|
||||||
@Input() public set isClear(value) {
|
@Input() public set isClear(value) {
|
||||||
debugger;
|
|
||||||
if (value) {
|
if (value) {
|
||||||
this.selectedItems = [];
|
this.selectedItems = [];
|
||||||
// this.count=0;
|
// this.count=0;
|
||||||
|
@ -187,6 +187,11 @@ export class EmployeePickerComponent implements OnInit {
|
||||||
/** role-permission-entry ctor */
|
/** role-permission-entry ctor */
|
||||||
@Input() fixedGrades: number[] = undefined;
|
@Input() fixedGrades: number[] = undefined;
|
||||||
|
|
||||||
|
private _isForLifeCycle = false;
|
||||||
|
@Input()
|
||||||
|
public set ForLifeCycleSearch(value: boolean) {
|
||||||
|
this._isForLifeCycle = value ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
public pageSize = 25;
|
public pageSize = 25;
|
||||||
public skip = 0;
|
public skip = 0;
|
||||||
|
@ -454,10 +459,10 @@ export class EmployeePickerComponent implements OnInit {
|
||||||
} else {
|
} else {
|
||||||
name = value;
|
name = value;
|
||||||
}
|
}
|
||||||
|
debugger;
|
||||||
|
if(this._isForLifeCycle === false){
|
||||||
this.loadingEmployee = true;
|
this.loadingEmployee = true;
|
||||||
// this.empSrvc.getEmpCodeName(code, name)
|
this.empSrvc.getEmpCodeNameForEmployeePickerInput(code, name).subscribe(
|
||||||
this.empSrvc.getEmpCodeNameForEmployeePickerInput(code, name)
|
|
||||||
.subscribe(
|
|
||||||
(resp: any) => {
|
(resp: any) => {
|
||||||
this.searchEmployees = resp;
|
this.searchEmployees = resp;
|
||||||
},
|
},
|
||||||
|
@ -470,14 +475,36 @@ export class EmployeePickerComponent implements OnInit {
|
||||||
this.loadingEmployee = false;
|
this.loadingEmployee = false;
|
||||||
this.empCodeNameListSource = [];
|
this.empCodeNameListSource = [];
|
||||||
this.searchEmployees.forEach(x => {
|
this.searchEmployees.forEach(x => {
|
||||||
|
|
||||||
this.empCodeNameListSource.push(x.employeeNo + ' ' + x.name);
|
this.empCodeNameListSource.push(x.employeeNo + ' ' + x.name);
|
||||||
});
|
});
|
||||||
this.empCodeNameList = this.empCodeNameListSource.filter((s) =>
|
this.empCodeNameList = this.empCodeNameListSource.filter((s) =>
|
||||||
s.toLowerCase().indexOf(value.toLowerCase()) !== -1);
|
s.toLowerCase().indexOf(value.toLowerCase()) !== -1);
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
this.loadingEmployee = true;
|
||||||
|
this.empSrvc.getEmpCodeNameForEmployeePickerInputNew(code, name, this._isForLifeCycle).subscribe(
|
||||||
|
(resp: any) => {
|
||||||
|
this.searchEmployees = resp;
|
||||||
|
},
|
||||||
|
(err: any) => {
|
||||||
|
// ON ERROR
|
||||||
|
this.loadingEmployee = false;
|
||||||
|
},
|
||||||
|
() => {
|
||||||
|
// ON Success
|
||||||
|
this.loadingEmployee = false;
|
||||||
|
this.empCodeNameListSource = [];
|
||||||
|
this.searchEmployees.forEach(x => {
|
||||||
|
this.empCodeNameListSource.push(x.employeeNo + ' ' + x.name);
|
||||||
|
});
|
||||||
|
this.empCodeNameList = this.empCodeNameListSource.filter((s) =>
|
||||||
|
s.toLowerCase().indexOf(value.toLowerCase()) !== -1);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/*} else {
|
/*} else {
|
||||||
|
|
||||||
this.empCodeNameList = this.empCodeNameListSource.filter((s) =>
|
this.empCodeNameList = this.empCodeNameListSource.filter((s) =>
|
||||||
|
|
|
@ -822,6 +822,53 @@ namespace HRM.UI.Controllers
|
||||||
return Ok(olist);
|
return Ok(olist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet("getEmpCodeNameForEmployeePickerInputNew/{code}/{name}/{isForLifeCycle}")]
|
||||||
|
public ActionResult getEmpCodeNameForEmployeePickerInputNew(string code, string name, bool isForLifeCycle)
|
||||||
|
{
|
||||||
|
code = GlobalFunctions.GetApiDefaultData(code);
|
||||||
|
name = GlobalFunctions.GetApiDefaultData(name);
|
||||||
|
|
||||||
|
CurrentUser currentUser = CurrentUser.GetCurrentUser(HttpContext.User);
|
||||||
|
List<SearchEmployee> olist = new List<SearchEmployee>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
//olist = _serachManager.FindEmpCodeName((int) currentUser.PayrollTypeID, code, name);
|
||||||
|
if (code != "")
|
||||||
|
{
|
||||||
|
List<SearchEmployee> unorderedList = _serachManager.FindEmpCodeNameForEmployeePickerNew((int)currentUser.UserID, (int)currentUser.PayrollTypeID, code, name, isForLifeCycle);
|
||||||
|
|
||||||
|
olist = unorderedList
|
||||||
|
.OrderBy(item => item.EmployeeNo != code) // False (0) for priority value, True (1) for others
|
||||||
|
.ThenBy(item => item.EmployeeNo).ToList();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
olist = _serachManager.FindEmpCodeNameForEmployeePickerNew((int)currentUser.UserID, (int)currentUser.PayrollTypeID, code, name, isForLifeCycle);
|
||||||
|
}
|
||||||
|
|
||||||
|
//List<Grade> grades = new GradeService().Get(EnumStatus.Regardless, (int)currentUser.PayrollTypeID);
|
||||||
|
//List<Designation> designations = new DesignationService().Get(EnumStatus.Regardless, (int)currentUser.PayrollTypeID);
|
||||||
|
//List<Department> departments = new DepartmentService().Get(EnumStatus.Regardless, (int)currentUser.PayrollTypeID);
|
||||||
|
//olist.ForEach(x=>
|
||||||
|
//{
|
||||||
|
// var grd = grades.FirstOrDefault(d => d.ID == x.GradeID);
|
||||||
|
// if(grd != null) x.gradeName = grd.Name;
|
||||||
|
|
||||||
|
// var designation = designations.FirstOrDefault(d => d.ID == x.designationID);
|
||||||
|
// if (designation != null) x.designationName = designation.Name;
|
||||||
|
// var department = departments.FirstOrDefault(d => d.ID == x.DepartmentID);
|
||||||
|
// if (department != null) x.departmentName = department.Name;
|
||||||
|
//}); // Secondary ordering (alphabetical)
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
return StatusCode(StatusCodes.Status500InternalServerError, ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok(olist);
|
||||||
|
}
|
||||||
|
|
||||||
[HttpGet("getEmployeeAttachments/{empId}")]
|
[HttpGet("getEmployeeAttachments/{empId}")]
|
||||||
public ActionResult GetEmployeeAttachments(int empId)
|
public ActionResult GetEmployeeAttachments(int empId)
|
||||||
{
|
{
|
||||||
|
|
|
@ -233,7 +233,7 @@
|
||||||
<Paragraph>
|
<Paragraph>
|
||||||
<TextRuns>
|
<TextRuns>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>=Sum(Fields!OTRate.Value)</Value>
|
<Value>=Fields!OTRate.Value</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontSize>8pt</FontSize>
|
<FontSize>8pt</FontSize>
|
||||||
<Format>N2</Format>
|
<Format>N2</Format>
|
||||||
|
@ -322,7 +322,7 @@
|
||||||
<Paragraph>
|
<Paragraph>
|
||||||
<TextRuns>
|
<TextRuns>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>=Sum(Fields!OTRate.Value)</Value>
|
<Value />
|
||||||
<Style>
|
<Style>
|
||||||
<FontFamily />
|
<FontFamily />
|
||||||
<FontSize>8pt</FontSize>
|
<FontSize>8pt</FontSize>
|
||||||
|
|
|
@ -502,7 +502,7 @@
|
||||||
<Paragraph>
|
<Paragraph>
|
||||||
<TextRuns>
|
<TextRuns>
|
||||||
<TextRun>
|
<TextRun>
|
||||||
<Value>=Format((Fields!OTRate.Value),"###,##.00")</Value>
|
<Value>=Fields!OTRate.Value</Value>
|
||||||
<Style>
|
<Style>
|
||||||
<FontSize>8pt</FontSize>
|
<FontSize>8pt</FontSize>
|
||||||
</Style>
|
</Style>
|
||||||
|
@ -544,6 +544,7 @@
|
||||||
<PaddingBottom>2pt</PaddingBottom>
|
<PaddingBottom>2pt</PaddingBottom>
|
||||||
</Style>
|
</Style>
|
||||||
</Textbox>
|
</Textbox>
|
||||||
|
<rd:Selected>true</rd:Selected>
|
||||||
</CellContents>
|
</CellContents>
|
||||||
</TablixCell>
|
</TablixCell>
|
||||||
<TablixCell>
|
<TablixCell>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user