...
This commit is contained in:
@@ -50,7 +50,6 @@ namespace TaxPayer.Infrastructure.Persistence
|
|||||||
public DbSet<Promotion> Promotions { get; set; }
|
public DbSet<Promotion> Promotions { get; set; }
|
||||||
public DbSet<PromotionDetails> PromotionDetails { get; set; }
|
public DbSet<PromotionDetails> PromotionDetails { get; set; }
|
||||||
public DbSet<CreditDocuments> CreditDocuments { get; set; }
|
public DbSet<CreditDocuments> CreditDocuments { get; set; }
|
||||||
public DbSet<Condition> Conditions { get; set; }
|
|
||||||
#endregion
|
#endregion
|
||||||
//public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken())
|
//public override Task<int> SaveChangesAsync(CancellationToken cancellationToken = new CancellationToken())
|
||||||
//{
|
//{
|
||||||
|
@@ -1,16 +0,0 @@
|
|||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
|
|
||||||
namespace Back.Data.Models
|
|
||||||
{
|
|
||||||
public class Condition
|
|
||||||
{
|
|
||||||
public int ID { get; set; }
|
|
||||||
public int fildID { get; set; }
|
|
||||||
public string condition { get; set; }
|
|
||||||
|
|
||||||
|
|
||||||
//----------nav
|
|
||||||
[ForeignKey("fildID")]
|
|
||||||
public Fild fild { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@@ -16,7 +16,6 @@ namespace Back.Data.Models
|
|||||||
#region Navigation
|
#region Navigation
|
||||||
public virtual ICollection<FildModeInPattern> FildModeInPatterns { get; set; }
|
public virtual ICollection<FildModeInPattern> FildModeInPatterns { get; set; }
|
||||||
public virtual ICollection<Coding> Codings { get; set; }
|
public virtual ICollection<Coding> Codings { get; set; }
|
||||||
public virtual ICollection<Condition> Conditions { get; set; }
|
|
||||||
[NotMapped]
|
[NotMapped]
|
||||||
public ICollection<SpecialCondition> specialConditions { get; set; }
|
public ICollection<SpecialCondition> specialConditions { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
using System.Reflection.Metadata.Ecma335;
|
||||||
|
|
||||||
namespace Back.Data.Models
|
namespace Back.Data.Models
|
||||||
{
|
{
|
||||||
@@ -25,7 +26,10 @@ namespace Back.Data.Models
|
|||||||
public string? mu { get { return cODItem != null ? cODItem.CODUnit.UnitTaxID : null; } }
|
public string? mu { get { return cODItem != null ? cODItem.CODUnit.UnitTaxID : null; } }
|
||||||
//میزان ارز
|
//میزان ارز
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? cfee { get { return exr==null || exr==0 ? null : fee / exr; } }
|
public decimal? cfee { get { return
|
||||||
|
invoice?.pattern?.inp == 2 ? _cfee
|
||||||
|
: invoice?.pattern?.inp == 1 && exr != null && exr != 0 ? fee / exr
|
||||||
|
: null ; } }
|
||||||
//مبلغ مالیات بر ارزش افزوده
|
//مبلغ مالیات بر ارزش افزوده
|
||||||
[MaxLength(18)]
|
[MaxLength(18)]
|
||||||
public decimal? vam { get
|
public decimal? vam { get
|
||||||
@@ -128,6 +132,7 @@ namespace Back.Data.Models
|
|||||||
//شناسه یکتای ثبت قرارداد حق العمل کاری
|
//شناسه یکتای ثبت قرارداد حق العمل کاری
|
||||||
[MaxLength(12)]
|
[MaxLength(12)]
|
||||||
public string? bsrn { get; set; }
|
public string? bsrn { get; set; }
|
||||||
|
public decimal? _cfee { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Navigation
|
#region Navigation
|
||||||
|
@@ -111,7 +111,7 @@ namespace Back.Services
|
|||||||
var head = await invok.Where(w => w.Fild.Title == "H").Select(s => new _TaxPayer.Fild()
|
var head = await invok.Where(w => w.Fild.Title == "H").Select(s => new _TaxPayer.Fild()
|
||||||
{
|
{
|
||||||
FildID = s.FildID,
|
FildID = s.FildID,
|
||||||
eName = s.Fild.Name == "indatim" ? "InvoicIssueDate" : s.Fild.Name == "Indati2m" ? "InvoiceDate" : s.Fild.Name == "cdcd" ? "CottageDateOfCustomsDeclaration" : s.Fild.Name,
|
eName = s.Fild.Name == "indatim" ? "InvoicIssueDate" : s.Fild.Name == "Indati2m" ? "InvoiceDate" : s.Fild.Name == "cdcd" ? "CottageDateOfCustomsDeclaration" : s.Fild.Name,
|
||||||
fName = s.Fild.Type,
|
fName = s.Fild.Type,
|
||||||
ModeID = s.FildModeID,
|
ModeID = s.FildModeID,
|
||||||
ModeTitle = s.FildMode.Title,
|
ModeTitle = s.FildMode.Title,
|
||||||
@@ -131,7 +131,7 @@ namespace Back.Services
|
|||||||
var body = await invok.Where(w => w.Fild.Title == "B").Select(s => new _TaxPayer.Fild()
|
var body = await invok.Where(w => w.Fild.Title == "B").Select(s => new _TaxPayer.Fild()
|
||||||
{
|
{
|
||||||
FildID = s.FildID,
|
FildID = s.FildID,
|
||||||
eName = s.Fild.Name,
|
eName = s.Fild.Name == "cfee" ? "_cfee" : s.Fild.Name,
|
||||||
fName = s.Fild.Type,
|
fName = s.Fild.Type,
|
||||||
ModeID = s.FildModeID,
|
ModeID = s.FildModeID,
|
||||||
ModeTitle = s.FildMode.Title,
|
ModeTitle = s.FildMode.Title,
|
||||||
@@ -144,17 +144,12 @@ namespace Back.Services
|
|||||||
var Bmodel = body.Clone();
|
var Bmodel = body.Clone();
|
||||||
foreach (_TaxPayer.Fild item in Bmodel)
|
foreach (_TaxPayer.Fild item in Bmodel)
|
||||||
{
|
{
|
||||||
if (item.InputBox=="")
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
var resval = invoicedetail.GetType().GetProperties().Where(w => w.Name == item.eName).Select(s => s.GetValue(invoicedetail)).FirstOrDefault();
|
var resval = invoicedetail.GetType().GetProperties().Where(w => w.Name == item.eName).Select(s => s.GetValue(invoicedetail)).FirstOrDefault();
|
||||||
item.Value = resval == null ? "" : resval.ToString().Split('.').Length == 2 ? ((decimal)resval).ToString("N0") : resval.ToString();
|
item.Value = resval == null ? "" : resval.ToString().Split('.').Length == 2 ? ((decimal)resval).ToString("N0") : resval.ToString();
|
||||||
item.DefVals = item.InputBox == "fromdb" ? _codingRepo.Get(w => w.FildID == item.FildID).Select(ss => new _TaxPayer.Coding() { ID = ss.Code, Name = ss.Title }).ToList() : new List<_TaxPayer.Coding>();
|
item.DefVals = item.InputBox == "fromdb" ? _codingRepo.Get(w => w.FildID == item.FildID).Select(ss => new _TaxPayer.Coding() { ID = ss.Code, Name = ss.Title }).ToList() : new List<_TaxPayer.Coding>();
|
||||||
item.Des = item.ModeID == 3 ? _specialConditionRepo.Get(w => w.FildID == item.FildID).Select(ss => ss.condition).ToArray() : null;
|
item.Des = item.ModeID == 3 ? _specialConditionRepo.Get(w => w.FildID == item.FildID).Select(ss => ss.condition).ToArray() : null;
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -197,7 +192,7 @@ namespace Back.Services
|
|||||||
|
|
||||||
}
|
}
|
||||||
// سریال صورتحساب
|
// سریال صورتحساب
|
||||||
var innoS=await _invoiceRepo.Get(w => w.CompanyID == InvoiceItem.CompanyID).Select(s => s.inno).ToListAsync();
|
var innoS=await _invoiceRepo.Get(w => w.CompanyID == InvoiceItem.CompanyID && !string.IsNullOrEmpty(w.inno)).Select(s => s.inno).ToListAsync();
|
||||||
var result = Enumerable.Range(1, 1000000000) .Except(innoS.Select(t => t).ToList().Select(int.Parse).ToList()).FirstOrDefault();
|
var result = Enumerable.Range(1, 1000000000) .Except(innoS.Select(t => t).ToList().Select(int.Parse).ToList()).FirstOrDefault();
|
||||||
InvoiceItem.inno = result.ToString("0000000000");
|
InvoiceItem.inno = result.ToString("0000000000");
|
||||||
|
|
||||||
|
@@ -127,33 +127,36 @@ else
|
|||||||
if (item.eName.ToLower() == "inty")
|
if (item.eName.ToLower() == "inty")
|
||||||
{
|
{
|
||||||
var bill = BillTypes.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
|
var bill = BillTypes.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
|
||||||
if (bill != null)
|
|
||||||
{
|
<input value="@bill" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
||||||
item.Value = bill;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (item.eName.ToLower() == "inp")
|
else if (item.eName.ToLower() == "inp")
|
||||||
{
|
{
|
||||||
var patt = Patterns.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
|
patt=item.Value;
|
||||||
if (patt != null)
|
var _patt = Patterns.Where(w => w.ID == Convert.ToInt32(item.Value)).Select(s => s.Title).FirstOrDefault();
|
||||||
{
|
<input value="@_patt" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
||||||
item.Value = patt;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (item.eName.ToLower() == "ins")
|
else if (item.eName.ToLower() == "ins")
|
||||||
{
|
{
|
||||||
InvoiceType foo = (InvoiceType)Enum.Parse(typeof(InvoiceType), item.Value);
|
InvoiceType foo = (InvoiceType)Enum.Parse(typeof(InvoiceType), item.Value);
|
||||||
item.Value = foo.GetEnumDisplayName();
|
<input value="@foo.GetEnumDisplayName()" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (item.eName.ToLower() == "tob")
|
else if (item.eName.ToLower() == "tob")
|
||||||
{
|
{
|
||||||
CustomerType foo = (CustomerType)Enum.Parse(typeof(CustomerType), item.Value);
|
CustomerType foo = (CustomerType)Enum.Parse(typeof(CustomerType), item.Value);
|
||||||
item.Value = foo.GetEnumDisplayName();
|
<input value="@foo.GetEnumDisplayName()" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<input @bind-value="item.Value" style="text-align:center;" class="form-control" type="text" placeholder="@item.fName" disabled />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -244,12 +247,9 @@ else
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (itemB.InputBox == "autofild")
|
else if (itemB.InputBox == "autofild" || (itemB.eName.ToLower() == "_cfee" && patt != "2"))
|
||||||
{
|
{
|
||||||
<input @bind-value="itemB.Value" style="text-align:center;" class="form-control" type="text" placeholder="@itemB.fName" disabled />
|
<input @bind-value="itemB.Value" style="text-align:center;" class="form-control" type="text" placeholder="@itemB.fName" disabled />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -307,6 +307,7 @@ else
|
|||||||
|
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
string patt = "";
|
||||||
private List<IdName<int>>? Patterns = new List<IdName<int>>();
|
private List<IdName<int>>? Patterns = new List<IdName<int>>();
|
||||||
private List<IdName<int>>? BillTypes = new List<IdName<int>>();
|
private List<IdName<int>>? BillTypes = new List<IdName<int>>();
|
||||||
private Modal modal = default!;
|
private Modal modal = default!;
|
||||||
|
Reference in New Issue
Block a user