This commit is contained in:
mmrbnjd
2024-05-27 18:57:25 +03:30
parent e8c5dfcda4
commit 66871c7425
4 changed files with 15 additions and 15 deletions

View File

@@ -59,8 +59,8 @@ namespace Back.Controllers
// return BadRequest(item);
//-----GetUserAndCompany
var claim = "64"/* HttpContext.User.Claims.First(c => c.Type == "UserID")*/;
var UserID = claim;
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
var UserID = claim.Value;
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
//-----Validaton
@@ -78,7 +78,7 @@ namespace Back.Controllers
//}
return Ok(_servInvoice.AddInvoice(new Invoice()
return Ok(await _servInvoice.AddInvoice(new Invoice()
{
Title = item.Title,

View File

@@ -30,7 +30,7 @@ namespace Back.Data.Infrastructure.Repository
public IQueryable<T> Get(Expression<Func<T, bool>> predicate)
{
var query = _query.AsQueryable();
// query = query.AsNoTracking();
query = query.AsNoTracking();
return query.Where(predicate).AsQueryable();
}
public IQueryable<T> TrackingGet(Expression<Func<T, bool>> predicate)

View File

@@ -101,8 +101,8 @@ namespace Back.Data.Models
public string? Des { get; set; }
public InvoiceType invoiceType { get; set; }
//شماره منحصر به فرد مالیاتی
[MaxLength(22)]
public string? taxid { get; set; }
// [MaxLength(22)]
public string taxid { get; set; } = "";
//شماره منحصر به فرد مالیاتی صورتحساب مرجع
[MaxLength(22)]
public string? irtaxid { get; set; }
@@ -160,12 +160,12 @@ namespace Back.Data.Models
public virtual Customer Customer { get; set; }
[ForeignKey("LastChangeUserID")]
public virtual User user { get; set; }
public virtual ICollection<InvoiceItem>? invoiceDetails { get; set; }
public virtual ICollection<InvoiceItem> invoiceDetails { get; set; }
[ForeignKey("BillReference")]
public virtual Invoice? invoice { get; set; }
public virtual ICollection<InvoicePayment>? payments { get; set; }
public virtual ICollection<InvoiceStatusChang>? invoiceStatusChangs { get; set; }
public virtual ICollection<SentTax>? sentTax { get; set; }
public virtual ICollection<InvoicePayment> payments { get; set; }
public virtual ICollection<InvoiceStatusChang> invoiceStatusChangs { get; set; }
public virtual ICollection<SentTax> sentTax { get; set; }
[ForeignKey("PatternID")]
public virtual Pattern? pattern { get; set; }
[ForeignKey("CompanyID")]

View File

@@ -136,11 +136,11 @@ namespace Back.Services
invoice.PreparedtoSendtoTax = false;
if (calculate)
{
//if (await _checkPermission.ExtensionofAccess(invoice.CompanyID.Value, 3, "-1"))
// {
if (await _checkPermission.ExtensionofAccess(invoice.CompanyID.Value, 3, "-1"))
{
var item = await _invoiceRepo.AddAsync(invoice);
return item.ID;
// }
}
return -1;
}