...
This commit is contained in:
@@ -456,5 +456,15 @@ namespace Back.Controllers
|
||||
return BadRequest(new List<string> { "خطای ناشناخته" });
|
||||
}
|
||||
}
|
||||
[HttpGet("GetBillTypes")]
|
||||
public async Task<ActionResult<List<IdName<int>>>> GetBillTypes()
|
||||
{
|
||||
return Ok(await _servTaxPayer.GetBillTypes());
|
||||
}
|
||||
[HttpGet("GetPatterns")]
|
||||
public async Task<ActionResult<List<IdName<int>>>> GetPatterns()
|
||||
{
|
||||
return Ok(await _servTaxPayer.GetPatterns(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ namespace Back.Services
|
||||
{
|
||||
private readonly IAsyncRepository<SentTax> _repoSentTax;
|
||||
private readonly IAsyncRepository<Pattern> _repoPattern;
|
||||
private readonly IAsyncRepository<BillType> _repoBillType;
|
||||
private readonly IAsyncRepository<Invoice> _invoiceRepo;
|
||||
private readonly IAsyncRepository<InvoiceItem> _invoiceitemRepo;
|
||||
private readonly IAsyncRepository<FildModeInPattern> _fildModeInPatternRepo;
|
||||
@@ -20,7 +21,7 @@ namespace Back.Services
|
||||
public servTaxPayer(IAsyncRepository<SentTax> repoSentTax, IAsyncRepository<Pattern> repoPattern
|
||||
, IAsyncRepository<Invoice> invoiceRepo, IAsyncRepository<FildModeInPattern> fildModeInPatternRepo
|
||||
, IAsyncRepository<Coding> codingRepo, IAsyncRepository<SpecialCondition> specialConditionRepo
|
||||
, IAsyncRepository<InvoiceItem> invoiceitemRepo)
|
||||
, IAsyncRepository<InvoiceItem> invoiceitemRepo, IAsyncRepository<BillType> repoBillType)
|
||||
{
|
||||
_repoSentTax = repoSentTax;
|
||||
_repoPattern = repoPattern;
|
||||
@@ -29,6 +30,7 @@ namespace Back.Services
|
||||
_codingRepo = codingRepo;
|
||||
_specialConditionRepo = specialConditionRepo;
|
||||
_invoiceitemRepo = invoiceitemRepo;
|
||||
_repoBillType = repoBillType;
|
||||
}
|
||||
public async Task<bool> ExistSuccessfulorSendorpendingInvoiceinCompanyID(int CompanyID)
|
||||
{
|
||||
@@ -45,10 +47,19 @@ namespace Back.Services
|
||||
&& (w.SentStatus == SentStatus.Successful || w.SentStatus == SentStatus.Send || w.SentStatus == SentStatus.pending)
|
||||
&& w.invoice.CompanyID != CompanyID).AnyAsync();
|
||||
}
|
||||
public async Task<List<IdName<int>>> GetPatterns()
|
||||
public async Task<List<IdName<int>>> GetPatterns(bool inp=false)
|
||||
{
|
||||
if(inp)
|
||||
return await _repoPattern.Get(w => w.Status).Select(s => new IdName<int> { ID = s.inp, Title = s.Title }).ToListAsync();
|
||||
|
||||
else
|
||||
return await _repoPattern.Get(w=>w.Status).Select(s => new IdName<int> { ID = s.ID, Title = s.Title }).ToListAsync();
|
||||
|
||||
}
|
||||
public async Task<List<IdName<int>>> GetBillTypes()
|
||||
{
|
||||
return await _repoBillType.GetAll().Select(s => new IdName<int> { ID = s.inty, Title = s.Title }).ToListAsync();
|
||||
|
||||
}
|
||||
public async Task<bool> UpdateInvoice(Invoice invoice)
|
||||
{
|
||||
|
Reference in New Issue
Block a user