1194 lines
55 KiB
C#
1194 lines
55 KiB
C#
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.ComponentModel;
|
|||
|
using System.Data;
|
|||
|
using System.Drawing;
|
|||
|
using System.Linq;
|
|||
|
using System.Text;
|
|||
|
using System.Windows.Forms;
|
|||
|
using Payroll.BO;
|
|||
|
using Ease.CoreV35;
|
|||
|
using Ease.CoreV35.Model;
|
|||
|
using Ease.CoreV35.Caching;
|
|||
|
using Ease.CoreV35.DataAccess;
|
|||
|
using Microsoft.Reporting.WinForms;
|
|||
|
|
|||
|
namespace Payroll.Report
|
|||
|
{
|
|||
|
public class rptBankAdvice
|
|||
|
{
|
|||
|
private ReportSetup _selectedParameter;
|
|||
|
public rptBankAdvice()
|
|||
|
{
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public ReportSetup SelectedParameter
|
|||
|
{
|
|||
|
set
|
|||
|
{
|
|||
|
_selectedParameter = value;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//public void ShowReport()
|
|||
|
//{
|
|||
|
// fReportViewer form = new fReportViewer();
|
|||
|
// DateTime salaryMonth = _selectedParameter.FromDate.Value;
|
|||
|
// string sEmpID = _selectedParameter.ReportItem.INSQL;
|
|||
|
// int count = 1;
|
|||
|
// DataRow oDR = null;
|
|||
|
// Bank oBank;
|
|||
|
|
|||
|
// if (_selectedParameter.Banks.Count > 0)
|
|||
|
// oBank = _selectedParameter.Banks[0];
|
|||
|
// else throw new ServiceException("please select a bank");
|
|||
|
|
|||
|
// DataSet oEmpBankAcc = EmployeeBankAccount.GetEmpBankAdvice(GlobalFunctions.LastDateOfMonth(salaryMonth), sEmpID);
|
|||
|
|
|||
|
// PayrollDataSet.dsCompany.BankAdviceDataTable bankAdvice = new Payroll.Report.PayrollDataSet.dsCompany.BankAdviceDataTable();
|
|||
|
|
|||
|
// double nTotal = 0.0;
|
|||
|
// foreach (DataRow oDRow in oEmpBankAcc.Tables[0].Rows)
|
|||
|
// {
|
|||
|
// oDR = bankAdvice.NewRow();
|
|||
|
// oDR["EmpNo"] = oDRow["EMPLOYEENO"];
|
|||
|
// oDR["EmpName"] = oDRow["NAME"];
|
|||
|
// oDR["AccountNo"] = oDRow["ACCOUNTNO"];
|
|||
|
// oDR["Amount"] = Math.Round(Convert.ToDouble(oDRow["CHANGEDAMOUNT"]));
|
|||
|
// oDR["Email"] = oDRow["EMAILADDRESS"];
|
|||
|
// oDR["SalaryMonth"] = salaryMonth;
|
|||
|
// oDR["SLNo"] = count;
|
|||
|
// oDR["CostCenter"] = oDRow["CostCenter"].ToString();
|
|||
|
// nTotal += Convert.ToDouble(oDR["Amount"]);
|
|||
|
// bankAdvice.Rows.Add(oDR);
|
|||
|
// count++;
|
|||
|
// }
|
|||
|
|
|||
|
// string amountInWord = Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(nTotal);
|
|||
|
|
|||
|
// form.ShowDlgForBankAdvice(_selectedParameter.ReportItem, bankAdvice, amountInWord);
|
|||
|
//}
|
|||
|
|
|||
|
public void ShowReport()
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
DateTime salaryMonth = _selectedParameter.FromDate.Value;
|
|||
|
string sEmpID = _selectedParameter.ReportItem.INSQL;
|
|||
|
int count = 1;
|
|||
|
DataRow oDR = null;
|
|||
|
Bank oBank;
|
|||
|
//string month = salaryMonth.ToString("MMMM-yyyy");
|
|||
|
string takaInWord = string.Empty;
|
|||
|
if (_selectedParameter.Banks.Count > 0)
|
|||
|
oBank = _selectedParameter.Banks[0];
|
|||
|
else throw new ServiceException("please select a bank");
|
|||
|
|
|||
|
DataSet oEmpBankAcc = EmployeeBankAccount.GetEmpBankAdvice(GlobalFunctions.LastDateOfMonth(salaryMonth), sEmpID);
|
|||
|
|
|||
|
PayrollDataSet.dsCompany.BankAdviceDataTable bankAdvice = new Payroll.Report.PayrollDataSet.dsCompany.BankAdviceDataTable();
|
|||
|
|
|||
|
double nTotal = 0.0;
|
|||
|
foreach (DataRow oDRow in oEmpBankAcc.Tables[0].Rows)
|
|||
|
{
|
|||
|
oDR = bankAdvice.NewRow();
|
|||
|
oDR["EmpNo"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["EmpName"] = oDRow["NAME"];
|
|||
|
oDR["AccountNo"] = oDRow["ACCOUNTNO"];
|
|||
|
oDR["Amount"] = Math.Round(Convert.ToDouble(oDRow["CHANGEDAMOUNT"]));
|
|||
|
oDR["Email"] = oDRow["EMAILADDRESS"];
|
|||
|
oDR["SalaryMonth"] = salaryMonth;
|
|||
|
oDR["SLNo"] = count;
|
|||
|
oDR["CostCenter"] = oDRow["CostCenter"].ToString();
|
|||
|
|
|||
|
bankAdvice.Rows.Add(oDR);
|
|||
|
nTotal += Convert.ToDouble(oDR["Amount"]);
|
|||
|
count++;
|
|||
|
}
|
|||
|
|
|||
|
takaInWord = Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(nTotal);
|
|||
|
|
|||
|
DataSet ds = new DataSet();
|
|||
|
bankAdvice.TableName = "dsCompany_BankAdvice";
|
|||
|
ds.Tables.Add(bankAdvice);
|
|||
|
|
|||
|
List<ReportAuthorization> oAuthorizations = ReportAuthorization.GetByReportID(_selectedParameter.ReportItem.ReportID);
|
|||
|
List<AuthorizedPerson> oPersons = AuthorizedPerson.Get();
|
|||
|
List<ReportParameter> _parameters = new List<ReportParameter>();
|
|||
|
int nCount = 1;
|
|||
|
foreach(ReportAuthorization item in oAuthorizations)
|
|||
|
{
|
|||
|
AuthorizedPerson person = oPersons.Find(x => x.ID == item.AuthorizePersionId);
|
|||
|
if (person != null)
|
|||
|
{
|
|||
|
if (nCount == 1)
|
|||
|
{
|
|||
|
|
|||
|
_parameters.Add(new ReportParameter("Person1", person.Name));
|
|||
|
_parameters.Add(new ReportParameter("Designation1", person.Designation));
|
|||
|
}
|
|||
|
if (nCount == 2)
|
|||
|
{
|
|||
|
|
|||
|
_parameters.Add(new ReportParameter("Person2", person.Name));
|
|||
|
_parameters.Add(new ReportParameter("Designation2", person.Designation));
|
|||
|
}
|
|||
|
}
|
|||
|
nCount++;
|
|||
|
}
|
|||
|
_parameters.Add(new ReportParameter("Person3", "na"));
|
|||
|
_parameters.Add(new ReportParameter("Designation3","na"));
|
|||
|
|
|||
|
_parameters.Add(new ReportParameter("SalaryMonth", salaryMonth.ToString("MMMM-yyyy")));
|
|||
|
_parameters.Add(new ReportParameter("Month", salaryMonth.ToString("MMM-yyyy")));
|
|||
|
_parameters.Add(new ReportParameter("TakaInWord", takaInWord));
|
|||
|
_parameters.Add(new ReportParameter("BankName", oBank.Name));
|
|||
|
|
|||
|
form.CommonReportView(_selectedParameter.ReportItem, ds, "Payroll.Report.RDLC.BankAdvice.rdlc", _parameters);
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public void ShowBankForwordingLetter()
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
DateTime salaryMonth = _selectedParameter.FromDate.Value;
|
|||
|
string sEmpID = _selectedParameter.ReportItem.INSQL;
|
|||
|
int count = 1;
|
|||
|
DataRow oDR = null;
|
|||
|
Bank oBank;
|
|||
|
|
|||
|
if (_selectedParameter.Banks.Count > 0)
|
|||
|
oBank = _selectedParameter.Banks[0];
|
|||
|
else throw new ServiceException("please select a bank");
|
|||
|
|
|||
|
DataSet oEmpBankAcc = EmployeeBankAccount.GetEmpBankAdvice(GlobalFunctions.LastDateOfMonth(salaryMonth), sEmpID);
|
|||
|
|
|||
|
PayrollDataSet.dsCompany.BankAdviceDataTable bankAdvice = new Payroll.Report.PayrollDataSet.dsCompany.BankAdviceDataTable();
|
|||
|
|
|||
|
double nTotal = 0.0;
|
|||
|
foreach (DataRow oDRow in oEmpBankAcc.Tables[0].Rows)
|
|||
|
{
|
|||
|
//oDR = bankAdvice.NewRow();
|
|||
|
//oDR["EmpNo"] = oDRow["EMPLOYEENO"];
|
|||
|
//oDR["EmpName"] = oDRow["NAME"];
|
|||
|
//oDR["AccountNo"] = oDRow["ACCOUNTNO"];
|
|||
|
//oDR["Amount"] = Math.Round(Convert.ToDouble(oDRow["CHANGEDAMOUNT"]));
|
|||
|
//oDR["Email"] = oDRow["EMAILADDRESS"];
|
|||
|
//oDR["SalaryMonth"] = salaryMonth;
|
|||
|
//oDR["SLNo"] = count;
|
|||
|
//oDR["CostCenter"] = oDRow["CostCenter"].ToString();
|
|||
|
nTotal += Math.Round(Convert.ToDouble(oDRow["CHANGEDAMOUNT"]));
|
|||
|
//bankAdvice.Rows.Add(oDR);
|
|||
|
//count++;
|
|||
|
}
|
|||
|
string amountInWord = string.Empty;
|
|||
|
amountInWord = "Tk "+nTotal+" ("+ Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(nTotal)+")";
|
|||
|
|
|||
|
form.ShowDlgForBankForwordingLetter(_selectedParameter.ReportItem, bankAdvice, amountInWord, salaryMonth.ToString("MMM yy"), oBank);
|
|||
|
}
|
|||
|
public DataTable ExportBankAdvice(DateTime dMonth, ID nRepID, string sEmpIDs,List<Bank> oBanks)
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
DateTime salaryMonth = dMonth;
|
|||
|
string sEmpID = sEmpIDs;
|
|||
|
int count = 1;
|
|||
|
DataRow oDR = null;
|
|||
|
Bank oBank;
|
|||
|
|
|||
|
if (oBanks.Count > 0)
|
|||
|
oBank = oBanks[0];
|
|||
|
else throw new ServiceException("please select a bank");
|
|||
|
|
|||
|
DataSet oEmpBankAcc = EmployeeBankAccount.GetEmpBankAdvice(GlobalFunctions.LastDateOfMonth(salaryMonth), sEmpID);
|
|||
|
|
|||
|
DataTable bankAdvice = new DataTable();
|
|||
|
bankAdvice.Columns.Add("SL", typeof(int));
|
|||
|
bankAdvice.Columns.Add("Employee ID", typeof(int));
|
|||
|
bankAdvice.Columns.Add("Employee Name");
|
|||
|
bankAdvice.Columns.Add("Account No.");
|
|||
|
bankAdvice.Columns.Add("Amount BDT.",typeof(double));
|
|||
|
double nTotal = 0.0;
|
|||
|
foreach (DataRow oDRow in oEmpBankAcc.Tables[0].Rows)
|
|||
|
{
|
|||
|
oDR = bankAdvice.NewRow();
|
|||
|
oDR["Employee ID"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["Employee Name"] = oDRow["NAME"];
|
|||
|
oDR["Account No."] = oDRow["ACCOUNTNO"];
|
|||
|
oDR["Amount BDT."] = Math.Round(Convert.ToDouble(oDRow["CHANGEDAMOUNT"]));
|
|||
|
//nTotal += Convert.ToDouble(oDR["Amount"]);
|
|||
|
oDR["SL"] = count;
|
|||
|
bankAdvice.Rows.Add(oDR);
|
|||
|
count++;
|
|||
|
}
|
|||
|
|
|||
|
string amountInWord = Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(nTotal);
|
|||
|
return bankAdvice;
|
|||
|
//form.ShowDlgForBankAdvice(_selectedParameter.ReportItem, bankAdvice, amountInWord);
|
|||
|
}
|
|||
|
|
|||
|
public void ShowCashChequePaymentReport(DateTime month, string PaymentType)
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
DataRow oDR = null;
|
|||
|
DataSet CashChequePaymentdSet = MiscellaneousDataset.GetCashChequePaymentReport(month, PaymentType);
|
|||
|
PayrollDataSet.PayrollDataSet.CashChequePaymentDataTable cashChecqueDTable = new PayrollDataSet.PayrollDataSet.CashChequePaymentDataTable();
|
|||
|
string smonth = month.ToString("MMM yyyy");
|
|||
|
foreach (DataRow oDRow in CashChequePaymentdSet.Tables[0].Rows)
|
|||
|
{
|
|||
|
oDR = cashChecqueDTable.NewRow();
|
|||
|
oDR["EmployeeNo"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["Name"] = oDRow["NAME"];
|
|||
|
oDR["Department"] = oDRow["Department"];
|
|||
|
oDR["Designation"] = oDRow["Designation"];
|
|||
|
oDR["Amount"] = oDRow["Amount"];
|
|||
|
cashChecqueDTable.Rows.Add(oDR);
|
|||
|
}
|
|||
|
form.ShowDlgForCashChequePaymentReport(cashChecqueDTable, smonth, PaymentType);
|
|||
|
}
|
|||
|
public void ShowCashChequePaymentReportBonus(DateTime month, string PaymentType)
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
DataRow oDR = null;
|
|||
|
DataSet CashChequePaymentdSet = MiscellaneousDataset.GetCashChequePaymentReportBonus(month, PaymentType);
|
|||
|
PayrollDataSet.PayrollDataSet.CashChequePaymentDataTable cashChecqueDTable = new PayrollDataSet.PayrollDataSet.CashChequePaymentDataTable();
|
|||
|
string smonth = month.ToString("MMM yyyy");
|
|||
|
foreach (DataRow oDRow in CashChequePaymentdSet.Tables[0].Rows)
|
|||
|
{
|
|||
|
oDR = cashChecqueDTable.NewRow();
|
|||
|
oDR["EmployeeNo"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["Name"] = oDRow["NAME"];
|
|||
|
oDR["Department"] = oDRow["Department"];
|
|||
|
oDR["Designation"] = oDRow["Designation"];
|
|||
|
oDR["Amount"] = oDRow["Amount"];
|
|||
|
cashChecqueDTable.Rows.Add(oDR);
|
|||
|
}
|
|||
|
form.ShowDlgForCashChequePaymentReport(cashChecqueDTable, smonth, PaymentType);
|
|||
|
}
|
|||
|
|
|||
|
public void ShowReportOPI()
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
DateTime salaryMonth = _selectedParameter.FromDate.Value;
|
|||
|
string sEmpID = _selectedParameter.ReportItem.INSQL;
|
|||
|
int count = 1;
|
|||
|
DataRow oDR = null;
|
|||
|
Bank oBank;
|
|||
|
|
|||
|
if (_selectedParameter.Banks.Count > 0)
|
|||
|
oBank = _selectedParameter.Banks[0];
|
|||
|
else throw new ServiceException("please select a bank");
|
|||
|
|
|||
|
DataSet oEmpBankAcc = EmployeeBankAccount.GetOPIEmpBankAdvice(GlobalFunctions.LastDateOfMonth(salaryMonth), sEmpID, oBank.ID.Integer);
|
|||
|
DataSet oEmpExpenseAmount = new DataSet();
|
|||
|
|
|||
|
PayrollDataSet.PayrollDataSet.BankAdviceDataTable bankAdvice = new Payroll.Report.PayrollDataSet.PayrollDataSet.BankAdviceDataTable();
|
|||
|
PayrollDataSet.PayrollDataSet.BankAdviceLetterDataTable bankAdviceLetter = new Payroll.Report.PayrollDataSet.PayrollDataSet.BankAdviceLetterDataTable();
|
|||
|
|
|||
|
double nTotal = 0.0;
|
|||
|
foreach (DataRow oDRow in oEmpBankAcc.Tables[0].Rows)
|
|||
|
{
|
|||
|
oDR = bankAdvice.NewRow();
|
|||
|
oDR["EmpNo"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["EmpName"] = oDRow["NAME"];
|
|||
|
oDR["AccountNo"] = oDRow["ACCOUNTNO"];
|
|||
|
oDR["Amount"] = oDRow["Amount"];
|
|||
|
oDR["SLNo"] = count;
|
|||
|
nTotal += Convert.ToDouble(oDR["Amount"]);
|
|||
|
bankAdvice.Rows.Add(oDR);
|
|||
|
|
|||
|
count++;
|
|||
|
}
|
|||
|
|
|||
|
string amountInWord = Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(nTotal);
|
|||
|
form.ShowDlgForOPIBankAdvice(_selectedParameter.ReportItem, bankAdvice, amountInWord);
|
|||
|
}
|
|||
|
public void BonusRegisterBankAdviceCarFuel()
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
|
|||
|
ID nBonusID = _selectedParameter.Bonuses[0].ID;
|
|||
|
Bonus oBonus = Bonus.Get(nBonusID);
|
|||
|
DateTime dBonusMonth = _selectedParameter.FromDate.Value;
|
|||
|
string sEmpID = _selectedParameter.ReportItem.INSQL;
|
|||
|
int count = 1;
|
|||
|
DataRow oDR = null;
|
|||
|
DataSet oBonusRegister = null;
|
|||
|
|
|||
|
oBonusRegister = BonusProcess.GetBonusRegister(nBonusID, GlobalFunctions.FirstDateOfMonth(dBonusMonth), sEmpID);
|
|||
|
PayrollDataSet.PayrollDataSet.BonusRegisterDataTable dBonusRegData = new Payroll.Report.PayrollDataSet.PayrollDataSet.BonusRegisterDataTable();
|
|||
|
foreach (DataRow oDRow in oBonusRegister.Tables[0].Rows)
|
|||
|
{
|
|||
|
oDR = dBonusRegData.NewRow();
|
|||
|
oDR["EmpNo"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["Name"] = oDRow["NAME"];
|
|||
|
oDR["Basic"] = oDRow["BasicSalary"];
|
|||
|
oDR["BonusAmount"] = oDRow["ChangeBonusAmount"];
|
|||
|
oDR["TaxAmount"] = oDRow["ChangeTaxAmount"];
|
|||
|
oDR["Gross"] = oDRow["GROSSSALARY"];
|
|||
|
oDR["JoiningDate"] = oDRow["JOININGDATE"];
|
|||
|
oDR["BonusMonth"] = dBonusMonth;
|
|||
|
//oDR["NetBonus"]=oDRow[""];
|
|||
|
oDR["SLNo"] = count;
|
|||
|
dBonusRegData.Rows.Add(oDR);
|
|||
|
count++;
|
|||
|
}
|
|||
|
|
|||
|
form.ShowDlgForBonusRegister(_selectedParameter.ReportItem, dBonusRegData);
|
|||
|
|
|||
|
}
|
|||
|
public void ShowReportCarFuel()
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
DateTime salaryMonth = _selectedParameter.FromDate.Value;
|
|||
|
string sEmpID = _selectedParameter.ReportItem.INSQL;
|
|||
|
int count = 1;
|
|||
|
DataRow oDR = null;
|
|||
|
Bank oBank;
|
|||
|
|
|||
|
if (_selectedParameter.Banks.Count > 0)
|
|||
|
oBank = _selectedParameter.Banks[0];
|
|||
|
else throw new ServiceException("please select a bank");
|
|||
|
|
|||
|
DataSet oEmpBankAcc = EmployeeBankAccount.GetEmpCarFuelBankAdvice(GlobalFunctions.LastDateOfMonth(salaryMonth), sEmpID, oBank.ID.Integer);
|
|||
|
DataSet oEmpExpenseAmount = new DataSet();
|
|||
|
|
|||
|
PayrollDataSet.PayrollDataSet.BankAdviceDataTable bankAdvice = new Payroll.Report.PayrollDataSet.PayrollDataSet.BankAdviceDataTable();
|
|||
|
PayrollDataSet.PayrollDataSet.BankAdviceLetterDataTable bankAdviceLetter = new Payroll.Report.PayrollDataSet.PayrollDataSet.BankAdviceLetterDataTable();
|
|||
|
|
|||
|
double nTotal = 0.0;
|
|||
|
foreach (DataRow oDRow in oEmpBankAcc.Tables[0].Rows)
|
|||
|
{
|
|||
|
oDR = bankAdvice.NewRow();
|
|||
|
oDR["EmpNo"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["EmpName"] = oDRow["NAME"];
|
|||
|
oDR["AccountNo"] = oDRow["ACCOUNTNO"];
|
|||
|
oDR["Amount"] = oDRow["Amount"];
|
|||
|
oDR["SLNo"] = count;
|
|||
|
nTotal += Convert.ToDouble(oDR["Amount"]);
|
|||
|
bankAdvice.Rows.Add(oDR);
|
|||
|
|
|||
|
count++;
|
|||
|
}
|
|||
|
|
|||
|
string amountInWord = Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(nTotal);
|
|||
|
form.ShowDlgForOPIBankAdvice(_selectedParameter.ReportItem, bankAdvice, amountInWord);
|
|||
|
}
|
|||
|
|
|||
|
public void ShowReportHNMOPI()
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
DateTime salaryMonth = _selectedParameter.FromDate.Value;
|
|||
|
string sEmpID = _selectedParameter.ReportItem.INSQL;
|
|||
|
int count = 1;
|
|||
|
DataRow oDR = null;
|
|||
|
Bank oBank;
|
|||
|
//else throw new ServiceException("please select a division");
|
|||
|
|
|||
|
if (_selectedParameter.Banks.Count > 0)
|
|||
|
oBank = _selectedParameter.Banks[0];
|
|||
|
else throw new ServiceException("please select a bank");
|
|||
|
|
|||
|
DataSet oEmpBankAcc = EmployeeBankAccount.GetHNMOPIEmpBankAdvice(GlobalFunctions.LastDateOfMonth(salaryMonth), sEmpID);
|
|||
|
DataSet oEmpExpenseAmount = new DataSet();
|
|||
|
|
|||
|
PayrollDataSet.PayrollDataSet.BankAdviceHNMDataTable bankAdvice = new Payroll.Report.PayrollDataSet.PayrollDataSet.BankAdviceHNMDataTable();
|
|||
|
PayrollDataSet.PayrollDataSet.BankAdviceLetterDataTable bankAdviceLetter = new Payroll.Report.PayrollDataSet.PayrollDataSet.BankAdviceLetterDataTable();
|
|||
|
|
|||
|
double nTotal = 0.0;
|
|||
|
foreach (DataRow oDRow in oEmpBankAcc.Tables[0].Rows)
|
|||
|
{
|
|||
|
//DataRow[] oEmpExpAmount = oEmpExpenseAmount.Tables[0].Select("EmployeeNo='" + oDRow["EMPLOYEENO"].ToString() + "'");
|
|||
|
oDR = bankAdvice.NewRow();
|
|||
|
oDR["EmpNo"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["EmpName"] = oDRow["NAME"];
|
|||
|
oDR["AccountNo"] = oDRow["ACCOUNTNO"];
|
|||
|
oDR["Amount"] = Math.Round(Convert.ToDouble(oDRow["Amount"]));
|
|||
|
oDR["CostCenter"] = oDRow["CostCenter"];
|
|||
|
////}
|
|||
|
//oDR["Email"] = oDRow["EMAILADDRESS"];
|
|||
|
//oDR["SalaryMonth"] = salaryMonth;
|
|||
|
oDR["SLNo"] = count;
|
|||
|
bankAdvice.Rows.Add(oDR);
|
|||
|
//nTotal += Convert.ToDouble(oDR["Amount"]);
|
|||
|
count++;
|
|||
|
}
|
|||
|
|
|||
|
//string sRefNo = "Reference No." +
|
|||
|
// Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate.Year.ToString() + "/" +
|
|||
|
// Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate.ToString("MMM") + "/" +
|
|||
|
// oBank.Code + "/" + oDivision.Name;
|
|||
|
//string sDateTaka = Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate.ToString("MMMM, yyyy") +
|
|||
|
// " of total BDT " + Payroll.BO.GlobalFunctions.TakaFormat(nTotal) + " (" + Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(nTotal) + ")";
|
|||
|
////string sAccount = oBank.Code=="400"?"01-6174914-03":"171.120.119";
|
|||
|
|
|||
|
|
|||
|
//string sAccount = oBank.AccountNo;
|
|||
|
|
|||
|
//string sTaka = "BDT " + Payroll.BO.GlobalFunctions.TakaFormat(nTotal) + " (" + Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(nTotal) + ")";
|
|||
|
//bankAdviceLetter.Rows.Add(sRefNo, sDateTaka, sAccount, oDivision.Name, DateTime.Today.ToString("dd MMM yyyy"), oBank.Name, Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate.ToString("MMMM, yyyy"), sTaka);
|
|||
|
|
|||
|
//return bankAdvice;
|
|||
|
form.ShowDlgForHNMOPIBankAdvice(_selectedParameter.ReportItem, bankAdvice);
|
|||
|
}
|
|||
|
|
|||
|
public void OPIBankDisbursement()
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
DateTime salaryMonth = _selectedParameter.FromDate.Value;
|
|||
|
string sEmpID = _selectedParameter.ReportItem.INSQL;
|
|||
|
int count = 1;
|
|||
|
DataRow oDR = null;
|
|||
|
Bank oBank;
|
|||
|
//else throw new ServiceException("please select a division");
|
|||
|
|
|||
|
if (_selectedParameter.Banks.Count > 0)
|
|||
|
oBank = _selectedParameter.Banks[0];
|
|||
|
else throw new ServiceException("please select a bank");
|
|||
|
|
|||
|
DataSet oEmpBankAcc = EmployeeBankAccount.GetHNMOPIEmpBankAdvice(GlobalFunctions.LastDateOfMonth(salaryMonth), sEmpID);
|
|||
|
DataSet oEmpExpenseAmount = new DataSet();
|
|||
|
|
|||
|
PayrollDataSet.PayrollDataSet.BankAdviceHNMDataTable bankAdvice = new Payroll.Report.PayrollDataSet.PayrollDataSet.BankAdviceHNMDataTable();
|
|||
|
PayrollDataSet.PayrollDataSet.BankAdviceLetterDataTable bankAdviceLetter = new Payroll.Report.PayrollDataSet.PayrollDataSet.BankAdviceLetterDataTable();
|
|||
|
|
|||
|
double nTotal = 0.0;
|
|||
|
foreach (DataRow oDRow in oEmpBankAcc.Tables[0].Rows)
|
|||
|
{
|
|||
|
//DataRow[] oEmpExpAmount = oEmpExpenseAmount.Tables[0].Select("EmployeeNo='" + oDRow["EMPLOYEENO"].ToString() + "'");
|
|||
|
oDR = bankAdvice.NewRow();
|
|||
|
oDR["EmpNo"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["EmpName"] = oDRow["NAME"];
|
|||
|
oDR["AccountNo"] = oDRow["ACCOUNTNO"];
|
|||
|
oDR["Amount"] = Math.Round(Convert.ToDouble(oDRow["Amount"]));
|
|||
|
oDR["CostCenter"] = oDRow["CostCenter"];
|
|||
|
////}
|
|||
|
//oDR["Email"] = oDRow["EMAILADDRESS"];
|
|||
|
//oDR["SalaryMonth"] = salaryMonth;
|
|||
|
oDR["SLNo"] = count;
|
|||
|
bankAdvice.Rows.Add(oDR);
|
|||
|
//nTotal += Convert.ToDouble(oDR["Amount"]);
|
|||
|
count++;
|
|||
|
}
|
|||
|
|
|||
|
//string sRefNo = "Reference No." +
|
|||
|
// Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate.Year.ToString() + "/" +
|
|||
|
// Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate.ToString("MMM") + "/" +
|
|||
|
// oBank.Code + "/" + oDivision.Name;
|
|||
|
//string sDateTaka = Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate.ToString("MMMM, yyyy") +
|
|||
|
// " of total BDT " + Payroll.BO.GlobalFunctions.TakaFormat(nTotal) + " (" + Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(nTotal) + ")";
|
|||
|
////string sAccount = oBank.Code=="400"?"01-6174914-03":"171.120.119";
|
|||
|
|
|||
|
|
|||
|
//string sAccount = oBank.AccountNo;
|
|||
|
|
|||
|
//string sTaka = "BDT " + Payroll.BO.GlobalFunctions.TakaFormat(nTotal) + " (" + Ease.CoreV35.Utility.Global.NumericFunctions.TakaWords(nTotal) + ")";
|
|||
|
//bankAdviceLetter.Rows.Add(sRefNo, sDateTaka, sAccount, oDivision.Name, DateTime.Today.ToString("dd MMM yyyy"), oBank.Name, Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate.ToString("MMMM, yyyy"), sTaka);
|
|||
|
|
|||
|
//return bankAdvice;
|
|||
|
form.OPIBankDisbursement(_selectedParameter.ReportItem, bankAdvice);
|
|||
|
}
|
|||
|
|
|||
|
internal List<string> ShowBankAdvice(DateTime salaryMonth, Bank obank)
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
|
|||
|
List<string> col = new List<string>();
|
|||
|
int count = 1;
|
|||
|
string sRefNo = string.Empty;
|
|||
|
string sSub = string.Empty;
|
|||
|
DataRow oDR = null;
|
|||
|
try
|
|||
|
{
|
|||
|
// start
|
|||
|
string processDate = string.Empty;
|
|||
|
DateTime pDate = DateTime.MinValue;
|
|||
|
ObjectsTemplate<SalaryProcess> sProcesses = new ObjectsTemplate<SalaryProcess>();
|
|||
|
sProcesses = SalaryProcess.Get(GlobalFunctions.LastDateOfMonth(salaryMonth));
|
|||
|
SalaryProcess sProcess = new SalaryProcess();
|
|||
|
foreach (SalaryProcess sp in sProcesses)
|
|||
|
{
|
|||
|
pDate = sp.ProcessDate;
|
|||
|
break;
|
|||
|
}
|
|||
|
processDate = pDate.ToString("MMM-dd-yyyy");
|
|||
|
|
|||
|
//end
|
|||
|
|
|||
|
DataSet oEmpBankAcc = EmployeeBankAccount.GetEmpBankAdvice(GlobalFunctions.LastDateOfMonth(salaryMonth), obank.ID.Integer);
|
|||
|
|
|||
|
PayrollDataSet.dsCompany.BankAdviceDataTable bankAdvice = new Payroll.Report.PayrollDataSet.dsCompany.BankAdviceDataTable();
|
|||
|
PayrollDataSet.dsCompany.BankAdviceLetterDataTable bankAdviceLetter = new Payroll.Report.PayrollDataSet.dsCompany.BankAdviceLetterDataTable();
|
|||
|
PayrollDataSet.dsCompany.BankAdviceParametersDataTable bankAdviceParameter = new Payroll.Report.PayrollDataSet.dsCompany.BankAdviceParametersDataTable();
|
|||
|
|
|||
|
double nTotal = 0.0;
|
|||
|
foreach (DataRow oDRow in oEmpBankAcc.Tables[0].Rows)
|
|||
|
{
|
|||
|
oDR = bankAdvice.NewRow();
|
|||
|
oDR["EmpNo"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["EmpName"] = oDRow["NAME"];
|
|||
|
oDR["AccountNo"] = oDRow["ACCOUNTNO"];
|
|||
|
oDR["Amount"] = GlobalFunctions.Round(Convert.ToDouble(oDRow["CHANGEDAMOUNT"].ToString()));
|
|||
|
oDR["SalaryMonth"] = salaryMonth;
|
|||
|
oDR["Maintenance"] = "A";
|
|||
|
oDR["Currency"] = "BDT";
|
|||
|
oDR["Method"] = "T";
|
|||
|
oDR["ProcessDate"] = processDate;
|
|||
|
oDR["Cheque"] = "";
|
|||
|
oDR["DeNomination"] = "";
|
|||
|
oDR["Bank"] = obank.Name;
|
|||
|
oDR["Branch"] = oDRow["Branch"].ToString();
|
|||
|
oDR["Remarks"] = "Salary-" + salaryMonth.ToString("MMM yy");
|
|||
|
oDR["SenderAccNo"] = obank.Accountingformat;
|
|||
|
oDR["BankRouting"] = oDRow["Code"].ToString();
|
|||
|
oDR["AccType"] = "Savings Account";
|
|||
|
oDR["SLNo"] = count;
|
|||
|
bankAdvice.Rows.Add(oDR);
|
|||
|
nTotal += Convert.ToDouble(oDR["Amount"]);
|
|||
|
count++;
|
|||
|
}
|
|||
|
sSub = "Subject: Transfer of Salary for the month of ";
|
|||
|
if (obank.ID.Integer == 2)
|
|||
|
{
|
|||
|
sRefNo = "Our Ref : " + obank.Name + " / DIS - P- ";
|
|||
|
}
|
|||
|
else if (obank.ID.Integer == 3)
|
|||
|
{
|
|||
|
sRefNo = "Our Ref : " + obank.Name + " / DIS - P-";
|
|||
|
}
|
|||
|
else if (obank.ID.Integer == 4)
|
|||
|
{
|
|||
|
sRefNo = "Our Ref : " + obank.Name + " / DIS -P-";
|
|||
|
}
|
|||
|
else if (obank.ID.Integer == 5)
|
|||
|
{
|
|||
|
sRefNo = "Our Ref : " + obank.Name + " / DIS - P-";
|
|||
|
}
|
|||
|
else if (obank.ID.Integer == 1)
|
|||
|
{
|
|||
|
sRefNo = "Ref.: HSBC / DIS -P- ";// +" (001-004175-011" + obank.Accountingformat + ")";
|
|||
|
|
|||
|
oDR = bankAdviceParameter.NewRow();
|
|||
|
|
|||
|
oDR["OrderingCustomer"] = "Eskayef Bangladesh Limited";
|
|||
|
oDR["DAccountID"] = "";
|
|||
|
oDR["DAccountNo"] = obank.Accountingformat;
|
|||
|
oDR["Date"] = "";// salaryMonth.ToString("m/dd/yyyy");
|
|||
|
oDR["MapTable"] = "";
|
|||
|
oDR["Field"] = "";
|
|||
|
oDR["PaymentReference"] = "";
|
|||
|
oDR["TransactionAmount"] = GlobalFunctions.Round(nTotal);
|
|||
|
oDR["PayeesAccNo"] = "";
|
|||
|
oDR["AccName"] = obank.Name;
|
|||
|
oDR["PayRef1"] = count.ToString();
|
|||
|
oDR["PayRef2"] = "";
|
|||
|
oDR["PayRef3"] = "";
|
|||
|
oDR["PayRef4"] = "";
|
|||
|
|
|||
|
bankAdviceParameter.Rows.Add(oDR);
|
|||
|
sSub = "Subject : Disbursement of Employees Salary for the month of ";
|
|||
|
}
|
|||
|
|
|||
|
string sAmount = NumWordsWrapper(Payroll.BO.GlobalFunctions.Round(nTotal));
|
|||
|
string sDateTaka = "BDT. " + sAmount;
|
|||
|
string sAccount = obank.Accountingformat;
|
|||
|
double dAmount = Payroll.BO.GlobalFunctions.Round(nTotal);
|
|||
|
string sTaka = "BDT " + dAmount.ToString("###,##") + "/-(BDT. " + sAmount + ")";
|
|||
|
|
|||
|
if (oEmpBankAcc.Tables[0].Rows.Count > 0)
|
|||
|
{
|
|||
|
bankAdviceLetter.Rows.Add(sRefNo, sDateTaka, sAccount, oEmpBankAcc.Tables[0].Rows[0]["Branch"].ToString(), DateTime.Today.ToString("dd MMM yyyy"), obank.Name, salaryMonth.ToString("MMMM, yyyy"), sTaka);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
bankAdviceLetter.Rows.Add(sRefNo, sDateTaka, sAccount, "", DateTime.Today.ToString("dd MMM yyyy"), obank.Name, salaryMonth.ToString("MMMM, yyyy"), sTaka);
|
|||
|
}
|
|||
|
//if (obank.ID.Integer != 6 && obank.ID.Integer != 7)
|
|||
|
//{
|
|||
|
form.ShowDlgForBankAdvice(salaryMonth, bankAdvice, bankAdviceLetter, bankAdviceParameter, obank, sSub, sAmount);
|
|||
|
//}
|
|||
|
//else
|
|||
|
//{
|
|||
|
|
|||
|
//}
|
|||
|
if (obank.ID.Integer == 1)
|
|||
|
{
|
|||
|
col.Add(dAmount.ToString());
|
|||
|
col.Add(sAmount);
|
|||
|
col.Add(salaryMonth.ToString("MMMM, yyyy"));
|
|||
|
}
|
|||
|
if (obank.ID.Integer == 2)
|
|||
|
{
|
|||
|
col.Add(dAmount.ToString());
|
|||
|
col.Add(sAmount);
|
|||
|
col.Add(salaryMonth.ToString("MMMM, yyyy"));
|
|||
|
}
|
|||
|
|
|||
|
return col;
|
|||
|
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw new ServiceException(ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal void ShowOPIBankAdvice(DateTime salaryMonth, Bank obank)
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
|
|||
|
int count = 1;
|
|||
|
string sRefNo = string.Empty;
|
|||
|
string sSub = string.Empty;
|
|||
|
DataRow oDR = null;
|
|||
|
try
|
|||
|
{
|
|||
|
DataSet oEmpBankAcc = EmployeeBankAccount.GetEmpOPIBankAdvice(GlobalFunctions.LastDateOfMonth(salaryMonth), obank.ID.Integer);
|
|||
|
|
|||
|
PayrollDataSet.dsCompany.BankAdviceDataTable bankAdvice = new Payroll.Report.PayrollDataSet.dsCompany.BankAdviceDataTable();
|
|||
|
PayrollDataSet.dsCompany.BankAdviceLetterDataTable bankAdviceLetter = new Payroll.Report.PayrollDataSet.dsCompany.BankAdviceLetterDataTable();
|
|||
|
PayrollDataSet.dsCompany.BankAdviceParametersDataTable bankAdviceParameter = new Payroll.Report.PayrollDataSet.dsCompany.BankAdviceParametersDataTable();
|
|||
|
|
|||
|
double nTotal = 0.0;
|
|||
|
foreach (DataRow oDRow in oEmpBankAcc.Tables[0].Rows)
|
|||
|
{
|
|||
|
oDR = bankAdvice.NewRow();
|
|||
|
oDR["EmpNo"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["EmpName"] = oDRow["NAME"];
|
|||
|
oDR["AccountNo"] = oDRow["ACCOUNTNO"];
|
|||
|
oDR["Amount"] = GlobalFunctions.Round(Convert.ToDouble(oDRow["CHANGEDAMOUNT"].ToString()));
|
|||
|
oDR["SalaryMonth"] = salaryMonth;
|
|||
|
oDR["Maintenance"] = "A";
|
|||
|
oDR["Currency"] = "BDT";
|
|||
|
oDR["Method"] = "T";
|
|||
|
oDR["Cheque"] = "";
|
|||
|
oDR["DeNomination"] = "";
|
|||
|
oDR["Bank"] = obank.Name;
|
|||
|
oDR["Branch"] = oDRow["Branch"].ToString();
|
|||
|
// For HSBC & DBBL
|
|||
|
if (obank.ID.Integer == 1 || obank.ID.Integer == 2)
|
|||
|
{
|
|||
|
oDR["Remarks"] = "Expenses-" + salaryMonth.ToString("MMM yy");
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
oDR["Remarks"] = "Salary-" + salaryMonth.ToString("MMM yy");
|
|||
|
}
|
|||
|
oDR["SenderAccNo"] = obank.Accountingformat;
|
|||
|
oDR["BankRouting"] = oDRow["Code"].ToString();
|
|||
|
oDR["AccType"] = "Savings Account";
|
|||
|
oDR["SLNo"] = count;
|
|||
|
bankAdvice.Rows.Add(oDR);
|
|||
|
nTotal += Convert.ToDouble(oDR["Amount"]);
|
|||
|
count++;
|
|||
|
}
|
|||
|
sSub = "Subject: Transfer of OPI for the month of ";
|
|||
|
if (obank.ID.Integer == 2)
|
|||
|
{
|
|||
|
sRefNo = "Our Ref : " + obank.Name + " / DIS - P-"; //69/" + salaryMonth.ToString("yy");
|
|||
|
}
|
|||
|
else if (obank.ID.Integer == 3)
|
|||
|
{
|
|||
|
sRefNo = "Our Ref : " + obank.Name + " / DIS - P-";
|
|||
|
}
|
|||
|
else if (obank.ID.Integer == 4)
|
|||
|
{
|
|||
|
sRefNo = "Our Ref : " + obank.Name + " / DIS -P-";
|
|||
|
}
|
|||
|
else if (obank.ID.Integer == 5)
|
|||
|
{
|
|||
|
sRefNo = "Our Ref : " + obank.Name + " / DIS - P-";
|
|||
|
}
|
|||
|
else if (obank.ID.Integer == 1)
|
|||
|
{
|
|||
|
sRefNo = "Ref.: HSBC / DIS -P-";//50/" + salaryMonth.ToString("yyyy") + " (Current Account # " + obank.Accountingformat + ")";
|
|||
|
|
|||
|
oDR = bankAdviceParameter.NewRow();
|
|||
|
|
|||
|
oDR["OrderingCustomer"] = "Eskayef Bangladesh Limited";
|
|||
|
oDR["DAccountID"] = "";
|
|||
|
oDR["DAccountNo"] = obank.Accountingformat;
|
|||
|
oDR["Date"] = ""; salaryMonth.ToString("m/dd/yyyy");
|
|||
|
oDR["MapTable"] = "";
|
|||
|
oDR["Field"] = "";
|
|||
|
oDR["PaymentReference"] = "";
|
|||
|
oDR["TransactionAmount"] = GlobalFunctions.Round(nTotal);
|
|||
|
oDR["PayeesAccNo"] = "";
|
|||
|
oDR["AccName"] = obank.Name;
|
|||
|
oDR["PayRef1"] = count.ToString();
|
|||
|
oDR["PayRef2"] = "";
|
|||
|
oDR["PayRef3"] = "";
|
|||
|
oDR["PayRef4"] = "";
|
|||
|
|
|||
|
bankAdviceParameter.Rows.Add(oDR);
|
|||
|
sSub = "Subject : Disbursement of Employees OPI for the month of ";
|
|||
|
}
|
|||
|
|
|||
|
string sAmount = NumWordsWrapper(Payroll.BO.GlobalFunctions.Round(nTotal));
|
|||
|
string sDateTaka = "BDT. " + sAmount;
|
|||
|
string sAccount = obank.Accountingformat;
|
|||
|
double dAmount = Payroll.BO.GlobalFunctions.Round(nTotal);
|
|||
|
string sTaka = "BDT " + dAmount.ToString("###,##") + "/-(BDT. " + sAmount + ")";
|
|||
|
|
|||
|
if (oEmpBankAcc.Tables[0].Rows.Count > 0)
|
|||
|
{
|
|||
|
bankAdviceLetter.Rows.Add(sRefNo, sDateTaka, sAccount, oEmpBankAcc.Tables[0].Rows[0]["Branch"].ToString(), DateTime.Today.ToString("dd MMM yyyy"), obank.Name, Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate.ToString("MMMM, yyyy"), sTaka);
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
bankAdviceLetter.Rows.Add(sRefNo, sDateTaka, sAccount, "", DateTime.Today.ToString("dd MMM yyyy"), obank.Name, Payroll.BO.SystemInformation.CurrentSysInfo.NextPayProcessDate.ToString("MMMM, yyyy"), sTaka);
|
|||
|
}
|
|||
|
//if (obank.ID.Integer != 6 && obank.ID.Integer != 7)
|
|||
|
//{
|
|||
|
form.ShowDlgForBankAdvice(salaryMonth, bankAdvice, bankAdviceLetter, bankAdviceParameter, obank, sSub, sAmount);
|
|||
|
//}
|
|||
|
//else
|
|||
|
//{
|
|||
|
|
|||
|
//}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw new ServiceException(ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public static String NumWordsWrapper(double value)
|
|||
|
{
|
|||
|
string words = "";
|
|||
|
double intPart;
|
|||
|
double decPart = 0;
|
|||
|
if (value == 0)
|
|||
|
return "zero";
|
|||
|
|
|||
|
try
|
|||
|
{
|
|||
|
string[] splitter = value.ToString().Split('.');
|
|||
|
intPart = double.Parse(splitter[0]);
|
|||
|
if (splitter.Length > 1)
|
|||
|
{
|
|||
|
decPart = double.Parse(splitter[1]);
|
|||
|
}
|
|||
|
}
|
|||
|
catch
|
|||
|
{
|
|||
|
intPart = value;
|
|||
|
}
|
|||
|
|
|||
|
words = NumWords(Convert.ToInt32(intPart));
|
|||
|
|
|||
|
if (decPart > 0)
|
|||
|
{
|
|||
|
if (words != "")
|
|||
|
words += " and ";
|
|||
|
int counter = decPart.ToString().Length;
|
|||
|
switch (counter)
|
|||
|
{
|
|||
|
case 1: words += NumWords(Convert.ToInt32(decPart)) + ""; break;// tenths
|
|||
|
case 2: words += NumWords(Convert.ToInt32(decPart)) + ""; break;// hundredths
|
|||
|
case 3: words += NumWords(Convert.ToInt32(decPart)) + ""; break;// thousandths
|
|||
|
case 4: words += NumWords(Convert.ToInt32(decPart)) + ""; break;// ten-thousandths
|
|||
|
case 5: words += NumWords(Convert.ToInt32(decPart)) + ""; break;// hundred-thousandths
|
|||
|
case 6: words += NumWords(Convert.ToInt32(decPart)) + ""; break;// millionths
|
|||
|
case 7: words += NumWords(Convert.ToInt32(decPart)) + ""; break;// ten-millionths
|
|||
|
}
|
|||
|
}
|
|||
|
return words + " Only";
|
|||
|
}
|
|||
|
|
|||
|
private static string NumWords(int Num)
|
|||
|
{
|
|||
|
#region Old Code
|
|||
|
//string[] numbersArr = new string[] { "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen" };
|
|||
|
//string[] tensArr = new string[] { "twenty", "thirty", "fourty", "fifty", "sixty", "seventy", "eighty", "ninty" };
|
|||
|
//string[] suffixesArr = new string[] { "thousand", "million", "billion", "trillion", "quadrillion", "quintillion", "sextillion", "septillion", "octillion", "nonillion", "decillion", "undecillion", "duodecillion", "tredecillion", "Quattuordecillion", "Quindecillion", "Sexdecillion", "Septdecillion", "Octodecillion", "Novemdecillion", "Vigintillion" };
|
|||
|
//string words = "";
|
|||
|
|
|||
|
//bool tens = false;
|
|||
|
|
|||
|
//if (n < 0)
|
|||
|
//{
|
|||
|
// words += "negative ";
|
|||
|
// n *= -1;
|
|||
|
//}
|
|||
|
|
|||
|
//int power = (suffixesArr.Length + 1) * 3;
|
|||
|
|
|||
|
//while (power > 3)
|
|||
|
//{
|
|||
|
// double pow = Math.Pow(10, power);
|
|||
|
// if (n > pow)
|
|||
|
// {
|
|||
|
// if (n % Math.Pow(10, power) > 0)
|
|||
|
// {
|
|||
|
// words += NumWords(Math.Floor(n / pow)) + " " + suffixesArr[(power / 3) - 1] + " and ";
|
|||
|
// }
|
|||
|
// else if (n % pow > 0)
|
|||
|
// {
|
|||
|
// words += NumWords(Math.Floor(n / pow)) + " " + suffixesArr[(power / 3) - 1];
|
|||
|
// }
|
|||
|
// n %= pow;
|
|||
|
// }
|
|||
|
// power -= 3;
|
|||
|
//}
|
|||
|
//if (n >= 1000)
|
|||
|
//{
|
|||
|
// if (n % 1000 > 0) words += NumWords(Math.Floor(n / 1000)) + " thousand and ";
|
|||
|
// else words += NumWords(Math.Floor(n / 1000)) + " thousand";
|
|||
|
// n %= 1000;
|
|||
|
//}
|
|||
|
//if (0 <= n && n <= 999)
|
|||
|
//{
|
|||
|
// if ((int)n / 100 > 0)
|
|||
|
// {
|
|||
|
// words += NumWords(Math.Floor(n / 100)) + " hundred";
|
|||
|
// n %= 100;
|
|||
|
// }
|
|||
|
// if ((int)n / 10 > 1)
|
|||
|
// {
|
|||
|
// if (words != "")
|
|||
|
// words += " ";
|
|||
|
// words += tensArr[(int)n / 10 - 2];
|
|||
|
// tens = true;
|
|||
|
// n %= 10;
|
|||
|
// }
|
|||
|
|
|||
|
// if (n < 20)
|
|||
|
// {
|
|||
|
// if (words != "" && tens == false)
|
|||
|
// words += " ";
|
|||
|
// words += (tens ? "-" + numbersArr[(int)n - 1] : numbersArr[(int)n - 1]);
|
|||
|
// n -= Math.Floor(n);
|
|||
|
// }
|
|||
|
//}
|
|||
|
|
|||
|
//return words;
|
|||
|
#endregion
|
|||
|
string[] Below20 = { "", "One ", "Two ", "Three ", "Four ",
|
|||
|
"Five ", "Six " , "Seven ", "Eight ",
|
|||
|
"Nine ", "Ten ", "Eleven ",
|
|||
|
"Twelve " , "Thirteen ", "Fourteen ","Fifteen ",
|
|||
|
"Sixteen " , "Seventeen ","Eighteen " , "Nineteen "
|
|||
|
};
|
|||
|
|
|||
|
string[] Below100 = { "", "", "Twenty ", "Thirty ",
|
|||
|
"Forty ", "Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety "
|
|||
|
};
|
|||
|
string InWords = "";
|
|||
|
if (Num >= 1 && Num < 20)
|
|||
|
InWords += Below20[Num];
|
|||
|
if (Num >= 20 && Num <= 99)
|
|||
|
InWords += Below100[Num / 10] + Below20[Num % 10];
|
|||
|
if (Num >= 100 && Num <= 999)
|
|||
|
InWords += NumWords(Num / 100) + " Hundred " + NumWords(Num % 100);
|
|||
|
if (Num >= 1000 && Num <= 99999)
|
|||
|
InWords += NumWords(Num / 1000) + " Thousand " + NumWords(Num % 1000);
|
|||
|
if (Num >= 100000 && Num <= 9999999)
|
|||
|
InWords += NumWords(Num / 100000) + " Lac " + NumWords(Num % 100000);
|
|||
|
if (Num >= 10000000)
|
|||
|
InWords += NumWords(Num / 10000000) + " Crore " + NumWords(Num % 10000000);
|
|||
|
|
|||
|
return InWords;
|
|||
|
}
|
|||
|
|
|||
|
public void ShowBankDisbursmentReport()
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
DateTime salaryMonth = _selectedParameter.FromDate.Value;
|
|||
|
string sEmpID = _selectedParameter.ReportItem.INSQL;
|
|||
|
int count = 1;
|
|||
|
DataRow oDR = null;
|
|||
|
Bank oBank;
|
|||
|
|
|||
|
if (_selectedParameter.Banks.Count > 0)
|
|||
|
oBank = _selectedParameter.Banks[0];
|
|||
|
else throw new ServiceException("please select a bank");
|
|||
|
|
|||
|
DataSet oEmpBankAcc = EmployeeBankAccount.GetEmpBankAdvice(GlobalFunctions.LastDateOfMonth(salaryMonth), sEmpID);
|
|||
|
|
|||
|
PayrollDataSet.dsCompany.BankAdviceDataTable bankAdvice = new Payroll.Report.PayrollDataSet.dsCompany.BankAdviceDataTable();
|
|||
|
|
|||
|
double nTotal = 0.0;
|
|||
|
foreach (DataRow oDRow in oEmpBankAcc.Tables[0].Rows)
|
|||
|
{
|
|||
|
oDR = bankAdvice.NewRow();
|
|||
|
oDR["EmpNo"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["EmpName"] = oDRow["NAME"];
|
|||
|
oDR["AccountNo"] = oDRow["ACCOUNTNO"];
|
|||
|
oDR["Amount"] = Math.Round(Convert.ToDouble(oDRow["CHANGEDAMOUNT"]));
|
|||
|
oDR["Email"] = oDRow["EMAILADDRESS"];
|
|||
|
oDR["SalaryMonth"] = salaryMonth;
|
|||
|
oDR["SLNo"] = count;
|
|||
|
oDR["CostCenter"] = oDRow["CostCenter"].ToString();
|
|||
|
bankAdvice.Rows.Add(oDR);
|
|||
|
nTotal += Convert.ToDouble(oDR["Amount"]);
|
|||
|
count++;
|
|||
|
}
|
|||
|
|
|||
|
form.ShowDlgForBankDisbursment(_selectedParameter.ReportItem, bankAdvice);
|
|||
|
}
|
|||
|
|
|||
|
public void ShowEuroBankAdviceReport()
|
|||
|
{
|
|||
|
fReportViewer form = new fReportViewer();
|
|||
|
DateTime salaryMonth = _selectedParameter.FromDate.Value;
|
|||
|
string sEmpID = _selectedParameter.ReportItem.INSQL;
|
|||
|
int count = 1;
|
|||
|
DataRow oDR = null;
|
|||
|
Bank oBank;
|
|||
|
|
|||
|
if (_selectedParameter.Banks.Count > 0)
|
|||
|
oBank = _selectedParameter.Banks[0];
|
|||
|
else throw new ServiceException("please select a bank");
|
|||
|
|
|||
|
DataSet oEmpBankAcc = EmployeeBankAccount.GetEmpEuroBankAdvice(GlobalFunctions.LastDateOfMonth(salaryMonth), sEmpID);
|
|||
|
|
|||
|
PayrollDataSet.dsCompany.BankAdviceDataTable bankAdvice = new Payroll.Report.PayrollDataSet.dsCompany.BankAdviceDataTable();
|
|||
|
|
|||
|
double nTotal = 0.0;
|
|||
|
foreach (DataRow oDRow in oEmpBankAcc.Tables[0].Rows)
|
|||
|
{
|
|||
|
oDR = bankAdvice.NewRow();
|
|||
|
oDR["EmpNo"] = oDRow["EMPLOYEENO"];
|
|||
|
oDR["EmpName"] = oDRow["NAME"];
|
|||
|
oDR["AccountNo"] = oDRow["EUROACCOUNTNO"];
|
|||
|
oDR["Amount"] = oDRow["Amount"];// Math.Round(Convert.ToDouble(oDRow["CHANGEDAMOUNT"]));
|
|||
|
//oDR["Email"] = oDRow["EMAILADDRESS"];
|
|||
|
//oDR["SalaryMonth"] = salaryMonth;
|
|||
|
oDR["SLNo"] = count;
|
|||
|
//oDR["CostCenter"] = oDRow["CostCenter"].ToString();
|
|||
|
bankAdvice.Rows.Add(oDR);
|
|||
|
//nTotal += Convert.ToDouble(oDR["Amount"]);
|
|||
|
count++;
|
|||
|
}
|
|||
|
|
|||
|
form.ShowDlgForEuroBankAdvice(_selectedParameter.ReportItem, bankAdvice);
|
|||
|
}
|
|||
|
|
|||
|
internal void PrepareBankPaymentSummaryReport(DateTime dateTime)
|
|||
|
{
|
|||
|
fReportViewer oviewer = new fReportViewer();
|
|||
|
|
|||
|
DataSet dsBankPaymentSummary = new DataSet();
|
|||
|
DataRow oRow = null;
|
|||
|
|
|||
|
try
|
|||
|
{
|
|||
|
dsBankPaymentSummary = MiscellaneousDataset.GetBankPaymentSummaryData(dateTime);
|
|||
|
PayrollDataSet.dsCompany.BankPaymentSummaryDataTable dtBankPaymentSummary = new Payroll.Report.PayrollDataSet.dsCompany.BankPaymentSummaryDataTable();
|
|||
|
PayrollDataSet.dsCompany.BankPaymentSummaryDataTable dtBankPaymentSummary1 = new Payroll.Report.PayrollDataSet.dsCompany.BankPaymentSummaryDataTable();
|
|||
|
|
|||
|
if (dsBankPaymentSummary != null)
|
|||
|
{
|
|||
|
if (dsBankPaymentSummary.Tables[0].Rows.Count > 0)
|
|||
|
{
|
|||
|
string sbankName = "";
|
|||
|
string sPrvBankName = "";
|
|||
|
|
|||
|
foreach (DataRow orr in dsBankPaymentSummary.Tables[0].Rows)
|
|||
|
{
|
|||
|
sbankName = orr["Bank"].ToString();
|
|||
|
if (sbankName != sPrvBankName)
|
|||
|
{
|
|||
|
if (orr["Bank"].ToString() == "HSBC")
|
|||
|
{
|
|||
|
oRow = dtBankPaymentSummary.NewRow();
|
|||
|
oRow["Bank2"] = orr["Bank"].ToString();
|
|||
|
oRow["Bank1"] = "A) ";
|
|||
|
oRow["Serial"] = 1;
|
|||
|
oRow["Description"] = "Salary, Allowances & OPI";
|
|||
|
dtBankPaymentSummary.Rows.Add(oRow);
|
|||
|
sPrvBankName = sbankName;
|
|||
|
}
|
|||
|
else if (orr["Bank"].ToString() == "SCB")
|
|||
|
{
|
|||
|
oRow = dtBankPaymentSummary.NewRow();
|
|||
|
oRow["Bank2"] = orr["Bank"].ToString();
|
|||
|
oRow["Bank1"] = "B) ";
|
|||
|
oRow["Serial"] = 2;
|
|||
|
oRow["Description"] = "Salary, Allowances & OPI";
|
|||
|
dtBankPaymentSummary.Rows.Add(oRow);
|
|||
|
sPrvBankName = sbankName;
|
|||
|
}
|
|||
|
else if (orr["Bank"].ToString() == "EBL")
|
|||
|
{
|
|||
|
oRow = dtBankPaymentSummary.NewRow();
|
|||
|
oRow["Bank2"] = orr["Bank"].ToString();
|
|||
|
oRow["Bank1"] = "C) ";
|
|||
|
oRow["Serial"] = 6;
|
|||
|
oRow["Description"] = "Salary, Allowances & OPI";
|
|||
|
dtBankPaymentSummary.Rows.Add(oRow);
|
|||
|
sPrvBankName = sbankName;
|
|||
|
}
|
|||
|
else if (orr["Bank"].ToString() == "CBCL")
|
|||
|
{
|
|||
|
oRow = dtBankPaymentSummary.NewRow();
|
|||
|
oRow["Bank2"] = orr["Bank"].ToString();
|
|||
|
oRow["Bank1"] = "D) ";
|
|||
|
oRow["Serial"] = 7;
|
|||
|
oRow["Description"] = "Salary, Allowances & OPI";
|
|||
|
dtBankPaymentSummary.Rows.Add(oRow);
|
|||
|
sPrvBankName = sbankName;
|
|||
|
}
|
|||
|
else if (orr["Bank"].ToString() == "DBBL")
|
|||
|
{
|
|||
|
oRow = dtBankPaymentSummary.NewRow();
|
|||
|
oRow["Bank2"] = orr["Bank"].ToString();
|
|||
|
oRow["Bank1"] = "E) ";
|
|||
|
oRow["Serial"] = 8;
|
|||
|
oRow["Description"] = "Salary, Allowances & OPI";
|
|||
|
dtBankPaymentSummary.Rows.Add(oRow);
|
|||
|
sPrvBankName = sbankName;
|
|||
|
}
|
|||
|
}
|
|||
|
if (sPrvBankName == sbankName)
|
|||
|
{
|
|||
|
oRow["HSBC00"] = Convert.ToDouble(orr["Unit-00"].ToString());
|
|||
|
|
|||
|
oRow["HSBC01"] = Convert.ToDouble(orr["Unit-01"].ToString()); ;
|
|||
|
|
|||
|
oRow["HSBC03"] = Convert.ToDouble(orr["Unit-03"].ToString());
|
|||
|
|
|||
|
oRow["HSBS04"] = Convert.ToDouble(orr["Unit-04"].ToString());
|
|||
|
|
|||
|
oRow["HSBC05"] = Convert.ToDouble(orr["Unit-05"].ToString());
|
|||
|
|
|||
|
oRow["HSBC06"] = Convert.ToDouble(orr["Unit-06"].ToString());
|
|||
|
|
|||
|
oRow["HSBC08"] = Convert.ToDouble(orr["Unit-08"].ToString());
|
|||
|
|
|||
|
oRow["HSBC09"] = Convert.ToDouble(orr["Unit-09"].ToString());
|
|||
|
|
|||
|
oRow["HSBC10"] = Convert.ToDouble(orr["Unit-10"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU0"] = Convert.ToDouble(orr["U-00"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU1"] = Convert.ToDouble(orr["U-01"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU3"] = Convert.ToDouble(orr["U-03"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU5"] = Convert.ToDouble(orr["U-05"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU8"] = Convert.ToDouble(orr["U-08"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU9"] = Convert.ToDouble(orr["U-09"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU10"] = Convert.ToDouble(orr["U-10"].ToString());
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
if (dsBankPaymentSummary.Tables[1].Rows.Count > 0)
|
|||
|
{
|
|||
|
foreach (DataRow orr in dsBankPaymentSummary.Tables[1].Rows)
|
|||
|
{
|
|||
|
oRow = dtBankPaymentSummary.NewRow();
|
|||
|
|
|||
|
oRow["Bank2"] = "SCB";
|
|||
|
oRow["Bank1"] = "B) ";
|
|||
|
oRow["Description"] = orr["Description"].ToString();
|
|||
|
if (oRow["Description"].ToString() == "Advance Income Tax")
|
|||
|
{
|
|||
|
oRow["Serial"] = 3;
|
|||
|
}
|
|||
|
else if (oRow["Description"].ToString() == "Employees Provident Fund")
|
|||
|
{
|
|||
|
oRow["Serial"] = 4;
|
|||
|
}
|
|||
|
else if (oRow["Description"].ToString() == "Article Loan")
|
|||
|
{
|
|||
|
oRow["Serial"] = 5;
|
|||
|
}
|
|||
|
|
|||
|
oRow["HSBC00"] = Convert.ToDouble(orr["Unit-00"].ToString());
|
|||
|
|
|||
|
oRow["HSBC01"] = Convert.ToDouble(orr["Unit-01"].ToString());
|
|||
|
|
|||
|
oRow["HSBC03"] = Convert.ToDouble(orr["Unit-03"].ToString());
|
|||
|
|
|||
|
oRow["HSBS04"] = Convert.ToDouble(orr["Unit-04"].ToString());
|
|||
|
|
|||
|
oRow["HSBC05"] = Convert.ToDouble(orr["Unit-05"].ToString());
|
|||
|
|
|||
|
oRow["HSBC06"] = Convert.ToDouble(orr["Unit-06"].ToString());
|
|||
|
|
|||
|
oRow["HSBC08"] = Convert.ToDouble(orr["Unit-08"].ToString());
|
|||
|
|
|||
|
oRow["HSBC09"] = Convert.ToDouble(orr["Unit-09"].ToString());
|
|||
|
|
|||
|
oRow["HSBC10"] = Convert.ToDouble(orr["Unit-10"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU0"] = Convert.ToDouble(orr["U-00"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU1"] = Convert.ToDouble(orr["U-01"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU3"] = Convert.ToDouble(orr["U-03"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU5"] = Convert.ToDouble(orr["U-05"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU8"] = Convert.ToDouble(orr["U-08"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU9"] = Convert.ToDouble(orr["U-09"].ToString());
|
|||
|
|
|||
|
oRow["HSBCU10"] = Convert.ToDouble(orr["U-10"].ToString());
|
|||
|
|
|||
|
dtBankPaymentSummary.Rows.Add(oRow);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
var sortedTempData = from DataRow dr in dtBankPaymentSummary.Rows orderby dr["Serial"] select dr;
|
|||
|
|
|||
|
foreach (DataRow dr in sortedTempData)
|
|||
|
{
|
|||
|
dtBankPaymentSummary1.ImportRow(dr);
|
|||
|
}
|
|||
|
|
|||
|
if (dtBankPaymentSummary1.Rows.Count > 0)
|
|||
|
{
|
|||
|
oviewer.ShowBankPaymentSummaryReport(dtBankPaymentSummary1, dateTime);
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
throw new ServiceException("No Data Found!!!");
|
|||
|
}
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw new ServiceException(ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
internal void PrepareCashPaymentSummaryReport(DateTime dateTime)
|
|||
|
{
|
|||
|
fReportViewer oviewer = new fReportViewer();
|
|||
|
|
|||
|
DataSet dsCashPaymentSummary = new DataSet();
|
|||
|
DataRow oRow = null;
|
|||
|
|
|||
|
try
|
|||
|
{
|
|||
|
dsCashPaymentSummary = MiscellaneousDataset.GetCashPaymentSummaryData(dateTime);
|
|||
|
PayrollDataSet.dsCompany.CashPaymentSummaryDataTable dtBankPaymentSummary = new Payroll.Report.PayrollDataSet.dsCompany.CashPaymentSummaryDataTable();
|
|||
|
|
|||
|
foreach (DataRow dr in dsCashPaymentSummary.Tables[0].Rows)
|
|||
|
{
|
|||
|
oRow = dtBankPaymentSummary.NewRow();
|
|||
|
oRow["EmpCode"] = dr["EmployeeNo"];
|
|||
|
oRow["Name"] = dr["NAME"];
|
|||
|
oRow["Department"] = dr["Department"];
|
|||
|
oRow["Unit"] = dr["Unit"];
|
|||
|
oRow["UnitName"] = dr["UnitName"];
|
|||
|
oRow["Designation"] = dr["Designation"];
|
|||
|
oRow["Amount"] = dr["Amount"];
|
|||
|
|
|||
|
dtBankPaymentSummary.Rows.Add(oRow);
|
|||
|
}
|
|||
|
oviewer.ShowDlgForCashPaymentSummary(dtBankPaymentSummary);
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
throw new ServiceException(ex.Message);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|