Merge pull request 'salary on balancing' (#3) from Brac_Master_Ashek into Brac_Master

Reviewed-on: http://103.197.204.162:3025/CelHRTeam/HRM-10/pulls/3
This commit is contained in:
ashek 2026-11-30 12:33:50 +06:00
commit b0602c2ee0
16 changed files with 480 additions and 134 deletions

View File

@ -194,6 +194,9 @@ namespace HRM.BO
public bool IsTaxProjection { get; set; } public bool IsTaxProjection { get; set; }
public bool IsDependsOnAttendance { get; set; } public bool IsDependsOnAttendance { get; set; }
public bool ISDEPENDSONSPECIALHOUR { get; set; } public bool ISDEPENDSONSPECIALHOUR { get; set; }
public EnumAllowanceType AllowanceType { get; set; }
public bool IsOnBalancing { get; set; }
public bool IsDependsOnOTHour { get; set; } public bool IsDependsOnOTHour { get; set; }
public bool IsWithException { get; set; } public bool IsWithException { get; set; }
public EnumPeriodicity Periodicity { get; set; } public EnumPeriodicity Periodicity { get; set; }
@ -718,7 +721,7 @@ namespace HRM.BO
//#endregion //#endregion
} }

View File

@ -65,6 +65,10 @@ namespace HRM.BO
public int Approvedby { get; set; } public int Approvedby { get; set; }
public DateTime ApprovedDate { get; set; } public DateTime ApprovedDate { get; set; }
public EnumAuthStatus ApprovalStatus { get; set; } public EnumAuthStatus ApprovalStatus { get; set; }
public EnumAllowanceType AllowanceType { get; set; }
public bool IsOnBalancing { get; set; }
public double GetAmount(double basicSalary, double grossSalary) public double GetAmount(double basicSalary, double grossSalary)
{ {
if (this.ValueType == EnumValueType.Amount) return this.MonthlyAmount; if (this.ValueType == EnumValueType.Amount) return this.MonthlyAmount;

View File

@ -1961,6 +1961,14 @@ namespace HRM.BO
Individual = 2 Individual = 2
} }
public enum EnumAllowanceType
{
None = 0,
HouseRent = 1,
Medical = 2,
Conveynce = 3
}
public enum EnumPFTranType public enum EnumPFTranType
{ {

View File

@ -791,6 +791,8 @@ namespace HRM.BO
#endregion #endregion
public double ActualPassegeFreeAmount { get; set; }
// #region Functions // #region Functions
// public static SalaryMonthly Get(int nID) // public static SalaryMonthly Get(int nID)

View File

@ -173,7 +173,11 @@ namespace HRM.BO
} }
#endregion #endregion
public EnumAllowanceType AllowanceType { get; set; }
public bool IsOnBalancing { get; set; }
public double ActualPassegeFreeAmount { get; set; }
#region Service Factory ISalaryMonthlyService : ISalaryMonthlyService #region Service Factory ISalaryMonthlyService : ISalaryMonthlyService

View File

@ -22,15 +22,15 @@ namespace HRM.DA
{ {
// 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
tc.ExecuteNonQuery( tc.ExecuteNonQuery(
"INSERT INTO ADPARAMETERBASIC(ADParameterID, allowDeductID, isForConfirmOnly, flatAmount, percentOfBasic, percentOfGross, GFFlatAmount, GFPercentOfBasic, GFPercentOfGross, minAmount, maxAmount, isCurrentlyActive, TAXABLEPERCENTAGE, ISTAXABLE, ISTaxProjection, IsDependsOnAttendance, IsDependsOnOTHour,ISDEPENDSONSPECIALHOUR, IsWithException, Periodicity, ALLOWORDEDUCT, GENDER, CreatedBy, CreationDate, PAYROLLTYPEID, LASTACTIVATIONDATE,ENTITLETYPE,PercentOfEarnedBasic,IsFractionateApplicable, TaxProjection)" + "INSERT INTO ADPARAMETERBASIC(ADParameterID, allowDeductID, isForConfirmOnly, flatAmount, percentOfBasic, percentOfGross, GFFlatAmount, GFPercentOfBasic, GFPercentOfGross, minAmount, maxAmount, isCurrentlyActive, TAXABLEPERCENTAGE, ISTAXABLE, ISTaxProjection, IsDependsOnAttendance, IsDependsOnOTHour,ISDEPENDSONSPECIALHOUR, IsWithException, Periodicity, ALLOWORDEDUCT, GENDER, CreatedBy, CreationDate, PAYROLLTYPEID, LASTACTIVATIONDATE,ENTITLETYPE,PercentOfEarnedBasic,IsFractionateApplicable, TaxProjection,allowanceType,isBalancing)" +
" VALUES(%n, %n, %b, %n, %n, %n, %n, %n, %n, %n, %n, %b, %n, %b, %b, %b, %b, %n, %b, %n, %n, %n, %n, %d, %n, %D, %n, %n, %n,%n)", " VALUES(%n, %n, %b, %n, %n, %n, %n, %n, %n, %n, %n, %b, %n, %b, %b, %b, %b, %n, %b, %n, %n, %n, %n, %d, %n, %D, %n, %n, %n,%n,%n,%b)",
item.ID, item.AllowDeductID, item.IsForConfirmOnly, item.FlatAmount, item.PercentOfBasic, item.ID, item.AllowDeductID, item.IsForConfirmOnly, item.FlatAmount, item.PercentOfBasic,
item.PercentOfGross, item.GFFlatAmount, item.GFPercentOfBasic, item.GFPercentOfGross, item.MinAmount, item.PercentOfGross, item.GFFlatAmount, item.GFPercentOfBasic, item.GFPercentOfGross, item.MinAmount,
item.MaxAmount, item.IsCurrentlyActive, item.TaxablePercentage, item.IsTaxable, item.IsTaxProjection, item.MaxAmount, item.IsCurrentlyActive, item.TaxablePercentage, item.IsTaxable, item.IsTaxProjection,
item.IsDependsOnAttendance, item.IsDependsOnOTHour, item.ISDEPENDSONSPECIALHOUR, item.IsWithException, item.IsDependsOnAttendance, item.IsDependsOnOTHour, item.ISDEPENDSONSPECIALHOUR, item.IsWithException,
item.Periodicity, item.AllowOrDeductType, item.Gender, item.CreatedBy, item.CreatedDate, item.Periodicity, item.AllowOrDeductType, item.Gender, item.CreatedBy, item.CreatedDate,
item.PayrollTypeID, DateTime.Now, item.EntitleType, item.PercentOfEarnedBasic, item.PayrollTypeID, DateTime.Now, item.EntitleType, item.PercentOfEarnedBasic,
item.IsFractionateApplicable, 0); item.IsFractionateApplicable, 0,item.AllowanceType,item.IsOnBalancing);
} }
internal static void Insert(TransactionContext tc, ADParameter.ADParameterGrade item) internal static void Insert(TransactionContext tc, ADParameter.ADParameterGrade item)
@ -57,13 +57,13 @@ namespace HRM.DA
internal static void Update(TransactionContext tc, ADParameter item) internal static void Update(TransactionContext tc, ADParameter item)
{ {
tc.ExecuteNonQuery( tc.ExecuteNonQuery(
"UPDATE ADPARAMETERBASIC SET allowDeductID=%n, IsForConfirmOnly=%b, FlatAmount=%n, PercentOfBasic=%n, PercentOfGross=%n, GFFlatAmount=%n, GFPercentOfBasic=%n, GFPercentOfGross=%n, MinAmount=%n, MaxAmount=%n, IsCurrentlyActive=%b, TaxablePercentage=%n, IsTaxable=%b, IsTaxProjection=%b, IsDependsOnAttendance=%b, IsDependsOnOTHour=%b, IsWithException=%b, Periodicity=%n, ALLOWORDEDUCT=%n, Gender=%n, ModifiedBy=%n, ModifiedDate=%d, ENTITLETYPE=%n, PercentOfEarnedBasic=%n, IsFractionateApplicable=%n" + "UPDATE ADPARAMETERBASIC SET allowDeductID=%n, IsForConfirmOnly=%b, FlatAmount=%n, PercentOfBasic=%n, PercentOfGross=%n, GFFlatAmount=%n, GFPercentOfBasic=%n, GFPercentOfGross=%n, MinAmount=%n, MaxAmount=%n, IsCurrentlyActive=%b, TaxablePercentage=%n, IsTaxable=%b, IsTaxProjection=%b, IsDependsOnAttendance=%b, IsDependsOnOTHour=%b, IsWithException=%b, Periodicity=%n, ALLOWORDEDUCT=%n, Gender=%n, ModifiedBy=%n, ModifiedDate=%d, ENTITLETYPE=%n, PercentOfEarnedBasic=%n, IsFractionateApplicable=%n,allowanceType=%n,isBalancing=%b" +
" WHERE ADParameterID=%n", item.AllowDeductID, item.IsForConfirmOnly, item.FlatAmount, " WHERE ADParameterID=%n", item.AllowDeductID, item.IsForConfirmOnly, item.FlatAmount,
item.PercentOfBasic, item.PercentOfGross, item.GFFlatAmount, item.GFPercentOfBasic, item.PercentOfBasic, item.PercentOfGross, item.GFFlatAmount, item.GFPercentOfBasic,
item.GFPercentOfGross, item.MinAmount, item.MaxAmount, item.IsCurrentlyActive, item.TaxablePercentage, item.GFPercentOfGross, item.MinAmount, item.MaxAmount, item.IsCurrentlyActive, item.TaxablePercentage,
item.IsTaxable, item.IsTaxProjection, item.IsDependsOnAttendance, item.IsDependsOnOTHour, item.IsTaxable, item.IsTaxProjection, item.IsDependsOnAttendance, item.IsDependsOnOTHour,
item.IsWithException, item.Periodicity, item.AllowOrDeductType, item.Gender, item.ModifiedBy, item.IsWithException, item.Periodicity, item.AllowOrDeductType, item.Gender, item.ModifiedBy,
item.ModifiedDate, item.EntitleType, item.PercentOfEarnedBasic, item.IsFractionateApplicable, item.ID); item.ModifiedDate, item.EntitleType, item.PercentOfEarnedBasic, item.IsFractionateApplicable, item.AllowanceType, item.IsOnBalancing, item.ID);
} }
#endregion #endregion

View File

@ -51,6 +51,8 @@ namespace HRM.DA
oADParameter.ModifiedBy = oReader.GetInt32("ModifiedBy", 0); oADParameter.ModifiedBy = oReader.GetInt32("ModifiedBy", 0);
oADParameter.ModifiedDate = oReader.GetDateTime("ModifiedDate"); oADParameter.ModifiedDate = oReader.GetDateTime("ModifiedDate");
oADParameter.EntitleType = (EnumEntitleType)oReader.GetInt32("EntitleType").Value; oADParameter.EntitleType = (EnumEntitleType)oReader.GetInt32("EntitleType").Value;
oADParameter.AllowanceType = (EnumAllowanceType)oReader.GetInt32("allowanceType").Value;
oADParameter.IsOnBalancing = oReader.GetBoolean("isBalancing").Value;
this.SetObjectState(oADParameter, Ease.Core.ObjectState.Saved); this.SetObjectState(oADParameter, Ease.Core.ObjectState.Saved);
} }
@ -938,7 +940,88 @@ namespace HRM.DA
return nAmount; return nAmount;
} }
public double GetGradeDefinedAmountForMonth(Employee employee, double basicSalary,
double grossSalary, EmployeeGradeSalary oEmpGradeSalary, ADParameter param, int nFrac)
{
ADParameterEmployee adEmp = null;
double nAmount = 0.0;
switch (param.EntitleType)
{
case EnumEntitleType.Grade:
if (param.PercentOfBasic > 0)
nAmount = nAmount + param.FlatAmount * nFrac +
basicSalary * param.PercentOfBasic / 100.0;
//nAmount = basicSalary * this.PercentOfBasic / 100.0;// + this.FlatAmount;
else if (param.PercentOfGross > 0)
nAmount = nAmount + param.FlatAmount * nFrac +
grossSalary * param.PercentOfGross / 100.0;
//nAmount = grossSalary * this.PercentOfGross / 100.0;// + this.FlatAmount;
else
nAmount = param.FlatAmount * nFrac;
//bool IsGradFather = (employee.GrandFather != null && employee.GrandFather.Allowance == true);
//if (IsGradFather == true)
//{
// nAmount = 0;
// if (this.GFPercentOfBasic > 0)
// nAmount = nAmount + this.GFFlatAmount * oEmpGradeSalary.FractionofFromTo + basicSalary * this.GFPercentOfBasic / 100.0;
// //nAmount = basicSalary * this.PercentOfBasic / 100.0;// + this.FlatAmount;
// else if (this.GFPercentOfGross > 0)
// nAmount = nAmount + this.GFFlatAmount * oEmpGradeSalary.FractionofFromTo + grossSalary * this.GFPercentOfGross / 100.0;
// //nAmount = grossSalary * this.PercentOfGross / 100.0;// + this.FlatAmount;
// else
// nAmount = this.GFFlatAmount * oEmpGradeSalary.FractionofFromTo;
//}
if (param.NotApplicable.Exists(x => x.EmployeeID == employee.ID) == true)
{
nAmount = 0;
}
else
{
adEmp = param.Exception.Find(x => x.EmployeeID == employee.ID);
if (adEmp != null)
{
switch (adEmp.ValueType)
{
case EnumValueType.Amount:
nAmount = adEmp.MonthlyAmount * nFrac;
break;
case EnumValueType.Other:
if (param.PercentOfBasic > 0 || adEmp.MonthlyAmount > 0)
nAmount = basicSalary * adEmp.MonthlyAmount /
100.0; //* oEmpGradeSalary.FractionofFromTo; //+ this.FlatAmount;
else if (param.PercentOfGross > 0 || adEmp.MonthlyAmount > 0)
nAmount = grossSalary * adEmp.MonthlyAmount /
100.0; //* oEmpGradeSalary.FractionofFromTo; //+ this.FlatAmount;
break;
}
}
}
break;
case EnumEntitleType.Individual:
throw new Exception("You have choosed the wrong overloaded function to calculate"
+ " Individual Allowance" + " Employee:(" + employee.EmployeeNo + ")" +
employee.Name + "; Item Name:" + param.AllowanceDeduction.Name);
}
if (param.MinAmount != 0 || param.MaxAmount != 0)
{
if (nAmount < param.MinAmount)
{
nAmount = param.MinAmount;
}
if (nAmount > param.MaxAmount)
{
nAmount = param.MaxAmount;
}
}
return nAmount;
}
public double GetGradeDefinedAmount(Employee employee, double basicSalary, public double GetGradeDefinedAmount(Employee employee, double basicSalary,
double grossSalary, EmployeeGradeSalary oEmpGradeSalary, ADParameter param) double grossSalary, EmployeeGradeSalary oEmpGradeSalary, ADParameter param)
{ {

View File

@ -128,8 +128,9 @@ namespace HRM.DA
//this.PF(); //this.PF();
this.PFNEW(); this.PFNEW();
// this.OverTimeArrearProcess(); needed later // this.OverTimeArrearProcess(); needed later
//UpdateprocessStatus("Calculating Employees Income tax...."); //UpdateprocessStatus("Calculating Employees Income tax....");
this.CalculateOnBalance();
UpdateprocessStatus("Calculating Income Tax"); UpdateprocessStatus("Calculating Income Tax");
this.Tax(); this.Tax();
UpdateprocessStatus("Calculating Cost-Center"); UpdateprocessStatus("Calculating Cost-Center");
@ -480,6 +481,7 @@ namespace HRM.DA
//{ //{
// basicDetail = this.AddDetail(salary, EnumSalaryGroup.Gross, EnumSalaryItemCode.Basic_Salary, (int)EnumSalaryItemCode.Basic_Salary, 0, "Ordinary Amount", PayrollPayrollGlobalFunctions.Round(basicSalary)); // basicDetail = this.AddDetail(salary, EnumSalaryGroup.Gross, EnumSalaryItemCode.Basic_Salary, (int)EnumSalaryItemCode.Basic_Salary, 0, "Ordinary Amount", PayrollPayrollGlobalFunctions.Round(basicSalary));
//} //}
salary.ActualPassegeFreeAmount += salary.ThisMonthBasic;
} }
#endregion Calculate Normal Salary #endregion Calculate Normal Salary
#region calculate arrear amount #region calculate arrear amount
@ -693,6 +695,79 @@ namespace HRM.DA
} }
private void CalculateOnBalance()
{
AllowanceDeduction allowDeduc = new AllowanceDeduction();
UpdateProgressStatus(EnumProcessStatus.Start);
double grossamount = 0, rcvgross = 0, nProjectAmount = 0;
double arrgrossamount = 0, arrrcvgross = 0;
foreach (SalaryMonthly sMonthly in _salaryMonthlys)
{
grossamount = 0; rcvgross = 0; nProjectAmount = 0;
arrgrossamount = 0; arrrcvgross = 0;
foreach (EmployeeGradeSalary item in sMonthly.GradeSalaries)
{
grossamount = grossamount + item.GrossSalary;
}
foreach (EmployeeGradeSalary item in sMonthly.ArrearGradeSalaries)
{
arrgrossamount = arrgrossamount + item.GrossSalary;
}
foreach (SalaryMonthlyDetail item in sMonthly.Details)
{
if ((item.ItemCode == EnumSalaryItemCode.Basic_Salary && item.ItemID == -101 && item.itemGroupCode == EnumSalaryGroup.Gross) ||
item.AllowanceType == EnumAllowanceType.HouseRent && item.itemGroupCode == EnumSalaryGroup.Gross ||
item.AllowanceType == EnumAllowanceType.Medical && item.itemGroupCode == EnumSalaryGroup.Gross ||
item.AllowanceType == EnumAllowanceType.Conveynce && item.itemGroupCode == EnumSalaryGroup.Gross
)
{
rcvgross += item.CalculatedAmount;
}
}
foreach (SalaryMonthlyDetail item in sMonthly.Details)
{
if ((item.ItemCode == EnumSalaryItemCode.Basic_Salary && item.ItemID == -101 && item.itemGroupCode == EnumSalaryGroup.Arrear) ||
item.AllowanceType == EnumAllowanceType.HouseRent && item.itemGroupCode == EnumSalaryGroup.Arrear ||
item.AllowanceType == EnumAllowanceType.Medical && item.itemGroupCode == EnumSalaryGroup.Arrear ||
item.AllowanceType == EnumAllowanceType.Conveynce && item.itemGroupCode == EnumSalaryGroup.Arrear
)
{
arrrcvgross += item.CalculatedAmount;
}
}
SalaryMonthlyDetail smd = sMonthly.Details.Find(x => x.ItemCode == EnumSalaryItemCode.Allowance && x.IsOnBalancing && x.itemGroupCode == EnumSalaryGroup.Gross);
if (smd != null)
{
smd.CalculatedAmount = Math.Round(grossamount - rcvgross, 0);
smd.ChangedAmount = smd.CalculatedAmount;
smd.ActualPassegeFreeAmount = sMonthly.ActualPassegeFreeAmount;
SalaryMonthlyDetail arr = sMonthly.Details.Find(x => x.ItemCode == EnumSalaryItemCode.Allowance && x.IsOnBalancing && x.itemGroupCode == EnumSalaryGroup.Arrear);
if (arr != null)
{
arr.CalculatedAmount = 0;
arr.ChangedAmount = 0;
}
if (arr == null && arrrcvgross != 0)
arr = this.AddDetail(sMonthly, EnumSalaryGroup.Arrear, EnumSalaryItemCode.Allowance, smd.ItemID, smd.SupportID, smd.Description + " Arrear", 0);
if (arr != null && arrrcvgross != 0)
{
arr.CalculatedAmount = Math.Round(arrgrossamount - arrrcvgross, 0);
arr.ChangedAmount = arr.CalculatedAmount;
}
}
}
}
private void PFNEW() private void PFNEW()
{ {
UpdateProgressStatus(EnumProcessStatus.Start); UpdateProgressStatus(EnumProcessStatus.Start);
@ -855,6 +930,17 @@ namespace HRM.DA
List<ADParameterEmployee> indvAllowances = new ADParameterEmployeeService().Get( List<ADParameterEmployee> indvAllowances = new ADParameterEmployeeService().Get(
GlobalFunctions.FirstDateOfMonth(_processMonth), GlobalFunctions.FirstDateOfMonth(_processMonth),
GlobalFunctions.LastDateOfMonth(_processMonth), this.PayrollTypeID); GlobalFunctions.LastDateOfMonth(_processMonth), this.PayrollTypeID);
foreach (ADParameterEmployee emp in indvAllowances)
{
ADParameter adParam = _adParameters.Find(x => x.ID == emp.ADParameterID);
if (adParam != null)
{
emp.AllowanceType=adParam.AllowanceType;
emp.IsOnBalancing=adParam.IsOnBalancing;
}
}
double totalPresentDays = 0; double totalPresentDays = 0;
foreach (SalaryMonthly salary in _salaryMonthlys) foreach (SalaryMonthly salary in _salaryMonthlys)
{ {
@ -864,6 +950,8 @@ namespace HRM.DA
this.GradeDefinedAllowDeduct(salary, salary.ArrearGradeSalaries, EnumSalaryGroup.Arrear, indvAllowances, EnumSide.Add); this.GradeDefinedAllowDeduct(salary, salary.ArrearGradeSalaries, EnumSalaryGroup.Arrear, indvAllowances, EnumSide.Add);
// this.GradeDefinedAllowDeduct(salary, salary.ArrearPaidGradeSalaries, EnumSalaryGroup.Arrear, indvAllowances, EnumSide.Deduct); leter we can introduce // this.GradeDefinedAllowDeduct(salary, salary.ArrearPaidGradeSalaries, EnumSalaryGroup.Arrear, indvAllowances, EnumSide.Deduct); leter we can introduce
this.IndividualAllowDeduct(salary, indvAllowances, totalPresentDays); this.IndividualAllowDeduct(salary, indvAllowances, totalPresentDays);
salary.ActualPassegeFreeAmount = salary.ThisMonthGross - salary.ActualPassegeFreeAmount;
} }
} }
private void IndividualAllowDeduct(SalaryMonthly salary, List<ADParameterEmployee> indvAllowances, double toTalPresentDays) private void IndividualAllowDeduct(SalaryMonthly salary, List<ADParameterEmployee> indvAllowances, double toTalPresentDays)
@ -925,6 +1013,22 @@ namespace HRM.DA
detail.Position = item.AllowDeduct.Sequence + 1; detail.Position = item.AllowDeduct.Sequence + 1;
detail.ADParamEmployee = item; detail.ADParamEmployee = item;
} }
if (detail != null)
{
if (parameter.AllowanceType == EnumAllowanceType.HouseRent ||
parameter.AllowanceType == EnumAllowanceType.Medical ||
parameter.AllowanceType == EnumAllowanceType.Conveynce)
{
if (groupCode != EnumSalaryGroup.Arrear)
{
salary.ActualPassegeFreeAmount += item.MonthlyAmount;
}
}
}
} }
#endregion Individual Allowance #endregion Individual Allowance
@ -953,12 +1057,17 @@ namespace HRM.DA
{ {
if (salary.Category.WagesType == EnumWagesType.Monthly) if (salary.Category.WagesType == EnumWagesType.Monthly)
{ {
amount = new ADParameterService().GetGradeDefinedAmount(salary.Employee, empGradeSalary.BasicSalary, empGradeSalary.GrossSalary, empGradeSalary, parameter); amount = new ADParameterService().GetGradeDefinedAmount(salary.Employee, empGradeSalary.BasicSalary, empGradeSalary.GrossSalary, empGradeSalary, parameter);
// for echotex
if (parameter.AllowanceDeduction.Code == "023" && parameter.AllowanceDeduction.Name == "Night shift allowance" && amount >0) if ((parameter.AllowanceType == EnumAllowanceType.HouseRent && gCode == EnumSalaryGroup.Gross) ||
(parameter.AllowanceType == EnumAllowanceType.Medical && gCode == EnumSalaryGroup.Gross) ||
(parameter.AllowanceType == EnumAllowanceType.Conveynce && gCode == EnumSalaryGroup.Gross))
{ {
amount = parameter.FlatAmount; double nAmt = new ADParameterService().GetGradeDefinedAmountForMonth(salary.Employee, salary.ThisMonthBasic, salary.ThisMonthGross, empGradeSalary, parameter, 1);
salary.ActualPassegeFreeAmount += nAmt;
} }
} }
} else continue; } else continue;
@ -993,6 +1102,10 @@ namespace HRM.DA
if (detail != null) if (detail != null)
detail.Position = parameter.AllowanceDeduction.Sequence + 1; detail.Position = parameter.AllowanceDeduction.Sequence + 1;
detail.AllowanceType = parameter.AllowanceType;
detail.IsOnBalancing= parameter.IsOnBalancing;
} }
} }
} }

View File

@ -1345,6 +1345,8 @@ namespace HRM.DA
taxCalculator.Salary = salaries; taxCalculator.Salary = salaries;
taxCalculator.Employee = new EmployeeService().Get(salaries.EmployeeID); taxCalculator.Employee = new EmployeeService().Get(salaries.EmployeeID);
taxCalculator.AllowanceDeductions = new AllowanceDeductionService().Get(EnumStatus.Regardless); taxCalculator.AllowanceDeductions = new AllowanceDeductionService().Get(EnumStatus.Regardless);
List<ADParameter> ads = new ADParameterService().GetWithDetail(EnumStatus.Regardless, salaries.PayrollTypeID);
taxCalculator.AdParameters = ads;
try try
{ {
foreach (IncomeTax item in taxCalculator.CurrentYearTax) foreach (IncomeTax item in taxCalculator.CurrentYearTax)
@ -1353,6 +1355,49 @@ namespace HRM.DA
item.ProjectedAmount = 0; item.ProjectedAmount = 0;
} }
double rcvGross = 0;
// find gross amount
Employee oEmp = new EmployeeService().Get(salaries.EmployeeID);
SalaryMonthlyDetail pscFreeIime = null;
foreach (var item in salaries.Details)
{
if (item.itemGroupCode == EnumSalaryGroup.Gross)
{
if (item.ItemCode == EnumSalaryItemCode.Allowance)
{
ADParameter param = ads.Find(x=>x.AllowDeductID==item.ItemID);
if (param != null)
{
if(param.IsOnBalancing)
{
pscFreeIime = item;
}
if (param.AllowanceType ==EnumAllowanceType.HouseRent ||
param.AllowanceType == EnumAllowanceType.Medical ||
param.AllowanceType == EnumAllowanceType.Conveynce)
{
ADParameter adParam = new ADParameterService().GetApplicableParameter(oEmp, salaries.GradeID,
ads, item.ItemID);
double nAmt = new ADParameterService().GetAmount(oEmp, adParam);
rcvGross = rcvGross + nAmt;
}
}
}
}
}
rcvGross += salaries.ThisMonthBasic;
if (pscFreeIime!=null)
{
pscFreeIime.ActualPassegeFreeAmount = salaries.ThisMonthGross - rcvGross;
}
salaries.Incometaxes = taxCalculator.SalaryTax(); salaries.Incometaxes = taxCalculator.SalaryTax();
} }
catch (ServiceException sx) catch (ServiceException sx)

View File

@ -31,12 +31,12 @@ namespace HRM.DA
protected List<BATBGrandFatherTaging> _bATBGrandFatherTagings; protected List<BATBGrandFatherTaging> _bATBGrandFatherTagings;
protected List<AllowanceDeduction> _allowanceDeductions; protected List<AllowanceDeduction> _allowanceDeductions;
protected List<EmployeeTaxInvestment> _empTaxInvestments = null; protected List<EmployeeTaxInvestment> _empTaxInvestments = null;
protected List<TaxInvestment> _investmentTypes =null; protected List<TaxInvestment> _investmentTypes = null;
protected double _projectedMonth; protected double _projectedMonth;
protected double _onceoffAmount; protected double _onceoffAmount;
List<OTProcess> _oTProcesss = null; List<OTProcess> _oTProcesss = null;
private double _taxontaxamount; private double _taxontaxamount;
public bool? _investmentwithoutpf= null; public bool? _investmentwithoutpf = null;
public bool? _monthlyexemption = null; public bool? _monthlyexemption = null;
public bool _isActualInvestment; public bool _isActualInvestment;
#endregion Define Class Variable #endregion Define Class Variable
@ -348,7 +348,7 @@ namespace HRM.DA
// _projectedMonth = _projectedMonth + 1; // _projectedMonth = _projectedMonth + 1;
_salary = new SalaryMonthly(); _salary = new SalaryMonthly();
_salary.Details.Add(this.CreateSalaryDetail("Basic Salary", EnumSalaryItemCode.Basic_Salary, (int)EnumSalaryItemCode.Basic_Salary, 0, _employee.BasicSalary)); _salary.Details.Add(this.CreateSalaryDetail("Basic Salary", EnumSalaryItemCode.Basic_Salary, (int)EnumSalaryItemCode.Basic_Salary, 0, _employee.BasicSalary));
if(this._allowanceDeductions == null) if (this._allowanceDeductions == null)
{ {
this._allowanceDeductions = new AllowanceDeductionService().Get(EnumStatus.Regardless, this.payrolltype.ID); this._allowanceDeductions = new AllowanceDeductionService().Get(EnumStatus.Regardless, this.payrolltype.ID);
} }
@ -452,7 +452,15 @@ namespace HRM.DA
#region Management Payrol #region Management Payrol
if (adparameter.EntitleType == EnumEntitleType.Grade) if (adparameter.EntitleType == EnumEntitleType.Grade)
{ {
item.ProjectedAmount = GlobalFunctions.Round( new ADParameterService().GetGradeDefinedAmount(_employee, _employee.BasicSalary, _employee.GrossSalary, oEmpGSalary, adparameter)) * _projectedMonth; if ((salaryDetail.IsOnBalancing == true)
&& salaryDetail.ItemCode == EnumSalaryItemCode.Allowance &&
salaryDetail.itemGroupCode == EnumSalaryGroup.Gross)
{
item.ProjectedAmount = salaryDetail.ActualPassegeFreeAmount * _projectedMonth;
}
else item.ProjectedAmount = GlobalFunctions.Round(new ADParameterService().GetGradeDefinedAmount(_employee, _employee.BasicSalary, _employee.GrossSalary, oEmpGSalary, adparameter)) * _projectedMonth;
//item.ProjectedAmount = GlobalFunctions.Round( new ADParameterService().GetGradeDefinedAmount(_employee, _employee.BasicSalary, _employee.GrossSalary, oEmpGSalary, adparameter)) * _projectedMonth;
} }
else else
{ {
@ -600,7 +608,7 @@ namespace HRM.DA
where pItem.ItemGroup == 7 where pItem.ItemGroup == 7
select pItem; select pItem;
#endregion #endregion
if(this._monthlyexemption ==null) if (this._monthlyexemption == null)
this._monthlyexemption = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "incometax", "monthlyexemption"); this._monthlyexemption = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "incometax", "monthlyexemption");
foreach (var processItem in examtionItems) foreach (var processItem in examtionItems)
@ -612,15 +620,15 @@ namespace HRM.DA
{ {
//if (_employee.JoiningDate.Day > 1) //if (_employee.JoiningDate.Day > 1)
// _employee.JoiningDate = new DateTime(_employee.JoiningDate.Year, _employee.JoiningDate.Month, 1); // _employee.JoiningDate = new DateTime(_employee.JoiningDate.Year, _employee.JoiningDate.Month, 1);
IncomeTax basicItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax basicItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Basic_Salary && x.ItemID == (int) EnumIncomeTaxItemGroup.Basic_Salary); x.ItemGroup == EnumIncomeTaxItemGroup.Basic_Salary && x.ItemID == (int)EnumIncomeTaxItemGroup.Basic_Salary);
IncomeTax HRItem = _currentYearTax.FirstOrDefault(x=> x.EmployeeID == _employee.ID && IncomeTax HRItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.House_Rent_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.House_Rent_Allowance); x.ItemGroup == EnumIncomeTaxItemGroup.House_Rent_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.House_Rent_Allowance);
if (HRItem == null || HRItem.TotalAmount == 0) continue; //throw new ServiceException("House rent allowance not found in the collection while calculating HR Examtion"); if (HRItem == null || HRItem.TotalAmount == 0) continue; //throw new ServiceException("House rent allowance not found in the collection while calculating HR Examtion");
//continue; // //continue; //
IncomeTax HrExption = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax HrExption = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance && x.ItemGroup == EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance &&
x.ItemID == (int)EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance); x.ItemID == (int)EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance);
if (HrExption == null) HrExption = this.Add(EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance, if (HrExption == null) HrExption = this.Add(EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance,
@ -852,11 +860,11 @@ namespace HRM.DA
#region Conveyance Allowance Examtion #region Conveyance Allowance Examtion
else if (processItem.ItemCode == (int)EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance) else if (processItem.ItemCode == (int)EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance)
{ {
IncomeTax CnvItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID== _employee.ID && IncomeTax CnvItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Conveyance_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.Conveyance_Allowance); x.ItemGroup == EnumIncomeTaxItemGroup.Conveyance_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.Conveyance_Allowance);
if (CnvItem == null || CnvItem.TotalAmount == 0) continue; if (CnvItem == null || CnvItem.TotalAmount == 0) continue;
IncomeTax CvExption = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax CvExption = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance); x.ItemGroup == EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance);
if (CvExption == null) CvExption = this.Add(EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance, string.Empty, 0, 0, EnumIncomeTaxSide.Dec_SalaryIncome); if (CvExption == null) CvExption = this.Add(EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_Conveyance_Allowance, string.Empty, 0, 0, EnumIncomeTaxSide.Dec_SalaryIncome);
@ -899,15 +907,15 @@ namespace HRM.DA
#region Other Allowance Examption #region Other Allowance Examption
else if (processItem.ItemCode == (int)EnumIncomeTaxItemGroup.Exemption_Medical_Allowance) else if (processItem.ItemCode == (int)EnumIncomeTaxItemGroup.Exemption_Medical_Allowance)
{ {
IncomeTax MedicalItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax MedicalItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Medical_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.Medical_Allowance); x.ItemGroup == EnumIncomeTaxItemGroup.Medical_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.Medical_Allowance);
if (MedicalItem == null) continue; //throw new ServiceException("Conveyance allowance not found in the collection while calculating HR Examtion"); if (MedicalItem == null) continue; //throw new ServiceException("Conveyance allowance not found in the collection while calculating HR Examtion");
IncomeTax mdExption = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax mdExption = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Exemption_Medical_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.Exemption_Medical_Allowance); x.ItemGroup == EnumIncomeTaxItemGroup.Exemption_Medical_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.Exemption_Medical_Allowance);
if (mdExption == null) mdExption = this.Add(EnumIncomeTaxItemGroup.Exemption_Medical_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_Medical_Allowance, string.Empty, 0, 0, EnumIncomeTaxSide.Dec_SalaryIncome); if (mdExption == null) mdExption = this.Add(EnumIncomeTaxItemGroup.Exemption_Medical_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_Medical_Allowance, string.Empty, 0, 0, EnumIncomeTaxSide.Dec_SalaryIncome);
IncomeTax basicItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax basicItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Basic_Salary && x.ItemID == (int)EnumIncomeTaxItemGroup.Basic_Salary); x.ItemGroup == EnumIncomeTaxItemGroup.Basic_Salary && x.ItemID == (int)EnumIncomeTaxItemGroup.Basic_Salary);
//Sumon on 24 June 2014 //Sumon on 24 June 2014
@ -930,11 +938,11 @@ namespace HRM.DA
} }
else if (processItem.ItemCode == (int)EnumIncomeTaxItemGroup.Exemption_LFA_Allowance) else if (processItem.ItemCode == (int)EnumIncomeTaxItemGroup.Exemption_LFA_Allowance)
{ {
IncomeTax LFAItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax LFAItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.LFA_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.LFA_Allowance); x.ItemGroup == EnumIncomeTaxItemGroup.LFA_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.LFA_Allowance);
if (LFAItem == null) continue;// throw new ServiceException("LFA allowance not found in the collection while calculating HR Examtion"); if (LFAItem == null) continue;// throw new ServiceException("LFA allowance not found in the collection while calculating HR Examtion");
//continue; // //continue; //
IncomeTax lfaExption = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID IncomeTax lfaExption = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Exemption_LFA_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.Exemption_LFA_Allowance); && x.ItemGroup == EnumIncomeTaxItemGroup.Exemption_LFA_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.Exemption_LFA_Allowance);
if (lfaExption == null) lfaExption = this.Add(EnumIncomeTaxItemGroup.Exemption_LFA_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_LFA_Allowance, string.Empty, 0, 0, EnumIncomeTaxSide.Dec_SalaryIncome); if (lfaExption == null) lfaExption = this.Add(EnumIncomeTaxItemGroup.Exemption_LFA_Allowance, (int)EnumIncomeTaxItemGroup.Exemption_LFA_Allowance, string.Empty, 0, 0, EnumIncomeTaxSide.Dec_SalaryIncome);
@ -946,11 +954,11 @@ namespace HRM.DA
} }
else if (processItem.ItemCode == (int)EnumIncomeTaxItemGroup.WPPF_Examption) else if (processItem.ItemCode == (int)EnumIncomeTaxItemGroup.WPPF_Examption)
{ {
IncomeTax wppfItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID ==_employee.ID && IncomeTax wppfItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.WPPF_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.WPPF_Allowance); x.ItemGroup == EnumIncomeTaxItemGroup.WPPF_Allowance && x.ItemID == (int)EnumIncomeTaxItemGroup.WPPF_Allowance);
if (wppfItem == null) continue;// throw new ServiceException("LFA allowance not found in the collection while calculating HR Examtion"); if (wppfItem == null) continue;// throw new ServiceException("LFA allowance not found in the collection while calculating HR Examtion");
//continue; // //continue; //
IncomeTax wppfExption = _currentYearTax.FirstOrDefault(x=>x.EmployeeID== _employee.ID IncomeTax wppfExption = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.WPPF_Examption && x.ItemID == (int)EnumIncomeTaxItemGroup.WPPF_Examption); && x.ItemGroup == EnumIncomeTaxItemGroup.WPPF_Examption && x.ItemID == (int)EnumIncomeTaxItemGroup.WPPF_Examption);
if (wppfExption == null) wppfExption = this.Add(EnumIncomeTaxItemGroup.WPPF_Examption, (int)EnumIncomeTaxItemGroup.WPPF_Examption, string.Empty, 0, 0, EnumIncomeTaxSide.Dec_SalaryIncome); if (wppfExption == null) wppfExption = this.Add(EnumIncomeTaxItemGroup.WPPF_Examption, (int)EnumIncomeTaxItemGroup.WPPF_Examption, string.Empty, 0, 0, EnumIncomeTaxSide.Dec_SalaryIncome);
@ -973,7 +981,7 @@ namespace HRM.DA
x.ItemGroup == EnumIncomeTaxItemGroup.Company_Contri_PF && x.ItemID == (int)EnumIncomeTaxItemGroup.Company_Contri_PF); x.ItemGroup == EnumIncomeTaxItemGroup.Company_Contri_PF && x.ItemID == (int)EnumIncomeTaxItemGroup.Company_Contri_PF);
if (pfItem == null) pfItem = this.Add(EnumIncomeTaxItemGroup.Company_Contri_PF, (int)EnumIncomeTaxItemGroup.Company_Contri_PF, string.Empty, 0, 0, EnumIncomeTaxSide.Inc_AnnualIncome); if (pfItem == null) pfItem = this.Add(EnumIncomeTaxItemGroup.Company_Contri_PF, (int)EnumIncomeTaxItemGroup.Company_Contri_PF, string.Empty, 0, 0, EnumIncomeTaxSide.Inc_AnnualIncome);
IncomeTax BasicItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID IncomeTax BasicItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Basic_Salary && x.ItemID == (int)EnumIncomeTaxItemGroup.Basic_Salary); && x.ItemGroup == EnumIncomeTaxItemGroup.Basic_Salary && x.ItemID == (int)EnumIncomeTaxItemGroup.Basic_Salary);
if (BasicItem == null) return; if (BasicItem == null) return;
@ -1027,7 +1035,7 @@ namespace HRM.DA
} }
if (_projectionBonusParams == null || _projectionBonusParams.Count == 0) return; if (_projectionBonusParams == null || _projectionBonusParams.Count == 0) return;
oparams = new BonusParameterService().GetApplicableParameters(_employee, (int) _employee.GradeID, _projectionBonusParams); oparams = new BonusParameterService().GetApplicableParameters(_employee, (int)_employee.GradeID, _projectionBonusParams);
if (oparams == null) return; if (oparams == null) return;
_ApplicableBonusParams = oparams; _ApplicableBonusParams = oparams;
@ -1055,9 +1063,9 @@ namespace HRM.DA
pfItem.ProjectedAmount = 0; pfItem.ProjectedAmount = 0;
//First Project Month //First Project Month
if (bonusAmount >0 && item.firstProjectMonth != null && item.firstProjectMonth > payrolltype.NextPayProcessDate) if (bonusAmount > 0 && item.firstProjectMonth != null && item.firstProjectMonth > payrolltype.NextPayProcessDate)
{ {
if(item.secondProjectMonth !=null) if (item.secondProjectMonth != null)
pfItem.ProjectedAmount = bonusAmount / 2; pfItem.ProjectedAmount = bonusAmount / 2;
else pfItem.ProjectedAmount = bonusAmount; else pfItem.ProjectedAmount = bonusAmount;
} }
@ -1138,13 +1146,13 @@ namespace HRM.DA
if (_isActualInvestment == true) // payroll type wise Actual investment date is different, so this done in temporary basis if (_isActualInvestment == true) // payroll type wise Actual investment date is different, so this done in temporary basis
{ {
IncomeTax ActualInvestment = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax ActualInvestment = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Investment_Actual && x.ItemID == (int)EnumIncomeTaxItemGroup.Investment_Actual); x.ItemGroup == EnumIncomeTaxItemGroup.Investment_Actual && x.ItemID == (int)EnumIncomeTaxItemGroup.Investment_Actual);
if (ActualInvestment == null) if (ActualInvestment == null)
ActualInvestment = this.Add(EnumIncomeTaxItemGroup.Investment_Actual, (int)EnumIncomeTaxItemGroup.Investment_Actual, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_Info_Item); ActualInvestment = this.Add(EnumIncomeTaxItemGroup.Investment_Actual, (int)EnumIncomeTaxItemGroup.Investment_Actual, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_Info_Item);
IncomeTax pfItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && x.ItemGroup == EnumIncomeTaxItemGroup.Company_Contri_PF IncomeTax pfItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID && x.ItemGroup == EnumIncomeTaxItemGroup.Company_Contri_PF
&& x.ItemID == (int)EnumIncomeTaxItemGroup.Company_Contri_PF); && x.ItemID == (int)EnumIncomeTaxItemGroup.Company_Contri_PF);
investAmount = 0; investAmount = 0;
if (pfItem != null) if (pfItem != null)
@ -1158,7 +1166,7 @@ namespace HRM.DA
ActualInvestment.TotalAmount = nactualInvt; ActualInvestment.TotalAmount = nactualInvt;
} }
IncomeTax InvestmentAllowed = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && x.ItemGroup == EnumIncomeTaxItemGroup.Investment_Allowed IncomeTax InvestmentAllowed = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID && x.ItemGroup == EnumIncomeTaxItemGroup.Investment_Allowed
&& x.ItemID == (int)EnumIncomeTaxItemGroup.Investment_Allowed); && x.ItemID == (int)EnumIncomeTaxItemGroup.Investment_Allowed);
if (InvestmentAllowed == null) InvestmentAllowed = this.Add(EnumIncomeTaxItemGroup.Investment_Allowed, if (InvestmentAllowed == null) InvestmentAllowed = this.Add(EnumIncomeTaxItemGroup.Investment_Allowed,
(int)EnumIncomeTaxItemGroup.Investment_Allowed, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_Info_Item); (int)EnumIncomeTaxItemGroup.Investment_Allowed, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_Info_Item);
@ -1189,14 +1197,14 @@ namespace HRM.DA
{ {
if (_assignedHeads == null) return; if (_assignedHeads == null) return;
List<ITEmpHead> Items = _assignedHeads.FindAll(x=>x.EmployeeID == _employee.ID); List<ITEmpHead> Items = _assignedHeads.FindAll(x => x.EmployeeID == _employee.ID);
if (Items == null || Items.Count == 0) return; if (Items == null || Items.Count == 0) return;
DateTime fromDate = GlobalFunctions.FirstDateOfMonth(month); DateTime fromDate = GlobalFunctions.FirstDateOfMonth(month);
DateTime toDate = GlobalFunctions.LastDateOfMonth(month); DateTime toDate = GlobalFunctions.LastDateOfMonth(month);
bool bvalid = false; bool bvalid = false;
IncomeTax basicSalaryItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID IncomeTax basicSalaryItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Basic_Salary && x.ItemGroup == EnumIncomeTaxItemGroup.Basic_Salary
&& x.ItemID == (int)EnumIncomeTaxItemGroup.Basic_Salary); && x.ItemID == (int)EnumIncomeTaxItemGroup.Basic_Salary);
@ -1220,7 +1228,7 @@ namespace HRM.DA
#region Calculate Car calculation #region Calculate Car calculation
if (item.HeadID == EnumIncomeTaxHead.Car) if (item.HeadID == EnumIncomeTaxHead.Car)
{ {
taxItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID taxItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Cmp_Provided_car && x.ItemGroup == EnumIncomeTaxItemGroup.Cmp_Provided_car
&& x.ItemID == (int)EnumIncomeTaxItemGroup.Cmp_Provided_car); && x.ItemID == (int)EnumIncomeTaxItemGroup.Cmp_Provided_car);
if (taxItem == null) taxItem = this.Add(EnumIncomeTaxItemGroup.Cmp_Provided_car, if (taxItem == null) taxItem = this.Add(EnumIncomeTaxItemGroup.Cmp_Provided_car,
@ -1241,13 +1249,13 @@ namespace HRM.DA
//else tempAmount = basicSalaryItem.ProjectedAmount / _projectedMonth; //else tempAmount = basicSalaryItem.ProjectedAmount / _projectedMonth;
if (toDate == GlobalFunctions.LastDateOfMonth(toDate)) if (toDate == GlobalFunctions.LastDateOfMonth(toDate))
taxItem.ProjectedAmount = (tempAmount * (Global.DateFunctions.DateDiff("m", GlobalFunctions.LastDateOfMonth(month).AddDays(1), toDate) + 1) ); taxItem.ProjectedAmount = (tempAmount * (Global.DateFunctions.DateDiff("m", GlobalFunctions.LastDateOfMonth(month).AddDays(1), toDate) + 1));
else else
taxItem.ProjectedAmount = (tempAmount * GlobalFunctions.GetFraction(GlobalFunctions.LastDateOfMonth(month).AddDays(1), toDate)) ; taxItem.ProjectedAmount = (tempAmount * GlobalFunctions.GetFraction(GlobalFunctions.LastDateOfMonth(month).AddDays(1), toDate));
taxItem.ProjectedAmount = GlobalFunctions.Round(taxItem.ProjectedAmount); taxItem.ProjectedAmount = GlobalFunctions.Round(taxItem.ProjectedAmount);
if(taxItem.TotalAmount <120000) if (taxItem.TotalAmount < 120000)
{ {
taxItem.ProjectedAmount = 120000 - (taxItem.PreviousAmount + taxItem.ThisMonthAmount); taxItem.ProjectedAmount = 120000 - (taxItem.PreviousAmount + taxItem.ThisMonthAmount);
} }
@ -1257,7 +1265,7 @@ namespace HRM.DA
#region Calculate House rent calculation #region Calculate House rent calculation
if (item.HeadID == EnumIncomeTaxHead.House) if (item.HeadID == EnumIncomeTaxHead.House)
{ {
taxItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID taxItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Cmp_Provided_House && x.ItemGroup == EnumIncomeTaxItemGroup.Cmp_Provided_House
&& x.ItemID == (int)EnumIncomeTaxItemGroup.Cmp_Provided_House); && x.ItemID == (int)EnumIncomeTaxItemGroup.Cmp_Provided_House);
if (taxItem == null) taxItem = this.Add(EnumIncomeTaxItemGroup.Cmp_Provided_House, if (taxItem == null) taxItem = this.Add(EnumIncomeTaxItemGroup.Cmp_Provided_House,
@ -1270,7 +1278,7 @@ namespace HRM.DA
tempAmount = basicSalaryItem.ThisMonthAmount; tempAmount = basicSalaryItem.ThisMonthAmount;
else else
{ {
SalaryMonthlyDetail detail = _salary.Details.FirstOrDefault(x=>x.itemGroupCode == EnumSalaryGroup.Gross SalaryMonthlyDetail detail = _salary.Details.FirstOrDefault(x => x.itemGroupCode == EnumSalaryGroup.Gross
&& x.ItemCode == EnumSalaryItemCode.Basic_Salary && x.ItemID == (int)EnumSalaryItemCode.Basic_Salary); && x.ItemCode == EnumSalaryItemCode.Basic_Salary && x.ItemID == (int)EnumSalaryItemCode.Basic_Salary);
if (detail == null) continue; if (detail == null) continue;
tempAmount = detail.ChangedAmount; tempAmount = detail.ChangedAmount;
@ -1284,7 +1292,7 @@ namespace HRM.DA
GlobalFunctions.GetFraction(item.StartDate, (DateTime)gse.TillDate); GlobalFunctions.GetFraction(item.StartDate, (DateTime)gse.TillDate);
else else
{ {
SalaryMonthlyDetail arreardetail = _salary.Details.FirstOrDefault(x=>x.itemGroupCode == EnumSalaryGroup.Arrear SalaryMonthlyDetail arreardetail = _salary.Details.FirstOrDefault(x => x.itemGroupCode == EnumSalaryGroup.Arrear
&& x.ItemCode == EnumSalaryItemCode.Basic_Salary && x.ItemID == (int)EnumSalaryItemCode.Basic_Salary); && x.ItemCode == EnumSalaryItemCode.Basic_Salary && x.ItemID == (int)EnumSalaryItemCode.Basic_Salary);
if (arreardetail != null) if (arreardetail != null)
{ {
@ -1382,7 +1390,7 @@ namespace HRM.DA
protected void CalculateTotalIncome() protected void CalculateTotalIncome()
{ {
IncomeTax salaryIncome = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax salaryIncome = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Annual_Salary_Income && x.ItemID == (int)EnumIncomeTaxItemGroup.Annual_Salary_Income); x.ItemGroup == EnumIncomeTaxItemGroup.Annual_Salary_Income && x.ItemID == (int)EnumIncomeTaxItemGroup.Annual_Salary_Income);
if (salaryIncome == null) salaryIncome = this.Add(EnumIncomeTaxItemGroup.Annual_Salary_Income, if (salaryIncome == null) salaryIncome = this.Add(EnumIncomeTaxItemGroup.Annual_Salary_Income,
(int)EnumIncomeTaxItemGroup.Annual_Salary_Income, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item); (int)EnumIncomeTaxItemGroup.Annual_Salary_Income, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item);
@ -1412,7 +1420,7 @@ namespace HRM.DA
salaryIncome.ThisMonthAmount = GlobalFunctions.Round(salaryIncome.ThisMonthAmount); salaryIncome.ThisMonthAmount = GlobalFunctions.Round(salaryIncome.ThisMonthAmount);
salaryIncome.ProjectedAmount = GlobalFunctions.Round(salaryIncome.ProjectedAmount); salaryIncome.ProjectedAmount = GlobalFunctions.Round(salaryIncome.ProjectedAmount);
IncomeTax annualIncome = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID IncomeTax annualIncome = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Annual_Income && x.ItemID == (int)EnumIncomeTaxItemGroup.Annual_Income); && x.ItemGroup == EnumIncomeTaxItemGroup.Annual_Income && x.ItemID == (int)EnumIncomeTaxItemGroup.Annual_Income);
if (annualIncome == null) annualIncome = this.Add(EnumIncomeTaxItemGroup.Annual_Income, if (annualIncome == null) annualIncome = this.Add(EnumIncomeTaxItemGroup.Annual_Income,
(int)EnumIncomeTaxItemGroup.Annual_Income, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item); (int)EnumIncomeTaxItemGroup.Annual_Income, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item);
@ -1457,7 +1465,7 @@ namespace HRM.DA
if (item.ItemGroup == EnumIncomeTaxItemGroup.Tax_Gross_Rebate || if (item.ItemGroup == EnumIncomeTaxItemGroup.Tax_Gross_Rebate ||
item.ItemGroup == EnumIncomeTaxItemGroup.Tax_Gross_Refund || item.ItemGroup == EnumIncomeTaxItemGroup.Tax_Gross_Refund ||
item.ItemGroup == EnumIncomeTaxItemGroup.Tax_Gross_OtherRebate || item.ItemGroup == EnumIncomeTaxItemGroup.Tax_Gross_OtherRebate ||
item.ItemGroup == EnumIncomeTaxItemGroup.Tax_Gross_OtherAddable ) item.ItemGroup == EnumIncomeTaxItemGroup.Tax_Gross_OtherAddable)
{ {
if (item.Side == EnumIncomeTaxSide.Inc_GrossTax) if (item.Side == EnumIncomeTaxSide.Inc_GrossTax)
TotIncome = TotIncome + item.TotalAmount; TotIncome = TotIncome + item.TotalAmount;
@ -1473,9 +1481,9 @@ namespace HRM.DA
/// </summary> /// </summary>
protected void CalculateYearlyRefund() protected void CalculateYearlyRefund()
{ {
IncomeTax oNetTaxPayable = this.CurrentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax oNetTaxPayable = this.CurrentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Net_Payable && x.ItemID == (int)EnumIncomeTaxItemGroup.Net_Payable); x.ItemGroup == EnumIncomeTaxItemGroup.Net_Payable && x.ItemID == (int)EnumIncomeTaxItemGroup.Net_Payable);
IncomeTax oTaxDeducted = this.CurrentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax oTaxDeducted = this.CurrentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted); x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted);
@ -1488,7 +1496,7 @@ namespace HRM.DA
if ((oNetTaxPayable.TotalAmount - oTaxDeducted.TotalAmount) != 0) if ((oNetTaxPayable.TotalAmount - oTaxDeducted.TotalAmount) != 0)
{ {
IncomeTax TaxRefund = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID IncomeTax TaxRefund = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Refund_On_Current_Year && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Refund_On_Current_Year); && x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Refund_On_Current_Year && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Refund_On_Current_Year);
if (TaxRefund == null) TaxRefund = this.Add(EnumIncomeTaxItemGroup.Tax_Refund_On_Current_Year, if (TaxRefund == null) TaxRefund = this.Add(EnumIncomeTaxItemGroup.Tax_Refund_On_Current_Year,
(int)EnumIncomeTaxItemGroup.Tax_Refund_On_Current_Year, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item); (int)EnumIncomeTaxItemGroup.Tax_Refund_On_Current_Year, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item);
@ -1507,7 +1515,7 @@ namespace HRM.DA
protected void CalculateNetPayable() protected void CalculateNetPayable()
{ {
IncomeTax GrossTax = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID IncomeTax GrossTax = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Gross_Tax && x.ItemID == (int)EnumIncomeTaxItemGroup.Gross_Tax); && x.ItemGroup == EnumIncomeTaxItemGroup.Gross_Tax && x.ItemID == (int)EnumIncomeTaxItemGroup.Gross_Tax);
if (GrossTax == null) if (GrossTax == null)
{ {
@ -1516,7 +1524,7 @@ namespace HRM.DA
this.CalculateGrossTax(); this.CalculateGrossTax();
IncomeTax netPayable = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax netPayable = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Net_Payable && x.ItemID == (int)EnumIncomeTaxItemGroup.Net_Payable); x.ItemGroup == EnumIncomeTaxItemGroup.Net_Payable && x.ItemID == (int)EnumIncomeTaxItemGroup.Net_Payable);
if (netPayable == null) netPayable = this.Add(EnumIncomeTaxItemGroup.Net_Payable, if (netPayable == null) netPayable = this.Add(EnumIncomeTaxItemGroup.Net_Payable,
(int)EnumIncomeTaxItemGroup.Net_Payable, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item); (int)EnumIncomeTaxItemGroup.Net_Payable, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item);
@ -1527,7 +1535,7 @@ namespace HRM.DA
if (GrossTax.TotalAmount > 0) if (GrossTax.TotalAmount > 0)
{ {
IncomeTax InvestItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID IncomeTax InvestItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Credit_On_Investment && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Credit_On_Investment); && x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Credit_On_Investment && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Credit_On_Investment);
if (InvestItem == null) this.CalculateInvestment(); if (InvestItem == null) this.CalculateInvestment();
@ -1575,7 +1583,7 @@ namespace HRM.DA
protected void CalculateGrossTax() protected void CalculateGrossTax()
{ {
IncomeTax GrossTax = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID IncomeTax GrossTax = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Gross_Tax && x.ItemID == (int)EnumIncomeTaxItemGroup.Gross_Tax); && x.ItemGroup == EnumIncomeTaxItemGroup.Gross_Tax && x.ItemID == (int)EnumIncomeTaxItemGroup.Gross_Tax);
if (GrossTax == null) GrossTax = this.Add(EnumIncomeTaxItemGroup.Gross_Tax, if (GrossTax == null) GrossTax = this.Add(EnumIncomeTaxItemGroup.Gross_Tax,
(int)EnumIncomeTaxItemGroup.Gross_Tax, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item); (int)EnumIncomeTaxItemGroup.Gross_Tax, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item);
@ -1592,7 +1600,7 @@ namespace HRM.DA
{ {
double nAmount = 0; double nAmount = 0;
double nTaxAmount = 0; double nTaxAmount = 0;
IncomeTax TaxDeductitem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID IncomeTax TaxDeductitem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted); && x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted);
if (TaxDeductitem != null) if (TaxDeductitem != null)
{ {
@ -1602,7 +1610,7 @@ namespace HRM.DA
this.CalculateThisMonth(); this.CalculateThisMonth();
TaxDeductitem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && TaxDeductitem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted); x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted);
if (TaxDeductitem != null) if (TaxDeductitem != null)
{ {
@ -1613,7 +1621,7 @@ namespace HRM.DA
protected void UndoDecutedAmount(double nAmount) protected void UndoDecutedAmount(double nAmount)
{ {
IncomeTax TaxDeductitem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID IncomeTax TaxDeductitem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted); && x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted);
if (TaxDeductitem != null) if (TaxDeductitem != null)
TaxDeductitem.ThisMonthAmount = TaxDeductitem.ThisMonthAmount - nAmount; TaxDeductitem.ThisMonthAmount = TaxDeductitem.ThisMonthAmount - nAmount;
@ -1624,11 +1632,11 @@ namespace HRM.DA
if (_employee.ForeignExPat == true) return 0; if (_employee.ForeignExPat == true) return 0;
if(this._investmentwithoutpf ==null) if (this._investmentwithoutpf == null)
this._investmentwithoutpf = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "incometax", "investmentwithoutpf"); this._investmentwithoutpf = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "incometax", "investmentwithoutpf");
IncomeTax AnnItem = null; IncomeTax AnnItem = null;
AnnItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID== _employee.ID && x.ItemGroup == EnumIncomeTaxItemGroup.Annual_Income AnnItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID && x.ItemGroup == EnumIncomeTaxItemGroup.Annual_Income
&& x.ItemID == (int)EnumIncomeTaxItemGroup.Annual_Income); && x.ItemID == (int)EnumIncomeTaxItemGroup.Annual_Income);
double totalIncome = IncomeAmount; //AnnItem.TotalAmount - _onceoffAmount; double totalIncome = IncomeAmount; //AnnItem.TotalAmount - _onceoffAmount;
@ -1655,13 +1663,13 @@ namespace HRM.DA
} }
if (_isActualInvestment == true) if (_isActualInvestment == true)
{ {
IncomeTax ActualInvestment = _currentYearTax.FirstOrDefault(x=>x.EmployeeID== _employee.ID && IncomeTax ActualInvestment = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Investment_Actual && x.ItemID == (int)EnumIncomeTaxItemGroup.Investment_Actual); x.ItemGroup == EnumIncomeTaxItemGroup.Investment_Actual && x.ItemID == (int)EnumIncomeTaxItemGroup.Investment_Actual);
if (ActualInvestment == null) if (ActualInvestment == null)
ActualInvestment = this.Add(EnumIncomeTaxItemGroup.Investment_Actual, (int)EnumIncomeTaxItemGroup.Investment_Actual, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_Info_Item); ActualInvestment = this.Add(EnumIncomeTaxItemGroup.Investment_Actual, (int)EnumIncomeTaxItemGroup.Investment_Actual, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_Info_Item);
IncomeTax pfItem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && x.ItemGroup == EnumIncomeTaxItemGroup.Company_Contri_PF IncomeTax pfItem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID && x.ItemGroup == EnumIncomeTaxItemGroup.Company_Contri_PF
&& x.ItemID == (int)EnumIncomeTaxItemGroup.Company_Contri_PF); && x.ItemID == (int)EnumIncomeTaxItemGroup.Company_Contri_PF);
investAmount = 0; investAmount = 0;
if (pfItem != null) if (pfItem != null)
@ -1703,7 +1711,7 @@ namespace HRM.DA
protected void CalculateThisMonth() protected void CalculateThisMonth()
{ {
IncomeTax TaxDeductitem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax TaxDeductitem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted); x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted);
if (TaxDeductitem == null) TaxDeductitem = this.Add(EnumIncomeTaxItemGroup.Tax_Deducted, if (TaxDeductitem == null) TaxDeductitem = this.Add(EnumIncomeTaxItemGroup.Tax_Deducted,
(int)EnumIncomeTaxItemGroup.Tax_Deducted, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item); (int)EnumIncomeTaxItemGroup.Tax_Deducted, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item);
@ -1711,7 +1719,7 @@ namespace HRM.DA
this.CalculateGrossTax(); this.CalculateGrossTax();
this.CalculateNetPayable(); this.CalculateNetPayable();
double onceOffTax = 0; double onceOffTax = 0;
double netPayable = this._currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && double netPayable = this._currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Net_Payable && x.ItemID == (int)EnumIncomeTaxItemGroup.Net_Payable).TotalAmount; x.ItemGroup == EnumIncomeTaxItemGroup.Net_Payable && x.ItemID == (int)EnumIncomeTaxItemGroup.Net_Payable).TotalAmount;
double annualIncome = this.GetAnnualIncome(); double annualIncome = this.GetAnnualIncome();
//double grossTax = IncomeTax.Get(this._currentYearTax, _employee.ID, //double grossTax = IncomeTax.Get(this._currentYearTax, _employee.ID,
@ -1724,7 +1732,7 @@ namespace HRM.DA
// if (onceOffTax < 0) onceOffTax = 0; // if (onceOffTax < 0) onceOffTax = 0;
//} //}
double exptionAmount = 0; double exptionAmount = 0;
var expItem = this._currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && var expItem = this._currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.AnnualExemption && x.ItemID == x.ItemGroup == EnumIncomeTaxItemGroup.AnnualExemption && x.ItemID ==
(int)EnumIncomeTaxItemGroup.AnnualExemption); (int)EnumIncomeTaxItemGroup.AnnualExemption);
if (expItem != null) exptionAmount = expItem.TotalAmount; if (expItem != null) exptionAmount = expItem.TotalAmount;
@ -1970,8 +1978,8 @@ namespace HRM.DA
double taxamount = this.GetTaxAmount(income); double taxamount = this.GetTaxAmount(income);
if (_employee.ForeignExPat == true) return 0; if (_employee.ForeignExPat == true) return 0;
if(this._investmentwithoutpf ==null) if (this._investmentwithoutpf == null)
this._investmentwithoutpf = new SystemConfigarationService().GetconfigBooleanValue( EnumConfigurationType.Logic, "incometax", "investmentwithoutpf"); this._investmentwithoutpf = new SystemConfigarationService().GetconfigBooleanValue(EnumConfigurationType.Logic, "incometax", "investmentwithoutpf");
double investmentCanBeShown = ((taxamount * _taxParameter.MaxInvestPercent) / 100); double investmentCanBeShown = ((taxamount * _taxParameter.MaxInvestPercent) / 100);
if (investmentCanBeShown > _taxParameter.MaxInvAmount) investmentCanBeShown = _taxParameter.MaxInvAmount; if (investmentCanBeShown > _taxParameter.MaxInvAmount) investmentCanBeShown = _taxParameter.MaxInvAmount;
@ -1987,7 +1995,7 @@ namespace HRM.DA
} }
if (_isActualInvestment == true) if (_isActualInvestment == true)
{ {
IncomeTax ActualInvestment = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax ActualInvestment = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Investment_Actual && x.ItemID == (int)EnumIncomeTaxItemGroup.Investment_Actual); x.ItemGroup == EnumIncomeTaxItemGroup.Investment_Actual && x.ItemID == (int)EnumIncomeTaxItemGroup.Investment_Actual);
investAmount = ActualInvestment.ThisMonthAmount; investAmount = ActualInvestment.ThisMonthAmount;
} }
@ -2009,7 +2017,7 @@ namespace HRM.DA
// (int)EnumIncomeTaxItemGroup.Cmp_Provided_car); // (int)EnumIncomeTaxItemGroup.Cmp_Provided_car);
this.CalculateTotalIncome(); this.CalculateTotalIncome();
IncomeTax IncomeWithCar = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID IncomeTax IncomeWithCar = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Annual_Salary_Income && x.ItemID == (int)EnumIncomeTaxItemGroup.Annual_Salary_Income); && x.ItemGroup == EnumIncomeTaxItemGroup.Annual_Salary_Income && x.ItemID == (int)EnumIncomeTaxItemGroup.Annual_Salary_Income);
double dif = 0; double dif = 0;
@ -2044,13 +2052,13 @@ namespace HRM.DA
{ {
double nAmount = 0; double nAmount = 0;
double nTaxAmount = 0; double nTaxAmount = 0;
IncomeTax TaxDeductitem = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID && IncomeTax TaxDeductitem = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID &&
x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted); x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted);
if (TaxDeductitem == null) TaxDeductitem = this.Add(EnumIncomeTaxItemGroup.Tax_Deducted, if (TaxDeductitem == null) TaxDeductitem = this.Add(EnumIncomeTaxItemGroup.Tax_Deducted,
(int)EnumIncomeTaxItemGroup.Tax_Deducted, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item); (int)EnumIncomeTaxItemGroup.Tax_Deducted, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item);
IncomeTax onetTax = _currentYearTax.FirstOrDefault(x=>x.EmployeeID == _employee.ID IncomeTax onetTax = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Net_Payable && x.ItemID == (int)EnumIncomeTaxItemGroup.Net_Payable); && x.ItemGroup == EnumIncomeTaxItemGroup.Net_Payable && x.ItemID == (int)EnumIncomeTaxItemGroup.Net_Payable);
if (onetTax != null) if (onetTax != null)
@ -2095,7 +2103,7 @@ namespace HRM.DA
} }
public class TaxCalculator : AbstractTaxCalculator public class TaxCalculator : AbstractTaxCalculator
{ {
public TaxCalculator(int taxparamid, int payrolltypeid):base(taxparamid, payrolltypeid) public TaxCalculator(int taxparamid, int payrolltypeid) : base(taxparamid, payrolltypeid)
{ {
} }
@ -2116,7 +2124,7 @@ namespace HRM.DA
set set
{ {
if (_taxParameter == null) throw new ServiceException("Taxparameter must set before Employee"); if (_taxParameter == null) throw new ServiceException("Taxparameter must set before Employee");
_taxSlabs = new TaxParameterService().GetEmployeeSlab( payrolltype, _taxSlabs = new TaxParameterService().GetEmployeeSlab(payrolltype,
_taxParameter, value); _taxParameter, value);
TaxParameter.SetMinimumTax(value, _taxParameter); TaxParameter.SetMinimumTax(value, _taxParameter);
@ -2196,7 +2204,7 @@ namespace HRM.DA
if (this.payrolltype.TaxParamID == nTaxParamterID) if (this.payrolltype.TaxParamID == nTaxParamterID)
oTaxYearly = new IncomeTaxService().GetByYear(nTaxParamterID, EnumIncomeTaxDataFrom.ProcessTempData, this.payrolltype.ID); oTaxYearly = new IncomeTaxService().GetByYear(nTaxParamterID, EnumIncomeTaxDataFrom.ProcessTempData, this.payrolltype.ID);
else else
oTaxYearly = new IncomeTaxService().GetPrvYear(nTaxParamterID,payrolltype.ID); oTaxYearly = new IncomeTaxService().GetPrvYear(nTaxParamterID, payrolltype.ID);
int? nCurrEmployeeid = null; int? nCurrEmployeeid = null;
if (oTaxYearly.Count > 0) nCurrEmployeeid = oTaxYearly[0].EmployeeID; if (oTaxYearly.Count > 0) nCurrEmployeeid = oTaxYearly[0].EmployeeID;
_taxParameter = new TaxParameterService().Get((int)nTaxParamterID); _taxParameter = new TaxParameterService().Get((int)nTaxParamterID);
@ -2205,10 +2213,10 @@ namespace HRM.DA
while (true) while (true)
{ {
_employee = oemps.FirstOrDefault(x => x.ID == nCurrEmployeeid); _employee = oemps.FirstOrDefault(x => x.ID == nCurrEmployeeid);
if(_employee == null) _employee = new EmployeeService().Get((int)nCurrEmployeeid); if (_employee == null) _employee = new EmployeeService().Get((int)nCurrEmployeeid);
_isActualInvestment = true; _isActualInvestment = true;
this.CurrentYearTax = oTaxYearly.FindAll(x=>x.EmployeeID == nCurrEmployeeid); this.CurrentYearTax = oTaxYearly.FindAll(x => x.EmployeeID == nCurrEmployeeid);
// Initialize the current data. // Initialize the current data.
foreach (IncomeTax item in this.CurrentYearTax) foreach (IncomeTax item in this.CurrentYearTax)
oTaxYearly.Remove(item); // Remove from collection oTaxYearly.Remove(item); // Remove from collection
@ -2400,7 +2408,7 @@ namespace HRM.DA
if (item.EmployeeID == _employee.ID) if (item.EmployeeID == _employee.ID)
this.CurrentYearTax.Add(item); this.CurrentYearTax.Add(item);
} }
if (this.payrolltype.NextPayProcessDate.Month == 7 && this.CurrentYearTax.Count ==0) // if month is july and salary not yet processed then, clear all tax data if (this.payrolltype.NextPayProcessDate.Month == 7 && this.CurrentYearTax.Count == 0) // if month is july and salary not yet processed then, clear all tax data
{ {
bStartMonth = true; bStartMonth = true;
_projectedMonth = 12; _projectedMonth = 12;
@ -2459,7 +2467,7 @@ namespace HRM.DA
double newGross = this.GetTaxAmount(annualIncome - _onceoffAmount); double newGross = this.GetTaxAmount(annualIncome - _onceoffAmount);
ntaxAmount = newGross - CalculateOnceOfInvestmentAmt(annualIncome - _onceoffAmount); ntaxAmount = newGross - CalculateOnceOfInvestmentAmt(annualIncome - _onceoffAmount);
if (newGross >0 && ntaxAmount < _taxParameter.MinTaxAmount) if (newGross > 0 && ntaxAmount < _taxParameter.MinTaxAmount)
ntaxAmount = _taxParameter.MinTaxAmount; ntaxAmount = _taxParameter.MinTaxAmount;
ntaxAmount = ntaxAmount + this.GetTaxRebate(); ntaxAmount = ntaxAmount + this.GetTaxRebate();
@ -2490,7 +2498,7 @@ namespace HRM.DA
ntaxAmount = GlobalFunctions.Round(ntaxAmount); ntaxAmount = GlobalFunctions.Round(ntaxAmount);
} }
if(ntaxAmount> this._onceoffAmount) // if tax amount greater than bonus amount if (ntaxAmount > this._onceoffAmount) // if tax amount greater than bonus amount
{ {
ntaxAmount = this._onceoffAmount; ntaxAmount = this._onceoffAmount;
} }
@ -2500,7 +2508,7 @@ namespace HRM.DA
if (TaxDeductitem == null) TaxDeductitem = this.Add(EnumIncomeTaxItemGroup.Tax_Deducted, if (TaxDeductitem == null) TaxDeductitem = this.Add(EnumIncomeTaxItemGroup.Tax_Deducted,
(int)EnumIncomeTaxItemGroup.Tax_Deducted, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item); (int)EnumIncomeTaxItemGroup.Tax_Deducted, string.Empty, 0, 0, EnumIncomeTaxSide.Tax_fixed_Item);
TaxDeductitem.PreviousAmount = TaxDeductitem.PreviousAmount + TaxDeductitem.ThisMonthAmount ; TaxDeductitem.PreviousAmount = TaxDeductitem.PreviousAmount + TaxDeductitem.ThisMonthAmount;
TaxDeductitem.ThisMonthAmount = ntaxAmount; TaxDeductitem.ThisMonthAmount = ntaxAmount;
@ -2702,7 +2710,7 @@ namespace HRM.DA
&& x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted); && x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted && x.ItemID == (int)EnumIncomeTaxItemGroup.Tax_Deducted);
IncomeTax netPayable = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID IncomeTax netPayable = _currentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Net_Payable && x.ItemID == (int)EnumIncomeTaxItemGroup.Net_Payable); && x.ItemGroup == EnumIncomeTaxItemGroup.Net_Payable && x.ItemID == (int)EnumIncomeTaxItemGroup.Net_Payable);
if(TaxDeductitem != null) if (TaxDeductitem != null)
TaxDeductitem.ThisMonthAmount = netPayable.TotalAmount - TaxDeductitem.TotalAmount; TaxDeductitem.ThisMonthAmount = netPayable.TotalAmount - TaxDeductitem.TotalAmount;
return this.CurrentYearTax; return this.CurrentYearTax;
} }
@ -2812,7 +2820,7 @@ namespace HRM.DA
{ {
// if IncomeTax.get() function not return employee order-by wise data, rest of the function will not culculate properly. // if IncomeTax.get() function not return employee order-by wise data, rest of the function will not culculate properly.
List<IncomeTax> oTaxYearly = new IncomeTaxService().Get(EnumIncomeTaxDataFrom.ProcessTempData, ptyp.ID); List<IncomeTax> oTaxYearly = new IncomeTaxService().Get(EnumIncomeTaxDataFrom.ProcessTempData, ptyp.ID);
oTaxYearly = oTaxYearly.OrderBy(x=>x.EmployeeID).ToList(); oTaxYearly = oTaxYearly.OrderBy(x => x.EmployeeID).ToList();
int? nCurrEmployeeid = null; int? nCurrEmployeeid = null;
if (oTaxYearly.Count > 0) nCurrEmployeeid = oTaxYearly[0].EmployeeID; if (oTaxYearly.Count > 0) nCurrEmployeeid = oTaxYearly[0].EmployeeID;
_taxParameter = new TaxParameterService().Get((int)ptyp.TaxParamID); _taxParameter = new TaxParameterService().Get((int)ptyp.TaxParamID);
@ -3192,7 +3200,7 @@ namespace HRM.DA
List<SalaryMonthly> empsalareis = salareis.FindAll(x => x.EmployeeID == employeeid).ToList(); List<SalaryMonthly> empsalareis = salareis.FindAll(x => x.EmployeeID == employeeid).ToList();
if (empsalareis != null) if (empsalareis != null)
{ {
foreach(var salary in empsalareis) foreach (var salary in empsalareis)
{ {
foreach (var salaryDetail in salary.Details) foreach (var salaryDetail in salary.Details)
{ {
@ -3363,11 +3371,11 @@ namespace HRM.DA
} }
this.CurrentYearTax =oTaxYearly.FindAll(x=>x.EmployeeID== _employee.ID); this.CurrentYearTax = oTaxYearly.FindAll(x => x.EmployeeID == _employee.ID);
#region Calculate From Salary & Bonus #region Calculate From Salary & Bonus
double basicSalary = 0; double basicSalary = 0;
IncomeTax HrExption = this.CurrentYearTax.FirstOrDefault(x=>x.EmployeeID== _employee.ID IncomeTax HrExption = this.CurrentYearTax.FirstOrDefault(x => x.EmployeeID == _employee.ID
&& x.ItemGroup == EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance && x.ItemGroup == EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance
&& x.ItemID == (int)EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance); && x.ItemID == (int)EnumIncomeTaxItemGroup.Exemption_House_Rent_Allowance);
@ -3858,7 +3866,7 @@ namespace HRM.DA
List<TaxMergeMaster> taxMerges = new TaxMergeMasterService().GetbyTaxParameter(_taxParameter.ID, payrolltypeid); List<TaxMergeMaster> taxMerges = new TaxMergeMasterService().GetbyTaxParameter(_taxParameter.ID, payrolltypeid);
var taxdeductedItem = taxMerges.FirstOrDefault(x => x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted); var taxdeductedItem = taxMerges.FirstOrDefault(x => x.ItemGroup == EnumIncomeTaxItemGroup.Tax_Deducted);
if(taxdeductedItem == null) if (taxdeductedItem == null)
{ {
TaxMergeMaster taxMerge = new TaxMergeMaster TaxMergeMaster taxMerge = new TaxMergeMaster
{ {

View File

@ -1,4 +1,4 @@
import { EnumPeriodicity, EnumAllowOrDeduct, EnumArrearType, EnumADEmpType, EnumValueType, EnumEntitleType, EnumGender, EnumAuthStatus } from "../enums"; import { EnumPeriodicity, EnumAllowOrDeduct, EnumArrearType, EnumADEmpType, EnumValueType, EnumEntitleType, EnumGender, EnumAuthStatus, EnumAllowanceType } from "../enums";
import { BaseObject } from '../Basic/baseObject'; import { BaseObject } from '../Basic/baseObject';
import { AllowanceDeduction } from '../../_models/HRBasic/allowanceDeduction'; import { AllowanceDeduction } from '../../_models/HRBasic/allowanceDeduction';
import { SearchEmployee } from '../../_models/Employee/searchEmployee'; import { SearchEmployee } from '../../_models/Employee/searchEmployee';
@ -42,6 +42,8 @@ export class ADParameter extends BaseObject
this.gradeNames=''; this.gradeNames='';
this.adParameterEmployees = []; this.adParameterEmployees = [];
this.calculatedAmount = 0; this.calculatedAmount = 0;
this.allowanceType=EnumAllowanceType.None;
this.isOnBalancing = false;
} }
allowDeductID: number; allowDeductID: number;
allowDeductName: string; allowDeductName: string;
@ -71,6 +73,8 @@ export class ADParameter extends BaseObject
entitleType: EnumEntitleType; entitleType: EnumEntitleType;
allowOrDeductType: EnumAllowOrDeduct; allowOrDeductType: EnumAllowOrDeduct;
gender: EnumGender; gender: EnumGender;
allowanceType: EnumAllowanceType;
isOnBalancing: boolean;
// public AllowanceDeduction AllowanceDeduction { get; set; } // public AllowanceDeduction AllowanceDeduction { get; set; }
exception: ADParameterEmployee[] =[]; exception: ADParameterEmployee[] =[];

View File

@ -1427,6 +1427,14 @@ export enum EnumEntitleType {
Individual = 2, Individual = 2,
} }
export enum EnumAllowanceType
{
None = 0,
HouseRent = 1,
Medical = 2,
Conveynce = 3
}
export enum EnumOpiAvgPayType { export enum EnumOpiAvgPayType {
NONE = 0, NONE = 0,
OT = 1, OT = 1,

View File

@ -29,6 +29,11 @@
{{dataItem.isTaxable ? 'Yes' : 'No'}} {{dataItem.isTaxable ? 'Yes' : 'No'}}
</ng-template> </ng-template>
</kendo-grid-column> </kendo-grid-column>
<kendo-grid-column field="isOnBalancing" title="On Balancing ?" [width]="10">
<ng-template kendoGridCellTemplate let-dataItem>
{{dataItem.isOnBalancing ? 'Yes' : 'No'}}
</ng-template>
</kendo-grid-column>
<kendo-grid-command-column title="Active" [width]="10"> <kendo-grid-command-column title="Active" [width]="10">
<ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex"> <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
<button themeColor="primary" kendoButton (click)="DoActiveInActive(rowIndex)" >{{dataItem.isCurrentlyActive ==true ? 'In-Active' : 'Active' }}</button> <button themeColor="primary" kendoButton (click)="DoActiveInActive(rowIndex)" >{{dataItem.isCurrentlyActive ==true ? 'In-Active' : 'Active' }}</button>

View File

@ -73,6 +73,28 @@
</kendo-dropdownlist> </kendo-dropdownlist>
</div> </div>
</div> </div>
<div class="adp-field">
<label class="adp-label" for="ddlAllowanceType">Allowance Type <span class="adp-required">*</span></label>
<div class="adp-control">
<kendo-dropdownlist
class="form-control form-control-sm input-sm"
style="width: 100%"
id="ddlAllowanceType"
[data]="_allowanceTpe"
[defaultItem]="{
name: 'Select Allowance Type',
value: null
}"
[textField]="'name'"
[valueField]="'value'"
[valuePrimitive]="true"
formControlName="allowancetype"
[(ngModel)]="_selectedAllowanceType"
(selectionChange)="changeallowancetype($event)"
>
</kendo-dropdownlist>
</div>
</div>
<div class="checkBoxGrid adp-checks"> <div class="checkBoxGrid adp-checks">
<label class="k-form-field right adp-check"> <label class="k-form-field right adp-check">
<input <input
@ -110,6 +132,15 @@
kendoCheckBox/> kendoCheckBox/>
<label class="k-checkbox-label" for="enabletaxableCheck">Taxable</label> <label class="k-checkbox-label" for="enabletaxableCheck">Taxable</label>
</label> </label>
<label class="k-form-field right adp-check">
<input
type="checkbox"
formControlName="isOnBalancing"
id="enableOnBalancingCheck"
[(ngModel)]="_adPram.isOnBalancing"
kendoCheckBox/>
<label class="k-checkbox-label" for="enableOnBalancingCheck">On Balancing</label>
</label>
</div> </div>
</div> </div>

View File

@ -11,7 +11,7 @@ import {UntilityHandlerService} from '../../../../utility.hanldler.service';
import {ADParameter, ADParameterGrade, ADParameterEmployee} from '../../../../_models/Payroll/adparameter'; import {ADParameter, ADParameterGrade, ADParameterEmployee} from '../../../../_models/Payroll/adparameter';
import {AllowanceDeduction} from '../../../../_models/HRBasic/allowanceDeduction'; import {AllowanceDeduction} from '../../../../_models/HRBasic/allowanceDeduction';
import {Grade} from '../../../../_models/Basic/grade'; import {Grade} from '../../../../_models/Basic/grade';
import {EnumArrearType, EnumADEmpType, EnumExtension, EnumPeriodicity, EnumGender, EnumEntitleType, EnumAllowOrDeduct, EnumValueType, EnumAuthStatus} from '../../../../_models/enums'; import {EnumArrearType, EnumADEmpType, EnumExtension, EnumPeriodicity, EnumGender, EnumEntitleType, EnumAllowOrDeduct, EnumValueType, EnumAuthStatus, EnumAllowanceType} from '../../../../_models/enums';
import { AuthService } from '../../../../_services/auth/auth.service'; import { AuthService } from '../../../../_services/auth/auth.service';
import { PayrollType } from '../../../../_models/Authentication/payrollType'; import { PayrollType } from '../../../../_models/Authentication/payrollType';
import { Router } from '@angular/router'; import { Router } from '@angular/router';
@ -45,8 +45,16 @@ export class AllowanceDeductionParameterizationEntryComponent implements OnInit,
{ name: 'Monthly-Employee-Wise', value: 3 }, { name: 'Monthly-Employee-Wise', value: 3 },
{ name: 'Once-off', value: 2 }, { name: 'Once-off', value: 2 },
];
_allowanceTpe = [
{ name: 'None', value: 0},
{ name: 'HouseRent', value: 1 },
{ name: 'Medical', value: 2 },
{ name: 'Conveynce', value: 3 },
]; ];
_selectedPeriodicity: number =1; _selectedPeriodicity: number =1;
_selectedAllowanceType: number =0;
_gender: any = EnumExtension.getNamesAndValues(EnumGender); _gender: any = EnumExtension.getNamesAndValues(EnumGender);
_selectedPreiodicity: number; _selectedPreiodicity: number;
_individualAmount: number=0; _individualAmount: number=0;
@ -117,6 +125,7 @@ export class AllowanceDeductionParameterizationEntryComponent implements OnInit,
}, },
() => { () => {
this.AllowDeductselectionChange(this._allowDeducts.find(x => x.id == this._adPram.allowDeductID)); this.AllowDeductselectionChange(this._allowDeducts.find(x => x.id == this._adPram.allowDeductID));
this._selectedAllowanceType = this._adPram.allowanceType ?? EnumAllowanceType.None;
if (this._adPram.periodicity == EnumPeriodicity.Monthly && if (this._adPram.periodicity == EnumPeriodicity.Monthly &&
this._adPram.entitleType == EnumEntitleType.Grade) { this._adPram.entitleType == EnumEntitleType.Grade) {
@ -142,6 +151,7 @@ export class AllowanceDeductionParameterizationEntryComponent implements OnInit,
this._fromValidator = new FormBuilder().group({ this._fromValidator = new FormBuilder().group({
allowOrDeductID: ['', Validators.required], allowOrDeductID: ['', Validators.required],
periodicity: ['', Validators.required], periodicity: ['', Validators.required],
allowancetype: ['', Validators.required],
isIndividual: '', isIndividual: '',
flatAmount: '', flatAmount: '',
percentOfBasic: '', percentOfBasic: '',
@ -153,6 +163,7 @@ export class AllowanceDeductionParameterizationEntryComponent implements OnInit,
isFractionateApplicable: '', isFractionateApplicable: '',
gender: '', gender: '',
isTaxable: '', isTaxable: '',
isOnBalancing: '',
}); });
} }
@ -203,6 +214,23 @@ export class AllowanceDeductionParameterizationEntryComponent implements OnInit,
this.prediocityPopulate(2); this.prediocityPopulate(2);
} }
}
changeallowancetype(item:any) {
if (item.value == 0) {
this._adPram.allowanceType = EnumAllowanceType.None;
}
else if (item.value == 1) {
this._adPram.allowanceType = EnumAllowanceType.HouseRent;
}
else if (item.value == 2) {
this._adPram.allowanceType = EnumAllowanceType.Medical;
}
else if (item.value == 3) {
this._adPram.allowanceType = EnumAllowanceType.Conveynce;
}
} }
IndividualChecked(e) { IndividualChecked(e) {

View File

@ -52,8 +52,8 @@
//"Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDB;User Id=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", //"Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDB;User Id=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;",
//"SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=autocrop;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", // Development //"SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=autocrop;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", // Development
"Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDBBRAC;User Id= DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;", "Default": "provider=sql;sqlSyntax=SQL;server=103.197.204.164,1718;Database=MasterProjectDBUATBRAC;User Id= DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;",
"SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=MasterProjectDBBRAC;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;" // Development "SqlCommandConnection": "Data Source=103.197.204.164,1718;Initial Catalog=MasterProjectDBUATBRAC;Persist Security Info=True; User ID=DBuser;Password=ceLEa&e2025;TrustServerCertificate=True;" // Development
}, },
"Calendar": { "Calendar": {