Browse Source

Repository OrderShop (findAllByDateStartEnd) + Assets custom

feature/export_comptable
Guillaume 4 years ago
parent
commit
f384051766
5 changed files with 21 additions and 6 deletions
  1. +4
    -1
      ShopBundle/Controller/Admin/AdminController.php
  2. +1
    -1
      ShopBundle/Model/OrderShop.php
  3. +12
    -0
      ShopBundle/Repository/OrderShopRepository.php
  4. +3
    -3
      ShopBundle/Resources/views/backend/default/layout.html.twig
  5. +1
    -1
      ShopBundle/Services/OrderUtils.php

+ 4
- 1
ShopBundle/Controller/Admin/AdminController.php View File

@@ -10,6 +10,7 @@ use FOS\UserBundle\Model\UserManagerInterface;
use Lc\ShopBundle\Context\FilterMultipleMerchantsInterface;
use Lc\ShopBundle\Context\MerchantInterface;
use Lc\ShopBundle\Context\MerchantUtilsInterface;
use Lc\ShopBundle\Context\OrderUtilsInterface;
use Lc\ShopBundle\Context\StatusInterface;
use Lc\ShopBundle\Context\TreeInterface;
use Lc\ShopBundle\Form\AbstractEditPositionType;
@@ -30,9 +31,10 @@ class AdminController extends EasyAdminController
protected $utils;
protected $merchantUtils ;
protected $mailjetTransport ;
protected $orderUtils ;

public function __construct(Security $security, UserManagerInterface $userManager, EntityManagerInterface $em, Utils $utils,
MerchantUtilsInterface $merchantUtils, MailjetTransport $mailjetTransport)
MerchantUtilsInterface $merchantUtils, MailjetTransport $mailjetTransport, OrderUtilsInterface $orderUtils)
{
$this->security = $security;
$this->userManager = $userManager;
@@ -40,6 +42,7 @@ class AdminController extends EasyAdminController
$this->utils = $utils;
$this->merchantUtils = $merchantUtils ;
$this->mailjetTransport = $mailjetTransport ;
$this->orderUtils = $orderUtils ;
}

/**

+ 1
- 1
ShopBundle/Model/OrderShop.php View File

@@ -11,7 +11,7 @@ use Lc\ShopBundle\Context\FilterMerchantInterface;
/**
* @ORM\MappedSuperclass()
*/
abstract class OrderShop implements FilterMerchantInterface
abstract class OrderShop extends AbstractEntity implements FilterMerchantInterface
{

/**

+ 12
- 0
ShopBundle/Repository/OrderShopRepository.php View File

@@ -36,4 +36,16 @@ class OrderShopRepository extends BaseRepository implements DefaultRepositoryInt
return $query->getQuery()->getOneOrNullResult() ;
}

public function findAllByDateStartEnd($dateStart, $dateEnd)
{
$query = $this->findByMerchantQuery()
->andWhere('e.createdAt >= :dateStart')
->setParameter('dateStart', $dateStart)
->andWhere('e.createdAt <= :dateEnd')
->setParameter('dateEnd', $dateEnd)
;

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

}

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

@@ -31,9 +31,10 @@
{% endblock %}

{% block head_custom_stylesheets %}

<link rel="stylesheet" href="{{ asset('bundles/lcshop/css/backend/custom.css') }}">

{% for asset_css in easyadmin_config('design.assets.css') %}
<link rel="stylesheet" href="{{ asset(asset_css) }}">
{% endfor %}
{% endblock head_custom_stylesheets %}

{#
@@ -48,7 +49,6 @@
{% set favicon = easyadmin_config('design.assets.favicon') %}
<link rel="icon" type="{{ favicon.mime_type }}" href="{{ asset(favicon.path) }}"/>
{% endblock %}

</head>

{% block body %}

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

@@ -16,7 +16,7 @@ class OrderUtils
protected $security;
protected $userUtils;
protected $merchantUtils;
private $orderShopRepo;
protected $orderShopRepo;
protected $priceUtils ;
protected $productFamilyUtils ;


Loading…
Cancel
Save