This commit is contained in:
mmrbnjd
2024-08-09 23:20:25 +03:30
parent 3a4eb0a4de
commit 42ce2a29e7
6 changed files with 29 additions and 46 deletions

View File

@@ -111,7 +111,7 @@ namespace Back.Services
var head = await invok.Where(w => w.Fild.Title == "H").Select(s => new _TaxPayer.Fild()
{
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,
ModeID = s.FildModeID,
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()
{
FildID = s.FildID,
eName = s.Fild.Name,
eName = s.Fild.Name == "cfee" ? "_cfee" : s.Fild.Name,
fName = s.Fild.Type,
ModeID = s.FildModeID,
ModeTitle = s.FildMode.Title,
@@ -144,17 +144,12 @@ namespace Back.Services
var Bmodel = body.Clone();
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();
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.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();
InvoiceItem.inno = result.ToString("0000000000");