Merge branch 'master' into Main

This commit is contained in:
MahanCh
2025-08-23 11:55:57 +03:30
9 changed files with 89 additions and 32 deletions

View File

@@ -135,6 +135,11 @@ public class CreateCheckout
/// </summary>
public string TotalDayOfBunosesCompute { get; set; }
/// <summary>
/// ساعت موظفی پرسنل برای این ماه
/// </summary>
public TimeSpan EmployeeMandatoryHours { get; set; }
public bool HolidayWorking { get; set; }
public string ShiftWork { get; set; }

View File

@@ -56,5 +56,10 @@ public class ComputingViewModel
public TimeSpan TotalPaidLeave { get; set; }
public TimeSpan TotalSickLeave { get; set; }
/// <summary>
/// ساعت موظفی پرسنل برای این ماه
/// </summary>
public TimeSpan EmployeeMandatoryHours { get; set; }
//public List<string> holidays;
}

View File

@@ -171,7 +171,8 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
};
}
public async Task<OperationResult<ClientFinancialStatementViewModel>> GetDetailsByPublicId(string publicId)
{
var op = new OperationResult<ClientFinancialStatementViewModel>();
@@ -186,7 +187,8 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
{
return op.Failed("شناسه ارسال شده نامعتبر است");
}
double balance = 0;
var res = new ClientFinancialStatementViewModel()
{
Id = financialStatement.id,
@@ -194,17 +196,30 @@ public class FinancialStatmentRepository : RepositoryBase<long, FinancialStatmen
TotalCredit = financialStatement.FinancialTransactionList.Sum(x => x.Creditor),
TotalDebt = financialStatement.FinancialTransactionList.Sum(x => x.Deptor),
ContractingPartyName = financialStatement.ContractingPartyName,
Transactions = financialStatement.FinancialTransactionList.Select(t => new FinancialTransactionDetailViewModel()
Transactions = financialStatement.FinancialTransactionList.Select(t =>
{
DateTimeGr = t.TdateGr,
DateFa = t.TdateGr.ToFarsi(),
TimeFa = $"{t.TdateGr:HH:mm}",
Description = t.DescriptionOption + " " + t.Description,
Debtor = t.Deptor,
Creditor = t.Creditor,
Balance = t.Balance,
Type = t.TypeOfTransaction == "debt" ? FinancialTransactionType.Debt : FinancialTransactionType.Credit,
TypeStr = t.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد"
if (t.TypeOfTransaction == "debt")
{
balance += t.Deptor;
}
else
{
balance -= t.Creditor;
}
return new FinancialTransactionDetailViewModel()
{
DateTimeGr = t.TdateGr,
DateFa = t.TdateGr.ToFarsi(),
TimeFa = $"{t.TdateGr:HH:mm}",
Description = t.DescriptionOption + " " + t.Description,
Debtor = t.Deptor,
Creditor = t.Creditor,
Balance = balance,
Type = t.TypeOfTransaction == "debt"
? FinancialTransactionType.Debt
: FinancialTransactionType.Credit,
TypeStr = t.TypeOfTransaction == "debt" ? "ایجاد درآمد" : "دریافت درآمد"
};
}).OrderByDescending(t => t.DateTimeGr).ToList(),
};
return op.Succcedded(res);

View File

@@ -910,24 +910,30 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
var workshop = _context.Workshops.FirstOrDefault(x => x.id == rollCallService.WorkshopId);
string description = "";
if (rollCallService.StartService <= prevMonthStart)
{
var monthPrev = prevMonthEnd.ToFarsi().Substring(5, 2);
var yearPrev = prevMonthEnd.ToFarsi().Substring(0, 4);
var prevMonthName = monthPrev.ToFarsiMonthByNumber();
description =
$"{prevMonthName} و {currentMonthName} {yearCurrent} - {workshop.WorkshopFullName}";
monthCounter = 2;
}
else if (rollCallService.StartService <= currentMonthStart &&
rollCallService.StartService > prevMonthStart)
//if (rollCallService.StartService <= prevMonthStart)
//{
// var monthPrev = prevMonthEnd.ToFarsi().Substring(5, 2);
// var yearPrev = prevMonthEnd.ToFarsi().Substring(0, 4);
// var prevMonthName = monthPrev.ToFarsiMonthByNumber();
// description =
// $"{prevMonthName} و {currentMonthName} {yearCurrent} - {workshop.WorkshopFullName}";
// monthCounter = 2;
//}
//else if (rollCallService.StartService <= currentMonthStart &&
// rollCallService.StartService > prevMonthStart)
//{
// monthCounter = 1;
// description = $"{currentMonthName} {yearCurrent} - {workshop.WorkshopFullName}";
//}
if (rollCallService.StartService <= currentMonthStart)
{
monthCounter = 1;
description = $"{currentMonthName} {yearCurrent} - {workshop.WorkshopFullName}";
}
var employees =
_context.RollCallEmployees.Where(x => x.WorkshopId == rollCallService.WorkshopId)
.Select(x => x.id);
@@ -966,9 +972,14 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
var tenPercent = amountWithoutTax * 10 / 100;
var totalAmonut = amountWithoutTax + tenPercent;
double roundFloor = Math.Floor(totalAmonut);
double result = Math.Ceiling(roundFloor / 10000.0) * 10000;
Console.WriteLine(counter + " - " + rollCallService.StartService.ToFarsi() + " - " +
rollCallService.WorkshopId + " - " + monthCounter + " - " + employeeCount +
$" - {amountWithoutTax}");
rollCallService.WorkshopId + " - " + employeeCount +
$" - {totalAmonut} - round {result}");
var financialStatment =
_context.FinancialStatments.FirstOrDefault(x =>
@@ -989,7 +1000,7 @@ public class InstitutionContractRepository : RepositoryBase<long, InstitutionCon
var transaction = new FinancialTransaction(financialStatementId, endOfMonthGr, endOfMonth,
description,
"debt", "بابت سرویس حضور غیاب", totalAmonut, 0, 0);
"debt", "بابت سرویس حضور غیاب", result, 0, 0);
_context.FinancialTransactions.Add(transaction);
_context.SaveChanges();

View File

@@ -103,6 +103,13 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
//This Time Mandatory Hourse
double mandatoryHours = Math.Round((mandatorDays * 7.33), 2);
//تبدیل عدد زیاضی موظفی به تایم اسپن
int hoursConverted = (int)mandatoryHours;
double minutesDecimalConverted = (mandatoryHours - hoursConverted) * 60;
int minutesConverted = (int)minutesDecimalConverted;
TimeSpan mandatoryHoursTimeSpan = new TimeSpan(hoursConverted, minutesConverted, 0);
//گرفتن ساعت استراحت پرسنل از تنظیمات
#region breakTime
BaseCustomizeEntity settings = _context.CustomizeWorkshopEmployeeSettings.AsSplitQuery()
@@ -443,7 +450,7 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
//TimeSpan mandatoryHoursTimeSpan = new TimeSpan(7, 20, 0).Multiply(mandatorDays);
//TimeSpan Mandatory = sumSpansWhitOutleaves.Subtract(mandatoryHoursTimeSpan);
double mandatoryWorkWithOutleaves = (sumSpansWhitOutleaves.TotalMinutes) / 60;
double mandatoryWorkWithOutleaves = (sumSpans.TotalMinutes) / 60;
double overTimeWork = 0;
if (mandatoryWorkWithOutleaves > mandatoryHours)
{
@@ -881,6 +888,9 @@ public class RollCallMandatoryRepository : RepositoryBase<long, RollCall>, IRoll
TotalPaidLeave = totalLeaveSpan,
//مرخصی استعلاجی
TotalSickLeave = new TimeSpan(sickLeaveTimeSpans.Sum(x => x.Ticks)),
//ساعت موظفی پرسنل در این ماه
EmployeeMandatoryHours = mandatoryHoursTimeSpan,
#endregion
};

View File

@@ -1041,6 +1041,9 @@ public class IndexModel : PageModel
//لیست حضورغیاب جهت ذخیره سازی
GroupedRollCalls = mandatoryCompute.GroupedRollCalls,
// ساعت موظفی پرسنل برای این ماه
EmployeeMandatoryHours = mandatoryCompute.EmployeeMandatoryHours,
HasInsuranceChekoutOverTime = workshop.InsuranceCheckoutOvertime
};

View File

@@ -687,9 +687,16 @@ namespace ServiceHost.Areas.Client.Pages
var allServices = _rollCallServiceApplication.GetAllServiceByWorkshopId(workshopId);
var hasPreviousService = allServices.Any();
var activeService = _rollCallServiceApplication.GetActiveServiceByWorkshopId(workshopId);
var hasRollCallService = activeService != null;
bool hasCustomizeCheckout = false;
if (hasRollCallService)
hasCustomizeCheckout = activeService.HasCustomizeCheckoutService == "true" ? true : false;
bool hasCameraAccount;
if (hasRollCallService)
{
@@ -707,7 +714,8 @@ namespace ServiceHost.Areas.Client.Pages
{
hasRollCallWorkshopSetting,
hasCameraAccount,
hasRollCallService
hasRollCallService,
hasCustomizeCheckout
});
}

View File

@@ -11,7 +11,7 @@
},
"ServiceHost": {
"commandName": "Project",
"launchBrowser": false,
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"

View File

@@ -12,7 +12,7 @@
//"MesbahDb": "Data Source=DESKTOP-NUE119G\\MSNEW;Initial Catalog=Mesbah_db;Integrated Security=True"
//server
"MesbahDbServer": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
//"MesbahDbServer": "Data Source=171.22.24.15;Initial Catalog=mesbah_db;Persist Security Info=False;User ID=ir_db;Password=R2rNp[170]18[3019]#@ATt;TrustServerCertificate=true;",
//local
@@ -35,7 +35,7 @@
"ApiKey": "Og5M562igmzJRhQPnq0GdtieYdLgtfikjzxOmeQBPxJjZtyge5Klc046Lfw1mxSa",
"SecretKey": "dadmehr"
},
"Domain": ".dadmehrg.ir"
"Domain": ".gozareshgir.ir"
}