106 lines
5.0 KiB
C#
106 lines
5.0 KiB
C#
|
|
using Ease.Core.Model;
|
|
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
|
|
|
|
namespace HRM.BO
|
|
{
|
|
public class SalaryException
|
|
{
|
|
#region Define Class Veriable
|
|
|
|
List<AllowanceDeduction> oAllDeducts;
|
|
|
|
#endregion Define Class Veriable
|
|
|
|
//public SalaryException()
|
|
//{
|
|
// oAllDeducts = AllowanceDeduction.Get(EnumStatus.Regardless);
|
|
|
|
//}
|
|
|
|
//public void SalaryExceptionCalculation(SalaryCalculator scalculator)
|
|
//{
|
|
|
|
// //if (SystemInformation.CurrentSysInfo.PayrollTypeID.Integer == (int)EnumBATBBonusType.Management_Corporate)
|
|
// //{
|
|
// // string Acting = ConfigurationManager.GetStringValue("salary", "actingallowance", EnumConfigurationType.Logic);
|
|
// // string[] Actingsplited = Acting.Split(',');
|
|
|
|
// // string forthShift = ConfigurationManager.GetStringValue("salary", "forthshiftallowid", EnumConfigurationType.Logic);
|
|
// // string[] forthShiftsplited = forthShift.Split(',');
|
|
|
|
// // #region Remove
|
|
// // List<ActingResponsibilitySetup> ActingAllow = ActingResponsibilitySetup.Service.GetBySalaryMonth(scalculator._processMonth);
|
|
// // foreach (SalaryMonthly omonthly in scalculator.SalaryMonthlies)
|
|
// // {
|
|
// // foreach (SalaryMonthlyDetail odetail in omonthly.Details)
|
|
// // {
|
|
// // if (Actingsplited.Length != 2)
|
|
// // {
|
|
// // if (odetail.ItemID.ToString() == Actingsplited[0] && odetail.itemGroupCode == EnumSalaryGroup.Gross && odetail.ItemCode == EnumSalaryItemCode.Allowance)
|
|
// // {
|
|
// // odetail.CalculatedAmount = 0;
|
|
// // odetail.ChangedAmount = 0;
|
|
// // }
|
|
// // }
|
|
// // if (forthShiftsplited.Length != 2)
|
|
// // {
|
|
// // if (odetail.ItemID.ToString() == forthShiftsplited[0] && odetail.itemGroupCode == EnumSalaryGroup.Gross && odetail.ItemCode == EnumSalaryItemCode.Allowance)
|
|
// // {
|
|
// // odetail.CalculatedAmount = 0;
|
|
// // odetail.ChangedAmount = 0;
|
|
// // }
|
|
// // }
|
|
// // }
|
|
// // }
|
|
// // #endregion
|
|
|
|
// // #region Acting Allowance
|
|
// // foreach (ActingResponsibilitySetup act in ActingAllow)
|
|
// // {
|
|
// // SalaryMonthly omonthly = scalculator.SalaryMonthlies.FirstOrDefault(x => x.EmployeeID.Integer == act.EmployeeID.Integer);
|
|
// // if (omonthly != null)
|
|
// // {
|
|
// // SalaryMonthlyDetail odetail = omonthly.Details.FirstOrDefault(x => x.ItemID.ToString() == Actingsplited[0] && x.itemGroupCode == EnumSalaryGroup.Gross && x.ItemCode == EnumSalaryItemCode.Allowance);
|
|
// // if (odetail == null)
|
|
// // {
|
|
// // scalculator.AddDetail(omonthly, EnumSalaryGroup.Gross, EnumSalaryItemCode.Allowance, Convert.ToInt32(Actingsplited[0]), Convert.ToInt32(Actingsplited[1]), "Acting Allowance", act.Amount);
|
|
// // }
|
|
// // else odetail.CalculatedAmount = act.Amount;
|
|
// // }
|
|
// // }
|
|
// // #endregion
|
|
|
|
// // #region ForthShif Allowance
|
|
// // List<EmployeeWorkPlanSetup> empWorkPlans = EmployeeWorkPlanSetup.Get(EnumWorkPlanGroup.Counter_Clock_1);
|
|
// // ADParameter oparameter = scalculator.Adparameter.FirstOrDefault(x => x.ID.Integer == Convert.ToInt32(forthShiftsplited[1]));
|
|
// // double Amount = oparameter.FlatAmount;
|
|
// // foreach (EmployeeWorkPlanSetup act in empWorkPlans)
|
|
// // {
|
|
// // SalaryMonthly omonthly = scalculator.SalaryMonthlies.FirstOrDefault(x => x.EmployeeID.Integer == act.EmployeeID.Integer);
|
|
// // if (omonthly != null)
|
|
// // {
|
|
// // SalaryMonthlyDetail odetail = omonthly.Details.FirstOrDefault(x => x.ItemID.ToString() == forthShiftsplited[0] && x.itemGroupCode == EnumSalaryGroup.Gross && x.ItemCode == EnumSalaryItemCode.Allowance);
|
|
// // if (odetail == null)
|
|
// // {
|
|
// // scalculator.AddDetail(omonthly, EnumSalaryGroup.Gross, EnumSalaryItemCode.Allowance, Convert.ToInt32(forthShiftsplited[0]), Convert.ToInt32(forthShiftsplited[1]), "Acting Allowance", Amount);
|
|
// // }
|
|
// // else odetail.CalculatedAmount = Amount;
|
|
// // }
|
|
// // }
|
|
|
|
// // #endregion
|
|
|
|
// //}
|
|
//}
|
|
|
|
}
|
|
|
|
|
|
}
|