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
c53a92cc
Commit
c53a92cc
authored
Dec 13, 2022
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check if cotisation profile exists on adherent side
parent
d32f7a49
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
3 deletions
+22
-3
FluxController.php
src/Controller/FluxController.php
+1
-1
UserAdherentController.php
src/Controller/UserAdherentController.php
+13
-0
AchatMonnaieFormType.php
src/Form/Type/AchatMonnaieFormType.php
+1
-1
adherent_payer_cotisation.html.twig
...mes/kohinos/tav/block/adherent_payer_cotisation.html.twig
+7
-1
No files found.
src/Controller/FluxController.php
View file @
c53a92cc
...
@@ -109,7 +109,7 @@ class FluxController extends AbstractController
...
@@ -109,7 +109,7 @@ class FluxController extends AbstractController
TAVCotisationUtils
$tavCotisationsUtils
,
TAVCotisationUtils
$tavCotisationsUtils
,
TokenGeneratorInterface
$tokenGenerator
,
TokenGeneratorInterface
$tokenGenerator
,
ValidatorInterface
$validator
,
ValidatorInterface
$validator
,
CsrfTokenManagerInterface
$tokenManager
,
CsrfTokenManagerInterface
$tokenManager
)
{
)
{
$this
->
security
=
$security
;
$this
->
security
=
$security
;
$this
->
em
=
$em
;
$this
->
em
=
$em
;
...
...
src/Controller/UserAdherentController.php
View file @
c53a92cc
...
@@ -137,6 +137,7 @@ class UserAdherentController extends FluxController
...
@@ -137,6 +137,7 @@ class UserAdherentController extends FluxController
if
(
$form
->
isSubmitted
()
&&
$form
->
isValid
())
{
if
(
$form
->
isSubmitted
()
&&
$form
->
isValid
())
{
// TODO: set CB payment when the functionality is validated
// TODO: set CB payment when the functionality is validated
$flux
=
$form
->
getData
();
$flux
=
$form
->
getData
();
// Look for existing cotisation
// Look for existing cotisation
...
@@ -149,6 +150,18 @@ class UserAdherentController extends FluxController
...
@@ -149,6 +150,18 @@ class UserAdherentController extends FluxController
return
$this
->
redirectToRoute
(
'index'
);
return
$this
->
redirectToRoute
(
'index'
);
}
}
$destinataire
=
$flux
->
getDestinataire
();
$profile
=
$destinataire
->
getProfilDeCotisation
();
if
(
is_null
(
$profile
))
{
$this
->
addFlash
(
'error'
,
$this
->
translator
->
trans
(
'Opération impossible : vous n\'avez pas de profil de cotisation associé. Veuillez contacter un administrateur.'
)
);
return
$this
->
redirectToRoute
(
'index'
);
}
if
(
null
==
$flux
->
getDon
()
||
0
==
$flux
->
getDon
()
->
getMontant
())
{
if
(
null
==
$flux
->
getDon
()
||
0
==
$flux
->
getDon
()
->
getMontant
())
{
$flux
->
setDon
(
null
);
$flux
->
setDon
(
null
);
}
}
...
...
src/Form/Type/AchatMonnaieFormType.php
View file @
c53a92cc
...
@@ -40,7 +40,7 @@ class AchatMonnaieFormType extends FluxFormType
...
@@ -40,7 +40,7 @@ class AchatMonnaieFormType extends FluxFormType
if
(
null
!=
$profilDeCotisation
)
{
if
(
null
!=
$profilDeCotisation
)
{
$montant
=
$profilDeCotisation
->
getMontant
();
$montant
=
$profilDeCotisation
->
getMontant
();
}
else
{
}
else
{
$montant
=
intval
(
$this
->
em
->
getRepository
(
GlobalParameter
::
class
)
->
val
(
GlobalParameter
::
COTISATION_ADHERENT_DEFAULT
))
;
$montant
=
false
;
}
}
$builder
$builder
...
...
templates/themes/kohinos/tav/block/adherent_payer_cotisation.html.twig
View file @
c53a92cc
...
@@ -6,10 +6,13 @@
...
@@ -6,10 +6,13 @@
{%
block
blockcontent
%}
{%
block
blockcontent
%}
{%
set
form
=
getPayerCotisationTAVForm
(
app.user
)
%}
{%
set
form
=
getPayerCotisationTAVForm
(
app.user
)
%}
{%
if
form.montant.vars.value
==
false
%}
<p>
{{
'Vous n\'avez pas de profil de cotisation associé, vous ne pouvez donc pas payer de cotisation.'
|
trans
}}
</p>
<p>
{{
'Veuillez contacter un administrateur.'
|
trans
}}
</p>
{%
else
%}
<p>
<p>
{{
'Montant de la cotisation à payer'
|
trans
}}
:
<span
class=
"paiement_cotisation_montant"
>
{{
form.montant.vars.value
}}
€
</span>
{{
'Montant de la cotisation à payer'
|
trans
}}
:
<span
class=
"paiement_cotisation_montant"
>
{{
form.montant.vars.value
}}
€
</span>
</p>
</p>
{{
form_start
(
form
)
}}
{{
form_start
(
form
)
}}
{%
if
form.don
is
defined
%}
{%
if
form.don
is
defined
%}
{{
form_row
(
form.don
,
{
row_attr
:{
style
:
'max-width: 200px;margin: 0 auto;'
}}
) }}
{{
form_row
(
form.don
,
{
row_attr
:{
style
:
'max-width: 200px;margin: 0 auto;'
}}
) }}
...
@@ -23,5 +26,7 @@
...
@@ -23,5 +26,7 @@
{{
form_widget
(
form.saveHelloAsso
)
}}
{{
form_widget
(
form.saveHelloAsso
)
}}
{%
endif
%}
{%
endif
%}
{{
form_end
(
form
)
}}
{{
form_end
(
form
)
}}
{%
endif
%}
{%
endblock
blockcontent
%}
{%
endblock
blockcontent
%}
\ No newline at end of file
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