Browse Source

Merge branch 'develop'

master^2
Guillaume 3 years ago
parent
commit
8c60177eb9
92 changed files with 1555 additions and 379 deletions
  1. +8
    -0
      ShopBundle/Context/UserUtilsInterface.php
  2. +4
    -1
      ShopBundle/Controller/Backend/OrderController.php
  3. +40
    -0
      ShopBundle/Controller/Backend/ReductionCartController.php
  4. +5
    -0
      ShopBundle/EventSubscriber/ListEventSubscriber.php
  5. +6
    -0
      ShopBundle/Form/Backend/Merchant/MerchantConfigType.php
  6. +1
    -1
      ShopBundle/Form/Backend/Order/AddOrderReductionCartType.php
  7. +11
    -0
      ShopBundle/Form/Backend/ProductFamily/ProductType.php
  8. +2
    -1
      ShopBundle/Form/Backend/User/TicketTypesNotificationType.php
  9. +61
    -0
      ShopBundle/Form/Frontend/EditGiftVoucherType.php
  10. +21
    -1
      ShopBundle/Form/Frontend/NewsletterType.php
  11. +11
    -0
      ShopBundle/Form/Frontend/RegistrationType.php
  12. +46
    -0
      ShopBundle/Form/Frontend/SendGiftVoucherType.php
  13. +1
    -0
      ShopBundle/Form/Frontend/TicketType.php
  14. +3
    -1
      ShopBundle/Model/Address.php
  15. +20
    -0
      ShopBundle/Model/OrderReductionCredit.php
  16. +13
    -2
      ShopBundle/Model/OrderShop.php
  17. +2
    -0
      ShopBundle/Model/OrderStatus.php
  18. +17
    -0
      ShopBundle/Model/ProductCategory.php
  19. +34
    -0
      ShopBundle/Model/ProductFamily.php
  20. +16
    -1
      ShopBundle/Model/ReductionCart.php
  21. +57
    -0
      ShopBundle/Model/ReductionCredit.php
  22. +1
    -0
      ShopBundle/Model/ReductionTrait.php
  23. +2
    -0
      ShopBundle/Model/Ticket.php
  24. +14
    -3
      ShopBundle/Model/User.php
  25. +14
    -0
      ShopBundle/Repository/CreditHistoryRepository.php
  26. +28
    -13
      ShopBundle/Repository/OrderShopRepository.php
  27. +9
    -2
      ShopBundle/Repository/ProductFamilyRepository.php
  28. +5
    -4
      ShopBundle/Repository/ReductionCartRepository.php
  29. +44
    -0
      ShopBundle/Repository/ReductionCreditRepository.php
  30. +4
    -3
      ShopBundle/Repository/TicketRepository.php
  31. +188
    -116
      ShopBundle/Resources/public/css/backend/custom.css
  32. +20
    -2
      ShopBundle/Resources/public/js/backend/script/default/utils.js
  33. +0
    -1
      ShopBundle/Resources/public/js/backend/script/default/vuejs-mixins.js
  34. +3
    -2
      ShopBundle/Resources/public/js/backend/script/merchant/vuejs-merchant.js
  35. +19
    -12
      ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js
  36. +39
    -2
      ShopBundle/Resources/public/sass/backend/custom.scss
  37. +34
    -4
      ShopBundle/Resources/translations/lcshop.fr.yaml
  38. +9
    -2
      ShopBundle/Resources/views/backend/default/block/action.html.twig
  39. +0
    -1
      ShopBundle/Resources/views/backend/default/block/actions.html.twig
  40. +1
    -0
      ShopBundle/Resources/views/backend/default/block/flash_messages.html.twig
  41. +11
    -0
      ShopBundle/Resources/views/backend/default/block/form_address.html.twig
  42. +22
    -0
      ShopBundle/Resources/views/backend/default/block/list_addressloopinbesancon.html.twig
  43. +27
    -0
      ShopBundle/Resources/views/backend/default/block/list_orderswaitingbankreturn.html.twig
  44. +1
    -1
      ShopBundle/Resources/views/backend/default/edit.html.twig
  45. +25
    -20
      ShopBundle/Resources/views/backend/default/layout/layout.html.twig
  46. +1
    -1
      ShopBundle/Resources/views/backend/default/list-datatable.html.twig
  47. +2
    -2
      ShopBundle/Resources/views/backend/default/list-fields/field_datetime.html.twig
  48. +2
    -0
      ShopBundle/Resources/views/backend/default/list-fields/field_product_family_total_product_ordered.html.twig
  49. +28
    -5
      ShopBundle/Resources/views/backend/default/list.html.twig
  50. +1
    -1
      ShopBundle/Resources/views/backend/default/new.html.twig
  51. +1
    -1
      ShopBundle/Resources/views/backend/default/sortable.html.twig
  52. +17
    -6
      ShopBundle/Resources/views/backend/form/custom_bootstrap_4.html.twig
  53. +1
    -1
      ShopBundle/Resources/views/backend/merchant/edit.html.twig
  54. +0
    -1
      ShopBundle/Resources/views/backend/merchant/form.html.twig
  55. +6
    -0
      ShopBundle/Resources/views/backend/merchant/panel_delivery.html.twig
  56. +7
    -0
      ShopBundle/Resources/views/backend/merchant/panel_email.html.twig
  57. +10
    -0
      ShopBundle/Resources/views/backend/merchant/panel_general.html.twig
  58. +45
    -6
      ShopBundle/Resources/views/backend/merchant/panel_order.html.twig
  59. +37
    -0
      ShopBundle/Resources/views/backend/order/form/modal_orderstatushistories.html.twig
  60. +18
    -0
      ShopBundle/Resources/views/backend/order/list-fields/field_hasreach.html.twig
  61. +24
    -0
      ShopBundle/Resources/views/backend/order/macros.html.twig
  62. +5
    -2
      ShopBundle/Resources/views/backend/order/show-cart.html.twig
  63. +2
    -1
      ShopBundle/Resources/views/backend/order/show-order.html.twig
  64. +3
    -1
      ShopBundle/Resources/views/backend/order/show.html.twig
  65. +1
    -1
      ShopBundle/Resources/views/backend/productfamily/advanced_edition.html.twig
  66. +1
    -1
      ShopBundle/Resources/views/backend/productfamily/edit.html.twig
  67. +2
    -0
      ShopBundle/Resources/views/backend/productfamily/form.html.twig
  68. +12
    -6
      ShopBundle/Resources/views/backend/productfamily/macros.html.twig
  69. +3
    -0
      ShopBundle/Resources/views/backend/productfamily/panel_general.html.twig
  70. +6
    -0
      ShopBundle/Resources/views/backend/productfamily/panel_price.html.twig
  71. +71
    -31
      ShopBundle/Resources/views/backend/productfamily/panel_products.html.twig
  72. +1
    -1
      ShopBundle/Resources/views/backend/reductioncart/edit.html.twig
  73. +6
    -0
      ShopBundle/Resources/views/backend/reductioncart/panel_info.html.twig
  74. +1
    -1
      ShopBundle/Resources/views/backend/reductioncatalog/edit.html.twig
  75. +1
    -1
      ShopBundle/Resources/views/backend/ticket/show.html.twig
  76. +19
    -13
      ShopBundle/Resources/views/backend/user/block/user-switch.html.twig
  77. +1
    -1
      ShopBundle/Resources/views/backend/user/block_useraddress.html.twig
  78. +3
    -1
      ShopBundle/Resources/views/backend/user/edit.html.twig
  79. +10
    -0
      ShopBundle/Resources/views/backend/user/list-fields/field-countordershops.html.twig
  80. +1
    -1
      ShopBundle/Resources/views/backend/usermerchant/show.html.twig
  81. +1
    -1
      ShopBundle/Services/CsvGenerator.php
  82. +22
    -2
      ShopBundle/Services/MailUtils.php
  83. +4
    -3
      ShopBundle/Services/Order/OrderUtils.php
  84. +50
    -4
      ShopBundle/Services/Order/OrderUtilsReductionTrait.php
  85. +52
    -30
      ShopBundle/Services/Order/OrderUtilsStockTrait.php
  86. +76
    -22
      ShopBundle/Services/Price/OrderShopPriceUtils.php
  87. +2
    -2
      ShopBundle/Services/Price/PriceUtils.php
  88. +35
    -25
      ShopBundle/Services/ProductFamilyUtils.php
  89. +4
    -1
      ShopBundle/Services/UserUtils.php
  90. +54
    -3
      ShopBundle/Services/Utils.php
  91. +3
    -2
      ShopBundle/Services/UtilsManager.php
  92. +4
    -2
      ShopBundle/Twig/FrontendTwigExtension.php

+ 8
- 0
ShopBundle/Context/UserUtilsInterface.php View File

<?php

namespace Lc\ShopBundle\Context;

interface UserUtilsInterface
{

}

+ 4
- 1
ShopBundle/Controller/Backend/OrderController.php View File

public function updateEntity($entity) public function updateEntity($entity)
{ {


//SI PAS DE problème après le 23/05/2021 à supprimer
die('Une erreur est survenue, merci de contacter FAB : Erreur ligne 80 LC =>OrderController ');
foreach ($entity->getOrderProducts() as $orderProduct) { foreach ($entity->getOrderProducts() as $orderProduct) {
//dump($orderProduct); //dump($orderProduct);
$orderProduct->setCreatedBy($this->getUser()); $orderProduct->setCreatedBy($this->getUser());
$this->em->persist($orderShop); $this->em->persist($orderShop);
$this->em->flush(); $this->em->flush();
$this->mailUtils->send([ $this->mailUtils->send([
MailUtils::SUBJECT => 'Régler votre commande',
MailUtils::SUBJECT => 'Réglement de votre commande',
MailUtils::TO_EMAIL => $orderShop->getUser()->getEmail(), MailUtils::TO_EMAIL => $orderShop->getUser()->getEmail(),
MailUtils::TO_NAME => $orderShop->getUser()->getName(), MailUtils::TO_NAME => $orderShop->getUser()->getName(),
MailUtils::CONTENT_TEMPLATE => 'mail/order-payment-link', MailUtils::CONTENT_TEMPLATE => 'mail/order-payment-link',
case OrderStatus::ALIAS_PAID_BY_CREDIT : case OrderStatus::ALIAS_PAID_BY_CREDIT :
case OrderStatus::ALIAS_PAID_ONLINE : case OrderStatus::ALIAS_PAID_ONLINE :
case OrderStatus::ALIAS_WAITING_DELIVERY : case OrderStatus::ALIAS_WAITING_DELIVERY :
case OrderStatus::ALIAS_WAITING_BANK_RETURN :
$parameters['form_order_payment'] = $this->createCustomForm(OrderPaymentType::class, 'orderPayment', $parameters, false)->createView(); $parameters['form_order_payment'] = $this->createCustomForm(OrderPaymentType::class, 'orderPayment', $parameters, false)->createView();
$parameters['form_order_status'] = $this->createCustomForm(OrderStatusType::class, 'orderStatus', $parameters)->createView(); $parameters['form_order_status'] = $this->createCustomForm(OrderStatusType::class, 'orderStatus', $parameters)->createView();
$parameters['form_delete_order_payment'] = $this->createCustomForm(DeleteOrderPaymentType::class, 'deleteOrderPayment', $parameters)->createView(); $parameters['form_delete_order_payment'] = $this->createCustomForm(DeleteOrderPaymentType::class, 'deleteOrderPayment', $parameters)->createView();

+ 40
- 0
ShopBundle/Controller/Backend/ReductionCartController.php View File

<?php

namespace Lc\ShopBundle\Controller\Backend;


use Doctrine\ORM\EntityManagerInterface;

use FOS\UserBundle\Model\UserManagerInterface;
use Lc\ShopBundle\Services\UtilsManager;
use Mailjet\MailjetSwiftMailer\SwiftMailer\MailjetTransport;
use Symfony\Component\Security\Core\Security;
use Symfony\Contracts\Translation\TranslatorInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;

class ReductionCartController extends AdminController
{


public function updateReductionCartEntity($entity, $editForm = false)
{
$displayError =false;
foreach ($entity->getCodes() as $code) {
$reductionCart = $this->orderUtils->getReductionCartByCode($code);
if ($reductionCart && $reductionCart->getId() != $entity->getId()) {
$this->addFlash('error', "Le code " . $code . " est déjà utilisé dans la réduction #" . $reductionCart->getId() . " " . $reductionCart->getTitle());
$displayError = true;
}
}
if ($displayError == false) parent::updateEntity($entity);
}

/* public function persistProductFamilyEntity($entity, $newForm)
{
$entity = $this->productFamilyUtils->processBeforePersistProductFamily($entity, $newForm);

$this->em->persist($entity);
$this->em->flush();
}*/
}


+ 5
- 0
ShopBundle/EventSubscriber/ListEventSubscriber.php View File



use Lc\ShopBundle\Context\FilterMerchantInterface; use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\ShopBundle\Context\FilterMultipleMerchantsInterface; use Lc\ShopBundle\Context\FilterMultipleMerchantsInterface;
use Lc\ShopBundle\Context\ProductFamilyInterface;
use Lc\ShopBundle\Context\StatusInterface; use Lc\ShopBundle\Context\StatusInterface;
use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Container;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;


}else {*/ }else {*/


if ($entityObject instanceof ProductFamilyInterface) {
$paginator->nbResultsOnSale = $entityRepo->count(array('saleStatus' =>1, 'status'=> 1, 'merchant'=> $criteria['merchant']));
}

if ($entityObject instanceof StatusInterface) { if ($entityObject instanceof StatusInterface) {


for ($status = -1; $status <= 1; $status++) { for ($status = -1; $status <= 1; $status++) {

+ 6
- 0
ShopBundle/Form/Backend/Merchant/MerchantConfigType.php View File

use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType; use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType; use Symfony\Component\Form\Extension\Core\Type\TextType;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
'label' => $merchantConfig->getLabel(), 'label' => $merchantConfig->getLabel(),
]); ]);
} }
elseif($merchantConfig->getFieldType() == 'textarea') {
$form->add('value', TextareaType::class, [
'label' => $merchantConfig->getLabel(),
]);
}
else { else {
if($merchantConfig->getOption()) { if($merchantConfig->getOption()) {
$form->add('value', TextType::class, [ $form->add('value', TextType::class, [

+ 1
- 1
ShopBundle/Form/Backend/Order/AddOrderReductionCartType.php View File

$builder $builder
->add('reductionCart', EntityType::class, array( ->add('reductionCart', EntityType::class, array(
'class' => $reductionCartClass->getName(), 'class' => $reductionCartClass->getName(),
'choices' => $reductionCartRepo->getEligibleReductionCart($entity),
'choices' => $reductionCartRepo->getOnlineReductionCart(),
'required' => true, 'required' => true,
'mapped'=>false 'mapped'=>false
)); ));

+ 11
- 0
ShopBundle/Form/Backend/ProductFamily/ProductType.php View File

namespace Lc\ShopBundle\Form\Backend\ProductFamily; namespace Lc\ShopBundle\Form\Backend\ProductFamily;


use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Lc\ShopBundle\Context\ProductInterface; use Lc\ShopBundle\Context\ProductInterface;
use Lc\ShopBundle\Context\ReductionCartInterface;
use Lc\ShopBundle\Context\UnitInterface; use Lc\ShopBundle\Context\UnitInterface;
use Lc\ShopBundle\Model\ReductionCart;
use Lc\ShopBundle\Services\Utils; use Lc\ShopBundle\Services\Utils;
use Symfony\Bridge\Doctrine\Form\Type\EntityType; use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\Extension\Core\Type\DateType; use Symfony\Component\Form\Extension\Core\Type\DateType;
$builder->add('exportNote', TextType::class, array( $builder->add('exportNote', TextType::class, array(
'required' =>false 'required' =>false
)); ));
$reductionCartClass = $this->em->getClassMetadata(ReductionCartInterface::class)->getName();
$reductionCartRepo = $this->em->getRepository(ReductionCartInterface::class);

/* $builder->add('giftVoucherReductionCart', EntityType::class, array(
'required' =>false,
'class'=> $reductionCartClass,
'choices' => $reductionCartRepo->getOnlineReductionCart(),
));*/


} }



+ 2
- 1
ShopBundle/Form/Backend/User/TicketTypesNotificationType.php View File

'field.Ticket.typeOptions.'.Ticket::TYPE_GENERAL_QUESTION => Ticket::TYPE_GENERAL_QUESTION, 'field.Ticket.typeOptions.'.Ticket::TYPE_GENERAL_QUESTION => Ticket::TYPE_GENERAL_QUESTION,
'field.Ticket.typeOptions.'.Ticket::TYPE_PRODUCT_ERROR=> Ticket::TYPE_PRODUCT_ERROR , 'field.Ticket.typeOptions.'.Ticket::TYPE_PRODUCT_ERROR=> Ticket::TYPE_PRODUCT_ERROR ,
'field.Ticket.typeOptions.'.Ticket::TYPE_PRODUCT_UNAVAILABLE => Ticket::TYPE_PRODUCT_UNAVAILABLE, 'field.Ticket.typeOptions.'.Ticket::TYPE_PRODUCT_UNAVAILABLE => Ticket::TYPE_PRODUCT_UNAVAILABLE,
'field.Ticket.typeOptions.'.Ticket::TYPE_TECHNICAL_PROBLEM => Ticket::TYPE_TECHNICAL_PROBLEM
'field.Ticket.typeOptions.'.Ticket::TYPE_TECHNICAL_PROBLEM => Ticket::TYPE_TECHNICAL_PROBLEM,
'field.Ticket.typeOptions.'.Ticket::TYPE_POULTRY_BOOKING => Ticket::TYPE_POULTRY_BOOKING
), ),
'required' => false, 'required' => false,
'expanded' => false, 'expanded' => false,

+ 61
- 0
ShopBundle/Form/Frontend/EditGiftVoucherType.php View File

<?php

namespace Lc\ShopBundle\Form\Frontend;

use App\Entity\Address;
use App\Entity\OrderShop;
use Doctrine\ORM\EntityManagerInterface;
use Lc\ShopBundle\Model\Ticket;
use Lc\ShopBundle\Services\UtilsManager;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Security;

class EditGiftVoucherType extends AbstractType
{
protected $orderShopRepository ;
protected $security ;
protected $em ;
protected $priceUtils ;


public function buildForm(FormBuilderInterface $builder, array $options)
{

$builder->add('activationDate', DateType::class, [
'label' => 'Date d\'activation de votre bon cadeau :',
'widget'=> 'single_text',
'help'=> 'Date à partir de laquelle la personne pourra utiliser ce bon cadeau.'
//'format'=> 'dd/MM/yyyy'
])
->add('title', TextType::class, [
'label' => 'Message personnalisé affiché dans le bon cadeau :',
'help'=> 'Exemple "Joyeux Noël Tata Suzanne !"'
])
->add('email', EmailType::class, [
'label' => 'Email de la personne à qui vous souhaitez offrir ce bon cadeau :',
'help'=> 'Le bon ne sera utilisable qu\'avec cet adresse e-mail'
])
->add('ownerName', TextType::class,[
'label' => 'Offert par :',
'help'=> 'Sera affiché dans le bon cadeau'
]);


}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}

+ 21
- 1
ShopBundle/Form/Frontend/NewsletterType.php View File



namespace Lc\ShopBundle\Form\Frontend; namespace Lc\ShopBundle\Form\Frontend;


use Lc\ShopBundle\Services\UtilsManager;
use Lc\ShopBundle\Validator\Constraints\UniqueEmailValidator; use Lc\ShopBundle\Validator\Constraints\UniqueEmailValidator;
use Symfony\Component\Form\Extension\Core\Type\EmailType; use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\Email;
use Symfony\Component\Validator\Constraints\EqualTo;
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
use Symfony\Component\Validator\Constraints\NotNull;


class NewsletterType extends AbstractType class NewsletterType extends AbstractType
{ {
protected $utils ;

public function __construct(UtilsManager $utilsManager)
{
$this->utils = $utilsManager->getUtils() ;
}

public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder->add('email', EmailType::class, [ $builder->add('email', EmailType::class, [
'label' => 'Renseignez votre adresse email :'
'label' => 'Renseignez votre adresse email :',
'constraints' => [
new Email(),
new NotNull()
]
]); ]);

// captcha
$this->utils->addCaptchaType($builder);
} }


public function configureOptions(OptionsResolver $resolver) public function configureOptions(OptionsResolver $resolver)

+ 11
- 0
ShopBundle/Form/Frontend/RegistrationType.php View File

namespace Lc\ShopBundle\Form\Frontend; namespace Lc\ShopBundle\Form\Frontend;


use FOS\UserBundle\Form\Type\RegistrationFormType as BaseRegistrationFormType; use FOS\UserBundle\Form\Type\RegistrationFormType as BaseRegistrationFormType;
use Lc\ShopBundle\Services\UtilsManager;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; use Symfony\Component\Form\Extension\Core\Type\ChoiceType;


class RegistrationType extends AbstractType class RegistrationType extends AbstractType
{ {
protected $utils ;

public function __construct(UtilsManager $utilsManager)
{
$this->utils = $utilsManager->getUtils() ;
}

public function getParent() public function getParent()
{ {
return BaseRegistrationFormType::class; return BaseRegistrationFormType::class;
'mapped' => false, 'mapped' => false,
'translation_domain' => 'lcshop', 'translation_domain' => 'lcshop',
]); ]);

// captcha
$this->utils->addCaptchaType($builder);
} }





+ 46
- 0
ShopBundle/Form/Frontend/SendGiftVoucherType.php View File

<?php

namespace Lc\ShopBundle\Form\Frontend;

use App\Entity\Address;
use App\Entity\OrderShop;
use Doctrine\ORM\EntityManagerInterface;
use Lc\ShopBundle\Model\Ticket;
use Lc\ShopBundle\Services\UtilsManager;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\EmailType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Security;

class SendGiftVoucherType extends AbstractType
{
protected $orderShopRepository ;
protected $security ;
protected $em ;
protected $priceUtils ;


public function buildForm(FormBuilderInterface $builder, array $options)
{

$builder->add('message', TextareaType::class, [
'label' => 'Message personnalisé',
]);


}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
// Configure your form options here
]);
}
}

+ 1
- 0
ShopBundle/Form/Frontend/TicketType.php View File

'field.Ticket.typeOptions.'.Ticket::TYPE_PRODUCT_UNAVAILABLE => Ticket::TYPE_PRODUCT_UNAVAILABLE, 'field.Ticket.typeOptions.'.Ticket::TYPE_PRODUCT_UNAVAILABLE => Ticket::TYPE_PRODUCT_UNAVAILABLE,
'field.Ticket.typeOptions.'.Ticket::TYPE_PRODUCT_ERROR => Ticket::TYPE_PRODUCT_ERROR, 'field.Ticket.typeOptions.'.Ticket::TYPE_PRODUCT_ERROR => Ticket::TYPE_PRODUCT_ERROR,
'field.Ticket.typeOptions.'.Ticket::TYPE_TECHNICAL_PROBLEM => Ticket::TYPE_TECHNICAL_PROBLEM, 'field.Ticket.typeOptions.'.Ticket::TYPE_TECHNICAL_PROBLEM => Ticket::TYPE_TECHNICAL_PROBLEM,
'field.Ticket.typeOptions.'.Ticket::TYPE_POULTRY_BOOKING => Ticket::TYPE_POULTRY_BOOKING,
], ],
'translation_domain' => 'lcshop', 'translation_domain' => 'lcshop',
]) ; ]) ;

+ 3
- 1
ShopBundle/Model/Address.php View File

namespace Lc\ShopBundle\Model; namespace Lc\ShopBundle\Model;


use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\StatusInterface;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()
*/ */
abstract class Address extends AbstractEntity
abstract class Address extends AbstractEntity implements StatusInterface
{ {
use StatusTrait;


const TYPE_INDIVIDUAL = 'individual'; const TYPE_INDIVIDUAL = 'individual';
const TYPE_LEGAL_PERSON = 'legal-person'; const TYPE_LEGAL_PERSON = 'legal-person';

+ 20
- 0
ShopBundle/Model/OrderReductionCredit.php View File

*/ */
protected $reductionCredit; protected $reductionCredit;



/**
* @ORM\Column(type="string", length=255)
*/
protected $type;


public function __toString() public function __toString()
{ {
return $this->title; return $this->title;


return $this; return $this;
} }

public function getType(): ?string
{
return $this->type;
}

public function setType(string $type): self
{
$this->type = $type;

return $this;
}

} }

+ 13
- 2
ShopBundle/Model/OrderShop.php View File



namespace Lc\ShopBundle\Model; namespace Lc\ShopBundle\Model;


use App\Entity\OrderStatus;
use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Collection;
use Gedmo\Mapping\Annotation as Gedmo; use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Lc\ShopBundle\Context\DocumentInterface; use Lc\ShopBundle\Context\DocumentInterface;
use Lc\ShopBundle\Context\FilterMerchantInterface; use Lc\ShopBundle\Context\FilterMerchantInterface;
use Lc\ShopBundle\Services\Order\OrderUtils;
use Lc\ShopBundle\Model\OrderStatus ;


/** /**
* @ORM\MappedSuperclass() * @ORM\MappedSuperclass()


public function getDateCreated() public function getDateCreated()
{ {
$orderStatusHistory = $this->getOrderStatusHistory('new');
$orderStatusHistory = $this->getOrderStatusHistory(OrderStatus::ALIAS_WAITING_DELIVERY);
if ($orderStatusHistory) { if ($orderStatusHistory) {
return $orderStatusHistory->getCreatedAt(); return $orderStatusHistory->getCreatedAt();
} }
return $this; return $this;
} }


public function getDocumentInvoice(): Document
{
foreach($this->getDocuments() as $document) {
if($document->getType() == Document::TYPE_INVOICE) {
return $document ;
}
}

return false ;
}


/** /**
* @return Collection|Ticket[] * @return Collection|Ticket[]

+ 2
- 0
ShopBundle/Model/OrderStatus.php View File

const ALIAS_CART_CANCELED = 'cart-canceled' ; const ALIAS_CART_CANCELED = 'cart-canceled' ;
const ALIAS_WAITING_PAYMENT_ONLINE = 'waiting-payment-online' ; const ALIAS_WAITING_PAYMENT_ONLINE = 'waiting-payment-online' ;
const ALIAS_WAITING_PAYMENT_CREDIT = 'waiting-payment-credit' ; const ALIAS_WAITING_PAYMENT_CREDIT = 'waiting-payment-credit' ;
const ALIAS_WAITING_BANK_RETURN = 'waiting-bank-return' ;
const ALIAS_PAID_ONLINE = 'paid-online' ; const ALIAS_PAID_ONLINE = 'paid-online' ;
const ALIAS_ERROR_PAYMENT_ONLINE = 'error-payment-online' ; const ALIAS_ERROR_PAYMENT_ONLINE = 'error-payment-online' ;
const ALIAS_PAID_BY_CREDIT = 'paid-by-credit' ; const ALIAS_PAID_BY_CREDIT = 'paid-by-credit' ;
self::ALIAS_PAID_ONLINE, self::ALIAS_PAID_ONLINE,
self::ALIAS_PAID_BY_CREDIT, self::ALIAS_PAID_BY_CREDIT,
self::ALIAS_WAITING_DELIVERY, self::ALIAS_WAITING_DELIVERY,
self::ALIAS_WAITING_BANK_RETURN,
self::ALIAS_WAITING_DELIVERY_WITH_PAYMENT, self::ALIAS_WAITING_DELIVERY_WITH_PAYMENT,
self::ALIAS_DELIVERED_WITHOUT_PAYMENT, self::ALIAS_DELIVERED_WITHOUT_PAYMENT,
self::ALIAS_DONE self::ALIAS_DONE

+ 17
- 0
ShopBundle/Model/ProductCategory.php View File

*/ */
protected $productFamilies; protected $productFamilies;


/**
* @ORM\Column(type="boolean")
*/
protected $saleStatus;

public function __construct() public function __construct()
{ {
$this->childrens = new ArrayCollection(); $this->childrens = new ArrayCollection();


return $this; return $this;
} }

public function getSaleStatus(): ?bool
{
return $this->saleStatus;
}

public function setSaleStatus(bool $saleStatus): self
{
$this->saleStatus = $saleStatus;

return $this;
}
} }

+ 34
- 0
ShopBundle/Model/ProductFamily.php View File

*/ */
protected $productsType; protected $productsType;


/**
* @ORM\Column(type="boolean", nullable=true)
*/
protected $productsQuantityAsTitle;

/** /**
* @ORM\Column(type="string", length=255, nullable=true) * @ORM\Column(type="string", length=255, nullable=true)
*/ */
protected $behaviorPrice; protected $behaviorPrice;




/**
* @ORM\Column(type="boolean")
*/
protected $saleStatus;

public function __construct() public function __construct()
{ {
$this->productCategories = new ArrayCollection(); $this->productCategories = new ArrayCollection();
return $this; return $this;
} }


public function getProductsQuantityAsTitle(): ?bool
{
return $this->productsQuantityAsTitle;
}

public function setProductsQuantityAsTitle(bool $productsQuantityAsTitle): self
{
$this->productsQuantityAsTitle = $productsQuantityAsTitle;

return $this;
}

public function getProductsType(): ?string public function getProductsType(): ?string
{ {
return $this->productsType; return $this->productsType;


return false ; return false ;
} }

public function getSaleStatus(): ?bool
{
return $this->saleStatus;
}

public function setSaleStatus(bool $saleStatus): self
{
$this->saleStatus = $saleStatus;

return $this;
}
} }

+ 16
- 1
ShopBundle/Model/ReductionCart.php View File

*/ */
protected $uncombinableTypes = []; protected $uncombinableTypes = [];



/**
* @ORM\Column(type="integer")
*/
protected $availableQuantityPerCode;
public function __toString() public function __toString()
{ {
return $this->title; return $this->title;
return $this; return $this;
} }


public function getAvailableQuantityPerCode(): ?int
{
return $this->availableQuantityPerCode;
}

public function setAvailableQuantityPerCode(int $availableQuantityPerCode): self
{
$this->availableQuantityPerCode = $availableQuantityPerCode;

return $this;
}

} }

+ 57
- 0
ShopBundle/Model/ReductionCredit.php View File

*/ */
abstract class ReductionCredit extends AbstractEntity implements ReductionInterface, FilterMerchantInterface, StatusInterface abstract class ReductionCredit extends AbstractEntity implements ReductionInterface, FilterMerchantInterface, StatusInterface
{ {
const TYPE_CREDIT = 'credit' ;
const TYPE_GIFT = 'gift' ;


use ReductionTrait; use ReductionTrait;
use StatusTrait; use StatusTrait;


*/ */
protected $merchant; protected $merchant;


/**
* @ORM\Column(type="string", length=255)
*/
protected $type;

/**
* @ORM\Column(type="boolean", nullable=true)
*/
protected $sended;


/**
* @ORM\ManyToOne(targetEntity="Lc\ShopBundle\Context\UserInterface")
*/
protected $owner;


public function __construct() public function __construct()
{ {


return $this; return $this;
} }

public function getType(): ?string
{
return $this->type;
}

public function setType(string $type): self
{
$this->type = $type;

return $this;
}




public function getSended(): ?bool
{
return $this->sended;
}

public function setSended(?bool $sended): self
{
$this->sended = $sended;

return $this;
}


public function getOwner(): ?User
{
return $this->owner;
}

public function setOwner(?User $owner): self
{
$this->owner = $owner;

return $this;
}
} }

+ 1
- 0
ShopBundle/Model/ReductionTrait.php View File



trait ReductionTrait trait ReductionTrait
{ {

/** /**
* @ORM\Column(type="float", nullable=true) * @ORM\Column(type="float", nullable=true)
*/ */

+ 2
- 0
ShopBundle/Model/Ticket.php View File

const TYPE_PRODUCT_ERROR = 'product-error' ; const TYPE_PRODUCT_ERROR = 'product-error' ;
const TYPE_TECHNICAL_PROBLEM = 'technical-problem' ; const TYPE_TECHNICAL_PROBLEM = 'technical-problem' ;
const TYPE_GENERAL_QUESTION = 'general-question' ; const TYPE_GENERAL_QUESTION = 'general-question' ;
const TYPE_POULTRY_BOOKING = 'poultry-booking' ;



const TICKET_STATUS_OPEN = 'open' ; const TICKET_STATUS_OPEN = 'open' ;
const TICKET_STATUS_BEING_PROCESSED = 'being-processed' ; const TICKET_STATUS_BEING_PROCESSED = 'being-processed' ;

+ 14
- 3
ShopBundle/Model/User.php View File

/** /**
* @return Collection|Address[] * @return Collection|Address[]
*/ */
public function getAddresses(): Collection
{
return $this->addresses;
public function getAddresses($status = null): Collection
{
if($status){
$addressToReturn = new ArrayCollection();
foreach ($this->addresses as $address){
if($address->getStatus() == $status) {
$addressToReturn[] = $address;
}
}
return $addressToReturn;
}else{
return $this->addresses;
}

} }


public function addAddress(Address $address): self public function addAddress(Address $address): self

+ 14
- 0
ShopBundle/Repository/CreditHistoryRepository.php View File

return CreditHistoryInterface::class; return CreditHistoryInterface::class;
} }


public function findAllByDateStartEnd($merchant, $dateStart, $dateEnd)
{
return $this->createQueryBuilder('e')
->innerJoin('e.userMerchant', 'user_merchant')
->andWhere('user_merchant.merchant = :merchant')
->setParameter(':merchant', $merchant)
->andWhere('e.createdAt >= :dateStart')
->andWhere('e.createdAt <= :dateEnd')
->setParameter(':dateStart', $dateStart)
->setParameter(':dateEnd', $dateEnd)
->addOrderBy('e.createdAt', 'ASC')
->getQuery()->getResult();
}

public function findAllByUserMerchant($userMerchant) public function findAllByUserMerchant($userMerchant)
{ {
return $this->createQueryBuilder('e') return $this->createQueryBuilder('e')

+ 28
- 13
ShopBundle/Repository/OrderShopRepository.php View File

return OrderShopInterface::class; return OrderShopInterface::class;
} }


public function countValidOrderWithReductionCredit($reductionCredit, $user)
public function countValidOrderWithReductionCredit($reductionCredit, $user=null)
{ {
$query = $this->findByMerchantQuery(); $query = $this->findByMerchantQuery();
$query = $this->filterOrderValid($query); $query = $this->filterOrderValid($query);
$query->select('count(e.id)'); $query->select('count(e.id)');
$query->andWhere('e.user = :user');
if($user) {
$query->andWhere('e.user = :user');
$query->setParameter('user', $user);
}
$query->innerJoin('e.orderReductionCredits', 'orc'); $query->innerJoin('e.orderReductionCredits', 'orc');
$query->andWhere('orc.reductionCredit = :reductionCredit'); $query->andWhere('orc.reductionCredit = :reductionCredit');
$query->setParameter('reductionCredit', $reductionCredit); $query->setParameter('reductionCredit', $reductionCredit);
$query->setParameter('user', $user);
return $query->getQuery()->getSingleScalarResult(); return $query->getQuery()->getSingleScalarResult();
} }


} }




public function filterOrderValid(?QueryBuilder $query): QueryBuilder
{
return $this->_filterOrderStatus($query, OrderStatus::$statusAliasAsValid) ;
}


public function filterOrderWaitingDelivery($query) public function filterOrderWaitingDelivery($query)
{ {
{ {
return $this->_filterOrderStatus($query, OrderStatus::$statusAliasAsCart) ; return $this->_filterOrderStatus($query, OrderStatus::$statusAliasAsCart) ;
} }
public function filterOrderValid(?QueryBuilder $query): QueryBuilder
{
return $this->_filterOrderStatus($query, OrderStatus::$statusAliasAsValid) ;
}


private function _filterOrderStatus($query, $statusArray) { private function _filterOrderStatus($query, $statusArray) {
$query->leftJoin('e.orderStatus', 'os'); $query->leftJoin('e.orderStatus', 'os');
} }


$setParameterHorsTournee = false ; $setParameterHorsTournee = false ;
$setParameterGiftVoucher = false ;


if (isset($params['isCircuit'])) {
if(isset($params['isCircuit'])) {
$query->leftJoin('e.deliveryPointSale', 'pointSale'); $query->leftJoin('e.deliveryPointSale', 'pointSale');
$query->andWhere('e.deliveryPointSale IS NULL OR (pointSale.isDepository = 0 AND (pointSale.devAlias IS NULL OR pointSale.devAlias != :devAliasHorsTournee))');
$query->andWhere('e.deliveryPointSale IS NULL OR (pointSale.isDepository = 0 AND (pointSale.devAlias IS NULL OR (pointSale.devAlias != :devAliasHorsTournee AND pointSale.devAlias != :devAliasGiftVoucher)))');
$setParameterHorsTournee = true ; $setParameterHorsTournee = true ;
$setParameterGiftVoucher = true ;
} }


if (isset($params['isDepository'])) {
if(isset($params['isDepository'])) {
$query->innerJoin('e.deliveryPointSale', 'pointSale'); $query->innerJoin('e.deliveryPointSale', 'pointSale');
$query->andWhere('pointSale IS NOT NULL AND pointSale.isDepository = 1 AND (pointSale.devAlias IS NULL OR pointSale.devAlias != :devAliasHorsTournee)');
$query->andWhere('pointSale IS NOT NULL AND pointSale.isDepository = 1 AND (pointSale.devAlias IS NULL OR (pointSale.devAlias != :devAliasHorsTournee AND pointSale.devAlias != :devAliasGiftVoucher))');
$setParameterHorsTournee = true ; $setParameterHorsTournee = true ;
$setParameterGiftVoucher = true ;
} }


if (isset($params['isOffCircuit'])) {
if(isset($params['isOffCircuit'])) {
$query->innerJoin('e.deliveryPointSale', 'pointSale'); $query->innerJoin('e.deliveryPointSale', 'pointSale');
$query->andWhere('pointSale IS NOT NULL AND pointSale.devAlias = :devAliasHorsTournee'); $query->andWhere('pointSale IS NOT NULL AND pointSale.devAlias = :devAliasHorsTournee');
$setParameterHorsTournee = true ; $setParameterHorsTournee = true ;
} }


if(isset($params['isGiftVoucher'])) {
$query->innerJoin('e.deliveryPointSale', 'pointSale');
$query->andWhere('pointSale IS NOT NULL AND pointSale.devAlias = :devAliasGiftVoucher');
$setParameterGiftVoucher = true ;
}

if($setParameterHorsTournee) { if($setParameterHorsTournee) {
$query->setParameter('devAliasHorsTournee', 'horstournee') ; $query->setParameter('devAliasHorsTournee', 'horstournee') ;
} }


if($setParameterGiftVoucher) {
$query->setParameter('devAliasGiftVoucher', 'giftvoucher') ;
}

if (isset($params['deliveryAvailability'])) { if (isset($params['deliveryAvailability'])) {
$deliveryAvailability = $params['deliveryAvailability'] ; $deliveryAvailability = $params['deliveryAvailability'] ;


$query->orderBy('e.id', 'DESC'); $query->orderBy('e.id', 'DESC');
} }



if (isset($params['groupBy'])) { if (isset($params['groupBy'])) {
$query->groupBy( $params['groupBy']); $query->groupBy( $params['groupBy']);
} }

+ 9
- 2
ShopBundle/Repository/ProductFamilyRepository.php View File

$query->andWhere('e.status = 1'); $query->andWhere('e.status = 1');
$query->andWhere(':now <= e.propertyNoveltyExpirationDate') $query->andWhere(':now <= e.propertyNoveltyExpirationDate')
->setParameter('now', new \DateTime()) ; ->setParameter('now', new \DateTime()) ;
$query->orderBy('e.createdAt', 'DESC');


return $query->getQuery()->getResult() ; return $query->getQuery()->getResult() ;
} }
public function findByTerms($terms, $maxResults = false) public function findByTerms($terms, $maxResults = false)
{ {
$query = $this->findByMerchantQuery() ; $query = $this->findByMerchantQuery() ;
$query = $this->joinRelations($query) ;

$query->leftJoin('e.productCategories', 'cat');
$query->addSelect('cat') ;

$query->orderBy('e.position', 'ASC');


$query->andWhere('e.status = 1'); $query->andWhere('e.status = 1');
$query->andWhere('e.title LIKE :terms');
$query->andWhere('e.title LIKE :terms OR cat.title LIKE :terms');
$query->setParameter(':terms', '%'.$terms.'%') ; $query->setParameter(':terms', '%'.$terms.'%') ;


$query->groupBy('e.id') ;

if($maxResults) { if($maxResults) {
$query->setMaxResults($maxResults) ; $query->setMaxResults($maxResults) ;
} }

+ 5
- 4
ShopBundle/Repository/ReductionCartRepository.php View File

return ReductionCartInterface::class; return ReductionCartInterface::class;
} }


public function findOneByCode($code)
public function findByCode($code)
{ {
$query = $this->findByMerchantQuery() ; $query = $this->findByMerchantQuery() ;
$query->andWhere('e.codes LIKE :code')->setParameter('code', '%'.$code.'%') ; $query->andWhere('e.codes LIKE :code')->setParameter('code', '%'.$code.'%') ;
return $query->getQuery()->getOneOrNullResult() ;
return $query->getQuery()->getResult() ;
} }


public function getValuesOfFieldType(){ public function getValuesOfFieldType(){


} }


public function getEligibleReductionCart($order)
public function getOnlineReductionCart()
{ {
$query = $this->findByMerchantQuery() ; $query = $this->findByMerchantQuery() ;
$query->andWhere('e.status = 1'); $query->andWhere('e.status = 1');
foreach($reductionCarts as $reductionCart) { foreach($reductionCarts as $reductionCart) {
if($this->orderUtils->isReductionCartMatchWithUser($reductionCart, $user) if($this->orderUtils->isReductionCartMatchWithUser($reductionCart, $user)
&& $this->orderUtils->isReductionCartMatchWithGroupUser($reductionCart, $user) && $this->orderUtils->isReductionCartMatchWithGroupUser($reductionCart, $user)
&& $this->orderUtils->countReductionCartAvailableForUser($reductionCart, $user)) {
&& $this->orderUtils->countReductionCartAvailableForUser($reductionCart, $user)
&& ($reductionCart->getUsers()->count() > 0 || $reductionCart->getGroupUsers()->count() > 0)) {


$reductionCartsArray[] = $reductionCart ; $reductionCartsArray[] = $reductionCart ;
} }

+ 44
- 0
ShopBundle/Repository/ReductionCreditRepository.php View File

use Lc\ShopBundle\Context\DefaultRepositoryInterface; use Lc\ShopBundle\Context\DefaultRepositoryInterface;
use Lc\ShopBundle\Context\MerchantUtilsInterface; use Lc\ShopBundle\Context\MerchantUtilsInterface;
use Lc\ShopBundle\Context\ReductionCreditInterface; use Lc\ShopBundle\Context\ReductionCreditInterface;
use Lc\ShopBundle\Model\ReductionCredit;


/** /**
* @method ReductionCreditInterface|null find($id, $lockMode = null, $lockVersion = null) * @method ReductionCreditInterface|null find($id, $lockMode = null, $lockVersion = null)
{ {
$query = $this->findByMerchantQuery() ; $query = $this->findByMerchantQuery() ;
$query->andWhere('e.status = 1'); $query->andWhere('e.status = 1');
$query->andWhere('e.type = :type');
$query->andWhere(':user MEMBER OF e.users'); $query->andWhere(':user MEMBER OF e.users');
$query->setParameter('user', $user); $query->setParameter('user', $user);
$query->setParameter('type', ReductionCredit::TYPE_CREDIT);
return $query->getQuery()->getResult() ;
}

public function findReductionGiftToUseByUser($user){
$query = $this->findByMerchantQuery() ;
$query->andWhere('e.status = 1');
$query->andWhere('e.type = :type');
$query->andWhere(':user MEMBER OF e.users');
$query->andWhere(':now > e.activationDate');
$query->setParameter('now', new \DateTime()) ;

$query->setParameter('user', $user);
$query->setParameter('type', ReductionCredit::TYPE_GIFT);
return $query->getQuery()->getResult() ;
}


public function findReductionGiftOwnedByUser($user){
$query = $this->findByMerchantQuery() ;
$query->leftJoin('e.users', 'u');
$query->having('COUNT(u.id) =0');
$query->andWhere('e.status = 1');
$query->andWhere('e.type = :type');
$query->andWhere('e.owner = :user');
$query->setParameter('user', $user);
$query->setParameter('type', ReductionCredit::TYPE_GIFT);
$query->groupBy('e.id');
return $query->getQuery()->getResult() ;
}

public function findReductionGiftOwnedActiveByUser($user){
$query = $this->findByMerchantQuery() ;
$query->leftJoin('e.users', 'u');
$query->having('COUNT(u.id) >0');
$query->andWhere('e.status = 1');
$query->andWhere('e.type = :type');
$query->andWhere('e.owner = :user');
$query->setParameter('user', $user);
$query->setParameter('type', ReductionCredit::TYPE_GIFT);
$query->groupBy('e.id');

return $query->getQuery()->getResult() ; return $query->getQuery()->getResult() ;
} }
} }

+ 4
- 3
ShopBundle/Repository/TicketRepository.php View File

return $query ; return $query ;
} }


public function findAllOpen()
public function findAllOpen($limit=0)
{ {
$query = $this->findByMerchantQuery() ; $query = $this->findByMerchantQuery() ;
$this->filterStatus($query, [Ticket::TICKET_STATUS_OPEN, Ticket::TICKET_STATUS_BEING_PROCESSED]) ;
$this->filterStatus($query, [Ticket::TICKET_STATUS_OPEN]) ;
$query->addOrderBy('e.id', 'DESC') ; $query->addOrderBy('e.id', 'DESC') ;
$query->setMaxResults($limit);
return $query->getQuery()->getResult() ; return $query->getQuery()->getResult() ;
} }


{ {
$query = $this->findByMerchantQuery() ; $query = $this->findByMerchantQuery() ;
$query->select('count(e.id)'); $query->select('count(e.id)');
$this->filterStatus($query, [Ticket::TICKET_STATUS_OPEN, Ticket::TICKET_STATUS_BEING_PROCESSED]) ;
$this->filterStatus($query, [Ticket::TICKET_STATUS_OPEN]) ;
return $query->getQuery()->getSingleScalarResult() ; return $query->getQuery()->getSingleScalarResult() ;
} }
} }

+ 188
- 116
ShopBundle/Resources/public/css/backend/custom.css View File

body#pdl-body .wrapper .main-sidebar { body#pdl-body .wrapper .main-sidebar {
bottom: 0; bottom: 0;
float: none; float: none;
height: 100vh;
height: 110vh;
left: 0; left: 0;
position: fixed; position: fixed;
top: 0; top: 0;
} }


/* line 41, ../../sass/backend/custom.scss */ /* line 41, ../../sass/backend/custom.scss */
body#pdl-body .wrapper .sidebar {
height: 100%;
}

/* line 42, ../../sass/backend/custom.scss */
body#pdl-body .wrapper .sidebar nav {
padding-bottom: 40px;
}

/* line 43, ../../sass/backend/custom.scss */
body#pdl-body .wrapper .content-wrapper { body#pdl-body .wrapper .content-wrapper {
margin-top: 0; margin-top: 0;
padding-top: 57px; padding-top: 57px;
} }


/* line 42, ../../sass/backend/custom.scss */
/* line 44, ../../sass/backend/custom.scss */
.sidebar { .sidebar {
overflow-y: auto; overflow-y: auto;
} }


/* line 45, ../../sass/backend/custom.scss */
/* line 47, ../../sass/backend/custom.scss */
#lc-flash-messages { #lc-flash-messages {
display: none; display: none;
} }


/* line 47, ../../sass/backend/custom.scss */
/* line 49, ../../sass/backend/custom.scss */
.main-sidebar .logo-long { .main-sidebar .logo-long {
padding: 8px 0; padding: 8px 0;
text-align: center; text-align: center;
} }


/* line 48, ../../sass/backend/custom.scss */
/* line 50, ../../sass/backend/custom.scss */
.main-sidebar .logo-long img { .main-sidebar .logo-long img {
height: 40px; height: 40px;
display: inline-block; display: inline-block;
} }


/* line 49, ../../sass/backend/custom.scss */
/* line 51, ../../sass/backend/custom.scss */
.sidebar-collapse .main-sidebar .logo-long span { .sidebar-collapse .main-sidebar .logo-long span {
display: none; display: none;
} }


/* line 50, ../../sass/backend/custom.scss */
/* line 52, ../../sass/backend/custom.scss */
.sidebar-collapse .main-sidebar:hover .logo-long span { .sidebar-collapse .main-sidebar:hover .logo-long span {
display: inline-block; display: inline-block;
} }


/* line 52, ../../sass/backend/custom.scss */
/* line 54, ../../sass/backend/custom.scss */
.table.datatable-simple .highlight { .table.datatable-simple .highlight {
background: var(--teal); background: var(--teal);
} }


/* line 53, ../../sass/backend/custom.scss */
/* line 55, ../../sass/backend/custom.scss */
.datatable-field-search.small { .datatable-field-search.small {
width: 50px; width: 50px;
} }


/* line 55, ../../sass/backend/custom.scss */
/* line 57, ../../sass/backend/custom.scss */
.dataTables_length, .dataTables_filter { .dataTables_length, .dataTables_filter {
padding: .75rem 1.25rem 0.25rem; padding: .75rem 1.25rem 0.25rem;
} }


/* line 57, ../../sass/backend/custom.scss */
/* line 59, ../../sass/backend/custom.scss */
table.fixedHeader-floating { table.fixedHeader-floating {
margin-top: 0px !important; margin-top: 0px !important;
} }


/* line 58, ../../sass/backend/custom.scss */
/* line 60, ../../sass/backend/custom.scss */
table th.sorting_asc, table th.sorting_desc { table th.sorting_asc, table th.sorting_desc {
border-top: 3px solid var(--success); border-top: 3px solid var(--success);
} }


/* line 59, ../../sass/backend/custom.scss */
/* line 61, ../../sass/backend/custom.scss */
.card-body table.lc-table-list th.sorted, table th.sorting_asc, table th.sorting_desc { .card-body table.lc-table-list th.sorted, table th.sorting_asc, table th.sorting_desc {
border-top: 2px solid var(--success); border-top: 2px solid var(--success);
} }


/*.card-body table.lc-table-list th{border-top:3px solid var(--success);}*/ /*.card-body table.lc-table-list th{border-top:3px solid var(--success);}*/
/* line 61, ../../sass/backend/custom.scss */
/* line 63, ../../sass/backend/custom.scss */
table th.filtered { table th.filtered {
border-top: 3px solid var(--primary); border-top: 3px solid var(--primary);
} }


/* line 64, ../../sass/backend/custom.scss */
/* line 66, ../../sass/backend/custom.scss */
.lc-table-list thead a { .lc-table-list thead a {
color: #212529; color: #212529;
} }


/* line 65, ../../sass/backend/custom.scss */
/* line 67, ../../sass/backend/custom.scss */
.table-filters-line th { .table-filters-line th {
font-weight: 400; font-weight: 400;
position: relative; position: relative;
} }


/* line 67, ../../sass/backend/custom.scss */
/* line 69, ../../sass/backend/custom.scss */
#list_filter_id { #list_filter_id {
width: 60px; width: 60px;
} }


/* line 68, ../../sass/backend/custom.scss */
/* line 70, ../../sass/backend/custom.scss */
.lc-table-list .date-range { .lc-table-list .date-range {
width: 130px; width: 130px;
} }


/* line 70, ../../sass/backend/custom.scss */
/* line 72, ../../sass/backend/custom.scss */
th.actions, td.actions { th.actions, td.actions {
white-space: nowrap; white-space: nowrap;
text-align: right; text-align: right;
} }


/* line 72, ../../sass/backend/custom.scss */
/* line 74, ../../sass/backend/custom.scss */
.table td, .table th { .table td, .table th {
padding: 0.35rem; padding: 0.35rem;
} }


/* line 73, ../../sass/backend/custom.scss */
/* line 75, ../../sass/backend/custom.scss */
.delivery-field .form-group { .delivery-field .form-group {
display: inline-block; display: inline-block;
margin-bottom: 0px; margin-bottom: 0px;
margin-right: 15px; margin-right: 15px;
} }


/* line 74, ../../sass/backend/custom.scss */
/* line 76, ../../sass/backend/custom.scss */
.delivery-field .form-group .form-control { .delivery-field .form-group .form-control {
width: 150px; width: 150px;
} }


/* line 76, ../../sass/backend/custom.scss */
/* line 78, ../../sass/backend/custom.scss */
table th input { table th input {
width: 100%; width: 100%;
} }


/* line 77, ../../sass/backend/custom.scss */
/* line 79, ../../sass/backend/custom.scss */
table th .select2-container--default .select2-selection--single { table th .select2-container--default .select2-selection--single {
padding: 0.3rem 0.4rem; padding: 0.3rem 0.4rem;
} }


/************************ LOGIN PAGE *********************/ /************************ LOGIN PAGE *********************/
/* line 80, ../../sass/backend/custom.scss */
/* line 82, ../../sass/backend/custom.scss */
.login-logo { .login-logo {
display: block; display: block;
margin: auto; margin: auto;
} }


/************************ form error *********************/ /************************ form error *********************/
/* line 83, ../../sass/backend/custom.scss */
/* line 85, ../../sass/backend/custom.scss */
.form-sent .form-control:invalid { .form-sent .form-control:invalid {
border-color: #dc3545; border-color: #dc3545;
padding-right: 2.25rem; padding-right: 2.25rem;
background-size: calc(.75em + .375rem) calc(.75em + .375rem); background-size: calc(.75em + .375rem) calc(.75em + .375rem);
} }


/* line 84, ../../sass/backend/custom.scss */
/* line 86, ../../sass/backend/custom.scss */
.form-sent select.form-control:invalid + .select2 .select2-selection { .form-sent select.form-control:invalid + .select2 .select2-selection {
border-color: #dc3545; border-color: #dc3545;
} }


/* line 85, ../../sass/backend/custom.scss */
/* line 87, ../../sass/backend/custom.scss */
.form-sent select.form-control:invalid + .select2 .select2-selection b { .form-sent select.form-control:invalid + .select2 .select2-selection b {
border-color: #dc3545 transparent transparent transparent; border-color: #dc3545 transparent transparent transparent;
} }


/*CUSTOM Checkbox /*CUSTOM Checkbox
/* Customize the label (the container) */ /* Customize the label (the container) */
/* line 90, ../../sass/backend/custom.scss */
/* line 92, ../../sass/backend/custom.scss */
.form-check-label { .form-check-label {
display: block; display: block;
position: relative; position: relative;
} }


/* Hide the browser's default checkbox */ /* Hide the browser's default checkbox */
/* line 92, ../../sass/backend/custom.scss */
/* line 94, ../../sass/backend/custom.scss */
.form-check-label input { .form-check-label input {
position: absolute; position: absolute;
opacity: 0; opacity: 0;
} }


/* Create a custom checkbox */ /* Create a custom checkbox */
/* line 95, ../../sass/backend/custom.scss */
/* line 97, ../../sass/backend/custom.scss */
.form-check { .form-check {
padding-left: 0px; padding-left: 0px;
} }


/* line 97, ../../sass/backend/custom.scss */
/* line 99, ../../sass/backend/custom.scss */
.form-sent .form-check-label input:invalid ~ .checkmark { .form-sent .form-check-label input:invalid ~ .checkmark {
border-color: #dc3545; border-color: #dc3545;
} }


/* line 98, ../../sass/backend/custom.scss */
/* line 100, ../../sass/backend/custom.scss */
.form-check-label input:disabled ~ .checkmark { .form-check-label input:disabled ~ .checkmark {
display: none; display: none;
} }


/* line 99, ../../sass/backend/custom.scss */
/* line 101, ../../sass/backend/custom.scss */
.form-check-label input ~ .checkmark { .form-check-label input ~ .checkmark {
position: absolute; position: absolute;
top: 0; top: 0;
border: 1px solid var(--primary); border: 1px solid var(--primary);
} }


/* line 100, ../../sass/backend/custom.scss */
/* line 102, ../../sass/backend/custom.scss */
.form-check-label.big input ~ .checkmark { .form-check-label.big input ~ .checkmark {
height: 21px; height: 21px;
width: 21px; width: 21px;
} }


/* line 101, ../../sass/backend/custom.scss */
/* line 103, ../../sass/backend/custom.scss */
.form-check-label input[type="checkbox"] ~ .checkmark { .form-check-label input[type="checkbox"] ~ .checkmark {
top: 2px; top: 2px;
} }


/* line 102, ../../sass/backend/custom.scss */
/* line 104, ../../sass/backend/custom.scss */
.form-check-label input[type="radio"] ~ .checkmark { .form-check-label input[type="radio"] ~ .checkmark {
top: 3px; top: 3px;
border-radius: 50%; border-radius: 50%;
} }


/* line 103, ../../sass/backend/custom.scss */
/* line 105, ../../sass/backend/custom.scss */
.form-check-label:hover input ~ .checkmark { .form-check-label:hover input ~ .checkmark {
background-color: #ccc; background-color: #ccc;
} }


/* When the checkbox is checked, add a blue background */ /* When the checkbox is checked, add a blue background */
/* line 105, ../../sass/backend/custom.scss */
/* line 107, ../../sass/backend/custom.scss */
.form-check-label input:checked ~ .checkmark { .form-check-label input:checked ~ .checkmark {
background-color: var(--primary); background-color: var(--primary);
} }


/* Create the checkmark/indicator (hidden when not checked) */ /* Create the checkmark/indicator (hidden when not checked) */
/* line 107, ../../sass/backend/custom.scss */
/* line 109, ../../sass/backend/custom.scss */
.form-check-label .checkmark:after { .form-check-label .checkmark:after {
content: ""; content: "";
position: absolute; position: absolute;
} }


/* Show the checkmark when checked */ /* Show the checkmark when checked */
/* line 109, ../../sass/backend/custom.scss */
/* line 111, ../../sass/backend/custom.scss */
.form-check-label input:checked ~ .checkmark:after { .form-check-label input:checked ~ .checkmark:after {
display: block; display: block;
} }


/* Style the checkmark/indicator */ /* Style the checkmark/indicator */
/* line 111, ../../sass/backend/custom.scss */
/* line 113, ../../sass/backend/custom.scss */
.form-check-label .checkmark:after { .form-check-label .checkmark:after {
left: 7px; left: 7px;
top: 3px; top: 3px;
transform: rotate(45deg); transform: rotate(45deg);
} }


/* line 112, ../../sass/backend/custom.scss */
/* line 114, ../../sass/backend/custom.scss */
.form-check-label input[type="checkbox"] ~ .checkmark:after { .form-check-label input[type="checkbox"] ~ .checkmark:after {
left: 6px; left: 6px;
top: 2px; top: 2px;
transform: rotate(45deg); transform: rotate(45deg);
} }


/* line 113, ../../sass/backend/custom.scss */
/* line 115, ../../sass/backend/custom.scss */
.form-check-label input[type="radio"] ~ .checkmark:after { .form-check-label input[type="radio"] ~ .checkmark:after {
top: 4px; top: 4px;
left: 4px; left: 4px;
background: white; background: white;
} }


/* line 115, ../../sass/backend/custom.scss */
/* line 117, ../../sass/backend/custom.scss */
.form-check-label.big input[type="checkbox"] ~ .checkmark:after { .form-check-label.big input[type="checkbox"] ~ .checkmark:after {
left: 7px; left: 7px;
top: 3px; top: 3px;
} }


/* Create a custom radio button */ /* Create a custom radio button */
/* line 119, ../../sass/backend/custom.scss */
/* line 121, ../../sass/backend/custom.scss */
.product-categories .parent .form-group.field-checkbox .form-check-label { .product-categories .parent .form-group.field-checkbox .form-check-label {
padding-left: 0px; padding-left: 0px;
font-style: italic; font-style: italic;
} }


/* line 120, ../../sass/backend/custom.scss */
/* line 122, ../../sass/backend/custom.scss */
.product-categories .children .form-group.field-checkbox { .product-categories .children .form-group.field-checkbox {
margin-left: 20px; margin-left: 20px;
} }


/* line 121, ../../sass/backend/custom.scss */
/* line 123, ../../sass/backend/custom.scss */
.product-categories .form-group { .product-categories .form-group {
margin-bottom: 0.15rem; margin-bottom: 0.15rem;
} }


/* line 122, ../../sass/backend/custom.scss */
/* line 124, ../../sass/backend/custom.scss */
.lc-deleted-field { .lc-deleted-field {
display: none; display: none;
} }


/* line 123, ../../sass/backend/custom.scss */
/* line 125, ../../sass/backend/custom.scss */
.lc-offline-field { .lc-offline-field {
opacity: 0.5; opacity: 0.5;
} }


/* line 124, ../../sass/backend/custom.scss */
/* line 126, ../../sass/backend/custom.scss */
.lc-offline-field label::after { .lc-offline-field label::after {
content: ' [hors ligne]'; content: ' [hors ligne]';
} }


/* Général */ /* Général */
/* line 130, ../../sass/backend/custom.scss */
/* line 132, ../../sass/backend/custom.scss */
.btn.action-save { .btn.action-save {
float: right; float: right;
margin-left: 10px; margin-left: 10px;
} }


/* line 131, ../../sass/backend/custom.scss */
/* line 133, ../../sass/backend/custom.scss */
.button-action a.float-right { .button-action a.float-right {
margin-left: 10px; margin-left: 10px;
} }


/* line 133, ../../sass/backend/custom.scss */
/* line 135, ../../sass/backend/custom.scss */
.input-group-text { .input-group-text {
padding: 0.25rem 0.75rem; padding: 0.25rem 0.75rem;
} }


/* line 137, ../../sass/backend/custom.scss */
/* line 139, ../../sass/backend/custom.scss */
.col-form-label { .col-form-label {
font-weight: bold; font-weight: bold;
} }


/* line 139, ../../sass/backend/custom.scss */
/* line 141, ../../sass/backend/custom.scss */
#toast-container.toast-top-right { #toast-container.toast-top-right {
top: 60px; top: 60px;
} }


/* SIDEBAR */ /* SIDEBAR */
/* line 142, ../../sass/backend/custom.scss */
/* line 144, ../../sass/backend/custom.scss */
.main-header.navbar { .main-header.navbar {
padding: 0; padding: 0;
min-height: 57px; min-height: 57px;
} }


/* line 143, ../../sass/backend/custom.scss */
/* line 145, ../../sass/backend/custom.scss */
.lc-navbar li { .lc-navbar li {
border-left: 1px solid #e0e0e0; border-left: 1px solid #e0e0e0;
padding: 0.5rem 1.5rem; padding: 0.5rem 1.5rem;
} }


/* line 144, ../../sass/backend/custom.scss */
/* line 146, ../../sass/backend/custom.scss */
.lc-navbar li label { .lc-navbar li label {
margin-bottom: 0; margin-bottom: 0;
vertical-align: middle; vertical-align: middle;
font-weight: normal !important; font-weight: normal !important;
} }


/* line 146, ../../sass/backend/custom.scss */
/* line 148, ../../sass/backend/custom.scss */
#switch-merchant { #switch-merchant {
min-width: 170px; min-width: 170px;
} }


/* Sortable */ /* Sortable */
/* line 152, ../../sass/backend/custom.scss */
/* line 154, ../../sass/backend/custom.scss */
.ui-sortable-helper { .ui-sortable-helper {
display: table; display: table;
} }


/* line 153, ../../sass/backend/custom.scss */
/* line 155, ../../sass/backend/custom.scss */
.ui-state-highlight { .ui-state-highlight {
background: #eee; background: #eee;
} }


/* line 154, ../../sass/backend/custom.scss */
/* line 156, ../../sass/backend/custom.scss */
.lc-sortable div:last-child { .lc-sortable div:last-child {
display: none; display: none;
} }
.lc-ckfinder-wrap .lc-ckfinder-button{width: 100%; bottom: 0px; left: 0; position: absolute;} .lc-ckfinder-wrap .lc-ckfinder-button{width: 100%; bottom: 0px; left: 0; position: absolute;}
*/ */
/* VUES JS */ /* VUES JS */
/* line 169, ../../sass/backend/custom.scss */
/* line 171, ../../sass/backend/custom.scss */
.nav-item .btn { .nav-item .btn {
padding-right: 15px; padding-right: 15px;
position: relative; position: relative;
} }


/* line 170, ../../sass/backend/custom.scss */
/* line 172, ../../sass/backend/custom.scss */
.nav-item .btn .invalid-form { .nav-item .btn .invalid-form {
display: none; display: none;
position: absolute; position: absolute;
font-size: 1.2rem; font-size: 1.2rem;
} }


/* line 171, ../../sass/backend/custom.scss */
/* line 173, ../../sass/backend/custom.scss */
.nav-item.has-invalid .btn .invalid-form { .nav-item.has-invalid .btn .invalid-form {
display: inline-block; display: inline-block;
z-index: 2; z-index: 2;
} }


/* ProductFamily */ /* ProductFamily */
/* line 176, ../../sass/backend/custom.scss */
/* line 178, ../../sass/backend/custom.scss */
.field-unit-quantity { .field-unit-quantity {
border-bottom: 2px dotted #eee; border-bottom: 2px dotted #eee;
padding-bottom: 10px; padding-bottom: 10px;
margin-bottom: 20px; margin-bottom: 20px;
} }


/* line 177, ../../sass/backend/custom.scss */
/* line 179, ../../sass/backend/custom.scss */
.field-reduction-apply { .field-reduction-apply {
border-top: 2px dotted #eee; border-top: 2px dotted #eee;
padding-top: 10px; padding-top: 10px;
margin-top: 20px; margin-top: 20px;
} }


/* line 179, ../../sass/backend/custom.scss */
/* line 181, ../../sass/backend/custom.scss */
.new-productfamily #nav-params, .new-productfamily #nav-params,
.edit-productfamily #nav-params { .edit-productfamily #nav-params {
margin-bottom: 30px; margin-bottom: 30px;
} }


/* line 184, ../../sass/backend/custom.scss */
/* line 186, ../../sass/backend/custom.scss */
.new-productfamily #nav-params .btn, .new-productfamily #nav-params .btn,
.edit-productfamily #nav-params .btn { .edit-productfamily #nav-params .btn {
margin-left: 20px; margin-left: 20px;
} }


/* line 189, ../../sass/backend/custom.scss */
/* line 191, ../../sass/backend/custom.scss */
.new-productfamily #product-categories .row, .new-productfamily #product-categories .row,
.edit-productfamily #product-categories .row { .edit-productfamily #product-categories .row {
padding: 10px; padding: 10px;
} }


/* line 194, ../../sass/backend/custom.scss */
/* line 196, ../../sass/backend/custom.scss */
.new-productfamily #product-categories .form-group, .new-productfamily #product-categories .form-group,
.edit-productfamily #product-categories .form-group { .edit-productfamily #product-categories .form-group {
width: 100%; width: 100%;
padding: 4px; padding: 4px;
} }


/* line 200, ../../sass/backend/custom.scss */
/* line 202, ../../sass/backend/custom.scss */
.new-productfamily #product-categories .children, .new-productfamily #product-categories .children,
.edit-productfamily #product-categories .children { .edit-productfamily #product-categories .children {
margin-left: 20px; margin-left: 20px;
width: 100%; width: 100%;
} }


/* line 206, ../../sass/backend/custom.scss */
/* line 208, ../../sass/backend/custom.scss */
.new-productfamily ul.products, .new-productfamily ul.products,
.edit-productfamily ul.products { .edit-productfamily ul.products {
padding: 0px; padding: 0px;
list-style-type: none; list-style-type: none;
} }


/* line 212, ../../sass/backend/custom.scss */
/* line 214, ../../sass/backend/custom.scss */
.new-productfamily ul.products li.product, .new-productfamily ul.products li.product,
.edit-productfamily ul.products li.product { .edit-productfamily ul.products li.product {
padding: 0px; padding: 0px;
position: relative; position: relative;
} }


/* line 219, ../../sass/backend/custom.scss */
/* line 221, ../../sass/backend/custom.scss */
.new-productfamily ul.products li.add, .new-productfamily ul.products li.add,
.edit-productfamily ul.products li.add { .edit-productfamily ul.products li.add {
text-align: right; text-align: right;
} }


/* line 224, ../../sass/backend/custom.scss */
/* line 226, ../../sass/backend/custom.scss */
.autoresize textarea { .autoresize textarea {
height: auto; height: auto;
min-height: 38px; min-height: 38px;
} }


/* line 226, ../../sass/backend/custom.scss */
/* line 228, ../../sass/backend/custom.scss */
.field-price .input-group.buyingPrice input, .field-price .input-group.buyingPrice .input-group-text { .field-price .input-group.buyingPrice input, .field-price .input-group.buyingPrice .input-group-text {
font-weight: bold; font-weight: bold;
border-color: #222; border-color: #222;
} }


/* line 227, ../../sass/backend/custom.scss */
/* line 229, ../../sass/backend/custom.scss */
.field-price .input-group.buyingPriceByRefUnit input, .field-price .input-group.buyingPriceByRefUnit .input-group-text { .field-price .input-group.buyingPriceByRefUnit input, .field-price .input-group.buyingPriceByRefUnit .input-group-text {
font-weight: bold; font-weight: bold;
border-color: #222; border-color: #222;
} }


/* line 228, ../../sass/backend/custom.scss */
/* line 230, ../../sass/backend/custom.scss */
.field-price .input-group.priceWithTax input, .field-price .input-group.priceWithTax .input-group-text { .field-price .input-group.priceWithTax input, .field-price .input-group.priceWithTax .input-group-text {
font-weight: bold; font-weight: bold;
border-color: #222; border-color: #222;
} }


/* line 229, ../../sass/backend/custom.scss */
/* line 231, ../../sass/backend/custom.scss */
.field-price .input-group.priceByRefUnitWithTax input, .field-price .input-group.priceByRefUnitWithTax .input-group-text { .field-price .input-group.priceByRefUnitWithTax input, .field-price .input-group.priceByRefUnitWithTax .input-group-text {
font-weight: bold; font-weight: bold;
border-color: #222; border-color: #222;
} }


/* line 230, ../../sass/backend/custom.scss */
/* line 232, ../../sass/backend/custom.scss */
.input-group.multiplyingFactor input, .input-group.multiplyingFactor .input-group-text { .input-group.multiplyingFactor input, .input-group.multiplyingFactor .input-group-text {
font-weight: bold; font-weight: bold;
border-color: #222; border-color: #222;
} }


/* ORDER */ /* ORDER */
/* line 236, ../../sass/backend/custom.scss */
/* line 238, ../../sass/backend/custom.scss */
.table-order-summary { .table-order-summary {
width: 100%; width: 100%;
} }


/* line 239, ../../sass/backend/custom.scss */
/* line 241, ../../sass/backend/custom.scss */
.order-product-item.redelivery { .order-product-item.redelivery {
background: rgba(18, 104, 253, 0.38) !important; background: rgba(18, 104, 253, 0.38) !important;
} }
/*.select2-container--bootstrap .select2-selection{max-width: none;}*/ /*.select2-container--bootstrap .select2-selection{max-width: none;}*/
/*.order-product-item{margin: 15px 0; padding: 0;}*/ /*.order-product-item{margin: 15px 0; padding: 0;}*/
/* Product */ /* Product */
/* line 244, ../../sass/backend/custom.scss */
/* line 246, ../../sass/backend/custom.scss */
.product-form-modal { .product-form-modal {
display: none; display: none;
} }


/* line 245, ../../sass/backend/custom.scss */
/* line 247, ../../sass/backend/custom.scss */
.product-form.modal .form-check-label { .product-form.modal .form-check-label {
font-style: italic; font-style: italic;
color: #666; color: #666;
text-align: left; text-align: left;
} }


/* line 246, ../../sass/backend/custom.scss */
/* line 248, ../../sass/backend/custom.scss */
.products-collection-table .inherited { .products-collection-table .inherited {
color: #888; color: #888;
font-style: italic; font-style: italic;
font-weight: initial; font-weight: initial;
} }


/* line 247, ../../sass/backend/custom.scss */
/* line 249, ../../sass/backend/custom.scss */
.products-collection-table td { .products-collection-table td {
position: relative; position: relative;
} }


/* line 248, ../../sass/backend/custom.scss */
/* line 250, ../../sass/backend/custom.scss */
.card-body.p-0 .products-collection-table tbody > tr > td:first-of-type, .card-body.p-0 .products-collection-table tbody > tr > th:first-of-type, .card-body.p-0 .products-collection-table thead > tr > td:first-of-type, .card-body.p-0 .products-collection-table thead > tr > th:first-of-type { .card-body.p-0 .products-collection-table tbody > tr > td:first-of-type, .card-body.p-0 .products-collection-table tbody > tr > th:first-of-type, .card-body.p-0 .products-collection-table thead > tr > td:first-of-type, .card-body.p-0 .products-collection-table thead > tr > th:first-of-type {
padding-left: 0.35rem; padding-left: 0.35rem;
} }


/* line 249, ../../sass/backend/custom.scss */
/* line 251, ../../sass/backend/custom.scss */
.products-collection-table .btn-empty-field { .products-collection-table .btn-empty-field {
position: absolute; position: absolute;
right: 3px; right: 3px;
padding: 0px; padding: 0px;
} }


/* line 250, ../../sass/backend/custom.scss */
/* line 252, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table { #lc-product-family-edit .products-collection-table {
table-layout: fixed; table-layout: fixed;
/* background-clip: padding-box;*/ /* background-clip: padding-box;*/
border-collapse: collapse; border-collapse: collapse;
} }


/* line 251, ../../sass/backend/custom.scss */
/* line 253, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table th { #lc-product-family-edit .products-collection-table th {
font-size: 13px; font-size: 13px;
border-left: 1px solid #dee2e6; border-left: 1px solid #dee2e6;
border-top: 1px solid #dee2e6; border-top: 1px solid #dee2e6;
text-align: center; text-align: center;
border-bottom: 2px solid #dee2e6; border-bottom: 2px solid #dee2e6;
position: relative;
} }


/* line 252, ../../sass/backend/custom.scss */
/* line 254, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table tfoot th { #lc-product-family-edit .products-collection-table tfoot th {
border-top: 2px solid #dee2e6; border-top: 2px solid #dee2e6;
} }


/* line 253, ../../sass/backend/custom.scss */
/* line 255, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table th span { #lc-product-family-edit .products-collection-table th span {
white-space: initial; white-space: initial;
} }


/* line 254, ../../sass/backend/custom.scss */
/* line 256, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table th:last-child { #lc-product-family-edit .products-collection-table th:last-child {
border-right: 1px solid #dee2e6; border-right: 1px solid #dee2e6;
} }


/* line 255, ../../sass/backend/custom.scss */
/* line 257, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td { #lc-product-family-edit .products-collection-table td {
border-left: 1px solid #dee2e6; border-left: 1px solid #dee2e6;
text-align: center; text-align: center;
border-bottom: 1px solid #dee2e6; border-bottom: 1px solid #dee2e6;
} }


/* line 256, ../../sass/backend/custom.scss */
/* line 258, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td:last-child { #lc-product-family-edit .products-collection-table td:last-child {
border-right: 1px solid #dee2e6; border-right: 1px solid #dee2e6;
white-space: nowrap; white-space: nowrap;
} }


/* line 257, ../../sass/backend/custom.scss */
/* line 259, ../../sass/backend/custom.scss */
#lc-product-family-edit .btn-add-product { #lc-product-family-edit .btn-add-product {
margin: 20px 0; margin: 20px 0;
float: right; float: right;
} }


/* line 258, ../../sass/backend/custom.scss */
/* line 260, ../../sass/backend/custom.scss */
#lc-product-family-edit .inherited { #lc-product-family-edit .inherited {
color: #888; color: #888;
font-style: italic; font-style: italic;
font-weight: initial; font-weight: initial;
} }


/* line 259, ../../sass/backend/custom.scss */
/* line 261, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td .value { #lc-product-family-edit .products-collection-table td .value {
min-width: 80%; min-width: 80%;
margin: auto; margin: auto;
cursor: pointer; cursor: pointer;
} }


/* line 260, ../../sass/backend/custom.scss */
/* line 262, ../../sass/backend/custom.scss */
#lc-product-family-edit .products-collection-table td .modal { #lc-product-family-edit .products-collection-table td .modal {
text-align: left; text-align: left;
} }


/* line 261, ../../sass/backend/custom.scss */
/* line 263, ../../sass/backend/custom.scss */
table.products-collection-table th.main-info, td.buyingPrice, td.multiplyingFactor, td.priceWithTax { table.products-collection-table th.main-info, td.buyingPrice, td.multiplyingFactor, td.priceWithTax {
background: #eeeeee; background: #eeeeee;
background-clip: padding-box; background-clip: padding-box;
text-decoration: underline; text-decoration: underline;
} }


/* line 263, ../../sass/backend/custom.scss */
/* line 265, ../../sass/backend/custom.scss */
table.products-collection-table tr.disabled { table.products-collection-table tr.disabled {
opacity: 0.5; opacity: 0.5;
} }


/* line 264, ../../sass/backend/custom.scss */
/* line 266, ../../sass/backend/custom.scss */
.table-striped tbody .tr-sep { .table-striped tbody .tr-sep {
border-top: 2px solid #888; border-top: 2px solid #888;
} }


/* DeliveryZone */ /* DeliveryZone */
/* line 268, ../../sass/backend/custom.scss */
/* line 270, ../../sass/backend/custom.scss */
#autocomplete-cities { #autocomplete-cities {
position: relative; position: relative;
} }


/* line 272, ../../sass/backend/custom.scss */
/* line 274, ../../sass/backend/custom.scss */
#autocomplete-cities .ui-autocomplete { #autocomplete-cities .ui-autocomplete {
left: 30%; left: 30%;
top: 41px; top: 41px;
margin-left: 18px; margin-left: 18px;
} }


/* line 278, ../../sass/backend/custom.scss */
/* line 280, ../../sass/backend/custom.scss */
.head-reminders { .head-reminders {
margin-top: 15px; margin-top: 15px;
} }


/* TABLEAU DE BORD */ /* TABLEAU DE BORD */
/* line 281, ../../sass/backend/custom.scss */
/* line 283, ../../sass/backend/custom.scss */
.todo-list > li { .todo-list > li {
position: relative; position: relative;
} }


/* line 282, ../../sass/backend/custom.scss */
/* line 284, ../../sass/backend/custom.scss */
.todo-list > li .text { .todo-list > li .text {
margin-left: 30px; margin-left: 30px;
} }


/* line 283, ../../sass/backend/custom.scss */
/* line 285, ../../sass/backend/custom.scss */
.todo-list > li .tools { .todo-list > li .tools {
position: absolute; position: absolute;
top: 4px; top: 4px;
right: 15px; right: 15px;
} }


/* line 285, ../../sass/backend/custom.scss */
/* line 287, ../../sass/backend/custom.scss */
#addTicketMessageForm { #addTicketMessageForm {
margin-top: 30px; margin-top: 30px;
border-top: 2px dotted #eee; border-top: 2px dotted #eee;
padding-top: 30px; padding-top: 30px;
} }


/* line 287, ../../sass/backend/custom.scss */
/* line 289, ../../sass/backend/custom.scss */
#dashboard .list-btn-statistic { #dashboard .list-btn-statistic {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: center; justify-content: center;
} }


/* line 288, ../../sass/backend/custom.scss */
/* line 290, ../../sass/backend/custom.scss */
#dashboard .btn-statistic { #dashboard .btn-statistic {
width: 120px; width: 120px;
height: 70px; height: 70px;
line-height: 1rem; line-height: 1rem;
} }


/* line 289, ../../sass/backend/custom.scss */
/* line 291, ../../sass/backend/custom.scss */
#dashboard .btn-statistic small { #dashboard .btn-statistic small {
margin-bottom: 10px; margin-bottom: 10px;
display: block; display: block;
} }


/* line 290, ../../sass/backend/custom.scss */
/* line 292, ../../sass/backend/custom.scss */
#dashboard .btn-statistic .value { #dashboard .btn-statistic .value {
display: block; display: block;
} }


/* Tickets */
/* line 294, ../../sass/backend/custom.scss */
#dashboard #range_date_interval {
margin-bottom: 20px;
}

/* line 295, ../../sass/backend/custom.scss */
#dashboard #range_date_interval label {
float: left;
margin-right: 20px;
}

/* line 296, ../../sass/backend/custom.scss */ /* line 296, ../../sass/backend/custom.scss */
#dashboard #range_date_interval .form-check {
float: left;
margin-right: 10px;
}

/* line 297, ../../sass/backend/custom.scss */
#dashboard .table-condensed .btn, #dashboard .table-condensed .btn-sm {
white-space: nowrap;
}

/* Tickets */
/* line 303, ../../sass/backend/custom.scss */
#ticket-list .btn-sm { #ticket-list .btn-sm {
display: block; display: block;
} }

/* line 309, ../../sass/backend/custom.scss */
#toast-container {
width: 350px;
}

/* line 310, ../../sass/backend/custom.scss */
.toast {
float: right;
}

/* line 312, ../../sass/backend/custom.scss */
#toast-container:before:hover {
opacity: 1;
cursor: pointer;
}

/* line 316, ../../sass/backend/custom.scss */
#toast-close-all {
border: 0;
position: absolute;
pointer-events: auto;
z-index: 999999999999999999999;
background: #BD362F;
border-radius: 3px;
color: #fff;
opacity: 0.8;
top: 2px;
width: 50px;
height: 50px;
font-size: 30px;
left: 0px;
text-align: center;
-webkit-text-shadow: 0 1px 0 #fff;
text-shadow: 0 1px 0 #fff;
-moz-box-shadow: 0 0 12px #999;
-webkit-box-shadow: 0 0 12px #999;
box-shadow: 0 0 12px #999;
}

+ 20
- 2
ShopBundle/Resources/public/js/backend/script/default/utils.js View File





function setFlashMessages(flashMessages){ function setFlashMessages(flashMessages){
var currentFlash =new Array();
for (var type in flashMessages) { for (var type in flashMessages) {
for (var key in flashMessages[type]) { for (var key in flashMessages[type]) {
generateNotice(type, flashMessages[type][key]);
if(!currentFlash.includes(flashMessages[type][key])) {
currentFlash.push(flashMessages[type][key]);
generateNotice(type, flashMessages[type][key]);
}
} }
} }
} }


function generateNotice(type, text) { function generateNotice(type, text) {
toastr.options.timeOut = 30000;

toastr.options.timeOut = 3000;
toastr.options.onHidden = function() {
if($('#toast-container .toast').length==0)$('#toast-close-all').remove();
};
//toastr.options.preventDuplicates = true;
toastr[type](text); toastr[type](text);


if($('#toast-close-all').length==0) {
$('#toast-container').prepend('<button id="toast-close-all"><i class="fa fa-times"></i></button>');
}
$('#toast-close-all').off('click');
$('#toast-close-all').on('click', function (){
toastr.remove();
if($('#toast-container .toast').length==0)$('#toast-close-all').remove();
});

/*var n = noty({ /*var n = noty({
text: text, text: text,
type: type, type: type,

+ 0
- 1
ShopBundle/Resources/public/js/backend/script/default/vuejs-mixins.js View File

if (this.behaviorPriceValue == 'by-piece') { if (this.behaviorPriceValue == 'by-piece') {
this.setBuyingPriceByRefUnit(); this.setBuyingPriceByRefUnit();
this.setBuyingPriceByRefUnitWithTax(); this.setBuyingPriceByRefUnitWithTax();
log('ncihe');
this.setPriceByRefUnit(); this.setPriceByRefUnit();
this.setPriceByRefUnitWithTax(); this.setPriceByRefUnitWithTax();
} else if (this.behaviorPriceValue == 'by-reference-unit') { } else if (this.behaviorPriceValue == 'by-reference-unit') {

+ 3
- 2
ShopBundle/Resources/public/js/backend/script/merchant/vuejs-merchant.js View File

{ {
addressType: null, addressType: null,
currentSection:'general', currentSection:'general',
isOpenFullTime: false,
sectionsArray: [ sectionsArray: [
{ {
name: 'general', name: 'general',
nameDisplay: 'Catalogue'
nameDisplay: 'Général'
}, },
{ {
name: 'product', name: 'product',
nameDisplay: 'Maintenance' nameDisplay: 'Maintenance'
} }
] ]
}, window.addressValues);
}, window.addressValues, window.merchantPanelOrderValues);
}, },
mounted: function () {}, mounted: function () {},
methods: { methods: {

+ 19
- 12
ShopBundle/Resources/public/js/backend/script/productfamily/vuejs-product-family.js View File

availableQuantityInherited: false, availableQuantityInherited: false,
availableQuantityDefaultInherited: false, availableQuantityDefaultInherited: false,
propertyExpirationDateInherited: false propertyExpirationDateInherited: false

}, window.productForm[this.keyForm]) }, window.productForm[this.keyForm])
}, },
mounted: function () { mounted: function () {


this.$nextTick(function () { this.$nextTick(function () {


log(this.status);
if (this.status == 0) { if (this.status == 0) {
$(this.$el).addClass('disabled'); $(this.$el).addClass('disabled');
} }
}, },
availableQuantityDefaultUpdated: function () { availableQuantityDefaultUpdated: function () {
}, },
propertyExpirationDateUpdated: function () {
},
propertyExpirationDateUpdated: function () {},
setFocusOnField: function (field, y) { setFocusOnField: function (field, y) {
this[field] = true; this[field] = true;
this.$nextTick(function () { this.$nextTick(function () {
if (field == 'unitInherited') { if (field == 'unitInherited') {
$('select[data-ref="' + field + '"]').eq(y).focus(); $('select[data-ref="' + field + '"]').eq(y).focus();
} else { } else {
$('input[data-ref="' + field + '"]').eq(y).focus();
log('blop');
$('input[data-ref="' + field + '"]').eq(y).focus().select();
} }
}); });


var app = this; var app = this;
$(this.$el).find('input, select').off('keydown'); $(this.$el).find('input, select').off('keydown');
$(this.$el).find('input, select').on('keydown', function (e) { $(this.$el).find('input, select').on('keydown', function (e) {
if (e.keyCode == 13 || e.keyCode == 9) e.preventDefault();
if (e.keyCode == 13 || e.keyCode == 9 || e.keyCode ==40 || e.keyCode==38) e.preventDefault();


//ENTRER //ENTRER
if (e.keyCode == 13) { if (e.keyCode == 13) {
if (e.shiftKey && e.keyCode == 9) { if (e.shiftKey && e.keyCode == 9) {
e.preventDefault(); e.preventDefault();
$prevField = $(this).parents('td').prevAll('td:visible').first().find('input, select'); $prevField = $(this).parents('td').prevAll('td:visible').first().find('input, select');
log($prevField);
if($prevField.length == 0){ if($prevField.length == 0){
$prevField = $(this).parents('td').prevAll('td:visible').first().prevAll('td:visible').first().find('input, select'); $prevField = $(this).parents('td').prevAll('td:visible').first().prevAll('td:visible').first().find('input, select');


'supplierTaxRateValue': this.$refs.productUnitPrice.supplierTaxRateValue, 'supplierTaxRateValue': this.$refs.productUnitPrice.supplierTaxRateValue,
'marginProfit': this.$refs.productUnitPrice.marginProfit, 'marginProfit': this.$refs.productUnitPrice.marginProfit,
'marginProfitPercent': this.$refs.productUnitPrice.marginProfitPercent, 'marginProfitPercent': this.$refs.productUnitPrice.marginProfitPercent,
'productsQuantityAsTitle': this.productsQuantityAsTitle,
/*'taxRate': this.$refs.productUnitPrice.taxRate, /*'taxRate': this.$refs.productUnitPrice.taxRate,
'supplierTaxRate': this.$refs.productUnitPrice.supplierTaxRate, 'supplierTaxRate': this.$refs.productUnitPrice.supplierTaxRate,
*/ */
'reductionActive': this.reductionActive, 'reductionActive': this.reductionActive,
'reductionUnit': this.reductionUnit, 'reductionUnit': this.reductionUnit,
'reductionValue': this.reductionValue, 'reductionValue': this.reductionValue,
'reductionBehaviorTaxRate': this.reductionBehaviorTaxRate
'reductionBehaviorTaxRate': this.reductionBehaviorTaxRate,
'giftVoucherActive': this.giftVoucherActive
}; };
} else { } else {
return { return {
'supplierTaxRate': null, 'supplierTaxRate': null,
'multiplyingFactor': null, 'multiplyingFactor': null,
'taxRateValue': null, 'taxRateValue': null,
'productsQuantityAsTitle': null,
'propertyExpirationDate': this.propertyExpirationDate, 'propertyExpirationDate': this.propertyExpirationDate,
'behaviorExpirationDate': this.behaviorExpirationDate
'behaviorExpirationDate': this.behaviorExpirationDate,
'giftVoucherActive': this.giftVoucherActive
}; };
} }
}, },
propertyNoveltyExpirationDateActive: false, propertyNoveltyExpirationDateActive: false,
propertyNoveltyExpirationDate:null, propertyNoveltyExpirationDate:null,
activeProducts: false, activeProducts: false,

giftVoucherActive: false,
productsQuantityAsTitle: false,
formProducts: {}, formProducts: {},
currentSection: 'general', currentSection: 'general',
sectionsArray: [ sectionsArray: [
} }
} }
}, },
emptyProductsField: function (fieldName){
if (confirm('Êtes-vous sur de cette action ?')) {
for (i = 0; i < this.$refs.productForm.length; i++) {
this.$refs.productForm[i][fieldName] = null;
}
}
},
getUnitReference: function () { getUnitReference: function () {
if (typeof this.$refs.productUnitPrice !== 'undefined') { if (typeof this.$refs.productUnitPrice !== 'undefined') {
return this.$refs.productUnitPrice.unitReference; return this.$refs.productUnitPrice.unitReference;

+ 39
- 2
ShopBundle/Resources/public/sass/backend/custom.scss View File

.main-sidebar .sidebar{padding-left: 0px; padding-right: 0px; padding-top: 114px;} .main-sidebar .sidebar{padding-left: 0px; padding-right: 0px; padding-top: 114px;}
.main-sidebar .nav-link{padding: .4rem .5rem .4rem .7rem;} .main-sidebar .nav-link{padding: .4rem .5rem .4rem .7rem;}


body#pdl-body .wrapper .main-sidebar{bottom: 0; float: none; height: 100vh; left: 0; position: fixed; top: 0;}
body#pdl-body .wrapper .main-sidebar{bottom: 0; float: none; height: 110vh; left: 0; position: fixed; top: 0;}
body#pdl-body .wrapper .sidebar{height: 100%;}
body#pdl-body .wrapper .sidebar nav{padding-bottom: 40px;}
body#pdl-body .wrapper .content-wrapper{margin-top: 0; padding-top: 57px;} body#pdl-body .wrapper .content-wrapper{margin-top: 0; padding-top: 57px;}
.sidebar{overflow-y: auto;} .sidebar{overflow-y: auto;}


.card-body.p-0 .products-collection-table tbody > tr > td:first-of-type, .card-body.p-0 .products-collection-table tbody > tr > th:first-of-type, .card-body.p-0 .products-collection-table thead > tr > td:first-of-type, .card-body.p-0 .products-collection-table thead > tr > th:first-of-type{padding-left: 0.35rem;} .card-body.p-0 .products-collection-table tbody > tr > td:first-of-type, .card-body.p-0 .products-collection-table tbody > tr > th:first-of-type, .card-body.p-0 .products-collection-table thead > tr > td:first-of-type, .card-body.p-0 .products-collection-table thead > tr > th:first-of-type{padding-left: 0.35rem;}
.products-collection-table .btn-empty-field{position: absolute; right: 3px; font-size: 0.7rem; top: 5px; padding: 0px;} .products-collection-table .btn-empty-field{position: absolute; right: 3px; font-size: 0.7rem; top: 5px; padding: 0px;}
#lc-product-family-edit .products-collection-table {table-layout:fixed;/* background-clip: padding-box;*/ border-collapse: collapse;} #lc-product-family-edit .products-collection-table {table-layout:fixed;/* background-clip: padding-box;*/ border-collapse: collapse;}
#lc-product-family-edit .products-collection-table th{font-size:13px; border-left: 1px solid #dee2e6; border-top: 1px solid #dee2e6; text-align: center; border-bottom: 2px solid #dee2e6;}
#lc-product-family-edit .products-collection-table th{font-size:13px; border-left: 1px solid #dee2e6; border-top: 1px solid #dee2e6; text-align: center; border-bottom: 2px solid #dee2e6; position: relative;}
#lc-product-family-edit .products-collection-table tfoot th{border-top: 2px solid #dee2e6;} #lc-product-family-edit .products-collection-table tfoot th{border-top: 2px solid #dee2e6;}
#lc-product-family-edit .products-collection-table th span {white-space: initial;} #lc-product-family-edit .products-collection-table th span {white-space: initial;}
#lc-product-family-edit .products-collection-table th:last-child{border-right: 1px solid #dee2e6;} #lc-product-family-edit .products-collection-table th:last-child{border-right: 1px solid #dee2e6;}
#dashboard .btn-statistic small{margin-bottom: 10px; display: block;} #dashboard .btn-statistic small{margin-bottom: 10px; display: block;}
#dashboard .btn-statistic .value{display: block;} #dashboard .btn-statistic .value{display: block;}


#dashboard #range_date_interval {margin-bottom: 20px;}
#dashboard #range_date_interval label{float: left; margin-right: 20px;}
#dashboard #range_date_interval .form-check{float: left; margin-right: 10px;}
#dashboard .table-condensed .btn, #dashboard .table-condensed .btn-sm{white-space: nowrap;}



/* Tickets */ /* Tickets */


display: block ; display: block ;
} }
} }


#toast-container { width: 350px;}
.toast{float: right}

#toast-container:before:hover {
opacity:1;
cursor:pointer;
}
#toast-close-all {
border:0;
position: absolute;
pointer-events: auto;
z-index: 999999999999999999999;
background: #BD362F;
border-radius: 3px;
color:#fff;
opacity:0.8;
top: 2px;
width: 50px;
height: 50px;
font-size: 30px;
left: 0px;
text-align: center;
-webkit-text-shadow: 0 1px 0 #fff;
text-shadow: 0 1px 0 #fff;
-moz-box-shadow: 0 0 12px #999;
-webkit-box-shadow: 0 0 12px #999;
box-shadow: 0 0 12px #999;
}

+ 34
- 4
ShopBundle/Resources/translations/lcshop.fr.yaml View File

nbResultsFiltered: Total d'élements filtrés nbResultsFiltered: Total d'élements filtrés
nbResultsOnline: Total d'élements en ligne nbResultsOnline: Total d'élements en ligne
nbResultsOffline: Total d'élements hors ligne nbResultsOffline: Total d'élements hors ligne
nbResultsDeleted: Total d'élements supprimé
nbResultsDeleted: Total d'élements supprimés
nbResultsOnSale: Total de produits en vente
nbProductFamilyOnline: Total de produits visibles
listChildren: Afficher les enfants listChildren: Afficher les enfants
edit: Éditer edit: Éditer
delete: Supprimer delete: Supprimer
send: Envoyer send: Envoyer
duplicate: Dupliquer duplicate: Dupliquer
duplicateOtherHub: Dupliquer sur un autre hub
duplicateOtherHub: Dupliquer sur %title%
sortProductFamily: Trier les produits de cette catégorie sortProductFamily: Trier les produits de cette catégorie
group: group:
main: Général main: Général
deliveryAddress: Adresse de livraison deliveryAddress: Adresse de livraison
complementary: Commandes complémentaires complementary: Commandes complémentaires
tickets: Tickets relatif à la commande tickets: Tickets relatif à la commande
orderStatusHistories: Historique de changement de statut
waitingBankReturn: Commandes en attente de retour banque
Ticket: Ticket:
listMessages: Liste des messages listMessages: Liste des messages
list: Tickets ouverts list: Tickets ouverts
listLast: Derniers tickets ouverts
PointSale: PointSale:
main: Général main: Général
Merchant: Merchant:
email: Email email: Email
delivery: Livraison delivery: Livraison
maintenance: Maintenance maintenance: Maintenance
Address:
listLoopBesancon: Adresses de Besançon à spécifier (lat / long)




None: Aucune valeur None: Aucune valeur
common: common:
fieldChange: Le champ a bien été modifié fieldChange: Le champ a bien été modifié
productFamily: productFamily:
editStock: Le stock a bien été modifié
editStock: "Stocks renouveler pour : %count% produits"
error: error:
form: form:
submitted: Une erreur est survenue à la soumission du formulaire submitted: Une erreur est survenue à la soumission du formulaire
notAdded: Le crédit n'a pas été ajouté notAdded: Le crédit n'a pas été ajouté
productFamily: productFamily:
editStock: Le stock n'a pas été modifié, une erreur est survenue editStock: Le stock n'a pas été modifié, une erreur est survenue
editStockNoQuantityDefault: "Le stock n'a pas été modifié pour le produit #%id% (Aucune quantité par défaut)"
field: field:
default: default:
placeholder: Choisissez une option placeholder: Choisissez une option
deliveryAvailabilty: Créneau de livraison deliveryAvailabilty: Créneau de livraison
id: Id id: Id
status: Statut status: Statut
saleStatus: En vente sur le site
statusOptions: statusOptions:
offline: <span class="badge badge-danger">Hors ligne</span> offline: <span class="badge badge-danger">Hors ligne</span>
online: <span class="badge badge-success">En ligne</span> online: <span class="badge badge-success">En ligne</span>
success: Succès (vert) success: Succès (vert)
warningMessage: Contenu du message d'avertissement warningMessage: Contenu du message d'avertissement
newsletters: Newsletters newsletters: Newsletters
deliveryDepositoryOnly: Retrait au dépot uniquement
isPublic: Publique isPublic: Publique
isDepository: Dépôt isDepository: Dépôt
productCategories: Catégories productCategories: Catégories
users: Utilisateurs users: Utilisateurs
total: Total total: Total
products: Produits products: Produits
purchaseOrderEmailContent: "Contenu par défaut de l'email envoyé aux producteurs"
dateStart: Date de début
dateEnd: Date de fin


PointSale: PointSale:
code: Code code: Code
propertyAlcoholLevel: Degré d'alcool propertyAlcoholLevel: Degré d'alcool
displayPriceUnitRef: Afficher le prix par unité de référence displayPriceUnitRef: Afficher le prix par unité de référence
behaviorPrice: Travailler avec des tarifs behaviorPrice: Travailler avec des tarifs
productsQuantityAsTitle: Titre équivalent à quantité
behaviorPriceOptions: behaviorPriceOptions:
by-piece: À la pièce by-piece: À la pièce
by-reference-unit: Par unité de référence by-reference-unit: Par unité de référence
value: Montant ou valeur value: Montant ou valeur
permanent: Réduction permanante permanent: Réduction permanante
dateRange: Date de but et date de fin dateRange: Date de but et date de fin
ReductionCredit:
type:
gift: Bon cadeau
credit: Avoir
ReductionCart: ReductionCart:
type: Type de réduction type: Type de réduction
typeOptions: typeOptions:
unit: Unité unit: Unité
Address: Address:
city: Commune city: Commune
statusOptions:
offline: Désactiver
online: Activer
typeOptions: typeOptions:
individual: Particulier individual: Particulier
legal-person: Professionnel legal-person: Professionnel
quantityProduct: Quantité (en rapport à l'unité) quantityProduct: Quantité (en rapport à l'unité)
unit: Unité unit: Unité
OrderShop: OrderShop:
hasReach: Étape atteinte
deliveryTrucks: Véhicules de livraison deliveryTrucks: Véhicules de livraison
createdAt: Date de création createdAt: Date de création
updatedAt: Date de modification updatedAt: Date de modification
product-unavailable: Produit manquant product-unavailable: Produit manquant
product-error: Erreur sur un produit product-error: Erreur sur un produit
technical-problem: Problème techique technical-problem: Problème techique
poultry-booking: Réservation volaille
statusOptions: statusOptions:
open: Ouvert open: Ouvert
being-processed: En cours de traitement being-processed: En cours de traitement
quotation: Devis quotation: Devis
purchase-order: Bon de commande purchase-order: Bon de commande
delivery-note: Bon de livraison delivery-note: Bon de livraison

Statistic:
interval: Affichage des résultats
intervalOptions:
days: Par jour
week: Par semaine
month: Par mois


action: action:
apply: Appliquer apply: Appliquer
form.empty_value: Aucun(e) form.empty_value: Aucun(e)
add: Ajouter add: Ajouter
valid: Valider valid: Valider
close: Fermer
history: Historique
product: product:
editStock: Gérer les stocks editStock: Gérer les stocks
editProductFamily: Éditer le produit editProductFamily: Éditer le produit

+ 9
- 2
ShopBundle/Resources/views/backend/default/block/action.html.twig View File


{% set title = "" %}
{% if merchant is defined %}
{% set title = merchant.title %}
{% endif %}
{% if is_dropdown %} {% if is_dropdown %}

<a class="btn dropdown-item {{ action.css_class|default('btn-default') }}" <a class="btn dropdown-item {{ action.css_class|default('btn-default') }}"
href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}"> href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%} {%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}
{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id, '%title%': title }), domain = translation_domain) }}
</a> </a>

{% else %} {% else %}
{% if action.hub is defined %} {% if action.hub is defined %}
{% set trad = action.label~action.hub|uc_first %} {% set trad = action.label~action.hub|uc_first %}
{% endif %} {% endif %}
<a class="btn {{ is_dropdown|default(false) ? 'dropdown-item' }} {{ action.css_class|default('btn-default') }}" <a class="btn {{ is_dropdown|default(false) ? 'dropdown-item' }} {{ action.css_class|default('btn-default') }}"
data-toggle="tooltip" data-toggle="tooltip"
title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}"
title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id, '%title%': title }), domain = translation_domain) }}"
href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}"> href="{{ action_href }}{{ action.hub is defined ? '&hub='~action.hub : '' }}" target="{{ action.target }}">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%} {%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
</a> </a>

+ 0
- 1
ShopBundle/Resources/views/backend/default/block/actions.html.twig View File

{% set dropdownAction ={} %} {% set dropdownAction ={} %}
{% for action in actions %} {% for action in actions %}



{% if action.group is defined and action.group==true %} {% if action.group is defined and action.group==true %}
{% set dropdownAction = dropdownAction|merge({(loop.index0): action}) %} {% set dropdownAction = dropdownAction|merge({(loop.index0): action}) %}
{% else %} {% else %}

+ 1
- 0
ShopBundle/Resources/views/backend/default/block/flash_messages.html.twig View File

{% endif %} {% endif %}
{% if _flash_messages|length > 0 %} {% if _flash_messages|length > 0 %}
<div id="lc-flash-messages"> <div id="lc-flash-messages">

{% for label, messages in _flash_messages %} {% for label, messages in _flash_messages %}
{% if label != 'alert' %} {% if label != 'alert' %}
{% for message in messages %} {% for message in messages %}

+ 11
- 0
ShopBundle/Resources/views/backend/default/block/form_address.html.twig View File

<div class="col-12"> <div class="col-12">
{{ form_row(form.deliveryInfos) }} {{ form_row(form.deliveryInfos) }}
</div> </div>

<div class="col-12 {{ merchantUtils.getMerchantCurrent().isHubBesancon() ? '': 'hidden'}}">
{{ form_row(form.inBesanconLoop) }}
</div>

<div class="col-6"> <div class="col-6">
{{ form_row(form.latitude) }} {{ form_row(form.latitude) }}
</div> </div>
<div class="col-6"> <div class="col-6">
{{ form_row(form.longitudeOverride) }} {{ form_row(form.longitudeOverride) }}
</div> </div>
<div class="col-12">
{{ form_row(form.status) }}
<p class="callout callout-info">
Sauf si vous savez ce que ce vous faites ce champ doit toujours être "Activer"
</p>
</div>


{{ form_row(form.country) }} {{ form_row(form.country) }}



+ 22
- 0
ShopBundle/Resources/views/backend/default/block/list_addressloopinbesancon.html.twig View File

<table class="table table-condensed" id="address-list">
<thead>
<tr>
<th>Adresse</th>
<th></th>
</tr>
</thead>
<tbody>
{% for address in addressesLoopBesancon %}
<tr>
<td>{{ address }}</td>
<td><a class="btn-sm btn-success"
href="{{ path('easyadmin', {id: address.user.id, entity: 'User', action: 'show'}) }}">
<i class="fas fa-eye"></i>
</a></td>
</tr>
{% else %}
<tr>
<td colspan="2"><i>Aucune adresse pour le moment</i></td>
{% endfor %}
</tbody>
</table>

+ 27
- 0
ShopBundle/Resources/views/backend/default/block/list_orderswaitingbankreturn.html.twig View File

<table class="table table-condensed" id="address-list">
<thead>
<tr>
<th>Id</th>
<th>Utilisateurs</th>
<th>Date</th>
<th></th>
</tr>
</thead>
<tbody>
{% for order in ordersWaitingBankReturn %}
<tr>
<td>{{ order.id }}</td>
<td>{{ order.user }}</td>
<td>{{ order.updatedAt|date('d-m H:i') }}</td>
<td><a class="btn-sm btn-success"
href="{{ path('easyadmin', {id: order.id, entity: 'OrderShop', action: 'show'}) }}">
<i class="fas fa-eye"></i>
</a></td>
</tr>
{% else %}
<tr>
<td colspan="4"><i>Aucune commande pour le moment</i></td>
{% endfor %}
</tbody>
</table>


+ 1
- 1
ShopBundle/Resources/views/backend/default/edit.html.twig View File



{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-edit.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-edit.js')|lc_cache }}"></script>
{% endblock %} {% endblock %}

+ 25
- 20
ShopBundle/Resources/views/backend/default/layout/layout.html.twig View File

href="{{ asset('bundles/lcshop/css/backend/adminlte/plugins/select2/select2-bootstrap.min.css') }}"> href="{{ asset('bundles/lcshop/css/backend/adminlte/plugins/select2/select2-bootstrap.min.css') }}">
<link rel="stylesheet" <link rel="stylesheet"
href="{{ asset('bundles/lcshop/css/backend/adminlte/plugins/bootstrap/bootstrap-switch.min.css') }}"> href="{{ asset('bundles/lcshop/css/backend/adminlte/plugins/bootstrap/bootstrap-switch.min.css') }}">

<!-- Theme style --> <!-- Theme style -->
<link rel="stylesheet" href="{{ asset('bundles/lcshop/css/backend/adminlte/plugins/toastr/toastr.min.css') }}"> <link rel="stylesheet" href="{{ asset('bundles/lcshop/css/backend/adminlte/plugins/toastr/toastr.min.css') }}">
<link rel="stylesheet" href="{{ asset('bundles/lcshop/css/backend/adminlte/adminlte.css') }}"> <link rel="stylesheet" href="{{ asset('bundles/lcshop/css/backend/adminlte/adminlte.css') }}">
<!-- Google Font: Source Sans Pro --> <!-- Google Font: Source Sans Pro -->
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet"> <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">


{#<link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.css') }}">#}
{# <link rel="stylesheet" href="{{ asset('bundles/easyadmin/app.css') }}"> #}
{% endblock %} {% endblock %}


{% block head_custom_stylesheets %} {% block head_custom_stylesheets %}
<link rel="stylesheet" href="{{ asset('bundles/lcshop/css/backend/custom.css') }}">
<link rel="stylesheet" href="{{ asset('bundles/lcshop/css/backend/custom.css')|lc_cache }}">
{% for asset_css in easyadmin_config('design.assets.css') %} {% for asset_css in easyadmin_config('design.assets.css') %}
<link rel="stylesheet" href="{{ asset(asset_css) }}">
<link rel="stylesheet" href="{{ asset(asset_css)|lc_cache }}">
{% endfor %} {% endfor %}
{% endblock head_custom_stylesheets %} {% endblock head_custom_stylesheets %}


{# {#
{% if easyadmin_config('design.brand_color') != 'hsl(230, 55%, 60%)' %}
<style>
:root { --color-primary: {{ easyadmin_config('design.brand_color') }}; }
</style>
{% endif %}
{% if easyadmin_config('design.brand_color') != 'hsl(230, 55%, 60%)' %}
<style>
:root { --color-primary: {{ easyadmin_config('design.brand_color') }}; }
</style>
{% endif %}
#} #}


{% block head_favicon %} {% block head_favicon %}
</head> </head>


{% block body %} {% block body %}
<body id="pdl-body" class="{% block body_class %}sidebar-mini layout-navbar-fixed{% endblock %} {% block body_class_extend %}{% endblock %}">
<body id="pdl-body"
class="{% block body_class %}sidebar-mini layout-navbar-fixed{% endblock %} {% block body_class_extend %}{% endblock %}">
{# <script> {# <script>
document.body.classList.add( document.body.classList.add(
'easyadmin-content-width-' + (localStorage.getItem('easyadmin/content/width') || 'normal'), 'easyadmin-content-width-' + (localStorage.getItem('easyadmin/content/width') || 'normal'),
'easyadmin-sidebar-width-' + (localStorage.getItem('easyadmin/sidebar/width') || 'normal') 'easyadmin-sidebar-width-' + (localStorage.getItem('easyadmin/sidebar/width') || 'normal')
); );
</script>#}
</script> #}


{% block wrapper_wrapper %} {% block wrapper_wrapper %}
<div class="wrapper"> <div class="wrapper">
{% endif %} {% endif %}
</li> </li>
<li> <li>
<a target="_blank" class="btn btn-outline-success"
href="{{ merchantUtils.getMerchantUser.getMerchantConfig('url') }}">Afficher le
site</a>
{% if 'localhost' in app.request.getSchemeAndHttpHost() %}
<a target="_blank" class="btn btn-outline-success"
href="{{ app.request.getSchemeAndHttpHost() }}">Afficher le site</a>
{% else %}
<a target="_blank" class="btn btn-outline-success"
href="{{ merchantUtils.getMerchantUser.getMerchantConfig('url') }}">Afficher le
site</a>
{% endif %}
</li> </li>
</ul> </ul>
{% endblock navbar %} {% endblock navbar %}
{% block global_actions_wrapper %} {% block global_actions_wrapper %}
<div class="global-actions"> <div class="global-actions">
{% block global_actions %}{% endblock %} {% block global_actions %}{% endblock %}
{#{{ dump(_request_parameters) }}#}
{# {{ dump(_request_parameters) }} #}
<button type="button" class="btn-sm btn-primary btn-add-reminder " <button type="button" class="btn-sm btn-primary btn-add-reminder "
data-url="{{ path('easyadmin', { action: 'new', entity: 'Reminder' }) }}"> data-url="{{ path('easyadmin', { action: 'new', entity: 'Reminder' }) }}">
+ Ajouter pense bête + Ajouter pense bête
</div> </div>


{% block content_reminders %} {% block content_reminders %}
{% if reminders|length >0 %}
{% if reminders is defined and reminders|length >0 %}
<div class="head-reminders card card-outline card-danger"> <div class="head-reminders card card-outline card-danger">
{% include '@LcShop/backend/default/block/list_reminders.html.twig' %} {% include '@LcShop/backend/default/block/list_reminders.html.twig' %}
</div> </div>
{% endblock wrapper_wrapper %} {% endblock wrapper_wrapper %}




{#Initilisation des varibles requis dans le JS #}
{# Initilisation des varibles requis dans le JS #}
<script> <script>
const DOMAIN = "{{ app.request.getSchemeAndHttpHost() }}"; const DOMAIN = "{{ app.request.getSchemeAndHttpHost() }}";
</script> </script>
<!-- Bootstrap 4 --> <!-- Bootstrap 4 -->
<script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap/bootstrap.bundle.min.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap/bootstrap.bundle.min.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/plugin/toastr/toastr.min.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/toastr/toastr.min.js') }}"></script>
{#<script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.min.js') }}"></script>#}
{# <script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.min.js') }}"></script> #}
<script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.full.min.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/select2/select2.full.min.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap/bootstrap-switch.min.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/bootstrap/bootstrap-switch.min.js') }}"></script>
<!-- AdminLTE App --> <!-- AdminLTE App -->
<script src="{{ asset('bundles/lcshop/js/backend/plugin/adminlte.min.js') }}"></script> <script src="{{ asset('bundles/lcshop/js/backend/plugin/adminlte.min.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/default/utils.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/default/utils.js')|lc_cache }}"></script>
{% endblock plugin_javascript %} {% endblock plugin_javascript %}


{% block script_javascript %} {% block script_javascript %}
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-common.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-common.js')|lc_cache }}"></script>
{% endblock script_javascript %} {% endblock script_javascript %}


{% block add_script_javascript %}{% endblock add_script_javascript %} {% block add_script_javascript %}{% endblock add_script_javascript %}

+ 1
- 1
ShopBundle/Resources/views/backend/default/list-datatable.html.twig View File



{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-list-datatable.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-list-datatable.js')|lc_cache }}"></script>
{% endblock %} {% endblock %}

+ 2
- 2
ShopBundle/Resources/views/backend/default/list-fields/field_datetime.html.twig View File

{#{{ value|date('U')}}#}
{# {{ value|date('U')}} #}


{% if field_options.format == "d/m/Y h:i A e" %}
{% if field_options.format == "d/m/Y h:i A e" or field_options.format == null %}
{% set format = "d/m/Y H:i" %} {% set format = "d/m/Y H:i" %}
{% else %} {% else %}
{% set format = field_options.format %} {% set format = field_options.format %}

+ 2
- 0
ShopBundle/Resources/views/backend/default/list-fields/field_product_family_total_product_ordered.html.twig View File

{% import '@LcShop/backend/productfamily/macros.html.twig' as macros %}
{{ macros.total_order_product_family(orderUtils.getTotalProductOrderedLastWeeks(item, 2, true)['total'], item, true) }}

+ 28
- 5
ShopBundle/Resources/views/backend/default/list.html.twig View File

<i class="fa fa-check"></i> </span>{% endif %} <i class="fa fa-check"></i> </span>{% endif %}
{% if paginator.nbResultsOffline is defined %}<span data-toggle="tooltip" {% if paginator.nbResultsOffline is defined %}<span data-toggle="tooltip"
title="{{ "list.nbResultsOffline"|trans }}" title="{{ "list.nbResultsOffline"|trans }}"
class="badge badge-warning">{{ paginator.nbResultsOffline }}
class="badge badge-danger">{{ paginator.nbResultsOffline }}
<i class="fa fa-pen"></i></span>{% endif %} <i class="fa fa-pen"></i></span>{% endif %}
{% if is_granted('ROLE_SUPER_ADMIN') and paginator.nbResultsDeleted is defined %}<span {% if is_granted('ROLE_SUPER_ADMIN') and paginator.nbResultsDeleted is defined %}<span
data-toggle="tooltip" title="{{ "list.nbResultsDeleted"|trans }}" data-toggle="tooltip" title="{{ "list.nbResultsDeleted"|trans }}"
class="badge badge-danger">{{ paginator.nbResultsDeleted }} <i
class="badge badge-secondary">{{ paginator.nbResultsDeleted }} <i
class="fa fa-trash"></i> class="fa fa-trash"></i>
</span>{% endif %} </span>{% endif %}
{% endblock %} {% endblock %}
{% if _entity_config['list']['btn_download_purchase_order_archive'] is defined %} {% if _entity_config['list']['btn_download_purchase_order_archive'] is defined %}
<a class="float-right btn-sm btn-success" <a class="float-right btn-sm btn-success"
href="{{ path('easyadmin', { entity: 'Supplier', action: 'exportOrderPurchasesAsArchive' }) }}"> href="{{ path('easyadmin', { entity: 'Supplier', action: 'exportOrderPurchasesAsArchive' }) }}">
<i class="fa fa-download"></i> Télécharger tous les bons de commande
<i class="fa fa-download"></i> Récapitulatif des commandes
</a>
{% endif %}


{% if _entity_config['list']['btn_history_purchase_order'] is defined %}
<a class="float-right btn-sm btn-info"
href="{{ path('easyadmin', { entity: 'PurchaseOrder', action: 'list' }) }}">
<i class="fa fa-history"></i> Historiques des bons de commandes
</a>
{% endif %}

{% if _entity_config['list']['btn_week_purchase_order'] is defined %}
<a class="float-right btn-sm btn-info"
href="{{ path('easyadmin', { entity: 'SupplierOrderPurchase', action: 'list' }) }}">
<i class="fa fa-tractor"></i> Bons de commandes de la semaine
</a>
{% endif %}

{% if _entity_config['list']['btn_add_purchase_order'] is defined %}
<a class="float-right btn-sm btn-primary"
href="{{ path('easyadmin', { entity: 'PurchaseOrder', action: 'new' }) }}">
<i class="fa fa-plus"></i> Créer un bon de commande
</a> </a>
{% endif %} {% endif %}




<td class="{{ isSortingField ? 'sorted' }} {{ metadata.dataType|lower }} {{ metadata.css_class }}" {{ easyadmin_config('design.rtl') ? 'dir="rtl"' }}> <td class="{{ isSortingField ? 'sorted' }} {{ metadata.dataType|lower }} {{ metadata.css_class }}" {{ easyadmin_config('design.rtl') ? 'dir="rtl"' }}>
{% if (field == 'title' or field== 'id') and (metadata.dataType=="string" or metadata.dataType=="integer") %} {% if (field == 'title' or field== 'id') and (metadata.dataType=="string" or metadata.dataType=="integer") %}

<a class="link-as-text" <a class="link-as-text"
href="{{ path('easyadmin', {'action':'edit', 'entity':_entity_config.name, 'id': item.id}) }}">
href="{{ path('easyadmin', _request_parameters|merge({ action: 'edit', id: item.id })) }}">
{{ easyadmin_render_field_for_list_view(_entity_config.name, item, metadata) }} {{ easyadmin_render_field_for_list_view(_entity_config.name, item, metadata) }}
</a> </a>
{% else %} {% else %}


{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-list.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-list.js')|lc_cache }}"></script>




<script type="text/javascript"> <script type="text/javascript">

+ 1
- 1
ShopBundle/Resources/views/backend/default/new.html.twig View File



{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-edit.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-edit.js')|lc_cache }}"></script>


{# {#
<script type="text/javascript"> <script type="text/javascript">

+ 1
- 1
ShopBundle/Resources/views/backend/default/sortable.html.twig View File



{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-sort.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-sort.js')|lc_cache }}"></script>
{% endblock %} {% endblock %}

+ 17
- 6
ShopBundle/Resources/views/backend/form/custom_bootstrap_4.html.twig View File

</div> </div>
{% endif %}#} {% endif %}#}


{% set labelHelp = 'field.'~easyadmin['entity']['name']~'.'~name~'Help' %}
{% if labelHelp|trans({}, 'lcshop') == labelHelp %}{% set labelHelp = 'form.field.default.'~name~'Help' %}{% endif %}
{% if labelHelp|trans({}, 'lcshop') != labelHelp %}
<small class="form-text text-muted">{{ labelHelp|trans({}, 'lcshop')|raw }}</small>

{% if easyadmin is defined %}
{% set labelHelp = 'field.'~easyadmin['entity']['name']~'.'~name~'Help' %}
{% if labelHelp|trans({}, 'lcshop') == labelHelp %}{% set labelHelp = 'form.field.default.'~name~'Help' %}{% endif %}
{% if labelHelp|trans({}, 'lcshop') != labelHelp %}
<small class="form-text text-muted">{{ labelHelp|trans({}, 'lcshop')|raw }}</small>
{% endif %}
{% endif %} {% endif %}


{{- form_errors(form) -}} {{- form_errors(form) -}}
{% if 'field.MerchantConfig.' in label %} {% if 'field.MerchantConfig.' in label %}
{% set name_trad = label|replace({'field.MerchantConfig.': ''}) %} {% set name_trad = label|replace({'field.MerchantConfig.': ''}) %}
{% set trad = name_trad|lc_trad(easyadmin['entity']['name'], 'field') %} {% set trad = name_trad|lc_trad(easyadmin['entity']['name'], 'field') %}

{% else %} {% else %}
{% set trad = name|lc_trad(easyadmin['entity']['name'], 'field') %}
{% if easyadmin is defined %}
{% set trad = name|lc_trad(easyadmin['entity']['name'], 'field') %}
{% else %}
{% set trad = name|lc_trad('', 'field') %}
{% endif %}

{% endif %} {% endif %}


{%- endif -%} {%- endif -%}
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ trad }}</{{ element|default('label') }}>
{% if trad is defined %}
<{{ element|default('label') }}{% if label_attr %}{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}{% endif %}>{{ trad }}</{{ element|default('label') }}>
{% endif %}
{%- endif -%} {%- endif -%}
{%- endblock form_label %} {%- endblock form_label %}



+ 1
- 1
ShopBundle/Resources/views/backend/merchant/edit.html.twig View File

{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
{% include '@LcShop/backend/default/block/script-vuejs.html.twig' %} {% include '@LcShop/backend/default/block/script-vuejs.html.twig' %}
<script src="{{ asset('bundles/lcshop/js/backend/script/merchant/vuejs-merchant.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/merchant/vuejs-merchant.js')|lc_cache }}"></script>


{% endblock %} {% endblock %}

+ 0
- 1
ShopBundle/Resources/views/backend/merchant/form.html.twig View File

<span class="glyphicon glyphicon-triangle-bottom"></span> <span class="glyphicon glyphicon-triangle-bottom"></span>
<i class="fa fa-exclamation-circle invalid-form"></i> <i class="fa fa-exclamation-circle invalid-form"></i>
</button> </button>

</li> </li>
</ul> </ul>
</div> </div>

+ 6
- 0
ShopBundle/Resources/views/backend/merchant/panel_delivery.html.twig View File

<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
{{ macros.card_start('Merchant.delivery','light') }} {{ macros.card_start('Merchant.delivery','light') }}

{% if form.merchantConfigs['delivery-depository-only'] is defined %}
<div class="col-12">
{{ form_row(form.merchantConfigs['delivery-depository-only']) }}
</div>
{% endif %}
{% if form.merchantConfigs['image-zones'] is defined %} {% if form.merchantConfigs['image-zones'] is defined %}
<div class="col-12"> <div class="col-12">
{{ form_row(form.merchantConfigs['image-zones']) }} {{ form_row(form.merchantConfigs['image-zones']) }}

+ 7
- 0
ShopBundle/Resources/views/backend/merchant/panel_email.html.twig View File

<div class="col-12"> <div class="col-12">
{{ form_row(form.merchantConfigs['email-contact']) }} {{ form_row(form.merchantConfigs['email-contact']) }}
</div> </div>
{% if form.merchantConfigs['email-from-purchase-order'] is defined %}
<div class="col-12"> <div class="col-12">
{{ form_row(form.merchantConfigs['email-from-purchase-order']) }} {{ form_row(form.merchantConfigs['email-from-purchase-order']) }}
</div> </div>
{% endif %}
{% if form.merchantConfigs['purchase-order-email-content'] is defined %}
<div class="col-12">
{{ form_row(form.merchantConfigs['purchase-order-email-content']) }}
</div>
{% endif %}
{{ macros.card_end() }} {{ macros.card_end() }}
</div> </div>
</div> </div>

+ 10
- 0
ShopBundle/Resources/views/backend/merchant/panel_general.html.twig View File

<div class="col-12"> <div class="col-12">
{{ form_row(form.merchantConfigs['second-line-element-menu']) }} {{ form_row(form.merchantConfigs['second-line-element-menu']) }}
</div> </div>
{% if form.merchantConfigs['message-global-alert-type'] is defined %}
<div class="col-12">
{{ form_row(form.merchantConfigs['message-global-alert-type']) }}
</div>
{% endif %}
{% if form.merchantConfigs['message-global-alert'] is defined %}
<div class="col-12">
{{ form_row(form.merchantConfigs['message-global-alert']) }}
</div>
{% endif %}
{{ macros.card_end() }} {{ macros.card_end() }}
</div> </div>
</div> </div>

+ 45
- 6
ShopBundle/Resources/views/backend/merchant/panel_order.html.twig View File



{% import '@LcShop/backend/default/block/macros.html.twig' as macros %} {% import '@LcShop/backend/default/block/macros.html.twig' as macros %}



<script>
window.merchantPanelOrderValues = {
{% if form.merchantConfigs['is-open-full-time'] is defined %}isOpenFullTime: {{ form.merchantConfigs['is-open-full-time'].vars.data.value }}{% endif %}
};
</script>


<div class="row"> <div class="row">
<div class="col-8"> <div class="col-8">
{{ macros.card_start('Merchant.order','light') }} {{ macros.card_start('Merchant.order','light') }}
<div class="col-6"> <div class="col-6">
{{ form_row(form.merchantConfigs['maximum-order-week']) }} {{ form_row(form.merchantConfigs['maximum-order-week']) }}
</div> </div>
<div class="col-6">
{% if form.merchantConfigs['is-open-full-time'] is defined %}
<div class="col-12">
{% for field in form.merchantConfigs['is-open-full-time'] %}
{% if field.vars.name == 'value' %}
{{ form_row(field, {'attr': {"v-model" : 'isOpenFullTime'}}) }}
{% else %}
{{ form_row(field) }}
{% endif %}
{% endfor %}
</div>
{% endif %}
{% if form.merchantConfigs['message-site-opening-background'] is defined %}
<div v-show="isOpenFullTime == true" class="col-6">
{{ form_row(form.merchantConfigs['message-site-opening-background']) }}
</div>
{% endif %}
{% if form.merchantConfigs['message-site-opening'] is defined %}
<div v-show="isOpenFullTime == true" class="col-6">
{{ form_row(form.merchantConfigs['message-site-opening']) }}
</div>
{% endif %}
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.merchantConfigs['order-open-day']) }} {{ form_row(form.merchantConfigs['order-open-day']) }}
</div> </div>
<div class="col-6">
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.merchantConfigs['order-open-time']) }} {{ form_row(form.merchantConfigs['order-open-time']) }}
</div> </div>
<div class="col-6">
{% if form.merchantConfigs['order-open-day-vip'] is defined %}
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.merchantConfigs['order-open-day-vip']) }}
</div>
{% endif %}
{% if form.merchantConfigs['order-open-time-vip'] is defined %}
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.merchantConfigs['order-open-time-vip']) }}
</div>
{% endif %}
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.merchantConfigs['order-close-day']) }} {{ form_row(form.merchantConfigs['order-close-day']) }}
</div> </div>
<div class="col-6">
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.merchantConfigs['order-close-time']) }} {{ form_row(form.merchantConfigs['order-close-time']) }}
</div> </div>
<div class="col-6">
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.dateBeginHoliday) }} {{ form_row(form.dateBeginHoliday) }}
</div> </div>
<div class="col-6">
<div v-show="isOpenFullTime == false" class="col-6">
{{ form_row(form.dateEndHoliday) }} {{ form_row(form.dateEndHoliday) }}
</div> </div>
{{ macros.card_end() }} {{ macros.card_end() }}

+ 37
- 0
ShopBundle/Resources/views/backend/order/form/modal_orderstatushistories.html.twig View File

{% embed "@LcShop/backend/default/block/embed_modal.twig" %}
{% trans_default_domain 'lcshop' %}
{% block size %}modal-lg{% endblock %}
{% block id %}modal-order-status-histories{% endblock %}
{% block title %}{{ "group.OrderShop.orderStatusHistories"|trans }}{% endblock %}

{% block content %}
<div class="col">
<table class="table table-bordered">
<thead>
<th>Id</th>
<th>Date</th>
<th>Statut</th>
<th>Utilisateur</th>
<th>Origin</th>
</thead>
<tbody>
<template v-for="(orderStatusHistory, i) in order.orderStatusHistories">
<tr>
<td>${orderStatusHistory.id}</td>
<td>${orderStatusHistory.createdAt}</td>
<td>${orderStatusHistory.orderStatus}</td>
<td>${orderStatusHistory.createdBy}</td>
<td>${orderStatusHistory.origin}</td>
</tr>
</template>
</tbody>
</table>
</div>
{% endblock %}

{% block footer %}
<button type="button" class="btn btn-default float-right"
data-dismiss="modal">{{ 'action.close'|trans }}</button>
{% endblock %}

{% endembed %}

+ 18
- 0
ShopBundle/Resources/views/backend/order/list-fields/field_hasreach.html.twig View File

{% if value == 1 %}
<span class="badge badge-info">
Adresse de livraison
</span>
{% elseif value == 2 %}
<span class="badge badge-warning">
Adresse de facturation
</span>
{% elseif value == 3 %}
<span class="badge badge-danger">
Page de confirmation
</span>
{% else %}
<span class="badge badge-secondary">
Aucune
</span>
{% endif %}


+ 24
- 0
ShopBundle/Resources/views/backend/order/macros.html.twig View File

{% endembed %} {% endembed %}
{% endmacro %} {% endmacro %}


{% macro box_step_reach() %}
{% embed '@LcShop/backend/default/block/embed_box.twig' %}
{% import '@LcShop/backend/order/macros.html.twig' as order_macros %}
{% trans_default_domain 'lcshop' %}
{% block class %}bg-info{% endblock %}
{% block icon %}list-ol{% endblock %}
{% block label %}Étape atteinte{% endblock %}
{% block value %}
<div v-if="order.hasReach == 1">
Adresse de livraison
</div>
<div v-if="order.hasReach == 2">
Adresse de facturation
</div>
<div v-if="order.hasReach == 3">
Page de paiement
</div>
<div v-if="order.hasReach ==null">
Aucune
</div>
{% endblock %}
{% endembed %}
{% endmacro %}




{% macro box_payments() %} {% macro box_payments() %}
<strong> ${order.orderStatus}</strong> <strong> ${order.orderStatus}</strong>
{% endblock %} {% endblock %}
{% block button %} {% block button %}
{{ order_macros.order_modal_button('#modal-order-status-histories', 'btn-secondary', 'action.history') }}
{{ order_macros.order_modal_button('#modal-order-status') }} {{ order_macros.order_modal_button('#modal-order-status') }}
{% endblock %} {% endblock %}
{% endembed %} {% endembed %}

+ 5
- 2
ShopBundle/Resources/views/backend/order/show-cart.html.twig View File

{{ order_macros.box_delivery_slot() }} {{ order_macros.box_delivery_slot() }}
</div> </div>
</template> </template>

<div class="col-3">
{{ order_macros.box_step_reach() }}
</div>


<div class="col-12"> <div class="col-12">
{{ macros.card_start('OrderShop.resume') }} {{ macros.card_start('OrderShop.resume') }}
{% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %} {% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %}
{% endif %} {% endif %}


{% include '@LcShop/backend/order/form/modal_orderstatushistories.html.twig' %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}
{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
{% include '@LcShop/backend/default/block/script-vuejs.html.twig' %} {% include '@LcShop/backend/default/block/script-vuejs.html.twig' %}
<script src="{{ asset('bundles/lcshop/js/backend/script/order/vuejs-order.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/order/vuejs-order.js')|lc_cache }}"></script>
{% endblock %} {% endblock %}

+ 2
- 1
ShopBundle/Resources/views/backend/order/show-order.html.twig View File

{% if form_order_send_payment_link is defined %} {% if form_order_send_payment_link is defined %}
{% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %} {% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %}
{% endif %} {% endif %}
{% include '@LcShop/backend/order/form/modal_orderstatushistories.html.twig' %}


</div> </div>
</div> </div>
{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
{% include '@LcShop/backend/default/block/script-vuejs.html.twig' %} {% include '@LcShop/backend/default/block/script-vuejs.html.twig' %}
<script src="{{ asset('bundles/lcshop/js/backend/script/order/vuejs-order.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/order/vuejs-order.js')|lc_cache }}"></script>
{% endblock %} {% endblock %}

+ 3
- 1
ShopBundle/Resources/views/backend/order/show.html.twig View File

{% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %} {% include '@LcShop/backend/order/form/modal_sendpaymentlink.html.twig' %}
{% endif %} {% endif %}


{% include '@LcShop/backend/order/form/modal_orderstatushistories.html.twig' %}

</div> </div>
</div> </div>
{% endblock %} {% endblock %}
{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
{% include '@LcShop/backend/default/block/script-vuejs.html.twig' %} {% include '@LcShop/backend/default/block/script-vuejs.html.twig' %}
<script src="{{ asset('bundles/lcshop/js/backend/script/order/vuejs-order.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/order/vuejs-order.js')|lc_cache }}"></script>
{% endblock %} {% endblock %}

+ 1
- 1
ShopBundle/Resources/views/backend/productfamily/advanced_edition.html.twig View File

{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
{% include '@LcShop/backend/default/block/script-vuejs.html.twig' %} {% include '@LcShop/backend/default/block/script-vuejs.html.twig' %}
<script src="{{ asset('assets/js/backend/script/productfamily/vuejs-advanced-edition-product-family.js') }}"></script>
<script src="{{ asset('assets/js/backend/script/productfamily/vuejs-advanced-edition-product-family.js')|lc_cache }}"></script>


{% endblock %} {% endblock %}

+ 1
- 1
ShopBundle/Resources/views/backend/productfamily/edit.html.twig View File

{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
{% include '@LcShop/backend/default/block/script-vuejs.html.twig' %} {% include '@LcShop/backend/default/block/script-vuejs.html.twig' %}
<script src="{{ asset('bundles/lcshop/js/backend/script/productfamily/vuejs-product-family.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/productfamily/vuejs-product-family.js')|lc_cache }}"></script>
{% endblock %} {% endblock %}

+ 2
- 0
ShopBundle/Resources/views/backend/productfamily/form.html.twig View File

{% if formValues.behaviorExpirationDate %}behaviorExpirationDate: "{{ formValues.behaviorExpirationDate }}",{% endif %} {% if formValues.behaviorExpirationDate %}behaviorExpirationDate: "{{ formValues.behaviorExpirationDate }}",{% endif %}
{% if formValues.propertyExpirationDate %}propertyExpirationDate: "{{ formValues.propertyExpirationDate }}",{% endif %} {% if formValues.propertyExpirationDate %}propertyExpirationDate: "{{ formValues.propertyExpirationDate }}",{% endif %}
{% if formValues.activeProducts %}activeProducts: "{{ formValues.activeProducts }}",{% endif %} {% if formValues.activeProducts %}activeProducts: "{{ formValues.activeProducts }}",{% endif %}
{% if formValues.giftVoucherActive %}giftVoucherActive: "{{ formValues.giftVoucherActive }}",{% endif %}
{% if formValues.productsQuantityAsTitle %}productsQuantityAsTitle: {{ formValues.productsQuantityAsTitle }},{% endif %}


}; };
multiplyingFactor = "{{ form.multiplyingFactor.vars.value }}" multiplyingFactor = "{{ form.multiplyingFactor.vars.value }}"

+ 12
- 6
ShopBundle/Resources/views/backend/productfamily/macros.html.twig View File

{% endmacro total_order_product %} {% endmacro total_order_product %}




{% macro total_order_product_family(totalProductOrdered, productFamily) %}
{% macro total_order_product_family(totalProductOrdered, productFamily,forceByMeasure = false) %}
{% for weekNumber, weekNumberQuantity in totalProductOrdered %} {% for weekNumber, weekNumberQuantity in totalProductOrdered %}
<span class="text-success"><i class="fa fa-calendar"></i> {{ weekNumber }}</span> <span class="text-success"><i class="fa fa-calendar"></i> {{ weekNumber }}</span>
<span class="text-info"><i class="fa fa-shopping-basket"></i> <span class="text-info"><i class="fa fa-shopping-basket"></i>
<strong> <strong>
{{ weekNumberQuantity is null ? 0 : weekNumberQuantity}} {{ weekNumberQuantity is null ? 0 : weekNumberQuantity}}
{% if productFamily and productFamily.behaviorCountStock== constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') %}
{% if productFamily and (productFamily.behaviorCountStock== constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') or forceByMeasure)%}
{{ productFamily.unit.unitReference }} {{ productFamily.unit.unitReference }}
{% endif %} {% endif %}
</strong> </strong>
#new #new
{% endif %} <br/> {% endif %} <br/>
{% verbatim %}{{keyForm}}{% endverbatim %}<i class="fa fa-fw fa-sort"></i></td> {% verbatim %}{{keyForm}}{% endverbatim %}<i class="fa fa-fw fa-sort"></i></td>
{{ _self.product_field(4, product.title, 'title') }}
{{ _self.product_field(4, product.title, 'title', false, "",'v-show="productFamily.productsQuantityAsTitle == false"' ) }}
{{ _self.product_field(2, product.quantity, 'quantity') }} {{ _self.product_field(2, product.quantity, 'quantity') }}
{{ _self.product_field(2, product.unit, 'unit', 'unitWording') }} {{ _self.product_field(2, product.unit, 'unit', 'unitWording') }}
{{ _self.product_field(3, product.buyingPriceByRefUnit, 'buyingPriceByRefUnit',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') ~ '\'"') }} {{ _self.product_field(3, product.buyingPriceByRefUnit, 'buyingPriceByRefUnit',false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') ~ '\'"') }}
{{ _self.product_field(3, product.price, 'price', false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }} {{ _self.product_field(3, product.price, 'price', false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }}
{{ _self.product_field(3, product.priceWithTax, 'priceWithTax', false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }} {{ _self.product_field(3, product.priceWithTax, 'priceWithTax', false, '€', 'v-show="productFamily.behaviorPrice == \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') ~ '\'"') }}


<td colspan="2">
<td colspan="2" v-show="productFamily.giftVoucherActive!= true">
<span v-if="productFamily.reductionActive" class="text-danger"> <span v-if="productFamily.reductionActive" class="text-danger">
{% verbatim %}{{ marginProfitWithReduction }}{% endverbatim %}€<br /> {% verbatim %}{{ marginProfitWithReduction }}{% endverbatim %}€<br />
{% verbatim %}{{ marginProfitPercentWithReduction }}{% endverbatim %}% {% verbatim %}{{ marginProfitPercentWithReduction }}{% endverbatim %}%
{{ _self.product_field(2, product.availableQuantityDefault, 'availableQuantityDefault',false, '', 'v-show="productFamily.behaviorCountStock== \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') ~ '\' && productFamily.behaviorStockWeek!= \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') ~ '\'"') }} {{ _self.product_field(2, product.availableQuantityDefault, 'availableQuantityDefault',false, '', 'v-show="productFamily.behaviorCountStock== \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') ~ '\' && productFamily.behaviorStockWeek!= \'' ~ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') ~ '\'"') }}




<td colspan="2" v-show="productFamily.behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' || productFamily.behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') }}'">
<td colspan="2">


{{ _self.total_order_product(totalProductOrdered) }} {{ _self.total_order_product(totalProductOrdered) }}


</td> </td>

{# <td colspan="4" v-show="productFamily.giftVoucherActive== true">

{{ form_row(product.giftVoucherReductionCart, {"label": false, "attr" : {'v-model' : 'giftVoucherReductionCart', ':required': 'status ==1 && productFamily.giftVoucherActive'}}) }}

</td>#}
<td colspan="3"> <td colspan="3">
<button type="button" class="btn-sm btn-info" @click="modalProductForm()"> <button type="button" class="btn-sm btn-info" @click="modalProductForm()">
<i class="fa fa-edit"></i> <i class="fa fa-edit"></i>
</div> </div>
<div class="col"> <div class="col">
{{ form_row(product.exportNote) }} {{ form_row(product.exportNote) }}

</div> </div>



</div> </div>
<div class="modal-footer justify-content-between"> <div class="modal-footer justify-content-between">
<button type="button" class="btn btn-info float-right" data-dismiss="modal">Ok</button> <button type="button" class="btn btn-info float-right" data-dismiss="modal">Ok</button>

+ 3
- 0
ShopBundle/Resources/views/backend/productfamily/panel_general.html.twig View File

<div class="col-12"> <div class="col-12">
{{ form_row(form.status) }} {{ form_row(form.status) }}
</div> </div>
<div class="col-12">
{{ form_row(form.saleStatus) }}
</div>
<div class="col-12"> <div class="col-12">
{{ form_row(form.supplier) }} {{ form_row(form.supplier) }}
</div> </div>

+ 6
- 0
ShopBundle/Resources/views/backend/productfamily/panel_price.html.twig View File

{{ form_widget(field, {"attr" : {"v-model" : 'behaviorPrice'}}) }} {{ form_widget(field, {"attr" : {"v-model" : 'behaviorPrice'}}) }}
{% endfor %} {% endfor %}
</div> </div>
<div class="col-12" v-show="activeProducts == true">
<label>Bon cadeau</label>
{{ form_row(form.giftVoucherActive, {"attr": {"v-model": 'giftVoucherActive'}}) }}
</div>

{{ macros.endCard(true) }} {{ macros.endCard(true) }}





{{ macros.startCard(0, 'ProductFamily.tax','light') }} {{ macros.startCard(0, 'ProductFamily.tax','light') }}
<div class="col-12"> <div class="col-12">
{{ form_row(form.taxRate, {'attr': {'v-model':'taxRate'}}) }} {{ form_row(form.taxRate, {'attr': {'v-model':'taxRate'}}) }}

+ 71
- 31
ShopBundle/Resources/views/backend/productfamily/panel_products.html.twig View File

{% import '@LcShop/backend/productfamily/macros.html.twig' as product_family_macros %} {% import '@LcShop/backend/productfamily/macros.html.twig' as product_family_macros %}
{% trans_default_domain 'lcshop' %} {% trans_default_domain 'lcshop' %}


{#{% import _self as formMacros %}#}
{# {% import _self as formMacros %} #}
<div class="row"> <div class="row">
{{ macros.startCard(12, 'ProductFamily.products', 'light', true) }} {{ macros.startCard(12, 'ProductFamily.products', 'light', true) }}


<tr> <tr>
<th> <th>
</th> </th>
<th colspan="4" class="string">
<th colspan="4" class="string" v-show="productsQuantityAsTitle == false">
Titre Titre
<button v-on:click="emptyProductsField('title');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="2" class="string "> <th colspan="2" class="string ">
Quantité Quantité
<button v-on:click="emptyProductsField('quantity');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="2" class="quantity"> <th colspan="2" class="quantity">
Unité Unité
<button v-on:click="emptyProductsField('unit');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
colspan="3" class="buyingPriceByRefUnit "> colspan="3" class="buyingPriceByRefUnit ">
PA HT / ${ getUnitReference() } PA HT / ${ getUnitReference() }
<button v-on:click="emptyProductsField('buyingPriceByRefUnit');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
colspan="3" class="priceByRefUnit"> colspan="3" class="priceByRefUnit">
PA TTC / ${ getUnitReference() } PA TTC / ${ getUnitReference() }
<button v-on:click="emptyProductsField('buyingPriceByRefUnitWithTax');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>


<th colspan="3" class="price main-info"> <th colspan="3" class="price main-info">
PA HT PA HT
<button v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'" v-on:click="emptyProductsField('buyingPrice');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="3" class="price" <th colspan="3" class="price"
v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'">
PA TTC PA TTC
<button v-on:click="emptyProductsField('buyingPriceWithTax');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="3" class="main-info"> <th colspan="3" class="main-info">
Coef Coef
<button v-on:click="emptyProductsField('multiplyingFactor');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>




<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
colspan="3" class=""> colspan="3" class="">
PV HT / ${ getUnitReference() } PV HT / ${ getUnitReference() }
<button v-on:click="emptyProductsField('priceByRefUnit');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'" <th v-show="getBehaviorPrice() == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_REFERENCE_UNIT') }}'"
colspan="3" class="price"> colspan="3" class="price">
PV TTC / ${ getUnitReference() } PV TTC / ${ getUnitReference() }
<button v-on:click="emptyProductsField('priceByRefUnitWithTax');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>


<th colspan="3" class="price"> <th colspan="3" class="price">
{# v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'">#}
{# v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> #}
PV HT PV HT
<button v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'" v-on:click="emptyProductsField('price');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="3" class="price main-info"> <th colspan="3" class="price main-info">
PV TTC PV TTC
<button v-show="productFamily.behaviorPrice == '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'" v-on:click="emptyProductsField('priceWithTax');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="2">
<th colspan="2" v-show="giftVoucherActive!= true">
Marge HT Marge HT
</th> </th>


<th colspan="2" class="" <th colspan="2" class=""
v-show="behaviorExpirationDate== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT') }}'"> v-show="behaviorExpirationDate== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_EXPIRATION_DATE_BY_PRODUCT') }}'">
<span style="text-transform: uppercase"> ${typeExpirationDate}</span> <span style="text-transform: uppercase"> ${typeExpirationDate}</span>
<button v-on:click="emptyProductsField('propertyExpirationDate');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="2" <th colspan="2"
v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}'"> v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}'">
Stock Stock
<button v-on:click="emptyProductsField('availableQuantity');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="2" <th colspan="2"
v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' && behaviorStockWeek!= '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') }}'"> v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' && behaviorStockWeek!= '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') }}'">
Stock par défaut Stock par défaut
<button v-on:click="emptyProductsField('availableQuantityDefault');"
class="btn btn-empty-field" type="button"><i class="fa fa-undo"></i></button>
</th> </th>
<th colspan="2"
v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' || behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') }}'">
<th colspan="2">
Semaine / Commandés Semaine / Commandés
</th> </th>

{#<th colspan="4"
v-show="giftVoucherActive== true">
Réduction "Bon cadeaux"
</th>#}
<th colspan="3" class=""> <th colspan="3" class="">
Action Action
</th> </th>
<th> <th>
Rappel Rappel
</th> </th>
<th colspan="4" class="string">
<th colspan="4" class="string" v-show="productsQuantityAsTitle == false">
${title} ${title}

</th> </th>
<th colspan="2" class="string "> <th colspan="2" class="string ">
${productFamily.quantity} ${productFamily.quantity}
</th> </th>


<th colspan="3" class="price"> <th colspan="3" class="price">
{# v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'">#}
{# v-show="getBehaviorPrice() =='{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_PRICE_BY_PIECE') }}'"> #}
${productFamily.price} ${productFamily.price}
</th> </th>
<th colspan="3" class="price main-info"> <th colspan="3" class="price main-info">
${productFamily.priceWithTax} ${productFamily.priceWithTax}
</th> </th>
<th colspan="2" class="price">
<th colspan="2" class="price" v-show="giftVoucherActive!= true">
${productFamily.marginProfit}€<br/> ${productFamily.marginProfit}€<br/>
${productFamily.marginProfitPercent}% ${productFamily.marginProfitPercent}%
</td> </td>
<th colspan="2" <th colspan="2"
v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' && behaviorStockWeek!= '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') }}'"> v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' && behaviorStockWeek!= '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_STOCK_WEEK_NON_RENEWABLE') }}'">
</th> </th>
<th colspan="2"
v-show="behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT') }}' || behaviorCountStock== '{{ constant('Lc\\ShopBundle\\Model\\ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE') }}'">
<th colspan="2">
</th> </th>

{#<th colspan="4"
v-show="giftVoucherActive== true">
</th>#}
<th colspan="3" class=""> <th colspan="3" class="">


</th> </th>
</tfoot> </tfoot>
</table> </table>


<button type="button" class="add_tag_link btn-add-product btn btn-default" @click="addProductForm"><span
class="fa fa-plus"></span> Ajouter une déclinaison
</button>
<p>
<strong>Aide à l'utilisation - Raccourci clavier</strong>
<ul>
<li><strong>TAB</strong> : Champ suivant</li>
<li><strong>SHIFT + TAB</strong> : Champ précédent</li>
<li><strong>FLÈCHE BAS</strong> : Déclinaison suivante</li>
<li><strong>FLÈCHE HAUT</strong> : Déclinaison précédente</li>
<li><strong>SHIFT + [+]</strong> : Ajout d'une nouvelle déclinaison</li>
</ul>
</p>

<div class="clearfix"></div>

<div class="col-12">
<button type="button" class="add_tag_link btn-add-product btn btn-default" @click="addProductForm"><span
class="fa fa-plus"></span> Ajouter une déclinaison
</button>

{{ form_row(form.productsQuantityAsTitle, {"attr":{'v-model' : 'productsQuantityAsTitle'}}) }}
<p>
<strong>Aide à l'utilisation - Raccourci clavier</strong>
<ul>
<li><strong>TAB</strong> : Champ suivant</li>
<li><strong>SHIFT + TAB</strong> : Champ précédent</li>
<li><strong>FLÈCHE BAS</strong> : Déclinaison suivante</li>
<li><strong>FLÈCHE HAUT</strong> : Déclinaison précédente</li>
<li><strong>SHIFT + [+]</strong> : Ajout d'une nouvelle déclinaison</li>
</ul>
</p>
</div>

<div class="clearfix"></div>


{{ macros.endCard() }} {{ macros.endCard() }}
</div> </div>
{% for keyForm,i in sortableProductsField %} {% for keyForm,i in sortableProductsField %}
{% set product = form.products[i] %} {% set product = form.products[i] %}


{#{% if product.vars.value.status >= 0 and (product.vars.value.originProduct is null or product.vars.value.originProduct == false) %}#}
{# {% if product.vars.value.status >= 0 and (product.vars.value.originProduct is null or product.vars.value.originProduct == false) %} #}
window.productForm[{{ keyForm }}] = { window.productForm[{{ keyForm }}] = {
{% if product.vars.value.originProduct is defined %}originProduct: parseInt({{ product.vars.value.originProduct }}),{% endif %} {% if product.vars.value.originProduct is defined %}originProduct: parseInt({{ product.vars.value.originProduct }}),{% endif %}
{% if product.vars.value.status is defined %}status: parseInt({{ product.vars.value.status }}),{% endif %} {% if product.vars.value.status is defined %}status: parseInt({{ product.vars.value.status }}),{% endif %}
{% if product.vars.value.availableQuantity %}availableQuantity: parseInt({{ product.vars.value.availableQuantity }}),{% endif %} {% if product.vars.value.availableQuantity %}availableQuantity: parseInt({{ product.vars.value.availableQuantity }}),{% endif %}
{% if product.vars.value.availableQuantityDefault %}availableQuantityDefault: parseInt({{ product.vars.value.availableQuantityDefault }}),{% endif %} {% if product.vars.value.availableQuantityDefault %}availableQuantityDefault: parseInt({{ product.vars.value.availableQuantityDefault }}),{% endif %}
{% if product.vars.value.propertyExpirationDate %}propertyExpirationDate: "{{ product.vars.value.propertyExpirationDate }}",{% endif %} {% if product.vars.value.propertyExpirationDate %}propertyExpirationDate: "{{ product.vars.value.propertyExpirationDate }}",{% endif %}
{#{% if product.vars.value.expirationDate %}expirationDate: "{{ product.vars.value.expirationDate|date('d/m/Y') }}"{% endif %}#}
{#{% if product.vars.value.giftVoucherReductionCart %}giftVoucherReductionCart: {{ product.vars.value.giftVoucherReductionCart.id }},{% endif %}#}
{# {% if product.vars.value.expirationDate %}expirationDate: "{{ product.vars.value.expirationDate|date('d/m/Y') }}"{% endif %} #}
}; };
window.formProductTemplate[{{ keyForm }}] = '{{ product_family_macros.product_row(product, totalProductOrdered[product.vars.value.id])|replace({"\n":' ', "\r":' ', "'" : "\\'"})|raw }}'; window.formProductTemplate[{{ keyForm }}] = '{{ product_family_macros.product_row(product, totalProductOrdered[product.vars.value.id])|replace({"\n":' ', "\r":' ', "'" : "\\'"})|raw }}';
{#{% endif %}#}
{# {% endif %} #}
{% endfor %} {% endfor %}


</script> </script>

+ 1
- 1
ShopBundle/Resources/views/backend/reductioncart/edit.html.twig View File

{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
{% include '@LcShop/backend/default/block/script-vuejs.html.twig' %} {% include '@LcShop/backend/default/block/script-vuejs.html.twig' %}
<script src="{{ asset('bundles/lcshop/js/backend/script/reductioncart/vuejs-reduction-cart.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/reductioncart/vuejs-reduction-cart.js')|lc_cache }}"></script>
{% endblock %} {% endblock %}

+ 6
- 0
ShopBundle/Resources/views/backend/reductioncart/panel_info.html.twig View File

<div class="col-6"> <div class="col-6">
{{ form_row(form.availableQuantityPerUser) }} {{ form_row(form.availableQuantityPerUser) }}
</div> </div>
{#
<div class="col-4">
{{ form_row(form.availableQuantityPerCode) }}
</div>#}
<div class="col-12"> <div class="col-12">
{{ form_row(form.codes, {"attr":{'v-on:keyup' : 'updateCodes'}}) }} {{ form_row(form.codes, {"attr":{'v-on:keyup' : 'updateCodes'}}) }}
</div> </div>






{{ macros.endCard() }} {{ macros.endCard() }}


</div> </div>

+ 1
- 1
ShopBundle/Resources/views/backend/reductioncatalog/edit.html.twig View File

{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
{% include '@LcShop/backend/default/block/script-vuejs.html.twig' %} {% include '@LcShop/backend/default/block/script-vuejs.html.twig' %}
<script src="{{ asset('bundles/lcshop/js/backend/script/reductioncatalog/vuejs-reduction-catalog.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/reductioncatalog/vuejs-reduction-catalog.js')|lc_cache }}"></script>
{% endblock %} {% endblock %}

+ 1
- 1
ShopBundle/Resources/views/backend/ticket/show.html.twig View File



{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
<script src="{{ asset('bundles/lcshop/js/backend/script/ticket/init-edit.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/ticket/init-edit.js')|lc_cache }}"></script>


{% endblock %} {% endblock %}

+ 19
- 13
ShopBundle/Resources/views/backend/user/block/user-switch.html.twig View File


{% if is_granted('ROLE_SUPER_ADMIN') %} {% if is_granted('ROLE_SUPER_ADMIN') %}
{% if is_dropdown %}
<a class="btn dropdown-item {{ action.css_class|default('btn-default') }}" href="{{ merchantUtils.merchantCurrent.getMerchantConfig('url') }}?_switch_user={{ item.username }}" target="_blank">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}
</a>
{% else %}
<a class="btn {{ action.css_class|default('btn-default') }}" data-toggle="tooltip"
title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}"
href="{{ merchant.getMerchantConfig('url') }}?_switch_user={{ val }}" target="_blank">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
</a>
{% endif %}

{% if 'localhost' in app.request.getSchemeAndHttpHost() %}
{% set href = app.request.getSchemeAndHttpHost()~ '?_switch_user='~item.username %}
{% else %}
{% set href = merchantUtils.merchantCurrent.getMerchantConfig('url')~ '?_switch_user='~item.username %}
{% endif %}
{% if is_dropdown %}
<a class="btn dropdown-item {{ action.css_class|default('btn-default') }}" href="{{ href }}"
target="_blank">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}
</a>
{% else %}
<a class="btn {{ action.css_class|default('btn-default') }}" data-toggle="tooltip"
title="{{ action.label|trans(arguments = trans_parameters|merge({ '%entity_id%': item_id }), domain = translation_domain) }}"
href="{{ href }}" target="_blank">
{%- if action.icon %}<i class="fa fa-fw fa-{{ action.icon }}"></i> {% endif -%}
</a>
{% endif %}
{% endif %} {% endif %}

+ 1
- 1
ShopBundle/Resources/views/backend/user/block_useraddress.html.twig View File

{% trans_default_domain 'lcshop' %} {% trans_default_domain 'lcshop' %}
<div class="col-6 user-address-item"> <div class="col-6 user-address-item">
{% set button = '<button type="button" data-url="'~ path('easyadmin', {"action": 'editAddressUser', 'entity': 'User', 'id': entity.id, 'addressId': address.id})~'" class="btn btn-default btn-edit-user-address" >'~ 'action.edit'|trans ~'</button>' %} {% set button = '<button type="button" data-url="'~ path('easyadmin', {"action": 'editAddressUser', 'entity': 'User', 'id': entity.id, 'addressId': address.id})~'" class="btn btn-default btn-edit-user-address" >'~ 'action.edit'|trans ~'</button>' %}
{{ macros.box_info('bg-info', 'address-card', address.summary, '', button) }}
{{ macros.box_info('bg-info', 'address-card', address.summary(true, true), '', button) }}
</div> </div>

+ 3
- 1
ShopBundle/Resources/views/backend/user/edit.html.twig View File

<div class="col-5"> <div class="col-5">
<div class="row" id="user-addresses"> <div class="row" id="user-addresses">
{% for address in entity.addresses %} {% for address in entity.addresses %}
{% if address.status >=0 %}
{% include '@LcShop/backend/user/block_useraddress.html.twig' %} {% include '@LcShop/backend/user/block_useraddress.html.twig' %}
{% endif %}
{% endfor %} {% endfor %}
</div> </div>
<button type="button" data-url="{{ path('easyadmin', {"action": 'editAddressUser', 'entity': 'User', 'id': entity.id, 'addressId': 'new'}) }}" <button type="button" data-url="{{ path('easyadmin', {"action": 'editAddressUser', 'entity': 'User', 'id': entity.id, 'addressId': 'new'}) }}"
{{ parent() }} {{ parent() }}
{% include '@LcShop/backend/default/block/script-vuejs.html.twig' %} {% include '@LcShop/backend/default/block/script-vuejs.html.twig' %}


<script src="{{ asset('bundles/lcshop/js/backend/script/user/init-edit.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/user/init-edit.js')|lc_cache }}"></script>


{% endblock %} {% endblock %}

+ 10
- 0
ShopBundle/Resources/views/backend/user/list-fields/field-countordershops.html.twig View File


{% if value|length > 0 %}
<span class="badge badge-success">
{{ value|length }} commandes
</span>
{% else %}
<span class="badge badge-danger">
0 commandes
</span>
{% endif %}

+ 1
- 1
ShopBundle/Resources/views/backend/usermerchant/show.html.twig View File



{% block script_javascript %} {% block script_javascript %}
{{ parent() }} {{ parent() }}
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-list.js') }}"></script>
<script src="{{ asset('bundles/lcshop/js/backend/script/default/init-list.js')|lc_cache }}"></script>
{% endblock %} {% endblock %}





+ 1
- 1
ShopBundle/Services/CsvGenerator.php View File

$response = new StreamedResponse(function () { $response = new StreamedResponse(function () {
$this->createCsv('php://output'); $this->createCsv('php://output');
}); });
$response->headers->set('Content-Encoding', $this->toEncoding);
$response->headers->set('Content-Type', 'application/force-download'); $response->headers->set('Content-Type', 'application/force-download');
$response->headers->set('Content-Disposition', 'attachment; filename="'.$this->titleDocument.'.csv"'); $response->headers->set('Content-Disposition', 'attachment; filename="'.$this->titleDocument.'.csv"');
return $response; return $response;

+ 22
- 2
ShopBundle/Services/MailUtils.php View File

const SUBJECT = 'subject'; const SUBJECT = 'subject';
const SUBJECT_PREFIX = 'subject-prefix'; const SUBJECT_PREFIX = 'subject-prefix';
const TO_EMAIL = 'to-email'; const TO_EMAIL = 'to-email';
const COPY_TO = 'copy-to';
const COPY_HIDDEN_TO = 'copy-hidden-to';
const TO_NAME = 'to-name'; const TO_NAME = 'to-name';
const FROM_EMAIL = 'from-email'; const FROM_EMAIL = 'from-email';
const FROM_NAME = 'from-name'; const FROM_NAME = 'from-name';
const ATTACHMENT_DATA = 'attachment-data'; const ATTACHMENT_DATA = 'attachment-data';
const ATTACHMENT_FILENAME = 'attachment-filename'; const ATTACHMENT_FILENAME = 'attachment-filename';
const ATTACHMENT_CONTENT_TYPE = 'attachment-content-type'; const ATTACHMENT_CONTENT_TYPE = 'attachment-content-type';
//const DISPOSITION_NOTIFICATION_TO = 'disposition-notification-to' ;


protected $transport; protected $transport;
protected $templating; protected $templating;
->setBody($this->templating->render($params[self::CONTENT_TEMPLATE] . '-html.html.twig', $contentData), 'text/html') ->setBody($this->templating->render($params[self::CONTENT_TEMPLATE] . '-html.html.twig', $contentData), 'text/html')
->addPart($this->templating->render($params[self::CONTENT_TEMPLATE] . '-text.html.twig', $contentData)); ->addPart($this->templating->render($params[self::CONTENT_TEMPLATE] . '-text.html.twig', $contentData));


if (isset($params[self::REPLY_TO]) && strlen($params[self::REPLY_TO])) {
if(isset($params[self::COPY_TO]) && strlen($params[self::COPY_TO])) {
$message->addCc($params[self::COPY_TO]);
}

if(isset($params[self::COPY_HIDDEN_TO]) && strlen($params[self::COPY_HIDDEN_TO])) {
$message->addBcc($params[self::COPY_HIDDEN_TO]);
}

if(isset($params[self::REPLY_TO]) && strlen($params[self::REPLY_TO])) {
$message->addReplyTo($params[self::REPLY_TO]); $message->addReplyTo($params[self::REPLY_TO]);
} }


if (isset($params[self::ATTACHMENT_DATA]) && isset($params[self::ATTACHMENT_FILENAME]) && isset($params[self::ATTACHMENT_CONTENT_TYPE])) {
if(isset($params[self::ATTACHMENT_DATA]) && isset($params[self::ATTACHMENT_FILENAME]) && isset($params[self::ATTACHMENT_CONTENT_TYPE])) {
$message->attach(\Swift_Attachment::newInstance( $message->attach(\Swift_Attachment::newInstance(
$params[self::ATTACHMENT_DATA], $params[self::ATTACHMENT_DATA],
$params[self::ATTACHMENT_FILENAME], $params[self::ATTACHMENT_FILENAME],
)); ));
} }


/*if(isset($params[self::DISPOSITION_NOTIFICATION_TO]) && $params[self::DISPOSITION_NOTIFICATION_TO]) {
$emailFromDispositionNotificationTo = $emailFrom ;
if(isset($params[self::REPLY_TO]) && strlen($params[self::REPLY_TO])) {
$emailFromDispositionNotificationTo = $params[self::REPLY_TO] ;
}
$message->getHeaders()->addTextHeader('Disposition-Notification-To', $emailFromDispositionNotificationTo) ;
$message->getHeaders()->addMailboxHeader('Disposition-Notification-To', $emailFromDispositionNotificationTo);
}*/

$this->transport->send($message); $this->transport->send($message);
} }
} }

+ 4
- 3
ShopBundle/Services/Order/OrderUtils.php View File

use Lc\ShopBundle\Context\PriceUtilsInterface; use Lc\ShopBundle\Context\PriceUtilsInterface;
use Lc\ShopBundle\Context\ProductFamilyUtilsInterface; use Lc\ShopBundle\Context\ProductFamilyUtilsInterface;
use Lc\ShopBundle\Context\ReductionCreditInterface; use Lc\ShopBundle\Context\ReductionCreditInterface;
use Lc\ShopBundle\Context\UserUtilsInterface;
use Lc\ShopBundle\Model\ProductFamily; use Lc\ShopBundle\Model\ProductFamily;
use Lc\ShopBundle\Services\CreditUtils; use Lc\ShopBundle\Services\CreditUtils;
use Lc\ShopBundle\Services\DocumentUtils; use Lc\ShopBundle\Services\DocumentUtils;
protected $creditUtils; protected $creditUtils;
protected $router; protected $router;


public function __construct(EntityManagerInterface $em, Security $security, RouterInterface $router, UserUtils $userUtils,
public function __construct(EntityManagerInterface $em, Security $security, RouterInterface $router, UserUtilsInterface $userUtils,
MerchantUtilsInterface $merchantUtils, PriceUtilsInterface $priceUtils, ProductFamilyUtilsInterface $productFamilyUtils, MerchantUtilsInterface $merchantUtils, PriceUtilsInterface $priceUtils, ProductFamilyUtilsInterface $productFamilyUtils,
DocumentUtils $documentUtils, Utils $utils, CreditUtils $creditUtils) DocumentUtils $documentUtils, Utils $utils, CreditUtils $creditUtils)
{ {
$this->em->flush(); $this->em->flush();
} }


$this->eventOrderShopChangeQuantity($orderShop) ;
$this->eventCartChange($orderShop) ;
} }
} }
else { else {
return $this->priceUtils->getTotalWithTax($orderShop) >= 0 ; return $this->priceUtils->getTotalWithTax($orderShop) >= 0 ;
} }


public function eventOrderShopChangeQuantity(OrderShopInterface $orderShop)
public function eventCartChange(OrderShopInterface $orderShop)
{ {


} }

+ 50
- 4
ShopBundle/Services/Order/OrderUtilsReductionTrait.php View File

use Lc\ShopBundle\Context\OrderShopInterface; use Lc\ShopBundle\Context\OrderShopInterface;
use Lc\ShopBundle\Context\ReductionCartInterface; use Lc\ShopBundle\Context\ReductionCartInterface;
use Lc\ShopBundle\Context\ReductionCreditInterface; use Lc\ShopBundle\Context\ReductionCreditInterface;
use Lc\ShopBundle\Model\ReductionCredit;
use function Matrix\trace;


trait OrderUtilsReductionTrait trait OrderUtilsReductionTrait
{ {
public function getReductionCartByCode($code){
$reductionCartRepository = $this->em->getRepository(ReductionCartInterface::class);

$reductionCarts = $reductionCartRepository->findByCode($code);
$findReductionCart = null;
foreach ($reductionCarts as $reductionCart) {
if ($reductionCart && in_array($code, $reductionCart->getCodes())) {
$findReductionCart = $reductionCart;
}
}
return $findReductionCart;
}

public function compareOrderProductReductionCatalog($orderProductReductionCatalog1, $orderProductReductionCatalog2) public function compareOrderProductReductionCatalog($orderProductReductionCatalog1, $orderProductReductionCatalog2)
{ {
return (!$orderProductReductionCatalog1 && !$orderProductReductionCatalog2) return (!$orderProductReductionCatalog1 && !$orderProductReductionCatalog2)
} }




public function createOrderReductionCart(OrderShopInterface $orderShop, ReductionCartInterface $reductionCart)
public function createOrderReductionCart(OrderShopInterface $orderShop, ReductionCartInterface $reductionCart, $code = null)
{ {
$orderReductionCartClass = $this->em->getClassMetadata(OrderReductionCartInterface::class); $orderReductionCartClass = $this->em->getClassMetadata(OrderReductionCartInterface::class);
$orderReductionCart = new $orderReductionCartClass->name; $orderReductionCart = new $orderReductionCartClass->name;
$orderReductionCart->setTitle($reductionCart->getTitle()); $orderReductionCart->setTitle($reductionCart->getTitle());
$orderReductionCart->setValue($reductionCart->getValue()); $orderReductionCart->setValue($reductionCart->getValue());
$orderReductionCart->setUnit($reductionCart->getUnit()); $orderReductionCart->setUnit($reductionCart->getUnit());
$orderReductionCart->setCodeUsed($code);
$orderReductionCart->setBehaviorTaxRate($reductionCart->getBehaviorTaxRate()); $orderReductionCart->setBehaviorTaxRate($reductionCart->getBehaviorTaxRate());
$orderReductionCart->setFreeShipping($reductionCart->getFreeShipping()); $orderReductionCart->setFreeShipping($reductionCart->getFreeShipping());
$orderReductionCart->setAppliedTo($reductionCart->getAppliedTo()); $orderReductionCart->setAppliedTo($reductionCart->getAppliedTo());
} }


// n'a pas été utilisé // n'a pas été utilisé
if ($this->orderShopRepo->countValidOrderWithReductionCredit($reductionCredit, $user) > 0) {
$this->utils->addFlash('error', 'error.reductionCredit.alreadyUse');
return false;
if($reductionCredit->getType()== ReductionCredit::TYPE_CREDIT){
if ($this->orderShopRepo->countValidOrderWithReductionCredit($reductionCredit, $user) > 0) {
$this->utils->addFlash('error', 'error.reductionCredit.alreadyUse');
return false;
}
}else{
if ($this->orderShopRepo->countValidOrderWithReductionCredit($reductionCredit) > 0) {
$this->utils->addFlash('error', 'error.reductionCredit.alreadyUse');
return false;
}

} }


return true; return true;
$orderReductionCredit->setValue($reductionCredit->getValue()); $orderReductionCredit->setValue($reductionCredit->getValue());
$orderReductionCredit->setUnit($reductionCredit->getUnit()); $orderReductionCredit->setUnit($reductionCredit->getUnit());
$orderReductionCredit->setBehaviorTaxRate($reductionCredit->getBehaviorTaxRate()); $orderReductionCredit->setBehaviorTaxRate($reductionCredit->getBehaviorTaxRate());
$orderReductionCredit->setType($reductionCredit->getType());


$orderShop->addOrderReductionCredit($orderReductionCredit) ; $orderShop->addOrderReductionCredit($orderReductionCredit) ;


return $reductionCreditsArray ; return $reductionCreditsArray ;
} }


public function getReductionGiftsAvailableByUser($user)
{
$reductionGifts = $this->reductionCreditRepo->findReductionGiftToUseByUser($user) ;

$reductionGiftsArray = [] ;
foreach($reductionGifts as $reductionGift) {
if(!$this->orderShopRepo->countValidOrderWithReductionCredit($reductionGift)) {
$reductionGiftsArray[] = $reductionGift ;
}
}

return $reductionGiftsArray ;
}

public function isReductionGiftUsed($reductionGift){
if($this->orderShopRepo->countValidOrderWithReductionCredit($reductionGift)) {
return true;
}else{
return false;
}
}
public function isReductionCreditAddedToOrder($orderShop, $reductionCredit) public function isReductionCreditAddedToOrder($orderShop, $reductionCredit)
{ {
foreach($orderShop->getOrderReductionCredits() as $orderReductionCredit) { foreach($orderShop->getOrderReductionCredits() as $orderReductionCredit) {

+ 52
- 30
ShopBundle/Services/Order/OrderUtilsStockTrait.php View File

{ {
public function deductAvailabilityProduct(\Lc\ShopBundle\Model\OrderShop $orderShop) public function deductAvailabilityProduct(\Lc\ShopBundle\Model\OrderShop $orderShop)
{ {
//TODO ne pas déduire des stocks les orderProduct marqué en relivraison

foreach ($orderShop->getOrderProducts() as $orderProduct) { foreach ($orderShop->getOrderProducts() as $orderProduct) {
switch ($orderProduct->getProduct()->getProductFamily()->getBehaviorCountStock()) {
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE :
//Si ce n'esrt pas une relivraison OU si c'est une relivraison + relivraison + ce n'est pas une erruer producteur
if (!$orderProduct->isRedelivery() || ($orderProduct->isRedelivery() && $orderProduct->isRedeliverySupplierOrder() && !$orderProduct->isRedeliverySupplierMistake())) {
switch ($orderProduct->getProduct()->getProductFamily()->getBehaviorCountStock()) {
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_MEASURE :

//Disponibilité par unité de référence
$oldAvailability = $orderProduct->getProduct()->getAvailableQuantityInherited();
$newAvailability = $oldAvailability - ($orderProduct->getQuantityOrder() * ($orderProduct->getQuantityProduct() / $orderProduct->getUnit()->getCoefficient()));


//Disponibilité par unité de référence
$oldAvailability = $orderProduct->getProduct()->getAvailableQuantityInherited();
$newAvailability = $oldAvailability - ($orderProduct->getQuantityOrder() * ($orderProduct->getQuantityProduct() / $orderProduct->getUnit()->getCoefficient()));
$productFamily = $orderProduct->getProduct()->getProductFamily();
$productFamily->setAvailableQuantity($newAvailability);
$productFamily->setUpdatedBy($orderShop->getUser());


$productFamily = $orderProduct->getProduct()->getProductFamily();
$productFamily->setAvailableQuantity($newAvailability);
$productFamily->setUpdatedBy($orderShop->getUser());
$this->em->persist($productFamily);


$this->em->persist($productFamily);
break;
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY :


break;
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY :
$oldAvailability = $orderProduct->getProduct()->getAvailableQuantityInherited();
$newAvailability = $oldAvailability - $orderProduct->getQuantityOrder();


$oldAvailability = $orderProduct->getProduct()->getAvailableQuantityInherited();
$newAvailability = $oldAvailability - $orderProduct->getQuantityOrder();
$productFamily = $orderProduct->getProduct()->getProductFamily();
$productFamily->setAvailableQuantity($newAvailability);
$productFamily->setUpdatedBy($orderShop->getUser());


$productFamily = $orderProduct->getProduct()->getProductFamily();
$productFamily->setAvailableQuantity($newAvailability);
$productFamily->setUpdatedBy($orderShop->getUser());
$this->em->persist($productFamily);


$this->em->persist($productFamily);
break;
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT :
$oldAvailability = $orderProduct->getProduct()->getAvailableQuantityInherited();
$newAvailability = $oldAvailability - $orderProduct->getQuantityOrder();


break;
case ProductFamily::BEHAVIOR_COUNT_STOCK_BY_PRODUCT :
$oldAvailability = $orderProduct->getProduct()->getAvailableQuantityInherited();
$newAvailability = $oldAvailability - $orderProduct->getQuantityOrder();
$product = $orderProduct->getProduct();
$product->setAvailableQuantity($newAvailability);
$product->setUpdatedBy($orderShop->getUser());


$product = $orderProduct->getProduct();
$product->setAvailableQuantity($newAvailability);
$product->setUpdatedBy($orderShop->getUser());
$this->em->persist($product);


$this->em->persist($product);
break;
}


break;
$this->em->flush();
} }
}
}


$this->em->flush();
public function isProductSaleStatusOn(Product $product)
{
if($product->getProductFamily()->getSaleStatus()!=1) {
return false ;
} }

$allCategoriesSalesOff = true;
foreach ($product->getProductFamily()->getProductCategories() as $category){
if($category->getParent()) {
if($category->getSaleStatus() && $category->getParent()->getSaleStatus())
$allCategoriesSalesOff = false;
}
else {
if($category->getSaleStatus()) $allCategoriesSalesOff = false;
}
}
if($allCategoriesSalesOff) return false;

return true ;
} }


public function isProductAvailable(Product $product, $quantityOrder = 0, $checkCart = false, $orderShop = null) public function isProductAvailable(Product $product, $quantityOrder = 0, $checkCart = false, $orderShop = null)
{ {
if ($product->getStatus() != 1 || $product->getProductFamily()->getStatus() != 1) {
if ($product->getStatus() != 1 || $product->getProductFamily()->getStatus() != 1 || !$this->isProductSaleStatusOn($product)) {
return false; return false;
} }



+ 76
- 22
ShopBundle/Services/Price/OrderShopPriceUtils.php View File

return $total; return $total;
} }



//Inclus les ReductionCatalog des OrderProducts //Inclus les ReductionCatalog des OrderProducts
public function getMarginOrderProducts(OrderShopInterface $orderShop): float public function getMarginOrderProducts(OrderShopInterface $orderShop): float
{ {
return $total; return $total;
} }


public function getMarginOrderProductsWithReductions(OrderShopInterface $orderShop): float
{
$total = $this->getMarginOrderProducts($orderShop);

$totalReductionAmount = 0;
foreach ($orderShop->getOrderReductionCarts() as $orderReductionCart) {
$totalReductionAmount += $this->getOrderProductsReductionCartAmountWithoutTax($orderShop, $orderReductionCart);
}

foreach ($orderShop->getOrderReductionCredits() as $orderReductionCredit) {
$totalReductionAmount += $this->getOrderProductsReductionCreditAmountWithoutTax($orderShop, $orderReductionCredit);
}

$total -= $totalReductionAmount;

return $total;
}

public function getMarginOrderProductsWithReductionsPercent(OrderShopInterface $orderShop): float
{
if ($this->getTotalOrderProducts($orderShop)) {
return $this->round($this->getMarginOrderProductsWithReductions($orderShop) / $this->getTotalOrderProductsWithReductions($orderShop) * 100);
} else {
return 0;
}
}

public function getMarginOrderProductsPercent(OrderShopInterface $orderShop): float public function getMarginOrderProductsPercent(OrderShopInterface $orderShop): float
{ {
if ($this->getTotalOrderProducts($orderShop)) { if ($this->getTotalOrderProducts($orderShop)) {
} else { } else {
return 0; return 0;
} }

} }


public function getBrandTaxesOrderProductsWithReductionsPercent(OrderShopInterface $orderShop): float
{
if ($this->getTotalOrderProducts($orderShop)) {
return $this->round($this->getMarginOrderProducts($orderShop) / $this->getTotalBuyingPriceOrderProducts($orderShop->getOrderProducts()) * 100);
} else {
return 0;
}
}


public function getTotalOrderProductsWithTax(OrderShopInterface $orderShop): float public function getTotalOrderProductsWithTax(OrderShopInterface $orderShop): float
{ {
return $this->getTotalOrderProductsWithTaxByOrderProducts($orderShop->getOrderProducts()); return $this->getTotalOrderProductsWithTaxByOrderProducts($orderShop->getOrderProducts());
} }


public function getTotalBuyingPriceOrderProducts($orderProducts): float
{
$total = 0;

foreach ($orderProducts as $orderProduct) {
$total += $this->orderProductPriceUtils->getTotalBuyingPrice($orderProduct);
}

return $total;
}

public function getTotalBuyingPriceOrderProductsWithTax($orderProducts): float public function getTotalBuyingPriceOrderProductsWithTax($orderProducts): float
{ {
$total = 0; $total = 0;
return $total; return $total;
} }



public function getMarginOrderProductsWithReductions(OrderShopInterface $orderShop): float
{
$total = $this->getMarginOrderProducts($orderShop);

$totalReductionAmount = 0;
foreach ($orderShop->getOrderReductionCarts() as $orderReductionCart) {
$totalReductionAmount += $this->getOrderProductsReductionCartAmountWithoutTax($orderShop, $orderReductionCart);
}

foreach ($orderShop->getOrderReductionCredits() as $orderReductionCredit) {
$totalReductionAmount += $this->getOrderProductsReductionCreditAmountWithoutTax($orderShop, $orderReductionCredit);
}

$total -= $totalReductionAmount;

return $total;
}


public function getTotalOrderProductsWithTaxAndReductionCarts(OrderShopInterface $orderShop) public function getTotalOrderProductsWithTaxAndReductionCarts(OrderShopInterface $orderShop)
{ {
$total = $this->getTotalOrderProductsWithTax($orderShop); $total = $this->getTotalOrderProductsWithTax($orderShop);


return $amountWithTax; return $amountWithTax;
} }

public function getTotalReductions(OrderShopInterface $orderShop)
{
$total = 0 ;

foreach($orderShop->getOrderReductionCarts() as $orderReductionCart) {
$total += $this->getOrderProductsReductionCartAmountWithoutTax($orderShop, $orderReductionCart) ;
}

foreach($orderShop->getOrderReductionCredits() as $orderReductionCredit) {
$total += $this->getOrderProductsReductionCreditAmountWithoutTax($orderShop, $orderReductionCredit) ;
}

return $total ;
}

public function getTotalReductionsWithTax(OrderShopInterface $orderShop)
{
$total = 0 ;

foreach($orderShop->getOrderReductionCarts() as $orderReductionCart) {
$total += $this->getOrderProductsReductionCartAmountWithTax($orderShop, $orderReductionCart) ;
}

foreach($orderShop->getOrderReductionCredits() as $orderReductionCredit) {
$total += $this->getOrderProductsReductionCreditAmountWithTax($orderShop, $orderReductionCredit) ;
}

return $total ;
}
} }



+ 2
- 2
ShopBundle/Services/Price/PriceUtils.php View File

$service = 'orderProductPriceUtils'; $service = 'orderProductPriceUtils';
} }


if ($entity instanceof OrderShopInterface || is_array($entity)) {
if ($entity instanceof OrderShopInterface || is_iterable($entity) || is_array($entity)) {
$service = 'orderShopPriceUtils'; $service = 'orderShopPriceUtils';
} }


} }
} else { } else {
if (!strlen($service)) { if (!strlen($service)) {
throw new \ErrorException("PriceUtils : le type d'entité n'est pas géré.");
throw new \ErrorException("PriceUtils : le type d'entité n'est pas géré");
} else { } else {
if (!method_exists($this->$service, $name)) { if (!method_exists($this->$service, $name)) {
throw new \ErrorException("PriceUtils : la méthode " . $name . " du service " . $service . " n'existe pas."); throw new \ErrorException("PriceUtils : la méthode " . $name . " du service " . $service . " n'existe pas.");

+ 35
- 25
ShopBundle/Services/ProductFamilyUtils.php View File

<?php <?php


namespace Lc\ShopBundle\Services ;
namespace Lc\ShopBundle\Services;


use App\Entity\Product; use App\Entity\Product;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;


class ProductFamilyUtils class ProductFamilyUtils
{ {
protected $priceUtils ;
protected $em ;
protected $priceUtils;
protected $em;



public function __construct(PriceUtilsInterface $priceUtils, EntityManagerInterface $em) public function __construct(PriceUtilsInterface $priceUtils, EntityManagerInterface $em)
{ {
$this->priceUtils = $priceUtils ;
$this->priceUtils = $priceUtils;
$this->em = $em; $this->em = $em;
} }


public function getCheapestProduct($productFamily) public function getCheapestProduct($productFamily)
{ {
$priceUtils = $this->priceUtils ;
$priceUtils = $this->priceUtils;
return $this->getCheapestOrMostExpensiveProduct($productFamily, function ($a, $b) use ($priceUtils) { return $this->getCheapestOrMostExpensiveProduct($productFamily, function ($a, $b) use ($priceUtils) {
return $priceUtils->getPriceWithTaxAndReduction($a) > $priceUtils->getPriceWithTaxAndReduction($b) ;
return $priceUtils->getPriceWithTaxAndReduction($a) > $priceUtils->getPriceWithTaxAndReduction($b);
}, true); }, true);
} }


public function getCheapestProductByRefUnit($productFamily) public function getCheapestProductByRefUnit($productFamily)
{ {
$priceUtils = $this->priceUtils ;
$priceUtils = $this->priceUtils;
return $this->getCheapestOrMostExpensiveProduct($productFamily, function ($a, $b) use ($priceUtils) { return $this->getCheapestOrMostExpensiveProduct($productFamily, function ($a, $b) use ($priceUtils) {
return $priceUtils->getPriceByRefUnitWithTaxAndReduction($a) > $priceUtils->getPriceByRefUnitWithTaxAndReduction($b) ;
return $priceUtils->getPriceByRefUnitWithTaxAndReduction($a) > $priceUtils->getPriceByRefUnitWithTaxAndReduction($b);
}, false); }, false);
} }


public function getMostExpensiveProductByRefUnit($productFamily) public function getMostExpensiveProductByRefUnit($productFamily)
{ {
$priceUtils = $this->priceUtils ;
$priceUtils = $this->priceUtils;
return $this->getCheapestOrMostExpensiveProduct($productFamily, function ($a, $b) use ($priceUtils) { return $this->getCheapestOrMostExpensiveProduct($productFamily, function ($a, $b) use ($priceUtils) {
return $priceUtils->getPriceByRefUnitWithTaxAndReduction($a) < $priceUtils->getPriceByRefUnitWithTaxAndReduction($b) ;
return $priceUtils->getPriceByRefUnitWithTaxAndReduction($a) < $priceUtils->getPriceByRefUnitWithTaxAndReduction($b);
}, false); }, false);
} }


private function getCheapestOrMostExpensiveProduct($productFamily, $comparisonFunction, $returnSelfIfNotActiveProducts) private function getCheapestOrMostExpensiveProduct($productFamily, $comparisonFunction, $returnSelfIfNotActiveProducts)
{ {
if($productFamily->getActiveProducts()) {
if ($productFamily->getActiveProducts()) {
$products = $productFamily->getProductsOnline()->getValues(); $products = $productFamily->getProductsOnline()->getValues();
if (count($products) > 0) { if (count($products) > 0) {
usort($products, $comparisonFunction); usort($products, $comparisonFunction);
return $products[0]; return $products[0];
} }
}else{
} else {
return $productFamily->getOriginProduct(); return $productFamily->getOriginProduct();
} }
if ($returnSelfIfNotActiveProducts) { if ($returnSelfIfNotActiveProducts) {
return $productFamily; return $productFamily;
}
else {
} else {
return false; return false;
} }
} }




public function processBeforePersistProductFamily($productFamily, $editForm=false, $clone =false){
if($editForm){
public function processBeforePersistProductFamily($productFamily, $editForm = false, $clone = false)
{
if ($editForm) {
$this->processReductionCatalog($productFamily, $editForm); $this->processReductionCatalog($productFamily, $editForm);
$this->processCategories($productFamily); $this->processCategories($productFamily);
} }
} }
} }


protected function processCloneProduct($productFamily)
{
foreach ($productFamily->getProducts() as $i => $product) {
$newProduct = clone $product;
$newProduct->setProductFamily($productFamily);
$this->em->persist($newProduct);
$productFamily->addProduct($newProduct);
}
}

protected function processProducts($entity, $clone = false) protected function processProducts($entity, $clone = false)
{ {
if($clone) {
foreach ($entity->getProducts() as $i => $product) {
$newProduct = clone $product;
$newProduct->setProductFamily($entity);
$this->em->persist($newProduct);
$entity->addProduct($newProduct);
}
}else {
if ($clone) {
$this->processCloneProduct($entity);
} else {
//Récupère le product origin //Récupère le product origin
$originProducts = $this->em->getRepository(ProductInterface::class)->findBy(array( $originProducts = $this->em->getRepository(ProductInterface::class)->findBy(array(
'productFamily' => $entity->getId(), 'productFamily' => $entity->getId(),


foreach ($entity->getProducts() as $product) { foreach ($entity->getProducts() as $product) {
$product->setProductFamily($entity); $product->setProductFamily($entity);

if ($entity->getProductsQuantityAsTitle() && $product->getStatus() >= 1) {
$product->setTitle(str_replace('.', ',', $product->getQuantityInherited()) . $product->getUnitInherited()->getWording());
}

$this->em->persist($product); $this->em->persist($product);
$entity->addProduct($product); $entity->addProduct($product);
} }

+ 4
- 1
ShopBundle/Services/UserUtils.php View File

use Lc\ShopBundle\Context\VisitorInterface; use Lc\ShopBundle\Context\VisitorInterface;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\HttpFoundation\RequestStack; use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\Security;


class UserUtils class UserUtils
{ {
protected $cookieChecker ; protected $cookieChecker ;


public function __construct(ParameterBagInterface $parameterBag, EntityManagerInterface $em, Utils $utils, public function __construct(ParameterBagInterface $parameterBag, EntityManagerInterface $em, Utils $utils,
RequestStack $requestStack, MerchantUtilsInterface $merchantUtils, CookieChecker $cookieChecker)
RequestStack $requestStack, MerchantUtilsInterface $merchantUtils, CookieChecker $cookieChecker,
Security $security)
{ {
$this->em = $em ; $this->em = $em ;
$this->parameterBag = $parameterBag ; $this->parameterBag = $parameterBag ;
$this->visitorRepository = $this->em->getRepository($this->em->getClassMetadata(VisitorInterface::class)->getName()) ; $this->visitorRepository = $this->em->getRepository($this->em->getClassMetadata(VisitorInterface::class)->getName()) ;
$this->merchantUtils = $merchantUtils ; $this->merchantUtils = $merchantUtils ;
$this->cookieChecker = $cookieChecker ; $this->cookieChecker = $cookieChecker ;
$this->security = $security ;
} }


public function getCookieNameVisitor() public function getCookieNameVisitor()

+ 54
- 3
ShopBundle/Services/Utils.php View File

use EasyCorp\Bundle\EasyAdminBundle\Configuration\ConfigManager; use EasyCorp\Bundle\EasyAdminBundle\Configuration\ConfigManager;
use Geocoder\Model\Coordinates; use Geocoder\Model\Coordinates;
use Geocoder\Provider\Addok\Addok; use Geocoder\Provider\Addok\Addok;
use Geocoder\Provider\GoogleMaps\GoogleMaps;
use Geocoder\Provider\Nominatim\Nominatim;
use Geocoder\Query\GeocodeQuery; use Geocoder\Query\GeocodeQuery;
use Geocoder\Query\ReverseQuery; use Geocoder\Query\ReverseQuery;
use Lc\ShopBundle\Context\ImageInterface; use Lc\ShopBundle\Context\ImageInterface;
use Lc\ShopBundle\Context\UserPointSaleInterface; use Lc\ShopBundle\Context\UserPointSaleInterface;
use Liip\ImagineBundle\Imagine\Cache\CacheManager; use Liip\ImagineBundle\Imagine\Cache\CacheManager;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpClient\HttplugClient; use Symfony\Component\HttpClient\HttplugClient;
use Symfony\Component\HttpFoundation\ParameterBag; use Symfony\Component\HttpFoundation\ParameterBag;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Validator\Constraints\EqualTo;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;


class Utils class Utils
return $truncate; return $truncate;
} }


function stripAccents($stripAccents)
{
return strtr($stripAccents,'àáâãäçèéêëìíîïñòóôõöùúûüýÿÀÁÂÃÄÇÈÉÊËÌÍÎÏÑÒÓÔÕÖÙÚÛÜÝ','aaaaaceeeeiiiinooooouuuuyyAAAAACEEEEIIIINOOOOOUUUUY');
}

function cleanStringToCompare($string)
{
return $this->stripAccents(trim(strtolower($string))) ;
}


public function isBot() public function isBot()
{ {


public function getGeocoderProvider() public function getGeocoderProvider()
{ {
$provider = false ;
$symfonyClient = new HttplugClient(); $symfonyClient = new HttplugClient();
$provider = new Addok($symfonyClient, 'https://api-adresse.data.gouv.fr') ;
$configGeocoderProvider = $this->parameterBag->get('geocoder.provider') ;

/* API du gouvernement */
if($configGeocoderProvider == 'addok') {
$provider = new Addok($symfonyClient, 'https://api-adresse.data.gouv.fr') ;
}
/* Google Maps */
elseif($configGeocoderProvider == 'googlemaps') {
$provider = new GoogleMaps($symfonyClient, null, $this->parameterBag->get('geocoder.api_key')) ;
}
/* Nominatim : OpenStreetMap */
elseif($configGeocoderProvider == 'nominatim') {
$provider = Nominatim::withOpenStreetMapServer($symfonyClient, 'Mozilla/5.0 (platform; rv:geckoversion) Gecko/geckotrail Firefox/firefoxversion');
}

if(!$provider) {
throw new \ErrorException('Aucun provider (geocoding) défini') ;
}

return $provider ; return $provider ;
} }


$provider = $this->getGeocoderProvider() ;; $provider = $this->getGeocoderProvider() ;;
$query = GeocodeQuery::create($query)->withData('type', 'housenumber'); $query = GeocodeQuery::create($query)->withData('type', 'housenumber');
$results = $provider->geocodeQuery($query); $results = $provider->geocodeQuery($query);
return $results->all() ;
$resultsToReturn = array();
foreach($results as $result) {
if ($result->getStreetNumber() && strlen($result->getStreetNumber()) > 0) {
$resultsToReturn[] = $result;
}
}
return $resultsToReturn;
} }


public function callReverseAddressApi($latitude, $longitude) public function callReverseAddressApi($latitude, $longitude)
} }





public function addCaptchaType(FormBuilderInterface $builder)
{
$builder->add('specialField', HiddenType::class, [
'data' => 0,
'mapped' => false,
'attr' => [
'class' => 'special-field'
],
'constraints' => [
new EqualTo(['value' => $this->parameterBag->get('app.captcha_value'), 'message' => 'Valeur incorrecte'])
],
]);
}


} }

+ 3
- 2
ShopBundle/Services/UtilsManager.php View File

use Lc\ShopBundle\Context\PriceUtilsInterface; use Lc\ShopBundle\Context\PriceUtilsInterface;
use Lc\ShopBundle\Context\ProductFamilyUtilsInterface; use Lc\ShopBundle\Context\ProductFamilyUtilsInterface;
use Lc\ShopBundle\Context\Services\StatisticsUtilsInterface; use Lc\ShopBundle\Context\Services\StatisticsUtilsInterface;
use Lc\ShopBundle\Context\UserUtilsInterface;
use League\Flysystem\Util; use League\Flysystem\Util;


class UtilsManager class UtilsManager


public function __construct( public function __construct(
Utils $utils, Utils $utils,
UserUtils $userUtils,
UserUtilsInterface $userUtils,
MerchantUtilsInterface $merchantUtils, MerchantUtilsInterface $merchantUtils,
ProductFamilyUtilsInterface $productFamilyUtils, ProductFamilyUtilsInterface $productFamilyUtils,
OrderUtilsInterface $orderUtils, OrderUtilsInterface $orderUtils,
return $this->utils ; return $this->utils ;
} }


public function getUserUtils(): UserUtils
public function getUserUtils(): UserUtilsInterface
{ {
return $this->userUtils ; return $this->userUtils ;
} }

+ 4
- 2
ShopBundle/Twig/FrontendTwigExtension.php View File

new TwigFunction('get_form_newsletter', [$this, 'getFormNewsletter']), new TwigFunction('get_form_newsletter', [$this, 'getFormNewsletter']),
new TwigFunction('get_merchants', [$this, 'getMerchants']), new TwigFunction('get_merchants', [$this, 'getMerchants']),
new TwigFunction('get_file_manager_folder', [$this, 'getFileManagerFolder']), new TwigFunction('get_file_manager_folder', [$this, 'getFileManagerFolder']),
new TwigFunction('lc_format_price', [$this, 'formatPrice']),
); );
} }


return $form->createView(); return $form->createView();
} }


public function formatPrice($price)
public function formatPrice($price, $unbreakableSpace = true)
{ {
$price = number_format($price, 2, ',', ' '); $price = number_format($price, 2, ',', ' ');
$price = $price . '&nbsp;€';
$price .= $unbreakableSpace ? '&nbsp;' : ' ' ;
$price .= '€' ;
return $price; return $price;
} }



Loading…
Cancel
Save