|
|
|
|
|
|
|
|
public function getSpecificPricesFilterByPriorityMatch($specificPrices, $user, $pointSale) |
|
|
public function getSpecificPricesFilterByPriorityMatch($specificPrices, $user, $pointSale) |
|
|
{ |
|
|
{ |
|
|
$priorityMatchSpecificPrice = ProductPrice::getPriorityMatchOfSpecificPriceArray($specificPrices, $user, $pointSale); |
|
|
$priorityMatchSpecificPrice = ProductPrice::getPriorityMatchOfSpecificPriceArray($specificPrices, $user, $pointSale); |
|
|
|
|
|
$specificPricesFilter = []; |
|
|
|
|
|
|
|
|
if($priorityMatchSpecificPrice) { |
|
|
|
|
|
foreach($specificPrices as $keySpecificPrice => $specificPrice) { |
|
|
|
|
|
if(!$specificPrice->$priorityMatchSpecificPrice($user, $pointSale)) { |
|
|
|
|
|
unset($specificPrices[$keySpecificPrice]); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
foreach($specificPrices as $keySpecificPrice => $specificPrice) { |
|
|
|
|
|
if(($priorityMatchSpecificPrice && $specificPrice->$priorityMatchSpecificPrice($user, $pointSale)) |
|
|
|
|
|
|| $specificPrice->matchFromQuantityOnly()) { |
|
|
|
|
|
|
|
|
return $specificPrices; |
|
|
|
|
|
|
|
|
$specificPricesFilter[] = $specificPrice; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
return []; |
|
|
|
|
|
|
|
|
return $specificPricesFilter; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getPrice($params = []) |
|
|
public function getPrice($params = []) |