This commit is contained in:
mmrbnjd
2024-12-14 14:20:36 +03:30
parent 8c06064476
commit 9d468a4dda
4 changed files with 11 additions and 13 deletions

View File

@@ -66,7 +66,7 @@ namespace Back.Data.Models
public decimal? tocv { get { return invoiceDetails.Sum(i => i.sscv); } } public decimal? tocv { get { return invoiceDetails.Sum(i => i.sscv); } }
//مجموع سهم مالیات بر ارزش افزوده از پرداخت //مجموع سهم مالیات بر ارزش افزوده از پرداخت
[MaxLength(18)] [MaxLength(18)]
public decimal? tvop { get { return invoiceDetails.Sum(i => i.vop); } } public decimal? tvop { get { return Math.Floor(invoiceDetails.Sum(i => i.vop).GetValueOrDefault()); } }
//نوع شخص خریدار //نوع شخص خریدار
[MaxLength(1)] [MaxLength(1)]
public int tob { get { return Customer.CustomerType == CustomerType.WithoutIdentity ? 0 : (int)Customer.CustomerType; } } public int tob { get { return Customer.CustomerType == CustomerType.WithoutIdentity ? 0 : (int)Customer.CustomerType; } }

View File

@@ -33,19 +33,19 @@ namespace Back.Data.Models
[MaxLength(18)] [MaxLength(18)]
public decimal? vam { get public decimal? vam { get
{ {
return vra==0 ? 0 : invoice?.pattern?.ID == 9 ? fee*vra/100 : return Math.Floor((vra ==0 ? 0 : invoice?.pattern?.ID == 9 ? fee*vra/100 :
invoice?.pattern?.ID == 13 || invoice?.pattern?.ID == 5 ? ((tcpbs+9)/100)+((prdis*vra)/100) invoice?.pattern?.ID == 13 || invoice?.pattern?.ID == 5 ? ((tcpbs+9)/100)+((prdis*vra)/100)
: vra * adis / 100; : vra * adis / 100).GetValueOrDefault());
} } } }
//جمع کل اجرت ،حق العمل و سود //جمع کل اجرت ،حق العمل و سود
[MaxLength(18)] [MaxLength(18)]
public decimal? tcpbs { get { return consfee + spro + bros; } } public decimal? tcpbs { get { return consfee + spro + bros; } }
//سهم نقدی از پرداخت //سهم نقدی از پرداخت
[MaxLength(18)] [MaxLength(18)]
public decimal? cop { get { return (tsstam * invoice?.cap) / invoice?.tadis; } } public decimal? cop { get { return Math.Floor(((tsstam * invoice?.cap) / invoice?.tadis).GetValueOrDefault()); } }
//سهم مالیات بر ارزش افزوده از پرداخت //سهم مالیات بر ارزش افزوده از پرداخت
[MaxLength(18)] [MaxLength(18)]
public decimal? vop { get { return vra == 0 ? 0 : (vam * invoice?.cap) / invoice?.tadis; } } public decimal? vop { get { return vra == 0 ? 0 : Math.Floor(((vam * invoice?.cap) / invoice?.tadis).GetValueOrDefault()); } }
//مبلغ کل کالا/خدمت //مبلغ کل کالا/خدمت
[MaxLength(18)] [MaxLength(18)]
public decimal? tsstam { get public decimal? tsstam { get

View File

@@ -120,8 +120,8 @@ namespace Back.Services
public string? Bsrn { get { return string.IsNullOrEmpty(bitem.bsrn) ? null : bitem.bsrn; } } public string? Bsrn { get { return string.IsNullOrEmpty(bitem.bsrn) ? null : bitem.bsrn; } }
public decimal? Tsstam { get { return bitem.tsstam; } } public decimal? Tsstam { get { return bitem.tsstam; } }
public decimal? Cui { get { return level == 5 || level == 13 ? bitem.cui : null; } } public decimal? Cui { get { return level == 5 || level == 13 ? bitem.cui : null; } }
public decimal? Cpr { get { return null; } } public decimal? Cpr { get { return level == 4 && bitem.cpr.HasValue ? bitem.cpr : null; } }
public long? Sovat { get { return bitem.sovat; } } public long? Sovat { get { return level == 4 && bitem.sovat.HasValue ? bitem.sovat : null; } }
} }
} }

View File

@@ -130,7 +130,7 @@ namespace Back.Services
foreach (_TaxPayer.Fild item in head) foreach (_TaxPayer.Fild item in head)
{ {
var resval = InvoiceItem.GetType().GetProperties().Where(w => w.Name == item.eName).Select(s => s.GetValue(InvoiceItem)).FirstOrDefault(); var resval = InvoiceItem.GetType().GetProperties().Where(w => w.Name == item.eName).Select(s => s.GetValue(InvoiceItem)).FirstOrDefault();
item.Value = resval == null ? "" : (item.eName == "InvoicIssueDate" || item.eName == "InvoiceDate" || item.eName == "CottageDateOfCustomsDeclaration" ? resval.ToString().ShamciToFormatShamci() : resval.ToString().Split('.').Length == 2 ? ((decimal)resval).ToString("N0") : resval.ToString()); item.Value = resval == null ? "" : (item.eName == "InvoicIssueDate" || item.eName == "InvoiceDate" || item.eName == "CottageDateOfCustomsDeclaration" ? resval.ToString().ShamciToFormatShamci() : resval.ToString().Split('.').Length == 2 || item.eName == "tvop" || item.eName == "tvam" ? ((decimal)resval).ToString("N0") : resval.ToString());
if (item.eName == "insp" ) if (item.eName == "insp" )
// زمانی که صورتحساب فقط نسیه بود مبلغ کل فاکتور در نسیه نشسته شود // زمانی که صورتحساب فقط نسیه بود مبلغ کل فاکتور در نسیه نشسته شود
@@ -140,7 +140,7 @@ namespace Back.Services
if (InvoiceItem.setm == 2) if (InvoiceItem.setm == 2)
{ {
var rescalcinsp = InvoiceItem.GetType().GetProperties().Where(w => w.Name == "Calcinsp").Select(s => s.GetValue(InvoiceItem)).FirstOrDefault(); var rescalcinsp = InvoiceItem.GetType().GetProperties().Where(w => w.Name == "Calcinsp").Select(s => s.GetValue(InvoiceItem)).FirstOrDefault();
item.Value = rescalcinsp == null ? "" : rescalcinsp.ToString().Split('.').Length == 2 ? ((decimal)rescalcinsp).ToString("N0") : rescalcinsp.ToString(); item.Value = rescalcinsp == null ? "" : rescalcinsp.ToString().Split('.').Length == 2 || item.eName == "tvop" || item.eName == "tvam" ? ((decimal)rescalcinsp).ToString("N0") : rescalcinsp.ToString();
} }
} }
@@ -174,11 +174,9 @@ namespace Back.Services
{ {
item.Value = ""; item.Value = "";
} }
else if (resval.ToString().Split('.').Length == 2 ) else if (resval.ToString().Split('.').Length == 2 || item.eName == "vam" || item.eName == "cop" || item.eName == "vop")
{ {
if (item.eName == "cfee")
{
}
try try
{ {
item.Value = ((decimal)resval).ToString("N0"); item.Value = ((decimal)resval).ToString("N0");