...
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
@inject HttpClientController hc;
|
@inject HttpClientController hc;
|
||||||
@inject Fixedvalues fv;
|
@inject Fixedvalues fv;
|
||||||
<ConfirmDialog @ref="dialog" />
|
<ConfirmDialog @ref="dialog" />
|
||||||
<Toasts class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
|
<Toasts AutoHide="true" Delay="6000" class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
@* alert *@
|
@* alert *@
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
<Modal @ref="modal" />
|
<Modal @ref="modal" />
|
||||||
<Preload LoadingText="در حال بارگذاری..." />
|
<Preload LoadingText="در حال بارگذاری..." />
|
||||||
<ConfirmDialog @ref="dialog" />
|
<ConfirmDialog @ref="dialog" />
|
||||||
|
<Toasts AutoHide="true" Delay="6000" class="p-3" Messages="messages" Placement="ToastsPlacement.TopRight" />
|
||||||
<form>
|
<form>
|
||||||
@* alert *@
|
@* alert *@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -19,7 +19,28 @@
|
|||||||
</Alert>
|
</Alert>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@if (InvoiceID == 0 || InvoiceID == null ? false : true)
|
||||||
|
{
|
||||||
|
<div class="row g-3">
|
||||||
|
<div class="col-md-1">
|
||||||
|
<Button Color="ButtonColor.Success" Outline="true"> فاکتور </Button>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-2">
|
||||||
|
<Button Color="ButtonColor.Info" Disabled="true" Outline="true"> برگشت از فروش </Button>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-1">
|
||||||
|
<Button Color="ButtonColor.Primary" Disabled="true" Outline="true"> اصلاح </Button>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-1">
|
||||||
|
<Button Color="ButtonColor.Danger" Disabled="true" Outline="true"> ابطال </Button>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-1">
|
||||||
|
<Button Color="ButtonColor.Dark" Outline="true"> لغو </Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<hr class="hr" />
|
||||||
|
}
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label class="col-sm-4 col-form-label" style="color:red" for="inputTitle">عنوان</label>
|
<label class="col-sm-4 col-form-label" style="color:red" for="inputTitle">عنوان</label>
|
||||||
@@ -27,7 +48,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<label class="col-sm-4 col-form-label" for="inputinvoiceTypeTitle">نوع</label>
|
<label class="col-sm-4 col-form-label" for="inputinvoiceTypeTitle">نوع</label>
|
||||||
<select @bind="invoice.invoiceType" class="form-control" aria-label="Default select example" disabled id="inputinvoiceTypeTitle">
|
<select @bind="invoice.invoiceType" class="form-control" aria-label="Default select example" disabled id="inputinvoiceTypeTitle">
|
||||||
@if (!invoice.invoiceType.HasValue)
|
@if (!invoice.invoiceType.HasValue)
|
||||||
{
|
{
|
||||||
<option value="0" style="color: #b5b5b5" selected>انتخاب کنید...</option>
|
<option value="0" style="color: #b5b5b5" selected>انتخاب کنید...</option>
|
||||||
@@ -122,55 +143,68 @@
|
|||||||
<InputText style=" text-align: center;" @bind-Value="invoice.InvoiceDate" type="text" class="form-control" id="inputInvoiceDate" placeholder="تاریخ" />
|
<InputText style=" text-align: center;" @bind-Value="invoice.InvoiceDate" type="text" class="form-control" id="inputInvoiceDate" placeholder="تاریخ" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if (InvoiceID == 0 || InvoiceID == null ? false : true)
|
@if (InvoiceID == 0 || InvoiceID == null ? false : true)
|
||||||
{
|
{
|
||||||
|
<br /> <hr class="hr" />
|
||||||
<br /> <hr class="hr" />
|
<div class="row g-3">
|
||||||
<div class="row g-3">
|
@* <Tabs NavStyle="NavStyle.VerticalUnderline">
|
||||||
<Tabs NavStyle="NavStyle.VerticalUnderline">
|
<Tab Title="آیتم ها" IsActive="true">
|
||||||
<Tab Title="آیتم ها" IsActive="true">
|
<Content> *@
|
||||||
<Content>
|
|
||||||
<div class="row g-3">
|
|
||||||
<div class="form-group col-md-11">
|
|
||||||
@if (InvoiceID.HasValue && invoice.items.Count > 0)
|
|
||||||
{
|
|
||||||
<LGridInvoiceItem InvoiceID="InvoiceID.Value" OnMultipleOfThree="EventCallback.Factory.Create<string>(this, CallBack)" InvoiceItems="invoice.items" />
|
|
||||||
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
<div class="form-group col-md-1">
|
|
||||||
|
|
||||||
<Button class="mt-3" Color="ButtonColor.Dark" @onclick="NewItemClick" Outline="true" Type="ButtonType.Button">
|
|
||||||
+
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</Content>
|
|
||||||
</Tab>
|
|
||||||
@* <Tab Title="پرداختی ها">
|
|
||||||
<Content>
|
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
<div class="form-group col-md-11">
|
<div class="form-group col-md-11">
|
||||||
<LGridInvoicePayment InvoicePays="invoice.payments" />
|
@if (InvoiceID.HasValue && invoice.items.Count > 0)
|
||||||
</div>
|
{
|
||||||
<div class="form-group col-md-1">
|
<LGridInvoiceItem InvoiceID="InvoiceID.Value" OnMultipleOfThree="EventCallback.Factory.Create<string>(this, CallBack)" InvoiceItems="invoice.items" />
|
||||||
|
|
||||||
<Button class="mt-3" Color="ButtonColor.Dark" @onclick="OnClickDelete" Outline="true" Type="ButtonType.Button">
|
}
|
||||||
+
|
</div>
|
||||||
</Button>
|
<div class="form-group col-md-1">
|
||||||
</div>
|
|
||||||
|
<Button class="mt-3" Color="ButtonColor.Dark" @onclick="NewItemClick" Outline="true" Type="ButtonType.Button">
|
||||||
|
+
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@* </Content>
|
||||||
|
</Tab> *@
|
||||||
|
@* <Tab Title="پرداختی ها">
|
||||||
|
<Content>
|
||||||
|
<div class="row g-3">
|
||||||
|
<div class="form-group col-md-11">
|
||||||
|
<LGridInvoicePayment InvoicePays="invoice.payments" />
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-1">
|
||||||
|
|
||||||
</Content>
|
<Button class="mt-3" Color="ButtonColor.Dark" @onclick="OnClickDelete" Outline="true" Type="ButtonType.Button">
|
||||||
</Tab> *@
|
+
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</Tabs>
|
|
||||||
</div>
|
</Content>
|
||||||
|
</Tab> *@
|
||||||
|
|
||||||
|
@* </Tabs> *@
|
||||||
|
</div>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
<br />
|
||||||
<hr class="hr" />
|
<hr class="hr" />
|
||||||
|
<div class="row g-3">
|
||||||
|
<div class="form-group col-md-4">
|
||||||
|
<label class="col-sm-6 col-form-label">مجموع تخفیف</label>
|
||||||
|
<CurrencyInput TValue="decimal?" @bind-Value="invoice.tdis" Locale="fa-Ir" Placeholder="مجموع تخفیف" readonly />
|
||||||
|
</div>
|
||||||
|
<div class="form-group col-md-4">
|
||||||
|
<label class="col-sm-6 col-form-label">مجموع مالیات</label>
|
||||||
|
<CurrencyInput TValue="decimal?" @bind-Value="invoice.tvam" Locale="fa-Ir" Placeholder="مجموع مالیات" readonly />
|
||||||
|
</div> <div class="form-group col-md-4">
|
||||||
|
<label class="col-sm-6 col-form-label">مجموع صورتحساب</label>
|
||||||
|
<CurrencyInput TValue="decimal?" @bind-Value="invoice.tbill" Locale="fa-Ir" Placeholder="مجموع صورتحساب" readonly />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div class="row g-3">
|
<div class="row g-3">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
@@ -184,7 +218,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<br />
|
<br />
|
||||||
@if(InvoiceID == 0 || InvoiceID == null)
|
@if (InvoiceID == 0 || InvoiceID == null)
|
||||||
{
|
{
|
||||||
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickAdd" Type="ButtonType.Button">
|
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickAdd" Type="ButtonType.Button">
|
||||||
جدید
|
جدید
|
||||||
@@ -211,7 +245,7 @@
|
|||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
[Inject] ToastService ToastService { get; set; } = default!;
|
List<ToastMessage> messages = new List<ToastMessage>();
|
||||||
private ConfirmDialog dialog = default!;
|
private ConfirmDialog dialog = default!;
|
||||||
private Modal modal = default!;
|
private Modal modal = default!;
|
||||||
[Inject] protected PreloadService PreloadService { get; set; } = default!;
|
[Inject] protected PreloadService PreloadService { get; set; } = default!;
|
||||||
@@ -245,7 +279,7 @@
|
|||||||
{
|
{
|
||||||
invoice = new InvoiceDTO()
|
invoice = new InvoiceDTO()
|
||||||
{
|
{
|
||||||
invoiceType=InvoiceType.Bidding,
|
invoiceType = InvoiceType.Bidding,
|
||||||
ID = 0,
|
ID = 0,
|
||||||
InvoiceDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
|
InvoiceDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
|
||||||
InvoicIssueDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
|
InvoicIssueDate = DateTime.Now.ConvertMiladiToShamsiinFront().ShamciToFormatShamciinFront(),
|
||||||
@@ -261,6 +295,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
@functions {
|
@functions {
|
||||||
|
private void ShowMessage(ToastType toastType, string msg) => messages.Add(CreateToastMessage(toastType, msg));
|
||||||
|
|
||||||
|
private ToastMessage CreateToastMessage(ToastType toastType, string msg)
|
||||||
|
=> new ToastMessage
|
||||||
|
{
|
||||||
|
Type = toastType,
|
||||||
|
Message = msg,
|
||||||
|
};
|
||||||
private async Task NewItemClick()
|
private async Task NewItemClick()
|
||||||
{
|
{
|
||||||
if (InvoiceID.HasValue)
|
if (InvoiceID.HasValue)
|
||||||
@@ -382,7 +424,7 @@
|
|||||||
|
|
||||||
if (request)
|
if (request)
|
||||||
{
|
{
|
||||||
ToastService.Notify(new ToastMessage(ToastType.Success, $"عملیات با موفقیت انجام شد"));
|
ShowSuccessAlert("ویرایش با موفقیت انجام شد");
|
||||||
|
|
||||||
}
|
}
|
||||||
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
|
||||||
@@ -426,7 +468,7 @@
|
|||||||
{
|
{
|
||||||
CustomerID = invoice.CustomerID,
|
CustomerID = invoice.CustomerID,
|
||||||
Des = invoice.Des,
|
Des = invoice.Des,
|
||||||
InvoiceDate = invoice.InvoiceDate.Replace("/",""),
|
InvoiceDate = invoice.InvoiceDate.Replace("/", ""),
|
||||||
InvoicIssueDate = invoice.InvoicIssueDate.Replace("/", ""),
|
InvoicIssueDate = invoice.InvoicIssueDate.Replace("/", ""),
|
||||||
PatternID = invoice.PatternID,
|
PatternID = invoice.PatternID,
|
||||||
Title = invoice.Title
|
Title = invoice.Title
|
||||||
@@ -495,8 +537,8 @@
|
|||||||
{ ShowDangerAlert("تاریخ صدور نمی تواند از امروز جلوتر باشد"); return false; }
|
{ ShowDangerAlert("تاریخ صدور نمی تواند از امروز جلوتر باشد"); return false; }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (invoice.PatternID.HasValue)
|
if (invoice.PatternID.HasValue && invoice.PatternID > 0)
|
||||||
if (invoice.PatternID <= 0 || !Patterns.Any(w => w.ID == invoice.PatternID.Value))
|
if (!Patterns.Any(w => w.ID == invoice.PatternID.Value))
|
||||||
{ ShowDangerAlert("شناسه الگو صحیح نمی باشد"); return false; }
|
{ ShowDangerAlert("شناسه الگو صحیح نمی باشد"); return false; }
|
||||||
|
|
||||||
if (invoice.CustomerID == null || invoice.CustomerID <= 0 || !Cus.Any(w => w.ID == invoice.CustomerID))
|
if (invoice.CustomerID == null || invoice.CustomerID <= 0 || !Cus.Any(w => w.ID == invoice.CustomerID))
|
||||||
@@ -519,7 +561,7 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ToastService.Notify(new ToastMessage(ToastType.Secondary, $"عملیات حذف متوقف شد"));
|
ShowMessage(ToastType.Secondary, "عملیات حذف متوقف شد");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user