png invoice
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="System.Drawing.Common" Version="9.0.0" />
|
||||||
<PackageReference Include="TaxCollectData.Library" Version="0.0.23" />
|
<PackageReference Include="TaxCollectData.Library" Version="0.0.23" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
@@ -23,12 +23,14 @@ namespace Back.Controllers
|
|||||||
private readonly servUser _servUser;
|
private readonly servUser _servUser;
|
||||||
private readonly AddOrUpdateInvoiceValidation _validationInvoice;
|
private readonly AddOrUpdateInvoiceValidation _validationInvoice;
|
||||||
private readonly servTaxPayer _servTaxPayer;
|
private readonly servTaxPayer _servTaxPayer;
|
||||||
|
private readonly servReport _servReport;
|
||||||
private readonly IAsyncRepository<rptQueue> _rptQueueRepository;
|
private readonly IAsyncRepository<rptQueue> _rptQueueRepository;
|
||||||
public InvoiceController(servInvoice servInvoice, servUser servUser
|
public InvoiceController(servInvoice servInvoice, servUser servUser
|
||||||
, AddOrUpdateInvoiceValidation validationInvoice
|
, AddOrUpdateInvoiceValidation validationInvoice
|
||||||
, servTaxPayer servTaxPayer, IConfiguration configuration
|
, servTaxPayer servTaxPayer, IConfiguration configuration
|
||||||
, IAsyncRepository<rptQueue> rptQueueRepository)
|
, IAsyncRepository<rptQueue> rptQueueRepository, servReport servReport)
|
||||||
{
|
{
|
||||||
|
_servReport= servReport;
|
||||||
_servInvoice = servInvoice;
|
_servInvoice = servInvoice;
|
||||||
_servUser = servUser;
|
_servUser = servUser;
|
||||||
_validationInvoice = validationInvoice;
|
_validationInvoice = validationInvoice;
|
||||||
@@ -593,7 +595,6 @@ namespace Back.Controllers
|
|||||||
[HttpGet("GetReport/{InvoiceID}")]
|
[HttpGet("GetReport/{InvoiceID}")]
|
||||||
public async Task<ActionResult<string>> GetReport(int InvoiceID)
|
public async Task<ActionResult<string>> GetReport(int InvoiceID)
|
||||||
{
|
{
|
||||||
string output = "";
|
|
||||||
//-----GetUserAndCompany
|
//-----GetUserAndCompany
|
||||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||||
var UserID = claim.Value;
|
var UserID = claim.Value;
|
||||||
@@ -604,37 +605,10 @@ namespace Back.Controllers
|
|||||||
if (!await _servInvoice.ExistInvoiceByInvoiceID(CompanyID.Value, InvoiceID))
|
if (!await _servInvoice.ExistInvoiceByInvoiceID(CompanyID.Value, InvoiceID))
|
||||||
return NotFound();
|
return NotFound();
|
||||||
|
|
||||||
//if( await _rptQueueRepository.AddBoolResultAsync(new rptQueue
|
var result = await _servInvoice.GetInvoice(user.RolUsers.First().CompanyID,InvoiceID);
|
||||||
// {
|
|
||||||
// CompanyID= CompanyID.Value,InvoicID= InvoiceID,
|
|
||||||
//}))
|
|
||||||
// {
|
|
||||||
// Thread.Sleep(2000);
|
|
||||||
// if(System.IO.File.Exists(_configuration["rptQueue"].ToString()+ InvoiceID + ".txt"))
|
|
||||||
// {
|
|
||||||
// output= System.IO.File.ReadAllText(_configuration["rptQueue"].ToString() + InvoiceID + ".txt");
|
|
||||||
// }
|
|
||||||
|
|
||||||
// }
|
string base64= await _servReport.CreateImage(result, user?.RolUsers.First().Company.Logo==null ?"":Convert.ToBase64String(user?.RolUsers.First().Company.Logo), user?.RolUsers.First().Company.Name);
|
||||||
try
|
return Ok(base64);
|
||||||
{
|
|
||||||
// Start the child process.
|
|
||||||
Process p = new Process();
|
|
||||||
// Redirect the output stream of the child process.
|
|
||||||
p.StartInfo.UseShellExecute = false;
|
|
||||||
p.StartInfo.RedirectStandardOutput = true;
|
|
||||||
p.StartInfo.FileName = _configuration["CreateReportFileName"].ToString();
|
|
||||||
p.StartInfo.Arguments = $"{CompanyID} {InvoiceID}";
|
|
||||||
p.Start();
|
|
||||||
output = await p.StandardOutput.ReadToEndAsync();
|
|
||||||
await p.WaitForExitAsync();
|
|
||||||
}
|
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
System.IO.File.AppendAllText(_configuration["ReportLog"].ToString(), ex.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok(output);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -83,6 +83,7 @@ builder.Services.AddScoped<ServOrders>();
|
|||||||
builder.Services.AddScoped<ServPricing>();
|
builder.Services.AddScoped<ServPricing>();
|
||||||
builder.Services.AddScoped<ServWalt>();
|
builder.Services.AddScoped<ServWalt>();
|
||||||
builder.Services.AddScoped<AUInvoicePayValidation>();
|
builder.Services.AddScoped<AUInvoicePayValidation>();
|
||||||
|
builder.Services.AddScoped<servReport>();
|
||||||
builder.Services.AddScoped(c => new mpNuget.RestClient("09119660045", "C54S2"));
|
builder.Services.AddScoped(c => new mpNuget.RestClient("09119660045", "C54S2"));
|
||||||
|
|
||||||
string origins = "OriginTaxPayer";
|
string origins = "OriginTaxPayer";
|
||||||
@@ -94,7 +95,7 @@ builder.Services.AddCors(options =>
|
|||||||
policy.WithOrigins("https://localhost:7224", "http://localhost:5107"
|
policy.WithOrigins("https://localhost:7224", "http://localhost:5107"
|
||||||
, "http://195.88.208.142", "http://moadiran.ir"
|
, "http://195.88.208.142", "http://moadiran.ir"
|
||||||
, "https://195.88.208.142", "https://moadiran.ir"
|
, "https://195.88.208.142", "https://moadiran.ir"
|
||||||
, "https://195.88.208.142:440", "https://moadiran.ir:440")
|
, "https://195.88.208.142:440", "https://moadiran.ir:440", "https://localhost:44346")
|
||||||
.AllowAnyHeader()
|
.AllowAnyHeader()
|
||||||
.WithHeaders(HeaderNames.ContentType)
|
.WithHeaders(HeaderNames.ContentType)
|
||||||
.AllowAnyMethod();
|
.AllowAnyMethod();
|
||||||
|
@@ -1,33 +1,24 @@
|
|||||||
{
|
{
|
||||||
"$schema": "http://json.schemastore.org/launchsettings.json",
|
|
||||||
"iisSettings": {
|
|
||||||
"windowsAuthentication": false,
|
|
||||||
"anonymousAuthentication": true,
|
|
||||||
"iisExpress": {
|
|
||||||
"applicationUrl": "http://localhost:24292",
|
|
||||||
"sslPort": 44346
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"profiles": {
|
"profiles": {
|
||||||
"http": {
|
"http": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"dotnetRunMessages": true,
|
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"launchUrl": "swagger",
|
"launchUrl": "swagger",
|
||||||
"applicationUrl": "http://localhost:5271",
|
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
},
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"applicationUrl": "http://localhost:5271"
|
||||||
},
|
},
|
||||||
"https": {
|
"https": {
|
||||||
"commandName": "Project",
|
"commandName": "Project",
|
||||||
"dotnetRunMessages": true,
|
|
||||||
"launchBrowser": true,
|
"launchBrowser": true,
|
||||||
"launchUrl": "swagger",
|
"launchUrl": "swagger",
|
||||||
"applicationUrl": "https://localhost:7075;http://localhost:5271",
|
|
||||||
"environmentVariables": {
|
"environmentVariables": {
|
||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
},
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"applicationUrl": "https://localhost:7075;http://localhost:5271"
|
||||||
},
|
},
|
||||||
"IIS Express": {
|
"IIS Express": {
|
||||||
"commandName": "IISExpress",
|
"commandName": "IISExpress",
|
||||||
@@ -37,5 +28,14 @@
|
|||||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"$schema": "http://json.schemastore.org/launchsettings.json",
|
||||||
|
"iisSettings": {
|
||||||
|
"windowsAuthentication": false,
|
||||||
|
"anonymousAuthentication": true,
|
||||||
|
"iisExpress": {
|
||||||
|
"applicationUrl": "http://localhost:50659/",
|
||||||
|
"sslPort": 44391
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
268
Back/Services/servReport.cs
Normal file
268
Back/Services/servReport.cs
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -34,10 +34,10 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO()
|
|||||||
|
|
||||||
// Server
|
// Server
|
||||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") });
|
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") });
|
||||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://moadiran.ir:444/api/") });
|
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://moadiran.ir:444/api/") });
|
||||||
|
|
||||||
//Home
|
//Home
|
||||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
|
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
|
||||||
|
|
||||||
//farzan
|
//farzan
|
||||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
|
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
|
||||||
|
Reference in New Issue
Block a user