dev_chapal #3
|
@ -646,6 +646,8 @@ namespace HRM.DA
|
||||||
Shift oShift = null;
|
Shift oShift = null;
|
||||||
ProdBonusProcessEmp oProcessEmp = null;
|
ProdBonusProcessEmp oProcessEmp = null;
|
||||||
int setupID = 21;
|
int setupID = 21;
|
||||||
|
DateTime? bonusIntime = DateTime.MinValue;
|
||||||
|
DateTime? bonusOuttime = DateTime.MinValue;
|
||||||
ADParameter _ADParam = new ADParameterService().Get(setupID, payrollTypeId);
|
ADParameter _ADParam = new ADParameterService().Get(setupID, payrollTypeId);
|
||||||
|
|
||||||
List<ProdBonusAttn> prodAttns = new ProdBonusAttnService().GetBySetupIDs(_oProductionBonusSetups.CommaSeparatedIDs());
|
List<ProdBonusAttn> prodAttns = new ProdBonusAttnService().GetBySetupIDs(_oProductionBonusSetups.CommaSeparatedIDs());
|
||||||
|
@ -659,11 +661,8 @@ namespace HRM.DA
|
||||||
DataTable empBasic = new EmployeeService().GetBasicSalaryWithDiscontinue(_oProdBonusProcess.SalaryMonth);
|
DataTable empBasic = new EmployeeService().GetBasicSalaryWithDiscontinue(_oProdBonusProcess.SalaryMonth);
|
||||||
|
|
||||||
foreach (ProductionBonusSetup oProductionBonusSetup in _oProductionBonusSetups)
|
foreach (ProductionBonusSetup oProductionBonusSetup in _oProductionBonusSetups)
|
||||||
{
|
|
||||||
if(oProductionBonusSetup.ID == 10302)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
|
||||||
prodAttn = prodAttns.Where(x => x.ProdBonusSetupID == oProductionBonusSetup.ID).ToList();//ToObjectsTemplate();
|
prodAttn = prodAttns.Where(x => x.ProdBonusSetupID == oProductionBonusSetup.ID).ToList();//ToObjectsTemplate();
|
||||||
ProdBonusProcessItem oProcessItem = null;
|
ProdBonusProcessItem oProcessItem = null;
|
||||||
foreach (ProdBonusLine oLine in oProductionBonusSetup.ProductionBonusLinesNew)
|
foreach (ProdBonusLine oLine in oProductionBonusSetup.ProductionBonusLinesNew)
|
||||||
|
@ -687,16 +686,6 @@ namespace HRM.DA
|
||||||
foreach (DataRow dr in foundRows)
|
foreach (DataRow dr in foundRows)
|
||||||
{
|
{
|
||||||
basicSal = Convert.ToDouble(dr["BASICSALARY"]);
|
basicSal = Convert.ToDouble(dr["BASICSALARY"]);
|
||||||
//
|
|
||||||
int empidtest = Convert.ToInt32(dr["EMPLOYEEID"]);
|
|
||||||
if(oProductionBonusSetup.SalaryMonth == new DateTime(2023, 10, 31))
|
|
||||||
{
|
|
||||||
|
|
||||||
if (empidtest == 27620)
|
|
||||||
{
|
|
||||||
basicSal = 5145;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -717,19 +706,22 @@ namespace HRM.DA
|
||||||
{
|
{
|
||||||
DailyAttnProcess dailyAtt = dailyAttm.FirstOrDefault(o => o.AttnDate.Date == tAtt.InTime.Date);
|
DailyAttnProcess dailyAtt = dailyAttm.FirstOrDefault(o => o.AttnDate.Date == tAtt.InTime.Date);
|
||||||
double wh = 0;
|
double wh = 0;
|
||||||
|
|
||||||
if (dailyAtt != null)
|
if (dailyAtt != null)
|
||||||
{
|
{
|
||||||
|
bonusIntime = dailyAtt.InTime;
|
||||||
|
bonusOuttime = dailyAtt.OutTime;
|
||||||
if (dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue)
|
if (dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue)
|
||||||
{
|
{
|
||||||
oShift = oShifts.FirstOrDefault(x => x.ID == dailyAtt.ShiftID);
|
oShift = oShifts.FirstOrDefault(x => x.ID == dailyAtt.ShiftID);
|
||||||
if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date)
|
if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date)
|
||||||
dailyAtt.InTime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.FromDate : dailyAtt.InTime;
|
bonusIntime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.FromDate : dailyAtt.InTime;
|
||||||
else if (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date)
|
else if (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date)
|
||||||
dailyAtt.OutTime = oProductionBonusSetup.ToDate < dailyAtt.OutTime ? oProductionBonusSetup.ToDate : dailyAtt.OutTime;
|
bonusOuttime = oProductionBonusSetup.ToDate < dailyAtt.OutTime ? oProductionBonusSetup.ToDate : dailyAtt.OutTime;
|
||||||
else if (oShift != null && dailyAtt.InTime.GetValueOrDefault().TimeOfDay < oShift.InTime.TimeOfDay)
|
else if (oShift != null && dailyAtt.InTime.GetValueOrDefault().TimeOfDay < oShift.InTime.TimeOfDay)
|
||||||
dailyAtt.InTime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute);
|
bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute);
|
||||||
|
|
||||||
TimeSpan ts = (TimeSpan)(dailyAtt.OutTime - dailyAtt.InTime);
|
TimeSpan ts = (TimeSpan)(bonusOuttime - bonusIntime);
|
||||||
if (ts.Minutes < 16 && ts.Hours < 5)
|
if (ts.Minutes < 16 && ts.Hours < 5)
|
||||||
wh = ts.Hours;
|
wh = ts.Hours;
|
||||||
else if (ts.Minutes < 16)
|
else if (ts.Minutes < 16)
|
||||||
|
@ -749,22 +741,8 @@ namespace HRM.DA
|
||||||
oProcessItem = new ProdBonusProcessItem();
|
oProcessItem = new ProdBonusProcessItem();
|
||||||
oProcessItem.EmployeeID = item.Key;
|
oProcessItem.EmployeeID = item.Key;
|
||||||
oProcessItem.OTHour = oth;
|
oProcessItem.OTHour = oth;
|
||||||
if(oProcessItem.EmployeeID == 283)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
//Amount mismatch hude ammount
|
|
||||||
if (oProcessItem.EmployeeID == 27620 || oProcessItem.EmployeeID == 27620 || oProcessItem.EmployeeID == 31161 || oProcessItem.EmployeeID == 1822
|
|
||||||
|| oProcessItem.EmployeeID == 36901 || oProcessItem.EmployeeID == 37542 || oProcessItem.EmployeeID == 41160 || oProcessItem.EmployeeID == 44495
|
|
||||||
|| oProcessItem.EmployeeID == 44495 || oProcessItem.EmployeeID == 46607 || oProcessItem.EmployeeID == 49783 || oProcessItem.EmployeeID == 55041
|
|
||||||
|| oProcessItem.EmployeeID == 55155 || oProcessItem.EmployeeID == 55388)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
if (oProcessItem.EmployeeID == 27620)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
oProcessItem.Amount = Math.Round(((double)basicSal / 208 * oth) * 2, 2);
|
oProcessItem.Amount = Math.Round(((double)basicSal / 208 * oth) * 2, 2);
|
||||||
//if(oProcessItem.EmployeeID == 55388)
|
//if(oProcessItem.EmployeeID == 55388)
|
||||||
//{
|
//{
|
||||||
|
@ -791,14 +769,16 @@ namespace HRM.DA
|
||||||
{
|
{
|
||||||
if (dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue)
|
if (dailyAtt.OutTime != DateTime.MinValue && dailyAtt.InTime != DateTime.MinValue)
|
||||||
{
|
{
|
||||||
|
bonusIntime = dailyAtt.InTime;
|
||||||
|
bonusOuttime = dailyAtt.OutTime;
|
||||||
oShift = oShifts.FirstOrDefault(x => x.ID == dailyAtt.ShiftID);
|
oShift = oShifts.FirstOrDefault(x => x.ID == dailyAtt.ShiftID);
|
||||||
|
|
||||||
if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date)
|
if (oProductionBonusSetup.FromDate.Date == dailyAtt.AttnDate.Date)
|
||||||
dailyAtt.InTime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.FromDate : dailyAtt.InTime;
|
bonusIntime = oProductionBonusSetup.FromDate > dailyAtt.InTime ? oProductionBonusSetup.FromDate : dailyAtt.InTime;
|
||||||
else if (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date)
|
else if (oProductionBonusSetup.ToDate.Date == dailyAtt.AttnDate.Date)
|
||||||
dailyAtt.OutTime = oProductionBonusSetup.ToDate < dailyAtt.OutTime ? oProductionBonusSetup.ToDate : dailyAtt.OutTime;
|
bonusOuttime = oProductionBonusSetup.ToDate < dailyAtt.OutTime ? oProductionBonusSetup.ToDate : dailyAtt.OutTime;
|
||||||
else if (oShift != null && dailyAtt.InTime.GetValueOrDefault().TimeOfDay < oShift.InTime.TimeOfDay)
|
else if (oShift != null && dailyAtt.InTime.GetValueOrDefault().TimeOfDay < oShift.InTime.TimeOfDay)
|
||||||
dailyAtt.InTime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute);
|
bonusIntime = dailyAtt.InTime.GetValueOrDefault().Date.AddHours(oShift.InTime.Hour).AddMinutes(oShift.InTime.Minute);
|
||||||
|
|
||||||
TimeSpan ts = (TimeSpan)(dailyAtt.OutTime - dailyAtt.InTime);
|
TimeSpan ts = (TimeSpan)(dailyAtt.OutTime - dailyAtt.InTime);
|
||||||
if (ts.Minutes < 16 && ts.Hours < 5)
|
if (ts.Minutes < 16 && ts.Hours < 5)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user