Browse Source

Produit stock negatif

feature/export_comptable
Fab 4 years ago
parent
commit
f58f3bb249
2 changed files with 6 additions and 1 deletions
  1. +1
    -1
      ShopBundle/Resources/views/backend/default/menu.html.twig
  2. +5
    -0
      ShopBundle/Twig/BackendTwigExtension.php

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

@@ -24,7 +24,7 @@
{% if item.icon is not empty %}<i class="fa fa-fw {{ item.icon }}"></i>{% endif %}
<p>{{ item.label|trans(domain = translation_domain) }}
{% if item.children|default([]) is not empty %}<i class="right fas fa-angle-left"></i>{% endif %}
{% if item.params.count_menu_item is defined %}<span class="badge badge-info right">{{ count_menu_items(item.params.count_menu_item) }}</span>{% endif %}
{% if item.params.count_menu_item is defined %}<span class="badge badge-{{ item.params.alert is defined ? 'danger' : 'info' }} right">{{ count_menu_items(item.params.count_menu_item) }}</span>{% endif %}
</p>
</a>
{% endif %}

+ 5
- 0
ShopBundle/Twig/BackendTwigExtension.php View File

@@ -3,8 +3,10 @@
namespace Lc\ShopBundle\Twig;

use Doctrine\ORM\EntityManagerInterface;
use Lc\ShopBundle\Context\ProductInterface;
use Lc\ShopBundle\Context\ReductionCartInterface;
use Lc\ShopBundle\Context\TicketInterface;
use Lc\ShopBundle\Repository\ProductRepository;
use Symfony\Contracts\Translation\TranslatorInterface;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;
@@ -83,6 +85,9 @@ class BackendTwigExtension extends AbstractExtension
case 'ticket' :
$ticketRepo = $this->em->getRepository(TicketInterface::class);
return $ticketRepo->countAllOpen();
case 'productAvailabilitiesNegative' :
$productRepo = $this->em->getRepository(ProductInterface::class);
return count($productRepo->findProductByAvailabilitiesNegative());

}
}

Loading…
Cancel
Save