Browse Source

countValidOrderShopsByDeliveryAvailability

feature/export_comptable
Guillaume 4 years ago
parent
commit
6b6e276b17
3 changed files with 19 additions and 2 deletions
  1. +17
    -0
      ShopBundle/Repository/OrderShopRepository.php
  2. +1
    -1
      ShopBundle/Resources/views/backend/default/list-fields/field_price.html.twig
  3. +1
    -1
      ShopBundle/Resources/views/backend/default/list-fields/field_total.html.twig

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



namespace Lc\ShopBundle\Repository; namespace Lc\ShopBundle\Repository;


use App\Entity\DeliveryAvailabilityPointSale;
use App\Entity\DeliveryAvailabilityZone;
use Doctrine\ORM\QueryBuilder; use Doctrine\ORM\QueryBuilder;
use Lc\ShopBundle\Context\DefaultRepositoryInterface; use Lc\ShopBundle\Context\DefaultRepositoryInterface;
use Lc\ShopBundle\Context\OrderShopInterface; use Lc\ShopBundle\Context\OrderShopInterface;
$query->andWhere('pointSale.isDepository = 1'); $query->andWhere('pointSale.isDepository = 1');
} }


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

$isDeliveryAvailabilityZone = ($deliveryAvailability instanceof DeliveryAvailabilityZone) ? true : false;
$isDeliveryAvailabilityPointSale = ($deliveryAvailability instanceof DeliveryAvailabilityPointSale) ? true : false;

if($isDeliveryAvailabilityZone) {
$query->innerJoin('e.deliveryAvailabilityZone','deliveryAvailabilityZone') ;
}

if($isDeliveryAvailabilityPointSale) {
$query->innerJoin('e.deliveryAvailabilityPointSale','deliveryAvailabilityPointSale') ;
}
}

if (isset($params['orderBy'])) { if (isset($params['orderBy'])) {
$query->orderBy('e.' . $params['orderBy'], isset($params['orderByDirection']) ? $params['orderByDirection'] : 'DESC'); $query->orderBy('e.' . $params['orderBy'], isset($params['orderByDirection']) ? $params['orderByDirection'] : 'DESC');
} else { } else {

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

{{ priceUtils.getPriceWithTax(item) }}
{{ priceUtils.getPriceWithTax(item)|format_price|raw }}

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

{{ priceUtils.getTotalWithTax(item) }}
{{ priceUtils.getTotalWithTax(item)|format_price|raw }}

Loading…
Cancel
Save