@@ -29,7 +29,8 @@ abstract class UnitAdminController extends AbstractAdminController | |||
TextField::new('wordingUnit'), | |||
TextField::new('wordingShort'), | |||
IntegerField::new('coefficient'), | |||
AssociationField::new('unitReference'), | |||
AssociationField::new('unitReference') | |||
->setCustomOption('filter', false), | |||
]; | |||
} | |||
@@ -11,6 +11,10 @@ use EasyCorp\Bundle\EasyAdminBundle\Field\TextField; | |||
use Lc\CaracoleBundle\Context\MerchantContextTrait; | |||
use Lc\CaracoleBundle\Definition\Field\AbstractFieldDefinition; | |||
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\OrderShopUserFirstnameFilter; | |||
use Lc\CaracoleBundle\Field\Filter\Order\OrderShopUserLastnameFilter; | |||
@@ -56,30 +60,29 @@ class OrderShopFieldDefinition extends AbstractFieldDefinition | |||
'total' => NumberField::new('total') | |||
->setTemplatePath('@LcCaracole/admin/order/field/total.html.twig'), | |||
'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), | |||
'updatedAt' => DateTimeField::new('updatedAt')->setSortable(true), | |||
'orderShopCreatedAt' => DateTimeField::new('orderShopCreatedAt')->setSortable(true), | |||
'distribution' => AssociationField::new('distribution') | |||
->setSortable(true) | |||
->setCustomOption('filter_type', TextType::class) | |||
->setCustomOption('filter_on', 'cycleNumber') | |||
, | |||
->setCustomOption('filter_on', 'cycleNumber'), | |||
'cycleDeliveryId' => IntegerField::new('cycleDeliveryId')->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'), | |||
'reference' => TextField::new('reference')->setSortable(true), | |||
'complementaryOrderShops' => AssociationField::new('complementaryOrderShops') | |||
->setFormTypeOption('mapped', false) | |||
->setTemplatePath('@LcCaracole/admin/order/field/complementary.html.twig') | |||
->setCustomOption('filter', false) | |||
, | |||
->setTemplatePath('@LcCaracole/admin/order/field/complementary.html.twig'), | |||
'orderPayments' => AssociationField::new('orderPayments') | |||
->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) | |||
]; | |||
} | |||
@@ -0,0 +1,52 @@ | |||
<?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(); | |||
} | |||
} | |||
} |
@@ -0,0 +1,58 @@ | |||
<?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); | |||
} | |||
} | |||
} |
@@ -0,0 +1,57 @@ | |||
<?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); | |||
} | |||
} | |||
} |
@@ -0,0 +1,58 @@ | |||
<?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]); | |||
} | |||
} | |||
} |
@@ -38,7 +38,7 @@ class OrderShopUserEmailFilter | |||
public function applyFilter(RepositoryQueryInterface $repositoryQuery, FieldDto $fieldDto, $filteredValue = null) | |||
{ | |||
if ($filteredValue !== null) { | |||
$repositoryQuery->filterByUserEmail('%'.$filteredValue.'%'); | |||
$repositoryQuery->filterByDeliveryType('%'.$filteredValue.'%'); | |||
} | |||
} | |||
@@ -33,8 +33,6 @@ class ProductCategoriesFilter extends AssociationFilter | |||
'class' => 'select2 input-sm', | |||
'form' => 'filters-form', | |||
), | |||
) | |||
); | |||
} |
@@ -5,6 +5,7 @@ namespace Lc\CaracoleBundle\Repository\Order; | |||
use Knp\Component\Pager\PaginatorInterface; | |||
use Lc\CaracoleBundle\Model\Address\AddressInterface; | |||
use Lc\CaracoleBundle\Model\Distribution\DistributionInterface; | |||
use Lc\CaracoleBundle\Model\Order\OrderPaymentInterface; | |||
use Lc\CaracoleBundle\Model\Product\ProductInterface; | |||
use Lc\CaracoleBundle\Model\Reduction\ReductionCartInterface; | |||
use Lc\CaracoleBundle\Model\Reduction\ReductionCreditInterface; | |||
@@ -29,6 +30,8 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
protected bool $isJoinUser = false; | |||
protected bool $isJoinComplementaryOrderShops = false; | |||
protected bool $isJoinDeliveryPointSale = false; | |||
protected bool $isJoinOrderPayment = false; | |||
protected bool $isFilteredByStatus = false; | |||
public function __construct(OrderShopRepository $repository, PaginatorInterface $paginator) | |||
{ | |||
@@ -39,18 +42,18 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
public function selectSumStatTotalWithTax(): self | |||
{ | |||
return $this | |||
->select( | |||
'SUM(DISTINCT(orderShop.statTotalWithTax)) as total' | |||
); | |||
->select( | |||
'SUM(DISTINCT(orderShop.statTotalWithTax)) as total' | |||
); | |||
} | |||
public function selectSumQuantityOrder(): self | |||
{ | |||
$this->joinOrderProducts(); | |||
return $this | |||
->select( | |||
'SUM(orderProducts.quantityOrder) as quantity' | |||
); | |||
->select( | |||
'SUM(orderProducts.quantityOrder) as quantity' | |||
); | |||
} | |||
@@ -59,16 +62,16 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
$this->joinProduct(); | |||
$this->joinDistribution(); | |||
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 | |||
{ | |||
return $this | |||
->select('count(DISTINCT(orderShop.user)) as total'); | |||
->select('count(DISTINCT(orderShop.user)) as total'); | |||
} | |||
@@ -76,13 +79,13 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
public function selectParam($select): self | |||
{ | |||
return $this | |||
->addSelect($select); | |||
->addSelect($select); | |||
} | |||
public function selectCount(): self | |||
{ | |||
return $this | |||
->select('count(DISTINCT(orderShop.id)) as total'); | |||
->select('count(DISTINCT(orderShop.id)) as total'); | |||
} | |||
public function joinUser(): self | |||
@@ -99,8 +102,8 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
public function filterByUser(UserInterface $user): self | |||
{ | |||
return $this | |||
->andWhere('.user = :user') | |||
->setParameter('user', $user); | |||
->andWhere('.user = :user') | |||
->setParameter('user', $user); | |||
} | |||
public function filterByUserEmail(string $email): self | |||
@@ -133,15 +136,15 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
$this->joinOrderStatus(); | |||
return $this | |||
->andWhere('orderStatus.alias IN (:alias)') | |||
->setParameter('alias', $status); | |||
->andWhere('orderStatus.alias IN (:alias)') | |||
->setParameter('alias', $status); | |||
} | |||
public function filterByDistributions(array $distributions): self | |||
{ | |||
return $this | |||
->andWhere('.distribution IN(:distributions)') | |||
->setParameter('distributions', $distributions); | |||
->andWhere('.distribution IN(:distributions)') | |||
->setParameter('distributions', $distributions); | |||
} | |||
public function filterByProducts(array $products): self | |||
@@ -149,8 +152,8 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
$this->joinOrderProducts(); | |||
return $this | |||
->andWhere('product.id IN(:products)') | |||
->setParameter('products', $products); | |||
->andWhere('product.id IN(:products)') | |||
->setParameter('products', $products); | |||
} | |||
public function filterByProduct(ProductInterface $product): self | |||
@@ -158,30 +161,30 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
$this->joinProduct(); | |||
return $this | |||
->andWhere('orderProducts.product = :product') | |||
->setParameter('product', $product); | |||
->andWhere('orderProducts.product = :product') | |||
->setParameter('product', $product); | |||
} | |||
public function filterIsMerchantOnline(): self | |||
{ | |||
$this->joinMerchant(); | |||
return $this | |||
->andWhere('merchant.status = :status') | |||
->setParameter(':status', 1); | |||
->andWhere('merchant.status = :status') | |||
->setParameter(':status', 1); | |||
} | |||
public function filterByDateStart(string $dateField, DateTime $dateStart): self | |||
{ | |||
return $this | |||
->andWhere('.' . $dateField . ' >= :dateStart') | |||
->setParameter('dateStart', $dateStart); | |||
->andWhere('.' . $dateField . ' >= :dateStart') | |||
->setParameter('dateStart', $dateStart); | |||
} | |||
public function filterByDateEnd(string $dateField, DateTime $dateEnd): self | |||
{ | |||
return $this | |||
->andWhere('.' . $dateField . ' <= :dateEnd') | |||
->setParameter('dateEnd', $dateEnd); | |||
->andWhere('.' . $dateField . ' <= :dateEnd') | |||
->setParameter('dateEnd', $dateEnd); | |||
} | |||
public function filterByVisitor(VisitorInterface $visitor): self | |||
@@ -192,17 +195,23 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
public function filterByAddress(AddressInterface $address): self | |||
{ | |||
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 | |||
{ | |||
$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)') | |||
->setParameter('alias', $statusArray); | |||
} | |||
return $this; | |||
} | |||
public function filterByReductionCredit(ReductionCreditInterface $reductionCredit): self | |||
@@ -210,8 +219,8 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
$this->joinOrderReductionCredits(); | |||
return $this | |||
->andWhere('orderReductionCredits.reductionCredit = :reductionCredit') | |||
->setParameter('reductionCredit', $reductionCredit); | |||
->andWhere('orderReductionCredits.reductionCredit = :reductionCredit') | |||
->setParameter('reductionCredit', $reductionCredit); | |||
} | |||
public function filterByReductionCart(ReductionCartInterface $reductionCart): self | |||
@@ -219,27 +228,49 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
$this->joinOrderReductionCarts(); | |||
return $this | |||
->andWhere('orderReductionCarts.reductionCart = :reductionCart') | |||
->setParameter('reductionCart', $reductionCart); | |||
->andWhere('orderReductionCarts.reductionCart = :reductionCart') | |||
->setParameter('reductionCart', $reductionCart); | |||
} | |||
public function filterByDistribution(DistributionInterface $distribution): self | |||
{ | |||
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 | |||
{ | |||
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 | |||
{ | |||
return $this | |||
->andWhere('.mainOrderShop IS NULL'); | |||
->andWhere('.mainOrderShop IS NULL'); | |||
} | |||
public function filterMinimumTomorrowDelivery(): self | |||
@@ -318,7 +349,7 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
$this->isJoinOrderReductionCredits = true; | |||
return $this | |||
->innerJoin('.orderReductionCredits', 'orderReductionCredits'); | |||
->innerJoin('.orderReductionCredits', 'orderReductionCredits'); | |||
} | |||
return $this; | |||
} | |||
@@ -329,7 +360,7 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
$this->isJoinOrderStatus = true; | |||
return $this | |||
->leftJoin('.orderStatus', 'orderStatus'); | |||
->leftJoin('.orderStatus', 'orderStatus'); | |||
} | |||
return $this; | |||
} | |||
@@ -340,7 +371,7 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
$this->isJoinOrderReductionCarts = true; | |||
return $this | |||
->leftJoin('.orderReductionCarts', 'orderReductionCarts'); | |||
->leftJoin('.orderReductionCarts', 'orderReductionCarts'); | |||
} | |||
return $this; | |||
} | |||
@@ -352,7 +383,7 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
$this->isJoinMerchant = true; | |||
return $this | |||
->leftJoin('s.merchant', 'merchant'); | |||
->leftJoin('s.merchant', 'merchant'); | |||
} | |||
return $this; | |||
} | |||
@@ -363,7 +394,7 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
$this->isJoinComplementaryOrderShops = true; | |||
return $this | |||
->leftJoin('.complementaryOrderShops', 'complementaryOrderShops'); | |||
->leftJoin('.complementaryOrderShops', 'complementaryOrderShops'); | |||
} | |||
return $this; | |||
} | |||
@@ -374,7 +405,18 @@ class OrderShopRepositoryQuery extends AbstractRepositoryQuery | |||
$this->isJoinDeliveryPointSale = true; | |||
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; | |||
} |
@@ -1,4 +1,3 @@ | |||
menu: | |||
pointsale: Points de vente | |||
product_category: Catégories | |||
@@ -55,7 +54,7 @@ entity: | |||
conf: Configuration | |||
fields: | |||
property: Caractéristiques | |||
propertyValue : Valeurs | |||
propertyValue: Valeurs | |||
parent: Parent | |||
saleStatus: En vente | |||
subtitle: Sous-titre | |||
@@ -118,12 +117,12 @@ entity: | |||
label: Utilisateur avec compte prépayé actif | |||
label_plurial: Utilisateurs avec comptes prépayés actifs | |||
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: | |||
fields: | |||
isSaleAlwaysOpen: Vente toujours ouverte | |||
@@ -158,7 +157,26 @@ entity: | |||
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 ... | |||
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: | |||
label: Groupe d'utilisateur | |||
label_plurial: Groupes d'utilisateurs |
@@ -1,5 +1,5 @@ | |||
{% set value = field.value %} | |||
{% if value|length > 0 %} | |||
{% set value = entity.instance.complementaryOrderShops|length %} | |||
{% if value > 0 %} | |||
<span class="badge badge-success"> | |||
{{ value|length }} compléments | |||
</span> |
@@ -0,0 +1,17 @@ | |||
<?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, | |||
]; | |||
} | |||
} |
@@ -0,0 +1,29 @@ | |||
<?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, | |||
]; | |||
} | |||
} |