This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user