Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
kohinos
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
9
Issues
9
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
cooperatic-mlc
kohinos
Commits
c3b15b73
Commit
c3b15b73
authored
Jan 29, 2021
by
Mathieu Poisbeau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #469: le solde de monnaie nantie doit diminuer
parent
56c08ee3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
13 deletions
+10
-13
TransfertPrestataireComptoir.php
src/Entity/TransfertPrestataireComptoir.php
+9
-2
FluxListener.php
src/Listener/FluxListener.php
+1
-11
No files found.
src/Entity/TransfertPrestataireComptoir.php
View file @
c3b15b73
...
...
@@ -38,11 +38,18 @@ class TransfertPrestataireComptoir extends Transfert
$this
->
getDestinataire
()
->
addCompte
(
$this
->
getMontant
());
$this
->
getDestinataire
()
->
getGroupe
()
->
getSiege
()
->
removeCompteNantie
(
$this
->
getMontant
());
return
[
$this
->
getExpediteur
(),
$this
->
getDestinataire
()];
return
[
$this
->
getExpediteur
(),
$this
->
getDestinataire
(),
$this
->
getDestinataire
()
->
getGroupe
()
->
getSiege
(),
// fix #469: do not forget to persist the 'Siege' entity
];
}
public
function
getUsersToNotify
()
{
return
array_merge
(
$this
->
getDestinataire
()
->
getGestionnaires
()
->
toArray
(),
$this
->
getExpediteur
()
->
getUsers
()
->
toArray
());
return
array_merge
(
$this
->
getDestinataire
()
->
getGestionnaires
()
->
toArray
(),
$this
->
getExpediteur
()
->
getUsers
()
->
toArray
()
);
}
}
src/Listener/FluxListener.php
View file @
c3b15b73
<?php
namespace
App\Listener
;
use
App\Entity\Flux
;
use
Doctrine\Common\EventSubscriber
;
use
Doctrine\ORM\EntityManagerInterface
;
use
Doctrine\ORM\Event\OnFlushEventArgs
;
use
Doctrine\ORM\Events
;
use
Symfony\Component\Security\Core\Security
;
class
FluxListener
implements
EventSubscriber
{
private
$em
;
private
$security
;
public
function
__construct
(
EntityManagerInterface
$em
,
Security
$security
)
{
$this
->
em
=
$em
;
$this
->
security
=
$security
;
}
public
function
getSubscribedEvents
()
{
return
array
(
Events
::
onFlush
);
...
...
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