...
This commit is contained in:
@@ -3,6 +3,7 @@ using Back.Services;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Shared.DTOs;
|
||||
using static Shared.DTOs._TaxPayer;
|
||||
|
||||
namespace Back.Controllers
|
||||
{
|
||||
@@ -53,5 +54,18 @@ namespace Back.Controllers
|
||||
}
|
||||
|
||||
}
|
||||
[HttpPost("PreparationInvoiceBeforeSending")]
|
||||
public async Task<ActionResult<bool>> PreparationInvoiceBeforeSending([FromBody] Atemplatefield item)
|
||||
{
|
||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||
var UserID = claim.Value;
|
||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||
var result = await _servTaxPayer.GetInvoice(user.RolUsers.First().CompanyID, item.header.ID);
|
||||
if (result == null)
|
||||
return BadRequest(new List<string> { "صورتحساب یافت نشد" });
|
||||
|
||||
|
||||
return Ok(await _servTaxPayer.PreparationInvoiceBeforeSending(item, result));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user