<?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; | |||||
} |
<?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; | |||||
} |
return $this; | return $this; | ||||
} | } | ||||
public function andWhereMerchantManyToMany($dqlId, $merchant):self | |||||
{ | |||||
$this->andWhere(':currentMerchant MEMBER OF '.$dqlId.'.merchants'); | |||||
$this->setParameter('currentMerchant', $merchant); | |||||
return $this; | |||||
} | |||||
} | } |
return $this; | return $this; | ||||
} | } | ||||
public function setFilterOnMerchantManyToMany(MerchantInterface $merchant): self | |||||
{ | |||||
$this->queryBuilderParameters['merchantManyToMany'] = $merchant; | |||||
return $this; | |||||
} | |||||
public function setFilterOnDevAlias(string $devAlias): self | public function setFilterOnDevAlias(string $devAlias): self | ||||
{ | { | ||||
$this->queryBuilderParameters['devAlias'] = $devAlias; | $this->queryBuilderParameters['devAlias'] = $devAlias; | ||||
$qb->andWhereMerchant('e',$param['merchant']); | $qb->andWhereMerchant('e',$param['merchant']); | ||||
} | } | ||||
if (isset($param['merchantManyToMany'])) { | |||||
$qb->andWhereMerchantManyToMany('e',$param['merchantManyToMany']); | |||||
} | |||||
if (isset($param['status'])) { | if (isset($param['status'])) { | ||||
$qb->andWhere('e.status = :status')->setParameter('status', $param['status']); | $qb->andWhere('e.status = :status')->setParameter('status', $param['status']); | ||||
} | } |
const APPLIED_TO_DELIVERY = 'delivery'; | const APPLIED_TO_DELIVERY = 'delivery'; | ||||
const APPLIED_TO_ORDER_PRODUCTS = 'order-products'; | 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) | * @ORM\Column(type="string", length=255) | ||||
*/ | */ |
namespace Lc\CaracoleBundle\Solver\Reduction; | namespace Lc\CaracoleBundle\Solver\Reduction; | ||||
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; | use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; | ||||
use Lc\CaracoleBundle\Model\Reduction\ReductionCartModel; | |||||
use Lc\SovBundle\Model\User\UserInterface; | use Lc\SovBundle\Model\User\UserInterface; | ||||
class ReductionCartSolver | class ReductionCartSolver | ||||
return $conditionGroupUser; | return $conditionGroupUser; | ||||
} | } | ||||
public function getAppliedToChoices() | |||||
{ | |||||
return [ | |||||
// ReductionCartModel::APPLIED_TO_DELIVERY, | |||||
ReductionCartModel::APPLIED_TO_ORDER_PRODUCTS, | |||||
]; | |||||
} | |||||
} | } |