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
6
Merge Requests
6
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
970e19ce
Commit
970e19ce
authored
Apr 29, 2024
by
Yvon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prevent cancelling transactions which happened before last reconversion
parent
2072962f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
UserController.php
src/Controller/UserController.php
+18
-0
No files found.
src/Controller/UserController.php
View file @
970e19ce
...
...
@@ -8,6 +8,7 @@ use App\Entity\CotisationPrestataire;
use
App\Entity\GlobalParameter
;
use
App\Entity\Payment
;
use
App\Entity\Prestataire
;
use
App\Entity\Reconversion
;
use
App\Entity\TransactionPrestataireAdherent
;
use
App\Entity\User
;
use
App\Entity\TransactionAdherentPrestataire
;
...
...
@@ -31,6 +32,7 @@ use Symfony\Component\Routing\Annotation\Route;
use
Symfony\Component\Security\Core\Security
;
use
Symfony\Component\Translation\TranslatorInterface
;
use
Twig\Environment
;
use
App\Entity\Flux
;
class
UserController
extends
AbstractController
{
...
...
@@ -285,6 +287,22 @@ class UserController extends AbstractController
return
$this
->
redirectToRoute
(
'index'
);
}
//Prevent cancelling transactions which happened before the most recent reconversion (SSA Gironde sprint 4 ; see sprint 5 for CCAS specific case)
if
(
$this
->
em
->
getRepository
(
Flux
::
class
)
->
getQueryByPrestataire
(
$presta
,
null
,
Reconversion
::
TYPE_RECONVERSION_PRESTATAIRE
,
$transactionAdherentPrestataire
->
getCreatedAt
()
->
format
(
"Y-m-d H:i:s"
)
)
->
getResult
()
)
{
$this
->
addFlash
(
'error'
,
'Cette transaction ne plus être annulée car une reconversion a été demandée depuis.'
);
return
$this
->
redirectToRoute
(
'index'
);
}
//Create new transaction in opposite direction
$flux
=
new
TransactionPrestataireAdherent
();
$flux
->
setExpediteur
(
$presta
);
...
...
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