Kpi Report modified
This commit is contained in:
parent
634c30f368
commit
ccabffeeec
|
@ -85,7 +85,10 @@ namespace HRM.DA
|
|||
}
|
||||
internal static IDataReader Get(TransactionContext tc, EnumStatus status)
|
||||
{
|
||||
return tc.ExecuteReader("SELECT * FROM GRADES where Status=%n order by code", status);
|
||||
if(status == EnumStatus.Regardless)
|
||||
return tc.ExecuteReader("SELECT * FROM GRADES order by code");
|
||||
else
|
||||
return tc.ExecuteReader("SELECT * FROM GRADES where Status=%n order by code", status);
|
||||
}
|
||||
internal static IDataReader Get(TransactionContext tc, EnumStatus status, string sIDs,
|
||||
string sTargetPropertyName, int payrolltypeid)
|
||||
|
|
|
@ -857,6 +857,9 @@
|
|||
<TablixColumn>
|
||||
<Width>0.46875in</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>0.39583in</Width>
|
||||
</TablixColumn>
|
||||
<TablixColumn>
|
||||
<Width>0.35417in</Width>
|
||||
</TablixColumn>
|
||||
|
@ -1198,6 +1201,39 @@
|
|||
</Textbox>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="Textbox100">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>=Sum(iif(Fields!ExtraAllowance.Value = 1,1,0))</Value>
|
||||
<Style>
|
||||
<FontSize>8pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style />
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox100</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>Solid</Style>
|
||||
</Border>
|
||||
<BackgroundColor>=iif(Sum(iif(Fields!AttenType.Value = 1 or Fields!AttenType.Value = 3 or Fields!AttenType.Value = 7 or Fields!AttenType.Value = 11 or Fields!AttenType.Value = 12,1,0))>0,"Yellow","White")</BackgroundColor>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
<rd:Selected>true</rd:Selected>
|
||||
</CellContents>
|
||||
</TablixCell>
|
||||
<TablixCell>
|
||||
<CellContents>
|
||||
<Textbox Name="Textbox8">
|
||||
|
@ -2457,6 +2493,87 @@
|
|||
</TablixMember>
|
||||
</TablixMembers>
|
||||
</TablixMember>
|
||||
<TablixMember>
|
||||
<TablixHeader>
|
||||
<Size>0.25in</Size>
|
||||
<CellContents>
|
||||
<Textbox Name="Textbox98">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value />
|
||||
<Style>
|
||||
<FontSize>8pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style>
|
||||
<TextAlign>Center</TextAlign>
|
||||
</Style>
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox98</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
</Border>
|
||||
<VerticalAlign>Middle</VerticalAlign>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
</CellContents>
|
||||
</TablixHeader>
|
||||
<TablixMembers>
|
||||
<TablixMember>
|
||||
<TablixHeader>
|
||||
<Size>0.69792in</Size>
|
||||
<CellContents>
|
||||
<Textbox Name="Textbox99">
|
||||
<CanGrow>true</CanGrow>
|
||||
<KeepTogether>true</KeepTogether>
|
||||
<Paragraphs>
|
||||
<Paragraph>
|
||||
<TextRuns>
|
||||
<TextRun>
|
||||
<Value>Extra Allowance</Value>
|
||||
<Style>
|
||||
<FontStyle>Normal</FontStyle>
|
||||
<FontSize>8pt</FontSize>
|
||||
<FontWeight>Normal</FontWeight>
|
||||
<TextDecoration>None</TextDecoration>
|
||||
<Color>#000000</Color>
|
||||
</Style>
|
||||
</TextRun>
|
||||
</TextRuns>
|
||||
<Style>
|
||||
<TextAlign>Center</TextAlign>
|
||||
</Style>
|
||||
</Paragraph>
|
||||
</Paragraphs>
|
||||
<rd:DefaultName>Textbox99</rd:DefaultName>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>Solid</Style>
|
||||
</Border>
|
||||
<BackgroundColor>Yellow</BackgroundColor>
|
||||
<VerticalAlign>Middle</VerticalAlign>
|
||||
<PaddingLeft>2pt</PaddingLeft>
|
||||
<PaddingRight>2pt</PaddingRight>
|
||||
<PaddingTop>2pt</PaddingTop>
|
||||
<PaddingBottom>2pt</PaddingBottom>
|
||||
</Style>
|
||||
</Textbox>
|
||||
</CellContents>
|
||||
</TablixHeader>
|
||||
</TablixMember>
|
||||
</TablixMembers>
|
||||
</TablixMember>
|
||||
<TablixMember>
|
||||
<TablixHeader>
|
||||
<Size>0.25in</Size>
|
||||
|
@ -4083,7 +4200,7 @@
|
|||
<DataSetName>MonthlyKPIDetail</DataSetName>
|
||||
<Top>0.16021in</Top>
|
||||
<Height>1.19792in</Height>
|
||||
<Width>13.95876in</Width>
|
||||
<Width>14.35459in</Width>
|
||||
<Style>
|
||||
<Border>
|
||||
<Style>None</Style>
|
||||
|
|
|
@ -1,14 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Ease.Core.Model;
|
||||
using Ease.Core.Utility;
|
||||
using HRM.BO;
|
||||
using HRM.BO.Configuration;
|
||||
using HRM.DA;
|
||||
using HRM.Report.Attendence.AttendenceDataSet;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Reporting.NETCore;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using NPOI.XSSF.Streaming.Values;
|
||||
|
@ -2844,6 +2847,38 @@ namespace HRM.Report
|
|||
oMonthlyKPIDetail = new EchoTexExceptionReportService().GetMonthlyKPIDetail(dFromDate, dToDate, sEmpID);
|
||||
|
||||
|
||||
#region Extra
|
||||
|
||||
oMonthlyKPIDetail.Tables[0].Columns.Add("ExtraAllowance", typeof(double));
|
||||
|
||||
if (oMonthlyKPIDetail != null && oMonthlyKPIDetail.Tables.Count > 0)
|
||||
{
|
||||
List<DailyAttnProcess> dAttnProcessess = dAttnProcessess = new DailyAttnProcessService().Get(sEmpID, dFromDate, dToDate);
|
||||
//List<AttnNationalHoliday> oNationalHolidays = AttnNationalHoliday.GetByMonth(dFromDate.FirstDateOfYear(), dFromDate.LastDateOfYear());
|
||||
List<Shift> oShifts = new ShiftService().Get(EnumStatus.Active, payrollTypeID);
|
||||
List<Employee> oemps = new EmployeeService().GetByEmpIDs(sEmpID);
|
||||
List<ADParameter> oAdparameters = new ADParameterService().Get(EnumStatus.Active, EnumAllowOrDeduct.Allowance, payrollTypeID).Where(x => x.AllowDeductID == 4).ToList(); // AllowDeductID = 4 is Extra Allowance in ALLOWANCEDEDUCTION table
|
||||
List<Grade> ogrades = new GradeService().Get(EnumStatus.Regardless);
|
||||
foreach (DataRow monthlyRow in oMonthlyKPIDetail.Tables[0].Rows)
|
||||
{
|
||||
Employee emp = oemps.Find(x => x.EmployeeNo.ToString() == monthlyRow["IDNo"].ToString());
|
||||
if (emp == null) continue;
|
||||
DateTime attnDate = Convert.ToDateTime(monthlyRow["AttnDate"]);
|
||||
List<DailyAttnProcess> dEmpAttn = dAttnProcessess.FindAll(x => x.EmployeeID == emp.ID && x.AttnDate.Date == attnDate.Date).ToList();
|
||||
DataTable oDataTable = new rptEcho().GetEmpDailyAttnNewKPI(emp.ID, dEmpAttn, emp, oShifts, oAdparameters, ogrades);
|
||||
if (oDataTable != null && oDataTable.Rows.Count > 0)
|
||||
{
|
||||
monthlyRow["ExtraAllowance"] = oDataTable.Rows[0]["ExtraAllowance"];
|
||||
}
|
||||
else
|
||||
{
|
||||
monthlyRow["ExtraAllowance"] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
DataTable oMnthlyKPIDtlSummary = new AttendenceDataSet.MnthlyKPIDtlSummaryDataTable();
|
||||
|
||||
#region Summary Parts
|
||||
|
@ -2883,6 +2918,64 @@ namespace HRM.Report
|
|||
|
||||
return reportProcessor.AttendanceReportsView(null, oMonthlyKPIDetail, null, RDLC, _parameters, true, payrollTypeID, reportType);
|
||||
}
|
||||
public DataTable GetEmpDailyAttnNewKPI(int EmpID, List<DailyAttnProcess> dAttnProcessess, Employee emp, List<Shift> oShifts, List<ADParameter> oADPrams, List<Grade> ogrades)
|
||||
{
|
||||
AttendenceDataSet.EmpDailyAttnDataTable dTable = new AttendenceDataSet.EmpDailyAttnDataTable();
|
||||
|
||||
var builder = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddJsonFile("appsettings.json");
|
||||
IConfiguration Configuration = builder.Build();
|
||||
|
||||
string sExtraAllowanceHour = Configuration.GetSection("Attendance")["ExtraAllowanceHour"];
|
||||
double dExtraAllowanceHours = 0;
|
||||
if (!double.TryParse(sExtraAllowanceHour, out dExtraAllowanceHours))
|
||||
{
|
||||
dExtraAllowanceHours = 13.5; // Default if Hour not given
|
||||
}
|
||||
DateTime startTime, endTime;
|
||||
|
||||
if (!(dAttnProcessess == null || dAttnProcessess.Count <= 0))
|
||||
{
|
||||
foreach (DailyAttnProcess dAttnProcess in dAttnProcessess)
|
||||
{
|
||||
DataRow Rowbody = dTable.NewRow();
|
||||
Rowbody["ExtraAllowance"] = 0;
|
||||
if (oADPrams != null && emp != null)
|
||||
{
|
||||
foreach (ADParameter adparam in oADPrams)
|
||||
{
|
||||
foreach (ADParameter.ADParameterGrade grn in adparam.ADParameterGrades)
|
||||
{
|
||||
//Grade gr = ogrades.GetItem(grn.GradeID);
|
||||
Grade gr = ogrades.Find(delegate (Grade item) { return item.ID == grn.GradeID; });
|
||||
if (gr != null && gr.ID == emp.GradeID)
|
||||
{
|
||||
if (dAttnProcess.InTime != null && dAttnProcess.InTime != DateTime.MinValue)
|
||||
{
|
||||
Shift sft = oShifts.FirstOrDefault(x => x.ID == dAttnProcess.ShiftID);
|
||||
startTime = dAttnProcess.InTime.Value.Date.Add(sft.InTime.TimeOfDay);
|
||||
|
||||
startTime = (DateTime)startTime.AddMinutes(-15) > (DateTime)dAttnProcess.InTime ? (DateTime)startTime.AddMinutes(-15) : (DateTime)dAttnProcess.InTime;
|
||||
|
||||
endTime = dAttnProcess.OutTime != null ? (DateTime)dAttnProcess.OutTime : DateTime.MinValue;
|
||||
if (endTime != DateTime.MinValue)
|
||||
{
|
||||
if (endTime.Subtract(startTime).Add(TimeSpan.FromMinutes(1)).TotalHours >= dExtraAllowanceHours)
|
||||
{
|
||||
Rowbody["ExtraAllowance"] = 1;// ncount++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dTable.Rows.Add(Rowbody);
|
||||
}
|
||||
}
|
||||
return dTable;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -2942,7 +2942,27 @@ namespace HRM.Report
|
|||
.AsEnumerable()
|
||||
.OrderBy(x => Convert.ToInt32(x["EmployeeID"].ToString()))
|
||||
.CopyToDataTable();
|
||||
|
||||
string photoPath = "";
|
||||
string basePath = System.Environment.CurrentDirectory + "\\Documents\\EMPPHOTO\\";
|
||||
string fileNamePattern = "Image-" + employee.EmployeeNo.Trim();
|
||||
|
||||
string[] imageExtensions = { ".jpg", ".jpeg", ".png", ".gif", ".bmp", ".tiff" };
|
||||
string[] matchingFiles = Directory
|
||||
.GetFiles(basePath, fileNamePattern + ".*") // Check all files matching the pattern
|
||||
.Where(file => imageExtensions.Contains(Path.GetExtension(file), StringComparer.OrdinalIgnoreCase))
|
||||
.ToArray();
|
||||
|
||||
if (matchingFiles.Length > 0)
|
||||
{
|
||||
|
||||
photoPath = matchingFiles[0];
|
||||
//Console.WriteLine("Matching image files found:");
|
||||
//foreach (string file in matchingFiles)
|
||||
//{
|
||||
// photoPath = file;
|
||||
//}
|
||||
}
|
||||
|
||||
foreach (DataRow drBasic in dtEmpBasicInfo.Rows)
|
||||
{
|
||||
|
@ -2961,6 +2981,7 @@ namespace HRM.Report
|
|||
oRow["MartialStatus"] = (EnumMaritalStatus)Convert.ToInt16(drBasic["MARITALSTATUSID"]);
|
||||
oRow["Religion"] = drBasic["Religion"];
|
||||
oRow["Email"] = drBasic["PERSONALEMAIL"];
|
||||
oRow["EmpPhotograph"] = photoPath;
|
||||
//Commented for development
|
||||
//oRow["EmpPhotograph"] = _rImageManager.GetImage(drBasic["PhotoPath"].ToString());
|
||||
|
||||
|
|
|
@ -786,8 +786,8 @@ export class ReportViewerComponent implements OnInit {
|
|||
this.multiselect = true;
|
||||
this.hiddenFromDate = true;
|
||||
this.hiddenToDate = true;
|
||||
this.fromDate = new Date();
|
||||
this.toDate = new Date();
|
||||
this.fromDate = GlobalfunctionExtension.getFirstDateofMonth(new Date());
|
||||
this.toDate = GlobalfunctionExtension.getLastDateOfMonth(new Date());
|
||||
this.hiddenAllSearch = false;
|
||||
this.hiddenExport = true;
|
||||
this.loadCurrentFiscalYear();
|
||||
|
|
|
@ -1244,6 +1244,9 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="RDLC\IDCardPrint.rdlc">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="RDLC\Report177.rdlc">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
|
|
@ -1023,7 +1023,7 @@
|
|||
<TextRun>
|
||||
<Value>="‡dvb: "&Parameters!CPhone.Value</Value>
|
||||
<Style>
|
||||
<FontFamily>KarnaphuliMJ</FontFamily>
|
||||
<FontFamily>sutonnyMJ</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
|
@ -1506,7 +1506,7 @@
|
|||
<TextRun>
|
||||
<Value> kZ©vejx</Value>
|
||||
<Style>
|
||||
<FontFamily>KarnaphuliMJ</FontFamily>
|
||||
<FontFamily>sutonnyMJ</FontFamily>
|
||||
<FontSize>8pt</FontSize>
|
||||
<FontWeight>Bold</FontWeight>
|
||||
</Style>
|
||||
|
@ -1597,7 +1597,7 @@
|
|||
<TextRun>
|
||||
<Value>1. GB KvW© n¯ÍvšÍi †hvM¨ b‡n |</Value>
|
||||
<Style>
|
||||
<FontFamily>KarnaphuliMJ</FontFamily>
|
||||
<FontFamily>sutonnyMJ</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
|
@ -1626,7 +1626,7 @@
|
|||
<TextRun>
|
||||
<Value>2. GB KvW© nviv‡bv ‡M‡j ev bó n‡j mv‡_</Value>
|
||||
<Style>
|
||||
<FontFamily>KarnaphuliMJ</FontFamily>
|
||||
<FontFamily>sutonnyMJ</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
|
@ -1655,7 +1655,7 @@
|
|||
<TextRun>
|
||||
<Value> mv‡_ KZ©„cÿ‡K AewnZ Ki‡Z n‡e|</Value>
|
||||
<Style>
|
||||
<FontFamily>KarnaphuliMJ</FontFamily>
|
||||
<FontFamily>sutonnyMJ</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
|
@ -1684,7 +1684,7 @@
|
|||
<TextRun>
|
||||
<Value>=" kÖwgK AvBb Gi "+Parameters!Dhara.Value+" aviv ‡gvZv‡eK"</Value>
|
||||
<Style>
|
||||
<FontFamily>KarnaphuliMJ</FontFamily>
|
||||
<FontFamily>sutonnyMJ</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
|
@ -1713,7 +1713,7 @@
|
|||
<TextRun>
|
||||
<Value> bZzb KvW© cÖ`vb Kiv nB‡e| </Value>
|
||||
<Style>
|
||||
<FontFamily>KarnaphuliMJ</FontFamily>
|
||||
<FontFamily>sutonnyMJ</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
|
@ -1742,7 +1742,7 @@
|
|||
<TextRun>
|
||||
<Value> 3. PvKzix Z¨vM Kivi mgq KvW©wU ‡diZ</Value>
|
||||
<Style>
|
||||
<FontFamily>KarnaphuliMJ</FontFamily>
|
||||
<FontFamily>sutonnyMJ</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
|
@ -2002,7 +2002,7 @@
|
|||
<TextRun>
|
||||
<Value> w`‡Z n‡e|</Value>
|
||||
<Style>
|
||||
<FontFamily>KarnaphuliMJ</FontFamily>
|
||||
<FontFamily>sutonnyMJ</FontFamily>
|
||||
<FontSize>7pt</FontSize>
|
||||
</Style>
|
||||
</TextRun>
|
||||
|
|
Loading…
Reference in New Issue
Block a user