This commit is contained in:
2021-05-14 18:36:49 +00:00
parent 4e3668673f
commit 59bb48750c
2 changed files with 16 additions and 8 deletions

View File

@@ -1895,15 +1895,20 @@ namespace AyaNova.Biz
}
//CONTRACT ADJUSTMENTS
//First check if there is a matching tagged service rate contract discount, that takes precedence
if(c.ContractServiceRateOverrideItems.Count>0){
if (c.ContractServiceRateOverrideItems.Count > 0)
{
//does our contract rate have a matching tag?
//TODO: Iterate all contract tagged items, use the one with the MOST matching tags
foreach(var csr in c.ContractServiceRateOverrideItems){
csr.Tags.All(z => Rate.Tags.Any(x => x == z));
}
//Iterate all contract tagged items in order of ones with the most tags first
foreach (var csr in c.ContractServiceRateOverrideItems.OrderByDescending(z => z.Tags.Count))
if (csr.Tags.All(z => Rate.Tags.Any(x => x == z)))
{
break;
}
}