...
This commit is contained in:
@@ -544,5 +544,29 @@ namespace Back.Controllers
|
||||
{
|
||||
return Ok(await _servTaxPayer.GetUnits());
|
||||
}
|
||||
[HttpGet("EconomicCodeInformation")]
|
||||
public async Task<ActionResult<EconomicCodeModelDto>> GetEconomicCodeInformation(string item)
|
||||
{
|
||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||
var UserID = claim.Value;
|
||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||
if (!await _actionTaxPayer.login(user.RolUsers.First().CompanyID))
|
||||
return BadRequest(new List<string> { "خطا در احراز هویت سازمان مالیاتی" });
|
||||
var result=await _actionTaxPayer.GetEconomicCodeInformation(item);
|
||||
if (result == null) return NotFound();
|
||||
return Ok(result);
|
||||
}
|
||||
[HttpGet("FiscalInformation")]
|
||||
public async Task<ActionResult<FiscalInformationModelDto>> GetFiscalInformation(string item)
|
||||
{
|
||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||
var UserID = claim.Value;
|
||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||
if (!await _actionTaxPayer.login(user.RolUsers.First().CompanyID))
|
||||
return BadRequest(new List<string> { "خطا در احراز هویت سازمان مالیاتی" });
|
||||
var result=await _actionTaxPayer.GetFiscalInformation(item);
|
||||
if (result == null) return NotFound();
|
||||
return Ok(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -48,7 +48,14 @@ namespace Back.Services
|
||||
}
|
||||
public async Task<EconomicCodeModel?> GetEconomicCodeInformation(string Item)
|
||||
{
|
||||
return await TaxApiService.Instance.TaxApis.GetEconomicCodeInformationAsync(Item);
|
||||
|
||||
return await TaxApiService.Instance.TaxApis.GetEconomicCodeInformationAsync(Item);
|
||||
|
||||
|
||||
}
|
||||
public async Task<FiscalInformationModel?> GetFiscalInformation(string Item)
|
||||
{
|
||||
return await TaxApiService.Instance.TaxApis.GetFiscalInformationAsync(Item);
|
||||
}
|
||||
//-------------------internal
|
||||
public async Task<bool> login(int CompanyID)
|
||||
|
24
Shared/DTOs/EconomicCodeModelDto.cs
Normal file
24
Shared/DTOs/EconomicCodeModelDto.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Shared.DTOs
|
||||
{
|
||||
public class EconomicCodeModelDto
|
||||
{
|
||||
public string NameTrade { get; set; }
|
||||
|
||||
public string TaxpayerStatus { get; set; }
|
||||
|
||||
public string TaxpayerType { get; set; }
|
||||
|
||||
public string PostalcodeTaxpayer { get; set; }
|
||||
|
||||
public string AddressTaxpayer { get; set; }
|
||||
|
||||
public string NationalId { get; set; }
|
||||
|
||||
}
|
||||
}
|
19
Shared/DTOs/FiscalInformationModelDto.cs
Normal file
19
Shared/DTOs/FiscalInformationModelDto.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Shared.DTOs
|
||||
{
|
||||
public class FiscalInformationModelDto
|
||||
{
|
||||
public string NameTrade { get; set; }
|
||||
|
||||
public int FiscalStatus { get; set; }
|
||||
|
||||
public string EconomicCode { get; set; }
|
||||
|
||||
public string NationalId { get; set; }
|
||||
}
|
||||
}
|
@@ -105,13 +105,13 @@
|
||||
<div class="col-md-10">
|
||||
@if (Cus.ID == 0)
|
||||
{
|
||||
<Button Disabled="SpinnerVisible" class=" mt-3" Color="ButtonColor.Success" @onclick="OnClickAdd" Type="ButtonType.Button">
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Success" @onclick="OnClickAdd" Type="ButtonType.Button">
|
||||
جدید
|
||||
</Button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Success" @onclick="OnClickUpdate" Type="ButtonType.Button">
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Success" @onclick="OnClickUpdate" Type="ButtonType.Button">
|
||||
ثبت تغییرات
|
||||
</Button>
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Danger" @onclick="ShowConfirmationDeleteAsync" Type="ButtonType.Button">
|
||||
@@ -124,6 +124,9 @@ else
|
||||
</Button>
|
||||
}
|
||||
}
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Info" @onclick="OnClickCheckEconomicCode" Type="ButtonType.Button">
|
||||
بررسی کد اقتصادی
|
||||
</Button>
|
||||
</div>
|
||||
<div class="col-md-2" style="align-content:center">
|
||||
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
|
||||
@@ -232,6 +235,33 @@ else
|
||||
else ShowDangerAlert("فیلدهای قرمز باید مقدار دهی شوند");
|
||||
SpinnerVisible = !SpinnerVisible;
|
||||
}
|
||||
public async Task OnClickCheckEconomicCode()
|
||||
{
|
||||
SpinnerVisible = !SpinnerVisible;
|
||||
if (!string.IsNullOrEmpty(Cus.EconomicCode))
|
||||
{
|
||||
|
||||
var rsp = await hc.Get($"TaxPayer/EconomicCodeInformation?item={Cus.EconomicCode}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
var request = await rsp.Content.ReadFromJsonAsync<EconomicCodeModelDto>();
|
||||
// dialog.ShowAsync(
|
||||
// title: $"کد اقتصادی به نام {request.NameTrade}",
|
||||
// message1: $"وضعیت {request.TaxpayerStatus}");
|
||||
|
||||
}
|
||||
else if(rsp.StatusCode==System.Net.HttpStatusCode.NotFound)
|
||||
{
|
||||
ShowDangerAlert("یافت نشد");
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
||||
}
|
||||
}
|
||||
else ShowDangerAlert("کد اقعصادی را مشخص کنید");
|
||||
SpinnerVisible = !SpinnerVisible;
|
||||
}
|
||||
public async Task OnClickAdd()
|
||||
{
|
||||
SpinnerVisible = !SpinnerVisible;
|
||||
|
@@ -111,7 +111,7 @@
|
||||
&& a.SentStatus == SentStatus.Successful))
|
||||
{
|
||||
SendInvoice = false;
|
||||
<h6>
|
||||
<h6 style="color:#49cc90;">
|
||||
این صورتحساب با این وضعیت به سامانه مودیان ارسال و تائید شده
|
||||
</h6>
|
||||
}
|
||||
|
@@ -144,6 +144,7 @@
|
||||
@functions{
|
||||
public async Task SentTaxItem(int ID)
|
||||
{
|
||||
PreloadService.Show(SpinnerColor.Dark);
|
||||
SpinnerVisible = true;
|
||||
var rsp = await hc.Get($"TaxPayer/GetResult/{ID}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
@@ -154,6 +155,7 @@
|
||||
ingriddata.SentStatus = requestsendTax.SentStatus;
|
||||
ingriddata.msgSentStatus = requestsendTax.msgSentStatus;
|
||||
SpinnerVisible = false;
|
||||
PreloadService.Hide();
|
||||
//-----------------
|
||||
var parameters = new Dictionary<string, object>();
|
||||
parameters.Add("inData", requestsendTax);
|
||||
@@ -161,7 +163,7 @@
|
||||
}
|
||||
else{
|
||||
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
|
||||
SpinnerVisible = false;
|
||||
SpinnerVisible = false; PreloadService.Hide();
|
||||
ShowDangerAlert(request[0]);
|
||||
}
|
||||
|
||||
|
@@ -22,16 +22,16 @@ else
|
||||
|
||||
@* alert *@
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
|
||||
<Alert hidden="@Hidealert" Color="@alertColor" Dismissable="false">
|
||||
<Icon Name="@alertIconName" class="me-2"></Icon>
|
||||
@alertMessage
|
||||
</Alert>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
@if (FullInvoice)
|
||||
{
|
||||
<h4 class="fw-bold py-3 mb-4">
|
||||
@@ -43,8 +43,12 @@ else
|
||||
<h4 class="fw-bold py-3 mb-4">
|
||||
<span class="text-muted fw-light">سرویس ها / صورتحساب /</span> آماده سازی قبل از ارسال به سامانه مودیان
|
||||
</h4>
|
||||
}
|
||||
|
||||
}
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
|
||||
</div>
|
||||
</div>
|
||||
@if (!FullInvoice)
|
||||
{
|
||||
<div class="row">
|
||||
|
@@ -36,10 +36,10 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO()
|
||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") });
|
||||
|
||||
//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
|
||||
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/") });
|
||||
|
||||
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");
|
||||
|
||||
|
Reference in New Issue
Block a user