This commit is contained in:
@@ -201,7 +201,4 @@ This menu option makes a service work order by copying the shared fields from th
|
|||||||
|
|
||||||
This menu option makes a [Quote](svc-quotes.md) by copying the shared fields from the PM to a new Quote. Use this feature if an existing PM is nearly identical to a Quote that needs to be made to save typing or to re-quote an existing PM schedule that's nearing it's end of term.
|
This menu option makes a [Quote](svc-quotes.md) by copying the shared fields from the PM to a new Quote. Use this feature if an existing PM is nearly identical to a Quote that needs to be made to save typing or to re-quote an existing PM schedule that's nearing it's end of term.
|
||||||
|
|
||||||
#### Quote status list
|
|
||||||
|
|
||||||
This is a link to edit the Quote states available. See the [Quote status help page](svc-quote-status.md) for more details.
|
|
||||||
|
|
||||||
|
|||||||
@@ -565,19 +565,27 @@ namespace AyaNova.Biz
|
|||||||
//called when there is a definite possibility of change of close by i.e. new contract, new customer, new workorder
|
//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 work order doesn't have a service date set then use utcnow otherwise use the selected date
|
||||||
|
DateTime referenceDate = DateTime.UtcNow;
|
||||||
|
if (newObj.ServiceDate != null)
|
||||||
|
{
|
||||||
|
referenceDate = (DateTime)newObj.ServiceDate;
|
||||||
|
}
|
||||||
|
|
||||||
if (newObj.ContractId != null)
|
if (newObj.ContractId != null)
|
||||||
{
|
{
|
||||||
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 = referenceDate.Add(mContractInEffect.ResponseTime);
|
||||||
return; //our work here is done
|
return; //our work here is done
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//not set yet, maybe the global default is the way...
|
//not set yet, maybe the global default is the way...
|
||||||
if (AyaNova.Util.ServerGlobalBizSettings.Cache.WorkOrderCompleteByAge != TimeSpan.Zero)
|
if (AyaNova.Util.ServerGlobalBizSettings.Cache.WorkOrderCompleteByAge != TimeSpan.Zero)
|
||||||
newObj.CompleteByDate = DateTime.UtcNow.Add(AyaNova.Util.ServerGlobalBizSettings.Cache.WorkOrderCompleteByAge);
|
newObj.CompleteByDate = referenceDate.Add(AyaNova.Util.ServerGlobalBizSettings.Cache.WorkOrderCompleteByAge);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user