diff --git a/HRM.DA/Service/Leave/LeaveEncashmentService.cs b/HRM.DA/Service/Leave/LeaveEncashmentService.cs index c6cc6ce..eb138dc 100644 --- a/HRM.DA/Service/Leave/LeaveEncashmentService.cs +++ b/HRM.DA/Service/Leave/LeaveEncashmentService.cs @@ -39,8 +39,8 @@ namespace HRM.Service oLeaveEncashment.CreatedDate = oReader.GetDateTime("CreatedDate").Value; oLeaveEncashment.ModifiedBy = oReader.GetString("ModifiedBy") == null ? 0 : oReader.GetInt32("ModifiedBy").Value; oLeaveEncashment.ModifiedDate = oReader.GetDateTime("ModifiedDate"); - oLeaveEncashment.BasicSalary = oReader.GetDouble("BasicSalary").Value; - oLeaveEncashment.ESSSubmittedDays = oReader.GetDouble("ESSSubmittedDays").Value; + oLeaveEncashment.BasicSalary = oReader.GetDouble("BasicSalary", true, 0); + oLeaveEncashment.ESSSubmittedDays = oReader.GetDouble("ESSSubmittedDays", true, 0); oLeaveEncashment.presentDays = oReader.GetDouble("PresentDays").Value; oLeaveEncashment.absentDays = oReader.GetDouble("AbsentDays").Value; oLeaveEncashment.enjoyedLeave = oReader.GetDouble("EnjoyedLeave").Value; diff --git a/HRM.Report/Class/rptEcho.cs b/HRM.Report/Class/rptEcho.cs index a50498b..21ab7ba 100644 --- a/HRM.Report/Class/rptEcho.cs +++ b/HRM.Report/Class/rptEcho.cs @@ -3368,32 +3368,38 @@ namespace HRM.Report public byte[] ShowLeaveReport(string sEmpIDs, int lyyid, int payrollTypeID, DateTime nextPayProcessDate, string reportType) { - - ReportProcessor form = new ReportProcessor(); - DataTable dTEmpLeave = new HRM.Report.PayrollDataSet.dsEmpLeaveLedger.LeaveBalanceDataTable(); - - LeaveYear lyy = new LeaveYearService().Get(lyyid); - - dTEmpLeave = new EmpLeaveStatusService().CurrentYearStatusOptimized(sEmpIDs, lyy, EnumLeaveStatus.Approved, nextPayProcessDate); - - if (dTEmpLeave.Rows.Count > 0) + try { - DataSet ds = new DataSet(); - dTEmpLeave.TableName = "dsEmpLeaveLedger_LeaveBalance"; - ds.Tables.Add(dTEmpLeave); + ReportProcessor form = new ReportProcessor(); + DataTable dTEmpLeave = new HRM.Report.PayrollDataSet.dsEmpLeaveLedger.LeaveBalanceDataTable(); - List oParameters = new List(); - ReportParameter rParam = new ReportParameter("FromDate", lyy.StartDate.ToString("dd MMM yyyy")); - oParameters.Add(rParam); - rParam = new ReportParameter("ToDate", lyy.EndDate.ToString("dd MMM yyyy")); - oParameters.Add(rParam); + LeaveYear lyy = new LeaveYearService().Get(lyyid); - string RDLC = "LeaveReportEcho.rdlc"; - return form.CommonReportViewForReports(null, ds, null, RDLC, oParameters, true, payrollTypeID, reportType); + dTEmpLeave = new EmpLeaveStatusService().CurrentYearStatusOptimized(sEmpIDs, lyy, EnumLeaveStatus.Approved, nextPayProcessDate); + + if (dTEmpLeave.Rows.Count > 0) + { + DataSet ds = new DataSet(); + dTEmpLeave.TableName = "dsEmpLeaveLedger_LeaveBalance"; + ds.Tables.Add(dTEmpLeave); + + List oParameters = new List(); + ReportParameter rParam = new ReportParameter("FromDate", lyy.StartDate.ToString("dd MMM yyyy")); + oParameters.Add(rParam); + rParam = new ReportParameter("ToDate", lyy.EndDate.ToString("dd MMM yyyy")); + oParameters.Add(rParam); + + string RDLC = "LeaveReportEcho.rdlc"; + return form.CommonReportViewForReports(null, ds, null, RDLC, oParameters, true, payrollTypeID, reportType); + } + else + { + throw new Exception("Leave balance not found"); + } } - else + catch (Exception ex) { - throw new Exception("Leave balance not found"); + throw new Exception(ex.Message, ex); } } @@ -3648,28 +3654,35 @@ namespace HRM.Report public byte[] ShowLeaveEncashmentReport(string sEmpIDs, DateTime fromMonth, int lyyid, int payrollTypeID, DateTime nextPayProcessDate, string reportType) { + try + { - ReportProcessor form = new ReportProcessor(); + ReportProcessor form = new ReportProcessor(); - LeaveYear oLeaveYear = new LeaveYearService().Get(lyyid); - string leaveYear = fromMonth.ToString("MMMM yyyy") + " - " + fromMonth.AddYears(1).ToString("MMMM yyyy");//cboLeaveYear.Text; + LeaveYear oLeaveYear = new LeaveYearService().Get(lyyid); + string leaveYear = fromMonth.ToString("MMMM yyyy") + " - " + fromMonth.AddYears(1).ToString("MMMM yyyy");//cboLeaveYear.Text; - //DataTable dTEmpLeave = new HRM.Report.PayrollDataSet.dsEmpLeaveLedger.LeaveBalanceDataTable(); - DataTable dt = new EmpLeaveStatusService().CurrentYearStatusForEncashment(sEmpIDs, oLeaveYear, EnumLeaveStatus.Approved, fromMonth); + //DataTable dTEmpLeave = new HRM.Report.PayrollDataSet.dsEmpLeaveLedger.LeaveBalanceDataTable(); + DataTable dt = new EmpLeaveStatusService().CurrentYearStatusForEncashment(sEmpIDs, oLeaveYear, EnumLeaveStatus.Approved, fromMonth); - DataSet dSet = new DataSet(); - dt.TableName = "PayrollDataSet_dtEncashmentReportNew"; - dSet.Tables.Add(dt); ; + DataSet dSet = new DataSet(); + dt.TableName = "PayrollDataSet_dtEncashmentReportNew"; + dSet.Tables.Add(dt); ; - List oParameters = new List(); - ReportParameter rParam = new ReportParameter("LeaveYear", leaveYear); - oParameters.Add(rParam); - rParam = new ReportParameter("EncashMonth", fromMonth.ToString("MMMM yyyy")); - oParameters.Add(rParam); + List oParameters = new List(); + ReportParameter rParam = new ReportParameter("LeaveYear", leaveYear); + oParameters.Add(rParam); + rParam = new ReportParameter("EncashMonth", fromMonth.ToString("MMMM yyyy")); + oParameters.Add(rParam); - string RDLC = "EncashmentReportEcho.rdlc"; - return form.CommonReportViewForReports(null, dSet, null, RDLC, oParameters, true, payrollTypeID, reportType); + string RDLC = "EncashmentReportEcho.rdlc"; + return form.CommonReportViewForReports(null, dSet, null, RDLC, oParameters, true, payrollTypeID, reportType); + } + catch (Exception ex) + { + throw new Exception(ex.Message, ex); + } } #endregion } diff --git a/HRM.UI/ClientApp/src/app/app.api.service.ts b/HRM.UI/ClientApp/src/app/app.api.service.ts index 56d4d14..0c3f2c3 100644 --- a/HRM.UI/ClientApp/src/app/app.api.service.ts +++ b/HRM.UI/ClientApp/src/app/app.api.service.ts @@ -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-20250902-`+"01"; + public versionNumber = `V-20251008-`+"01"; public static BASE_URL = ''; public base_url = ''; // public currentLink = ''; diff --git a/HRM.UI/ClientApp/src/app/reports/leave-encashment-report/leave-encashment-report.component.ts b/HRM.UI/ClientApp/src/app/reports/leave-encashment-report/leave-encashment-report.component.ts index 8667de0..724ca69 100644 --- a/HRM.UI/ClientApp/src/app/reports/leave-encashment-report/leave-encashment-report.component.ts +++ b/HRM.UI/ClientApp/src/app/reports/leave-encashment-report/leave-encashment-report.component.ts @@ -110,6 +110,7 @@ export class LeaveEncashmentReportComponent implements OnInit { reportid: 728, itemid: this.leaveYearId, empIds: this.empIds, + fromDate: this.fromDate, reportType: reportType, };