@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Controller\Order; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateModel; | |||
use Lc\CaracoleBundle\Model\Config\UnitModel; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
abstract class OrderShopAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
} |
@@ -0,0 +1,18 @@ | |||
<?php | |||
namespace Lc\CaracoleBundle\Controller\Reduction; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\ChoiceField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\NumberField; | |||
use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\CaracoleBundle\Controller\AdminControllerTrait; | |||
use Lc\CaracoleBundle\Model\Config\TaxRateModel; | |||
use Lc\CaracoleBundle\Model\Config\UnitModel; | |||
use Lc\SovBundle\Controller\AbstractAdminController; | |||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||
abstract class ReductionCreditAdminController extends AbstractAdminController | |||
{ | |||
use AdminControllerTrait; | |||
} |
@@ -26,4 +26,12 @@ class QueryBuilder extends SovQueryBuilder | |||
return $this; | |||
} | |||
public function andWhereMerchantManyToMany($dqlId, $merchant):self | |||
{ | |||
$this->andWhere(':currentMerchant MEMBER OF '.$dqlId.'.merchants'); | |||
$this->setParameter('currentMerchant', $merchant); | |||
return $this; | |||
} | |||
} |
@@ -64,6 +64,13 @@ final class AssociationField implements FieldInterface | |||
return $this; | |||
} | |||
public function setFilterOnMerchantManyToMany(MerchantInterface $merchant): self | |||
{ | |||
$this->queryBuilderParameters['merchantManyToMany'] = $merchant; | |||
return $this; | |||
} | |||
public function setFilterOnDevAlias(string $devAlias): self | |||
{ | |||
$this->queryBuilderParameters['devAlias'] = $devAlias; | |||
@@ -107,6 +114,10 @@ final class AssociationField implements FieldInterface | |||
$qb->andWhereMerchant('e',$param['merchant']); | |||
} | |||
if (isset($param['merchantManyToMany'])) { | |||
$qb->andWhereMerchantManyToMany('e',$param['merchantManyToMany']); | |||
} | |||
if (isset($param['status'])) { | |||
$qb->andWhere('e.status = :status')->setParameter('status', $param['status']); | |||
} |
@@ -42,16 +42,6 @@ abstract class ReductionCartModel extends AbstractLightEntity implements Reducti | |||
const APPLIED_TO_DELIVERY = 'delivery'; | |||
const APPLIED_TO_ORDER_PRODUCTS = 'order-products'; | |||
public function getAppliedToChoices() | |||
{ | |||
return [ | |||
self::APPLIED_TO_DELIVERY, | |||
self::APPLIED_TO_ORDER_PRODUCTS, | |||
]; | |||
} | |||
/** | |||
* @ORM\Column(type="string", length=255) | |||
*/ |
@@ -3,6 +3,7 @@ | |||
namespace Lc\CaracoleBundle\Solver\Reduction; | |||
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; | |||
use Lc\CaracoleBundle\Model\Reduction\ReductionCartModel; | |||
use Lc\SovBundle\Model\User\UserInterface; | |||
class ReductionCartSolver | |||
@@ -43,4 +44,14 @@ class ReductionCartSolver | |||
return $conditionGroupUser; | |||
} | |||
public function getAppliedToChoices() | |||
{ | |||
return [ | |||
// ReductionCartModel::APPLIED_TO_DELIVERY, | |||
ReductionCartModel::APPLIED_TO_ORDER_PRODUCTS, | |||
]; | |||
} | |||
} |