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
7a518f57
Commit
7a518f57
authored
May 06, 2024
by
Yvon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ccas : create ccas dedicated check for transaction cancellation
parent
0e358c9e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
14 deletions
+33
-14
UserController.php
src/Controller/UserController.php
+33
-14
No files found.
src/Controller/UserController.php
View file @
7a518f57
...
...
@@ -287,20 +287,39 @@ class UserController extends AbstractController
return
$this
->
redirectToRoute
(
'index'
);
}
//Prevent cancelling transactions which happened before a reconversion (to avoid refunding money that's been reconverted)
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'
);
//Ccas transactions.
if
(
$transactionAdherentPrestataire
->
getIsCcas
())
{
//Allowed if and only if transaction is from current month
$now
=
new
\DateTime
();
if
(
$transactionAdherentPrestataire
->
getCreatedAt
()
->
format
(
'm'
)
!==
$now
->
format
(
'm'
)
||
$transactionAdherentPrestataire
->
getCreatedAt
()
->
format
(
'Y'
)
!==
$now
->
format
(
'Y'
)
)
{
//display the same error message for CCAS or non CCAS as prestataire are not supposed to know if a transaction is CCAS or not
$this
->
addFlash
(
'error'
,
'Cette transaction ne plus être annulée car une reconversion a été demandée depuis.'
);
return
$this
->
redirectToRoute
(
'index'
);
}
}
//Non ccas transactions,
else
{
//we prevent cancelling transactions which happened before a reconversion (to avoid refunding money that's been reconverted)
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
...
...
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