|
|
@@ -343,6 +343,24 @@ class OrderShopStore extends AbstractStore |
|
|
|
return $query->findOne(); |
|
|
|
} |
|
|
|
|
|
|
|
public function getOneValidByDistributionAndUser( |
|
|
|
DistributionInterface $distribution, |
|
|
|
UserInterface $user, |
|
|
|
$query = null |
|
|
|
): ?OrderShopInterface |
|
|
|
{ |
|
|
|
$query = $this->createDefaultQuery($query); |
|
|
|
|
|
|
|
$query |
|
|
|
->filterByDistribution($distribution) |
|
|
|
->filterByUser($user) |
|
|
|
->filterByStatus(OrderStatusModel::$statusAliasAsValid) |
|
|
|
->filterIsNotComplementaryOrderShop() |
|
|
|
->orderBy('.cycleId', 'DESC'); |
|
|
|
|
|
|
|
return $query->findOne(); |
|
|
|
} |
|
|
|
|
|
|
|
//findLastOrderValid |
|
|
|
public function getOneLastValid($query = null): ?OrderShopInterface |
|
|
|
{ |