406 lines
18 KiB
C#
406 lines
18 KiB
C#
//using System;
|
|
//using System.Collections.Generic;
|
|
//using System.Linq;
|
|
//using System.Text;
|
|
//using System.Data;
|
|
//using Payroll.BO;
|
|
//using Ease.CoreV35;
|
|
//using Ease.CoreV35.Model;
|
|
//using Microsoft.Reporting.WinForms;
|
|
|
|
//namespace Payroll.Report
|
|
//{
|
|
// public class rptPF
|
|
// {
|
|
// private ReportSetup _selectedParameter;
|
|
// private DateTime _SalaryMonth;
|
|
// string tempEmpID = string.Empty;
|
|
// int count = 1;
|
|
// private int TotalEmp = 0;
|
|
// DataSet _currentSMonthly = null;
|
|
// DataSet _prvSMonthly = null;
|
|
// double balance = 0.00;
|
|
|
|
// public ReportSetup SelectedParameter
|
|
// {
|
|
// set
|
|
// {
|
|
// _selectedParameter = value;
|
|
// }
|
|
// }
|
|
|
|
// public rptPF()
|
|
// {
|
|
// }
|
|
|
|
// internal void GetPFLedger(string sEmpID, DateTime FromDate, DateTime toDate, string sEmpName,string sEmpNo)
|
|
// {
|
|
// fReportViewer form = new fReportViewer();
|
|
|
|
// DataRow oDR = null;
|
|
// DataSet oPFLedger = null;
|
|
// double opening = 0.00;
|
|
|
|
// oPFLedger = MiscellaneousDataset.GetPFLedger(sEmpID, FromDate, toDate);
|
|
// PayrollDataSet.PayrollDataSet.PFLedgerDataTable dTPFLedger = new Payroll.Report.PayrollDataSet.PayrollDataSet.PFLedgerDataTable();
|
|
|
|
// foreach (DataRow source in oPFLedger.Tables[0].Rows)
|
|
// {
|
|
// oDR = dTPFLedger.NewRow();
|
|
// oDR["Description"] = source["Description"];
|
|
// oDR["OpeningBalance"] = source["PFAmount"];
|
|
// opening = Convert.ToDouble(oDR["OpeningBalance"]);
|
|
// balance = Convert.ToDouble(oDR["OpeningBalance"]) + Convert.ToDouble(oDR["OpeningBalance"]);
|
|
// oDR["TotalBalance"] = balance;
|
|
// source["PFAmount"] = source["PFAmount"];
|
|
// source["CPFAmount"] = source["CPFAmount"];
|
|
// dTPFLedger.Rows.Add(oDR);
|
|
// }
|
|
|
|
// foreach (DataRow source in oPFLedger.Tables[1].Rows)
|
|
// {
|
|
// oDR = dTPFLedger.NewRow();
|
|
// this.CopyInd(oDR, source);
|
|
// dTPFLedger.Rows.Add(oDR);
|
|
// }
|
|
// dTPFLedger.Rows.RemoveAt(0);
|
|
// form.ShowPFLedger(dTPFLedger, sEmpID, FromDate, toDate, sEmpName, sEmpNo, opening);
|
|
// }
|
|
|
|
// public void CopyInd(DataRow source, DataRow destination)
|
|
// {
|
|
// DateTime date = Convert.ToDateTime(destination["Description"]);
|
|
// source["Description"] = date.ToString("MMMM,yyyy");
|
|
// source["PFAmount"] = destination["PFAmount"];
|
|
// source["CPFAmount"] = destination["CPFAmount"];
|
|
// balance = balance + Convert.ToDouble(source["PFAmount"])+ Convert.ToDouble(source["CPFAmount"]);
|
|
// source["TotalBalance"] = balance;
|
|
// }
|
|
|
|
// internal void PrepareProvidentFundReport(DateTime dateTime, string sUnitID)
|
|
// {
|
|
// fReportViewer form = new fReportViewer();
|
|
|
|
// DataRow oDR = null;
|
|
// DataSet dsPF = null;
|
|
// dsPF = MiscellaneousDataset.GetEmployeesPF(dateTime, sUnitID);
|
|
|
|
// PayrollDataSet.dsCompany.DTProvidentFundDataTable dtProvident = new Payroll.Report.PayrollDataSet.dsCompany.DTProvidentFundDataTable();
|
|
|
|
// if(dsPF.Tables.Count > 0)
|
|
// {
|
|
// foreach (DataRow orow in dsPF.Tables[0].Rows)
|
|
// {
|
|
// oDR = dtProvident.NewRow();
|
|
|
|
// oDR["Unit"] = orow["Unit"].ToString();
|
|
// oDR["Department"] = orow["Department"].ToString();
|
|
// oDR["CompanyContri"] = Convert.ToDouble(orow["CPF"].ToString());
|
|
// oDR["EmpContri"] = Convert.ToDouble(orow["EPF"].ToString());
|
|
// oDR["PFLoan"] = Convert.ToDouble(orow["PFLoan"].ToString());
|
|
// oDR["LoanInterest"] = Convert.ToDouble(orow["PFLoanInterest"].ToString());
|
|
|
|
// dtProvident.Rows.Add(oDR);
|
|
// }
|
|
|
|
// if(dtProvident.Rows.Count > 0)
|
|
// {
|
|
// form.ShowPFTransactionReport(dtProvident,dateTime);
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// internal void MonthlyPFReport(DateTime dateTime)
|
|
// {
|
|
// fReportViewer form = new fReportViewer();
|
|
|
|
// DataRow oDR = null;
|
|
// DataSet dsPF = null;
|
|
// dsPF = MiscellaneousDataset.GetEmployeesPF(dateTime);
|
|
// PayrollDataSet.dsCompany.DTMonthlyPFDataTable dtMonthlyPF = new Payroll.Report.PayrollDataSet.dsCompany.DTMonthlyPFDataTable();
|
|
|
|
// if(dsPF.Tables.Count > 0)
|
|
// {
|
|
// foreach (DataRow orr in dsPF.Tables[0].Rows)
|
|
// {
|
|
// oDR = dtMonthlyPF.NewRow();
|
|
|
|
// oDR["EmployeeNo"] = orr["EmployeeNo"].ToString();
|
|
// oDR["Name"] = orr["Name"].ToString();
|
|
// DateTime dtJoin = Convert.ToDateTime(orr["JOININGDATE"].ToString());
|
|
// oDR["Doj"] = dtJoin.ToString("dd MMM yyyy");
|
|
// oDR["Designation"] = orr["Designation"].ToString();
|
|
// oDR["Department"] = orr["Department"].ToString();
|
|
// oDR["CostCenter"] = orr["CostCenter"].ToString();
|
|
// oDR["TotalGross"] = Convert.ToDouble(orr["TotalGross"].ToString());
|
|
// oDR["CPF"] = Convert.ToDouble(orr["CPF"].ToString());
|
|
// oDR["EPF"] = Convert.ToDouble(orr["EPF"].ToString());
|
|
// if (Convert.ToDouble(orr["EPF"].ToString()) == 0 && Convert.ToDouble(orr["CPF"].ToString()) == 0)
|
|
// {
|
|
// continue;
|
|
// }
|
|
|
|
// dtMonthlyPF.Rows.Add(oDR);
|
|
// }
|
|
|
|
// if (dtMonthlyPF.Rows.Count > 0)
|
|
// {
|
|
// form.ShowMonthlyPFReport(dateTime, dtMonthlyPF);
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// internal void NewMonthlyPFReport(DateTime dtFirstdate, DateTime dtLastdate)
|
|
// {
|
|
// fReportViewer form = new fReportViewer();
|
|
|
|
// DataRow oDR = null;
|
|
// DataSet dsPF = null;
|
|
// dsPF = MiscellaneousDataset.GetEmployeesPF(dtFirstdate, dtLastdate);
|
|
// PayrollDataSet.dsCompany.DTMonthlyPFDataTable dtMonthlyPF = new Payroll.Report.PayrollDataSet.dsCompany.DTMonthlyPFDataTable();
|
|
|
|
// if (dsPF.Tables.Count > 0)
|
|
// {
|
|
// foreach (DataRow orr in dsPF.Tables[0].Rows)
|
|
// {
|
|
// oDR = dtMonthlyPF.NewRow();
|
|
|
|
// oDR["EmployeeNo"] = orr["EmployeeNo"].ToString();
|
|
// oDR["Name"] = orr["Name"].ToString();
|
|
// DateTime dtJoin = Convert.ToDateTime(orr["JOININGDATE"].ToString());
|
|
// oDR["Doj"] = dtJoin.ToString("dd MMM yyyy");
|
|
// oDR["Designation"] = orr["Designation"].ToString();
|
|
// oDR["Department"] = orr["Department"].ToString();
|
|
// oDR["CostCenter"] = orr["CostCenter"].ToString();
|
|
// oDR["TotalGross"] = Convert.ToDouble(orr["TotalGross"].ToString());
|
|
// oDR["CPF"] = Convert.ToDouble(orr["CPF"].ToString());
|
|
// oDR["EPF"] = Convert.ToDouble(orr["EPF"].ToString());
|
|
|
|
// dtMonthlyPF.Rows.Add(oDR);
|
|
// }
|
|
|
|
// if (dtMonthlyPF.Rows.Count > 0)
|
|
// {
|
|
// form.ShowMonthlyPFReport(dtFirstdate, dtMonthlyPF);
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
// public void PrepareDataForExceptionPFEmployee(DateTime fromdate, DateTime todate)
|
|
// {
|
|
// fReportViewer form = new fReportViewer();
|
|
|
|
// DataRow oDR = null;
|
|
// DataSet dsPF = null;
|
|
// dsPF = MiscellaneousDataset.GetExceptionEmployeesPF(fromdate, todate);
|
|
// PayrollDataSet.dsCompany.PFExceptionDataTable dtExceptionPF = new Payroll.Report.PayrollDataSet.dsCompany.PFExceptionDataTable();
|
|
|
|
// if (dsPF.Tables.Count > 0)
|
|
// {
|
|
// foreach (DataRow orr in dsPF.Tables[0].Rows)
|
|
// {
|
|
// oDR = dtExceptionPF.NewRow();
|
|
|
|
// oDR["Name"] = orr["Name"].ToString();
|
|
// oDR["EmpNo"] = orr["EmployeeNo"].ToString();
|
|
// oDR["Country"] = orr["Country"].ToString();
|
|
// oDR["Designation"] = orr["Designation"].ToString();
|
|
// oDR["Department"] = orr["Department"].ToString();
|
|
// oDR["CostCenter"] = orr["CostCenter"].ToString();
|
|
// oDR["PFAmount"] = Convert.ToDouble(orr["PFAmount"].ToString());
|
|
|
|
// dtExceptionPF.Rows.Add(oDR);
|
|
// }
|
|
|
|
// // if (dtExceptionPF.Rows.Count > 0)
|
|
// {
|
|
// form.ShowExceptionPFReport(fromdate, dtExceptionPF);
|
|
// }
|
|
// }
|
|
// }
|
|
// public void PrepareDataForExceptionPFandConfirmation(DateTime fromdate, DateTime todate)
|
|
// {
|
|
// fReportViewer form = new fReportViewer();
|
|
// DataRow oDR = null;
|
|
// DataSet dsPF = null;
|
|
|
|
// dsPF = MiscellaneousDataset.GetEmployeesPFNew(fromdate, todate);
|
|
|
|
// PayrollDataSet.dsCompany.NewPFDataTable dtMonthlyPF = new Payroll.Report.PayrollDataSet.dsCompany.NewPFDataTable();
|
|
|
|
// if (dsPF.Tables.Count > 0)
|
|
// {
|
|
// foreach (DataRow orr in dsPF.Tables[0].Rows)
|
|
// {
|
|
// oDR = dtMonthlyPF.NewRow();
|
|
|
|
// oDR["EmpName"] = orr["Name"].ToString();
|
|
// oDR["EmpNo"] = orr["EmployeeNo"].ToString();
|
|
// DateTime dtJoin = Convert.ToDateTime(orr["JOININGDATE"].ToString());
|
|
// oDR["JoiningDate"] = dtJoin.ToString("dd MMM yyyy");
|
|
// DateTime dob = Convert.ToDateTime((orr["BirthDate"]).ToString());
|
|
// oDR["DoB"] = dob.ToString("dd MMM yyyy");
|
|
// oDR["Designation"] = orr["Designation"].ToString();
|
|
// oDR["Department"] = orr["Department"].ToString();
|
|
|
|
// oDR["GrossSalary"] = Convert.ToDouble(orr["GrossSalary"].ToString());
|
|
// oDR["CPF"] = Convert.ToDouble(orr["CPF"].ToString());
|
|
// oDR["EPF"] = Convert.ToDouble(orr["EPF"].ToString());
|
|
|
|
// dtMonthlyPF.Rows.Add(oDR);
|
|
// }
|
|
|
|
// //if (dtMonthlyPF.Rows.Count > 0)
|
|
// {
|
|
// form.ShowExceptionPFConfirmationReport(fromdate, todate, dtMonthlyPF);
|
|
// }
|
|
// }
|
|
|
|
// }
|
|
|
|
// public void PrepareDataForExceptionSalaryRevision(DateTime fromdate, DateTime todate)
|
|
// {
|
|
// fReportViewer form = new fReportViewer();
|
|
// DataRow oDR = null;
|
|
// DataSet dsSR = null;
|
|
|
|
// dsSR = MiscellaneousDataset.GetMonthlySalaryRevision(fromdate, todate);
|
|
// PayrollDataSet.dsCompany.MonthlySalaryRevisionDataTable dtMonthlySalaryRevision = new Payroll.Report.PayrollDataSet.dsCompany.MonthlySalaryRevisionDataTable();
|
|
|
|
// if (dsSR.Tables.Count > 0)
|
|
// {
|
|
// foreach (DataRow orr in dsSR.Tables[0].Rows)
|
|
// {
|
|
// oDR = dtMonthlySalaryRevision.NewRow();
|
|
|
|
// oDR["EmpName"] = orr["Name"].ToString();
|
|
// oDR["EmpNo"] = orr["EMPLOYEENO"].ToString();
|
|
// DateTime dtJoin = Convert.ToDateTime(orr["JOININGDATE"].ToString());
|
|
// oDR["JoiningDate"] = dtJoin.ToString("dd MMM yyyy");
|
|
// oDR["Designation"] = orr["Designation"].ToString();
|
|
// oDR["Department"] = orr["Department"].ToString();
|
|
|
|
// oDR["PreviousSalary"] = Convert.ToDouble(orr["Prev"].ToString());
|
|
// oDR["RevisedSalary"] = Convert.ToDouble(orr["Present"].ToString());
|
|
|
|
// dtMonthlySalaryRevision.Rows.Add(oDR);
|
|
|
|
// }
|
|
|
|
// //if (dtMonthlySalaryRevision.Rows.Count > 0)
|
|
// {
|
|
// form.ShowExceptionSalaryRevisionReport(fromdate, todate, dtMonthlySalaryRevision);
|
|
// }
|
|
// }
|
|
|
|
// }
|
|
// public void PFRegister()
|
|
// {
|
|
// Loan oLoan = null;
|
|
// DataRow oDR = null;
|
|
// fReportViewer form = new fReportViewer();
|
|
// //DateTime dSalaryMonth = _selectedParameter.FromDate.Value;
|
|
// DateTime dSalaryMonth = Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate;
|
|
// DateTime fromdate=GlobalFunctions.FirstDateOfYear(dSalaryMonth);
|
|
// DateTime todate=GlobalFunctions.LastDateOfYear(dSalaryMonth);
|
|
// string sEmpID = _selectedParameter.ReportItem.INSQL;
|
|
// string[] sEMPIDs = sEmpID.Split(',');
|
|
|
|
// SalaryMonthlyDetail salaryDetail=null;
|
|
// DataSet ltadetailItems = ArrearProcess.GetDetailItems(sEmpID, dSalaryMonth, (int)enumPayrollComponentType.PF, (int)enumPayrollComponentType.PF);
|
|
// DataSet salarydetail = SalaryMonthly.GetOnRange(sEmpID, fromdate, todate, EnumSalaryGroup.Deductions, EnumSalaryItemCode.PF_Contribution);
|
|
// DataSet pfOpening = PFTransaction.GetPFBalanceBAT(new DateTime(fromdate.AddYears(-1).Year, 12, 31), todate);
|
|
// ObjectsTemplate<Employee> employees = Employee.GetByEmpIDs(sEmpID);
|
|
|
|
// PayrollDataSet.PayrollDataSet.PFRegisterDataTable dTable = new Payroll.Report.PayrollDataSet.PayrollDataSet.PFRegisterDataTable();
|
|
// try
|
|
// {
|
|
// foreach (Employee oEmp in employees)
|
|
// {
|
|
// oDR = dTable.NewRow();
|
|
// oDR["EmpID"] = oEmp.EmployeeNo;
|
|
// oDR["EmpName"] = oEmp.Name;
|
|
// oDR["Department"] = oEmp.Department.Name;
|
|
// oDR["CC"] = "";
|
|
|
|
|
|
// var opening = pfOpening.Tables[0].AsEnumerable().FirstOrDefault(o => o.Field<decimal>("EMPLOYEEID") == (decimal)oEmp.ID.Integer);
|
|
// if (opening != null)
|
|
// {
|
|
// oDR["OBalanceOwn"] = opening.Field<decimal>("AMOUNT");
|
|
// oDR["ObalanceCompany"] = oDR["OBalanceOwn"];
|
|
// }
|
|
// var ltadetailItem = ltadetailItems.Tables[0].AsEnumerable().FirstOrDefault(x => x.Field<decimal>("EMPLOYEEID") == (decimal)oEmp.ID.Integer);
|
|
// //osalaryMonthlystemp = osalaryMonthlys.Where(x => x.EmployeeID == oEmp.ID).ToObjectsTemplate();
|
|
// if (ltadetailItem!=null)
|
|
// {
|
|
// oDR["LTAPFOwn"] = ltadetailItem.Field<decimal>("CHANGEDAMOUNT");
|
|
// oDR["LTAPFCompany"] = oDR["LTAPFOwn"];
|
|
// }
|
|
|
|
// var osalaryMonthlystemp = salarydetail.Tables[0].AsEnumerable().Where(o => o.Field<decimal>("EmployeeID") == (decimal)oEmp.ID.Integer);
|
|
|
|
// foreach (var item in osalaryMonthlystemp)
|
|
// {
|
|
|
|
// switch ((item.Field<DateTime>("SALARYMONTH")).Month)
|
|
// {
|
|
// case 1:
|
|
// oDR["Jan"] = (item.Field<decimal>("ChangedAmount")) * 2;
|
|
// break;
|
|
// case 2:
|
|
// oDR["Feb"] = (item.Field<decimal>("ChangedAmount")) * 2;
|
|
// break;
|
|
// case 3:
|
|
// oDR["Mar"] = (item.Field<decimal>("ChangedAmount")) * 2;
|
|
// break;
|
|
// case 4:
|
|
// oDR["Apr"] = (item.Field<decimal>("ChangedAmount")) * 2;
|
|
// break;
|
|
// case 5:
|
|
// oDR["May"] = (item.Field<decimal>("ChangedAmount")) * 2;
|
|
// break;
|
|
// case 6:
|
|
// oDR["June"] = (item.Field<decimal>("ChangedAmount")) * 2;
|
|
// break;
|
|
// case 7:
|
|
// oDR["July"] = (item.Field<decimal>("ChangedAmount")) * 2;
|
|
// break;
|
|
// case 8:
|
|
// oDR["Aug"] = (item.Field<decimal>("ChangedAmount")) * 2;
|
|
// break;
|
|
// case 9:
|
|
// oDR["Sept"] = (item.Field<decimal>("ChangedAmount")) * 2;
|
|
// break;
|
|
// case 10:
|
|
// oDR["Oct"] = (item.Field<decimal>("ChangedAmount")) * 2;
|
|
// break;
|
|
// case 11:
|
|
// oDR["Nov"] = (item.Field<decimal>("ChangedAmount")) * 2;
|
|
// break;
|
|
// case 12:
|
|
// oDR["Dec"] = (item.Field<decimal>("ChangedAmount")) * 2;
|
|
// break;
|
|
// default:
|
|
// break;
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
|
|
// dTable.Rows.Add(oDR);
|
|
// }
|
|
// }
|
|
|
|
// catch (Exception ex)
|
|
// {
|
|
// throw new Exception(ex.Message);
|
|
// }
|
|
|
|
// form.ShowDlgPFRegister(_selectedParameter.ReportItem, dTable);
|
|
|
|
// }
|
|
// }
|
|
//}
|