This commit is contained in:
mmrbnjd
2024-07-22 14:23:29 +03:30
parent d9fd29dbba
commit a914057557
4 changed files with 111 additions and 17 deletions

View File

@@ -180,7 +180,7 @@ namespace Back.Controllers
//صورتحساب مجموع
Tbill = result.tbill ?? null,
// تسویه روش
Setm = result.setm ?? null,
Setm = result.setm == 0 ? null : result.setm ?? null,
//نقدی پرداختی مبلغ
Cap = result.cap ?? null,
//پرداختی نسیه

View File

@@ -171,6 +171,7 @@ namespace Back.Services
{
if (item.eName == "indatim" || item.eName == "Indati2m" || item.eName == "cdcd")
item.Value = item.Value.Replace("/", "");
SetValue(item, ref InvoiceItem);
}

View File

@@ -0,0 +1,22 @@
<div class="row g-3">
<table class="table">
<thead>
<tr>
<th scope="col">متن</th>
</tr>
</thead>
<tbody>
@foreach (var item in Conditions)
{
<tr>
<td>@item</td>
</tr>
}
</tbody>
</table>
</div>
@code {
[Parameter] public string[] Conditions { get; set; }
}

View File

@@ -6,7 +6,8 @@
@inject HttpClientController hc;
<Preload LoadingText="در حال بارگذاری..." />
<ConfirmDialog @ref="dialog" />
<Toasts AutoHide="true" Delay="6000" class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
<Toasts AutoHide="true" Delay="6000" class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
<Modal @ref="modal" />
@if (FullInvoice)
{
<PageTitle>اطلاعات تکمیلی صورتحساب</PageTitle>
@@ -38,7 +39,7 @@ else
</h4>
}
@if(!FullInvoice)
@if (!FullInvoice)
{
<div class="row">
<div class="col-md-12">
@@ -68,20 +69,49 @@ else
<div class="row">
@foreach (var item in invoice?.header.filds)
{
<div class="mb-3 col-md-6">
<div class="mb-1 col-md-3">
@if (item.ModeID == 1 && item.InputBox != "autofild")
{
<label style="color:red;" class="form-label">@item.fName</label>
if (item.Des != null && !FullInvoice)
{
<div class="row">
<div class="col-md-2">
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(item.Des,item.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
</div>
<div class="col-md-10">
<label style="color:red;" class="form-label">@item.fName</label>
</div>
</div>
}
else
{
<label style="color:red;" class="form-label">@item.fName</label>
}
}
else
{
<label class="form-label">@item.fName</label>
if (item.Des != null && !FullInvoice)
{
<div class="row">
<div class="col-md-2">
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(item.Des,item.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
</div>
<div class="col-md-10">
<label class="form-label">@item.fName</label>
</div>
</div>
}
else
{
<label class="form-label">@item.fName</label>
}
}
@if (item.InputBox == "fromdb")
{
<select @bind="item.Value" class="form-control" aria-label="Default select example">
<option style="color: #b5b5b5; " selected>@item.fName...</option>
<option style="color: #b5b5b5; " selected>@item.fName...</option>
@foreach (var itema in item.DefVals)
{
if (itema.ID == item.Value)
@@ -139,14 +169,44 @@ else
<div class="row">
@foreach (var itemB in item.filds)
{
<div class="mb-3 col-md-6">
<div class="mb-1 col-md-3">
@if (itemB.ModeID == 1 && itemB.InputBox != "autofild")
{
<label style="color:red;" class="form-label">@itemB.fName</label>
if (itemB.Des != null && !FullInvoice)
{
<div class="row">
<div class="col-md-2">
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(itemB.Des,itemB.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
</div>
<div class="col-md-10">
<label style="color:red;" class="form-label">@itemB.fName</label>
</div>
</div>
}
else
{
<label style="color:red;" class="form-label">@itemB.fName</label>
}
}
else
{
<label class="form-label">@itemB.fName</label>
if (itemB.Des != null && !FullInvoice)
{
<div class="row">
<div class="col-md-2">
<Badge style="cursor: pointer;" @onclick="()=>ShowConditions(itemB.Des,itemB.fName)" Color="BadgeColor.Primary" IndicatorType="BadgeIndicatorType.RoundedPill">شرایط خاص</Badge>
</div>
<div class="col-md-10">
<label class="form-label">@itemB.fName</label>
</div>
</div>
}
else
{
<label class="form-label">@itemB.fName</label>
}
}
@if (itemB.InputBox == "fromdb")
{
@@ -201,7 +261,7 @@ else
</div>
@if (invoice!=null)
@if (invoice != null)
{
@* action *@
<div class="row">
@@ -229,6 +289,7 @@ else
@code {
private Modal modal = default!;
private ConfirmDialog dialog = default!;
[Parameter] public int? InvoiceID { get; set; }
List<ToastMessage> messages = new List<ToastMessage>();
@@ -271,14 +332,15 @@ else
}
else
{
var rsp = await hc.Post<_TaxPayer.Atemplatefield>($"TaxPayer/PreparationInvoiceBeforeSending", invoice);
if (rsp.IsSuccessStatusCode)
{
var response = await rsp.Content.ReadFromJsonAsync<bool>();
if (response)
{
if(FullInvoice)
ShowMessage(ToastType.Success, "تغییرات با موفقیت انجام شد");
if (FullInvoice)
ShowMessage(ToastType.Success, "تغییرات با موفقیت انجام شد");
if (!FullInvoice)
{
@@ -308,7 +370,7 @@ else
else
{
if (FullInvoice)
ShowMessage(ToastType.Danger, "خطای در ذخیره سازی اطلاعات رخ داده");
ShowMessage(ToastType.Danger, "خطای در ذخیره سازی اطلاعات رخ داده");
else
ShowMessage(ToastType.Danger, "خطای در آماده سازی اطلاعات رخ داده");
}
@@ -363,4 +425,13 @@ else
}
}
private async Task ShowConditions(string[]? Conditions, string fild)
{
if (Conditions != null)
{
var parameters = new Dictionary<string, object>();
parameters.Add("Conditions", Conditions);
await modal.ShowAsync<CUSComponent.SpecialConditions>(title: $"شرایط خاص برای فیلد {fild}", parameters: parameters);
}
}
}