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
1
Merge Requests
1
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
f170cc7a
Commit
f170cc7a
authored
Dec 02, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP admin profildecotisation
parent
11bdb966
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
141 additions
and
5 deletions
+141
-5
sonata_admin.yaml
config/packages/sonata_admin.yaml
+1
-0
services.yaml
config/services.yaml
+10
-0
ProfilDeCotisationAdmin.php
src/Admin/ProfilDeCotisationAdmin.php
+85
-0
ProfilDeCotisation.php
src/Entity/ProfilDeCotisation.php
+45
-5
No files found.
config/packages/sonata_admin.yaml
View file @
f170cc7a
...
...
@@ -201,6 +201,7 @@ sonata_admin:
roles
:
[
'
ROLE_SUPER_ADMIN'
,
'
ROLE_ADMIN_ADHERENT_GERER_ALL'
,
'
ROLE_ADMIN_ADHERENT_GERER_CREATE'
]
-
admin.adherent.gerer
-
admin.adherent.cotisations
-
admin.adherent.profilsdecotisation
sonata.admin.group.prestataire
:
keep_open
:
false
label
:
"
Prestataires"
...
...
config/services.yaml
View file @
f170cc7a
...
...
@@ -300,6 +300,16 @@ services:
-
[
setSecurity
,
[
'
@security.helper'
]]
-
[
setOperationUtils
,
[
'
@app.utils.operations'
]]
admin.adherent.profilsdecotisation
:
class
:
App\Admin\ProfilDeCotisationAdmin
arguments
:
[
~
,
App\Entity\ProfilDeCotisation
,
'
App\Controller\CRUD\CRUDController'
]
tags
:
-
name
:
sonata.admin
manager_type
:
orm
group
:
"
Adherent"
label
:
"
Profils
De
Cotisation"
public
:
true
admin.prestataire.gerer
:
class
:
App\Admin\PrestataireAdmin
arguments
:
[
~
,
App\Entity\Prestataire
,
App\Controller\PrestataireAdminController
]
...
...
src/Admin/ProfilDeCotisationAdmin.php
0 → 100644
View file @
f170cc7a
<?php
namespace
App\Admin
;
use
Sonata\AdminBundle\Admin\AbstractAdmin
;
use
Sonata\AdminBundle\Datagrid\DatagridMapper
;
use
Sonata\AdminBundle\Datagrid\ListMapper
;
use
Sonata\AdminBundle\Form\FormMapper
;
use
Sonata\Form\Type\DateTimeRangePickerType
;
use
Symfony\Component\Form\Extension\Core\Type\NumberType
;
/**
* Administration des profils de cotisation.
*
* KOHINOS : Outil de gestion de Monnaie Locale Complémentaire
*
* -------------------------------> TODO
*/
class
ProfilDeCotisationAdmin
extends
AbstractAdmin
{
protected
$baseRouteName
=
'profilcotisation'
;
protected
$baseRoutePattern
=
'profilcotisation'
;
protected
$datagridValues
=
[
'_sort_order'
=>
'DESC'
,
'_sort_by'
=>
'createdAt'
,
];
/**
* {@inheritdoc}
*/
protected
function
configureFormFields
(
FormMapper
$formMapper
)
:
void
{
$formMapper
->
with
(
'Profil'
,
[
'class'
=>
'col-md-12'
])
->
add
(
'tauxCotisation'
,
NumberType
::
class
,
[
'label'
=>
'Taux de cotisation'
])
->
add
(
'maxPercevableMensuel'
,
NumberType
::
class
,
[
'label'
=>
'Montant maximum percevable'
])
->
end
()
;
parent
::
configureFormFields
(
$formMapper
);
}
/**
* {@inheritdoc}
*/
protected
function
configureDatagridFilters
(
DatagridMapper
$datagridMapper
)
:
void
{
$datagridMapper
->
add
(
'createdAt'
,
'doctrine_orm_datetime_range'
,
[
'field_type'
=>
DateTimeRangePickerType
::
class
,
'label'
=>
'Date de création'
,
])
->
add
(
'updatedAt'
,
'doctrine_orm_datetime_range'
,
[
'field_type'
=>
DateTimeRangePickerType
::
class
,
'label'
=>
'Date de mise à jour'
,
])
;
}
protected
function
configureListFields
(
ListMapper
$listMapper
)
:
void
{
$listMapper
->
addIdentifier
(
'tauxCotisation'
,
null
,
[
'label'
=>
'Taux de cotisation'
,
'sortable'
=>
true
])
->
add
(
'user.createdAt'
,
'date'
,
[
'pattern'
=>
'dd/MM/YYYY HH:mm'
,
'label'
=>
'Crée le'
,
])
->
add
(
'user.updatedAt'
,
'date'
,
[
'pattern'
=>
'dd/MM/YYYY HH:mm'
,
'label'
=>
'Mis à jour le'
,
])
->
add
(
'_action'
,
null
,
[
'actions'
=>
[
'edit'
=>
[]],
])
;
}
}
src/Entity/ProfilDeCotisation.php
View file @
f170cc7a
...
...
@@ -19,10 +19,6 @@ use Symfony\Component\Validator\Constraints as Assert;
*/
class
ProfilDeCotisation
{
use
NameSlugContentEntityTrait
;
use
TimestampableEntity
;
use
EnablableEntityTrait
;
/**
* @var \Ramsey\Uuid\UuidInterface
*
...
...
@@ -74,6 +70,50 @@ class ProfilDeCotisation
}
/**
* Get tauxCotisation.
*
* @return float tauxCotisation
*/
public
function
getTauxCotisation
()
:
?
float
{
return
$this
->
tauxCotisation
;
}
/**
* Set tauxCotisation.
*
* @return $this
*/
public
function
setTauxCotisation
(
?
float
$tauxCotisation
)
:
self
{
$this
->
tauxCotisation
=
$tauxCotisation
;
return
$this
;
}
/**
* Get maxPercevableMensuel.
*
* @return string maxPercevableMensuel
*/
public
function
getMaxPercevableMensuel
()
:
?
int
{
return
$this
->
maxPercevableMensuel
;
}
/**
* Set maxPercevableMensuel.
*
* @return $this
*/
public
function
setMaxPercevableMensuel
(
?
int
$maxPercevableMensuel
)
:
self
{
$this
->
maxPercevableMensuel
=
$maxPercevableMensuel
;
return
$this
;
}
/**
* @return ArrayCollection
*/
public
function
getBeneficiaires
()
...
...
@@ -128,7 +168,7 @@ class ProfilDeCotisation
public
function
__toString
()
:
string
{
return
'Profil de taux '
.
strval
(
100
*
$this
->
tauxCotisation
)
.
' %'
return
'Profil de taux '
.
strval
(
$this
->
tauxCotisation
)
.
' et de maximum percevable mensuel '
.
strval
(
$this
->
maxPercevableMensuel
)
.
' €'
;
}
}
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