...
This commit is contained in:
@@ -3,6 +3,9 @@ using Back.Data.Contracts;
|
||||
using Back.Data.Models;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Back.Common;
|
||||
using Shared;
|
||||
using Microsoft.OpenApi.Extensions;
|
||||
using Shared.DTOs.Serch;
|
||||
|
||||
namespace Back.Services
|
||||
{
|
||||
@@ -48,7 +51,10 @@ namespace Back.Services
|
||||
return await _repoPattern.Get(w=>w.Status).Select(s => new IdName<int> { ID = s.ID, Title = s.Title }).ToListAsync();
|
||||
|
||||
}
|
||||
|
||||
public async Task<bool> UpdateInvoice(Invoice invoice)
|
||||
{
|
||||
return await _invoiceRepo.UpdateAsync(invoice);
|
||||
}
|
||||
public async Task<Invoice?> GetInvoice(int CompanyID, int ID)
|
||||
{
|
||||
#region AdvancedSearch
|
||||
@@ -71,7 +77,10 @@ namespace Back.Services
|
||||
.ThenInclude(inc => inc.CODUnit)
|
||||
.FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
public async Task<bool> AddSentTax(SentTax sentTax)
|
||||
{
|
||||
return await _repoSentTax.AddBoolResultAsync(sentTax);
|
||||
}
|
||||
public async Task<_TaxPayer.Atemplatefield> GetFildInvoiceForPreparation(Invoice InvoiceItem)
|
||||
{
|
||||
_TaxPayer.Atemplatefield ret = new _TaxPayer.Atemplatefield();
|
||||
@@ -192,6 +201,35 @@ namespace Back.Services
|
||||
|
||||
|
||||
|
||||
}
|
||||
public async Task<PagingDto<SentTaxDto>> GetSentTax(int CompanyID, ItemSerchGetSentTax itemSerchGetSentTax)
|
||||
{
|
||||
var request = _repoSentTax.Get(w => w.invoice.CompanyID == CompanyID);
|
||||
|
||||
if (itemSerchGetSentTax.ID.HasValue)
|
||||
request = request.Where(w => w.ID == itemSerchGetSentTax.ID.Value);
|
||||
|
||||
if (itemSerchGetSentTax.invoiceType.HasValue)
|
||||
request = request.Where(w => w.invoice.invoiceType == itemSerchGetSentTax.invoiceType.Value);
|
||||
|
||||
if (itemSerchGetSentTax.SentStatus.HasValue)
|
||||
request = request.Where(w => w.SentStatus == itemSerchGetSentTax.SentStatus.Value);
|
||||
|
||||
if (itemSerchGetSentTax.InvoiceID.HasValue)
|
||||
request = request.Where(w => w.InvoiceID == itemSerchGetSentTax.InvoiceID.Value);
|
||||
|
||||
return await request.OrderByDescending(o=>o.ID)
|
||||
.Select(s => new SentTaxDto
|
||||
{
|
||||
Date = s.Date.ShamciToFormatShamciinFront(),
|
||||
Time = s.Time,
|
||||
ID = s.ID,
|
||||
InvoiceID = s.InvoiceID,
|
||||
SentStatus=s.SentStatus,
|
||||
msgInvoiceType = s.InvoiceType.GetDisplayName(),
|
||||
msgSentStatus = s.SentStatus.GetDisplayName()
|
||||
|
||||
}).Paging(itemSerchGetSentTax.PageIndex, itemSerchGetSentTax.PageSize);
|
||||
}
|
||||
private void SetValue<T>(_TaxPayer.Fild fild, ref T obj)
|
||||
{
|
||||
|
Reference in New Issue
Block a user