Merge pull request 'dev_Chapal' (#6) from dev_Chapal into Brac_devqc

Reviewed-on: http://103.197.204.162:3025/CelHRTeam/HRM-10/pulls/6
This commit is contained in:
shamim 2026-12-01 15:16:37 +06:00
commit 88421887ff
18 changed files with 1647 additions and 108 deletions

View File

@ -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<Employee> employees, int bonusid, DateTime dBasicMonth,
DateTime dPayDate, DateTime dCuttOfDate, double CurrProcess, bool IsDisburseWithSalary, bool IsTaxProcess);
List<BonusProcess.BonusProcessDetail> CalculateBonusTax(List<BonusProcess.BonusProcessDetail> bonusDetails,

View File

@ -2182,6 +2182,7 @@ namespace HRM.BO
OverAllSummary = 39,
SalaryControl = 40,
PaySlip = 41,
DateRangeWiseSalarySheet = 4101,
Envelop = 42,
SalaryReconcil = 43,
SalaryReconcilItemWise = 143,

View File

@ -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);

View File

@ -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)
{

View File

@ -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();

View File

@ -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();

View File

@ -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();

View File

@ -716,6 +716,259 @@ namespace HRM.Report
return reportProcessor.ShowDlgForNewPaySlip(null, basicInfo,oFDST, payrollTypeID);
}
#region Date Range Wise Salary Sheet
/// <summary>
/// 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.
/// </summary>
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<ReportParameter> extraParams = new List<ReportParameter>();
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);
}
/// <summary>
/// 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.
/// </summary>
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<DataRow> 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<DataRow>() : 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<KeyValuePair<string, string>> columns = new List<KeyValuePair<string, string>>();
// 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<string, string>(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<string, string>(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<string, string>(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<string, string>(bonus.Key, bonus.OrderBy(b => b.Month).Last().Name));
}
if (heads.Any(h => h.Group == unauthGroup))
columns.Add(new KeyValuePair<string, string>(unauthKey, "Unauthorized Leave"));
columns.Add(new KeyValuePair<string, string>(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<string, string>(bonusTaxKey, "Bonus Tax"));
bonusTaxAdded = true;
}
columns.Add(new KeyValuePair<string, string>(head.Key, head.Description));
}
if (!bonusTaxAdded)
columns.Add(new KeyValuePair<string, string>(bonusTaxKey, "Bonus Tax"));
columns.Add(new KeyValuePair<string, string>(totalDeductionKey, "Total Deduction"));
columns.Add(new KeyValuePair<string, string>(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<DataRow> salaryRows = salaryMonths.ContainsKey(rowKey) ? salaryMonths[rowKey] : new List<DataRow>();
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<string, double> amounts = new Dictionary<string, double>();
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();

View File

@ -315,6 +315,7 @@
<None Remove="RDLC\SalaryRegister.rdlc" />
<None Remove="RDLC\SalarySheetEchoTex.rdlc" />
<None Remove="RDLC\SalarySheetWithoutCostcenter.rdlc" />
<None Remove="RDLC\DateRangeWiseSalarySheet.rdlc" />
<None Remove="RDLC\SettlementAdviceSheet.rdlc" />
<None Remove="RDLC\SettlementAdviceSheetNew.rdlc" />
<None Remove="RDLC\ShowITPfAndOtherDetails.rdlc" />
@ -646,6 +647,7 @@
<EmbeddedResource Include="RDLC\SalaryRegister.rdlc" />
<EmbeddedResource Include="RDLC\SalarySheetEchoTex.rdlc" />
<EmbeddedResource Include="RDLC\SalarySheetWithoutCostcenter.rdlc" />
<EmbeddedResource Include="RDLC\DateRangeWiseSalarySheet.rdlc" />
<EmbeddedResource Include="RDLC\SettlementAdviceSheet.rdlc" />
<EmbeddedResource Include="RDLC\SettlementAdviceSheetNew.rdlc" />
<EmbeddedResource Include="RDLC\ShowITPfAndOtherDetails.rdlc" />

File diff suppressed because it is too large Load Diff

View File

@ -3660,9 +3660,6 @@
"arm64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -3680,9 +3677,6 @@
"arm64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@ -3700,9 +3694,6 @@
"ppc64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -3720,9 +3711,6 @@
"riscv64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -3740,9 +3728,6 @@
"s390x"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -3760,9 +3745,6 @@
"x64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -3780,9 +3762,6 @@
"x64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@ -4039,9 +4018,6 @@
"cpu": [
"arm64"
],
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -4058,9 +4034,6 @@
"cpu": [
"arm64"
],
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@ -4077,9 +4050,6 @@
"cpu": [
"ppc64"
],
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -4096,9 +4066,6 @@
"cpu": [
"riscv64"
],
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -4115,9 +4082,6 @@
"cpu": [
"riscv64"
],
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@ -4134,9 +4098,6 @@
"cpu": [
"s390x"
],
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -4153,9 +4114,6 @@
"cpu": [
"x64"
],
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -4172,9 +4130,6 @@
"cpu": [
"x64"
],
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@ -4434,9 +4389,6 @@
"arm"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -4458,9 +4410,6 @@
"arm"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@ -4482,9 +4431,6 @@
"arm64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -4506,9 +4452,6 @@
"arm64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@ -4530,9 +4473,6 @@
"x64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -4554,9 +4494,6 @@
"x64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@ -5913,9 +5850,6 @@
"arm64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -5933,9 +5867,6 @@
"arm64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@ -5953,9 +5884,6 @@
"ppc64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -5973,9 +5901,6 @@
"s390x"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -5993,9 +5918,6 @@
"x64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MIT",
"optional": true,
"os": [
@ -6013,9 +5935,6 @@
"x64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MIT",
"optional": true,
"os": [
@ -11296,9 +11215,6 @@
"arm64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MPL-2.0",
"optional": true,
"os": [
@ -11320,9 +11236,6 @@
"arm64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MPL-2.0",
"optional": true,
"os": [
@ -11344,9 +11257,6 @@
"x64"
],
"dev": true,
"libc": [
"glibc"
],
"license": "MPL-2.0",
"optional": true,
"os": [
@ -11368,9 +11278,6 @@
"x64"
],
"dev": true,
"libc": [
"musl"
],
"license": "MPL-2.0",
"optional": true,
"os": [
@ -13602,7 +13509,6 @@
"arm"
],
"dev": true,
"libc": "glibc",
"license": "MIT",
"optional": true,
"os": [
@ -13620,7 +13526,6 @@
"arm64"
],
"dev": true,
"libc": "glibc",
"license": "MIT",
"optional": true,
"os": [
@ -13638,7 +13543,6 @@
"arm"
],
"dev": true,
"libc": "musl",
"license": "MIT",
"optional": true,
"os": [
@ -13656,7 +13560,6 @@
"arm64"
],
"dev": true,
"libc": "musl",
"license": "MIT",
"optional": true,
"os": [
@ -13674,7 +13577,6 @@
"riscv64"
],
"dev": true,
"libc": "musl",
"license": "MIT",
"optional": true,
"os": [
@ -13692,7 +13594,6 @@
"x64"
],
"dev": true,
"libc": "musl",
"license": "MIT",
"optional": true,
"os": [
@ -13710,7 +13611,6 @@
"riscv64"
],
"dev": true,
"libc": "glibc",
"license": "MIT",
"optional": true,
"os": [
@ -13728,7 +13628,6 @@
"x64"
],
"dev": true,
"libc": "glibc",
"license": "MIT",
"optional": true,
"os": [

View File

@ -1606,6 +1606,7 @@ export enum EnumReportType {
OverAllSummary = 39,
SalaryControl = 40,
PaySlip = 41,
DateRangeWiseSalarySheet = 4101,
Envelop = 42,
SalaryReconcil = 43,
SalaryReconcilItemWise = 143,

View File

@ -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);

View File

@ -50,6 +50,15 @@
</div>
}
@if (hiddenIncludeBonus==true) {
<div class="col-4 md:col-2">
<label for="includeBonus">Include Bonus</label>
</div>
<div class="col-8 md:col-4">
<input type="checkbox" kendoCheckBox id="includeBonus" [(ngModel)]="includeBonus" />
</div>
}
@if (hiddenItemDDL==true) {
<div class="col-4 md:col-2">
<label>{{itemName}}</label>

View File

@ -152,6 +152,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;
@ -417,6 +420,24 @@ export class ReportViewerComponent implements OnInit {
this.topview = "decade";
this.hiddenSendMail = true;
this.apiService.selectedMenuName = 'Payslip';
} else if (this.reportType === '4101') {
// Date Range Wise Salary Sheet: a salary-sheet style matrix, one row per employee per salary month
// from the From month to the To month (ReportController -> PaySlip.ShowReportDateRange).
this.SearchFrom = EnumSearchFrom.Salary;
this.IsNegletWithheld = true;
this.hiddenFromDate = true;
this.hiddenToDate = true;
this.fromDate = GlobalfunctionExtension.getFirstDateofMonth(new Date(this.payrolltype.nextPayProcessDate));
this.toDate = GlobalfunctionExtension.getLastDateOfMonth(new Date(this.payrolltype.nextPayProcessDate));
this.PDFTitle = 'Date Range Wise Salary Sheet';
this.fromDateFormat = 'MMM yyyy';
this.toDateFormat = 'MMM yyyy';
this.bottomView = "year";
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') {
// ;
this.SearchFrom = EnumSearchFrom.Salary;
@ -1507,6 +1528,17 @@ export class ReportViewerComponent implements OnInit {
}
}
if (this.reportType === '4101') {
if (this.fromDate == undefined || this.toDate == undefined) {
this.notificationService.showWarning('Select From and To month');
return;
}
if (GlobalfunctionExtension.getFirstDateofMonth(this.fromDate) > GlobalfunctionExtension.getFirstDateofMonth(this.toDate)) {
this.notificationService.showWarning('From month can not be greater than To month');
return;
}
}
if (this.reportType === '2') {
this.employeeService.getEmpBasicInfo(this.empIds).subscribe(
(resp) => {
@ -2095,7 +2127,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;
@ -2540,6 +2574,12 @@ export class ReportViewerComponent implements OnInit {
this.notificationService.showError(err.error);
},
() => {
if (this.reportType === '4101' && this.searchEmployees != undefined) {
// Date Range Wise Salary Sheet searches salary over several months, so an employee whose
// department/designation changed in the range comes back more than once.
this.searchEmployees = this.searchEmployees.filter((emp, index, all) =>
all.findIndex(x => x.employeeID === emp.employeeID) === index);
}
this.loadingPanel.ShowLoadingPanel = false;
this.loadData();
this.selectAllState = "unchecked";

View File

@ -41,6 +41,7 @@ export const routes: Routes = [
{ path: 'report-viewer/50', component: ReportViewerComponent, canActivate: [AuthGuard] },
{ path: 'report-viewer/39', component: ReportViewerComponent, canActivate: [AuthGuard] },
{ path: 'report-viewer/41', component: ReportViewerComponent, canActivate: [AuthGuard] },
{ path: 'report-viewer/4101', component: ReportViewerComponent, canActivate: [AuthGuard] },
{ path: 'report-viewer/43', component: ReportViewerComponent, canActivate: [AuthGuard] },
{ path: 'report-viewer/430', component: ReportViewerComponent, canActivate: [AuthGuard] },
{ path: 'report-viewer/48', component: ReportViewerComponent, canActivate: [AuthGuard] },

View File

@ -189,6 +189,7 @@
<Menu key="4.8.2.19" name="Item Wise Salary Details" url="report-viewer/510" parentkey="4.8.2" action="add;edit;delete" RoleType="User" isvisible="true" menuIcon="pi pi-fw pi-table"/>
<Menu key="4.8.2.20" name="Salary Withheld" url="/payroll/salary-withheld" parentkey="4.8.2" action="add;edit;delete" RoleType="User" isvisible="true" menuIcon="pi pi-fw pi-lock"/>
<Menu key="4.8.2.21" name="Withheld Salary Sheet" url="report-viewer/56" parentkey="4.8.2" action="add;edit;delete" RoleType="User" isvisible="true" menuIcon="pi pi-fw pi-table"/>
<Menu key="4.8.2.22" name="Date Range Wise Salary Sheet" url="/reports/report-viewer/4101" parentkey="4.8.2" action="add;edit;delete" RoleType="User" isvisible="true" menuIcon="pi pi-fw pi-table"/>
<Menu key="4.8.3" name="Interface" url="" parentkey="7" action="add;edit;delete" RoleType="User" isvisible="true" menuIcon="pi pi-fw pi-share-alt"/>
<Menu key="4.8.3.1" name="Upload Salary Item" url="/common-interface/data-upload/22" parentkey="4.8.3" action="add;edit;delete" RoleType="Admin" menuIcon="pi pi-fw pi-upload"/>
<Menu key="4.9" name="Final Settlement" url="" parentkey="4" action="add;edit;delete" RoleType="Admin" menuIcon="pi pi-fw pi-sign-out"/>

View File

@ -244,6 +244,10 @@ namespace HRM.UI.Controllers.Report
bytes = new PaySlip().ShowReportNew((int)currentUser.PayrollTypeID, fromDate, sEmpIDs, isForESS);
}
break;
case EnumReportType.DateRangeWiseSalarySheet:
bool includeBonus = items["includeBonus"] != null && (bool)items["includeBonus"].ToObject<bool>();
bytes = new PaySlip().ShowReportDateRange((int)currentUser.PayrollTypeID, fromDate, toDate, sEmpIDs, reportType, includeBonus);
break;
case EnumReportType.Envelop:
break;
case EnumReportType.SalaryReconcil: