...
This commit is contained in:
@@ -94,8 +94,14 @@ namespace Back.Controllers
|
||||
var UserID = claim.Value;
|
||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||
|
||||
if (!string.IsNullOrEmpty(model.BranchID) && (model.BranchID.Length > 10 || !int.TryParse(model.BranchID, out int a)))
|
||||
if (!string.IsNullOrEmpty(model.BranchID))
|
||||
{
|
||||
if (!int.TryParse(model.BranchID, out int a))
|
||||
return BadRequest(new List<string> { "مقدار کد شعبه صحیح نمی باشد" });
|
||||
if(model.BranchID.Length!=4)
|
||||
return BadRequest(new List<string> { "مقدار کد شعبه یاید 4عددی باشد" });
|
||||
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(model.UniqeMemory) && (model.UniqeMemory.Length != 6))
|
||||
return BadRequest(new List<string> { "مقدار حافظه مالیاتی صحیح نمی باشد" });
|
||||
|
@@ -152,7 +152,7 @@ namespace Back.Controllers
|
||||
[HttpGet("SendInvoice/{InvoiceID}")]
|
||||
public async Task<ActionResult<bool>> SendInvoice(int InvoiceID)
|
||||
{
|
||||
return BadRequest(new List<string> { "در حال حاضر سامانه مودیان در دسترس نمی باشد" });
|
||||
//return BadRequest(new List<string> { "در حال حاضر سامانه مودیان در دسترس نمی باشد" });
|
||||
|
||||
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||
var UserID = claim.Value;
|
||||
@@ -255,7 +255,7 @@ namespace Back.Controllers
|
||||
// مجموع سایر مالیات، عوارض و وجوه قانونی
|
||||
Todam = result.todam ?? null,
|
||||
//صورتحساب مجموع
|
||||
Tbill =-10 /* result.tbill ?? null*/,
|
||||
Tbill = result.tbill ?? null,
|
||||
//مجموع وزن خالض
|
||||
Tonw = level == 10 ? result.tonw : null,
|
||||
//مجموع ارزش ریالی
|
||||
@@ -302,7 +302,7 @@ namespace Back.Controllers
|
||||
// مبلغ واحد
|
||||
Fee = level == 4 ? null : bitem.fee,
|
||||
//میزان ارز
|
||||
Cfee = level==8 || level==10 ?null: bitem.cfee,
|
||||
Cfee = bitem.cfee == 0|| level ==8 || level==10 ?null: bitem.cfee ,
|
||||
//نوع ارز
|
||||
Cut = level == 8 || string.IsNullOrEmpty(bitem.cut) ? null : bitem.cut,
|
||||
//نرخ برابری ارز با ریال
|
||||
|
@@ -14,7 +14,12 @@ namespace Back.Data.Models
|
||||
#region autofild
|
||||
//تاریخ و زمان پرداخت
|
||||
[MaxLength(13)]
|
||||
public long? pdt { get { return new DateTimeOffset(PaymentDateTime.Trim().ToMiladi()).ToUnixTimeSeconds(); } }
|
||||
public long? pdt { get
|
||||
{
|
||||
return null;
|
||||
return new DateTimeOffset(PaymentDateTime.Trim().ToMiladi().Date).ToUnixTimeSeconds();
|
||||
|
||||
} }
|
||||
#endregion
|
||||
|
||||
#region fild
|
||||
|
@@ -16,10 +16,14 @@ namespace Back.Services
|
||||
private string _UniqueMemory;
|
||||
private string _PrivateKey;
|
||||
private readonly servCompany _servCompany;
|
||||
public ActionTaxPayer(servCompany servCompany)
|
||||
private readonly IConfiguration _configuration;
|
||||
|
||||
public ActionTaxPayer(servCompany servCompany, IConfiguration configuration)
|
||||
{
|
||||
_servCompany = servCompany;
|
||||
_configuration = configuration;
|
||||
}
|
||||
|
||||
public string GenerateTaxid(string FactorNo, string InvoiceDate)
|
||||
{
|
||||
//return "testTaxid";
|
||||
@@ -70,12 +74,14 @@ namespace Back.Services
|
||||
|
||||
if (!string.IsNullOrEmpty(resquth.UniqueMemory) && !string.IsNullOrEmpty(resquth.PrivateKey))
|
||||
{
|
||||
// "https://sandboxrc.tax.gov.ir/req/api/"
|
||||
|
||||
//string taxapi = _configuration.GetSection("TaxPayerApi").Value;
|
||||
string taxapi = "https://sandboxrc.tax.gov.ir/req/api/";
|
||||
_UniqueMemory = resquth.UniqueMemory;
|
||||
_PrivateKey = resquth.PrivateKey;
|
||||
TaxApiService.Instance.Init(_UniqueMemory,
|
||||
new SignatoryConfig(_PrivateKey, null),
|
||||
new NormalProperties(ClientType.SELF_TSP), "https://tp.tax.gov.ir/req/api/");
|
||||
new NormalProperties(ClientType.SELF_TSP), taxapi);
|
||||
await TaxApiService.Instance.TaxApis.GetServerInformationAsync();
|
||||
}
|
||||
#endregion
|
||||
|
@@ -65,8 +65,8 @@ namespace Back.Validations
|
||||
RuleFor(r => r.Item2.BranchID)
|
||||
.Custom((model, context) =>
|
||||
{
|
||||
if (!string.IsNullOrEmpty(model) && (model.Length > 10))
|
||||
context.AddFailure("تعداد کارکتر کد شعبه صحبح نمی باشد");
|
||||
if (!string.IsNullOrEmpty(model) && (model.Length !=4))
|
||||
context.AddFailure("مقدار کد شعبه یاید 4عددی باشد");
|
||||
});
|
||||
RuleFor(r => r.Item2.ZipCode)
|
||||
.Custom((model, context) =>
|
||||
|
@@ -5,5 +5,6 @@
|
||||
"Microsoft.AspNetCore": "Warning"
|
||||
}
|
||||
},
|
||||
"AllowedHosts": "*"
|
||||
"AllowedHosts": "*",
|
||||
"TaxPayerApi": "https://tp.tax.gov.ir/req/api/"
|
||||
}
|
||||
|
Reference in New Issue
Block a user