Commit 12da036d by Damien Moulard

add parameter to activate adherents balance ceiling

parent 7e886ec1
......@@ -15,5 +15,6 @@ twig:
presta_self_init_and_eval: '%env(PRESTA_SELF_INIT_AND_EVAL)%'
presta_extra_data: '%env(PRESTA_EXTRA_DATA)%'
household_based_allowance: '%env(HOUSEHOLD_BASED_ALLOWANCE)%'
simplified_household_based_allowance: '%env(SIMPLIFIED_HOUSEHOLD_BASED_ALLOWANCE)%'
automatisation_reconversion: '%env(AUTOMATISATION_RECONVERSION)%'
ssa_friendly_flux_type_names: '%env(SSA_FRIENDLY_FLUX_TYPE_NAMES)%'
\ No newline at end of file
......@@ -807,6 +807,7 @@ class AdherentAdmin extends AbstractAdmin
protected function configureListFields(ListMapper $listMapper): void
{
$em = $this->getConfigurationPool()->getContainer()->get('doctrine')->getManager();
unset($this->listModes['mosaic']);
$listMapper
->addIdentifier('user.lastname', null, ['label' => 'Nom'])
......@@ -840,8 +841,11 @@ class AdherentAdmin extends AbstractAdmin
]
);
if(
$this->getConfigurationPool()->getContainer()->getParameter('household_based_allowance')
&& !$this->getConfigurationPool()->getContainer()->getParameter('simplified_household_based_allowance')
(
$this->getConfigurationPool()->getContainer()->getParameter('household_based_allowance')
|| $this->getConfigurationPool()->getContainer()->getParameter('simplified_household_based_allowance')
)
&& 'true' == $em->getRepository(GlobalParameter::class)->val(GlobalParameter::ACTIVATE_ADHERENTS_BALANCE_CEILING)
&& (
$this->security->isGranted('ROLE_SUPER_ADMIN')
|| $this->security->isGranted('ROLE_ADMIN_SIEGE')
......
......@@ -54,6 +54,7 @@ class GlobalParameter
const VIREMENT_RECONVERSION_RAISON_GESTIONNAIRE = 'VIREMENT_RECONVERSION_RAISON_GESTIONNAIRE';
const VIREMENT_RECONVERSION_BIC_GESTIONNAIRE = 'VIREMENT_RECONVERSION_BIC_GESTIONNAIRE';
const VIREMENT_RECONVERSION_IBAN_GESTIONNAIRE = 'VIREMENT_RECONVERSION_IBAN_GESTIONNAIRE';
const ACTIVATE_ADHERENTS_BALANCE_CEILING = 'ACTIVATE_ADHERENTS_BALANCE_CEILING';
/**
* @var \Ramsey\Uuid\UuidInterface
......
<?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 Version20250130095533 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql("INSERT INTO global_parameter (id, name, description, value, mandatory) VALUES (UUID(), 'ACTIVATE_ADHERENTS_BALANCE_CEILING', 'Active ou non les fonctionnalités liées au plafond de solde d\'un adhérent', null, '1')");
}
public function down(Schema $schema) : void
{
$this->addSql("DELETE FROM global_parameter where name='ACTIVATE_ADHERENTS_BALANCE_CEILING'");
// this down() migration is auto-generated, please modify it to your needs
}
}
......@@ -3,7 +3,11 @@
{%- spaceless %}
{% set balance = object.user.adherent.emlcAccount.balance %}
{% set ceiling = object.user.adherent.ceiling %}
{% if not ceiling %}
{% if
not ceiling
or household_based_allowance and not simplified_household_based_allowance and (not object.user.adherent.householdAdultCount or not object.user.adherent.cotisationAmount)
or simplified_household_based_allowance and (not object.user.adherent.householdCount or not object.user.adherent.cotisationAmount)
%}
{% set class = 'label label-warning' %}
{% set text = 'profil incomplet' %}
{% elseif balance > ceiling %}
......
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