...
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
{
|
||||
|
||||
<ul>
|
||||
|
||||
|
||||
@if (_SuccessfulSubmissiontoTaxPayer)
|
||||
{
|
||||
<li style="color:red">با این کالا صورتحسابی به سامانه مودیان ارسال کرده اید <br />نمیتوانید آن را ویرایش کنید</li>
|
||||
@@ -30,7 +30,16 @@
|
||||
}
|
||||
<li style="color:dodgerblue">زمان ویرایش دقت کنید<br /> تغییرات میتواند روی فاکتورهای صادر شده تائیر بگذارد</li>
|
||||
}
|
||||
|
||||
|
||||
@if (InventoryValue > 0)
|
||||
{
|
||||
<li style="color:seagreen">موجودی کالا در انبار : @InventoryValue</li>
|
||||
}
|
||||
else
|
||||
{
|
||||
<li style="color:red">این کالا در انبار موجودی ندارد</li>
|
||||
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
<div class="row g-3">
|
||||
@@ -38,14 +47,13 @@
|
||||
<label class="col-sm-4 col-form-label" style="color:red" for="inputTitle">نام کالا</label>
|
||||
@if (Cod.ID == 0 || !_UsedInTheInvoice)
|
||||
{
|
||||
<InputText style="text-align:center" @bind-Value="Cod.Title" type="text" class="form-control" id="inputTitle" placeholder="نام کالا"
|
||||
/>
|
||||
<InputText style="text-align:center" @bind-Value="Cod.Title" type="text" class="form-control" id="inputTitle" placeholder="نام کالا" />
|
||||
}
|
||||
else
|
||||
{
|
||||
<InputText style="text-align:center" @bind-Value="Cod.Title" type="text" class="form-control" id="inputTitle" placeholder="نام کالا" readonly />
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label class="col-sm-5 col-form-label" style="color:red" for="inputUnitID">واحد اندازه گیزی</label>
|
||||
@@ -90,19 +98,19 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
<div class="row g-3">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-10">
|
||||
@if (Cod.ID == 0)
|
||||
{
|
||||
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickAdd" Type="ButtonType.Button">
|
||||
جدید
|
||||
</Button>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (Cod.ID == 0)
|
||||
{
|
||||
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickAdd" Type="ButtonType.Button">
|
||||
جدید
|
||||
</Button>
|
||||
}
|
||||
else
|
||||
{
|
||||
@if (!_SuccessfulSubmissiontoTaxPayer)
|
||||
{
|
||||
<Button Disabled="SpinnerVisible" class="mt-3" Color="ButtonColor.Success" @onclick="OnClickUpdate" Type="ButtonType.Button">
|
||||
@@ -112,19 +120,20 @@ else
|
||||
حذف
|
||||
</Button>
|
||||
}
|
||||
|
||||
@if (_UsedInTheInvoice)
|
||||
|
||||
{
|
||||
<Button Disabled="SpinnerVisible" class=" mt-3" Color="ButtonColor.Link" @onclick="OnClickGoToInvoice" Type="ButtonType.Button">
|
||||
صورتحساب های مرتبط
|
||||
</Button>
|
||||
}
|
||||
}
|
||||
|
||||
@if (_UsedInTheInvoice)
|
||||
|
||||
{
|
||||
<Button Disabled="SpinnerVisible" class=" mt-3" Color="ButtonColor.Link" @onclick="OnClickGoToInvoice" Type="ButtonType.Button">
|
||||
صورتحساب های مرتبط
|
||||
</Button>
|
||||
}
|
||||
|
||||
}
|
||||
</div>
|
||||
<div class="col-md-2" >
|
||||
<div class="col-md-2">
|
||||
<Spinner Visible="SpinnerVisible" Color="SpinnerColor.Primary" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@code {
|
||||
public bool SpinnerVisible { get; set; } = false;
|
||||
@@ -154,6 +163,9 @@ else
|
||||
alertMessage = "";
|
||||
await UsedInTheInvoice();
|
||||
await SuccessfulSubmissiontoTaxPayer();
|
||||
// موجودی
|
||||
await Inventory();
|
||||
//
|
||||
SpinnerVisible = false;
|
||||
await base.OnParametersSetAsync();
|
||||
}
|
||||
@@ -165,7 +177,7 @@ else
|
||||
}
|
||||
public async Task UsedInTheInvoice()
|
||||
{
|
||||
if (Cod.ID!=0)
|
||||
if (Cod.ID != 0)
|
||||
{
|
||||
var rsp = await hc.Get($"Cod/UsedInTheInvoice/{Cod.ID}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
@@ -175,6 +187,16 @@ else
|
||||
}
|
||||
|
||||
}
|
||||
public decimal InventoryValue { get; set; } = 0;
|
||||
public async Task Inventory()
|
||||
{
|
||||
if (Cod.ID != 0)
|
||||
{
|
||||
var rsp = await hc.Get($"Warehouse/Inventory/{Cod.ID}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
InventoryValue = await rsp.Content.ReadFromJsonAsync<decimal>();
|
||||
}
|
||||
}
|
||||
public async Task SuccessfulSubmissiontoTaxPayer()
|
||||
{
|
||||
SpinnerVisible = true;
|
||||
@@ -187,7 +209,7 @@ else
|
||||
else _SuccessfulSubmissiontoTaxPayer = false;
|
||||
}
|
||||
|
||||
SpinnerVisible = false ;
|
||||
SpinnerVisible = false;
|
||||
}
|
||||
private void ShowSuccessAlert(string msg)
|
||||
{
|
||||
@@ -234,7 +256,7 @@ else
|
||||
SpinnerVisible = true;
|
||||
if (Cod.UnitID > 0 && Cod.TaxRate >= 0 && !string.IsNullOrEmpty(Cod.Title))
|
||||
{
|
||||
|
||||
|
||||
var rsp = await hc.Put<RCOD>("Cod/Update", Cod);
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
@@ -295,11 +317,11 @@ else
|
||||
message2: "اطمینان دارید?");
|
||||
|
||||
if (confirmation)
|
||||
await OnClickDelete();
|
||||
|
||||
await OnClickDelete();
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
@@ -17,7 +17,7 @@
|
||||
@if (_UsedFromInvoice)
|
||||
{
|
||||
<ul>
|
||||
<li> style="color:indianred"این سند از فاکتور صادر شده، ویرایش مستقیم آن ممکن نیست</li>
|
||||
<li style="color:red"> این سند از فاکتور صادر شده، ویرایش مستقیم آن ممکن نیست</li>
|
||||
<br />
|
||||
</ul>
|
||||
}
|
||||
@@ -31,11 +31,12 @@
|
||||
DataProvider="CODDataProvider"
|
||||
PropertyName="Title"
|
||||
Placeholder="جستجو در کالا..."
|
||||
Disabled="!NewItem"
|
||||
OnChanged="(CODIdName<int> cod) => OnAutoCompleteChanged(cod)" />
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="col-sm-4 col-form-label" style="color:red">تعداد</label>
|
||||
<InputNumber @bind-Value="model.Count" style="text-align:center" type="text" class="form-control" placeholder="تعداد" />
|
||||
<label class="col-sm-4 col-form-label" style="color:red">مقدار</label>
|
||||
<InputNumber @bind-Value="model.Count" style="text-align:center" type="text" class="form-control" placeholder="مقدار" />
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label class="col-sm-5 col-form-label" for="inputInvoicIssueDate">تاریخ</label>
|
||||
@@ -179,15 +180,12 @@
|
||||
var rsp = await hc.Delete($"{route}/{model.ID}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
{
|
||||
var request = await rsp.Content.ReadFromJsonAsync<bool>();
|
||||
if (request)
|
||||
{
|
||||
|
||||
ActionInResultComponent result = new ActionInResultComponent();
|
||||
result.Status = ComponentStatus.success;
|
||||
result.Action = ComponentAction.delete;
|
||||
await OnMultipleOfThree.InvokeAsync(result);
|
||||
}
|
||||
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
||||
|
||||
}
|
||||
|
||||
else if (rsp.StatusCode == System.Net.HttpStatusCode.NotFound)
|
||||
|
@@ -1,6 +1,7 @@
|
||||
@using System.Reflection
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using Shared.DTOs
|
||||
@using Shared.DTOs.Warehouse
|
||||
@typeparam T
|
||||
|
||||
<div class="row">
|
||||
@@ -79,7 +80,26 @@
|
||||
}
|
||||
|
||||
}
|
||||
else if (property.Name.ToLower() == "msgtype" && item.ToString() == "Shared.DTOs.Warehouse.CirculationDto")
|
||||
{
|
||||
var convertmodel = (CirculationDto)Convert.ChangeType(item, typeof(CirculationDto));
|
||||
switch (convertmodel.Type)
|
||||
{
|
||||
case TypeCirculation.Receipt:
|
||||
<td style="background-color:#ffab00">@property.GetValue(item, null)</td>
|
||||
break;
|
||||
|
||||
case TypeCirculation.Remittance:
|
||||
<td style="background-color:#66c732">@property.GetValue(item, null)</td>
|
||||
break;
|
||||
|
||||
|
||||
|
||||
default:
|
||||
<td>@property.GetValue(item, null)</td>
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (property.Name.ToLower() == "id" && item.ToString() != "Shared.DTOs.SentTaxDto")
|
||||
{
|
||||
if (id > 0)
|
||||
|
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user