This commit is contained in:
mmrbnjd
2024-06-20 19:10:38 +03:30
parent 309fac81d3
commit b733836224

View File

@@ -299,10 +299,10 @@ namespace Back.Services
for (int i = -7; i < 1; i++) for (int i = -7; i < 1; i++)
dt.Add(DateTime.Now.AddDays(i).ConvertMiladiToShamsi()); dt.Add(DateTime.Now.AddDays(i).ConvertMiladiToShamsi());
request.MostInvoicedProduct = await _invoiceitemRepo.Get(w => w.invoice.CompanyID == user.RolUsers.First().CompanyID request.MostInvoicedProduct = await _invoiceitemRepo.Get(w => w.invoice.CompanyID == user.RolUsers.First().CompanyID && !w.invoice.IsDeleted
&& (w.invoice.invoiceType == InvoiceType.Sale || w.invoice.invoiceType == InvoiceType.BackFrmSale && (w.invoice.invoiceType == InvoiceType.Sale || w.invoice.invoiceType == InvoiceType.BackFrmSale
|| w.invoice.invoiceType == InvoiceType.Repair) && !w.invoice.BillReference.HasValue || w.invoice.invoiceType == InvoiceType.Repair) && !w.invoice.BillReference.HasValue
&& (dt.Contains(w.invoice.Cdate))) && (dt.Contains(w.invoice.InvoiceDate)))
.Include(inc => inc.cODItem) .Include(inc => inc.cODItem)
.GroupBy(g => g.CODID) .GroupBy(g => g.CODID)
.Select(s => new IdNameByCount<int> .Select(s => new IdNameByCount<int>
@@ -313,10 +313,10 @@ namespace Back.Services
}).OrderByDescending(o => o.count) }).OrderByDescending(o => o.count)
.ToListAsync(); .ToListAsync();
request.MostInvoicedCustomer =await _RepoInvoice.Get(w => w.CompanyID == user.RolUsers.First().CompanyID request.MostInvoicedCustomer =await _RepoInvoice.Get(w => w.CompanyID == user.RolUsers.First().CompanyID && !w.IsDeleted
&& (w.invoiceType == InvoiceType.Sale || w.invoiceType == InvoiceType.BackFrmSale && (w.invoiceType == InvoiceType.Sale || w.invoiceType == InvoiceType.BackFrmSale
|| w.invoiceType == InvoiceType.Repair) && !w.BillReference.HasValue || w.invoiceType == InvoiceType.Repair) && !w.BillReference.HasValue
&& (dt.Contains(w.Cdate))) && (dt.Contains(w.InvoiceDate)))
.Include(inc => inc.Customer) .Include(inc => inc.Customer)
.GroupBy(g => g.CustomerID) .GroupBy(g => g.CustomerID)
.Select(s => new IdNameByCount<int> .Select(s => new IdNameByCount<int>
@@ -330,9 +330,9 @@ namespace Back.Services
var cdate = DateTime.Now.ConvertMiladiToShamsiAndGetYearMonth(); var cdate = DateTime.Now.ConvertMiladiToShamsiAndGetYearMonth();
var sale = await _RepoInvoice.Get(w => w.CompanyID == user.RolUsers.First().CompanyID var sale = await _RepoInvoice.Get(w => w.CompanyID == user.RolUsers.First().CompanyID && !w.IsDeleted
&& (w.invoiceType == InvoiceType.Sale || w.invoiceType == InvoiceType.BackFrmSale && (w.invoiceType == InvoiceType.Sale || w.invoiceType == InvoiceType.BackFrmSale
|| w.invoiceType == InvoiceType.Repair) && !w.BillReference.HasValue && w.Cdate.StartsWith(cdate)) || w.invoiceType == InvoiceType.Repair) && !w.BillReference.HasValue && w.InvoiceDate.StartsWith(cdate))
.Include(inc => inc.invoiceDetails) .Include(inc => inc.invoiceDetails)
.ThenInclude(inc => inc.cODItem) .ThenInclude(inc => inc.cODItem)
.ThenInclude(inc => inc.CODUnit) .ThenInclude(inc => inc.CODUnit)
@@ -343,9 +343,9 @@ namespace Back.Services
cdate = DateTime.Now.AddMonths(-1).ConvertMiladiToShamsiAndGetYearMonth(); cdate = DateTime.Now.AddMonths(-1).ConvertMiladiToShamsiAndGetYearMonth();
var lastonthsale = await _RepoInvoice.Get(w => w.CompanyID == user.RolUsers.First().CompanyID var lastonthsale = await _RepoInvoice.Get(w => w.CompanyID == user.RolUsers.First().CompanyID && !w.IsDeleted
&& (w.invoiceType == InvoiceType.Sale || w.invoiceType == InvoiceType.BackFrmSale && (w.invoiceType == InvoiceType.Sale || w.invoiceType == InvoiceType.BackFrmSale
|| w.invoiceType == InvoiceType.Repair) && !w.BillReference.HasValue && w.Cdate.StartsWith(cdate)) || w.invoiceType == InvoiceType.Repair) && !w.BillReference.HasValue && w.InvoiceDate.StartsWith(cdate))
.Include(inc => inc.invoiceDetails) .Include(inc => inc.invoiceDetails)
.ThenInclude(inc => inc.cODItem) .ThenInclude(inc => inc.cODItem)
.ThenInclude(inc => inc.CODUnit) .ThenInclude(inc => inc.CODUnit)