Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos-tav
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
agplv3
kohinos-tav
Commits
e03379b1
Commit
e03379b1
authored
Apr 11, 2025
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add param to set or not a cotisation minimum
parent
c447632f
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
15 deletions
+44
-15
AdherentAdmin.php
src/Admin/AdherentAdmin.php
+12
-15
GlobalParameter.php
src/Entity/GlobalParameter.php
+1
-0
Version20250411142610.php
src/Migrations/Version20250411142610.php
+31
-0
No files found.
src/Admin/AdherentAdmin.php
View file @
e03379b1
...
@@ -329,11 +329,11 @@ class AdherentAdmin extends AbstractAdmin
...
@@ -329,11 +329,11 @@ class AdherentAdmin extends AbstractAdmin
$maxAllocationAmount
=
$em
->
getRepository
(
GlobalParameter
::
class
)
$maxAllocationAmount
=
$em
->
getRepository
(
GlobalParameter
::
class
)
->
val
(
GlobalParameter
::
SSA_HOUSEHOLD_MAX_ALLOCATION_AMOUNT
);
->
val
(
GlobalParameter
::
SSA_HOUSEHOLD_MAX_ALLOCATION_AMOUNT
);
if
(
null
!==
$maxAllocationAmount
&&
''
!==
$maxAllocationAmount
)
{
$allowanceCalculationLimitationMsg
=
(
null
!==
$maxAllocationAmount
)
?
" dans la limite de
{
$maxAllocationAmount
}
{
$mlc
}
"
:
''
;
$allowanceCalculationLimitationMsg
=
" dans la limite de
{
$maxAllocationAmount
}
{
$mlc
}
"
;
}
else
{
$minCotisationAmount
=
$em
->
getRepository
(
GlobalParameter
::
class
)
$allowanceCalculationLimitationMsg
=
''
;
->
val
(
GlobalParameter
::
SSA_HOUSEHOLD_COTISATION_MINIMUM
)
;
}
$minCotisationMsg
=
(
null
!==
$minCotisationAmount
)
?
"Montant minimum :
{
$minCotisationAmount
}
€ par foyer."
:
''
;
// Add cotisation info
// Add cotisation info
$formMapper
$formMapper
...
@@ -344,7 +344,7 @@ class AdherentAdmin extends AbstractAdmin
...
@@ -344,7 +344,7 @@ class AdherentAdmin extends AbstractAdmin
])
])
->
add
(
'cotisationAmount'
,
NumberType
::
class
,
[
->
add
(
'cotisationAmount'
,
NumberType
::
class
,
[
'label'
=>
'Montant de la cotisation (en €)'
,
'label'
=>
'Montant de la cotisation (en €)'
,
'help'
=>
$
simplified_household_based_allowance
?
''
:
'Montant minimum : 10€ par foyer + 5€/personne supplémentaire du foyer'
,
'help'
=>
$
minCotisationMsg
,
'disabled'
=>
$disableHouseholdAllowanceFields
,
'disabled'
=>
$disableHouseholdAllowanceFields
,
])
])
->
add
(
'allocationAmount'
,
NumberType
::
class
,
[
->
add
(
'allocationAmount'
,
NumberType
::
class
,
[
...
@@ -559,15 +559,12 @@ class AdherentAdmin extends AbstractAdmin
...
@@ -559,15 +559,12 @@ class AdherentAdmin extends AbstractAdmin
}
}
if
(
$this
->
getConfigurationPool
()
->
getContainer
()
->
getParameter
(
'household_based_allowance'
))
{
if
(
$this
->
getConfigurationPool
()
->
getContainer
()
->
getParameter
(
'household_based_allowance'
))
{
if
(
!
$this
->
getConfigurationPool
()
->
getContainer
()
->
getParameter
(
'simplified_household_based_allowance'
))
{
// check cotisation amount above minimum if activated
// check cotisation amount
$minCotisationAmount
=
$em
->
getRepository
(
GlobalParameter
::
class
)
$adultsCount
=
$adherent
->
getHouseholdAdultCount
();
->
val
(
GlobalParameter
::
SSA_HOUSEHOLD_COTISATION_MINIMUM
);
$dependentChildrenCount
=
count
(
$adherent
->
getDependentChildren
());
$minCotisationAmount
=
10
+
5
*
(
$adultsCount
-
1
)
+
5
*
$dependentChildrenCount
;
if
(
null
!==
$minCotisationAmount
&&
$adherent
->
getCotisationAmount
()
<
(
int
)
$minCotisationAmount
)
{
$event
->
getForm
()
->
get
(
'cotisationAmount'
)
->
addError
(
new
FormError
(
'Champ invalide'
));
if
(
$adherent
->
getCotisationAmount
()
<
$minCotisationAmount
)
{
$event
->
getForm
()
->
get
(
'cotisationAmount'
)
->
addError
(
new
FormError
(
'Le montant minimum est de '
.
$minCotisationAmount
.
'€ (selon les données du foyer indiquées)'
));
}
}
}
// try to fix balance if required
// try to fix balance if required
...
...
src/Entity/GlobalParameter.php
View file @
e03379b1
...
@@ -67,6 +67,7 @@ class GlobalParameter
...
@@ -67,6 +67,7 @@ class GlobalParameter
const
SSA_HOUSEHOLD_DEPENDANT_CHILD_UNDER_LIMIT_AMOUNT
=
'SSA_HOUSEHOLD_DEPENDANT_CHILD_UNDER_LIMIT_AMOUNT'
;
const
SSA_HOUSEHOLD_DEPENDANT_CHILD_UNDER_LIMIT_AMOUNT
=
'SSA_HOUSEHOLD_DEPENDANT_CHILD_UNDER_LIMIT_AMOUNT'
;
const
SSA_HOUSEHOLD_USE_SHARED_CUSTODY
=
'SSA_HOUSEHOLD_USE_SHARED_CUSTODY'
;
const
SSA_HOUSEHOLD_USE_SHARED_CUSTODY
=
'SSA_HOUSEHOLD_USE_SHARED_CUSTODY'
;
const
SSA_HOUSEHOLD_MAX_ALLOCATION_AMOUNT
=
'SSA_HOUSEHOLD_MAX_ALLOCATION_AMOUNT'
;
const
SSA_HOUSEHOLD_MAX_ALLOCATION_AMOUNT
=
'SSA_HOUSEHOLD_MAX_ALLOCATION_AMOUNT'
;
const
SSA_HOUSEHOLD_COTISATION_MINIMUM
=
'SSA_HOUSEHOLD_COTISATION_MINIMUM'
;
/**
/**
* @var \Ramsey\Uuid\UuidInterface
* @var \Ramsey\Uuid\UuidInterface
*
*
...
...
src/Migrations/Version20250411142610.php
0 → 100644
View file @
e03379b1
<?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
Version20250411142610
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(), 'SSA_HOUSEHOLD_COTISATION_MINIMUM', 'Si défini, valeur minimum de cotisation', '10', '0')"
);
}
public
function
down
(
Schema
$schema
)
:
void
{
$this
->
addSql
(
"DELETE FROM global_parameter WHERE name='SSA_HOUSEHOLD_COTISATION_MINIMUM'"
);
// this down() migration is auto-generated, please modify it to your needs
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment