Project 'cooperatic/kohinos-tav' was moved to 'agplv3/kohinos-tav'. Please update any links and bookmarks that may still have the old path.
Commit f0844afc by Damien Moulard

Merge branch '3590-show-balance-inhabitant' into 'develop'

3590-show-balance-inhabitant

See merge request cooperatic/kohinos-tav!16
parents 7e05daf3 5befa416
......@@ -6,6 +6,7 @@ use App\Entity\AccountAdherent;
use App\Entity\Adherent;
use App\Entity\CotisationAdherent;
use App\Entity\Geoloc;
use App\Entity\GlobalParameter;
use App\Entity\Groupe;
use App\Entity\User;
use App\Entity\Usergroup;
......@@ -26,6 +27,7 @@ use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\ProxyQueryInterface;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Sonata\AdminBundle\Show\ShowMapper;
use Sonata\DoctrineORMAdminBundle\Datagrid\OrderByToSelectWalker;
use Sonata\DoctrineORMAdminBundle\Filter\CallbackFilter;
use Sonata\Form\Type\DateTimeRangePickerType;
......@@ -171,10 +173,10 @@ class AdherentAdmin extends AbstractAdmin
if ($this->getConfigurationPool()->getContainer()->getParameter('tav_env')) {
$formMapper
->tab('General')
->with('Profil de cotisation', ['class' => 'col-md-5'])
->with('Informations de cotisation', ['class' => 'col-md-5'])
->add('profilDeCotisation', ChoiceType::class, [
'required' => true,
'label' => 'Choix du profil :',
'label' => 'Choix du profil de cotisation :',
'choices' => $this->getConfigurationPool()->getContainer()->get('doctrine')->getRepository(ProfilDeCotisation::class)->findAll(),
'empty_data' => null,
'placeholder' => 'Choisir un profil',
......@@ -188,6 +190,23 @@ class AdherentAdmin extends AbstractAdmin
])
->end()
->end();
if (!empty($adherent) && !empty($adherent->getEmlcAccount()) ) {
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
$balance = $adherent->getEmlcAccount()->getBalance();
$mlc = $em->getRepository(GlobalParameter::class)->val(GlobalParameter::MLC_SYMBOL);
$formMapper
->tab('General')
->with('Informations de cotisation')
->add('idmlc', TextType::class, [
'disabled' => true,
'required' => false,
'label' => 'Solde e-' . $mlc . ' :',
'data' => $balance . ' ' . $mlc
])
->end()
->end();
}
}
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
......@@ -524,3 +543,4 @@ class AdherentAdmin extends AbstractAdmin
return $iterator;
}
}
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