FullInvoiceItem
This commit is contained in:
@@ -80,24 +80,24 @@ namespace Back.Controllers
|
||||
if (result == null)
|
||||
return BadRequest(new List<string> { "صورتحساب یافت نشد" });
|
||||
|
||||
else
|
||||
{
|
||||
if (result.invoiceType == InvoiceType.Bidding)
|
||||
return BadRequest(new List<string> { "صورتحساب در وضعیت پیش نویس نمیتواند آماده ارسال شود" });
|
||||
//else
|
||||
//{
|
||||
// if (result.invoiceType == InvoiceType.Bidding)
|
||||
// return BadRequest(new List<string> { "صورتحساب در وضعیت پیش نویس نمیتواند آماده ارسال شود" });
|
||||
|
||||
if (await _servTaxPayer.ExistSuccessfulorSendorpendingInvoice(result))
|
||||
return BadRequest(new List<string> { "این صورتحساب قبلا به سازمان ارسال شده" });
|
||||
// if (await _servTaxPayer.ExistSuccessfulorSendorpendingInvoice(result))
|
||||
// return BadRequest(new List<string> { "این صورتحساب قبلا به سازمان ارسال شده" });
|
||||
|
||||
if ((result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair)
|
||||
&& !result.BillReference.HasValue)
|
||||
return BadRequest(new List<string> { "در وضعیت برگشت از فروش و اصلاحی باید صورتحساب مرجع وجود داشته باشد" });
|
||||
// if ((result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair)
|
||||
// && !result.BillReference.HasValue)
|
||||
// return BadRequest(new List<string> { "در وضعیت برگشت از فروش و اصلاحی باید صورتحساب مرجع وجود داشته باشد" });
|
||||
|
||||
|
||||
if ((result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair)
|
||||
&& !await _servTaxPayer.ExistSuccessfulorSendorpendingInvoice(result.invoice))
|
||||
return BadRequest(new List<string> { "در وضعیت برگشت از فروش و اصلاحی باید صورتحساب مرجع به سامانه مودیان ارسال شده باشد" });
|
||||
// if ((result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair)
|
||||
// && !await _servTaxPayer.ExistSuccessfulorSendorpendingInvoice(result.invoice))
|
||||
// return BadRequest(new List<string> { "در وضعیت برگشت از فروش و اصلاحی باید صورتحساب مرجع به سامانه مودیان ارسال شده باشد" });
|
||||
|
||||
}
|
||||
//}
|
||||
|
||||
|
||||
return Ok(await _servTaxPayer.PreparationInvoiceBeforeSending(item, result));
|
||||
|
@@ -25,12 +25,12 @@ namespace Back.Data.Models
|
||||
public string? mu { get { return cODItem != null ? cODItem.CODUnit.UnitTaxID : null; } }
|
||||
//میزان ارز
|
||||
[MaxLength(18)]
|
||||
public decimal? cfee { get { return fee / exr; } }
|
||||
public decimal? cfee { get { return exr==null || exr==0 ? null : fee / exr; } }
|
||||
//مبلغ مالیات بر ارزش افزوده
|
||||
[MaxLength(18)]
|
||||
public decimal? vam { get
|
||||
{
|
||||
return invoice?.pattern?.inp == 9 ? fee*vra/100 :
|
||||
return vra==0 ? 0 : invoice?.pattern?.inp == 9 ? fee*vra/100 :
|
||||
invoice?.pattern?.inp == 13 ? ((tcpbs+9)/100)+((prdis*vra)/100)
|
||||
: vra * adis / 100;
|
||||
} }
|
||||
|
@@ -33,39 +33,38 @@ namespace Back.Services
|
||||
}
|
||||
#endregion
|
||||
//-----------------------
|
||||
|
||||
return await invok
|
||||
var item= await invok
|
||||
.Include(inc => inc.invoiceDetails)
|
||||
.ThenInclude(inc => inc.cODItem)
|
||||
.ThenInclude(inc => inc.CODUnit)
|
||||
.Include(inc => inc.Customer)
|
||||
.Include(inc => inc.sentTax)
|
||||
//.Include(inc => inc.payments)
|
||||
.Include(inc => inc.pattern)
|
||||
.ThenInclude(inc => inc.BillType)
|
||||
.Select(s => new InvoiceDTO()
|
||||
.ThenInclude(inc => inc.BillType).FirstOrDefaultAsync();
|
||||
return new InvoiceDTO()
|
||||
{
|
||||
|
||||
IsDeleted = s.IsDeleted,
|
||||
PatternID = s.PatternID,
|
||||
PatternTitle = s.pattern.Title,
|
||||
CustomerID = s.CustomerID,
|
||||
CustomerName = s.Customer.FullName,
|
||||
ID = s.ID,
|
||||
InvoiceDate = s.InvoiceDate.ShamciToFormatShamci(),
|
||||
invoiceTypeTitle = s.invoiceType.GetEnumDisplayName(),
|
||||
invoiceType = s.invoiceType,
|
||||
Title = s.Title,
|
||||
InvoicIssueDate = s.InvoicIssueDate.ShamciToFormatShamci(),
|
||||
BillReference = s.BillReference,
|
||||
tbill = s.tbill,
|
||||
Des = s.Des,
|
||||
PreparedtoSendtoTax = s.PreparedtoSendtoTax,
|
||||
tdis = s.tdis,
|
||||
//
|
||||
tvam = s.tvam,
|
||||
Udate = s.Udate.ShamciToFormatShamci(),
|
||||
IsDeleted = item.IsDeleted,
|
||||
PatternID = item.PatternID,
|
||||
PatternTitle = item.pattern.Title,
|
||||
CustomerID = item.CustomerID,
|
||||
CustomerName = item.Customer.FullName,
|
||||
ID = item.ID,
|
||||
InvoiceDate = item.InvoiceDate.ShamciToFormatShamci(),
|
||||
invoiceTypeTitle = item.invoiceType.GetEnumDisplayName(),
|
||||
invoiceType = item.invoiceType,
|
||||
Title = item.Title,
|
||||
InvoicIssueDate = item.InvoicIssueDate.ShamciToFormatShamci(),
|
||||
BillReference = item.BillReference,
|
||||
tbill = item.tbill,
|
||||
Des = item.Des,
|
||||
PreparedtoSendtoTax = item.PreparedtoSendtoTax,
|
||||
tdis = item.tdis,
|
||||
tvam = item.tvam,
|
||||
Udate = item.Udate.ShamciToFormatShamci(),
|
||||
|
||||
InvoiceSendTaxs = s.sentTax.OrderBy(o => o.ID).Select(s => new SentTaxDto()
|
||||
InvoiceSendTaxs = item.sentTax.OrderBy(o => o.ID).Select(s => new SentTaxDto()
|
||||
{
|
||||
Date = s.Date.ShamciToFormatShamci(),
|
||||
Time = s.Time,
|
||||
@@ -76,21 +75,21 @@ namespace Back.Services
|
||||
msgInvoiceType = s.InvoiceType.GetEnumDisplayName(),
|
||||
msgSentStatus = s.SentStatus.GetEnumDisplayName()
|
||||
}).ToList(),
|
||||
//items = s.invoiceDetails.OrderBy(o => o.ID).Select(x => new InvoiceItemDTO()
|
||||
//{
|
||||
// ID = x.ID,
|
||||
// CODID = x.CODID,
|
||||
// adis = x.adis,
|
||||
// am = x.am.Value,
|
||||
// dis = x.dis,
|
||||
// fee = x.fee.Value,
|
||||
// mu = x.unitTitle,
|
||||
// sstt = x.sstt,
|
||||
// tsstam = x.tsstam,
|
||||
// vam = x.vam,
|
||||
// vra = x.vra,
|
||||
// prdis = x.prdis
|
||||
//}).ToList(),
|
||||
items = item.invoiceDetails.OrderBy(o => o.ID).Select(x => new InvoiceItemDTO()
|
||||
{
|
||||
ID = x.ID,
|
||||
CODID = x.CODID,
|
||||
adis = x.adis,
|
||||
am = x.am.Value,
|
||||
dis = x.dis,
|
||||
fee = x.fee.Value,
|
||||
mu = x.unitTitle,
|
||||
sstt = x.sstt,
|
||||
tsstam = x.tsstam,
|
||||
vam = x.vam,
|
||||
vra = x.vra,
|
||||
prdis = x.prdis
|
||||
}).ToList(),
|
||||
payments = new List<InvoicePaymentDTO>()
|
||||
//s.payments.OrderBy(o => o.ID).Select(x => new InvoicePaymentDTO()
|
||||
//{
|
||||
@@ -106,8 +105,7 @@ namespace Back.Services
|
||||
// trmn = x.trmn,
|
||||
// trn = x.acn
|
||||
//}).ToList()
|
||||
})
|
||||
.FirstOrDefaultAsync();
|
||||
};
|
||||
|
||||
|
||||
}
|
||||
|
@@ -334,16 +334,17 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="d-flex gap-2">
|
||||
<Dropdown Color="DropdownColor.Info" Direction="DropdownDirection.Dropend">
|
||||
<DropdownToggleButton>Dropend</DropdownToggleButton>
|
||||
<DropdownMenu>
|
||||
<DropdownItem Type="ButtonType.Link" @onclick="OnClickUpdate"> ثبت تغییرات</DropdownItem>
|
||||
<DropdownItem Type="ButtonType.Link" @onclick="ShowConfirmationDeleteAsync">حذف</DropdownItem>
|
||||
<DropdownItem Type="ButtonType.Link" @onclick="showFullInvoiceItem">اطلاعات تکمیلی صورتحساب</DropdownItem>
|
||||
</DropdownMenu>
|
||||
</Dropdown>
|
||||
</div>
|
||||
|
||||
|
||||
<Button class="mt-3" Color="ButtonColor.Success" @onclick="OnClickUpdate" Type="ButtonType.Button">
|
||||
ثبت تغییرات
|
||||
</Button>
|
||||
<Button class="mt-3" Color="ButtonColor.Danger" @onclick="ShowConfirmationDeleteAsync" Type="ButtonType.Button">
|
||||
حذف
|
||||
</Button>
|
||||
<Button class="mt-3" Color="ButtonColor.Primary" @onclick="showFullInvoiceItem" Type="ButtonType.Button">
|
||||
اطلاعات تکمیلی
|
||||
</Button>
|
||||
@* <Button class="mt-3" Color="ButtonColor.Primary" @onclick="ShowReport" Type="ButtonType.Button">
|
||||
pdf
|
||||
</Button>
|
||||
@@ -354,7 +355,7 @@
|
||||
}
|
||||
|
||||
</div>
|
||||
@if (invoice.invoiceType != InvoiceType.Bidding && SendInvoice)
|
||||
@if (!invoice.IsDeleted && invoice.invoiceType != InvoiceType.Bidding && SendInvoice)
|
||||
{
|
||||
<div class="form-group col-md-2">
|
||||
<br />
|
||||
|
@@ -17,10 +17,22 @@
|
||||
</Alert>
|
||||
|
||||
</div>
|
||||
<h4 class="fw-bold py-3 mb-4">
|
||||
@if (FullInvoice)
|
||||
{
|
||||
<h4 class="fw-bold py-3 mb-4">
|
||||
<span class="text-muted fw-light">سرویس ها / صورتحساب /</span> اطلاعات تکمیلی صورتحساب
|
||||
</h4>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h4 class="fw-bold py-3 mb-4">
|
||||
<span class="text-muted fw-light">سرویس ها / صورتحساب /</span> آماده سازی قبل از ارسال به سامانه مودیان
|
||||
</h4>
|
||||
<div class="row">
|
||||
</h4>
|
||||
}
|
||||
|
||||
@if(!FullInvoice)
|
||||
{
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card mb-4">
|
||||
<h4 style="color:red;" class="card-header">توجه</h4>
|
||||
@@ -32,7 +44,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card mb-4">
|
||||
@@ -188,7 +202,15 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-auto">
|
||||
@if (FullInvoice)
|
||||
{
|
||||
<button type="submit" @onclick="Send" class="btn btn-primary">ثبت تغییرات</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="submit" @onclick="Send" class="btn btn-primary">آماده سازی و ارسال</button>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -204,6 +226,7 @@
|
||||
List<ToastMessage> messages = new List<ToastMessage>();
|
||||
[Inject] protected PreloadService PreloadService { get; set; } = default!;
|
||||
public _TaxPayer.Atemplatefield? invoice { get; set; }
|
||||
public bool FullInvoice { get; set; } = true;
|
||||
// alert
|
||||
AlertColor alertColor = AlertColor.Primary;
|
||||
IconName alertIconName = IconName.CheckCircleFill;
|
||||
@@ -216,7 +239,9 @@
|
||||
await LoadData();
|
||||
PreloadService.Hide();
|
||||
|
||||
var res= hc._nav.Uri.ToString();
|
||||
if (hc._nav.Uri.ToString().Contains("FullInvoiceItem"))
|
||||
FullInvoice = true;
|
||||
else FullInvoice = false;
|
||||
await base.OnParametersSetAsync();
|
||||
|
||||
}
|
||||
@@ -232,7 +257,7 @@
|
||||
};
|
||||
public async Task Send()
|
||||
{
|
||||
if (!await CheckAuth())
|
||||
if (!FullInvoice && !await CheckAuth())
|
||||
{
|
||||
ShowMessage(ToastType.Danger, "خطا در احراز هویت سازمان مالیاتی");
|
||||
}
|
||||
@@ -244,7 +269,11 @@
|
||||
var response = await rsp.Content.ReadFromJsonAsync<bool>();
|
||||
if (response)
|
||||
{
|
||||
ShowMessage(ToastType.Success, "آماده سازی با موفقیت انجام شد");
|
||||
if(FullInvoice)
|
||||
ShowMessage(ToastType.Success, "تغییرات با موفقیت انجام شد");
|
||||
|
||||
if (!FullInvoice)
|
||||
{
|
||||
ShowMessage(ToastType.Light, "در حال ارسال صورتحساب");
|
||||
rsp = await hc.Get($"TaxPayer/SendInvoice/{InvoiceID}");
|
||||
if (rsp.IsSuccessStatusCode)
|
||||
@@ -266,8 +295,13 @@
|
||||
ShowMessage(ToastType.Danger, request[0]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
if (FullInvoice)
|
||||
ShowMessage(ToastType.Danger, "خطای در ذخیره سازی اطلاعات رخ داده");
|
||||
else
|
||||
ShowMessage(ToastType.Danger, "خطای در آماده سازی اطلاعات رخ داده");
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user