tax
This commit is contained in:
@@ -276,14 +276,12 @@ namespace Back.Controllers
|
|||||||
IsDeleted = false,
|
IsDeleted = false,
|
||||||
PatternID = Invoice.PatternID,
|
PatternID = Invoice.PatternID,
|
||||||
setm = Invoice.setm,
|
setm = Invoice.setm,
|
||||||
cui = Invoice.cui,
|
|
||||||
crn = Invoice.crn,
|
crn = Invoice.crn,
|
||||||
CottageDateOfCustomsDeclaration = Invoice.CottageDateOfCustomsDeclaration,
|
CottageDateOfCustomsDeclaration = Invoice.CottageDateOfCustomsDeclaration,
|
||||||
ft = Invoice.ft,
|
ft = Invoice.ft,
|
||||||
cdcn = Invoice.cdcn,
|
cdcn = Invoice.cdcn,
|
||||||
insp = Invoice.insp,
|
insp = Invoice.insp,
|
||||||
billid = Invoice.billid,
|
billid = Invoice.billid,
|
||||||
pspd = Invoice.pspd,
|
|
||||||
scc = Invoice.scc,
|
scc = Invoice.scc,
|
||||||
scln = Invoice.scln,
|
scln = Invoice.scln,
|
||||||
seventeentax = Invoice.seventeentax,
|
seventeentax = Invoice.seventeentax,
|
||||||
@@ -308,7 +306,21 @@ namespace Back.Controllers
|
|||||||
olt = s.olt,
|
olt = s.olt,
|
||||||
spro = s.spro,
|
spro = s.spro,
|
||||||
sscv = s.sscv,
|
sscv = s.sscv,
|
||||||
ssrv = s.ssrv
|
ssrv = s.ssrv,
|
||||||
|
pspd = s.pspd,
|
||||||
|
cui = s.cui,
|
||||||
|
}).ToList(),
|
||||||
|
payments=Invoice.payments.Select(s=>new InvoicePayment()
|
||||||
|
{
|
||||||
|
acn=s.acn,
|
||||||
|
iinn=s.iinn,
|
||||||
|
PaymentDateTime=s.PaymentDateTime,
|
||||||
|
pcn=s.pcn,
|
||||||
|
pid=s.pid,
|
||||||
|
pmt=s.pmt,
|
||||||
|
pv=s.pv,
|
||||||
|
trmn=s.trmn,
|
||||||
|
trn=s.trn,
|
||||||
}).ToList()
|
}).ToList()
|
||||||
}, false);
|
}, false);
|
||||||
if (result > 0)
|
if (result > 0)
|
||||||
@@ -331,14 +343,12 @@ namespace Back.Controllers
|
|||||||
IsDeleted = false,
|
IsDeleted = false,
|
||||||
PatternID = Invoice.PatternID,
|
PatternID = Invoice.PatternID,
|
||||||
setm = Invoice.setm,
|
setm = Invoice.setm,
|
||||||
cui = Invoice.cui,
|
|
||||||
crn = Invoice.crn,
|
crn = Invoice.crn,
|
||||||
CottageDateOfCustomsDeclaration = Invoice.CottageDateOfCustomsDeclaration,
|
CottageDateOfCustomsDeclaration = Invoice.CottageDateOfCustomsDeclaration,
|
||||||
ft = Invoice.ft,
|
ft = Invoice.ft,
|
||||||
cdcn = Invoice.cdcn,
|
cdcn = Invoice.cdcn,
|
||||||
insp = Invoice.insp,
|
insp = Invoice.insp,
|
||||||
billid = Invoice.billid,
|
billid = Invoice.billid,
|
||||||
pspd = Invoice.pspd,
|
|
||||||
scc = Invoice.scc,
|
scc = Invoice.scc,
|
||||||
scln = Invoice.scln,
|
scln = Invoice.scln,
|
||||||
seventeentax = Invoice.seventeentax,
|
seventeentax = Invoice.seventeentax,
|
||||||
@@ -363,7 +373,21 @@ namespace Back.Controllers
|
|||||||
olt = s.olt,
|
olt = s.olt,
|
||||||
spro = s.spro,
|
spro = s.spro,
|
||||||
sscv = s.sscv,
|
sscv = s.sscv,
|
||||||
ssrv = s.ssrv
|
ssrv = s.ssrv,
|
||||||
|
pspd = s.pspd,
|
||||||
|
cui = s.cui,
|
||||||
|
}).ToList(),
|
||||||
|
payments = Invoice.payments.Select(s => new InvoicePayment()
|
||||||
|
{
|
||||||
|
acn = s.acn,
|
||||||
|
iinn = s.iinn,
|
||||||
|
PaymentDateTime = s.PaymentDateTime,
|
||||||
|
pcn = s.pcn,
|
||||||
|
pid = s.pid,
|
||||||
|
pmt = s.pmt,
|
||||||
|
pv = s.pv,
|
||||||
|
trmn = s.trmn,
|
||||||
|
trn = s.trn,
|
||||||
}).ToList()
|
}).ToList()
|
||||||
}, false);
|
}, false);
|
||||||
if (result1 > 0)
|
if (result1 > 0)
|
||||||
@@ -398,14 +422,12 @@ namespace Back.Controllers
|
|||||||
IsDeleted = false,
|
IsDeleted = false,
|
||||||
PatternID = Invoice.PatternID,
|
PatternID = Invoice.PatternID,
|
||||||
setm = Invoice.setm,
|
setm = Invoice.setm,
|
||||||
cui = Invoice.cui,
|
|
||||||
crn = Invoice.crn,
|
crn = Invoice.crn,
|
||||||
CottageDateOfCustomsDeclaration = Invoice.CottageDateOfCustomsDeclaration,
|
CottageDateOfCustomsDeclaration = Invoice.CottageDateOfCustomsDeclaration,
|
||||||
ft = Invoice.ft,
|
ft = Invoice.ft,
|
||||||
cdcn = Invoice.cdcn,
|
cdcn = Invoice.cdcn,
|
||||||
insp = Invoice.insp,
|
insp = Invoice.insp,
|
||||||
billid = Invoice.billid,
|
billid = Invoice.billid,
|
||||||
pspd = Invoice.pspd,
|
|
||||||
scc = Invoice.scc,
|
scc = Invoice.scc,
|
||||||
scln = Invoice.scln,
|
scln = Invoice.scln,
|
||||||
seventeentax = Invoice.seventeentax,
|
seventeentax = Invoice.seventeentax,
|
||||||
@@ -430,7 +452,21 @@ namespace Back.Controllers
|
|||||||
olt = s.olt,
|
olt = s.olt,
|
||||||
spro = s.spro,
|
spro = s.spro,
|
||||||
sscv = s.sscv,
|
sscv = s.sscv,
|
||||||
ssrv = s.ssrv
|
ssrv = s.ssrv,
|
||||||
|
pspd = s.pspd,
|
||||||
|
cui = s.cui,
|
||||||
|
}).ToList(),
|
||||||
|
payments = Invoice.payments.Select(s => new InvoicePayment()
|
||||||
|
{
|
||||||
|
acn = s.acn,
|
||||||
|
iinn = s.iinn,
|
||||||
|
PaymentDateTime = s.PaymentDateTime,
|
||||||
|
pcn = s.pcn,
|
||||||
|
pid = s.pid,
|
||||||
|
pmt = s.pmt,
|
||||||
|
pv = s.pv,
|
||||||
|
trmn = s.trmn,
|
||||||
|
trn = s.trn,
|
||||||
}).ToList()
|
}).ToList()
|
||||||
}, false);
|
}, false);
|
||||||
if (result2 > 0)
|
if (result2 > 0)
|
||||||
@@ -490,19 +526,16 @@ namespace Back.Controllers
|
|||||||
IsDeleted = false,
|
IsDeleted = false,
|
||||||
PatternID = Invoice.PatternID,
|
PatternID = Invoice.PatternID,
|
||||||
setm = Invoice.setm,
|
setm = Invoice.setm,
|
||||||
cui = Invoice.cui,
|
|
||||||
crn = Invoice.crn,
|
crn = Invoice.crn,
|
||||||
CottageDateOfCustomsDeclaration = Invoice.CottageDateOfCustomsDeclaration,
|
CottageDateOfCustomsDeclaration = Invoice.CottageDateOfCustomsDeclaration,
|
||||||
ft = Invoice.ft,
|
ft = Invoice.ft,
|
||||||
cdcn = Invoice.cdcn,
|
cdcn = Invoice.cdcn,
|
||||||
insp = Invoice.insp,
|
insp = Invoice.insp,
|
||||||
billid = Invoice.billid,
|
billid = Invoice.billid,
|
||||||
pspd = Invoice.pspd,
|
|
||||||
scc = Invoice.scc,
|
scc = Invoice.scc,
|
||||||
scln = Invoice.scln,
|
scln = Invoice.scln,
|
||||||
seventeentax = Invoice.seventeentax,
|
seventeentax = Invoice.seventeentax,
|
||||||
tinc = Invoice.tinc,
|
tinc = Invoice.tinc,
|
||||||
|
|
||||||
invoiceDetails = Invoice.invoiceDetails.Select(s => new InvoiceItem
|
invoiceDetails = Invoice.invoiceDetails.Select(s => new InvoiceItem
|
||||||
{
|
{
|
||||||
CODID = s.CODID,
|
CODID = s.CODID,
|
||||||
@@ -523,7 +556,21 @@ namespace Back.Controllers
|
|||||||
olt = s.olt,
|
olt = s.olt,
|
||||||
spro=s.spro,
|
spro=s.spro,
|
||||||
sscv = s.sscv,
|
sscv = s.sscv,
|
||||||
ssrv = s.ssrv
|
ssrv = s.ssrv,
|
||||||
|
pspd= s.pspd,
|
||||||
|
cui= s.cui,
|
||||||
|
}).ToList(),
|
||||||
|
payments = Invoice.payments.Select(s => new InvoicePayment()
|
||||||
|
{
|
||||||
|
acn = s.acn,
|
||||||
|
iinn = s.iinn,
|
||||||
|
PaymentDateTime = s.PaymentDateTime,
|
||||||
|
pcn = s.pcn,
|
||||||
|
pid = s.pid,
|
||||||
|
pmt = s.pmt,
|
||||||
|
pv = s.pv,
|
||||||
|
trmn = s.trmn,
|
||||||
|
trn = s.trn,
|
||||||
}).ToList()
|
}).ToList()
|
||||||
}, true);
|
}, true);
|
||||||
if (result > 0)
|
if (result > 0)
|
||||||
|
@@ -9,6 +9,7 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Org.BouncyCastle.Asn1.Cmp;
|
using Org.BouncyCastle.Asn1.Cmp;
|
||||||
using Org.BouncyCastle.Ocsp;
|
using Org.BouncyCastle.Ocsp;
|
||||||
|
using Org.BouncyCastle.Utilities;
|
||||||
using Shared.DTOs;
|
using Shared.DTOs;
|
||||||
using Shared.DTOs.Serch;
|
using Shared.DTOs.Serch;
|
||||||
using System;
|
using System;
|
||||||
@@ -184,82 +185,105 @@ namespace Back.Controllers
|
|||||||
|
|
||||||
#region Inital Send
|
#region Inital Send
|
||||||
InvoiceHeaderDto header = new InvoiceHeaderDto();
|
InvoiceHeaderDto header = new InvoiceHeaderDto();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int level = result.pattern.ID;
|
||||||
|
|
||||||
|
//header
|
||||||
#region header
|
#region header
|
||||||
if (result.inty == 1 && result.inp == 1)
|
header = new InvoiceHeaderDto
|
||||||
header = new InvoiceHeaderDto
|
{
|
||||||
{
|
//شماره منحصر به فرد مالیاتی
|
||||||
//شماره منحصر به فرد مالیاتی
|
Taxid = _actionTaxPayer.GenerateTaxid(result.inno, result.InvoiceDate.Replace("/", "").Trim()),
|
||||||
Taxid = _actionTaxPayer.GenerateTaxid(result.inno, result.InvoiceDate.Replace("/", "").Trim()),
|
//زمان صدور
|
||||||
//زمان صدور
|
Indatim = result.indatim ?? null,
|
||||||
Indatim = result.indatim ?? null,
|
//زمان ایجاد
|
||||||
//زمان ایجاد
|
Indati2m = result.Indati2m ?? null,
|
||||||
Indati2m = result.Indati2m ?? null,
|
// صورتحساب نوع *
|
||||||
// صورتحساب نوع *
|
Inty = result.inty ?? 1,
|
||||||
Inty = result.inty ?? 1,
|
//سریال صورت حساب
|
||||||
//سریال صورت حساب
|
Inno = string.IsNullOrEmpty(result.inno) ? null : result.inno,
|
||||||
Inno = string.IsNullOrEmpty(result.inno) ? null : result.inno,
|
//شماره منحصر به فرد مالیاتی صورتحساب مرجع
|
||||||
//شماره منحصر به فرد مالیاتی صورتحساب مرجع
|
Irtaxid = result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair ? result.invoice.taxid
|
||||||
Irtaxid = result.invoiceType == InvoiceType.BackFrmSale || result.invoiceType == InvoiceType.Repair ? result.invoice.taxid
|
: result.invoiceType == InvoiceType.Cancellation ? result.taxid : null,
|
||||||
: result.invoiceType == InvoiceType.Cancellation ? result.taxid : null,
|
//الگوی صورتحساب *
|
||||||
//الگوی صورتحساب *
|
Inp = result.inp ?? 1,
|
||||||
Inp = result.inp ?? 1,
|
//موضوع صورتحساب *
|
||||||
//موضوع صورتحساب *
|
Ins = result.ins ?? 1,
|
||||||
Ins = result.ins ?? 1,
|
//شماره اقتصادی فروشنده به جاش شناسه ملی داده شد
|
||||||
//شماره اقتصادی فروشنده به جاش شناسه ملی داده شد
|
Tins = string.IsNullOrEmpty(result.tins) ? null : result.tins,
|
||||||
Tins = string.IsNullOrEmpty(result.tins) ? null : result.tins,
|
//نوع شخص خریدار
|
||||||
//نوع شخص خریدار
|
Tob = level == 10 ? null : result.tob,
|
||||||
Tob = result.tob,
|
//شماره/شناسه ملی/شناسه مشارکت مدنی / کد فراگیر
|
||||||
//شماره/شناسه ملی/شناسه مشارکت مدنی / کد فراگیر
|
Bid = level == 10 || string.IsNullOrEmpty(result.bid) ? null : result.bid,
|
||||||
Bid = string.IsNullOrEmpty(result.bid) ? null : result.bid,
|
//شماره اقتصادی خریدار
|
||||||
//شماره اقتصادی خریدار
|
Tinb = level == 10 || string.IsNullOrEmpty(result.tinb) ? null : result.tinb,
|
||||||
Tinb = string.IsNullOrEmpty(result.tinb) ? null : result.tinb,
|
//کد شعبه فروشنده
|
||||||
//کد شعبه فروشنده
|
Sbc = string.IsNullOrEmpty(result.sbc) ? null : result.sbc,
|
||||||
Sbc = string.IsNullOrEmpty(result.sbc) ? null : result.sbc,
|
//کد پستی خریدار
|
||||||
//کد پستی خریدار
|
Bpc = level == 10 || string.IsNullOrEmpty(result.bpc) ? null : result.bpc,
|
||||||
Bpc = string.IsNullOrEmpty(result.bpc) ? null : result.bpc,
|
//کد شعبه خریدار
|
||||||
//کد شعبه خریدار
|
Bbc = level == 10 || string.IsNullOrEmpty(result.bbc) ? null : result.bbc,
|
||||||
Bbc = string.IsNullOrEmpty(result.bbc) ? null : result.bbc,
|
//نوع پرواز
|
||||||
//شماره پروانه گمرکی
|
Ft = level == 9 ? result.ft : null,
|
||||||
Scln = string.IsNullOrEmpty(result.scln) ? null : result.scln,
|
//شماره گذرنامه خریدار
|
||||||
//کد گمرک محل اظهار فروشنده
|
Bpn = (level == 9 || level == 4) && !string.IsNullOrEmpty(result.bpn) ? result.bpn : null,
|
||||||
Scc = string.IsNullOrEmpty(result.scc) ? null : result.scc,
|
//شماره پروانه گمرکی
|
||||||
//شناسه یکتای ثبت قزارداد فروشنده
|
Scln = (level == 3 || level == 4) && !string.IsNullOrEmpty(result.scln) ? result.scln : null,
|
||||||
Crn = string.IsNullOrEmpty(result.crn) ? null : result.crn,
|
//کد گمرک محل اظهار فروشنده
|
||||||
//مجموع مبلغ قبل از کسر تخفیف
|
Scc = (level == 3 || level == 4 || level == 10) && !string.IsNullOrEmpty(result.scc) ? result.scc : null,
|
||||||
Tprdis = result.tprdis ?? null,
|
//شماره کدتاژ اظهارنامه گمرکی
|
||||||
//مجموع تخفیفات
|
Cdcn = level == 10 ? result.cdcn : null,
|
||||||
Tdis = result.tdis ?? null,
|
//تاریخ کوتاژ اظهارنامه گمرکی
|
||||||
// مجموع مبلغ پس از کسر تخفیف
|
// Cdcd = level == 10 ? result.cdcd : null,
|
||||||
Tadis = result.tadis ?? null,
|
//شناسه یکتای ثبت قزارداد فروشنده
|
||||||
//مجموع مالیات بر ارزش افزوده
|
Crn = (level == 3 || level == 4 || level == 5 || level == 6) && !string.IsNullOrEmpty(result.crn) ? result.crn : null,
|
||||||
Tvam = result.tvam ?? null,
|
//شماره اشتراک/شناسه قبض بهره بردار
|
||||||
// مجموع سایر مالیات، عوارض و وجوه قانونی
|
Billid = level == 8 ?result.billid:null,
|
||||||
Todam = result.todam ?? null,
|
//مجموع مبلغ قبل از کسر تخفیف
|
||||||
//صورتحساب مجموع
|
Tprdis = level == 10 ? null : result.tprdis ?? null,
|
||||||
Tbill = result.tbill ?? null,
|
//مجموع تخفیفات
|
||||||
// تسویه روش
|
Tdis = level == 10 ? null : result.tdis ?? null,
|
||||||
Setm = result.setm == 0 ? null : result.setm ?? null,
|
// مجموع مبلغ پس از کسر تخفیف
|
||||||
//نقدی پرداختی مبلغ
|
Tadis = level == 10 ? null : result.tadis ?? null,
|
||||||
Cap = result.cap ?? null,
|
//مجموع مالیات بر ارزش افزوده
|
||||||
//پرداختی نسیه
|
Tvam = result.tvam ?? null,
|
||||||
Insp = result.insp ?? null,
|
// مجموع سایر مالیات، عوارض و وجوه قانونی
|
||||||
//مجموع سهم مالیات بر ارزش افزوده از پرداخت
|
Todam = result.todam ?? null,
|
||||||
Tvop = result.tvop ?? null,
|
//صورتحساب مجموع
|
||||||
//مالیات موضوع 17
|
Tbill = result.tbill ?? null,
|
||||||
Tax17 = string.IsNullOrEmpty(result.seventeentax) ? null : Convert.ToDecimal(result.seventeentax),
|
//مجموع وزن خالض
|
||||||
|
Tonw = level == 10 ? result.tonw : null,
|
||||||
|
//مجموع ارزش ریالی
|
||||||
|
Torv = level == 10 ? result.torv : null,
|
||||||
};
|
//مجموع ارزش ارزی
|
||||||
|
Tocv = level == 10 ? result.tocv : null,
|
||||||
else return BadRequest(new List<string> { "این الگو فعلا در دسترس نمی باشد" });
|
// تسویه روش
|
||||||
|
Setm = level == 8|| level == 10|| level == 11|| level == 13 || result.setm == 0 ? null : result.setm ?? null,
|
||||||
|
//نقدی پرداختی مبلغ
|
||||||
|
Cap = level == 8 || level == 10 || level == 11 || level == 13 ?null : result.cap ?? null,
|
||||||
|
//پرداختی نسیه
|
||||||
|
Insp = level == 8 || level == 10 || level == 11 || level == 13 ? null : result.insp ?? null,
|
||||||
|
//مجموع سهم مالیات بر ارزش افزوده از پرداخت
|
||||||
|
Tvop = level == 8 || level == 10 || level == 11 || level == 13 ? null : result.tvop ?? null,
|
||||||
|
//مالیات موضوع 17
|
||||||
|
Tax17 = level == 10 || string.IsNullOrEmpty(result.seventeentax) ? null : Convert.ToDecimal(result.seventeentax),
|
||||||
|
//شماره اقتصادی آژانس
|
||||||
|
Tinc = level == 9 && !string.IsNullOrEmpty(result.tinc) ? result.tinc : null
|
||||||
|
};
|
||||||
#endregion header
|
#endregion header
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//body
|
||||||
List<InvoiceBodyDto> InvoiceBody = new List<InvoiceBodyDto>();
|
List<InvoiceBodyDto> InvoiceBody = new List<InvoiceBodyDto>();
|
||||||
foreach (var bitem in result.invoiceDetails)
|
foreach (var bitem in result.invoiceDetails)
|
||||||
{
|
{
|
||||||
InvoiceBodyDto item = new InvoiceBodyDto();
|
InvoiceBodyDto item = new InvoiceBodyDto();
|
||||||
#region body
|
#region body
|
||||||
if (header.Inty == 1 && header.Inp == 1)
|
|
||||||
item = new InvoiceBodyDto
|
item = new InvoiceBodyDto
|
||||||
{
|
{
|
||||||
//شناسه کالا / خدمت
|
//شناسه کالا / خدمت
|
||||||
@@ -267,23 +291,29 @@ namespace Back.Controllers
|
|||||||
//شرح کاال/خدمت
|
//شرح کاال/خدمت
|
||||||
Sstt = bitem.sstt,
|
Sstt = bitem.sstt,
|
||||||
// تعداد
|
// تعداد
|
||||||
Am = bitem.am,
|
Am = level==4 ?null: bitem.am,
|
||||||
//واحد اندازه گیری
|
//واحد اندازه گیری
|
||||||
Mu = string.IsNullOrEmpty(bitem.mu) ? null : bitem.mu,
|
Mu = level == 4 || string.IsNullOrEmpty(bitem.mu) ? null : bitem.mu,
|
||||||
|
//وزن خالص
|
||||||
|
Nw=level==10 ? bitem.nw : null,
|
||||||
// مبلغ واحد
|
// مبلغ واحد
|
||||||
Fee = bitem.fee,
|
Fee = level == 4 ? null : bitem.fee,
|
||||||
//میزان ارز
|
//میزان ارز
|
||||||
Cfee = bitem.cfee,
|
Cfee = level==8 || level==10 ?null: bitem.cfee,
|
||||||
//نوع ارز
|
//نوع ارز
|
||||||
Cut = string.IsNullOrEmpty(bitem.cut) ? null : bitem.cut,
|
Cut = level == 8 || string.IsNullOrEmpty(bitem.cut) ? null : bitem.cut,
|
||||||
//نرخ برابری ارز با ریال
|
//نرخ برابری ارز با ریال
|
||||||
Exr = bitem.exr,
|
Exr = level == 8 ?null: bitem.exr,
|
||||||
|
// ارزش ریالی کاا
|
||||||
|
Ssrv= level == 10 ?bitem.ssrv : null,
|
||||||
|
// ارزش ارزی کاا
|
||||||
|
Sscv= level == 10 ? bitem.sscv : null,
|
||||||
//مبلغ قبل از تخفیف
|
//مبلغ قبل از تخفیف
|
||||||
Prdis = bitem.prdis,
|
Prdis = level == 10 ? null : bitem.prdis,
|
||||||
//مبلغ تخفیف
|
//مبلغ تخفیف
|
||||||
Dis = bitem.dis,
|
Dis = level == 10 ? null : bitem.dis,
|
||||||
//مبلغ بعد از تخفیف
|
//مبلغ بعد از تخفیف
|
||||||
Adis = bitem.adis,
|
Adis = level == 10 ? null : bitem.adis,
|
||||||
//نرخ مالیات بر ارزش افزوده
|
//نرخ مالیات بر ارزش افزوده
|
||||||
Vra = bitem.vra,
|
Vra = bitem.vra,
|
||||||
//مبلغ مالیات بر ارزش افزوده
|
//مبلغ مالیات بر ارزش افزوده
|
||||||
@@ -300,21 +330,60 @@ namespace Back.Controllers
|
|||||||
Olr = bitem.olr,
|
Olr = bitem.olr,
|
||||||
//مبلغ سایر وجوه قانونی
|
//مبلغ سایر وجوه قانونی
|
||||||
Olam = bitem.olam,
|
Olam = bitem.olam,
|
||||||
|
//اجرت ساخت
|
||||||
|
Consfee = level ==5 || level ==13 ?bitem.consfee : null,
|
||||||
|
// سود فروشنده
|
||||||
|
Spro= level == 5 || level == 13 ? bitem.spro : null,
|
||||||
|
//حقالعمل
|
||||||
|
Bros= level == 5 || level == 13 ? bitem.bros : null,
|
||||||
|
//جمع کل اجرت، حقالعمل و سود
|
||||||
|
Tcpbs= level == 5 || level == 13 ? bitem.tcpbs : null,
|
||||||
//سهم نقدی از پرداخت
|
//سهم نقدی از پرداخت
|
||||||
Cop = bitem.cop,
|
Cop = level==8 ||level==10 ||level==11||level==13 ? null : bitem.cop,
|
||||||
//سهم مالیات بر لرزش افزوده از پرداخت
|
//سهم مالیات بر لرزش افزوده از پرداخت
|
||||||
Vop = bitem.vop,
|
Vop = level == 8 || level == 10 || level == 11 || level == 13 ? null : bitem.vop,
|
||||||
//شناسه یکتای ثبت قرارداد حق العمل کاری
|
//شناسه یکتای ثبت قرارداد حق العمل کاری
|
||||||
Bsrn = string.IsNullOrEmpty(bitem.bsrn) ? null : bitem.bsrn,
|
Bsrn = string.IsNullOrEmpty(bitem.bsrn) ? null : bitem.bsrn,
|
||||||
// مبلغ کل کالا / خدمت
|
// مبلغ کل کالا / خدمت
|
||||||
Tsstam = bitem.tsstam,
|
Tsstam = bitem.tsstam,
|
||||||
|
//فاوت نرخ خرید و فروش ارز/ کارمزد فروش ارز
|
||||||
|
Pspd=level==4 ?bitem.pspd: null,
|
||||||
|
//عیار
|
||||||
|
Cui =level==5||level==13?bitem.cui: null
|
||||||
};
|
};
|
||||||
#endregion
|
#endregion
|
||||||
InvoiceBody.Add(item);
|
InvoiceBody.Add(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var responseModel = await _actionTaxPayer.SendInvoice(user.RolUsers.First().CompanyID, header, InvoiceBody, new PaymentDto { });
|
//Pay
|
||||||
|
List<PaymentDto> InvoicePay = new List<PaymentDto>();
|
||||||
|
if(level!=10)
|
||||||
|
foreach (var pitem in result.payments)
|
||||||
|
{
|
||||||
|
PaymentDto payment = new PaymentDto();
|
||||||
|
payment = new PaymentDto
|
||||||
|
{
|
||||||
|
Iinn=pitem.iinn,
|
||||||
|
Acn=pitem.acn,
|
||||||
|
Trmn=pitem.trmn,
|
||||||
|
Pmt=pitem.pmt,
|
||||||
|
Trn=pitem.trn,
|
||||||
|
Pcn=pitem.pcn,
|
||||||
|
Pid=pitem.pid,
|
||||||
|
Pdt=pitem.pdt,
|
||||||
|
Pv=pitem.pv,
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
InvoicePay.Add(payment);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var responseModel = await _actionTaxPayer.SendInvoice(user.RolUsers.First().CompanyID, header, InvoiceBody, InvoicePay);
|
||||||
if (responseModel == null)
|
if (responseModel == null)
|
||||||
{
|
{
|
||||||
return BadRequest(new List<string> { "خطا در ورود به سامانه مودیان" });
|
return BadRequest(new List<string> { "خطا در ورود به سامانه مودیان" });
|
||||||
|
@@ -151,18 +151,12 @@ namespace Back.Data.Models
|
|||||||
public string? seventeentax { get; set; }
|
public string? seventeentax { get; set; }
|
||||||
//نکته باید به شمسی تبدیل شود
|
//نکته باید به شمسی تبدیل شود
|
||||||
public string? Cdate { get; set; }
|
public string? Cdate { get; set; }
|
||||||
//تفاوت نرخ خرید و فروش ارز/ کارمزد فروش ارز
|
|
||||||
[MaxLength(26)]
|
|
||||||
public decimal? pspd { get; set; }
|
|
||||||
public string? Udate { get; set; }
|
public string? Udate { get; set; }
|
||||||
public string InvoicIssueDate { get; set; }
|
public string InvoicIssueDate { get; set; }
|
||||||
public string InvoiceDate { get; set; }
|
public string InvoiceDate { get; set; }
|
||||||
public bool PreparedtoSendtoTax { get; set; } = false;
|
public bool PreparedtoSendtoTax { get; set; } = false;
|
||||||
public int LastChangeUserID { get; set; }
|
public int LastChangeUserID { get; set; }
|
||||||
public bool IsDeleted { get; set; }
|
public bool IsDeleted { get; set; }
|
||||||
//عیار
|
|
||||||
[MaxLength(26)]
|
|
||||||
public decimal? cui { get; set; }
|
|
||||||
//شماره اقتصادی آژانس
|
//شماره اقتصادی آژانس
|
||||||
[MaxLength(14)]
|
[MaxLength(14)]
|
||||||
public string? tinc { get; set; }
|
public string? tinc { get; set; }
|
||||||
|
@@ -133,6 +133,10 @@ namespace Back.Data.Models
|
|||||||
[MaxLength(12)]
|
[MaxLength(12)]
|
||||||
public string? bsrn { get; set; }
|
public string? bsrn { get; set; }
|
||||||
public decimal? _cfee { get; set; }
|
public decimal? _cfee { get; set; }
|
||||||
|
//تفاوت نرخ خرید و فروش ارز
|
||||||
|
public decimal? pspd { get; set; }
|
||||||
|
//عیار
|
||||||
|
public decimal? cui { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Navigation
|
#region Navigation
|
||||||
|
@@ -14,7 +14,7 @@ namespace Back.Data.Models
|
|||||||
#region autofild
|
#region autofild
|
||||||
//تاریخ و زمان پرداخت
|
//تاریخ و زمان پرداخت
|
||||||
[MaxLength(13)]
|
[MaxLength(13)]
|
||||||
public long? pdt { get { return new DateTimeOffset(PaymentDateTime.Trim().ToMiladi()).ToUnixTimeMilliseconds(); } }
|
public long? pdt { get { return new DateTimeOffset(PaymentDateTime.Trim().ToMiladi()).ToUnixTimeSeconds(); } }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region fild
|
#region fild
|
||||||
|
@@ -48,7 +48,7 @@ namespace Back.Services
|
|||||||
return inquiryResultModels[0];
|
return inquiryResultModels[0];
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public async Task<TaxCollectData.Library.Dto.HttpResponse<AsyncResponseModel>> SendInvoice(int CompanyID,InvoiceHeaderDto header, List<InvoiceBodyDto> InvoiceBody, PaymentDto payment)
|
public async Task<TaxCollectData.Library.Dto.HttpResponse<AsyncResponseModel>> SendInvoice(int CompanyID,InvoiceHeaderDto header, List<InvoiceBodyDto> InvoiceBody, List<PaymentDto> payments)
|
||||||
{
|
{
|
||||||
//return new TaxCollectData.Library.Dto.HttpResponse<AsyncResponseModel>
|
//return new TaxCollectData.Library.Dto.HttpResponse<AsyncResponseModel>
|
||||||
// ( body: new AsyncResponseModel(
|
// ( body: new AsyncResponseModel(
|
||||||
@@ -62,7 +62,7 @@ namespace Back.Services
|
|||||||
{
|
{
|
||||||
new()
|
new()
|
||||||
{
|
{
|
||||||
Header =header,Body =InvoiceBody,Payments = new() {payment}
|
Header =header,Body =InvoiceBody,Payments = payments
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
, null);
|
, null);
|
||||||
|
@@ -39,7 +39,7 @@ namespace Back.Services
|
|||||||
.ThenInclude(inc => inc.CODUnit)
|
.ThenInclude(inc => inc.CODUnit)
|
||||||
.Include(inc => inc.Customer)
|
.Include(inc => inc.Customer)
|
||||||
.Include(inc => inc.sentTax)
|
.Include(inc => inc.sentTax)
|
||||||
//.Include(inc => inc.payments)
|
.Include(inc => inc.payments)
|
||||||
.Include(inc => inc.pattern)
|
.Include(inc => inc.pattern)
|
||||||
.ThenInclude(inc => inc.BillType)
|
.ThenInclude(inc => inc.BillType)
|
||||||
|
|
||||||
@@ -92,22 +92,22 @@ namespace Back.Services
|
|||||||
vra = x.vra,
|
vra = x.vra,
|
||||||
prdis = x.prdis
|
prdis = x.prdis
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
payments = new List<InvoicePaymentDTO>()
|
payments =
|
||||||
//s.payments.OrderBy(o => o.ID).Select(x => new InvoicePaymentDTO()
|
item.payments.OrderBy(o => o.ID).Select(x => new InvoicePaymentDTO()
|
||||||
//{
|
{
|
||||||
// ID = x.ID,
|
ID = x.ID,
|
||||||
// acn = x.acn,
|
acn = x.acn,
|
||||||
// iinn = x.acn,
|
iinn = x.acn,
|
||||||
// pcn = x.acn,
|
pcn = x.acn,
|
||||||
// pdt = x.pdt,
|
pdt = x.pdt,
|
||||||
// PaymentDateTime=x.PaymentDateTime,
|
PaymentDateTime = x.PaymentDateTime,
|
||||||
// pid = x.pid,
|
pid = x.pid,
|
||||||
// pmt = x.pmt,
|
pmt = x.pmt,
|
||||||
// pv = x.pv,
|
pv = x.pv,
|
||||||
// trmn = x.trmn,
|
trmn = x.trmn,
|
||||||
// trn = x.acn
|
trn = x.acn
|
||||||
//}).ToList()
|
}).ToList()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -15,13 +15,14 @@ namespace Back.Services
|
|||||||
private readonly IAsyncRepository<BillType> _repoBillType;
|
private readonly IAsyncRepository<BillType> _repoBillType;
|
||||||
private readonly IAsyncRepository<Invoice> _invoiceRepo;
|
private readonly IAsyncRepository<Invoice> _invoiceRepo;
|
||||||
private readonly IAsyncRepository<InvoiceItem> _invoiceitemRepo;
|
private readonly IAsyncRepository<InvoiceItem> _invoiceitemRepo;
|
||||||
|
private readonly IAsyncRepository<InvoicePayment> _invoicePaymentRepo;
|
||||||
private readonly IAsyncRepository<FildModeInPattern> _fildModeInPatternRepo;
|
private readonly IAsyncRepository<FildModeInPattern> _fildModeInPatternRepo;
|
||||||
private readonly IAsyncRepository<Coding> _codingRepo;
|
private readonly IAsyncRepository<Coding> _codingRepo;
|
||||||
private readonly IAsyncRepository<SpecialCondition> _specialConditionRepo;
|
private readonly IAsyncRepository<SpecialCondition> _specialConditionRepo;
|
||||||
public servTaxPayer(IAsyncRepository<SentTax> repoSentTax, IAsyncRepository<Pattern> repoPattern
|
public servTaxPayer(IAsyncRepository<SentTax> repoSentTax, IAsyncRepository<Pattern> repoPattern
|
||||||
, IAsyncRepository<Invoice> invoiceRepo, IAsyncRepository<FildModeInPattern> fildModeInPatternRepo
|
, IAsyncRepository<Invoice> invoiceRepo, IAsyncRepository<FildModeInPattern> fildModeInPatternRepo
|
||||||
, IAsyncRepository<Coding> codingRepo, IAsyncRepository<SpecialCondition> specialConditionRepo
|
, IAsyncRepository<Coding> codingRepo, IAsyncRepository<SpecialCondition> specialConditionRepo
|
||||||
, IAsyncRepository<InvoiceItem> invoiceitemRepo, IAsyncRepository<BillType> repoBillType)
|
, IAsyncRepository<InvoiceItem> invoiceitemRepo, IAsyncRepository<BillType> repoBillType, IAsyncRepository<InvoicePayment> invoicePaymentRepo)
|
||||||
{
|
{
|
||||||
_repoSentTax = repoSentTax;
|
_repoSentTax = repoSentTax;
|
||||||
_repoPattern = repoPattern;
|
_repoPattern = repoPattern;
|
||||||
@@ -31,6 +32,7 @@ namespace Back.Services
|
|||||||
_specialConditionRepo = specialConditionRepo;
|
_specialConditionRepo = specialConditionRepo;
|
||||||
_invoiceitemRepo = invoiceitemRepo;
|
_invoiceitemRepo = invoiceitemRepo;
|
||||||
_repoBillType = repoBillType;
|
_repoBillType = repoBillType;
|
||||||
|
_invoicePaymentRepo= invoicePaymentRepo;
|
||||||
}
|
}
|
||||||
public async Task<bool> ExistSuccessfulorSendorpendingInvoiceinCompanyID(int CompanyID)
|
public async Task<bool> ExistSuccessfulorSendorpendingInvoiceinCompanyID(int CompanyID)
|
||||||
{
|
{
|
||||||
@@ -214,6 +216,18 @@ namespace Back.Services
|
|||||||
if (!await _invoiceitemRepo.UpdateAsync(invoiceDetItem))
|
if (!await _invoiceitemRepo.UpdateAsync(invoiceDetItem))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach (var pitem in FildItems.Payments)
|
||||||
|
{
|
||||||
|
var invoicepayments = InvoiceItem.payments.Where(w => w.ID == pitem.ID).FirstOrDefault();
|
||||||
|
foreach (var item in pitem.filds.Where(w => w.InputBox == "fild" || w.InputBox == "fromdb"))
|
||||||
|
{
|
||||||
|
if (invoicepayments != null)
|
||||||
|
SetValue(item, ref invoicepayments);
|
||||||
|
}
|
||||||
|
if (!await _invoicePaymentRepo.UpdateAsync(invoicepayments))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
return true;
|
return true;
|
||||||
|
@@ -14,15 +14,7 @@
|
|||||||
<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" />
|
||||||
<PageTitle>جزئیات صورتحساب</PageTitle>
|
<PageTitle>جزئیات صورتحساب</PageTitle>
|
||||||
|
|
||||||
<Modal @ref="Codemodal" title="لینک برای دانلود" IsVerticallyCentered="true">
|
|
||||||
<BodyTemplate>
|
|
||||||
<h5>با لینک زیر دیگران میتوانند به این صورتحساب دسترسی داشته باشند</h5>
|
|
||||||
<NavLink href="@ExUrl">@ExUrl</NavLink>
|
|
||||||
</BodyTemplate>
|
|
||||||
<FooterTemplate>
|
|
||||||
<Button Color="ButtonColor.Secondary" @onclick="OnHideModalClick">Close</Button>
|
|
||||||
</FooterTemplate>
|
|
||||||
</Modal>
|
|
||||||
|
|
||||||
@if (invoice.IsDeleted)
|
@if (invoice.IsDeleted)
|
||||||
{
|
{
|
||||||
@@ -361,10 +353,10 @@
|
|||||||
<Button class="mt-3" Color="ButtonColor.Primary" @onclick="showFullInvoiceItem" Type="ButtonType.Button">
|
<Button class="mt-3" Color="ButtonColor.Primary" @onclick="showFullInvoiceItem" Type="ButtonType.Button">
|
||||||
اطلاعات تکمیلی
|
اطلاعات تکمیلی
|
||||||
</Button>
|
</Button>
|
||||||
@* <Button class="mt-3" Color="ButtonColor.Primary" @onclick="ShowReport" Type="ButtonType.Button">
|
<Button class="mt-3" Color="ButtonColor.Info" @onclick="OnClickPayment" Type="ButtonType.Button">
|
||||||
pdf
|
اطلاعات پرداخت
|
||||||
</Button>
|
</Button>
|
||||||
<Button class="mt-3" Color="ButtonColor.Info" @onclick="onClickLink" Type="ButtonType.Button">
|
@* <Button class="mt-3" Color="ButtonColor.Info" @onclick="onClickLink" Type="ButtonType.Button">
|
||||||
لینک
|
لینک
|
||||||
</Button> *@
|
</Button> *@
|
||||||
}
|
}
|
||||||
@@ -410,7 +402,6 @@
|
|||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
private Modal Codemodal = default!;
|
|
||||||
public bool SendInvoice { get; set; } = false;
|
public bool SendInvoice { get; set; } = false;
|
||||||
List<ToastMessage> messages = new List<ToastMessage>();
|
List<ToastMessage> messages = new List<ToastMessage>();
|
||||||
private ConfirmDialog dialog = default!;
|
private ConfirmDialog dialog = default!;
|
||||||
@@ -465,10 +456,7 @@
|
|||||||
@functions {
|
@functions {
|
||||||
|
|
||||||
|
|
||||||
private async Task OnHideModalClick()
|
|
||||||
{
|
|
||||||
await Codemodal.HideAsync();
|
|
||||||
}
|
|
||||||
private void ShowMessage(ToastType toastType, string msg) => messages.Add(CreateToastMessage(toastType, msg));
|
private void ShowMessage(ToastType toastType, string msg) => messages.Add(CreateToastMessage(toastType, msg));
|
||||||
|
|
||||||
private ToastMessage CreateToastMessage(ToastType toastType, string msg)
|
private ToastMessage CreateToastMessage(ToastType toastType, string msg)
|
||||||
@@ -490,6 +478,10 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
private async Task OnClickPayment()
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
private async Task CopyInvoice()
|
private async Task CopyInvoice()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user