...
This commit is contained in:
@@ -456,5 +456,15 @@ namespace Back.Controllers
|
||||
return BadRequest(new List<string> { "خطای ناشناخته" });
|
||||
}
|
||||
}
|
||||
[HttpGet("GetBillTypes")]
|
||||
public async Task<ActionResult<List<IdName<int>>>> GetBillTypes()
|
||||
{
|
||||
return Ok(await _servTaxPayer.GetBillTypes());
|
||||
}
|
||||
[HttpGet("GetPatterns")]
|
||||
public async Task<ActionResult<List<IdName<int>>>> GetPatterns()
|
||||
{
|
||||
return Ok(await _servTaxPayer.GetPatterns(true));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ namespace Back.Services
|
||||
{
|
||||
private readonly IAsyncRepository<SentTax> _repoSentTax;
|
||||
private readonly IAsyncRepository<Pattern> _repoPattern;
|
||||
private readonly IAsyncRepository<BillType> _repoBillType;
|
||||
private readonly IAsyncRepository<Invoice> _invoiceRepo;
|
||||
private readonly IAsyncRepository<InvoiceItem> _invoiceitemRepo;
|
||||
private readonly IAsyncRepository<FildModeInPattern> _fildModeInPatternRepo;
|
||||
@@ -20,7 +21,7 @@ namespace Back.Services
|
||||
public servTaxPayer(IAsyncRepository<SentTax> repoSentTax, IAsyncRepository<Pattern> repoPattern
|
||||
, IAsyncRepository<Invoice> invoiceRepo, IAsyncRepository<FildModeInPattern> fildModeInPatternRepo
|
||||
, IAsyncRepository<Coding> codingRepo, IAsyncRepository<SpecialCondition> specialConditionRepo
|
||||
, IAsyncRepository<InvoiceItem> invoiceitemRepo)
|
||||
, IAsyncRepository<InvoiceItem> invoiceitemRepo, IAsyncRepository<BillType> repoBillType)
|
||||
{
|
||||
_repoSentTax = repoSentTax;
|
||||
_repoPattern = repoPattern;
|
||||
@@ -29,6 +30,7 @@ namespace Back.Services
|
||||
_codingRepo = codingRepo;
|
||||
_specialConditionRepo = specialConditionRepo;
|
||||
_invoiceitemRepo = invoiceitemRepo;
|
||||
_repoBillType = repoBillType;
|
||||
}
|
||||
public async Task<bool> ExistSuccessfulorSendorpendingInvoiceinCompanyID(int CompanyID)
|
||||
{
|
||||
@@ -45,10 +47,19 @@ 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()
|
||||
public async Task<List<IdName<int>>> GetPatterns(bool inp=false)
|
||||
{
|
||||
if(inp)
|
||||
return await _repoPattern.Get(w => w.Status).Select(s => new IdName<int> { ID = s.inp, Title = s.Title }).ToListAsync();
|
||||
|
||||
else
|
||||
return await _repoPattern.Get(w=>w.Status).Select(s => new IdName<int> { ID = s.ID, Title = s.Title }).ToListAsync();
|
||||
|
||||
}
|
||||
public async Task<List<IdName<int>>> GetBillTypes()
|
||||
{
|
||||
return await _repoBillType.GetAll().Select(s => new IdName<int> { ID = s.inty, Title = s.Title }).ToListAsync();
|
||||
|
||||
}
|
||||
public async Task<bool> UpdateInvoice(Invoice invoice)
|
||||
{
|
||||
|
@@ -12,6 +12,8 @@ namespace Front
|
||||
public readonly HttpClientController _hc;
|
||||
private List<ForCustomerSearch>? Cus = null;
|
||||
private List<IdName<int>>? Patterns = null;
|
||||
private List<IdName<int>>? Patternsbyinp = null;
|
||||
private List<IdName<int>>? BillTypes = null;
|
||||
private List<IdName<int>>? Units = null;
|
||||
private List<CODIdName<int>>? Cods = null;
|
||||
private CompanyDTO? InfoCompany = null;
|
||||
@@ -68,6 +70,34 @@ namespace Front
|
||||
|
||||
return Patterns;
|
||||
}
|
||||
public async Task<List<IdName<int>>?> GetPatternsbyinp()
|
||||
{
|
||||
if (Patternsbyinp == null)
|
||||
{
|
||||
var request = await _hc.Get($"TaxPayer/GetPatterns");
|
||||
if (request.IsSuccessStatusCode)
|
||||
{
|
||||
Patternsbyinp = await request.Content.ReadFromJsonAsync<List<IdName<int>>>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Patternsbyinp;
|
||||
}
|
||||
public async Task<List<IdName<int>>?> GetBillTypes()
|
||||
{
|
||||
if (BillTypes == null)
|
||||
{
|
||||
var request = await _hc.Get($"TaxPayer/GetBillTypes");
|
||||
if (request.IsSuccessStatusCode)
|
||||
{
|
||||
BillTypes = await request.Content.ReadFromJsonAsync<List<IdName<int>>>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return BillTypes;
|
||||
}
|
||||
public async Task<CompanyDTO?> GetInfoCompany()
|
||||
{
|
||||
|
||||
|
@@ -4,6 +4,7 @@
|
||||
@using Shared.DTOs
|
||||
@layout PanelLayout
|
||||
@inject HttpClientController hc;
|
||||
@inject Fixedvalues fv;
|
||||
<Preload LoadingText="در حال بارگذاری..." />
|
||||
<ConfirmDialog @ref="dialog" />
|
||||
<Toasts AutoHide="true" Delay="6000" class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
|
||||
@@ -74,11 +75,11 @@ else
|
||||
{
|
||||
if (item.Des != null && item.Des.Count() > 0 && !FullInvoice)
|
||||
{
|
||||
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(item.Des,item.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
|
||||
|
||||
<label style="color:red;" class="form-label">@item.fName</label>
|
||||
|
||||
|
||||
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(item.Des,item.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
|
||||
|
||||
<label style="color:red;" class="form-label">@item.fName</label>
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -90,10 +91,10 @@ else
|
||||
{
|
||||
if (item.Des != null && item.Des.Count() > 0 && !FullInvoice)
|
||||
{
|
||||
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(item.Des,item.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
|
||||
|
||||
<label class="form-label">@item.fName</label>
|
||||
|
||||
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(item.Des,item.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
|
||||
|
||||
<label class="form-label">@item.fName</label>
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -122,7 +123,48 @@ else
|
||||
}
|
||||
else if (item.InputBox == "autofild")
|
||||
{
|
||||
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
||||
if (item.eName.ToLower() == "inty")
|
||||
{
|
||||
var bill = BillTypes.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
|
||||
if (bill != null)
|
||||
{
|
||||
item.Value = bill;
|
||||
}
|
||||
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
||||
|
||||
}
|
||||
else if (item.eName.ToLower() == "inp")
|
||||
{
|
||||
var patt = Patterns.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
|
||||
if (patt != null)
|
||||
{
|
||||
item.Value = patt;
|
||||
}
|
||||
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
||||
|
||||
}
|
||||
else if (item.eName.ToLower() == "ins")
|
||||
{
|
||||
var patt = Patterns.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
|
||||
if (patt != null)
|
||||
{
|
||||
item.Value = patt;
|
||||
}
|
||||
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
else
|
||||
{
|
||||
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -167,8 +209,8 @@ else
|
||||
{
|
||||
if (itemB.Des != null && itemB.Des.Count() > 0 && !FullInvoice)
|
||||
{
|
||||
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(itemB.Des,itemB.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
|
||||
<label style="color:red;" class="form-label">@itemB.fName</label>
|
||||
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(itemB.Des,itemB.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
|
||||
<label style="color:red;" class="form-label">@itemB.fName</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -179,8 +221,8 @@ else
|
||||
{
|
||||
if (itemB.Des != null && itemB.Des.Count() > 0 && !FullInvoice)
|
||||
{
|
||||
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(itemB.Des,itemB.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
|
||||
<label class="form-label">@itemB.fName</label>
|
||||
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(itemB.Des,itemB.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
|
||||
<label class="form-label">@itemB.fName</label>
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -212,6 +254,8 @@ else
|
||||
{
|
||||
<input @bind-value="itemB.Value" style="text-align:center;" class="form-control" type="text" placeholder="@itemB.fName" disabled />
|
||||
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -269,6 +313,8 @@ else
|
||||
|
||||
|
||||
@code {
|
||||
private List<IdName<int>>? Patterns = new List<IdName<int>>();
|
||||
private List<IdName<int>>? BillTypes = new List<IdName<int>>();
|
||||
private Modal modal = default!;
|
||||
private ConfirmDialog dialog = default!;
|
||||
[Parameter] public int? InvoiceID { get; set; }
|
||||
@@ -285,6 +331,9 @@ else
|
||||
protected override async Task OnParametersSetAsync()
|
||||
{
|
||||
PreloadService.Show(SpinnerColor.Dark);
|
||||
Patterns = await fv.GetPatternsbyinp();
|
||||
BillTypes = await fv.GetBillTypes();
|
||||
|
||||
await LoadData();
|
||||
PreloadService.Hide();
|
||||
|
||||
@@ -352,7 +401,7 @@ else
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowMessage(ToastType.Danger, "خطای در آماده سازی اطلاعات رخ داده");
|
||||
ShowMessage(ToastType.Danger, "خطای در آماده سازی اطلاعات رخ داده");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -37,10 +37,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("https://localhost:7075/api/") });
|
||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/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