...
This commit is contained in:
@@ -24,17 +24,20 @@ namespace Back.Services
|
||||
{
|
||||
#region AdvancedSearch
|
||||
var invok = _invoiceRepo
|
||||
.Get(w => w.CompanyID == CompanyID && !w.IsDeleted && w.ID==ID);
|
||||
.Get(w => w.CompanyID == CompanyID && !w.IsDeleted && w.ID == ID);
|
||||
|
||||
|
||||
#endregion
|
||||
//-----------------------
|
||||
return await invok
|
||||
.Include(inc => inc.invoiceDetails)
|
||||
.Include(inc => inc.payments)
|
||||
.Include(inc => inc.pattern)
|
||||
.ThenInclude(inc => inc.cODItem)
|
||||
.ThenInclude(inc => inc.CODUnit)
|
||||
//.Include(inc => inc.payments)
|
||||
//.Include(inc => inc.pattern)
|
||||
.Select(s => new InvoiceDTO()
|
||||
{
|
||||
|
||||
PatternID = s.PatternID,
|
||||
PatternTitle = s.pattern.Title,
|
||||
CustomerID = s.CustomerID,
|
||||
@@ -56,30 +59,32 @@ namespace Back.Services
|
||||
{
|
||||
ID = x.ID,
|
||||
CODID = x.CODID,
|
||||
//adis = x.adis,
|
||||
adis = x.adis,
|
||||
am = x.am.Value,
|
||||
dis = x.dis,
|
||||
fee = x.fee.Value,
|
||||
mu = x.unitTitle,
|
||||
sstt = x.sstt,
|
||||
tsstam = x.tsstam,
|
||||
vam = x.am,
|
||||
vra = x.vra
|
||||
}).ToList(),
|
||||
payments = s.payments.OrderBy(o => o.ID).Select(x => new InvoicePaymentDTO()
|
||||
{
|
||||
ID = x.ID,
|
||||
acn = x.acn,
|
||||
iinn = x.acn,
|
||||
pcn = x.acn,
|
||||
pdt = x.pdt,
|
||||
PaymentDateTime=x.PaymentDateTime,
|
||||
pid = x.pid,
|
||||
pmt = x.pmt,
|
||||
pv = x.pv,
|
||||
trmn = x.trmn,
|
||||
trn = x.acn
|
||||
vam = x.vam,
|
||||
vra = x.vra,
|
||||
prdis = x.prdis
|
||||
}).ToList(),
|
||||
payments = new List<InvoicePaymentDTO>() //s.payments.OrderBy(o => o.ID).Select(x => new InvoicePaymentDTO()
|
||||
//{
|
||||
// ID = x.ID,
|
||||
// acn = x.acn,
|
||||
// iinn = x.acn,
|
||||
// pcn = x.acn,
|
||||
// pdt = x.pdt,
|
||||
// PaymentDateTime=x.PaymentDateTime,
|
||||
// pid = x.pid,
|
||||
// pmt = x.pmt,
|
||||
// pv = x.pv,
|
||||
// trmn = x.trmn,
|
||||
// trn = x.acn
|
||||
//}).ToList()
|
||||
,
|
||||
})
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
@@ -107,10 +112,13 @@ namespace Back.Services
|
||||
//-----------------------
|
||||
return await invok
|
||||
.Include(inc => inc.invoiceDetails)
|
||||
.Include(inc => inc.payments)
|
||||
.Include(inc => inc.pattern)
|
||||
.ThenInclude(inc => inc.cODItem)
|
||||
.ThenInclude(inc => inc.CODUnit)
|
||||
//.Include(inc => inc.payments)
|
||||
//.Include(inc => inc.pattern)
|
||||
.Select(s => new InvoiceGridDTO()
|
||||
{
|
||||
|
||||
CustomerID = s.CustomerID,
|
||||
CustomerName = s.Customer.FullName,
|
||||
ID = s.ID,
|
||||
@@ -121,6 +129,7 @@ namespace Back.Services
|
||||
tdis = s.tdis,
|
||||
tvam = s.tvam,
|
||||
Udate = s.Udate.ShamciToFormatShamci(),
|
||||
|
||||
})
|
||||
.Paging(itemSerch.PageIndex, itemSerch.PageSize);
|
||||
}
|
||||
|
Reference in New Issue
Block a user