This commit is contained in:
2021-05-18 18:45:46 +00:00
parent 1742cdec0a
commit 79ade77f34

View File

@@ -328,7 +328,8 @@ namespace AyaNova.Biz
if (ayaEvent == AyaEvent.Created) if (ayaEvent == AyaEvent.Created)
{ {
await AutoSetContractAsync(newObj); await AutoSetContractAsync(newObj);
await AutoSetCloseByDateAsync(newObj); if (newObj.CompleteByDate == null)//need to account for a user manually selecting a specific close by date in advance indicating to ignore any auto sets
await AutoSetCloseByDateAsync(newObj);
await AutoSetAddressAsync(newObj); await AutoSetAddressAsync(newObj);
return; return;
} }
@@ -420,13 +421,16 @@ namespace AyaNova.Biz
{ {
await GetCurrentContractFromContractIdAsync(newObj.ContractId); await GetCurrentContractFromContractIdAsync(newObj.ContractId);
if (mContractInEffect != null && mContractInEffect.ResponseTime != TimeSpan.Zero) if (mContractInEffect != null && mContractInEffect.ResponseTime != TimeSpan.Zero)
{
newObj.CompleteByDate = DateTime.UtcNow.Add(mContractInEffect.ResponseTime); newObj.CompleteByDate = DateTime.UtcNow.Add(mContractInEffect.ResponseTime);
return; //our work here is done
}
} }
else
{ //not set yet, maybe the global default is the way...
if (AyaNova.Util.ServerGlobalBizSettings.WorkOrderCompleteByAge != TimeSpan.Zero) if (AyaNova.Util.ServerGlobalBizSettings.WorkOrderCompleteByAge != TimeSpan.Zero)
newObj.CompleteByDate = DateTime.UtcNow.Add(AyaNova.Util.ServerGlobalBizSettings.WorkOrderCompleteByAge); newObj.CompleteByDate = DateTime.UtcNow.Add(AyaNova.Util.ServerGlobalBizSettings.WorkOrderCompleteByAge);
}
} }
// //////////////////////////////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////////////////////////////