copy invoice

This commit is contained in:
mmrbnjd
2024-07-23 22:30:52 +03:30
parent 87aee3685b
commit 1dcadf1a35
6 changed files with 129 additions and 38 deletions

View File

@@ -56,7 +56,7 @@
@if (InvoiceID == 0 || InvoiceID == null ? false : true && !invoice.IsDeleted)
{
<div class="row g-3">
<div class="form-group col-md-9">
<div class="multi-button">
@switch (invoice.invoiceType)
{
@@ -88,10 +88,17 @@
break; *@
}
</div>
</div>
<div class="form-group col-md-3">
<div class="multi-button">
<Button class="button" style="color:white;" @onclick="CopyInvoice" id="sbg"><span>کپی صورتحساب</span></Button>
</div>
</div>
</div>
<br />
@if (invoice.InvoiceSendTaxs.Count > 0)
{
@@ -465,6 +472,28 @@
}
}
private async Task CopyInvoice()
{
var rsp = await hc.Post($"Invoice/CopyInvoice/{InvoiceID}");
if (rsp.IsSuccessStatusCode)
{
var resinvoice = await rsp.Content.ReadFromJsonAsync<InvoiceDTO>();
if (resinvoice != null)
{
invoice = resinvoice;
InvoiceID = resinvoice.ID;
ShowSuccessAlert("صورتحساب جدید با موفقیت ایجاد شد");
}
else ShowDangerAlert("خطایی در اجرای عملیات رخ داده");
}
else
{
var request = await rsp.Content.ReadFromJsonAsync<List<string>>();
ShowDangerAlert(request[0]);
}
}
private async Task ChangeStatus(int type)
{

View File

@@ -136,6 +136,10 @@ code {
background-color: rgb(242 42 42);
border: 1px solid rgb(242 42 42);
}
#sbg {
background-color: rgb(122, 188, 188);
border: 1px solid rgb(122, 188, 188);
}
#sred1 {
background-color: #ff7373;
border: 1px solid #ff7373;