This commit is contained in:
mmrbnjd
2024-07-09 23:04:19 +03:30
parent 414e52f19d
commit d67a9ae440
4 changed files with 59 additions and 8 deletions

View File

@@ -435,7 +435,7 @@ namespace Back.Controllers
{
foreach (var item in responseModel.Body.Result)
{
//ta imja
var ressenttax = new SentTax
{
@@ -447,8 +447,11 @@ namespace Back.Controllers
uId = item.Uid,
SentStatus = SentStatus.Send,
InvoiceModel = JsonConvert.SerializeObject(result, Formatting.Indented,new JsonSerializerSettings
{ PreserveReferencesHandling = PreserveReferencesHandling.Objects }),
{
PreserveReferencesHandling = PreserveReferencesHandling.Objects
}),
ResponseModel = JsonConvert.SerializeObject(responseModel)
};
await _servTaxPayer.AddSentTax(ressenttax);
}
@@ -494,16 +497,17 @@ namespace Back.Controllers
if (string.IsNullOrEmpty(item.uId))
return BadRequest(new List<string> { "کد پیگیری یافت نشد" });
if (!await _actionTaxPayer.login(user.RolUsers.First().CompanyID))
return BadRequest(new List<string> { "خطا در احراز هویت سازمان مالیاتی" });
//if (!await _actionTaxPayer.login(user.RolUsers.First().CompanyID))
// return BadRequest(new List<string> { "خطا در احراز هویت سازمان مالیاتی" });
DataInSendTaxDto desData = new DataInSendTaxDto();
if (item.SentStatus == SentStatus.Send
|| item.SentStatus == SentStatus.pending
|| item.SentStatus == SentStatus.IN_PROGRESS)
|| item.SentStatus == SentStatus.IN_PROGRESS
|| item.SentStatus == SentStatus.Unsuccessful)
{
//ta imja
var result = await _actionTaxPayer.GetResultByUid(user.RolUsers.First().CompanyID, item.uId);
if (result == null)
return BadRequest(new List<string> { "پاسخی از سازمان دریافت نشد" });
@@ -528,10 +532,13 @@ namespace Back.Controllers
: result.Status == "IN_PROGRESS" ? SentStatus.IN_PROGRESS
: SentStatus.Unknown;
}
if (await _servTaxPayer.UpdateSentTax(item)) return Ok(desData);
if (await _servTaxPayer.UpdateSentTax(item)) return Ok(desData);
else return BadRequest(new List<string> { "خطای در ذخیره سازی" });
}
else if (item.SentStatus == SentStatus.Unsuccessful && !string.IsNullOrEmpty(item.InquiryResultModel))
{
InquiryResultModel inquiryResult = JsonConvert.DeserializeObject<InquiryResultModel>(item.InquiryResultModel);