Commit fade8390 by Félicie

balance shown

parent 16872361
......@@ -119,19 +119,6 @@ class AdherentAdmin extends AbstractAdmin
]);
}
protected function configureShowFields(ShowMapper $showMapper): void
{
if ($this->getConfigurationPool()->getContainer()->getParameter('tav_env')) {
$adherent = $this->getSubject();
$balance = $adherent->getEmlcAccount()->getBalance();
$showMapper
->with('Solde', ['class' => 'col-md-12'])
->add('Solde : ' . $balance, TextType::class)
->end()
;
}
}
/**
* {@inheritdoc}
*/
......@@ -199,6 +186,19 @@ class AdherentAdmin extends AbstractAdmin
])
->end()
->end();
if (!empty($adherent) && !empty($adherent->getEmlcAccount()) ) {
$balance = $adherent->getEmlcAccount()->getBalance();
$formMapper
->tab('General')
->with('Solde', ['class' => 'col-md-5'])
->add('idmlc', TextType::class, [
'disabled' => true,
'label' => 'Solde e-mac : ',
'data' => $balance . ' emac'])
->end()
->end();
}
}
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
......@@ -514,3 +514,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