get invoice view
This commit is contained in:
@@ -61,6 +61,20 @@ namespace Back.Services
|
||||
}).OrderByDescending(o=>o.ID)
|
||||
.Paging(itemSerch.PageIndex, itemSerch.PageSize);
|
||||
}
|
||||
public async Task<List<ForCustomerSearch>?> GetCustomers(int CompanyID)
|
||||
{
|
||||
var invok = _repoCus
|
||||
.Get(w => w.CompanyID == CompanyID && !w.IsDeleted);
|
||||
|
||||
//-----------------------
|
||||
return await invok.Select(s => new ForCustomerSearch()
|
||||
{
|
||||
CustomerName=s.FullName,
|
||||
ID = s.ID
|
||||
|
||||
}).OrderByDescending(o => o.ID)
|
||||
.ToListAsync();
|
||||
}
|
||||
public async Task<Customer?> GetCustomerByCustomerID(int CustomerID, int CompanyID)
|
||||
{
|
||||
return await _repoCus
|
||||
|
@@ -13,9 +13,9 @@ namespace Back.Services
|
||||
private readonly IAsyncRepository<InvoiceStatusChang> _invoiceStatusChangPaymentRepo;
|
||||
private readonly CheckPermission _checkPermission;
|
||||
public servInvoice(IAsyncRepository<Invoice> invoiceRepo, CheckPermission checkPermission
|
||||
,IAsyncRepository<InvoiceStatusChang> invoiceStatusChangPaymentRepo)
|
||||
, IAsyncRepository<InvoiceStatusChang> invoiceStatusChangPaymentRepo)
|
||||
{
|
||||
_invoiceStatusChangPaymentRepo= invoiceStatusChangPaymentRepo;
|
||||
_invoiceStatusChangPaymentRepo = invoiceStatusChangPaymentRepo;
|
||||
_invoiceRepo = invoiceRepo;
|
||||
_checkPermission = checkPermission;
|
||||
|
||||
@@ -45,9 +45,11 @@ namespace Back.Services
|
||||
return await invok
|
||||
.Include(inc => inc.invoiceDetails)
|
||||
.Include(inc => inc.payments)
|
||||
.Include(inc => inc.pattern)
|
||||
.Select(s => new InvoiceDTO()
|
||||
{
|
||||
PatternID= s.PatternID,
|
||||
PatternID = s.PatternID,
|
||||
PatternTitle = s.pattern.Title,
|
||||
CustomerID = s.CustomerID,
|
||||
CustomerName = s.Customer.FullName,
|
||||
ID = s.ID,
|
||||
@@ -93,9 +95,9 @@ namespace Back.Services
|
||||
})
|
||||
.Paging(itemSerch.PageIndex, itemSerch.PageSize);
|
||||
}
|
||||
public async Task<bool> ExistInvoiceByInvoiceID(int CompanyID,int InvoiceID)
|
||||
public async Task<bool> ExistInvoiceByInvoiceID(int CompanyID, int InvoiceID)
|
||||
{
|
||||
return await _invoiceRepo.Get(w => w.ID == InvoiceID && w.CompanyID == CompanyID && !w.IsDeleted).AnyAsync();
|
||||
return await _invoiceRepo.Get(w => w.ID == InvoiceID && w.CompanyID == CompanyID && !w.IsDeleted).AnyAsync();
|
||||
|
||||
}
|
||||
public async Task<bool> AddInvoice(Invoice invoice, bool calculate = true)
|
||||
@@ -113,7 +115,7 @@ namespace Back.Services
|
||||
{
|
||||
return await _invoiceRepo.AddBoolResultAsync(invoice);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
public async Task<bool> UpdateInvoice(Invoice invoice)
|
||||
{
|
||||
@@ -121,7 +123,7 @@ namespace Back.Services
|
||||
invoice.PreparedtoSendtoTax = false;
|
||||
|
||||
|
||||
return await _invoiceRepo.UpdateAsync(invoice);
|
||||
return await _invoiceRepo.UpdateAsync(invoice);
|
||||
}
|
||||
public async Task<Invoice?> GetInvoiceByInvoiceID(int CompanyID, int InvoiceID)
|
||||
{
|
||||
@@ -180,8 +182,8 @@ namespace Back.Services
|
||||
Date = DateTime.Now.ConvertMiladiToShamsi(),
|
||||
UserID = invoiceitem.LastChangeUserID
|
||||
});
|
||||
if(action)
|
||||
return await _invoiceRepo.UpdateAsync(invoiceitem);
|
||||
if (action)
|
||||
return await _invoiceRepo.UpdateAsync(invoiceitem);
|
||||
else return true;
|
||||
//_contextMongodb.InsertItem(new SysLog()
|
||||
//{
|
||||
|
Reference in New Issue
Block a user