This commit is contained in:
2021-05-17 15:35:34 +00:00
parent 6d76a73191
commit 16bee4eff8
2 changed files with 6 additions and 5 deletions

View File

@@ -13,5 +13,6 @@ NOTES FOR DOC
- PRECEDENCE: Tagged Contract price overrides take precedence over general Contract price overrides. For example, if a Contract has a general discount for Labor rates and also has a tag override for a Labor record and the tags match then the tag override is the one used and the general override is ignored. If no tags matched then the general price override would be applied. - PRECEDENCE: Tagged Contract price overrides take precedence over general Contract price overrides. For example, if a Contract has a general discount for Labor rates and also has a tag override for a Labor record and the tags match then the tag override is the one used and the general override is ignored. If no tags matched then the general price override would be applied.
Conflict - multiple potential matches: Conflict - multiple potential matches:
Contract tagged items are checked against the object in order of the contract tagged override with the most tags to the contract override with the least tags. This is done to try to make the most specific possible tag match. For example, a contract with 3 tagged labor price overrides and their tags selected are: "green", "red, green, blue", "orange, green". AyaNova will attempt to match by starting with the contract labor override with the most tags: "red,green,blue" then "orange,green" and finally "green". If a record is saved tagged with "orange,red,yellow,green,black,blue" it will be matched to the first item tagged "red,green,blue" as it has the most terms that match and it's override terms will be used and the other two will not be used. Contract tagged items are checked against the object in order of the Contract tagged override with the most tags to the Contract override with the least tags. This is done to try to make the most specific possible tag match. For example, a Contract with 3 tagged labor price overrides and their tags selected are: "green", "red, green, blue", "orange, green". AyaNova will attempt to match by starting with the Contract labor override with the most tags: "red,green,blue" then "orange,green" and finally "green". If a record is saved tagged with "orange,red,yellow,green,black,blue" it will be matched to the first item tagged "red,green,blue" as it has the most terms that match and it's override terms will be used and the other two will not be used.
- Expiration: Contract expiry dates are checked at the time of work order **creation**. If a work order is in progress and has items added after it's Contract has expired the Contract will still apply to that work order.

View File

@@ -235,7 +235,7 @@ namespace AyaNova.Biz
await WorkOrderValidateAsync(putObject, dbObject); await WorkOrderValidateAsync(putObject, dbObject);
if (HasErrors) if (HasErrors)
return null; return null;
// await WorkOrderBizActionsAsync(AyaEvent.Modified, putObject, dbObject, null); await WorkOrderBizActionsAsync(AyaEvent.Modified, putObject, dbObject, null);
ct.Replace(dbObject, putObject); ct.Replace(dbObject, putObject);
try try
{ {
@@ -328,7 +328,7 @@ namespace AyaNova.Biz
//CREATION ACTIONS //CREATION ACTIONS
if (ayaEvent == AyaEvent.Created) if (ayaEvent == AyaEvent.Created)
{ { //applied at time of creation only
//CONTRACT AUTO SET //CONTRACT AUTO SET
if (newObj.ContractId == null && newObj.CustomerId != 0) if (newObj.ContractId == null && newObj.CustomerId != 0)
{ {
@@ -509,7 +509,7 @@ namespace AyaNova.Biz
//If Contract has response time then set CompleteByDate //If Contract has response time then set CompleteByDate
if (mContractInEffect.ResponseTime != TimeSpan.Zero) if (mContractInEffect!=null && mContractInEffect.ResponseTime != TimeSpan.Zero)
{ {
wo.CompleteByDate = DateTime.UtcNow.Add(mContractInEffect.ResponseTime); wo.CompleteByDate = DateTime.UtcNow.Add(mContractInEffect.ResponseTime);
} }