This commit is contained in:
@@ -328,6 +328,7 @@ namespace AyaNova.Biz
|
|||||||
if (ayaEvent == AyaEvent.Created)
|
if (ayaEvent == AyaEvent.Created)
|
||||||
{
|
{
|
||||||
await AutoSetContractAsync(newObj);
|
await AutoSetContractAsync(newObj);
|
||||||
|
await AutoSetCloseByDateAsync(newObj);
|
||||||
await AutoSetAddressAsync(newObj);
|
await AutoSetAddressAsync(newObj);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -341,6 +342,9 @@ namespace AyaNova.Biz
|
|||||||
await AutoSetContractAsync(newObj);
|
await AutoSetContractAsync(newObj);
|
||||||
await AutoSetAddressAsync(newObj);
|
await AutoSetAddressAsync(newObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (newObj.ContractId != oldObj.ContractId)
|
||||||
|
await AutoSetCloseByDateAsync(newObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,12 +409,13 @@ namespace AyaNova.Biz
|
|||||||
newObj.ContractId = head.contractId;
|
newObj.ContractId = head.contractId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task AutoSetCloseByDateAsync(WorkOrder newObj)
|
||||||
|
{
|
||||||
|
//called when there is a definite possibility of change of close by i.e. new contract, new customer, new workorder
|
||||||
//RESPONSE TIME / COMPLETE BY AUTO SET
|
//RESPONSE TIME / COMPLETE BY AUTO SET
|
||||||
//precedence: manually pre-set -> contract -> global biz
|
//precedence: manually pre-set -> contract -> global biz
|
||||||
if (newObj.CompleteByDate != null)
|
|
||||||
{
|
|
||||||
if (newObj.ContractId != null)
|
if (newObj.ContractId != null)
|
||||||
{
|
{
|
||||||
await GetCurrentContractFromContractIdAsync(newObj.ContractId);
|
await GetCurrentContractFromContractIdAsync(newObj.ContractId);
|
||||||
@@ -423,7 +428,6 @@ namespace AyaNova.Biz
|
|||||||
newObj.CompleteByDate = DateTime.UtcNow.Add(AyaNova.Util.ServerGlobalBizSettings.WorkOrderCompleteByAge);
|
newObj.CompleteByDate = DateTime.UtcNow.Add(AyaNova.Util.ServerGlobalBizSettings.WorkOrderCompleteByAge);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// ////////////////////////////////////////////////////////////////////////////////////////////////
|
// ////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// //CONTRACT UPDATE
|
// //CONTRACT UPDATE
|
||||||
|
|||||||
Reference in New Issue
Block a user