This commit is contained in:
mmrbnjd
2024-06-27 19:18:50 +03:30
parent 6c8aaadac3
commit a44b27b8a7
9 changed files with 109 additions and 16 deletions

View File

@@ -170,5 +170,9 @@ namespace Back.Services
}
}
public async Task<bool> UsedInTheInvoice(int codID)
{
return await _CODRepo.Get(w => w.invoiceDetails.Any(a=>a.CODID==codID)).AnyAsync();
}
}
}

View File

@@ -9,12 +9,13 @@ namespace Back.Services
public class servCustomer
{
private readonly IAsyncRepository<Customer> _repoCus;
private readonly IAsyncRepository<Invoice> _repoInvoice;
private readonly CheckPermission _checkPermission;
public servCustomer(IAsyncRepository<Customer> repoCus, CheckPermission checkPermission)
public servCustomer(IAsyncRepository<Customer> repoCus, CheckPermission checkPermission, IAsyncRepository<Invoice> repoInvoice)
{
_repoCus = repoCus;
_checkPermission = checkPermission;
_repoInvoice = repoInvoice;
}
public async Task<PagingDto<RCustomer>?> GetCustomers(int CompanyID, ItemSerchGetCustomer itemSerch)
{
@@ -189,6 +190,10 @@ namespace Back.Services
}
}
public async Task<bool> UsedInTheInvoice(int cusID)
{
return await _repoInvoice.Get(w => w.CustomerID == cusID).AnyAsync();
}
}

View File

@@ -125,6 +125,9 @@ namespace Back.Services
if (itemSerch.refInvoiceID != null)
invok = invok.Where(w => w.BillReference==itemSerch.refInvoiceID);
if(itemSerch.CodID != null)
invok = invok.Where(w => w.invoiceDetails.Any(wa=>wa.CODID== itemSerch.CodID));
//foreach (InputObj item in inputObjs)
// invok = invok.Where(ExMethod.GetFunc<Customer>(item.Param, item.Value));