...
This commit is contained in:
@@ -571,5 +571,21 @@ namespace Back.Controllers
|
||||
if (result == null) return NotFound();
|
||||
return Ok(result);
|
||||
}
|
||||
[HttpGet("CodInTaxPayerHaveBeenSentSuccessfully/{CODID}")]
|
||||
public async Task<ActionResult<bool>> CodInTaxPayerHaveBeenSentSuccessfully(int CODID)
|
||||
{
|
||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||
var UserID = claim.Value;
|
||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||
return Ok(await _servTaxPayer.AnyCodInTaxPayerHaveBeenSentSuccessfully(CODID, user.RolUsers.First().CompanyID));
|
||||
}
|
||||
[HttpGet("CustomerInTaxPayerHaveBeenSentSuccessfully/{CUSID}")]
|
||||
public async Task<ActionResult<bool>> CustomerInTaxPayerHaveBeenSentSuccessfully(int CUSID)
|
||||
{
|
||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||
var UserID = claim.Value;
|
||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||
return Ok(await _servTaxPayer.AnyCusInTaxPayerHaveBeenSentSuccessfully(CUSID, user.RolUsers.First().CompanyID));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -5,6 +5,7 @@ using Microsoft.EntityFrameworkCore;
|
||||
using Back.Common;
|
||||
using Microsoft.OpenApi.Extensions;
|
||||
using Shared.DTOs.Serch;
|
||||
using System.ComponentModel.Design;
|
||||
|
||||
namespace Back.Services
|
||||
{
|
||||
@@ -371,12 +372,25 @@ namespace Back.Services
|
||||
|
||||
resvaltype.SetValue(obj, _val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// }
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
public async Task<bool> AnyCodInTaxPayerHaveBeenSentSuccessfully(int CODID, int CompanyID)
|
||||
{
|
||||
return await _repoSentTax.Get(w => w.invoice.invoiceDetails.Any(a => a.CODID == CODID)
|
||||
&& w.invoice.CompanyID==CompanyID
|
||||
&& (w.SentStatus == SentStatus.Successful || w.SentStatus == SentStatus.Send
|
||||
|| w.SentStatus == SentStatus.pending || w.SentStatus == SentStatus.IN_PROGRESS)).AnyAsync();
|
||||
}
|
||||
public async Task<bool> AnyCusInTaxPayerHaveBeenSentSuccessfully(int CusID, int CompanyID)
|
||||
{
|
||||
return await _repoSentTax.Get(w => w.invoice.CustomerID==CusID
|
||||
&& w.invoice.CompanyID == CompanyID
|
||||
&& (w.SentStatus == SentStatus.Successful || w.SentStatus == SentStatus.Send
|
||||
|| w.SentStatus == SentStatus.pending || w.SentStatus == SentStatus.IN_PROGRESS)).AnyAsync();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user