...
This commit is contained in:
@@ -48,6 +48,14 @@ namespace Back.Controllers
|
||||
if (invoice == null)
|
||||
return BadRequest(new List<string> { "invoice notFound..." });
|
||||
|
||||
if (invoice.invoiceType==InvoiceType.Repair)
|
||||
{
|
||||
return BadRequest(new List<string> { "امکان افزودن کالا جدید در صورتحساب اصلاحی وجود ندارد" });
|
||||
}
|
||||
if (invoice.invoiceType == InvoiceType.BackFrmSale)
|
||||
{
|
||||
return BadRequest(new List<string> { "امکان افزودن کالا جدید در صورتحساب برگشت از فروش وجود ندارد" });
|
||||
}
|
||||
|
||||
invoice.LastChangeUserID = Convert.ToInt32(UserID);
|
||||
|
||||
@@ -81,10 +89,10 @@ namespace Back.Controllers
|
||||
if (invoice == null)
|
||||
return BadRequest(new List<string> { "invoice notFound..." });
|
||||
|
||||
|
||||
|
||||
|
||||
//-----Validaton
|
||||
var resultValidationmodel = await _validationInvoiceItem.ValidateAsync(Tuple.Create(user.RolUsers.First().CompanyID, model.invoiceID, model.item, eActionValidation.update));
|
||||
//-----Validaton
|
||||
var resultValidationmodel = await _validationInvoiceItem.ValidateAsync(Tuple.Create(user.RolUsers.First().CompanyID, model.invoiceID, model.item, eActionValidation.update));
|
||||
if (!resultValidationmodel.IsValid)
|
||||
{
|
||||
if (invoice.invoiceType != InvoiceType.BackFrmSale || (invoice.invoiceType != InvoiceType.BackFrmSale
|
||||
@@ -103,8 +111,27 @@ namespace Back.Controllers
|
||||
if (invoiceitem == null)
|
||||
return BadRequest(new List<string> { "invoice Item notFound..." });
|
||||
|
||||
if (invoice.invoiceType == InvoiceType.Repair && invoiceitem.CODID != model.item.CODID)
|
||||
{
|
||||
return BadRequest(new List<string> { "در صورتحساب اصلاجی نمیتوان کالا را تغییر داد" });
|
||||
}
|
||||
if (invoice.invoiceType == InvoiceType.BackFrmSale && invoiceitem.CODID != model.item.CODID)
|
||||
{
|
||||
return BadRequest(new List<string> { "در صورتحساب برگشت از فروش نمیتوان کالا را تغییر داد" });
|
||||
}
|
||||
|
||||
if (invoice.invoiceType == InvoiceType.Repair && invoiceitem.fee != model.item.fee)
|
||||
{
|
||||
return BadRequest(new List<string> { "در صورتحساب اصلاجی نمیتوان مبلغ واحد را تغییر داد" });
|
||||
}
|
||||
if (invoice.invoiceType == InvoiceType.BackFrmSale && invoiceitem.fee != model.item.fee)
|
||||
{
|
||||
return BadRequest(new List<string> { "در صورتحساب برگشت از فروش نمیتوان مبلغ واحد را تغییر داد" });
|
||||
}
|
||||
|
||||
|
||||
if (invoice.invoiceType==InvoiceType.BackFrmSale && invoiceitem.am < model.item.am)
|
||||
return BadRequest(new List<string> { "در حالت برگشت از فروش تعداد آیتم فقط میتواند کاهشی باشد" });
|
||||
return BadRequest(new List<string> { "در صورتحساب برگشت از فروش تعداد آیتم فقط میتواند کاهشی باشد" });
|
||||
|
||||
invoice.LastChangeUserID = Convert.ToInt32(UserID);
|
||||
|
||||
@@ -146,6 +173,14 @@ namespace Back.Controllers
|
||||
|
||||
|
||||
|
||||
if (invoiceitem.invoice.invoiceType == InvoiceType.Repair )
|
||||
{
|
||||
return BadRequest(new List<string> { "در صورتحساب اصلاجی نمیتوان کالا را حذف کذد" });
|
||||
}
|
||||
if (invoiceitem.invoice.invoiceType == InvoiceType.BackFrmSale)
|
||||
{
|
||||
return BadRequest(new List<string> { "در صورتحساب برگشت از فروش نمیتوان کالا را حذف کذد" });
|
||||
}
|
||||
invoiceitem.invoice.LastChangeUserID = Convert.ToInt32(UserID);
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user