...
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Blazor.PersianDatePicker" Version="2.1.0" />
|
||||
<PackageReference Include="Melipayamak.RestClient" Version="1.0.0" />
|
||||
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.2.0" />
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||
@@ -34,7 +35,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Service">
|
||||
<HintPath>..\..\..\LocalGit\TaxPayerTools\Service\bin\Debug\Service.dll</HintPath>
|
||||
<HintPath>..\..\Dlls\Service.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -38,6 +38,13 @@ namespace Back.Controllers
|
||||
[HttpPost("Add")]
|
||||
public async Task<ActionResult<int>> Add([FromBody] NUInvoiceDTO item)
|
||||
{
|
||||
if(string.IsNullOrEmpty(item.InvoiceDate))
|
||||
item.InvoiceDate = DateTime.Now.ConvertMiladiToShamsi();
|
||||
|
||||
if (string.IsNullOrEmpty(item.InvoicIssueDate))
|
||||
item.InvoicIssueDate = DateTime.Now.ConvertMiladiToShamsi();
|
||||
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
return BadRequest(item);
|
||||
|
||||
@@ -109,15 +116,24 @@ namespace Back.Controllers
|
||||
return BadRequest(new List<string> { "این صورتحساب به سازمان ارسال شده"+'\n'+
|
||||
"برای ویرایش ،صورتحساب را ابطال/اصلاح یا برگشت بزنید"});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//-----change invoice
|
||||
invoice.Title = item.Title;
|
||||
if (!string.IsNullOrEmpty(item.Title))
|
||||
invoice.Title = item.Title;
|
||||
|
||||
invoice.PatternID = item.PatternID;
|
||||
invoice.CustomerID = item.CustomerID;
|
||||
invoice.InvoicIssueDate = item.InvoicIssueDate;
|
||||
invoice.InvoiceDate = item.InvoiceDate;
|
||||
|
||||
if(item.CustomerID > 0)
|
||||
invoice.CustomerID = item.CustomerID;
|
||||
|
||||
if (!string.IsNullOrEmpty(item.InvoicIssueDate))
|
||||
invoice.InvoicIssueDate = item.InvoicIssueDate;
|
||||
|
||||
if (!string.IsNullOrEmpty(item.InvoiceDate))
|
||||
invoice.InvoiceDate = item.InvoiceDate;
|
||||
|
||||
invoice.Des = item.Des;
|
||||
invoice.LastChangeUserID = Convert.ToInt32(UserID);
|
||||
|
||||
@@ -341,5 +357,10 @@ namespace Back.Controllers
|
||||
return NoContent();
|
||||
|
||||
}
|
||||
[HttpGet("GetPatterns")]
|
||||
public async Task<ActionResult<List<IdName<int>>>> GetPatterns()
|
||||
{
|
||||
return Ok(await _servTaxPayer.GetPatterns());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,9 +8,11 @@ namespace Back.Services
|
||||
public class servTaxPayer
|
||||
{
|
||||
private readonly IAsyncRepository<SentTax> _repoSentTax;
|
||||
public servTaxPayer(IAsyncRepository<SentTax> repoSentTax)
|
||||
private readonly IAsyncRepository<Pattern> _repoPattern;
|
||||
public servTaxPayer(IAsyncRepository<SentTax> repoSentTax, IAsyncRepository<Pattern> repoPattern)
|
||||
{
|
||||
_repoSentTax = repoSentTax;
|
||||
_repoPattern = repoPattern;
|
||||
}
|
||||
public async Task<bool> ExistSuccessfulorSendorpendingInvoiceinCompanyID(int CompanyID)
|
||||
{
|
||||
@@ -27,6 +29,10 @@ namespace Back.Services
|
||||
&& (w.SentStatus == SentStatus.Successful || w.SentStatus == SentStatus.Send || w.SentStatus == SentStatus.pending)
|
||||
&& w.invoice.CompanyID != CompanyID).AnyAsync();
|
||||
}
|
||||
public async Task<List<IdName<int>>> GetPatterns()
|
||||
{
|
||||
return await _repoPattern.Get(w=>w.Status).Select(s => new IdName<int> { ID = s.ID, Title = s.Title }).ToListAsync();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user