RollCallMandatory : Day of Madatory Fixed Bug
This commit is contained in:
@@ -165,8 +165,8 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
double mandatoryHours = Math.Round((mandatorDays * 7.33), 2);
|
||||
//***********************************//
|
||||
var dailyFix = TimeSpan.Parse("07:20");
|
||||
dailyFix = dailyFix.Multiply(mandatorDays);
|
||||
TimeSpan Mandatory = sumSpans.Subtract(dailyFix);
|
||||
TimeSpan mandatoryHoursTimeSpan = new TimeSpan(7,20,0).Multiply(mandatorDays);
|
||||
TimeSpan Mandatory = sumSpans.Subtract(mandatoryHoursTimeSpan);
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -217,30 +217,30 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
|
||||
var totalWeek = (int)(TotalContractDays / 6);
|
||||
|
||||
#region Fix44Compute
|
||||
|
||||
if (totalHourses < mandatoryHours)
|
||||
#region Fix44Compute
|
||||
int TotalContractdaysUnder30 = TotalContractDays > 30 ? 30 : TotalContractDays;
|
||||
if (totalHourses < mandatoryHours)
|
||||
{
|
||||
if (command.ShiftWork == "1" || command.ShiftWork == "2" || command.ShiftWork == "4")
|
||||
{
|
||||
var workedHoursePerDay = totalHourses / mandatorDays;
|
||||
var result = (dayliFeeDouble / 7.33) * workedHoursePerDay;
|
||||
|
||||
|
||||
|
||||
dayliFee = result.ToMoney();
|
||||
|
||||
var HousingAllowonceNumberType = HousingAllowance.MoneyToDouble();
|
||||
var HousingStep1 = HousingAllowonceNumberType / 30;
|
||||
var HousingStep2 = HousingStep1 / 7.33;
|
||||
var HousingStep3 = HousingStep2 * workedHoursePerDay;
|
||||
var HousingStep4 = HousingStep3 * TotalContractDays;
|
||||
var HousingStep4 = HousingStep3 * TotalContractdaysUnder30;
|
||||
HousingAllowance = HousingStep4.ToMoney();
|
||||
|
||||
var ConsumableItemsNumberType = ConsumableItems.MoneyToDouble();
|
||||
var consumableItemsStep1 = ConsumableItemsNumberType / 30;
|
||||
var consumableItemsStep2 = consumableItemsStep1 / 7.33;
|
||||
var consumableItemsStep3 = consumableItemsStep2 * workedHoursePerDay;
|
||||
var consumableItemsStep4 = consumableItemsStep3 * TotalContractDays;
|
||||
var consumableItemsStep4 = consumableItemsStep3 * TotalContractdaysUnder30;
|
||||
ConsumableItems = consumableItemsStep4.ToMoney();
|
||||
|
||||
|
||||
@@ -251,7 +251,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
var MarriedStep1 = MarriedAllowance / 30;
|
||||
var MarriedStep2 = MarriedStep1 / 7.33;
|
||||
var MarriedStep3 = MarriedStep2 * workedHoursePerDay;
|
||||
var MarriedStep4 = MarriedStep3 * TotalContractDays;
|
||||
var MarriedStep4 = MarriedStep3 * TotalContractdaysUnder30;
|
||||
MarriedAllowanceStr = MarriedStep4.ToMoney();
|
||||
}
|
||||
|
||||
@@ -262,7 +262,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
var familyAllowanceStep1 = familyAllowanceNumberType / 30;
|
||||
var familyAllowanceStep2 = familyAllowanceStep1 / 7.33;
|
||||
var familyAllowanceStep3 = familyAllowanceStep2 * workedHoursePerDay;
|
||||
var familyAllowanceStep4 = familyAllowanceStep3 * TotalContractDays;
|
||||
var familyAllowanceStep4 = familyAllowanceStep3 * TotalContractdaysUnder30;
|
||||
familyAllowance = familyAllowanceStep4.ToMoney();
|
||||
}
|
||||
|
||||
@@ -310,26 +310,26 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
var familyAllowanceNumberType = familyAllowance.MoneyToDouble();
|
||||
|
||||
var HousingStep1 = HousingAllowonceNumberType / 30;
|
||||
var HousingStep4 = HousingStep1 * TotalContractDays;
|
||||
var HousingStep4 = HousingStep1 * TotalContractdaysUnder30;
|
||||
HousingAllowance = HousingStep4.ToMoney();
|
||||
|
||||
|
||||
var consumableItemsStep1 = ConsumableItemsNumberType / 30;
|
||||
var consumableItemsStep4 = consumableItemsStep1 * TotalContractDays;
|
||||
var consumableItemsStep4 = consumableItemsStep1 * TotalContractdaysUnder30;
|
||||
ConsumableItems = consumableItemsStep4.ToMoney();
|
||||
|
||||
//حق تاهل
|
||||
if (MarriedAllowance > 0)
|
||||
{
|
||||
var MarriedStep1 = MarriedAllowance / 30;
|
||||
var MarriedStep4 = MarriedStep1 * TotalContractDays;
|
||||
var MarriedStep4 = MarriedStep1 * TotalContractdaysUnder30;
|
||||
MarriedAllowanceStr = MarriedStep4.ToMoney();
|
||||
}
|
||||
|
||||
if (familyAllowance != "0")
|
||||
{
|
||||
var familyAllowanceStep1 = familyAllowanceNumberType / 30;
|
||||
var familyAllowanceStep4 = familyAllowanceStep1 * TotalContractDays;
|
||||
var familyAllowanceStep4 = familyAllowanceStep1 * TotalContractdaysUnder30;
|
||||
familyAllowance = familyAllowanceStep4.ToMoney();
|
||||
}
|
||||
|
||||
@@ -338,11 +338,13 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
|
||||
//اضافه کار
|
||||
if (totalHourses > mandatoryHours)
|
||||
{
|
||||
var mandatoryH = (int)Mandatory.TotalHours;
|
||||
int mandatoryM = (int)(Mandatory.Minutes % 60);
|
||||
Console.WriteLine(Mandatory);
|
||||
Console.WriteLine(Mandatory.Minutes);
|
||||
int mandatoryH = (int)Mandatory.TotalHours;
|
||||
int mandatoryM = (int)(Mandatory.TotalMinutes % 60);
|
||||
overMandatoryHours = mandatoryH.ToString();
|
||||
overMandatoryMinuts = mandatoryM.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user