This commit is contained in:
@@ -566,7 +566,7 @@ namespace AyaNova.Api.Controllers
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="updatedObject">WorkOrderItemLabor - top level only, no descendants</param>
|
||||
/// <returns>New concurrency token</returns>
|
||||
/// <returns>Updated object</returns>
|
||||
[HttpPut("items/labors")]
|
||||
public async Task<IActionResult> PutWorkOrderItemLabor([FromBody] WorkOrderItemLabor updatedObject)
|
||||
{
|
||||
@@ -585,7 +585,7 @@ namespace AyaNova.Api.Controllers
|
||||
else
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
return Ok(ApiOkResponse.Response(new { Concurrency = o.Concurrency }));
|
||||
return Ok(ApiOkResponse.Response(o));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1646,6 +1646,7 @@ namespace AyaNova.Biz
|
||||
//newObject.CustomFields = JsonUtil.CompactJson(newObject.CustomFields);
|
||||
await ct.WorkOrderItemLabor.AddAsync(newObject);
|
||||
await ct.SaveChangesAsync();
|
||||
newObject.IsDirty = false;
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, newObject.AyaType, AyaEvent.Created), ct);
|
||||
await LaborSearchIndexAsync(newObject, true);
|
||||
// await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, newObject.Tags, null);
|
||||
@@ -1693,6 +1694,7 @@ namespace AyaNova.Biz
|
||||
try
|
||||
{
|
||||
await ct.SaveChangesAsync();
|
||||
putObject.IsDirty = false;
|
||||
}
|
||||
catch (DbUpdateConcurrencyException)
|
||||
{
|
||||
@@ -1822,8 +1824,8 @@ namespace AyaNova.Biz
|
||||
//if modifed, see what has changed and should be re-applied
|
||||
if (ayaEvent == AyaEvent.Modified)
|
||||
{
|
||||
//If it wasn't a service rate change there is no need to set pricing
|
||||
if (newObj.ServiceRateId == oldObj.ServiceRateId)
|
||||
//If it wasn't a service rate or quantity change there is no need to set pricing
|
||||
if (newObj.ServiceRateId == oldObj.ServiceRateId && newObj.ServiceRateQuantity != oldObj.ServiceRateQuantity)
|
||||
{
|
||||
SetPrice = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user