Commit df1ae30a by Yvon Kerdoncuff

Merge branch 'montpellier-preprod' into develop

parents 34594ec8 0c5cf6c9
...@@ -4,6 +4,7 @@ namespace App\Admin; ...@@ -4,6 +4,7 @@ namespace App\Admin;
use App\Entity\AccountPrestataire; use App\Entity\AccountPrestataire;
use App\Entity\Adherent; use App\Entity\Adherent;
use App\Entity\Caissier;
use App\Entity\ContactPrestataire; use App\Entity\ContactPrestataire;
use App\Entity\CotisationAdherent; use App\Entity\CotisationAdherent;
use App\Entity\CotisationPrestataire; use App\Entity\CotisationPrestataire;
...@@ -179,6 +180,11 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -179,6 +180,11 @@ class PrestataireAdmin extends AbstractAdmin
} }
} }
$existingCaissiers = $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(Caissier::class)->findBy(['prestataire' => $presta]);
$existingCaissiersUsers = array_map(function ($caissier) {
return $caissier->getUser();
}, $existingCaissiers);
$formMapper $formMapper
->tab('Prestataire') ->tab('Prestataire')
->with('Prestataire', ['class' => 'col-md-6']) ->with('Prestataire', ['class' => 'col-md-6'])
...@@ -333,11 +339,12 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -333,11 +339,12 @@ class PrestataireAdmin extends AbstractAdmin
->end() ->end()
->with('Caissier(s)', ['class' => 'col-md-6']) ->with('Caissier(s)', ['class' => 'col-md-6'])
->add('caissiers', EntityType::class, [ ->add('caissiers', EntityType::class, [
// 'mapped' => false, 'mapped' => false,
'class' => User::class, 'class' => User::class, // instance of user so we can set existing users as choices
'multiple' => true, 'multiple' => true,
'required' => false, 'required' => false,
'label' => 'Associer à un(des) utilisateur(s) existant :', 'label' => 'Associer à un(des) utilisateur(s) existant :',
'data' => $existingCaissiersUsers,
'choices' => $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(User::class)->findOrderByName(), 'choices' => $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(User::class)->findOrderByName(),
'choice_label' => function ($user) { 'choice_label' => function ($user) {
return $user->getLastname() . ' ' . $user->getFirstname() . ' (' . $user->getEmail() . ')'; return $user->getLastname() . ' ' . $user->getFirstname() . ' (' . $user->getEmail() . ')';
...@@ -419,31 +426,58 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -419,31 +426,58 @@ class PrestataireAdmin extends AbstractAdmin
// )) // ))
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager(); $em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
$formMapper->getFormBuilder()->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { $formMapper->getFormBuilder()->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($existingCaissiers) {
$prestataire = $event->getData(); $prestataire = $event->getData();
$users = null; $users = null;
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
/* /*
Permet d'ajouter le nouvel utilisateur crée (newusers) aux gestionnaires du presta Permet d'ajouter le nouvel utilisateur créé (newusers) aux gestionnaires du presta
(On crée un compte adhérent en même temps que le prestataire) (On crée un compte adhérent en même temps que le prestataire)
Ajoute et/ou supprime le(s) caissier(s)
*/ */
if (null != $event->getForm()->get('users')->getData()) { if (null != $event->getForm()->get('users')->getData()) {
$users = $event->getForm()->get('users')->getData(); $users = $event->getForm()->get('users')->getData();
$this->addUsersOrCaissers($users, $prestataire); $this->addUsersOrCaissiers($users, $prestataire);
} }
if (null != $event->getForm()->get('caissiers')->getData()) { if (null != $event->getForm()->get('caissiers')->getData()) {
$caissiers = $event->getForm()->get('caissiers')->getData(); $caissiers = $event->getForm()->get('caissiers')->getData(); // instances of user here
$this->addUsersOrCaissers($caissiers, $prestataire, 'ROLE_CAISSIER'); $this->addUsersOrCaissiers($caissiers, $prestataire, 'ROLE_CAISSIER');
// Remove caissiers: get difference between existing caissier and caissiers set in field
$caissiersToRemove = [];
foreach ($existingCaissiers as $existingCaissier) {
$remove = true;
foreach ($caissiers as $caissierUser) {
if ($existingCaissier->getUser()->getId() === $caissierUser->getId()) {
$remove = false;
break;
}
}
if (true === $remove) {
// if user is only caissier for this prestataire and caissier is removed,
// remove role caissier for user
if (count($existingCaissier->getUser()->getCaissiers()) === 1) {
$groupeCaissier = $em->getRepository(Usergroup::class)->findOneByName('Caissier');
$existingCaissier->getUser()->removePossibleGroup($groupeCaissier);
}
// Remove caissier from prestataire
$prestataire->removeCaissier($existingCaissier);
}
}
} }
if (null != $event->getForm()->get('newusers')->getData()) { if (null != $event->getForm()->get('newusers')->getData()) {
$newusers = $event->getForm()->get('newusers')->getData(); $newusers = $event->getForm()->get('newusers')->getData();
$return = $this->addUsersOrCaissers($newusers, $prestataire); $return = $this->addUsersOrCaissiers($newusers, $prestataire);
if (false === $return) { if (false === $return) {
$event->getForm()->get('newusers')->addError(new FormError('Gestionnaires : Courriel(s) déjà utilisé : ' . implode(', ', $return) . '!')); $event->getForm()->get('newusers')->addError(new FormError('Gestionnaires : Courriel(s) déjà utilisé : ' . implode(', ', $return) . '!'));
} }
} }
if (null != $event->getForm()->get('newcaissiers')->getData()) { if (null != $event->getForm()->get('newcaissiers')->getData()) {
$newcaissiers = $event->getForm()->get('newcaissiers')->getData(); $newcaissiers = $event->getForm()->get('newcaissiers')->getData();
$return = $this->addUsersOrCaissers($newcaissiers, $prestataire, 'ROLE_CAISSIER'); $return = $this->addUsersOrCaissiers($newcaissiers, $prestataire, 'ROLE_CAISSIER');
if (count($return) > 0) { if (count($return) > 0) {
$event->getForm()->get('newcaissiers')->addError(new FormError('Caissiers : Courriel(s) déjà utilisé : ' . implode(', ', $return) . '!')); $event->getForm()->get('newcaissiers')->addError(new FormError('Caissiers : Courriel(s) déjà utilisé : ' . implode(', ', $return) . '!'));
} }
...@@ -452,7 +486,7 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -452,7 +486,7 @@ class PrestataireAdmin extends AbstractAdmin
parent::configureFormFields($formMapper); parent::configureFormFields($formMapper);
} }
private function addUsersOrCaissers($users, Prestataire $prestataire, string $role = 'ROLE_PRESTATAIRE') private function addUsersOrCaissiers($users, Prestataire $prestataire, string $role = 'ROLE_PRESTATAIRE')
{ {
$return = []; $return = [];
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager(); $em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
...@@ -474,18 +508,27 @@ class PrestataireAdmin extends AbstractAdmin ...@@ -474,18 +508,27 @@ class PrestataireAdmin extends AbstractAdmin
} }
if ('ROLE_PRESTATAIRE' == $role) { if ('ROLE_PRESTATAIRE' == $role) {
$prestataire->addUser($user); $prestataire->addUser($user);
$groupePresta = $em->getRepository(Usergroup::class)->findOneByName('Prestataire');
if ($newUser) { if ($newUser) {
$this->eventDispatcher->dispatch(MLCEvents::REGISTRATION_PRESTATAIRE, new PrestataireEvent($user, $prestataire, $this->getRequest())); $this->eventDispatcher->dispatch(MLCEvents::REGISTRATION_PRESTATAIRE, new PrestataireEvent($user, $prestataire, $this->getRequest()));
} }
$groupePresta = $em->getRepository(Usergroup::class)->findOneByName('Prestataire');
$user->addPossiblegroup($groupePresta);
} elseif ('ROLE_CAISSIER' == $role) { } elseif ('ROLE_CAISSIER' == $role) {
$prestataire->addCaissier($user); $caissier = $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(Caissier::class)->findOneBy(['prestataire' => $prestataire, 'user' => $user]);
$groupePresta = $em->getRepository(Usergroup::class)->findOneByName('Caissier'); if (null === $caissier) {
$caissier = new Caissier();
$caissier->setUser($user);
$caissier->setPrestataire($prestataire);
$em->persist($caissier);
}
$prestataire->addCaissier($caissier);
if ($newUser) { if ($newUser) {
$this->eventDispatcher->dispatch(MLCEvents::REGISTRATION_CAISSIER, new PrestataireEvent($user, $prestataire, $this->getRequest())); $this->eventDispatcher->dispatch(MLCEvents::REGISTRATION_CAISSIER, new PrestataireEvent($user, $prestataire, $this->getRequest()));
} }
$groupeCaissier = $em->getRepository(Usergroup::class)->findOneByName('Caissier');
$user->addPossiblegroup($groupeCaissier);
} }
$user->addPossiblegroup($groupePresta);
$this->userManager->updateCanonicalFields($user); $this->userManager->updateCanonicalFields($user);
$em->persist($user); $em->persist($user);
if ($newUser) { if ($newUser) {
......
...@@ -6,6 +6,7 @@ use App\Entity\AccountComptoir; ...@@ -6,6 +6,7 @@ use App\Entity\AccountComptoir;
use App\Entity\AccountGroupe; use App\Entity\AccountGroupe;
use App\Entity\AccountPrestataire; use App\Entity\AccountPrestataire;
use App\Entity\AccountSiege; use App\Entity\AccountSiege;
use App\Entity\Caissier;
use App\Entity\Comptoir; use App\Entity\Comptoir;
use App\Entity\Geoloc; use App\Entity\Geoloc;
use App\Entity\GeolocPrestataire; use App\Entity\GeolocPrestataire;
...@@ -696,11 +697,12 @@ class IndexController extends AbstractController ...@@ -696,11 +697,12 @@ class IndexController extends AbstractController
public function prestaChoiceAction(Usergroup $group, Prestataire $prestataire, Request $request) public function prestaChoiceAction(Usergroup $group, Prestataire $prestataire, Request $request)
{ {
$this->em->refresh($this->getUser()); $this->em->refresh($this->getUser());
if (!(($this->getUser()->getPossiblegroups()->exists(function ($key, $value) {
return in_array('ROLE_PRESTATAIRE', $value->getRoles()); // prevent operation if user isn't a prestataire
}) and $this->getUser()->getPrestataires()->contains($prestataire)) || (($this->getUser()->getPossiblegroups()->exists(function ($key, $value) { if (
return in_array('ROLE_CAISSIER', $value->getRoles()); !($this->getUser()->getPossiblegroups()->exists(function ($key, $value) {
}) and $this->getUser()->getCaissiers()->contains($prestataire)))) return in_array('ROLE_PRESTATAIRE', $value->getRoles());
}) and $this->getUser()->getPrestataires()->contains($prestataire))
) { ) {
$this->addFlash( $this->addFlash(
'error', 'error',
...@@ -717,6 +719,39 @@ class IndexController extends AbstractController ...@@ -717,6 +719,39 @@ class IndexController extends AbstractController
return $this->redirectToRoute('index'); return $this->redirectToRoute('index');
} }
/**
* Choix du presta géré.
*
* @Route("/login/caissier/choice/{usergrpid}/{caissierid}", name="caissier_choice")
* @ParamConverter("group", class="App:Usergroup", options={"mapping": {"usergrpid": "id"}})
* @ParamConverter("caissier", class="App:Caissier", options={"mapping": {"caissierid": "id"}})
* @IsGranted("ROLE_USER")
*/
public function caissierChoiceAction(Usergroup $group, Caissier $caissier, Request $request)
{
$this->em->refresh($this->getUser());
// prevent operation if user isn't a caissier
if (
!($this->getUser()->getPossiblegroups()->exists(function ($key, $value) {
return in_array('ROLE_CAISSIER', $value->getRoles());
}) and $this->getUser()->getCaissiers()->contains($caissier))
) {
$this->addFlash(
'error',
'Accès impossible !'
);
return $this->redirectToRoute('index');
}
$this->removeOldSessionParams();
// On enregistre le presta choisit en session
$this->session->set('_prestagere', $caissier->getPrestataire());
$this->reloadUserTokenFromGroup($group, $request);
return $this->redirectToRoute('index');
}
/** /**
* @Route("/login/group/choice/{id}", name="usergroup_choice") * @Route("/login/group/choice/{id}", name="usergroup_choice")
* @IsGranted("ROLE_USER") * @IsGranted("ROLE_USER")
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
namespace App\Controller; namespace App\Controller;
use App\Entity\Caissier;
use App\Entity\Groupe; use App\Entity\Groupe;
use App\Entity\Prestataire; use App\Entity\Prestataire;
use App\Entity\Rubrique; use App\Entity\Rubrique;
...@@ -16,18 +17,21 @@ use Symfony\Component\Routing\Annotation\Route; ...@@ -16,18 +17,21 @@ use Symfony\Component\Routing\Annotation\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted; use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\RouterInterface; use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\Security;
class PrestatairesController extends FrontController class PrestatairesController extends FrontController
{ {
protected $em; protected $em;
private $router; private $router;
private $session; private $session;
private $security;
public function __construct(EntityManagerInterface $em, RouterInterface $router, SessionInterface $session) public function __construct(EntityManagerInterface $em, RouterInterface $router, SessionInterface $session, Security $security)
{ {
$this->em = $em; $this->em = $em;
$this->router = $router; $this->router = $router;
$this->session = $session; $this->session = $session;
$this->security = $security;
} }
/** /**
...@@ -165,45 +169,53 @@ class PrestatairesController extends FrontController ...@@ -165,45 +169,53 @@ class PrestatairesController extends FrontController
} }
/** /**
* Get the total transactions amount towards the Prestataire since the last time it was fetched. * Get the total transactions amount towards the Prestataire operated by the connected Caissier,
* Exclude Reconversions from calculation. * since the last time it was fetched.
* *
* @Route("/prestataires/get_last_transactions", name="get_presta_last_transactions") * @Route("/prestataires/get_caissier_last_transactions", name="get_caissier_last_transactions")
* @IsGranted({"ROLE_CAISSIER", "ROLE_PRESTATAIRE"}) * @IsGranted({"ROLE_CAISSIER"})
*/ */
public function getLastTransactionsAmount() public function getLastCaissierTransactionsAmount()
{ {
if (!$this->session->has('_prestagere')) { if (!$this->session->has('_prestagere')) {
return null; return null;
} }
// Get last export datetime (presta creation if first export) $user = $this->security->getUser();
$presta = $this->em->getRepository(Prestataire::class)->findOneById($this->session->get('_prestagere')->getId()); $presta = $this->em->getRepository(Prestataire::class)->findOneById($this->session->get('_prestagere')->getId());
$caissier = $this->em->getRepository(Caissier::class)->findOneBy(['prestataire' => $presta, 'user' => $user]);
$datetime_last_export = $presta->getLastTransactionsExportDatetime(); // Get last caissier export datetime
$datetime_last_export = $caissier->getLastTransactionsExportDatetime();
if (null == $datetime_last_export) { if (null == $datetime_last_export) {
$datetime_last_export = $presta->getCreatedAt(); // for transition purposes from Prestataire level export towards Caissier level export,
// get prestataire last export if caissier export date is not yet set
$datetime_last_export = $caissier->getLastTransactionsExportDatetime();
if (null == $datetime_last_export) {
// prestaire creation if first export
$datetime_last_export = $presta->getCreatedAt();
}
} }
// Get total amount // Get total amount of transactions operated by connecteed Caissier for this Prestataire
$flux = $this->em->getRepository(Flux::class)->getQueryByPrestataire( $flux = $this->em->getRepository(Flux::class)->getQueryByCaissier(
$this->session->get('_prestagere'), $user,
null, $presta,
null,
$datetime_last_export->format(("Y-m-d H:i:s")) $datetime_last_export->format(("Y-m-d H:i:s"))
)->getResult(); )->getResult();
$total_amount = 0; $total_amount = 0;
foreach ($flux as $flux_item) { foreach ($flux as $flux_item) {
// Exclude reconversions from calculation // Exclude reconversions from calculation (extra security but probably unecessary, as reconversions don't have an operator)
if ($flux_item->getType() != "reconversion_prestataire") { if ($flux_item->getType() != "reconversion_prestataire") {
$total_amount += $flux_item->getMontant(); $total_amount += $flux_item->getMontant();
} }
} }
// Set now as this presta last export date // Set now as this caissier last export datetime
$presta->setLastTransactionsExportDatetime(new \Datetime('now')); $caissier->setLastTransactionsExportDatetime(new \Datetime('now'));
$this->em->persist($presta); $this->em->persist($caissier);
$this->em->flush(); $this->em->flush();
$str_datetime = $datetime_last_export->format('d/m/Y H\hi'); $str_datetime = $datetime_last_export->format('d/m/Y H\hi');
......
...@@ -4,6 +4,7 @@ namespace App\Controller; ...@@ -4,6 +4,7 @@ namespace App\Controller;
use App\Entity\AchatMonnaieAConfirmerPrestataire; use App\Entity\AchatMonnaieAConfirmerPrestataire;
use App\Entity\AchatMonnaiePrestataire; use App\Entity\AchatMonnaiePrestataire;
use App\Entity\Caissier;
use App\Entity\GlobalParameter; use App\Entity\GlobalParameter;
use App\Entity\Payment; use App\Entity\Payment;
use App\Entity\Prestataire; use App\Entity\Prestataire;
...@@ -75,12 +76,17 @@ class UserPrestataireController extends FluxController ...@@ -75,12 +76,17 @@ class UserPrestataireController extends FluxController
$this->translator->trans($errorText) $this->translator->trans($errorText)
); );
} else { } else {
// Remove caissier(s) if delete from the field // Remove caissier(s) if deleted from the field
foreach ($originalCaissiers as $oldCaissier) { foreach ($originalCaissiers as $oldCaissier) {
if (!in_array($oldCaissier->getEmail(), $caissiers)) { if (!in_array($oldCaissier->getUser()->getEmail(), $caissiers)) {
$groupePresta = $this->em->getRepository(Usergroup::class)->findOneByName('Caissier'); // if user is only caissier for this prestataire and caissier is removed,
$oldCaissier->removePossibleGroup($groupePresta); // remove role caissier for user
$this->em->persist($oldCaissier); if (count($oldCaissier->getUser()->getCaissiers()) === 1) {
$groupeCaissier = $this->em->getRepository(Usergroup::class)->findOneByName('Caissier');
$oldCaissier->getUser()->removePossibleGroup($groupeCaissier);
$this->em->persist($oldCaissier->getUser());
}
$form->getData()->getCaissiers()->removeElement($oldCaissier); $form->getData()->getCaissiers()->removeElement($oldCaissier);
} }
} }
...@@ -134,12 +140,19 @@ class UserPrestataireController extends FluxController ...@@ -134,12 +140,19 @@ class UserPrestataireController extends FluxController
$user->setEmail($email); $user->setEmail($email);
$user->setUsername($email); $user->setUsername($email);
} }
$prestataire->addCaissier($user); $caissier = $this->em->getRepository(Caissier::class)->findOneBy(['prestataire' => $prestataire, 'user' => $user]);
$groupePresta = $this->em->getRepository(Usergroup::class)->findOneByName('Caissier'); if (null === $caissier) {
$caissier = new Caissier();
$caissier->setUser($user);
$caissier->setPrestataire($prestataire);
$this->em->persist($caissier);
}
$prestataire->addCaissier($caissier);
$groupeCaissier = $this->em->getRepository(Usergroup::class)->findOneByName('Caissier');
if ($newUser) { if ($newUser) {
$this->eventDispatcher->dispatch(MLCEvents::REGISTRATION_CAISSIER, new PrestataireEvent($user, $prestataire, $request)); $this->eventDispatcher->dispatch(MLCEvents::REGISTRATION_CAISSIER, new PrestataireEvent($user, $prestataire, $request));
} }
$user->addPossiblegroup($groupePresta); $user->addPossiblegroup($groupeCaissier);
$this->userManager->updateCanonicalFields($user); $this->userManager->updateCanonicalFields($user);
$this->em->persist($user); $this->em->persist($user);
if ($newUser) { if ($newUser) {
......
<?php
namespace App\Entity;
use App\Repository\CaissierRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CaissierRepository::class)
*/
class Caissier
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="caissiers")
* @ORM\JoinColumn(nullable=false)
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity=Prestataire::class, inversedBy="caissiers")
* @ORM\JoinColumn(nullable=false)
*/
private $prestataire;
/**
* Caissiers can export all the transactions since the last export.
*
* @ORM\Column(type="datetime", nullable=true)
*/
private $lastTransactionsExportDatetime;
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getPrestataire(): ?Prestataire
{
return $this->prestataire;
}
public function setPrestataire(?Prestataire $prestataire): self
{
$this->prestataire = $prestataire;
return $this;
}
public function getLastTransactionsExportDatetime(): ?\DateTimeInterface
{
return $this->lastTransactionsExportDatetime;
}
public function setLastTransactionsExportDatetime(?\DateTimeInterface $lastTransactionsExportDatetime): self
{
$this->lastTransactionsExportDatetime = $lastTransactionsExportDatetime;
return $this;
}
public function __toString()
{
return $this->getUser()->__toString();
}
}
...@@ -291,16 +291,9 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -291,16 +291,9 @@ class Prestataire extends AccountableObject implements AccountableInterface
protected $users; protected $users;
/** /**
* @var ArrayCollection|User[] * @ORM\OneToMany(targetEntity=Caissier::class, mappedBy="prestataire", orphanRemoval=true)
*
* @ORM\ManyToMany(targetEntity="User", inversedBy="caissiers", cascade={"persist"})
* @ORM\JoinTable(name="user_caissier",
* joinColumns={@ORM\JoinColumn(name="prestataire_id", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")}
* )
* @Groups({"read", "write"})
*/ */
protected $caissiers; private $caissiers;
/** /**
* @var Groupe * @var Groupe
...@@ -359,7 +352,9 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -359,7 +352,9 @@ class Prestataire extends AccountableObject implements AccountableInterface
private $comments; private $comments;
/** /**
* Caissiers can export all the transactions since the last export. * [UNUSED]
* This field has been moved to the Caissier entity.
* This field is kept for transitions purposes only and isn't updated anymore.
* *
* @ORM\Column(type="datetime", nullable=true) * @ORM\Column(type="datetime", nullable=true)
*/ */
...@@ -794,9 +789,9 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -794,9 +789,9 @@ class Prestataire extends AccountableObject implements AccountableInterface
} }
/** /**
* @return ArrayCollection[]|User * @return Collection<int, Caissier>
*/ */
public function getCaissiers() public function getCaissiers(): Collection
{ {
return $this->caissiers; return $this->caissiers;
} }
...@@ -872,31 +867,23 @@ class Prestataire extends AccountableObject implements AccountableInterface ...@@ -872,31 +867,23 @@ class Prestataire extends AccountableObject implements AccountableInterface
return $this; return $this;
} }
/** public function addCaissier(Caissier $caissier): self
* @param User $caissier
*
* @return $this
*/
public function addCaissier(User $caissier): self
{ {
if (!$this->caissiers->contains($caissier)) { if (!$this->caissiers->contains($caissier)) {
$this->caissiers[] = $caissier; $this->caissiers[] = $caissier;
$caissier->addCaissier($this); $caissier->setPrestataire($this);
} }
return $this; return $this;
} }
/** public function removeCaissier(Caissier $caissier): self
* @param User $caissier
*
* @return $this
*/
public function removeCaissier(User $caissier)
{ {
if ($this->caissiers->contains($caissier)) { if ($this->caissiers->removeElement($caissier)) {
$this->caissiers->removeElement($caissier); // set the owning side to null (unless already changed)
$caissier->removeCaissier($this); if ($caissier->getPrestataire() === $this) {
$caissier->setPrestataire(null);
}
} }
return $this; return $this;
......
...@@ -126,9 +126,9 @@ class User extends BaseUser ...@@ -126,9 +126,9 @@ class User extends BaseUser
protected $prestataires; protected $prestataires;
/** /**
* @ORM\ManyToMany(targetEntity="App\Entity\Prestataire", mappedBy="caissiers", cascade={"persist"}, fetch="EAGER") * @ORM\OneToMany(targetEntity=Caissier::class, mappedBy="user", orphanRemoval=true)
*/ */
protected $caissiers; private $caissiers;
/** /**
* @ORM\ManyToMany(targetEntity="App\Entity\Groupe", mappedBy="gestionnaires", cascade={"persist"}, fetch="EAGER") * @ORM\ManyToMany(targetEntity="App\Entity\Groupe", mappedBy="gestionnaires", cascade={"persist"}, fetch="EAGER")
...@@ -418,48 +418,35 @@ class User extends BaseUser ...@@ -418,48 +418,35 @@ class User extends BaseUser
} }
/** /**
* Get caissiers. * @return Collection<int, Caissier>
*
* @return
*/ */
public function getCaissiers() public function getCaissiers(): Collection
{ {
return $this->caissiers; return $this->caissiers;
} }
/** public function addCaissier(Caissier $caissier): self
* @param Prestataire $caissier
*
* @return $this
*/
public function addCaissier(Prestataire $caissier): self
{ {
if (!$this->caissiers->contains($caissier)) { if (!$this->caissiers->contains($caissier)) {
$this->caissiers[] = $caissier; $this->caissiers[] = $caissier;
$caissier->setUser($this);
} }
return $this; return $this;
} }
/** public function removeCaissier(Caissier $caissier): self
* @param Prestataire $caissier
*
* @return $this
*/
public function removeCaissier(Prestataire $caissier): self
{ {
if ($this->caissiers->contains($caissier)) { if ($this->caissiers->removeElement($caissier)) {
$this->caissiers->removeElement($caissier); // set the owning side to null (unless already changed)
if ($caissier->getUser() === $this) {
$caissier->setUser(null);
}
} }
return $this; return $this;
} }
/**
* Set caissier.
*
* @return $this
*/
public function setCaissiers($caissiers): self public function setCaissiers($caissiers): self
{ {
$this->caissiers = $caissiers; $this->caissiers = $caissiers;
......
...@@ -38,7 +38,7 @@ class LoginListener ...@@ -38,7 +38,7 @@ class LoginListener
if (in_array('ROLE_PRESTATAIRE', $groupe->getRoles()) && count($user->getPrestataires()) >= 1) { if (in_array('ROLE_PRESTATAIRE', $groupe->getRoles()) && count($user->getPrestataires()) >= 1) {
$this->session->set('_prestagere', $user->getPrestataires()[0]); $this->session->set('_prestagere', $user->getPrestataires()[0]);
} elseif (in_array('ROLE_CAISSIER', $groupe->getRoles()) && count($user->getCaissiers()) >= 1) { } elseif (in_array('ROLE_CAISSIER', $groupe->getRoles()) && count($user->getCaissiers()) >= 1) {
$this->session->set('_prestagere', $user->getCaissiers()[0]); $this->session->set('_prestagere', $user->getCaissiers()[0]->getPrestataire());
} elseif (in_array('ROLE_COMPTOIR', $groupe->getRoles()) && count($user->getComptoirsGeres()) >= 1) { } elseif (in_array('ROLE_COMPTOIR', $groupe->getRoles()) && count($user->getComptoirsGeres()) >= 1) {
$this->session->set('_comptoirgere', $user->getComptoirsGeres()[0]); $this->session->set('_comptoirgere', $user->getComptoirsGeres()[0]);
} elseif ((in_array('ROLE_TRESORIER', $groupe->getRoles()) || in_array('ROLE_CONTACT', $groupe->getRoles()) || in_array('ROLE_GESTION_GROUPE', $groupe->getRoles())) && count($user->getGroupesGeres()) >= 1) { } elseif ((in_array('ROLE_TRESORIER', $groupe->getRoles()) || in_array('ROLE_CONTACT', $groupe->getRoles()) || in_array('ROLE_GESTION_GROUPE', $groupe->getRoles())) && count($user->getGroupesGeres()) >= 1) {
......
...@@ -103,7 +103,7 @@ class SwitchUserSubscriber implements EventSubscriberInterface ...@@ -103,7 +103,7 @@ class SwitchUserSubscriber implements EventSubscriberInterface
if (in_array('ROLE_PRESTATAIRE', $groupe->getRoles()) && count($user->getPrestataires()) >= 1) { if (in_array('ROLE_PRESTATAIRE', $groupe->getRoles()) && count($user->getPrestataires()) >= 1) {
$this->session->set('_prestagere', $user->getPrestataires()[0]); $this->session->set('_prestagere', $user->getPrestataires()[0]);
} elseif (in_array('ROLE_CAISSIER', $groupe->getRoles()) && count($user->getCaissiers()) >= 1) { } elseif (in_array('ROLE_CAISSIER', $groupe->getRoles()) && count($user->getCaissiers()) >= 1) {
$this->session->set('_prestagere', $user->getCaissiers()[0]); $this->session->set('_prestagere', $user->getCaissiers()[0]->getPrestataire());
} elseif (in_array('ROLE_COMPTOIR', $groupe->getRoles()) && count($user->getComptoirsGeres()) >= 1) { } elseif (in_array('ROLE_COMPTOIR', $groupe->getRoles()) && count($user->getComptoirsGeres()) >= 1) {
$this->session->set('_comptoirgere', $user->getComptoirsGeres()[0]); $this->session->set('_comptoirgere', $user->getComptoirsGeres()[0]);
} elseif ((in_array('ROLE_TRESORIER', $groupe->getRoles()) || in_array('ROLE_CONTACT', $groupe->getRoles()) || in_array('ROLE_GESTION_GROUPE', $groupe->getRoles())) && count($user->getGroupesGeres()) >= 1) { } elseif ((in_array('ROLE_TRESORIER', $groupe->getRoles()) || in_array('ROLE_CONTACT', $groupe->getRoles()) || in_array('ROLE_GESTION_GROUPE', $groupe->getRoles())) && count($user->getGroupesGeres()) >= 1) {
......
...@@ -82,6 +82,13 @@ class CustomDoctrineORMQuerySourceIterator extends AbstractPropertySourceIterato ...@@ -82,6 +82,13 @@ class CustomDoctrineORMQuerySourceIterator extends AbstractPropertySourceIterato
$firstCotis = $this->cotisationUtils->getFirstCotisationForPresta($presta); $firstCotis = $this->cotisationUtils->getFirstCotisationForPresta($presta);
$firstCotis = is_string($firstCotis) ? new \DateTime( $firstCotis ) : $firstCotis; $firstCotis = is_string($firstCotis) ? new \DateTime( $firstCotis ) : $firstCotis;
$data['Première Cotisation'] = false == $firstCotis ? '' : ($firstCotis->format('d/m/Y')); $data['Première Cotisation'] = false == $firstCotis ? '' : ($firstCotis->format('d/m/Y'));
if ($this->container->getParameter('tav_env')) {
$adresses = [];
foreach ($presta->getGeolocs() as $geoloc) {
$adresses[] = $geoloc ? $geoloc->getFullAddresse() : "";
}
$data['Adresses'] = implode(' - ', $adresses);
}
} elseif (!empty($data['Id']) && !empty($data['Email'])) { } elseif (!empty($data['Id']) && !empty($data['Email'])) {
//adherent //adherent
$adherent = $this->em->getRepository(Adherent::class)->findOneById($data['Id']); $adherent = $this->em->getRepository(Adherent::class)->findOneById($data['Id']);
...@@ -111,6 +118,7 @@ class CustomDoctrineORMQuerySourceIterator extends AbstractPropertySourceIterato ...@@ -111,6 +118,7 @@ class CustomDoctrineORMQuerySourceIterator extends AbstractPropertySourceIterato
if ($this->container->getParameter('ccas_mode')) { if ($this->container->getParameter('ccas_mode')) {
$data['Numéro d\'anonymisation'] = $adherent->getAnonymousToken(); $data['Numéro d\'anonymisation'] = $adherent->getAnonymousToken();
} }
$data["Adresse"] = (string) ($adherent->getGeoloc() ?: '');
} else { } else {
$cotisEnd = $this->cotisationUtils->isCotisationValidForAdherent($adherent); $cotisEnd = $this->cotisationUtils->isCotisationValidForAdherent($adherent);
$cotisEnd = is_string($cotisEnd) ? new \DateTime( $cotisEnd ) : $cotisEnd; $cotisEnd = is_string($cotisEnd) ? new \DateTime( $cotisEnd ) : $cotisEnd;
......
...@@ -45,7 +45,7 @@ class PrestataireInfosFormType extends AbstractType ...@@ -45,7 +45,7 @@ class PrestataireInfosFormType extends AbstractType
if ('' !== $caissiers) { if ('' !== $caissiers) {
$caissiers .= ';'; $caissiers .= ';';
} }
$caissiers .= $caissier->getEmail(); $caissiers .= $caissier->getUser()->getEmail();
} }
} }
$builder $builder
......
...@@ -119,7 +119,7 @@ class AfterLoginRedirection implements AuthenticationSuccessHandlerInterface ...@@ -119,7 +119,7 @@ class AfterLoginRedirection implements AuthenticationSuccessHandlerInterface
if (in_array('ROLE_PRESTATAIRE', $groupe->getRoles()) && count($user->getPrestataires()) >= 1) { if (in_array('ROLE_PRESTATAIRE', $groupe->getRoles()) && count($user->getPrestataires()) >= 1) {
$this->session->set('_prestagere', $user->getPrestataires()[0]); $this->session->set('_prestagere', $user->getPrestataires()[0]);
} elseif (in_array('ROLE_CAISSIER', $groupe->getRoles()) && count($user->getCaissiers()) >= 1) { } elseif (in_array('ROLE_CAISSIER', $groupe->getRoles()) && count($user->getCaissiers()) >= 1) {
$this->session->set('_prestagere', $user->getCaissiers()[0]); $this->session->set('_prestagere', $user->getCaissiers()[0]->getPrestataire());
} elseif (in_array('ROLE_COMPTOIR', $groupe->getRoles()) && count($user->getComptoirsGeres()) >= 1) { } elseif (in_array('ROLE_COMPTOIR', $groupe->getRoles()) && count($user->getComptoirsGeres()) >= 1) {
$this->session->set('_comptoirgere', $user->getComptoirsGeres()[0]); $this->session->set('_comptoirgere', $user->getComptoirsGeres()[0]);
} elseif ((in_array('ROLE_TRESORIER', $groupe->getRoles()) || in_array('ROLE_CONTACT', $groupe->getRoles()) || in_array('ROLE_GESTION_GROUPE', $groupe->getRoles())) && count($user->getGroupesGeres()) >= 1) { } elseif ((in_array('ROLE_TRESORIER', $groupe->getRoles()) || in_array('ROLE_CONTACT', $groupe->getRoles()) || in_array('ROLE_GESTION_GROUPE', $groupe->getRoles())) && count($user->getGroupesGeres()) >= 1) {
......
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20250422095126 extends AbstractMigration
{
public function getDescription() : string
{
return 'Operations related to changing ManyToMany relationship "caissiers" to explicit relation entity "Caissier"';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user_caissier DROP FOREIGN KEY FK_FF8E6FC2A76ED395');
$this->addSql('ALTER TABLE user_caissier DROP FOREIGN KEY FK_FF8E6FC2BE3DB2B7');
$this->addSql('ALTER TABLE user_caissier ADD id INT AUTO_INCREMENT NOT NULL, ADD last_transactions_export_datetime DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime_immutable)\', DROP PRIMARY KEY, ADD PRIMARY KEY (id)');
$this->addSql('ALTER TABLE user_caissier RENAME TO caissier');
$this->addSql('ALTER TABLE caissier ADD CONSTRAINT FK_1F038BC2A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE caissier ADD CONSTRAINT FK_1F038BC2BE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE caissier DROP FOREIGN KEY FK_1F038BC2A76ED395');
$this->addSql('ALTER TABLE caissier DROP FOREIGN KEY FK_1F038BC2BE3DB2B7');
$this->addSql('ALTER TABLE caissier DROP PRIMARY KEY, ADD PRIMARY KEY (prestataire_id, user_id), DROP COLUMN id, DROP COLUMN last_transactions_export_datetime');
$this->addSql('ALTER TABLE caissier RENAME TO user_caissier');
$this->addSql('ALTER TABLE user_caissier ADD CONSTRAINT FK_FF8E6FC2A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)');
$this->addSql('ALTER TABLE user_caissier ADD CONSTRAINT FK_FF8E6FC2BE3DB2B7 FOREIGN KEY (prestataire_id) REFERENCES prestataire (id)');
}
}
<?php
namespace App\Repository;
use App\Entity\Caissier;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\OptimisticLockException;
use Doctrine\ORM\ORMException;
use Doctrine\Persistence\ManagerRegistry;
/**
* @extends ServiceEntityRepository<Caissier>
*
* @method Caissier|null find($id, $lockMode = null, $lockVersion = null)
* @method Caissier|null findOneBy(array $criteria, array $orderBy = null)
* @method Caissier[] findAll()
* @method Caissier[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class CaissierRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Caissier::class);
}
/**
* @throws ORMException
* @throws OptimisticLockException
*/
public function add(Caissier $entity, bool $flush = true): void
{
$this->_em->persist($entity);
if ($flush) {
$this->_em->flush();
}
}
/**
* @throws ORMException
* @throws OptimisticLockException
*/
public function remove(Caissier $entity, bool $flush = true): void
{
$this->_em->remove($entity);
if ($flush) {
$this->_em->flush();
}
}
// /**
// * @return Caissier[] Returns an array of Caissier objects
// */
/*
public function findByExampleField($value)
{
return $this->createQueryBuilder('c')
->andWhere('c.exampleField = :val')
->setParameter('val', $value)
->orderBy('c.id', 'ASC')
->setMaxResults(10)
->getQuery()
->getResult()
;
}
*/
/*
public function findOneBySomeField($value): ?Caissier
{
return $this->createQueryBuilder('c')
->andWhere('c.exampleField = :val')
->setParameter('val', $value)
->getQuery()
->getOneOrNullResult()
;
}
*/
}
...@@ -177,19 +177,27 @@ class FluxRepository extends ServiceEntityRepository ...@@ -177,19 +177,27 @@ class FluxRepository extends ServiceEntityRepository
} }
/** /**
* @param Prestataire $presta * @param User $user operator of the flux
* @param bool $onlySameDay * @param Prestataire $presta
* @param string $from Date from which to fetch the flux
* *
* @return Query Returns a query fo finding an array of Flux * @return Query Returns a query fo finding an array of Flux
*/ */
public function getQueryByCaissier(Prestataire $presta, $onlySameDay = true) public function getQueryByCaissier(User $user, Prestataire $presta, $from = true)
{ {
$sqlQuery = "SELECT f.id FROM {$this->tableName} f WHERE ((f.type = 'adherent_prestataire' AND f.prestataire_id = :id) OR (f.type = 'prestataire_prestataire' AND f.prestataire_dest_id = :id))"; $sqlQuery = "SELECT f.id FROM {$this->tableName} f";
if ($onlySameDay) { $sqlQuery .= " WHERE ((f.type = 'adherent_prestataire' AND f.prestataire_id = :pid) OR (f.type = 'prestataire_prestataire' AND f.prestataire_dest_id = :pid))";
$sqlQuery .= ' AND DATE(f.created_at) = CURDATE()'; $sqlQuery .= " AND f.user_id = :cid"; // set operateur
if ($from != null) {
$sqlQuery .= " AND f.created_at >= :from";
} }
$statement = $this->connection->prepare($sqlQuery); $statement = $this->connection->prepare($sqlQuery);
$statement->bindValue(':id', $presta->getId()); $statement->bindValue(':pid', $presta->getId());
$statement->bindValue(':cid', $user->getId());
if ($from != null) {
$statement->bindValue(':from', $from);
}
$statement->execute(); $statement->execute();
$results = $statement->fetchAll(); $results = $statement->fetchAll();
$qb = $this->createQueryBuilder('f'); $qb = $this->createQueryBuilder('f');
......
...@@ -7,6 +7,7 @@ use App\Entity\AchatMonnaieAConfirmerPrestataire; ...@@ -7,6 +7,7 @@ use App\Entity\AchatMonnaieAConfirmerPrestataire;
use App\Entity\AchatMonnaieAdherent; use App\Entity\AchatMonnaieAdherent;
use App\Entity\AchatMonnaiePrestataire; use App\Entity\AchatMonnaiePrestataire;
use App\Entity\Adherent; use App\Entity\Adherent;
use App\Entity\Caissier;
use App\Entity\Comptoir; use App\Entity\Comptoir;
use App\Entity\CotisationAdherent; use App\Entity\CotisationAdherent;
use App\Entity\CotisationPrestataire; use App\Entity\CotisationPrestataire;
...@@ -106,7 +107,7 @@ class AppExtension extends AbstractExtension ...@@ -106,7 +107,7 @@ class AppExtension extends AbstractExtension
new \Twig_SimpleFunction('getPaymentReceiptUrlFromFlux', [$this, 'getPaymentReceiptUrlFromFlux']), new \Twig_SimpleFunction('getPaymentReceiptUrlFromFlux', [$this, 'getPaymentReceiptUrlFromFlux']),
new \Twig_SimpleFunction('getDonType', [$this, 'getDonType']), new \Twig_SimpleFunction('getDonType', [$this, 'getDonType']),
new \Twig_SimpleFunction('getLastTavCotisationForAdherent', [$this, 'getLastTavCotisationForAdherent']), new \Twig_SimpleFunction('getLastTavCotisationForAdherent', [$this, 'getLastTavCotisationForAdherent']),
new \Twig_SimpleFunction('getPrestaLastTransactionsExportDate', [$this, 'getPrestaLastTransactionsExportDate']), new \Twig_SimpleFunction('getCaissierLastTransactionsExportDate', [$this, 'getCaissierLastTransactionsExportDate']),
new \Twig_SimpleFunction('checkExistingRecurringPayment', [$this, 'checkExistingRecurringPayment']), new \Twig_SimpleFunction('checkExistingRecurringPayment', [$this, 'checkExistingRecurringPayment']),
new \Twig_SimpleFunction('parameter', function ($name) { new \Twig_SimpleFunction('parameter', function ($name) {
return $this->container->getParameter($name); return $this->container->getParameter($name);
...@@ -478,7 +479,7 @@ class AppExtension extends AbstractExtension ...@@ -478,7 +479,7 @@ class AppExtension extends AbstractExtension
if ($this->security->isGranted('ROLE_PRESTATAIRE')) { if ($this->security->isGranted('ROLE_PRESTATAIRE')) {
$query = $this->em->getRepository(Flux::class)->getQueryByPrestataire($this->session->get('_prestagere'), $parenttype); $query = $this->em->getRepository(Flux::class)->getQueryByPrestataire($this->session->get('_prestagere'), $parenttype);
} elseif ($this->security->isGranted('ROLE_CAISSIER')) { } elseif ($this->security->isGranted('ROLE_CAISSIER')) {
$query = $this->em->getRepository(Flux::class)->getQueryByCaissier($this->session->get('_prestagere')); $query = $this->em->getRepository(Flux::class)->getQueryByCaissier($user, $this->session->get('_prestagere'));
} }
} elseif (null != $user->getAdherent()) { } elseif (null != $user->getAdherent()) {
$query = $this->em->getRepository(Flux::class)->getQueryByAdherent($user->getAdherent(), $parenttype); $query = $this->em->getRepository(Flux::class)->getQueryByAdherent($user->getAdherent(), $parenttype);
...@@ -549,15 +550,17 @@ class AppExtension extends AbstractExtension ...@@ -549,15 +550,17 @@ class AppExtension extends AbstractExtension
return str_replace('@', '&#64;', $email); return str_replace('@', '&#64;', $email);
} }
public function getPrestaLastTransactionsExportDate(?Adherent $adherent = null) public function getCaissierLastTransactionsExportDate(?Adherent $adherent = null)
{ {
if (!$this->session->has('_prestagere')) { if (!$this->session->has('_prestagere')) {
return null; return null;
} }
$presta = $this->em->getRepository(Prestataire::class)->findOneById($this->session->get('_prestagere')->getId()); $presta = $this->em->getRepository(Prestataire::class)->findOneById($this->session->get('_prestagere')->getId());
$user = $this->security->getUser();
$caissier = $this->em->getRepository(Caissier::class)->findOneBy(['prestataire' => $presta, 'user' => $user]);
$datetime_last_export = $presta->getLastTransactionsExportDatetime(); $datetime_last_export = $caissier->getLastTransactionsExportDatetime();
$res = ""; $res = "";
if (null == $datetime_last_export) { if (null == $datetime_last_export) {
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
</div> </div>
{% endfor %} {% endfor %}
{% elseif role == 'ROLE_CAISSIER' %} {% elseif role == 'ROLE_CAISSIER' %}
{% for presta in app.user.caissiers %} {% for caissier in app.user.caissiers %}
<div class='col-6 text-center p-2'> <div class='col-6 text-center p-2'>
<a role="button" class="btn btn-default btn-secondary" href='{{path('presta_choice', {'prestaid' : presta.id, 'usergrpid': group.id})}}'>{{ group.name|trans }} - {{presta}} </a> <a role="button" class="btn btn-default btn-secondary" href='{{path('caissier_choice', {'caissierid' : caissier.id, 'usergrpid': group.id})}}'>{{ group.name|trans }} - {{caissier.prestataire}} </a>
</div> </div>
{% endfor %} {% endfor %}
{% elseif role == 'ROLE_COMPTOIR' %} {% elseif role == 'ROLE_COMPTOIR' %}
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
<i class="fa fa-list-alt mr-4"></i> {{'Transactions'|trans }} <i class="fa fa-list-alt mr-4"></i> {{'Transactions'|trans }}
{% endblock blocktitle %} {% endblock blocktitle %}
{% block blockcontent %} {% block blockcontent %}
{% set datetime_last_export = getPrestaLastTransactionsExportDate() %} {% set datetime_last_export = getCaissierLastTransactionsExportDate() %}
<p>Récupérer le montant total des transactions (hors reconversions) depuis le <b>{{ datetime_last_export }}</b></p> <p>Récupérer le montant total des transactions opérées par ce compte Caissier (hors reconversions) depuis le <b>{{ datetime_last_export }}</b></p>
<a class='btn btn-xs btn-primary mt-2' href='{{ path('get_presta_last_transactions') }}'> <a class='btn btn-xs btn-primary mt-2' href='{{ path('get_caissier_last_transactions') }}'>
{{ 'Exporter'|trans }} {{ 'Exporter'|trans }}
</a> </a>
{% endblock blockcontent %} {% endblock blockcontent %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment