diff --git a/HRM.BO/Bonus/BonusProcess.cs b/HRM.BO/Bonus/BonusProcess.cs index 5e0ccd4..bd11189 100644 --- a/HRM.BO/Bonus/BonusProcess.cs +++ b/HRM.BO/Bonus/BonusProcess.cs @@ -922,6 +922,7 @@ namespace HRM.BO public interface IBonusProcessService { DataTable GetBonusItemsForESSBonusPayslip(int EmployeeID); + DataSet GetEmpBonusDateRange(DateTime fromSalaryMonth, DateTime toSalaryMonth, string sEmpID); BonusProcess CalculateBonus(int payrolltypeid, List employees, int bonusid, DateTime dBasicMonth, DateTime dPayDate, DateTime dCuttOfDate, double CurrProcess, bool IsDisburseWithSalary, bool IsTaxProcess); List CalculateBonusTax(List bonusDetails, diff --git a/HRM.BO/HRBasic/Enums.cs b/HRM.BO/HRBasic/Enums.cs index 35f4363..972d299 100644 --- a/HRM.BO/HRBasic/Enums.cs +++ b/HRM.BO/HRBasic/Enums.cs @@ -2182,6 +2182,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 3c659d0..a2c65c0 100644 --- a/HRM.BO/Salary/SalaryMonthly.cs +++ b/HRM.BO/Salary/SalaryMonthly.cs @@ -2074,6 +2074,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/Bonus/BonusProcessDA.cs b/HRM.DA/DA/Bonus/BonusProcessDA.cs index b7db8a8..82e425f 100644 --- a/HRM.DA/DA/Bonus/BonusProcessDA.cs +++ b/HRM.DA/DA/Bonus/BonusProcessDA.cs @@ -430,6 +430,31 @@ AND BP.PayrollTypeID=%n", emps, FromDate, ToDate, payrollTypeID); //{ // return tc.ExecuteReader("SELECT * FROM BonusEmpCostCenter WHERE BonusProcessID=%n", nID); //} + // Date Range Wise Salary Sheet (Include Bonus): every bonus of the employees whose bonus month OR + // disburse date falls between the first day of fromSalaryMonth and the end of toSalaryMonth. + // A bonus disbursed with salary (ISDISBURSEWITHSALARY = 1) is left out: it is already a salary item + // (SalaryMonthlyDetail, ItemCode -107), so taking it again would count it twice. + // Amount / tax are ChangeBonusAmount / ChangeTaxAmount, the figures the bonus register shows. + internal static DataSet GetEmpBonusDateRange(TransactionContext tc, DateTime fromSalaryMonth, DateTime toSalaryMonth, string sEmpID) + { + DateTime fromDate = new DateTime(fromSalaryMonth.Year, fromSalaryMonth.Month, 1); + DateTime toDateExclusive = new DateTime(toSalaryMonth.Year, toSalaryMonth.Month, 1).AddMonths(1); + string sql = SQLParser.MakeSQL(@"SELECT E.EMPLOYEENO, E.NAME Name, G.DESCRIPTION GName, D.DESCRIPTION Department, E.JOININGDATE, + BPD.BasicSalary, BP.BonusProcessID, BP.BonusID, B.NAME BonusName, BP.BonusMonth, BP.DisburseDate, + BPD.ChangeBonusAmount, BPD.ChangeTaxAmount + FROM BONUSPROCESS BP + inner join BONUSPROCESSDETAIL BPD on BPD.BonusProcessID = BP.BonusProcessID + inner join BONUS B on B.BONUSID = BP.BONUSID + inner join EMPLOYEE E on E.EMPLOYEEID = BPD.EmployeeID + left outer join GRADES G on G.GRADEID = E.GRADEID + left outer join DEPARTMENT D on D.DEPARTMENTID = E.DEPARTMENTID + WHERE BPD.EmployeeID IN(%q) AND ISNULL(BP.ISDISBURSEWITHSALARY, 0) = 0 + AND ((BP.BonusMonth >= %d AND BP.BonusMonth < %d)) + ORDER BY E.EMPLOYEENO, BP.BonusMonth, BP.BonusID", + sEmpID, fromDate, toDateExclusive); + return tc.ExecuteDataSet(sql); + } + internal static DataSet GetBonusRegister(TransactionContext tc, int BonusID, DateTime dBonusMonth, string sEmpID, int payrolltypeid) { 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/Bonus/BonusProcessService.cs b/HRM.DA/Service/Bonus/BonusProcessService.cs index 4434756..f943b05 100644 --- a/HRM.DA/Service/Bonus/BonusProcessService.cs +++ b/HRM.DA/Service/Bonus/BonusProcessService.cs @@ -716,6 +716,32 @@ namespace HRM.DA // return bonusProcessAdjustItems; //} + public DataSet GetEmpBonusDateRange(DateTime fromSalaryMonth, DateTime toSalaryMonth, string sEmpID) + { + DataSet oBonuses = new DataSet(); + + TransactionContext tc = null; + try + { + tc = TransactionContext.Begin(); + oBonuses = BonusProcessDA.GetEmpBonusDateRange(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 oBonuses; + } + public DataSet GetBonusRegister(int bonusID, DateTime dBonusMonth, string sEmpID, int payrolltypeid) { DataSet oBonusRegisters = new DataSet(); diff --git a/HRM.DA/Service/Salary/SalaryMonthlyService.cs b/HRM.DA/Service/Salary/SalaryMonthlyService.cs index 1865273..3dd7d6e 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..7b0b1fa 100644 --- a/HRM.Report/Class/PaySlip.cs +++ b/HRM.Report/Class/PaySlip.cs @@ -716,6 +716,259 @@ 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. + /// With includeBonus, every bonus whose bonus month or disburse date falls in the range is added + /// too: one column per bonus and a Bonus Tax column next to Income Tax (see BonusProcessDA.GetEmpBonusDateRange). + /// 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, bool includeBonus) + { + 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]; + DataTable oBonuses = includeBonus + ? new BonusProcessService().GetEmpBonusDateRange(fromSalaryMonth, toSalaryMonth, sEmpID).Tables[0] + : null; + if (oItems.Rows.Count <= 0 && (oBonuses == null || oBonuses.Rows.Count <= 0)) + { + return null; + } + + DataTable dtSalarySheet = this.GetDateRangeSalarySheetTable(oItems, oBonuses, fromSalaryMonth, toSalaryMonth); + 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 (and, when given, the bonus rows of + /// GetEmpBonusDateRange) into the matrix rows: for every employee and month, one row per column + /// (0 where that month has no such head). Salary 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"); bonus columns are keyed by BonusID. + /// Total Gross = gross + arrear - unauthorized leave + bonus; Total Deduction = deductions + bonus tax; + /// Net Pay = the processed Net Payable (5 / -132) + bonus - bonus tax. + /// A bonus goes on the row of its bonus month when that month is in the range, otherwise on the row + /// of its disburse month. + /// + private DataTable GetDateRangeSalarySheetTable(DataTable oItems, DataTable oBonuses, DateTime fromSalaryMonth, DateTime toSalaryMonth) + { + 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"; + const string bonusKeyPrefix = "BONUS|", bonusTaxKey = "BONUSTAX"; + + 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(); + + // bonus rows with the salary month (row) each one belongs to + DateTime fromDate = new DateTime(fromSalaryMonth.Year, fromSalaryMonth.Month, 1); + var bonuses = (oBonuses == null ? new List() : oBonuses.AsEnumerable().ToList()) + .Select(r => + { + DateTime bonusMonth = Convert.ToDateTime(r["BonusMonth"]); + bool bonusMonthInRange = bonusMonth >= fromDate && bonusMonth <= toSalaryMonth.AddDays(1).AddTicks(-1); + return new + { + Row = r, + EmpNo = Convert.ToString(r["EMPLOYEENO"]), + Month = GlobalFunctions.LastDateOfMonth(bonusMonthInRange ? bonusMonth : Convert.ToDateTime(r["DisburseDate"])), + Key = bonusKeyPrefix + Convert.ToInt32(r["BonusID"]), + Name = Convert.ToString(r["BonusName"]), + Amount = r["ChangeBonusAmount"] == DBNull.Value ? 0 : Convert.ToDouble(r["ChangeBonusAmount"]), + Tax = r["ChangeTaxAmount"] == DBNull.Value ? 0 : Convert.ToDouble(r["ChangeTaxAmount"]) + }; + }) + .Where(b => b.Amount != 0 || b.Tax != 0) + .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))); + } + // one column per bonus, in the order they were paid + foreach (var bonus in bonuses.GroupBy(b => b.Key).OrderBy(g => g.Min(b => b.Month)).ThenBy(g => g.Key)) + { + columns.Add(new KeyValuePair(bonus.Key, bonus.OrderBy(b => b.Month).Last().Name)); + } + if (heads.Any(h => h.Group == unauthGroup)) + columns.Add(new KeyValuePair(unauthKey, "Unauthorized Leave")); + columns.Add(new KeyValuePair(totalGrossKey, "Total Gross")); + // deductions: Income Tax (then Bonus Tax), PF, then the salary position + bool bonusTaxAdded = bonuses.Count == 0; + 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)) + { + if (!bonusTaxAdded && head.Code != (int)EnumSalaryItemCode.Inc_Tax_Deduction) + { + columns.Add(new KeyValuePair(bonusTaxKey, "Bonus Tax")); + bonusTaxAdded = true; + } + columns.Add(new KeyValuePair(head.Key, head.Description)); + } + if (!bonusTaxAdded) + columns.Add(new KeyValuePair(bonusTaxKey, "Bonus Tax")); + columns.Add(new KeyValuePair(totalDeductionKey, "Total Deduction")); + columns.Add(new KeyValuePair(netPayKey, "Net Pay")); + #endregion + + var salaryMonths = oItems.AsEnumerable() + .GroupBy(r => new { EmpNo = Convert.ToString(r["EMPLOYEENO"]), Month = Convert.ToDateTime(r["SalaryMonth"]) }) + .ToDictionary(g => g.Key, g => g.ToList()); + // a bonus can fall in a month with no salary: that month still gets its row + var rowKeys = salaryMonths.Keys + .Union(bonuses.Select(b => new { b.EmpNo, b.Month })) + .ToList(); + + foreach (var rowKey in rowKeys) + { + List salaryRows = salaryMonths.ContainsKey(rowKey) ? salaryMonths[rowKey] : new List(); + var monthBonuses = bonuses.Where(b => b.EmpNo == rowKey.EmpNo && b.Month == rowKey.Month).ToList(); + + // employee information: this month's salary row, else the employee's latest salary row in the + // range, else the bonus row (employee master) + DataRow info = salaryRows.FirstOrDefault() + ?? oItems.AsEnumerable().Where(r => Convert.ToString(r["EMPLOYEENO"]) == rowKey.EmpNo) + .OrderBy(r => Convert.ToDateTime(r["SalaryMonth"])).LastOrDefault() + ?? monthBonuses.First().Row; + double actualBasic = salaryRows.Count > 0 + ? (salaryRows[0]["ActualBasic"] == DBNull.Value ? 0 : Convert.ToDouble(salaryRows[0]["ActualBasic"])) + : (monthBonuses[0].Row["BasicSalary"] == DBNull.Value ? 0 : Convert.ToDouble(monthBonuses[0].Row["BasicSalary"])); + + Dictionary amounts = new Dictionary(); + double totalGross = 0, totalDeduction = 0, unauthLeave = 0; + double? netPay = null; + + foreach (DataRow r in salaryRows.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; + } + double salaryNetPay = netPay ?? (totalGross - totalDeduction); + + double bonusAmount = 0, bonusTax = 0; + foreach (var bonus in monthBonuses) + { + amounts[bonus.Key] = (amounts.ContainsKey(bonus.Key) ? amounts[bonus.Key] : 0) + bonus.Amount; + bonusAmount += bonus.Amount; + bonusTax += bonus.Tax; + } + + amounts[unauthKey] = unauthLeave; + amounts[bonusTaxKey] = bonusTax; + amounts[totalGrossKey] = totalGross + bonusAmount; + amounts[totalDeductionKey] = totalDeduction + bonusTax; + amounts[netPayKey] = salaryNetPay + bonusAmount - bonusTax; + + for (int i = 0; i < columns.Count; i++) + { + DataRow oRow = dt.NewRow(); + oRow["EmpNo"] = rowKey.EmpNo; + oRow["EmpName"] = info["Name"]; + oRow["Grade"] = info["GName"]; + oRow["Department"] = info["Department"]; + oRow["SalaryMonth"] = rowKey.Month; + oRow["JoiningDate"] = info["JOININGDATE"]; + oRow["ActualBasic"] = 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 3c8f9d2..78ca6a0 100644 --- a/HRM.Report/HRM.Report.csproj +++ b/HRM.Report/HRM.Report.csproj @@ -315,6 +315,7 @@ + @@ -646,6 +647,7 @@ + diff --git a/HRM.Report/RDLC/DateRangeWiseSalarySheet.rdlc b/HRM.Report/RDLC/DateRangeWiseSalarySheet.rdlc new file mode 100644 index 0000000..ac7da41 --- /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 + 16.14in + + + + + + + + + + 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 + 14.62in + 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 + 14.14in + 0.22in + 2in + 1 + + + + + + + + 11.69in + 16.54in + 11.69in + 16.54in + 0.2in + 0.2in + 0.3in + 0.3in +