From af46e47314eee0f62638d099001de6351476a807 Mon Sep 17 00:00:00 2001 From: chapal Date: Tue, 7 Jan 2025 15:40:12 +0600 Subject: [PATCH] bonus --- HRM.DA/DA/Attendance/DailyAttnProcessDA.cs | 12 +++++++++--- HRM.Report/Class/rptBonus.cs | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/HRM.DA/DA/Attendance/DailyAttnProcessDA.cs b/HRM.DA/DA/Attendance/DailyAttnProcessDA.cs index 7fd58e3..6e1c3db 100644 --- a/HRM.DA/DA/Attendance/DailyAttnProcessDA.cs +++ b/HRM.DA/DA/Attendance/DailyAttnProcessDA.cs @@ -642,10 +642,16 @@ namespace HRM.DA internal static IDataReader Get(TransactionContext tc, string empID, DateTime fromDate, DateTime toDate) { + //string sql = + // SQLParser.MakeSQL( + // "SELECT dap.* FROM DailyAttnProcess dap Inner Join Employee e on e.EmployeeID=dap.EmployeeID " + + // "WHERE dap.EmployeeID IN(%q) AND dap.AttnDate BETWEEN %d AND %d order by dap.AttnDate DESC", + // empID, fromDate, toDate); string sql = - SQLParser.MakeSQL( - "SELECT dap.* FROM DailyAttnProcess dap Inner Join Employee e on e.EmployeeID=dap.EmployeeID WHERE dap.EmployeeID IN(%q) AND dap.AttnDate BETWEEN %d AND %d order by dap.AttnDate DESC", - empID, fromDate, toDate); + SQLParser.MakeSQL( + "SELECT dap.* FROM DailyAttnProcess dap " + + "WHERE dap.EmployeeID IN(%q) AND dap.AttnDate BETWEEN %d AND %d order by dap.AttnDate DESC", + empID, fromDate, toDate); IDataReader dr = tc.ExecuteReader(sql); return dr; } diff --git a/HRM.Report/Class/rptBonus.cs b/HRM.Report/Class/rptBonus.cs index 45a5132..7310d16 100644 --- a/HRM.Report/Class/rptBonus.cs +++ b/HRM.Report/Class/rptBonus.cs @@ -339,6 +339,7 @@ namespace HRM.Report DateTime? bonusIntime = DateTime.MinValue; DateTime? bonusOuttime = DateTime.MinValue; List prodAttn = new ProdBonusAttnService().GetBySetupID(designId); + if (prodAttn.Count <= 0) return null; string empIds = string.Empty; empIds = prodAttn.Select(x => x.EmployeeID).Distinct().Aggregate(new StringBuilder(), (sb, empid) => sb.Append(empid + ","), sb => sb.ToString().Trim(','));