...
This commit is contained in:
@@ -92,7 +92,7 @@ namespace Back.Services
|
||||
{
|
||||
#region AdvancedSearch
|
||||
var invok = _invoiceRepo
|
||||
.Get(w => w.CompanyID == CompanyID && !w.IsDeleted);
|
||||
.Get(w => w.CompanyID == CompanyID && !w.IsDeleted && !w.BillReference.HasValue);
|
||||
|
||||
if (itemSerch.InvoiceID != null)
|
||||
invok = invok.Where(w => w.ID == itemSerch.InvoiceID);
|
||||
@@ -209,7 +209,7 @@ namespace Back.Services
|
||||
|
||||
}
|
||||
}
|
||||
public async Task<bool> ChangeInvoiceType(Invoice invoiceitem, InvoiceType item, bool action = true)
|
||||
public async Task<InvoiceDTO?> ChangeInvoiceType(Invoice invoiceitem, InvoiceType item, bool action = true)
|
||||
{
|
||||
string old = invoiceitem.invoiceType.GetEnumDisplayName();
|
||||
invoiceitem.invoiceType = item;
|
||||
@@ -226,8 +226,19 @@ namespace Back.Services
|
||||
UserID = invoiceitem.LastChangeUserID
|
||||
});
|
||||
if (action)
|
||||
return await _invoiceRepo.UpdateAsync(invoiceitem);
|
||||
else return true;
|
||||
{
|
||||
var result = await _invoiceRepo.UpdateAsync(invoiceitem);
|
||||
if (result)
|
||||
{
|
||||
return await GetInvoice(invoiceitem.CompanyID.Value, invoiceitem.ID);
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
else return await GetInvoice(invoiceitem.CompanyID.Value, invoiceitem.ID);
|
||||
//_contextMongodb.InsertItem(new SysLog()
|
||||
//{
|
||||
// TraceIdentifierID = _httpContextAccessor.HttpContext.TraceIdentifier,
|
||||
@@ -249,7 +260,7 @@ namespace Back.Services
|
||||
// Route = _httpContextAccessor.HttpContext.Request.Path,
|
||||
// Type = "catch"
|
||||
//});
|
||||
return false;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user