...
This commit is contained in:
@@ -59,8 +59,8 @@ namespace Back.Controllers
|
|||||||
// return BadRequest(item);
|
// return BadRequest(item);
|
||||||
|
|
||||||
//-----GetUserAndCompany
|
//-----GetUserAndCompany
|
||||||
var claim = "64"/* HttpContext.User.Claims.First(c => c.Type == "UserID")*/;
|
var claim = HttpContext.User.Claims.First(c => c.Type == "UserID");
|
||||||
var UserID = claim;
|
var UserID = claim.Value;
|
||||||
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
var user = await _servUser.GetUserByUserID(Convert.ToInt32(UserID));
|
||||||
|
|
||||||
//-----Validaton
|
//-----Validaton
|
||||||
@@ -78,7 +78,7 @@ namespace Back.Controllers
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
||||||
return Ok(_servInvoice.AddInvoice(new Invoice()
|
return Ok(await _servInvoice.AddInvoice(new Invoice()
|
||||||
{
|
{
|
||||||
|
|
||||||
Title = item.Title,
|
Title = item.Title,
|
||||||
|
@@ -30,7 +30,7 @@ namespace Back.Data.Infrastructure.Repository
|
|||||||
public IQueryable<T> Get(Expression<Func<T, bool>> predicate)
|
public IQueryable<T> Get(Expression<Func<T, bool>> predicate)
|
||||||
{
|
{
|
||||||
var query = _query.AsQueryable();
|
var query = _query.AsQueryable();
|
||||||
// query = query.AsNoTracking();
|
query = query.AsNoTracking();
|
||||||
return query.Where(predicate).AsQueryable();
|
return query.Where(predicate).AsQueryable();
|
||||||
}
|
}
|
||||||
public IQueryable<T> TrackingGet(Expression<Func<T, bool>> predicate)
|
public IQueryable<T> TrackingGet(Expression<Func<T, bool>> predicate)
|
||||||
|
@@ -101,8 +101,8 @@ namespace Back.Data.Models
|
|||||||
public string? Des { get; set; }
|
public string? Des { get; set; }
|
||||||
public InvoiceType invoiceType { get; set; }
|
public InvoiceType invoiceType { get; set; }
|
||||||
//شماره منحصر به فرد مالیاتی
|
//شماره منحصر به فرد مالیاتی
|
||||||
[MaxLength(22)]
|
// [MaxLength(22)]
|
||||||
public string? taxid { get; set; }
|
public string taxid { get; set; } = "";
|
||||||
//شماره منحصر به فرد مالیاتی صورتحساب مرجع
|
//شماره منحصر به فرد مالیاتی صورتحساب مرجع
|
||||||
[MaxLength(22)]
|
[MaxLength(22)]
|
||||||
public string? irtaxid { get; set; }
|
public string? irtaxid { get; set; }
|
||||||
@@ -160,12 +160,12 @@ namespace Back.Data.Models
|
|||||||
public virtual Customer Customer { get; set; }
|
public virtual Customer Customer { get; set; }
|
||||||
[ForeignKey("LastChangeUserID")]
|
[ForeignKey("LastChangeUserID")]
|
||||||
public virtual User user { get; set; }
|
public virtual User user { get; set; }
|
||||||
public virtual ICollection<InvoiceItem>? invoiceDetails { get; set; }
|
public virtual ICollection<InvoiceItem> invoiceDetails { get; set; }
|
||||||
[ForeignKey("BillReference")]
|
[ForeignKey("BillReference")]
|
||||||
public virtual Invoice? invoice { get; set; }
|
public virtual Invoice? invoice { get; set; }
|
||||||
public virtual ICollection<InvoicePayment>? payments { get; set; }
|
public virtual ICollection<InvoicePayment> payments { get; set; }
|
||||||
public virtual ICollection<InvoiceStatusChang>? invoiceStatusChangs { get; set; }
|
public virtual ICollection<InvoiceStatusChang> invoiceStatusChangs { get; set; }
|
||||||
public virtual ICollection<SentTax>? sentTax { get; set; }
|
public virtual ICollection<SentTax> sentTax { get; set; }
|
||||||
[ForeignKey("PatternID")]
|
[ForeignKey("PatternID")]
|
||||||
public virtual Pattern? pattern { get; set; }
|
public virtual Pattern? pattern { get; set; }
|
||||||
[ForeignKey("CompanyID")]
|
[ForeignKey("CompanyID")]
|
||||||
|
@@ -136,11 +136,11 @@ namespace Back.Services
|
|||||||
invoice.PreparedtoSendtoTax = false;
|
invoice.PreparedtoSendtoTax = false;
|
||||||
if (calculate)
|
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);
|
var item = await _invoiceRepo.AddAsync(invoice);
|
||||||
return item.ID;
|
return item.ID;
|
||||||
// }
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user