From 01e548fc23804c94ebf56c3e0c4b86f67ea8d59f Mon Sep 17 00:00:00 2001 From: chapal Date: Mon, 30 Nov 2026 12:37:50 +0600 Subject: [PATCH 1/3] Date range wise Salary sheet --- HRM.BO/HRBasic/Enums.cs | 1 + HRM.BO/Salary/SalaryMonthly.cs | 1 + HRM.DA/DA/Salary/SalaryMonthlyDA.cs | 34 + HRM.DA/Service/Salary/SalaryMonthlyService.cs | 25 + HRM.Report/Class/PaySlip.cs | 180 +++ HRM.Report/HRM.Report.csproj | 2 + HRM.Report/RDLC/DateRangeWiseSalarySheet.rdlc | 1217 +++++++++++++++++ HRM.UI/ClientApp/package-lock.json | 101 -- HRM.UI/ClientApp/src/app/_models/enums.ts | 1 + .../report-viewer/report-viewer.component.ts | 33 + .../src/app/reports/reports-routing.module.ts | 1 + HRM.UI/ClientApp/src/assets/resource/Menu.xml | 1 + HRM.UI/Controllers/Report/ReportController.cs | 3 + 13 files changed, 1499 insertions(+), 101 deletions(-) create mode 100644 HRM.Report/RDLC/DateRangeWiseSalarySheet.rdlc diff --git a/HRM.BO/HRBasic/Enums.cs b/HRM.BO/HRBasic/Enums.cs index fad6fef..bab9adc 100644 --- a/HRM.BO/HRBasic/Enums.cs +++ b/HRM.BO/HRBasic/Enums.cs @@ -2173,6 +2173,7 @@ namespace HRM.BO OverAllSummary = 39, SalaryControl = 40, PaySlip = 41, + DateRangeWiseSalarySheet = 4101, Envelop = 42, SalaryReconcil = 43, SalaryReconcilItemWise = 143, diff --git a/HRM.BO/Salary/SalaryMonthly.cs b/HRM.BO/Salary/SalaryMonthly.cs index f5ac4e4..0c8f5dd 100644 --- a/HRM.BO/Salary/SalaryMonthly.cs +++ b/HRM.BO/Salary/SalaryMonthly.cs @@ -2072,6 +2072,7 @@ namespace HRM.BO DataSet GetEmpPaySlipGrossForOthers(DateTime dSalaryMonthDate, string sEmpID); DataSet GetEmpPaySlipDeductForOthers(DateTime dSalaryMonthDate, string sEmpID); + DataSet GetEmpPaySlipDateRangeMonthWise(DateTime fromSalaryMonth, DateTime toSalaryMonth, string sEmpID); DataSet GetEmpPaySlipDeductForCitiOthers(DateTime dSalaryMonthDate, string sEmpID); DataSet GetEmpPaySlipDeductForLR(DateTime dSalaryMonthDate, string sEmpID); diff --git a/HRM.DA/DA/Salary/SalaryMonthlyDA.cs b/HRM.DA/DA/Salary/SalaryMonthlyDA.cs index 91e2f20..d14c172 100644 --- a/HRM.DA/DA/Salary/SalaryMonthlyDA.cs +++ b/HRM.DA/DA/Salary/SalaryMonthlyDA.cs @@ -713,6 +713,40 @@ namespace HRM.DA return oSMonthlys; } + #region Date Range Wise Salary Sheet + + // Date Range Wise Salary Sheet: one row per salary item per employee per salary month in the range + // (gross 1, unauthorized leave 2, deduction 3, arrear 8 and the net payable 5/-132), with the + // employee's grade / basic of THAT month. PaySlip.ShowReportDateRange turns it into the salary sheet matrix. + // LEFT JOIN so that a salary month without any of those items still gets its row. + internal static DataSet GetEmpPaySlipDateRangeMonthWise(TransactionContext tc, DateTime fromSalaryMonth, DateTime toSalaryMonth, string sEmpID) + { + DataSet oSMonthlys = new DataSet(); + try + { + string sql = SQLParser.MakeSQL(@"SELECT E.EMPLOYEENO, E.NAME Name, G.DESCRIPTION GName, D.DESCRIPTION Department, E.JOININGDATE, + S.SalaryMonth, S.THISMONTHBASIC ActualBasic, + SD.ITEMGROUP, SD.ItemCode, SD.ItemID, SD.DESCRIPTION Description, SD.Position, SD.CHANGEDAMOUNT + FROM SALARYMONTHLY S + inner join EMPLOYEE E on S.EMPLOYEEID = E.EMPLOYEEID + inner join GRADES G on S.GRADEID = G.GRADEID + inner join DEPARTMENT D on S.DEPARTMENTID = D.DEPARTMENTID + left outer join SALARYMONTHLYDETAIL SD on S.SALARYMONTHLYID = SD.SALARYMONTHLYID + AND (SD.ITEMGROUP IN (1,2,3,8) OR (SD.ITEMGROUP = 5 AND SD.ItemCode = -132)) + WHERE S.SalaryMonth BETWEEN %d AND %d AND S.EmployeeID IN(%q) + ORDER BY E.EMPLOYEENO, S.SalaryMonth, SD.Position", fromSalaryMonth, toSalaryMonth, sEmpID); + + oSMonthlys = tc.ExecuteDataSet(sql); + } + catch (Exception ex) + { + throw new Exception(ex.Message); + } + return oSMonthlys; + } + + #endregion + internal static DataSet GetGrossDeduction(TransactionContext tc, int empID, DateTime salaryMonth) { DataSet rootDataset = new DataSet(); diff --git a/HRM.DA/Service/Salary/SalaryMonthlyService.cs b/HRM.DA/Service/Salary/SalaryMonthlyService.cs index 429c3fa..489ae5a 100644 --- a/HRM.DA/Service/Salary/SalaryMonthlyService.cs +++ b/HRM.DA/Service/Salary/SalaryMonthlyService.cs @@ -655,6 +655,31 @@ namespace HRM.DA return oSalaryMonthlys; } + public DataSet GetEmpPaySlipDateRangeMonthWise(DateTime fromSalaryMonth, DateTime toSalaryMonth, string sEmpID) + { + DataSet oSalaryMonthlys = new DataSet(); + TransactionContext tc = null; + try + { + tc = TransactionContext.Begin(); + oSalaryMonthlys = SalaryMonthlyDA.GetEmpPaySlipDateRangeMonthWise(tc, fromSalaryMonth, toSalaryMonth, sEmpID); + tc.End(); + } + catch (Exception e) + { + #region Handle Exception + + if (tc != null) + tc.HandleError(); + ExceptionLog.Write(e); + throw new ServiceException(e.Message, e); + + #endregion + } + + return oSalaryMonthlys; + } + public DataSet GetEmpPaySlipDeductForCitiOthers(DateTime dateTime, string sEmpID) { DataSet oSalaryMonthlys = new DataSet(); diff --git a/HRM.Report/Class/PaySlip.cs b/HRM.Report/Class/PaySlip.cs index 59084f1..0013101 100644 --- a/HRM.Report/Class/PaySlip.cs +++ b/HRM.Report/Class/PaySlip.cs @@ -716,6 +716,186 @@ namespace HRM.Report return reportProcessor.ShowDlgForNewPaySlip(null, basicInfo,oFDST, payrollTypeID); } + #region Date Range Wise Salary Sheet + + /// + /// Date Range Wise Salary Sheet (report 4101): a salary-sheet style matrix of every salary month of each + /// employee between fromMonth and toMonth - one row per employee per salary month, one column per + /// salary head (the columns come from the data, they are not fixed), then Total Gross, the + /// deduction heads, Total Deduction and Net Pay, with a grand total at the bottom. + /// Rendered from the embedded RDLC DateRangeWiseSalarySheet.rdlc, the way the salary sheet (report 54) is. + /// + public byte[] ShowReportDateRange(int payrollTypeID, DateTime fromMonth, DateTime toMonth, string sEmpID, string reportType) + { + DateTime fromSalaryMonth = GlobalFunctions.LastDateOfMonth(fromMonth); + DateTime toSalaryMonth = GlobalFunctions.LastDateOfMonth(toMonth); + if (fromSalaryMonth > toSalaryMonth) + { + throw new Exception("From month can not be greater than To month."); + } + + DataTable oItems = new SalaryMonthlyService().GetEmpPaySlipDateRangeMonthWise(fromSalaryMonth, toSalaryMonth, sEmpID).Tables[0]; + if (oItems.Rows.Count <= 0) + { + return null; + } + + DataTable dtSalarySheet = this.GetDateRangeSalarySheetTable(oItems); + dtSalarySheet.TableName = "DateRangeSalarySheet"; + DataSet resultDataSet = new DataSet(); + resultDataSet.Tables.Add(dtSalarySheet); + + string salarySheetPeriod = fromSalaryMonth.Year == toSalaryMonth.Year && fromSalaryMonth.Month == toSalaryMonth.Month + ? "Salary Sheet for the month of " + toSalaryMonth.ToString("MMMM yyyy") + : "Salary Sheet for the period of " + fromSalaryMonth.ToString("MMMM yyyy") + " to " + toSalaryMonth.ToString("MMMM yyyy"); + List extraParams = new List(); + extraParams.Add(new ReportParameter("SalarySheetPeriod", salarySheetPeriod)); + + ReportProcessor reportProcessor = new ReportProcessor(); + return reportProcessor.CommonReportView(null, "HRM.Report.RDLC.DateRangeWiseSalarySheet.rdlc", resultDataSet, null, extraParams, true, payrollTypeID, reportType); + } + + /// + /// Turns the item rows of GetEmpPaySlipDateRangeMonthWise into the matrix rows: for every employee + /// and salary month, one row per column (0 where that month has no such head). Columns are keyed by + /// ItemGroup|ItemCode|ItemID, not by description, because an arrear and an unauthorized-leave row + /// carry the same description as the gross head ("Basic"). + /// Total Gross = gross + arrear - unauthorized leave; Total Deduction = deductions; Net Pay is the + /// processed Net Payable (5 / -132) - the same figures the salary sheet shows. + /// + private DataTable GetDateRangeSalarySheetTable(DataTable oItems) + { + int grossGroup = (int)EnumSalaryGroup.Gross; + int unauthGroup = (int)EnumSalaryGroup.UnauthLeave; + int deductGroup = (int)EnumSalaryGroup.Deductions; + int arrearGroup = (int)EnumSalaryGroup.Arrear; + const string unauthKey = "UNAUTHLEAVE", totalGrossKey = "TOTALGROSS", totalDeductionKey = "TOTALDEDUCTION", netPayKey = "NETPAY"; + + DataTable dt = new DataTable(); + dt.Columns.Add("EmpNo", typeof(string)); + dt.Columns.Add("EmpName", typeof(string)); + dt.Columns.Add("Grade", typeof(string)); + dt.Columns.Add("Department", typeof(string)); + dt.Columns.Add("SalaryMonth", typeof(DateTime)); + dt.Columns.Add("JoiningDate", typeof(DateTime)); + dt.Columns.Add("ActualBasic", typeof(double)); + dt.Columns.Add("ColumnKey", typeof(string)); + dt.Columns.Add("ColumnName", typeof(string)); + dt.Columns.Add("ColumnSequence", typeof(int)); + dt.Columns.Add("Amount", typeof(double)); + + List itemRows = oItems.AsEnumerable().Where(r => r["ITEMGROUP"] != DBNull.Value).ToList(); + + // every head that has a non-zero amount somewhere in the range; the description of the latest month + var heads = itemRows + .GroupBy(r => new { Group = Convert.ToInt32(r["ITEMGROUP"]), Code = Convert.ToInt32(r["ItemCode"]), ID = Convert.ToInt32(r["ItemID"]) }) + .Select(g => new + { + g.Key.Group, + g.Key.Code, + g.Key.ID, + Key = g.Key.Group + "|" + g.Key.Code + "|" + g.Key.ID, + Description = Convert.ToString(g.OrderBy(r => Convert.ToDateTime(r["SalaryMonth"])).Last()["Description"]), + Position = g.Min(r => r["Position"] == DBNull.Value ? int.MaxValue : Convert.ToInt32(r["Position"])), + HasAmount = g.Any(r => Convert.ToDouble(r["CHANGEDAMOUNT"]) != 0) + }) + .Where(h => h.HasAmount) + .ToList(); + + #region Column order + List> columns = new List>(); + // earnings: Basic first, then the salary position; each head's arrear right after it + foreach (var head in heads.Where(h => h.Group == grossGroup) + .OrderBy(h => h.Code == (int)EnumSalaryItemCode.Basic_Salary ? 0 : 1) + .ThenBy(h => h.Position).ThenBy(h => h.Description)) + { + columns.Add(new KeyValuePair(head.Key, head.Description)); + var arrear = heads.FirstOrDefault(h => h.Group == arrearGroup && h.Code == head.Code && h.ID == head.ID); + if (arrear != null) + columns.Add(new KeyValuePair(arrear.Key, GetArrearColumnName(arrear.Description))); + } + // an arrear whose head is not paid in the range + foreach (var arrear in heads.Where(h => h.Group == arrearGroup && !columns.Any(c => c.Key == h.Key)) + .OrderBy(h => h.Position).ThenBy(h => h.Description)) + { + columns.Add(new KeyValuePair(arrear.Key, GetArrearColumnName(arrear.Description))); + } + if (heads.Any(h => h.Group == unauthGroup)) + columns.Add(new KeyValuePair(unauthKey, "Unauthorized Leave")); + columns.Add(new KeyValuePair(totalGrossKey, "Total Gross")); + // deductions: Income Tax, PF, then the salary position + foreach (var head in heads.Where(h => h.Group == deductGroup) + .OrderBy(h => h.Code == (int)EnumSalaryItemCode.Inc_Tax_Deduction ? 0 : h.Code == (int)EnumSalaryItemCode.PF_Contribution ? 1 : 2) + .ThenBy(h => h.Position).ThenBy(h => h.Description)) + { + columns.Add(new KeyValuePair(head.Key, head.Description)); + } + columns.Add(new KeyValuePair(totalDeductionKey, "Total Deduction")); + columns.Add(new KeyValuePair(netPayKey, "Net Pay")); + #endregion + + foreach (var salaryMonth in oItems.AsEnumerable() + .GroupBy(r => new { EmpNo = Convert.ToString(r["EMPLOYEENO"]), Month = Convert.ToDateTime(r["SalaryMonth"]) })) + { + DataRow info = salaryMonth.First(); + Dictionary amounts = new Dictionary(); + double totalGross = 0, totalDeduction = 0, unauthLeave = 0; + double? netPay = null; + + foreach (DataRow r in salaryMonth.Where(r => r["ITEMGROUP"] != DBNull.Value)) + { + int group = Convert.ToInt32(r["ITEMGROUP"]); + int code = Convert.ToInt32(r["ItemCode"]); + string key = group + "|" + code + "|" + Convert.ToInt32(r["ItemID"]); + double amount = Convert.ToDouble(r["CHANGEDAMOUNT"]); + + if (group == grossGroup || group == arrearGroup) + totalGross += amount; + else if (group == unauthGroup) + { + totalGross -= amount; + unauthLeave -= amount; + } + else if (group == deductGroup) + totalDeduction += amount; + else if (group == (int)EnumSalaryGroup.OtherItem && code == (int)EnumSalaryItemCode.Net_Payable) + netPay = (netPay ?? 0) + amount; + + if (group != unauthGroup) + amounts[key] = (amounts.ContainsKey(key) ? amounts[key] : 0) + amount; + } + amounts[unauthKey] = unauthLeave; + amounts[totalGrossKey] = totalGross; + amounts[totalDeductionKey] = totalDeduction; + amounts[netPayKey] = netPay ?? (totalGross - totalDeduction); + + for (int i = 0; i < columns.Count; i++) + { + DataRow oRow = dt.NewRow(); + oRow["EmpNo"] = salaryMonth.Key.EmpNo; + oRow["EmpName"] = info["Name"]; + oRow["Grade"] = info["GName"]; + oRow["Department"] = info["Department"]; + oRow["SalaryMonth"] = salaryMonth.Key.Month; + oRow["JoiningDate"] = info["JOININGDATE"]; + oRow["ActualBasic"] = info["ActualBasic"] == DBNull.Value ? 0 : Convert.ToDouble(info["ActualBasic"]); + oRow["ColumnKey"] = columns[i].Key; + oRow["ColumnName"] = columns[i].Value; + oRow["ColumnSequence"] = i + 1; + oRow["Amount"] = amounts.ContainsKey(columns[i].Key) ? amounts[columns[i].Key] : 0; + dt.Rows.Add(oRow); + } + } + return dt; + } + + private string GetArrearColumnName(string description) + { + return description.IndexOf("arrear", StringComparison.OrdinalIgnoreCase) >= 0 ? description : description + " Arrear"; + } + + #endregion + public void PayslipMail(int payrollTypeID, DateTime SalaryMonth, string sEmpID, bool isForESS, EmailSettings emailSettings) { DataSet oFDST = new DataSet(); diff --git a/HRM.Report/HRM.Report.csproj b/HRM.Report/HRM.Report.csproj index 0b3d320..c10e03a 100644 --- a/HRM.Report/HRM.Report.csproj +++ b/HRM.Report/HRM.Report.csproj @@ -314,6 +314,7 @@ + @@ -644,6 +645,7 @@ + diff --git a/HRM.Report/RDLC/DateRangeWiseSalarySheet.rdlc b/HRM.Report/RDLC/DateRangeWiseSalarySheet.rdlc new file mode 100644 index 0000000..169f08a --- /dev/null +++ b/HRM.Report/RDLC/DateRangeWiseSalarySheet.rdlc @@ -0,0 +1,1217 @@ + + + 0 + + + + System.Data.DataSet + /* Local Connection */ + + 7b0f4c1e-2d6a-4f3b-9c41-4101a1b2c3d4 + + + + + + PayrollDataSet + /* Local Query */ + + + + EmpNo + System.String + + + EmpName + System.String + + + Grade + System.String + + + Department + System.String + + + SalaryMonth + System.DateTime + + + JoiningDate + System.DateTime + + + ActualBasic + System.Double + + + ColumnKey + System.String + + + ColumnName + System.String + + + ColumnSequence + System.Int32 + + + Amount + System.Double + + + + PayrollDataSet + DateRangeSalarySheet + + + + + + + + + true + true + + + + + =Parameters!SalarySheetPeriod.Value + + + + + + + 0in + 0.25in + 13.6in + + + + + + + + + + true + true + + + + + SL + + + + + + + + + Silver + Middle + 1pt + 1pt + 2pt + 2pt + + + + + + + + true + true + + + + + Emp No + + + + + + + + + Silver + Middle + 1pt + 1pt + 2pt + 2pt + + + + + + + + true + true + + + + + Name + + + + + + + + + Silver + Middle + 1pt + 1pt + 2pt + 2pt + + + + + + + + true + true + + + + + Job Grade + + + + + + + + + Silver + Middle + 1pt + 1pt + 2pt + 2pt + + + + + + + + true + true + + + + + Department + + + + + + + + + Silver + Middle + 1pt + 1pt + 2pt + 2pt + + + + + + + + true + true + + + + + Joining Date + + + + + + + + + Silver + Middle + 1pt + 1pt + 2pt + 2pt + + + + + + + + true + true + + + + + Salary Month + + + + + + + + + Silver + Middle + 1pt + 1pt + 2pt + 2pt + + + + + + + + true + true + + + + + Actual Basic + + + + + + + + + Silver + Middle + 1pt + 1pt + 2pt + 2pt + + + + + + + + + + + 0.45in + + + + + 0.2in + + + + + true + true + + + + + =Sum(Fields!Amount.Value) + + + + + + + + + 1pt + 1pt + 2pt + 2pt + + + + Output + + + + + 0.2in + + + + + true + true + + + + + =Sum(Fields!Amount.Value) + + + + + + + + + 1pt + 1pt + 2pt + 2pt + + + + Output + + + + + + + + + + + =Fields!ColumnKey.Value + + + + + =Min(Fields!ColumnSequence.Value) + + + + 0.55in + + + true + true + + + + + =First(Fields!ColumnName.Value) + + + + + + + + + Silver + Middle + 1pt + 1pt + 2pt + 2pt + + + + + Output + + + + + + + + + =Fields!EmpNo.Value + + + + + =Fields!EmpNo.Value + + + + 0.28in + + + true + true + + + + + =RunningValue(Fields!EmpNo.Value, CountDistinct, "matrix1") + + + + + + Top + 1pt + 1pt + 2pt + 2pt + + + + + + + + + =Fields!EmpNo.Value + + + + 0.5in + + + true + true + + + + + =Fields!EmpNo.Value + + + + + + Top + 1pt + 1pt + 2pt + 2pt + + + + + + + + + =Fields!EmpNo.Value + + + + 0.85in + + + true + true + + + + + =First(Fields!EmpName.Value) + + + + + + Top + 1pt + 1pt + 2pt + 2pt + + + + + + + + + =Fields!EmpNo.Value + + + + 0.5in + + + true + true + + + + + =Last(Fields!Grade.Value) + + + + + + Top + 1pt + 1pt + 2pt + 2pt + + + + + + + + + =Fields!EmpNo.Value + + + + 0.7in + + + true + true + + + + + =Last(Fields!Department.Value) + + + + + + Top + 1pt + 1pt + 2pt + 2pt + + + + + + + + + =Fields!EmpNo.Value + + + + 0.6in + + + true + true + + + + + =IIf(IsNothing(First(Fields!JoiningDate.Value)), "", Format(First(Fields!JoiningDate.Value), "dd MMM yyyy")) + + + + + + Top + 1pt + 1pt + 2pt + 2pt + + + + + + + + + =Fields!SalaryMonth.Value + + + + + =Fields!SalaryMonth.Value + + + + 0.6in + + + true + true + + + + + =Format(Fields!SalaryMonth.Value, "dd MMM yyyy") + + + + + + 1pt + 1pt + 2pt + 2pt + + + + + + + + + =Fields!SalaryMonth.Value + + + + 0.55in + + + true + true + + + + + =First(Fields!ActualBasic.Value) + + + + + + + + + 1pt + 1pt + 2pt + 2pt + + + + + + + + + + + + + + + + + + + true + + + + 4.58in + + + true + true + + + + + Total + + + + + + 1pt + 1pt + 2pt + 2pt + + + + + Before + + + + true + true + DateRangeSalarySheet + 0.3in + 0.95in + 5.03in + 1 + + + + + + 1.3in + + 1.75pt + + + + + true + true + + + + + =Parameters!CompanyInfo.Value + + + + + + + 1.52083in + 0.25in + 12.08in + 1 + + + 2pt + 2pt + 2pt + 2pt + + + + External + ="file:///" & Parameters!Logo.Value + image/jpg + FitProportional + 0.0375in + 0.5625in + 1.4in + 2 + + + + + + true + true + + + + + =Parameters!Phone.Value + + + + + + + true + true + + + + + =Parameters!Address.Value + + + + + + + + + + + + 0.3in + true + true + + + true + true + + + + + ="Print Date & Time: " & Format(Now(), "MM/dd/yyyy h:mm:ss tt") + + + + + + + true + true + + + + + ="Page " & Globals!PageNumber & " of " & Globals!TotalPages + + + + + + + 0.04in + 11.6in + 0.22in + 2in + 1 + + + + + + + + 8.5in + 14in + 8.5in + 14in + 0.2in + 0.2in + 0.3in + 0.3in + @@ -964,7 +964,7 @@ 1.52083in 0.25in - 12.08in + 14.62in 1 - 8.5in - 14in - 8.5in - 14in + 11.69in + 16.54in + 11.69in + 16.54in 0.2in 0.2in 0.3in diff --git a/HRM.UI/ClientApp/src/app/reports/report-viewer/report-viewer.component.html b/HRM.UI/ClientApp/src/app/reports/report-viewer/report-viewer.component.html index 2c54ef9..3f56be9 100644 --- a/HRM.UI/ClientApp/src/app/reports/report-viewer/report-viewer.component.html +++ b/HRM.UI/ClientApp/src/app/reports/report-viewer/report-viewer.component.html @@ -50,6 +50,15 @@ } + @if (hiddenIncludeBonus==true) { +
+ +
+
+ +
+ } + @if (hiddenItemDDL==true) {
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 7e8376b..9fd761f 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 @@ -150,6 +150,9 @@ export class ReportViewerComponent implements OnInit { hiddenSendMail = false; hiddenSelectReport = false; hiddenAllSearch = false; + /** Date Range Wise Salary Sheet (4101) only: shows the "Include Bonus" check box. */ + hiddenIncludeBonus = false; + includeBonus = false; itemName = 'Item'; reportDropdownDefaultName = 'Select Item...'; public gridView: GridDataResult; @@ -431,6 +434,8 @@ export class ReportViewerComponent implements OnInit { this.topview = "decade"; this.apiService.selectedMenuName = 'Date Range Wise Salary Sheet'; this.hiddenExport = true; + this.hiddenIncludeBonus = true; + this.includeBonus = false; } else if (this.reportType === '263' || this.reportType === '709') { // debugger; this.SearchFrom = EnumSearchFrom.Salary; @@ -2020,7 +2025,9 @@ export class ReportViewerComponent implements OnInit { reportType: reportType, fromDate: this.fromDate != undefined ? this.fromDate.toDateString() : undefined, toDate: this.toDate != undefined ? this.toDate.toDateString() : undefined, - locationIds: locationIds + locationIds: locationIds, + // Date Range Wise Salary Sheet only (ReportController reads it for that report alone) + ...(this.hiddenIncludeBonus ? { includeBonus: this.includeBonus } : {}) }; this.loadingPanel.ShowLoadingPanel = true; diff --git a/HRM.UI/Controllers/Report/ReportController.cs b/HRM.UI/Controllers/Report/ReportController.cs index 0945e14..91aa154 100644 --- a/HRM.UI/Controllers/Report/ReportController.cs +++ b/HRM.UI/Controllers/Report/ReportController.cs @@ -245,7 +245,8 @@ namespace HRM.UI.Controllers.Report } break; case EnumReportType.DateRangeWiseSalarySheet: - bytes = new PaySlip().ShowReportDateRange((int)currentUser.PayrollTypeID, fromDate, toDate, sEmpIDs, reportType); + bool includeBonus = items["includeBonus"] != null && (bool)items["includeBonus"].ToObject(); + bytes = new PaySlip().ShowReportDateRange((int)currentUser.PayrollTypeID, fromDate, toDate, sEmpIDs, reportType, includeBonus); break; case EnumReportType.Envelop: break; From cf66e78d35010ef4b6ad95d7754bf78fc50bf28f Mon Sep 17 00:00:00 2001 From: chapal Date: Tue, 1 Dec 2026 14:50:17 +0600 Subject: [PATCH 3/3] label2 --- .../organogram-setup/organogram-setup.component.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/HRM.UI/ClientApp/src/app/organization-management/organogram-setup/organogram-setup.component.ts b/HRM.UI/ClientApp/src/app/organization-management/organogram-setup/organogram-setup.component.ts index b879d54..e1f866f 100644 --- a/HRM.UI/ClientApp/src/app/organization-management/organogram-setup/organogram-setup.component.ts +++ b/HRM.UI/ClientApp/src/app/organization-management/organogram-setup/organogram-setup.component.ts @@ -14,12 +14,6 @@ import {OrganogramService} from '../../_services/payroll/organogram.service'; import {loadingPanelService} from '../../hrm-loding panel/loding.panel.service'; import {Observable} from 'rxjs'; import { type TreeNode } from 'src/app/_models/common/ui-types'; - -/** An organogram node also shows the second part of the position name (`label2`) in the chart. */ -interface OrgTreeNode extends TreeNode { - label2?: string; - children?: OrgTreeNode[]; -} import {ApiService} from '../../app.api.service'; @@ -36,6 +30,11 @@ import { TabViewCompatModule } from 'src/app/custom-components/tab-view-compat/t import { EmployeePickerComponent } from 'src/app/picker/employee-picker.component'; import { TreeViewModule } from '@progress/kendo-angular-treeview'; import { OrganogramPickerComponent } from 'src/app/picker/organogram-picker.component'; +/** PrimeNG TreeNode plus a second label line (e.g. designation) shown in the organogram chart. */ +export interface OrgTreeNode extends TreeNode { + label2?: string; + children?: OrgTreeNode[]; +} const is = (fileName: string, ext: string) => new RegExp(`.${ext}\$`).test(fileName);