This commit is contained in:
mmrbnjd
2024-06-08 17:13:12 +03:30
parent e05ba7acdb
commit 39dbbf03d8
6 changed files with 309 additions and 8 deletions

View File

@@ -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));
}
}
}