tax
This commit is contained in:
@@ -23,7 +23,7 @@
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="TaxCollectData.Library" Version="0.0.15" />
|
||||
<PackageReference Include="TaxCollectData.Library" Version="0.0.20" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<Reference Include="Service">
|
||||
<HintPath>..\..\Dlls\Service.dll</HintPath>
|
||||
<HintPath>C:\Dlls\Service.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
|
||||
|
@@ -188,22 +188,47 @@ namespace Back.Controllers
|
||||
if (result.inty == 1 && result.inp == 1)
|
||||
header = new InvoiceHeaderDto
|
||||
{
|
||||
//نوع شخص خریدار
|
||||
Tob = result.tob,
|
||||
//شماره منحصر به فرد مالیاتی
|
||||
Taxid = _actionTaxPayer.GenerateTaxid(result.inno, result.InvoiceDate.Replace("/", "").Trim()),
|
||||
//زمان صدور
|
||||
Indatim = result.indatim ?? null,
|
||||
//زمان ایجاد
|
||||
Indati2m = result.Indati2m ?? null,
|
||||
// صورتحساب نوع *
|
||||
Inty = result.inty ?? 1,
|
||||
//سریال صورت حساب
|
||||
Inno = string.IsNullOrEmpty(result.inno) ? null : result.inno,
|
||||
//شماره منحصر به فرد مالیاتی صورتحساب مرجع
|
||||
Irtaxid = result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair ? result.invoice.taxid
|
||||
: result.invoiceType == InvoiceType.Cancellation ? result.taxid : null,
|
||||
//الگوی صورتحساب *
|
||||
Inp = result.inp ?? 1,
|
||||
//موضوع صورتحساب *
|
||||
Ins = result.ins ?? 1,
|
||||
//شماره منحصر به فرد مالیاتی
|
||||
Taxid = _actionTaxPayer.GenerateTaxid(result.inno, result.InvoiceDate.Replace("/", "").Trim()),
|
||||
//سریال صورت حساب
|
||||
Inno = string.IsNullOrEmpty(result.inno) ? null : result.inno,
|
||||
//شماره اقتصادی فروشنده به جاش شناسه ملی داده شد
|
||||
Tins = string.IsNullOrEmpty(result.tins) ? null : result.tins,
|
||||
//نوع شخص خریدار
|
||||
Tob = result.tob,
|
||||
//شماره/شناسه ملی/شناسه مشارکت مدنی / کد فراگیر
|
||||
Bid = string.IsNullOrEmpty(result.bid) ? null : result.bid,
|
||||
//شماره اقتصادی خریدار
|
||||
Tinb = string.IsNullOrEmpty(result.tinb) ? null : result.tinb,
|
||||
//کد شعبه فروشنده
|
||||
Sbc = string.IsNullOrEmpty(result.sbc) ? null : result.sbc,
|
||||
//کد پستی خریدار
|
||||
Bpc = string.IsNullOrEmpty(result.bpc) ? null : result.bpc,
|
||||
//کد شعبه خریدار
|
||||
Bbc = string.IsNullOrEmpty(result.bbc) ? null : result.bbc,
|
||||
//شماره پروانه گمرکی
|
||||
Scln = string.IsNullOrEmpty(result.scln) ? null : result.scln,
|
||||
//کد گمرک محل اظهار فروشنده
|
||||
Scc = string.IsNullOrEmpty(result.scc) ? null : result.scc,
|
||||
//شناسه یکتای ثبت قزارداد فروشنده
|
||||
Crn = string.IsNullOrEmpty(result.crn) ? null : result.crn,
|
||||
//مجموع مبلغ قبل از کسر تخفیف
|
||||
Tprdis = result.tprdis ?? null,
|
||||
//مجموع تخفیفات
|
||||
Tdis = result.tdis ?? null,
|
||||
// مجموع مبلغ پس از کسر تخفیف
|
||||
Tadis = result.tadis ?? null,
|
||||
//مجموع مالیات بر ارزش افزوده
|
||||
@@ -218,129 +243,15 @@ namespace Back.Controllers
|
||||
Cap = result.cap ?? null,
|
||||
//پرداختی نسیه
|
||||
Insp = result.insp ?? null,
|
||||
//مجموع تخفیفات
|
||||
Tdis = result.tdis ?? null,
|
||||
//شماره منحصر به فرد مالیاتی صورتحساب مرجع
|
||||
Irtaxid = result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair ? result.invoice.taxid : null,
|
||||
//شماره اقتصادی خریدار
|
||||
Tinb = string.IsNullOrEmpty(result.tinb) ? null : result.tinb ,
|
||||
//زمان صدور
|
||||
Indatim = result.indatim ?? null,
|
||||
//زمان ایجاد
|
||||
Indati2m = result.Indati2m ?? null,
|
||||
//کد شعبه خریدار
|
||||
Bbc = string.IsNullOrEmpty(result.bbc) ? null : result.bbc,
|
||||
//مجموع سهم مالیات بر ارزش افزوده از پرداخت
|
||||
Tvop = result.tvop ?? null,
|
||||
Crn = string.IsNullOrEmpty(result.crn) ? null : result.crn ,
|
||||
//مالیات موضوع 17
|
||||
Tax17 = string.IsNullOrEmpty(result.seventeentax) ? null : Convert.ToDecimal(result.seventeentax),
|
||||
Scc = string.IsNullOrEmpty(result.scc) ? null : result.scc ,
|
||||
Scln = string.IsNullOrEmpty(result.scln) ? null : result.scln ,
|
||||
Bid = string.IsNullOrEmpty(result.bid) ? null : result.bid ,
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
//if (header.Inty == 1 && header.Inp == 2)
|
||||
// header = new InvoiceHeaderDto
|
||||
// {
|
||||
// //نوع شخص خریدار
|
||||
// Tob = result.tob,
|
||||
// // صورتحساب نوع *
|
||||
// Inty = result.inty ?? 1,
|
||||
// //الگوی صورتحساب *
|
||||
// Inp = result.inp ?? 1,
|
||||
// //موضوع صورتحساب *
|
||||
// Ins = result.ins ?? 1,
|
||||
// //شماره منحصر به فرد مالیاتی
|
||||
// Taxid = _actionTaxPayer.GenerateTaxid(result.inno, result.InvoiceDate.Replace("/", "").Trim()),
|
||||
// //سریال صورت حساب
|
||||
// Inno = result.inno ?? null,
|
||||
// //شماره اقتصادی فروشنده به جاش شناسه ملی داده شد
|
||||
// Tins = result.tins ?? null,
|
||||
// //مجموع مبلغ قبل از کسر تخفیف
|
||||
// Tprdis = result.tprdis ?? null,
|
||||
// // مجموع مبلغ پس از کسر تخفیف
|
||||
// Tadis = result.tadis ?? null,
|
||||
// //مجموع مالیات بر ارزش افزوده
|
||||
// Tvam = result.tvam ?? null,
|
||||
// // مجموع سایر مالیات، عوارض و وجوه قانونی
|
||||
// Todam = result.todam ?? null,
|
||||
// //صورتحساب مجموع
|
||||
// Tbill = result.tbill ?? null,
|
||||
// // تسویه روش
|
||||
// Setm = result.setm ?? null,
|
||||
// //نقدی پرداختی مبلغ
|
||||
// Cap = result.cap ?? null,
|
||||
// //پرداختی نسیه
|
||||
// Insp = result.insp ?? null,
|
||||
// //مجموع تخفیفات
|
||||
// Tdis = result.tdis ?? null,
|
||||
// //شماره منحصر به فرد مالیاتی صورتحساب مرجع
|
||||
// Irtaxid = result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair ? result.invoice.taxid : null,
|
||||
// //شماره اقتصادی خریدار
|
||||
// Tinb = result.tinb ?? null,
|
||||
// //زمان صدور
|
||||
// Indatim = result.indatim ?? null,
|
||||
// //زمان ایجاد
|
||||
// Indati2m = result.Indati2m ?? null,
|
||||
// //کد شعبه خریدار
|
||||
// Bbc = result.bbc ?? null,
|
||||
// Tvop = result.tvop ?? null,
|
||||
// Crn = result.crn ?? null,
|
||||
// Tax17 = string.IsNullOrEmpty(result.seventeentax) ? null : Convert.ToDecimal(result.seventeentax),
|
||||
// Scc = result.scc ?? null,
|
||||
// Scln = result.scln ?? null,
|
||||
// Bpn = result.bpn ?? null,
|
||||
// Bid = result.bid ?? null,
|
||||
// };
|
||||
//if (header.Inty == 1 && header.Inp == 3)
|
||||
// header = new InvoiceHeaderDto
|
||||
// {
|
||||
// //نوع شخص خریدار
|
||||
// Tob = result.tob,
|
||||
// // صورتحساب نوع *
|
||||
// Inty = result.inty ?? 1,
|
||||
// //الگوی صورتحساب *
|
||||
// Inp = result.inp ?? 1,
|
||||
// //موضوع صورتحساب *
|
||||
// Ins = result.ins ?? 1,
|
||||
// //شماره منحصر به فرد مالیاتی
|
||||
// Taxid = _actionTaxPayer.GenerateTaxid(result.inno, result.InvoiceDate.Replace("/", "").Trim()),
|
||||
// //سریال صورت حساب
|
||||
// Inno = result.inno ?? null,
|
||||
// //شماره اقتصادی فروشنده به جاش شناسه ملی داده شد
|
||||
// Tins = result.tins ?? null,
|
||||
// //مجموع مبلغ قبل از کسر تخفیف
|
||||
// Tprdis = result.tprdis ?? null,
|
||||
// // مجموع مبلغ پس از کسر تخفیف
|
||||
// Tadis = result.tadis ?? null,
|
||||
// //مجموع مالیات بر ارزش افزوده
|
||||
// Tvam = result.tvam ?? null,
|
||||
// // مجموع سایر مالیات، عوارض و وجوه قانونی
|
||||
// Todam = result.todam ?? null,
|
||||
// //صورتحساب مجموع
|
||||
// Tbill = result.tbill ?? null,
|
||||
// // تسویه روش
|
||||
// Setm = result.setm ?? null,
|
||||
// //نقدی پرداختی مبلغ
|
||||
// Cap = result.cap ?? null,
|
||||
// //پرداختی نسیه
|
||||
// Insp = result.insp ?? null,
|
||||
// //مجموع تخفیفات
|
||||
// Tdis = result.tdis ?? null,
|
||||
// //شماره منحصر به فرد مالیاتی صورتحساب مرجع
|
||||
// Irtaxid = result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair ? result.invoice.taxid : null,
|
||||
// //شماره اقتصادی خریدار
|
||||
// Tinb = result.tinb ?? null,
|
||||
// //زمان صدور
|
||||
// Indatim = result.indatim ?? null,
|
||||
// //زمان ایجاد
|
||||
// Indati2m = result.Indati2m ?? null,
|
||||
// //کد شعبه خریدار
|
||||
// Bbc = result.bbc ?? null,
|
||||
// Tvop = result.tvop ?? null,
|
||||
// Crn = result.crn ?? null,
|
||||
// Tax17 = string.IsNullOrEmpty(result.seventeentax) ? null : Convert.ToDecimal(result.seventeentax),
|
||||
// Bid = result.bid ?? null,
|
||||
// };
|
||||
else return BadRequest(new List<string> { "این الگو فعلا در دسترس نمی باشد" });
|
||||
#endregion header
|
||||
List<InvoiceBodyDto> InvoiceBody = new List<InvoiceBodyDto>();
|
||||
@@ -388,91 +299,6 @@ namespace Back.Controllers
|
||||
|
||||
|
||||
};
|
||||
|
||||
//else if (header.Inty == 1 && header.Inp == 2)
|
||||
// item = new InvoiceBodyDto
|
||||
// {
|
||||
// //شناسه کالا / خدمت
|
||||
// Sstid = bitem.sstid,
|
||||
// //شرح کاال/خدمت
|
||||
// Sstt = bitem.sstt,
|
||||
// //واحد اندازه گیری
|
||||
// Mu = bitem.mu,
|
||||
// // تعداد
|
||||
// Am = bitem.am,
|
||||
// // مبلغ واحد
|
||||
// Fee = bitem.fee,
|
||||
// //مبلغ قبل از تخفیف
|
||||
// Prdis = bitem.prdis,
|
||||
// //مبلغ تخفیف
|
||||
// Dis = bitem.dis,
|
||||
// //مبلغ بعد از تخفیف
|
||||
// Adis = bitem.adis,
|
||||
// //نرخ مالیات بر ارزش افزوده
|
||||
// Vra = bitem.vra,
|
||||
// //مبلغ مالیات بر ارزش افزوده
|
||||
// Vam = bitem.vam,
|
||||
// // مبلغ کل کالا / خدمت
|
||||
// Tsstam = bitem.tsstam,
|
||||
// Cfee = bitem.cfee,
|
||||
// Cut = bitem.cut,
|
||||
// Exr = bitem.exr,
|
||||
// Odt = bitem.odt,
|
||||
// Odr = bitem.odr,
|
||||
// Odam = bitem.odam,
|
||||
// Olt = bitem.olt,
|
||||
// Olr = bitem.olr,
|
||||
// Olam = bitem.olam,
|
||||
// Cop = bitem.cop,
|
||||
// Vop = bitem.vop,
|
||||
// Bsrn = bitem.bsrn,
|
||||
|
||||
|
||||
// };
|
||||
|
||||
//else if (header.Inty == 1 && header.Inp == 3)
|
||||
// item = new InvoiceBodyDto
|
||||
// {
|
||||
// //شناسه کالا / خدمت
|
||||
// Sstid = bitem.sstid,
|
||||
// //شرح کاال/خدمت
|
||||
// Sstt = bitem.sstt,
|
||||
// //واحد اندازه گیری
|
||||
// Mu = bitem.mu,
|
||||
// // تعداد
|
||||
// Am = bitem.am,
|
||||
// // مبلغ واحد
|
||||
// Fee = bitem.fee,
|
||||
// //مبلغ قبل از تخفیف
|
||||
// Prdis = bitem.prdis,
|
||||
// //مبلغ تخفیف
|
||||
// Dis = bitem.dis,
|
||||
// //مبلغ بعد از تخفیف
|
||||
// Adis = bitem.adis,
|
||||
// //نرخ مالیات بر ارزش افزوده
|
||||
// Vra = bitem.vra,
|
||||
// //مبلغ مالیات بر ارزش افزوده
|
||||
// Vam = bitem.vam,
|
||||
// // مبلغ کل کالا / خدمت
|
||||
// Tsstam = bitem.tsstam,
|
||||
// Cfee = bitem.cfee,
|
||||
// Cut = bitem.cut,
|
||||
// Exr = bitem.exr,
|
||||
// Odt = bitem.odt,
|
||||
// Odr = bitem.odr,
|
||||
// Odam = bitem.odam,
|
||||
// Olt = bitem.olt,
|
||||
// Olr = bitem.olr,
|
||||
// Olam = bitem.olam,
|
||||
// Cop = bitem.cop,
|
||||
// Vop = bitem.vop,
|
||||
// Bsrn = bitem.bsrn,
|
||||
// Consfee = bitem.consfee,
|
||||
// Spro = bitem.spro,
|
||||
// Bros = bitem.bros,
|
||||
// Tcpbs = bitem.tcpbs,
|
||||
// };
|
||||
|
||||
#endregion
|
||||
InvoiceBody.Add(item);
|
||||
}
|
||||
|
@@ -16,9 +16,7 @@ namespace Back.Data.Models
|
||||
#endregion
|
||||
|
||||
#region autofild
|
||||
//سریال صورتحساب داخلی حافظه مالیاتی
|
||||
[MaxLength(10)]
|
||||
public string? inno { get { return ID.ToString("0000000000"); } }
|
||||
|
||||
//تاریخ و زمان صدور صورتحساب )میالدی(
|
||||
[MaxLength(13)]
|
||||
public long? indatim { get { return new DateTimeOffset(InvoicIssueDate.Trim().ToMiladi()).ToUnixTimeMilliseconds(); } }
|
||||
@@ -98,6 +96,9 @@ namespace Back.Data.Models
|
||||
#endregion
|
||||
|
||||
#region fild
|
||||
//سریال صورتحساب داخلی حافظه مالیاتی
|
||||
[MaxLength(10)]
|
||||
public string? inno { get; set; }
|
||||
public string Title { get; set; }
|
||||
public string? Des { get; set; }
|
||||
public InvoiceType invoiceType { get; set; }
|
||||
|
@@ -63,7 +63,7 @@ namespace Back.Services
|
||||
tdis = item.tdis,
|
||||
tvam = item.tvam,
|
||||
Udate = item.Udate.ShamciToFormatShamci(),
|
||||
|
||||
inno = item.inno,
|
||||
InvoiceSendTaxs = item.sentTax.OrderBy(o => o.ID).Select(s => new SentTaxDto()
|
||||
{
|
||||
Date = s.Date.ShamciToFormatShamci(),
|
||||
@@ -116,7 +116,7 @@ namespace Back.Services
|
||||
.Get(w => w.CompanyID == CompanyID && !w.IsDeleted/* && !w.BillReference.HasValue*/);
|
||||
|
||||
if (itemSerch.InvoiceID != null)
|
||||
invok = invok.Where(w => w.ID == itemSerch.InvoiceID);
|
||||
invok = invok.Where(w => w.ID == itemSerch.InvoiceID || w.inno == itemSerch.InvoiceID.ToString());
|
||||
|
||||
if (itemSerch.CustomerID != null)
|
||||
invok = invok.Where(w => w.CustomerID == itemSerch.CustomerID);
|
||||
|
@@ -176,6 +176,11 @@ namespace Back.Services
|
||||
SetValue(item, ref InvoiceItem);
|
||||
|
||||
}
|
||||
// سریال صورتحساب
|
||||
var innoS=await _invoiceRepo.Get(w => w.CompanyID == InvoiceItem.CompanyID).Select(s => s.inno).ToListAsync();
|
||||
var result = Enumerable.Range(1, 1000000000) .Except(innoS.Select(t => t).ToList().Select(int.Parse).ToList()).FirstOrDefault();
|
||||
InvoiceItem.inno = result.ToString("0000000000");
|
||||
|
||||
if (await _invoiceRepo.UpdateAsync(InvoiceItem))
|
||||
{
|
||||
foreach (var Bitem in FildItems.Bodys)
|
||||
|
9
Back/Validations/TaxSystemRules.cs
Normal file
9
Back/Validations/TaxSystemRules.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using FluentValidation;
|
||||
using TaxCollectData.Library.Dto.Content;
|
||||
|
||||
namespace Back.Validations
|
||||
{
|
||||
public class TaxSystemRules : AbstractValidator<Tuple<InvoiceHeaderDto, List<InvoiceBodyDto>, PaymentDto>>
|
||||
{
|
||||
}
|
||||
}
|
@@ -84,6 +84,11 @@ namespace Shared.DTOs
|
||||
// public ICollection<InvoiceStatusDto> Invoicestatuschanges { get; set; }
|
||||
public ICollection<SentTaxDto> InvoiceSendTaxs { get; set; }=new List<SentTaxDto> { };
|
||||
|
||||
[MaxLength(10)]
|
||||
[Display(Name = "سریال صورتحساب داخلی حافظه مالیاتی")]
|
||||
public string? inno { get; set; }
|
||||
|
||||
|
||||
}
|
||||
public class InvoiceItemDTO
|
||||
{
|
||||
|
@@ -23,8 +23,8 @@
|
||||
<ul class="list-group fa-padding" style="border: 2px solid #0d6efd">
|
||||
<li class="list-group-item" data-toggle="modal" data-target="#issue">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-1">
|
||||
<input @bind-value="itemsearch.InvoiceID" placeholder="شناسه" style="text-align:center;" class="form-control" type="text">
|
||||
<div class="col-md-2">
|
||||
<input @bind-value="itemsearch.InvoiceID" placeholder="شناسه / سریال" style="text-align:center;" class="form-control" type="text">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<input @bind-value="itemsearch.refInvoiceID" placeholder="شناسه مرجع" style="text-align:center;" class="form-control" type="text">
|
||||
|
@@ -338,7 +338,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-group col-md-4">
|
||||
<div class="form-group col-md-6">
|
||||
<br />
|
||||
@if (!invoice.IsDeleted)
|
||||
{
|
||||
@@ -371,6 +371,10 @@
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br />
|
||||
<div class="row g-3">
|
||||
@if (!invoice.IsDeleted && invoice.invoiceType != InvoiceType.Bidding && SendInvoice)
|
||||
{
|
||||
<div class="form-group col-md-2">
|
||||
@@ -380,7 +384,13 @@
|
||||
</Button>
|
||||
</div>
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
<div class="form-group col-md-3">
|
||||
<label class="col-form-label" for="inputinno">سریال صورتحساب داخلی حافظه مالیاتی</label>
|
||||
<InputText style=" text-align: center;" @bind-Value="invoice.inno" class="form-control" id="inputinno" readonly />
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
<br />
|
||||
<div class="row g-3">
|
||||
|
@@ -37,10 +37,10 @@ builder.Services.AddScoped(sp => new UserAuthenticationDTO()
|
||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://195.88.208.142:7075/api/") });
|
||||
|
||||
//Home
|
||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
|
||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("https://localhost:7075/api/") });
|
||||
|
||||
//farzan
|
||||
//builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
|
||||
builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri("http://localhost:5271/api/") });
|
||||
|
||||
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("fa-Ir");
|
||||
|
||||
|
Reference in New Issue
Block a user