TextField::new('wordingUnit'), | TextField::new('wordingUnit'), | ||||
TextField::new('wordingShort'), | TextField::new('wordingShort'), | ||||
IntegerField::new('coefficient'), | IntegerField::new('coefficient'), | ||||
AssociationField::new('unitReference'), | |||||
AssociationField::new('unitReference') | |||||
->setCustomOption('filter', false), | |||||
]; | ]; | ||||
} | } | ||||
use Lc\CaracoleBundle\Context\MerchantContextTrait; | use Lc\CaracoleBundle\Context\MerchantContextTrait; | ||||
use Lc\CaracoleBundle\Definition\Field\AbstractFieldDefinition; | use Lc\CaracoleBundle\Definition\Field\AbstractFieldDefinition; | ||||
use Lc\CaracoleBundle\Field\AssociationField; | use Lc\CaracoleBundle\Field\AssociationField; | ||||
use Lc\CaracoleBundle\Field\Filter\Order\OrderShopComplementaryFilter; | |||||
use Lc\CaracoleBundle\Field\Filter\Order\OrderShopOrderDeliveryTypeFilter; | |||||
use Lc\CaracoleBundle\Field\Filter\Order\OrderShopOrderPaymentFilter; | |||||
use Lc\CaracoleBundle\Field\Filter\Order\OrderShopOrderStatusFilter; | |||||
use Lc\CaracoleBundle\Field\Filter\Order\OrderShopUserEmailFilter; | use Lc\CaracoleBundle\Field\Filter\Order\OrderShopUserEmailFilter; | ||||
use Lc\CaracoleBundle\Field\Filter\Order\OrderShopUserFirstnameFilter; | use Lc\CaracoleBundle\Field\Filter\Order\OrderShopUserFirstnameFilter; | ||||
use Lc\CaracoleBundle\Field\Filter\Order\OrderShopUserLastnameFilter; | use Lc\CaracoleBundle\Field\Filter\Order\OrderShopUserLastnameFilter; | ||||
'total' => NumberField::new('total') | 'total' => NumberField::new('total') | ||||
->setTemplatePath('@LcCaracole/admin/order/field/total.html.twig'), | ->setTemplatePath('@LcCaracole/admin/order/field/total.html.twig'), | ||||
'orderStatus' => AssociationField::new('orderStatus')->setSortable(true) | 'orderStatus' => AssociationField::new('orderStatus')->setSortable(true) | ||||
->setTemplatePath('@LcCaracole/admin/order/field/order_status.html.twig'), | |||||
->setTemplatePath('@LcCaracole/admin/order/field/order_status.html.twig') | |||||
->setCustomOption('filter_fqcn', OrderShopOrderStatusFilter::class), | |||||
'createdAt' => DateTimeField::new('createdAt')->setSortable(true), | 'createdAt' => DateTimeField::new('createdAt')->setSortable(true), | ||||
'updatedAt' => DateTimeField::new('updatedAt')->setSortable(true), | 'updatedAt' => DateTimeField::new('updatedAt')->setSortable(true), | ||||
'orderShopCreatedAt' => DateTimeField::new('orderShopCreatedAt')->setSortable(true), | 'orderShopCreatedAt' => DateTimeField::new('orderShopCreatedAt')->setSortable(true), | ||||
'distribution' => AssociationField::new('distribution') | 'distribution' => AssociationField::new('distribution') | ||||
->setSortable(true) | ->setSortable(true) | ||||
->setCustomOption('filter_type', TextType::class) | ->setCustomOption('filter_type', TextType::class) | ||||
->setCustomOption('filter_on', 'cycleNumber') | |||||
, | |||||
->setCustomOption('filter_on', 'cycleNumber'), | |||||
'cycleDeliveryId' => IntegerField::new('cycleDeliveryId')->setSortable(true), | 'cycleDeliveryId' => IntegerField::new('cycleDeliveryId')->setSortable(true), | ||||
'cycleId' => IntegerField::new('cycleId')->setSortable(true), | 'cycleId' => IntegerField::new('cycleId')->setSortable(true), | ||||
'deliveryType' => Field::new('deliveryType')->setSortable(true), | |||||
'deliveryType' => Field::new('deliveryType')->setSortable(true) | |||||
->setCustomOption('filter_fqcn', OrderShopOrderDeliveryTypeFilter::class), | |||||
//->setTemplatePath('@LcShop/backend/default/field/options_translatable.html.twig'), | //->setTemplatePath('@LcShop/backend/default/field/options_translatable.html.twig'), | ||||
'reference' => TextField::new('reference')->setSortable(true), | 'reference' => TextField::new('reference')->setSortable(true), | ||||
'complementaryOrderShops' => AssociationField::new('complementaryOrderShops') | 'complementaryOrderShops' => AssociationField::new('complementaryOrderShops') | ||||
->setFormTypeOption('mapped', false) | ->setFormTypeOption('mapped', false) | ||||
->setTemplatePath('@LcCaracole/admin/order/field/complementary.html.twig') | |||||
->setCustomOption('filter', false) | ->setCustomOption('filter', false) | ||||
, | |||||
->setTemplatePath('@LcCaracole/admin/order/field/complementary.html.twig'), | |||||
'orderPayments' => AssociationField::new('orderPayments') | 'orderPayments' => AssociationField::new('orderPayments') | ||||
->setTemplatePath('@LcCaracole/admin/order/field/order_payment.html.twig') | ->setTemplatePath('@LcCaracole/admin/order/field/order_payment.html.twig') | ||||
->setCustomOption('filter', false), | |||||
'user'=> AssociationField::new('user')->setSortable(true) | |||||
->setCustomOption('filter_fqcn', OrderShopOrderPaymentFilter::class), | |||||
'user' => AssociationField::new('user')->setSortable(true) | |||||
]; | ]; | ||||
} | } | ||||
<?php | |||||
namespace Lc\CaracoleBundle\Field\Filter\Order; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto; | |||||
use Lc\CaracoleBundle\Solver\Order\OrderPaymentSolver; | |||||
use Lc\SovBundle\Field\Filter\FilterTrait; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | |||||
use Symfony\Component\Form\FormBuilderInterface; | |||||
use Symfony\Contracts\Translation\TranslatorTrait; | |||||
/** | |||||
* @author La clic ! <contact@laclic.fr> | |||||
*/ | |||||
class OrderShopComplementaryFilter | |||||
{ | |||||
use FilterTrait; | |||||
public function buildProperty(FormBuilderInterface $builder, FieldDto $fieldDto, $options = array()) | |||||
{ | |||||
$builder->add( | |||||
$fieldDto->getProperty(), | |||||
ChoiceType::class, | |||||
[ | |||||
'placeholder' => '--', | |||||
'choices' => | |||||
[ | |||||
'Non' => 0, | |||||
'Oui' => 1 | |||||
] | |||||
, | |||||
'required' => false, | |||||
'attr' => array( | |||||
'class' => 'select2 input-sm', | |||||
'form' => 'filters-form', | |||||
), | |||||
] | |||||
); | |||||
} | |||||
public function applyFilter(RepositoryQueryInterface $repositoryQuery, FieldDto $fieldDto, $filteredValue = null) | |||||
{ | |||||
if ($filteredValue === 0) { | |||||
$repositoryQuery->filterIsNotComplementaryOrderShop(); | |||||
} elseif ($filteredValue === 1) { | |||||
$repositoryQuery->filterIsComplementaryOrderShop(); | |||||
} | |||||
} | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Field\Filter\Order; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto; | |||||
use Lc\CaracoleBundle\Solver\Order\OrderDeliveryTypeSolver; | |||||
use Lc\CaracoleBundle\Solver\Order\OrderPaymentSolver; | |||||
use Lc\SovBundle\Field\Filter\FilterTrait; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | |||||
use Symfony\Component\Form\FormBuilderInterface; | |||||
use Symfony\Contracts\Translation\TranslatorTrait; | |||||
/** | |||||
* @author La clic ! <contact@laclic.fr> | |||||
*/ | |||||
class OrderShopOrderDeliveryTypeFilter | |||||
{ | |||||
use FilterTrait; | |||||
protected $translatorAdmin; | |||||
public function __construct(TranslatorAdmin $translatorAdmin) | |||||
{ | |||||
$this->translatorAdmin = $translatorAdmin; | |||||
} | |||||
public function buildProperty(FormBuilderInterface $builder, FieldDto $fieldDto, $options = array()) | |||||
{ | |||||
$builder->add( | |||||
$fieldDto->getProperty(), | |||||
ChoiceType::class, | |||||
[ | |||||
'placeholder' => '--', | |||||
'choices' => | |||||
$this->translatorAdmin->transChoices( | |||||
OrderDeliveryTypeSolver::getDeliveryTypeChoices(), | |||||
'OrderShop', | |||||
'deliveryType' | |||||
), | |||||
'required' => false, | |||||
'attr' => array( | |||||
'class' => 'select2 input-sm', | |||||
'form' => 'filters-form', | |||||
), | |||||
] | |||||
); | |||||
} | |||||
public function applyFilter(RepositoryQueryInterface $repositoryQuery, FieldDto $fieldDto, $filteredValue = null) | |||||
{ | |||||
if ($filteredValue !== null) { | |||||
$repositoryQuery->filterByDeliveryType($filteredValue); | |||||
} | |||||
} | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Field\Filter\Order; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto; | |||||
use Lc\CaracoleBundle\Solver\Order\OrderPaymentSolver; | |||||
use Lc\SovBundle\Field\Filter\FilterTrait; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | |||||
use Symfony\Component\Form\FormBuilderInterface; | |||||
use Symfony\Contracts\Translation\TranslatorTrait; | |||||
/** | |||||
* @author La clic ! <contact@laclic.fr> | |||||
*/ | |||||
class OrderShopOrderPaymentFilter | |||||
{ | |||||
use FilterTrait; | |||||
protected $translatorAdmin; | |||||
public function __construct(TranslatorAdmin $translatorAdmin) | |||||
{ | |||||
$this->translatorAdmin = $translatorAdmin; | |||||
} | |||||
public function buildProperty(FormBuilderInterface $builder, FieldDto $fieldDto, $options = array()) | |||||
{ | |||||
$builder->add( | |||||
$fieldDto->getProperty(), | |||||
ChoiceType::class, | |||||
[ | |||||
'placeholder' => '--', | |||||
'choices' => | |||||
$this->translatorAdmin->transChoices( | |||||
OrderPaymentSolver::getMeanPaymentChoices(), | |||||
'OrderPayment', | |||||
'meanPayment' | |||||
), | |||||
'required' => false, | |||||
'attr' => array( | |||||
'class' => 'select2 input-sm', | |||||
'form' => 'filters-form', | |||||
), | |||||
] | |||||
); | |||||
} | |||||
public function applyFilter(RepositoryQueryInterface $repositoryQuery, FieldDto $fieldDto, $filteredValue = null) | |||||
{ | |||||
if ($filteredValue !== null) { | |||||
$repositoryQuery->filterByMeanPayment($filteredValue); | |||||
} | |||||
} | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Field\Filter\Order; | |||||
use EasyCorp\Bundle\EasyAdminBundle\Dto\FieldDto; | |||||
use Lc\CaracoleBundle\Solver\Order\OrderPaymentSolver; | |||||
use Lc\CaracoleBundle\Solver\Order\OrderStatusSolver; | |||||
use Lc\SovBundle\Field\Filter\FilterTrait; | |||||
use Lc\SovBundle\Repository\RepositoryQueryInterface; | |||||
use Lc\SovBundle\Translation\TranslatorAdmin; | |||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; | |||||
use Symfony\Component\Form\FormBuilderInterface; | |||||
use Symfony\Contracts\Translation\TranslatorTrait; | |||||
/** | |||||
* @author La clic ! <contact@laclic.fr> | |||||
*/ | |||||
class OrderShopOrderStatusFilter | |||||
{ | |||||
use FilterTrait; | |||||
protected $translatorAdmin; | |||||
public function __construct(TranslatorAdmin $translatorAdmin) | |||||
{ | |||||
$this->translatorAdmin = $translatorAdmin; | |||||
} | |||||
public function buildProperty(FormBuilderInterface $builder, FieldDto $fieldDto, $options = array()) | |||||
{ | |||||
$builder->add( | |||||
$fieldDto->getProperty(), | |||||
ChoiceType::class, | |||||
[ | |||||
'placeholder' => '--', | |||||
'choices' => | |||||
$this->translatorAdmin->transChoices( | |||||
OrderStatusSolver::getOrderStatusChoices(), | |||||
'OrderStatus', | |||||
'status' | |||||
), | |||||
'required' => false, | |||||
'attr' => array( | |||||
'class' => 'select2 input-sm', | |||||
'form' => 'filters-form', | |||||
), | |||||
] | |||||
); | |||||
} | |||||
public function applyFilter(RepositoryQueryInterface $repositoryQuery, FieldDto $fieldDto, $filteredValue = null) | |||||
{ | |||||
if ($filteredValue !== null) { | |||||
$repositoryQuery->filterByStatus([$filteredValue]); | |||||
} | |||||
} | |||||
} |
public function applyFilter(RepositoryQueryInterface $repositoryQuery, FieldDto $fieldDto, $filteredValue = null) | public function applyFilter(RepositoryQueryInterface $repositoryQuery, FieldDto $fieldDto, $filteredValue = null) | ||||
{ | { | ||||
if ($filteredValue !== null) { | if ($filteredValue !== null) { | ||||
$repositoryQuery->filterByUserEmail('%'.$filteredValue.'%'); | |||||
$repositoryQuery->filterByDeliveryType('%'.$filteredValue.'%'); | |||||
} | } | ||||
} | } | ||||
'class' => 'select2 input-sm', | 'class' => 'select2 input-sm', | ||||
'form' => 'filters-form', | 'form' => 'filters-form', | ||||
), | ), | ||||
) | ) | ||||
); | ); | ||||
} | } |
use Knp\Component\Pager\PaginatorInterface; | use Knp\Component\Pager\PaginatorInterface; | ||||
use Lc\CaracoleBundle\Model\Address\AddressInterface; | use Lc\CaracoleBundle\Model\Address\AddressInterface; | ||||
use Lc\CaracoleBundle\Model\Distribution\DistributionInterface; | use Lc\CaracoleBundle\Model\Distribution\DistributionInterface; | ||||
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface; | |||||
use Lc\CaracoleBundle\Model\Product\ProductInterface; | use Lc\CaracoleBundle\Model\Product\ProductInterface; | ||||
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; | use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; | ||||
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; | use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; | ||||
protected bool $isJoinUser = false; | protected bool $isJoinUser = false; | ||||
protected bool $isJoinComplementaryOrderShops = false; | protected bool $isJoinComplementaryOrderShops = false; | ||||
protected bool $isJoinDeliveryPointSale = false; | protected bool $isJoinDeliveryPointSale = false; | ||||
protected bool $isJoinOrderPayment = false; | |||||
protected bool $isFilteredByStatus = false; | |||||
public function __construct(OrderShopRepository $repository, PaginatorInterface $paginator) | public function __construct(OrderShopRepository $repository, PaginatorInterface $paginator) | ||||
{ | { | ||||
public function selectSumStatTotalWithTax(): self | public function selectSumStatTotalWithTax(): self | ||||
{ | { | ||||
return $this | return $this | ||||
->select( | |||||
'SUM(DISTINCT(orderShop.statTotalWithTax)) as total' | |||||
); | |||||
->select( | |||||
'SUM(DISTINCT(orderShop.statTotalWithTax)) as total' | |||||
); | |||||
} | } | ||||
public function selectSumQuantityOrder(): self | public function selectSumQuantityOrder(): self | ||||
{ | { | ||||
$this->joinOrderProducts(); | $this->joinOrderProducts(); | ||||
return $this | return $this | ||||
->select( | |||||
'SUM(orderProducts.quantityOrder) as quantity' | |||||
); | |||||
->select( | |||||
'SUM(orderProducts.quantityOrder) as quantity' | |||||
); | |||||
} | } | ||||
$this->joinProduct(); | $this->joinProduct(); | ||||
$this->joinDistribution(); | $this->joinDistribution(); | ||||
return $this | return $this | ||||
->select( | |||||
'SUM(orderProducts.quantityOrder) as quantity, distribution.cycleNumber as cycleNumber, distribution.year as year , product.id as productId' | |||||
); | |||||
->select( | |||||
'SUM(orderProducts.quantityOrder) as quantity, distribution.cycleNumber as cycleNumber, distribution.year as year , product.id as productId' | |||||
); | |||||
} | } | ||||
public function selectCountUser(): self | public function selectCountUser(): self | ||||
{ | { | ||||
return $this | return $this | ||||
->select('count(DISTINCT(orderShop.user)) as total'); | |||||
->select('count(DISTINCT(orderShop.user)) as total'); | |||||
} | } | ||||
public function selectParam($select): self | public function selectParam($select): self | ||||
{ | { | ||||
return $this | return $this | ||||
->addSelect($select); | |||||
->addSelect($select); | |||||
} | } | ||||
public function selectCount(): self | public function selectCount(): self | ||||
{ | { | ||||
return $this | return $this | ||||
->select('count(DISTINCT(orderShop.id)) as total'); | |||||
->select('count(DISTINCT(orderShop.id)) as total'); | |||||
} | } | ||||
public function joinUser(): self | public function joinUser(): self | ||||
public function filterByUser(UserInterface $user): self | public function filterByUser(UserInterface $user): self | ||||
{ | { | ||||
return $this | return $this | ||||
->andWhere('.user = :user') | |||||
->setParameter('user', $user); | |||||
->andWhere('.user = :user') | |||||
->setParameter('user', $user); | |||||
} | } | ||||
public function filterByUserEmail(string $email): self | public function filterByUserEmail(string $email): self | ||||
$this->joinOrderStatus(); | $this->joinOrderStatus(); | ||||
return $this | return $this | ||||
->andWhere('orderStatus.alias IN (:alias)') | |||||
->setParameter('alias', $status); | |||||
->andWhere('orderStatus.alias IN (:alias)') | |||||
->setParameter('alias', $status); | |||||
} | } | ||||
public function filterByDistributions(array $distributions): self | public function filterByDistributions(array $distributions): self | ||||
{ | { | ||||
return $this | return $this | ||||
->andWhere('.distribution IN(:distributions)') | |||||
->setParameter('distributions', $distributions); | |||||
->andWhere('.distribution IN(:distributions)') | |||||
->setParameter('distributions', $distributions); | |||||
} | } | ||||
public function filterByProducts(array $products): self | public function filterByProducts(array $products): self | ||||
$this->joinOrderProducts(); | $this->joinOrderProducts(); | ||||
return $this | return $this | ||||
->andWhere('product.id IN(:products)') | |||||
->setParameter('products', $products); | |||||
->andWhere('product.id IN(:products)') | |||||
->setParameter('products', $products); | |||||
} | } | ||||
public function filterByProduct(ProductInterface $product): self | public function filterByProduct(ProductInterface $product): self | ||||
$this->joinProduct(); | $this->joinProduct(); | ||||
return $this | return $this | ||||
->andWhere('orderProducts.product = :product') | |||||
->setParameter('product', $product); | |||||
->andWhere('orderProducts.product = :product') | |||||
->setParameter('product', $product); | |||||
} | } | ||||
public function filterIsMerchantOnline(): self | public function filterIsMerchantOnline(): self | ||||
{ | { | ||||
$this->joinMerchant(); | $this->joinMerchant(); | ||||
return $this | return $this | ||||
->andWhere('merchant.status = :status') | |||||
->setParameter(':status', 1); | |||||
->andWhere('merchant.status = :status') | |||||
->setParameter(':status', 1); | |||||
} | } | ||||
public function filterByDateStart(string $dateField, DateTime $dateStart): self | public function filterByDateStart(string $dateField, DateTime $dateStart): self | ||||
{ | { | ||||
return $this | return $this | ||||
->andWhere('.' . $dateField . ' >= :dateStart') | |||||
->setParameter('dateStart', $dateStart); | |||||
->andWhere('.' . $dateField . ' >= :dateStart') | |||||
->setParameter('dateStart', $dateStart); | |||||
} | } | ||||
public function filterByDateEnd(string $dateField, DateTime $dateEnd): self | public function filterByDateEnd(string $dateField, DateTime $dateEnd): self | ||||
{ | { | ||||
return $this | return $this | ||||
->andWhere('.' . $dateField . ' <= :dateEnd') | |||||
->setParameter('dateEnd', $dateEnd); | |||||
->andWhere('.' . $dateField . ' <= :dateEnd') | |||||
->setParameter('dateEnd', $dateEnd); | |||||
} | } | ||||
public function filterByVisitor(VisitorInterface $visitor): self | public function filterByVisitor(VisitorInterface $visitor): self | ||||
public function filterByAddress(AddressInterface $address): self | public function filterByAddress(AddressInterface $address): self | ||||
{ | { | ||||
return $this | return $this | ||||
->andWhere('.deliveryAddress = :address OR .invoiceAddress = :address') | |||||
->setParameter('address', $address); | |||||
->andWhere('.deliveryAddress = :address OR .invoiceAddress = :address') | |||||
->setParameter('address', $address); | |||||
} | } | ||||
public function filterByStatus(array $statusArray): self | public function filterByStatus(array $statusArray): self | ||||
{ | { | ||||
$this->joinOrderStatus(); | $this->joinOrderStatus(); | ||||
return $this | |||||
// TODO: Voir pour faire mieux | |||||
// On fait qu'une seule fois le filtre | |||||
if (!$this->isFilteredByStatus) { | |||||
$this->isFilteredByStatus = true; | |||||
return $this | |||||
->andWhere('orderStatus.alias IN (:alias)') | ->andWhere('orderStatus.alias IN (:alias)') | ||||
->setParameter('alias', $statusArray); | ->setParameter('alias', $statusArray); | ||||
} | |||||
return $this; | |||||
} | } | ||||
public function filterByReductionCredit(ReductionCreditInterface $reductionCredit): self | public function filterByReductionCredit(ReductionCreditInterface $reductionCredit): self | ||||
$this->joinOrderReductionCredits(); | $this->joinOrderReductionCredits(); | ||||
return $this | return $this | ||||
->andWhere('orderReductionCredits.reductionCredit = :reductionCredit') | |||||
->setParameter('reductionCredit', $reductionCredit); | |||||
->andWhere('orderReductionCredits.reductionCredit = :reductionCredit') | |||||
->setParameter('reductionCredit', $reductionCredit); | |||||
} | } | ||||
public function filterByReductionCart(ReductionCartInterface $reductionCart): self | public function filterByReductionCart(ReductionCartInterface $reductionCart): self | ||||
$this->joinOrderReductionCarts(); | $this->joinOrderReductionCarts(); | ||||
return $this | return $this | ||||
->andWhere('orderReductionCarts.reductionCart = :reductionCart') | |||||
->setParameter('reductionCart', $reductionCart); | |||||
->andWhere('orderReductionCarts.reductionCart = :reductionCart') | |||||
->setParameter('reductionCart', $reductionCart); | |||||
} | } | ||||
public function filterByDistribution(DistributionInterface $distribution): self | public function filterByDistribution(DistributionInterface $distribution): self | ||||
{ | { | ||||
return $this | return $this | ||||
->andWhere('.distribution = :distribution') | |||||
->setParameter('distribution', $distribution); | |||||
->andWhere('.distribution = :distribution') | |||||
->setParameter('distribution', $distribution); | |||||
} | |||||
public function filterByMeanPayment(string $meanPayment): self | |||||
{ | |||||
$this->joinOrderPayment(); | |||||
return $this | |||||
->andWhere('orderPayments.meanPayment = :meanPayment') | |||||
->setParameter('meanPayment', $meanPayment); | |||||
} | |||||
public function filterByDeliveryType(string $deliveryType): self | |||||
{ | |||||
return $this | |||||
->andWhere('.deliveryType = :deliveryType') | |||||
->setParameter('deliveryType', $deliveryType); | |||||
} | } | ||||
public function filterIsNotComplementaryOrderShop(): self | public function filterIsNotComplementaryOrderShop(): self | ||||
{ | { | ||||
return $this | return $this | ||||
->andWhere('.mainOrderShop = false OR .mainOrderShop IS NULL'); | |||||
->andWhere('.mainOrderShop = false OR .mainOrderShop IS NULL'); | |||||
} | |||||
public function filterIsComplementaryOrderShop(): self | |||||
{ | |||||
return $this | |||||
->andWhere('.mainOrderShop = true OR .mainOrderShop IS NOT NULL'); | |||||
} | } | ||||
public function filterIsNullMainOrderShop(): self | public function filterIsNullMainOrderShop(): self | ||||
{ | { | ||||
return $this | return $this | ||||
->andWhere('.mainOrderShop IS NULL'); | |||||
->andWhere('.mainOrderShop IS NULL'); | |||||
} | } | ||||
public function filterMinimumTomorrowDelivery(): self | public function filterMinimumTomorrowDelivery(): self | ||||
$this->isJoinOrderReductionCredits = true; | $this->isJoinOrderReductionCredits = true; | ||||
return $this | return $this | ||||
->innerJoin('.orderReductionCredits', 'orderReductionCredits'); | |||||
->innerJoin('.orderReductionCredits', 'orderReductionCredits'); | |||||
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
$this->isJoinOrderStatus = true; | $this->isJoinOrderStatus = true; | ||||
return $this | return $this | ||||
->leftJoin('.orderStatus', 'orderStatus'); | |||||
->leftJoin('.orderStatus', 'orderStatus'); | |||||
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
$this->isJoinOrderReductionCarts = true; | $this->isJoinOrderReductionCarts = true; | ||||
return $this | return $this | ||||
->leftJoin('.orderReductionCarts', 'orderReductionCarts'); | |||||
->leftJoin('.orderReductionCarts', 'orderReductionCarts'); | |||||
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
$this->isJoinMerchant = true; | $this->isJoinMerchant = true; | ||||
return $this | return $this | ||||
->leftJoin('s.merchant', 'merchant'); | |||||
->leftJoin('s.merchant', 'merchant'); | |||||
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
$this->isJoinComplementaryOrderShops = true; | $this->isJoinComplementaryOrderShops = true; | ||||
return $this | return $this | ||||
->leftJoin('.complementaryOrderShops', 'complementaryOrderShops'); | |||||
->leftJoin('.complementaryOrderShops', 'complementaryOrderShops'); | |||||
} | } | ||||
return $this; | return $this; | ||||
} | } | ||||
$this->isJoinDeliveryPointSale = true; | $this->isJoinDeliveryPointSale = true; | ||||
return $this | return $this | ||||
->leftJoin('.deliveryPointSale', 'deliveryPointSale'); | |||||
->leftJoin('.deliveryPointSale', 'deliveryPointSale'); | |||||
} | |||||
return $this; | |||||
} | |||||
public function joinOrderPayment(): self | |||||
{ | |||||
if (!$this->isJoinOrderPayment) { | |||||
$this->isJoinOrderPayment = true; | |||||
return $this | |||||
->leftJoin('.orderPayments', 'orderPayments'); | |||||
} | } | ||||
return $this; | return $this; | ||||
} | } |
menu: | menu: | ||||
pointsale: Points de vente | pointsale: Points de vente | ||||
product_category: Catégories | product_category: Catégories | ||||
conf: Configuration | conf: Configuration | ||||
fields: | fields: | ||||
property: Caractéristiques | property: Caractéristiques | ||||
propertyValue : Valeurs | |||||
propertyValue: Valeurs | |||||
parent: Parent | parent: Parent | ||||
saleStatus: En vente | saleStatus: En vente | ||||
subtitle: Sous-titre | subtitle: Sous-titre | ||||
label: Utilisateur avec compte prépayé actif | label: Utilisateur avec compte prépayé actif | ||||
label_plurial: Utilisateurs avec comptes prépayés actifs | label_plurial: Utilisateurs avec comptes prépayés actifs | ||||
fields: | fields: | ||||
user: | |||||
email: Email | |||||
lastname: Nom | |||||
firstname: Prénom | |||||
creditActive: Crédit activer | |||||
credit: Montant du compte prépayé | |||||
user: | |||||
email: Email | |||||
lastname: Nom | |||||
firstname: Prénom | |||||
creditActive: Crédit activer | |||||
credit: Montant du compte prépayé | |||||
User: | User: | ||||
fields: | fields: | ||||
isSaleAlwaysOpen: Vente toujours ouverte | isSaleAlwaysOpen: Vente toujours ouverte | ||||
Merci de nous laisser le maximum d'informations pour faciliter notre arrivée : digicode, | Merci de nous laisser le maximum d'informations pour faciliter notre arrivée : digicode, | ||||
étage, rue non répertoriée dans les GPS, accès vers la porte d'entrée ... | étage, rue non répertoriée dans les GPS, accès vers la porte d'entrée ... | ||||
useDeliveryAddressAsBillingAddress: Utiliser l'adresse de livraison | useDeliveryAddressAsBillingAddress: Utiliser l'adresse de livraison | ||||
deliveryTypeChoices: | |||||
home: À domicile | |||||
point-sale: En ambassade | |||||
OrderStatus: | |||||
fields: | |||||
statusChoices: | |||||
cart: Panier [cart] | |||||
cart-canceled: Panier annulé [cart-canceled] | |||||
waiting-payment-online: En attente de paiement en ligne [waiting-payment-online] | |||||
waiting-bank-return: En attente retour banque [waiting-bank-return] | |||||
partial-payment: Paiement partiel [partial-payment] | |||||
paid: Payé [paid] | |||||
error-payment-online: Erreur de paiement en ligne [error-payment-online] | |||||
waiting-delivery: À livrer [waiting-delivery] | |||||
waiting-delivery-with-payment: À livrer, avec paiement [waiting-delivery-with-payment] | |||||
delivered-without-payment: À livrer, sans paiement [delivered-without-payment] | |||||
done: Terminé [done] | |||||
canceled: Annulé [canceled] | |||||
canceled-waiting-refund: Annulé, en attente de remboursement [canceled-waiting-refund] | |||||
refund: Remboursé [refund] | |||||
GroupUser: | GroupUser: | ||||
label: Groupe d'utilisateur | label: Groupe d'utilisateur | ||||
label_plurial: Groupes d'utilisateurs | label_plurial: Groupes d'utilisateurs |
{% set value = field.value %} | |||||
{% if value|length > 0 %} | |||||
{% set value = entity.instance.complementaryOrderShops|length %} | |||||
{% if value > 0 %} | |||||
<span class="badge badge-success"> | <span class="badge badge-success"> | ||||
{{ value|length }} compléments | {{ value|length }} compléments | ||||
</span> | </span> |
<?php | |||||
namespace Lc\CaracoleBundle\Solver\Order; | |||||
use Lc\CaracoleBundle\Model\Order\OrderShopModel; | |||||
class OrderDeliveryTypeSolver | |||||
{ | |||||
public static function getDeliveryTypeChoices() | |||||
{ | |||||
return [ | |||||
OrderShopModel::DELIVERY_TYPE_HOME, | |||||
OrderShopModel::DELIVERY_TYPE_POINTSALE, | |||||
]; | |||||
} | |||||
} |
<?php | |||||
namespace Lc\CaracoleBundle\Solver\Order; | |||||
use Lc\CaracoleBundle\Model\Order\OrderStatusModel; | |||||
class OrderStatusSolver | |||||
{ | |||||
public static function getOrderStatusChoices() | |||||
{ | |||||
return [ | |||||
OrderStatusModel::ALIAS_CART, | |||||
OrderStatusModel::ALIAS_CART_CANCELED, | |||||
OrderStatusModel::ALIAS_WAITING_PAYMENT_ONLINE, | |||||
OrderStatusModel::ALIAS_WAITING_BANK_RETURN, | |||||
OrderStatusModel::ALIAS_PARTIAL_PAYMENT, | |||||
OrderStatusModel::ALIAS_PAID, | |||||
OrderStatusModel::ALIAS_ERROR_PAYMENT_ONLINE, | |||||
OrderStatusModel::ALIAS_WAITING_DELIVERY, | |||||
OrderStatusModel::ALIAS_WAITING_DELIVERY_WITH_PAYMENT, | |||||
OrderStatusModel::ALIAS_DELIVERED_WITHOUT_PAYMENT, | |||||
OrderStatusModel::ALIAS_DONE, | |||||
OrderStatusModel::ALIAS_CANCELED, | |||||
OrderStatusModel::ALIAS_CANCELED_WAITING_REFUND, | |||||
OrderStatusModel::ALIAS_REFUND, | |||||
]; | |||||
} | |||||
} |