FullInvoiceItem

This commit is contained in:
mmrbnjd
2024-07-20 17:34:28 +03:30
parent cb8c69d81b
commit bd99459bc2
5 changed files with 158 additions and 125 deletions

View File

@@ -33,81 +33,79 @@ namespace Back.Services
}
#endregion
//-----------------------
return await invok
var item= await invok
.Include(inc => inc.invoiceDetails)
.ThenInclude(inc => inc.cODItem)
.ThenInclude(inc => inc.CODUnit)
.Include(inc => inc.Customer)
.Include(inc => inc.sentTax)
//.Include(inc => inc.payments)
.Include(inc => inc.pattern)
.ThenInclude(inc => inc.BillType)
.Select(s => new InvoiceDTO()
{
IsDeleted = s.IsDeleted,
PatternID = s.PatternID,
PatternTitle = s.pattern.Title,
CustomerID = s.CustomerID,
CustomerName = s.Customer.FullName,
ID = s.ID,
InvoiceDate = s.InvoiceDate.ShamciToFormatShamci(),
invoiceTypeTitle = s.invoiceType.GetEnumDisplayName(),
invoiceType = s.invoiceType,
Title = s.Title,
InvoicIssueDate = s.InvoicIssueDate.ShamciToFormatShamci(),
BillReference = s.BillReference,
tbill = s.tbill,
Des = s.Des,
PreparedtoSendtoTax = s.PreparedtoSendtoTax,
tdis = s.tdis,
//
tvam = s.tvam,
Udate = s.Udate.ShamciToFormatShamci(),
.ThenInclude(inc => inc.BillType).FirstOrDefaultAsync();
return new InvoiceDTO()
{
InvoiceSendTaxs = s.sentTax.OrderBy(o => o.ID).Select(s => new SentTaxDto()
{
Date = s.Date.ShamciToFormatShamci(),
Time = s.Time,
ID = s.ID,
InvoiceID = s.InvoiceID,
SentStatus = s.SentStatus,
InvoiceType = s.InvoiceType,
msgInvoiceType = s.InvoiceType.GetEnumDisplayName(),
msgSentStatus = s.SentStatus.GetEnumDisplayName()
}).ToList(),
//items = s.invoiceDetails.OrderBy(o => o.ID).Select(x => new InvoiceItemDTO()
//{
// ID = x.ID,
// CODID = x.CODID,
// 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.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();
IsDeleted = item.IsDeleted,
PatternID = item.PatternID,
PatternTitle = item.pattern.Title,
CustomerID = item.CustomerID,
CustomerName = item.Customer.FullName,
ID = item.ID,
InvoiceDate = item.InvoiceDate.ShamciToFormatShamci(),
invoiceTypeTitle = item.invoiceType.GetEnumDisplayName(),
invoiceType = item.invoiceType,
Title = item.Title,
InvoicIssueDate = item.InvoicIssueDate.ShamciToFormatShamci(),
BillReference = item.BillReference,
tbill = item.tbill,
Des = item.Des,
PreparedtoSendtoTax = item.PreparedtoSendtoTax,
tdis = item.tdis,
tvam = item.tvam,
Udate = item.Udate.ShamciToFormatShamci(),
InvoiceSendTaxs = item.sentTax.OrderBy(o => o.ID).Select(s => new SentTaxDto()
{
Date = s.Date.ShamciToFormatShamci(),
Time = s.Time,
ID = s.ID,
InvoiceID = s.InvoiceID,
SentStatus = s.SentStatus,
InvoiceType = s.InvoiceType,
msgInvoiceType = s.InvoiceType.GetEnumDisplayName(),
msgSentStatus = s.SentStatus.GetEnumDisplayName()
}).ToList(),
items = item.invoiceDetails.OrderBy(o => o.ID).Select(x => new InvoiceItemDTO()
{
ID = x.ID,
CODID = x.CODID,
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.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()
};
}