Browse Source

[Backend] Tableau de bord : tickets ouverts

feature/export_comptable
Guillaume 4 years ago
parent
commit
ac905991ee
4 changed files with 41 additions and 2 deletions
  1. +6
    -1
      ShopBundle/Model/OrderShop.php
  2. +8
    -0
      ShopBundle/Repository/TicketRepository.php
  3. +1
    -1
      ShopBundle/Resources/translations/lcshop.fr.yaml
  4. +26
    -0
      ShopBundle/Resources/views/backend/default/block/list_tickets.html.twig

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

@@ -135,7 +135,12 @@ abstract class OrderShop extends AbstractEntity implements FilterMerchantInterfa

public function __toString()
{
return 'Commande du '.$this->getValidationDate()->format('d/m/Y') ;
if($this->getValidationDate()) {
return 'Commande du '.$this->getValidationDate()->format('d/m/Y') ;
}
else {
return 'Commande #'.$this->getId() ;
}
}

public function getValidationDate(): ?\DateTimeInterface

+ 8
- 0
ShopBundle/Repository/TicketRepository.php View File

@@ -7,6 +7,7 @@ use Doctrine\Persistence\ManagerRegistry;
use Lc\ShopBundle\Context\DefaultRepositoryInterface;
use Lc\ShopBundle\Context\TicketInterface;
use Lc\ShopBundle\Context\UnitInterface;
use Lc\ShopBundle\Model\Ticket;
use Lc\ShopBundle\Repository\BaseRepository;

/**
@@ -21,5 +22,12 @@ class TicketRepository extends BaseRepository implements DefaultRepositoryInterf
{
return TicketInterface::class;
}

public function findAllOpen()
{
$query = $this->findByMerchantQuery() ;
$query->andWhere('e.status IN (:statusOpen)')->setParameter('statusOpen', [Ticket::TICKET_STATUS_OPEN, Ticket::TICKET_STATUS_BEING_PROCESSED]) ;
return $query->getQuery()->getResult() ;
}
}


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

@@ -60,9 +60,9 @@ group:
deliveryAddress: Adresse de livraison
complementary: Commandes complémentaires
tickets: Tickets relatif à la commande

Ticket:
listMessages: Liste des messages
list: Tickets ouverts
PointSale:
main: Général
Merchant:

+ 26
- 0
ShopBundle/Resources/views/backend/default/block/list_tickets.html.twig View File

@@ -0,0 +1,26 @@
<table class="table table-condensed">
<thead>
<tr>
<th>Sujet</th>
<th>Statut</th>
<th></th>
</tr>
</thead>
<tbody>
{% for ticket in tickets %}
<tr>
<td>{{ ticket.subject }}</td>
<td>
{% set value = ticket.status %}
{% include '@LcShop/backend/default/list-fields/field_ticket_status.html.twig' %}
</td>
<td>
<a class="btn-sm btn-success" href="{{ path('easyadmin', {id: ticket.id, entity: 'Ticket', action: 'show'}) }}">
<i class="fas fa-eye"></i>
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>


Loading…
Cancel
Save