...
This commit is contained in:
@@ -43,7 +43,7 @@ namespace Back.Services
|
||||
|
||||
#endregion
|
||||
//-----------------------
|
||||
return await invok.Select(s => new RCOD()
|
||||
return await invok.OrderByDescending(o=>o.ID).Select(s => new RCOD()
|
||||
{
|
||||
ID = s.ID,
|
||||
TaxID = s.ItemTaxID,
|
||||
|
@@ -41,7 +41,9 @@ namespace Back.Services
|
||||
.Include(inc => inc.sentTax)
|
||||
//.Include(inc => inc.payments)
|
||||
.Include(inc => inc.pattern)
|
||||
.ThenInclude(inc => inc.BillType).FirstOrDefaultAsync();
|
||||
.ThenInclude(inc => inc.BillType)
|
||||
|
||||
.FirstOrDefaultAsync();
|
||||
return new InvoiceDTO()
|
||||
{
|
||||
|
||||
@@ -143,6 +145,7 @@ namespace Back.Services
|
||||
.ThenInclude(inc => inc.CODUnit)
|
||||
//.Include(inc => inc.payments)
|
||||
.Include(inc => inc.pattern)
|
||||
.OrderByDescending(o=>o.ID)
|
||||
.Select(s => new InvoiceGridDTO()
|
||||
{
|
||||
|
||||
@@ -229,6 +232,7 @@ namespace Back.Services
|
||||
.Include(inc => inc.Customer)
|
||||
.Include(inc => inc.sentTax)
|
||||
.Include(inc => inc.pattern)
|
||||
.Include(inc => inc.invoice)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
public async Task<bool> DeleteInvoice(Invoice item)
|
||||
|
@@ -304,7 +304,7 @@ namespace Back.Services
|
||||
dt.Add(DateTime.Now.AddDays(i).ConvertMiladiToShamsi());
|
||||
|
||||
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.Repair) && !w.invoice.BillReference.HasValue || (w.invoice.invoiceType == InvoiceType.BackFrmSale))
|
||||
&& (w.invoice.invoiceType == InvoiceType.BackFrmSale || w.invoice.invoiceType == InvoiceType.Repair || (w.invoice.invoiceType == InvoiceType.Sale && !w.invoice.Childinvoice.Any(a => !a.IsDeleted)))
|
||||
&& (dt.Contains(w.invoice.InvoiceDate)))
|
||||
.Include(inc => inc.cODItem)
|
||||
.GroupBy(g => g.CODID)
|
||||
@@ -317,7 +317,7 @@ namespace Back.Services
|
||||
.ToListAsync();
|
||||
|
||||
request.MostInvoicedCustomer = await _RepoInvoice.Get(w => w.CompanyID == user.RolUsers.First().CompanyID && !w.IsDeleted
|
||||
&& ((w.invoiceType == InvoiceType.Sale || w.invoiceType == InvoiceType.Repair) && !w.BillReference.HasValue || (w.invoiceType == InvoiceType.BackFrmSale))
|
||||
&& (w.invoiceType == InvoiceType.BackFrmSale || w.invoiceType == InvoiceType.Repair || (w.invoiceType == InvoiceType.Sale && !w.Childinvoice.Any(a => !a.IsDeleted) ))
|
||||
&& dt.Contains(w.InvoiceDate))
|
||||
.Include(inc => inc.Customer)
|
||||
.GroupBy(g => g.CustomerID)
|
||||
@@ -333,7 +333,7 @@ namespace Back.Services
|
||||
|
||||
|
||||
var sale = await _RepoInvoice.Get(w => w.CompanyID == user.RolUsers.First().CompanyID && !w.IsDeleted
|
||||
&& ((w.invoiceType == InvoiceType.Sale || w.invoiceType == InvoiceType.Repair) && !w.BillReference.HasValue || (w.invoiceType == InvoiceType.BackFrmSale))
|
||||
&& (w.invoiceType == InvoiceType.BackFrmSale || w.invoiceType == InvoiceType.Repair || (w.invoiceType == InvoiceType.Sale && !w.Childinvoice.Any(a => !a.IsDeleted)))
|
||||
&& w.InvoiceDate.StartsWith(cdate))
|
||||
.Include(inc => inc.invoiceDetails)
|
||||
.ThenInclude(inc => inc.cODItem)
|
||||
@@ -346,7 +346,7 @@ namespace Back.Services
|
||||
cdate = DateTime.Now.AddMonths(-1).ConvertMiladiToShamsiAndGetYearMonth();
|
||||
|
||||
var lastonthsale = await _RepoInvoice.Get(w => w.CompanyID == user.RolUsers.First().CompanyID && !w.IsDeleted
|
||||
&& ((w.invoiceType == InvoiceType.Sale || w.invoiceType == InvoiceType.Repair) && !w.BillReference.HasValue || (w.invoiceType == InvoiceType.BackFrmSale))
|
||||
&& (w.invoiceType == InvoiceType.BackFrmSale || w.invoiceType == InvoiceType.Repair || (w.invoiceType == InvoiceType.Sale && !w.Childinvoice.Any(a => !a.IsDeleted)))
|
||||
&& w.InvoiceDate.StartsWith(cdate))
|
||||
.Include(inc => inc.invoiceDetails)
|
||||
.ThenInclude(inc => inc.cODItem)
|
||||
@@ -376,7 +376,7 @@ namespace Back.Services
|
||||
for (int i = 1; i <= Convert.ToInt32(dateTime.Substring(6, 2)); i++)
|
||||
{
|
||||
var sumsale = await _RepoInvoice.Get(w => w.CompanyID == user.RolUsers.First().CompanyID && !w.IsDeleted
|
||||
&& ((w.invoiceType == InvoiceType.Sale || w.invoiceType == InvoiceType.Repair) && !w.BillReference.HasValue || (w.invoiceType == InvoiceType.BackFrmSale))
|
||||
&& (w.invoiceType == InvoiceType.BackFrmSale || w.invoiceType == InvoiceType.Repair || (w.invoiceType == InvoiceType.Sale && !w.Childinvoice.Any(a => !a.IsDeleted)))
|
||||
&& w.InvoiceDate == dateTime.Substring(0, 4) + dateTime.Substring(4, 2) + i.ToString("00"))
|
||||
.Include(inc => inc.invoiceDetails)
|
||||
.ThenInclude(inc => inc.cODItem)
|
||||
|
Reference in New Issue
Block a user