diff --git a/HRM.DA/DA/Basic/GradeDA.cs b/HRM.DA/DA/Basic/GradeDA.cs index 5f4bf71..5a14761 100644 --- a/HRM.DA/DA/Basic/GradeDA.cs +++ b/HRM.DA/DA/Basic/GradeDA.cs @@ -85,7 +85,10 @@ namespace HRM.DA } internal static IDataReader Get(TransactionContext tc, EnumStatus status) { - return tc.ExecuteReader("SELECT * FROM GRADES where Status=%n order by code", status); + if(status == EnumStatus.Regardless) + return tc.ExecuteReader("SELECT * FROM GRADES order by code"); + else + return tc.ExecuteReader("SELECT * FROM GRADES where Status=%n order by code", status); } internal static IDataReader Get(TransactionContext tc, EnumStatus status, string sIDs, string sTargetPropertyName, int payrolltypeid) diff --git a/HRM.Report/Attendence/RDLC/rptMonthlyKPI.rdlc b/HRM.Report/Attendence/RDLC/rptMonthlyKPI.rdlc index 7245e24..902d687 100644 --- a/HRM.Report/Attendence/RDLC/rptMonthlyKPI.rdlc +++ b/HRM.Report/Attendence/RDLC/rptMonthlyKPI.rdlc @@ -857,6 +857,9 @@ 0.46875in + + 0.39583in + 0.35417in @@ -1198,6 +1201,39 @@ + + + + true + true + + + + + =Sum(iif(Fields!ExtraAllowance.Value = 1,1,0)) + + + + + + =iif(Sum(iif(Fields!AttenType.Value = 1 or Fields!AttenType.Value = 3 or Fields!AttenType.Value = 7 or Fields!AttenType.Value = 11 or Fields!AttenType.Value = 12,1,0))>0,"Yellow","White") + 2pt + 2pt + 2pt + 2pt + + + true + + @@ -2457,6 +2493,87 @@ + + + 0.25in + + + true + true + + + + + + + + + + + + Textbox98 + + + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + + 0.69792in + + + true + true + + + + + Extra Allowance + + + + + + + Textbox99 + + + Yellow + Middle + 2pt + 2pt + 2pt + 2pt + + + + + + + 0.25in @@ -4083,7 +4200,7 @@ MonthlyKPIDetail 0.16021in 1.19792in - 13.95876in + 14.35459in diff --git a/HRM.Report/Class/rptEcho.cs b/HRM.Report/Class/rptEcho.cs index dc2f7a8..b8611f9 100644 --- a/HRM.Report/Class/rptEcho.cs +++ b/HRM.Report/Class/rptEcho.cs @@ -1,14 +1,17 @@ using System; using System.Collections.Generic; using System.Data; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using Ease.Core.Model; using Ease.Core.Utility; using HRM.BO; +using HRM.BO.Configuration; using HRM.DA; using HRM.Report.Attendence.AttendenceDataSet; +using Microsoft.Extensions.Configuration; using Microsoft.Reporting.NETCore; using NPOI.SS.Formula.Functions; using NPOI.XSSF.Streaming.Values; @@ -2844,6 +2847,38 @@ namespace HRM.Report oMonthlyKPIDetail = new EchoTexExceptionReportService().GetMonthlyKPIDetail(dFromDate, dToDate, sEmpID); + #region Extra + + oMonthlyKPIDetail.Tables[0].Columns.Add("ExtraAllowance", typeof(double)); + + if (oMonthlyKPIDetail != null && oMonthlyKPIDetail.Tables.Count > 0) + { + List dAttnProcessess = dAttnProcessess = new DailyAttnProcessService().Get(sEmpID, dFromDate, dToDate); + //List oNationalHolidays = AttnNationalHoliday.GetByMonth(dFromDate.FirstDateOfYear(), dFromDate.LastDateOfYear()); + List oShifts = new ShiftService().Get(EnumStatus.Active, payrollTypeID); + List oemps = new EmployeeService().GetByEmpIDs(sEmpID); + List oAdparameters = new ADParameterService().Get(EnumStatus.Active, EnumAllowOrDeduct.Allowance, payrollTypeID).Where(x => x.AllowDeductID == 4).ToList(); // AllowDeductID = 4 is Extra Allowance in ALLOWANCEDEDUCTION table + List ogrades = new GradeService().Get(EnumStatus.Regardless); + foreach (DataRow monthlyRow in oMonthlyKPIDetail.Tables[0].Rows) + { + Employee emp = oemps.Find(x => x.EmployeeNo.ToString() == monthlyRow["IDNo"].ToString()); + if (emp == null) continue; + DateTime attnDate = Convert.ToDateTime(monthlyRow["AttnDate"]); + List dEmpAttn = dAttnProcessess.FindAll(x => x.EmployeeID == emp.ID && x.AttnDate.Date == attnDate.Date).ToList(); + DataTable oDataTable = new rptEcho().GetEmpDailyAttnNewKPI(emp.ID, dEmpAttn, emp, oShifts, oAdparameters, ogrades); + if (oDataTable != null && oDataTable.Rows.Count > 0) + { + monthlyRow["ExtraAllowance"] = oDataTable.Rows[0]["ExtraAllowance"]; + } + else + { + monthlyRow["ExtraAllowance"] = 0; + } + } + } + #endregion + + DataTable oMnthlyKPIDtlSummary = new AttendenceDataSet.MnthlyKPIDtlSummaryDataTable(); #region Summary Parts @@ -2883,6 +2918,64 @@ namespace HRM.Report return reportProcessor.AttendanceReportsView(null, oMonthlyKPIDetail, null, RDLC, _parameters, true, payrollTypeID, reportType); } + public DataTable GetEmpDailyAttnNewKPI(int EmpID, List dAttnProcessess, Employee emp, List oShifts, List oADPrams, List ogrades) + { + AttendenceDataSet.EmpDailyAttnDataTable dTable = new AttendenceDataSet.EmpDailyAttnDataTable(); + + var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json"); + IConfiguration Configuration = builder.Build(); + + string sExtraAllowanceHour = Configuration.GetSection("Attendance")["ExtraAllowanceHour"]; + double dExtraAllowanceHours = 0; + if (!double.TryParse(sExtraAllowanceHour, out dExtraAllowanceHours)) + { + dExtraAllowanceHours = 13.5; // Default if Hour not given + } + DateTime startTime, endTime; + + if (!(dAttnProcessess == null || dAttnProcessess.Count <= 0)) + { + foreach (DailyAttnProcess dAttnProcess in dAttnProcessess) + { + DataRow Rowbody = dTable.NewRow(); + Rowbody["ExtraAllowance"] = 0; + if (oADPrams != null && emp != null) + { + foreach (ADParameter adparam in oADPrams) + { + foreach (ADParameter.ADParameterGrade grn in adparam.ADParameterGrades) + { + //Grade gr = ogrades.GetItem(grn.GradeID); + Grade gr = ogrades.Find(delegate (Grade item) { return item.ID == grn.GradeID; }); + if (gr != null && gr.ID == emp.GradeID) + { + if (dAttnProcess.InTime != null && dAttnProcess.InTime != DateTime.MinValue) + { + Shift sft = oShifts.FirstOrDefault(x => x.ID == dAttnProcess.ShiftID); + startTime = dAttnProcess.InTime.Value.Date.Add(sft.InTime.TimeOfDay); + + startTime = (DateTime)startTime.AddMinutes(-15) > (DateTime)dAttnProcess.InTime ? (DateTime)startTime.AddMinutes(-15) : (DateTime)dAttnProcess.InTime; + + endTime = dAttnProcess.OutTime != null ? (DateTime)dAttnProcess.OutTime : DateTime.MinValue; + if (endTime != DateTime.MinValue) + { + if (endTime.Subtract(startTime).Add(TimeSpan.FromMinutes(1)).TotalHours >= dExtraAllowanceHours) + { + Rowbody["ExtraAllowance"] = 1;// ncount++; + } + } + + } + } + } + } + } + + dTable.Rows.Add(Rowbody); + } + } + return dTable; + } #endregion #endregion diff --git a/HRM.Report/Class/rptEmployee.cs b/HRM.Report/Class/rptEmployee.cs index c75d562..fd855ae 100644 --- a/HRM.Report/Class/rptEmployee.cs +++ b/HRM.Report/Class/rptEmployee.cs @@ -2942,7 +2942,27 @@ namespace HRM.Report .AsEnumerable() .OrderBy(x => Convert.ToInt32(x["EmployeeID"].ToString())) .CopyToDataTable(); + + string photoPath = ""; + string basePath = System.Environment.CurrentDirectory + "\\Documents\\EMPPHOTO\\"; + string fileNamePattern = "Image-" + employee.EmployeeNo.Trim(); + string[] imageExtensions = { ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff" }; + string[] matchingFiles = Directory + .GetFiles(basePath, fileNamePattern + ".*") // Check all files matching the pattern + .Where(file => imageExtensions.Contains(Path.GetExtension(file), StringComparer.OrdinalIgnoreCase)) + .ToArray(); + + if (matchingFiles.Length > 0) + { + + photoPath = matchingFiles[0]; + //Console.WriteLine("Matching image files found:"); + //foreach (string file in matchingFiles) + //{ + // photoPath = file; + //} + } foreach (DataRow drBasic in dtEmpBasicInfo.Rows) { @@ -2961,6 +2981,7 @@ namespace HRM.Report oRow["MartialStatus"] = (EnumMaritalStatus)Convert.ToInt16(drBasic["MARITALSTATUSID"]); oRow["Religion"] = drBasic["Religion"]; oRow["Email"] = drBasic["PERSONALEMAIL"]; + oRow["EmpPhotograph"] = photoPath; //Commented for development //oRow["EmpPhotograph"] = _rImageManager.GetImage(drBasic["PhotoPath"].ToString()); diff --git a/HRM.UI/ClientApp/src/app/reports/report-viewer/report-viewer.component.ts b/HRM.UI/ClientApp/src/app/reports/report-viewer/report-viewer.component.ts index 377db75..546b3fc 100644 --- a/HRM.UI/ClientApp/src/app/reports/report-viewer/report-viewer.component.ts +++ b/HRM.UI/ClientApp/src/app/reports/report-viewer/report-viewer.component.ts @@ -786,8 +786,8 @@ export class ReportViewerComponent implements OnInit { this.multiselect = true; this.hiddenFromDate = true; this.hiddenToDate = true; - this.fromDate = new Date(); - this.toDate = new Date(); + this.fromDate = GlobalfunctionExtension.getFirstDateofMonth(new Date()); + this.toDate = GlobalfunctionExtension.getLastDateOfMonth(new Date()); this.hiddenAllSearch = false; this.hiddenExport = true; this.loadCurrentFiscalYear(); diff --git a/HRM.UI/HRM.UI.csproj b/HRM.UI/HRM.UI.csproj index 9158fff..a0ca37b 100644 --- a/HRM.UI/HRM.UI.csproj +++ b/HRM.UI/HRM.UI.csproj @@ -1244,6 +1244,9 @@ + + Always + Always diff --git a/HRM.UI/RDLC/IDCardPrint.rdlc b/HRM.UI/RDLC/IDCardPrint.rdlc index b03dc14..944eb5c 100644 --- a/HRM.UI/RDLC/IDCardPrint.rdlc +++ b/HRM.UI/RDLC/IDCardPrint.rdlc @@ -1023,7 +1023,7 @@ ="‡dvb: "&Parameters!CPhone.Value @@ -1506,7 +1506,7 @@ kZ©vejx @@ -1597,7 +1597,7 @@ 1. GB KvW© n¯ÍvšÍi †hvM¨ b‡n | @@ -1626,7 +1626,7 @@ 2. GB KvW© nviv‡bv ‡M‡j ev bó n‡j mv‡_ @@ -1655,7 +1655,7 @@ mv‡_ KZ©„cÿ‡K AewnZ Ki‡Z n‡e| @@ -1684,7 +1684,7 @@ =" kÖwgK AvBb Gi "+Parameters!Dhara.Value+" aviv ‡gvZv‡eK" @@ -1713,7 +1713,7 @@ bZzb KvW© cÖ`vb Kiv nB‡e| @@ -1742,7 +1742,7 @@ 3. PvKzix Z¨vM Kivi mgq KvW©wU ‡diZ @@ -2002,7 +2002,7 @@ w`‡Z n‡e|