This commit is contained in:
mmrbnjd
2024-06-14 22:37:22 +03:30
parent 39c9de8f4c
commit 376da0e7d0
10 changed files with 3815 additions and 13 deletions

View File

@@ -22,6 +22,14 @@ namespace Back.Controllers
_servCompany = servCompany;
_servTaxPayer = servTaxPayer;
}
[HttpGet("GetCompany")]
public async Task<ActionResult<CompanyDTO>> GetCompany()
{
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 _servCompany.GetCompany(user.RolUsers.First().CompanyID));
}
[HttpPost("ChangeLogo")]
public async Task<ActionResult<bool>> ChangeLogo(byte[] logo)
{

View File

@@ -1,4 +1,5 @@
using Back.Common;
using Back.Data.Models;
using Back.Services;
using Back.Validations;
using Microsoft.AspNetCore.Authorization;
@@ -36,6 +37,32 @@ namespace Back.Controllers
return Ok(await _servCus.GetCustomers(user.RolUsers.First().CompanyID, itemSerch));
}
[HttpGet("GetCustomer/{ID}")]
public async Task<ActionResult<RCustomer>> GetCustomer(int ID)
{
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
var UserID = claim.Value;
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
var cus = await _servCus.GetCustomerByCustomerID(ID, user.RolUsers.First().CompanyID);
return Ok(new RCustomer
{
Address = cus.Address,
BranchID = cus.BranchID,
CustomerType = cus.CustomerType,
CustomerTypeTitle = cus.CustomerType.GetEnumDisplayName(),
EconomicCode = cus.EconomicCode,
Email = cus.Email,
FullName = cus.FullName,
ID = ID,
Info = cus.Info,
MeliCode = cus.MeliCode,
PassportNumber = cus.PassportNumber,
Phone = cus.Phone,
ZipCode = cus.ZipCode
});
}
[HttpGet("GetAllForidName")]
public async Task<ActionResult<List<ForCustomerSearch>>> GetAllForSearch()

View File

@@ -440,10 +440,10 @@ namespace Back.Controllers
{
return Ok(await _servTaxPayer.GetPatterns());
}
[HttpGet("GetReport")]
public IActionResult GetReport()
[HttpGet("GetReport/{InvoiceID}")]
public IActionResult GetReport(int InvoiceID)
{
var reportPath = $"Reports\\TwoSimpleLists.mrt";
var reportPath = $"Reports\\invoice.mrt";
var bytes = System.IO.File.ReadAllBytes(reportPath);
return new FileContentResult(bytes, "application/xml");
}

View File

@@ -45,7 +45,7 @@ namespace Back.Controllers
else
{
if (!result.PatternID.HasValue)
if (!result.PatternID.HasValue || result.PatternID==0)
return BadRequest(new List<string> { "ابتدا برای این صورتحساب الگو در نظر بگیرید" });
if (result.invoiceType == InvoiceType.Bidding)

View File

@@ -6,6 +6,7 @@ using Back.Services;
using Back.Validations;
using Microsoft.EntityFrameworkCore;
using Microsoft.IdentityModel.Tokens;
using Microsoft.Net.Http.Headers;
using Microsoft.OpenApi.Models;
using System.Text;
using TaxPayer.Infrastructure.Persistence;
@@ -85,6 +86,7 @@ builder.Services.AddCors(options =>
{
policy.WithOrigins("https://localhost:7224", "http://localhost:5107")
.AllowAnyHeader()
.WithHeaders(HeaderNames.ContentType)
.AllowAnyMethod();
});
});

1599
Back/Reports/Invoice.mrt Normal file

File diff suppressed because it is too large Load Diff

2001
Back/Reports/invoice1.mrt Normal file

File diff suppressed because it is too large Load Diff