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
5ec6fb59
Commit
5ec6fb59
authored
May 03, 2024
by
Damien Moulard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ccas: mark transaction as ccas
parent
22a234c3
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
3 deletions
+61
-3
UserController.php
src/Controller/UserController.php
+10
-0
Adherent.php
src/Entity/Adherent.php
+2
-2
Prestataire.php
src/Entity/Prestataire.php
+1
-1
TransactionAdherentPrestataire.php
src/Entity/TransactionAdherentPrestataire.php
+17
-0
Version20240503101225.php
src/Migrations/Version20240503101225.php
+31
-0
No files found.
src/Controller/UserController.php
View file @
5ec6fb59
...
@@ -459,6 +459,16 @@ class UserController extends AbstractController
...
@@ -459,6 +459,16 @@ class UserController extends AbstractController
$now
=
(
new
\Datetime
(
'now'
))
->
format
(
'd/m/Y H:i:s'
);
$now
=
(
new
\Datetime
(
'now'
))
->
format
(
'd/m/Y H:i:s'
);
$flux
->
setReference
(
'Achat en Monnaie Solidaire du '
.
$now
);
$flux
->
setReference
(
'Achat en Monnaie Solidaire du '
.
$now
);
// Mark transaction as CCAS if at the time of the transation, both adherent & presta are CCAS complient
if
(
$this
->
getParameter
(
'ccas_mode'
)
&&
$adherent
->
getCcasEligible
()
&&
$adherent
->
getCcasAccepted
()
&&
$presta
->
getCcasOk
()
)
{
$flux
->
setIsCcas
(
true
);
}
$this
->
em
->
persist
(
$flux
);
$this
->
em
->
persist
(
$flux
);
$this
->
operationUtils
->
executeOperations
(
$flux
);
$this
->
operationUtils
->
executeOperations
(
$flux
);
$this
->
em
->
flush
();
$this
->
em
->
flush
();
...
...
src/Entity/Adherent.php
View file @
5ec6fb59
...
@@ -152,12 +152,12 @@ class Adherent extends AccountableObject implements AccountableInterface
...
@@ -152,12 +152,12 @@ class Adherent extends AccountableObject implements AccountableInterface
/**
/**
* @ORM\Column(type="boolean", options={"default": false})
* @ORM\Column(type="boolean", options={"default": false})
*/
*/
private
$ccasEligible
;
private
$ccasEligible
=
false
;
/**
/**
* @ORM\Column(type="string", length=36, nullable=true, unique=true)
* @ORM\Column(type="string", length=36, nullable=true, unique=true)
*/
*/
private
$anonymousToken
;
private
$anonymousToken
=
false
;
public
function
__construct
()
public
function
__construct
()
...
...
src/Entity/Prestataire.php
View file @
5ec6fb59
...
@@ -381,7 +381,7 @@ class Prestataire extends AccountableObject implements AccountableInterface
...
@@ -381,7 +381,7 @@ class Prestataire extends AccountableObject implements AccountableInterface
/**
/**
* @ORM\Column(type="boolean", options={"default": false})
* @ORM\Column(type="boolean", options={"default": false})
*/
*/
private
$ccasOk
;
private
$ccasOk
=
false
;
public
function
__construct
()
public
function
__construct
()
...
...
src/Entity/TransactionAdherentPrestataire.php
View file @
5ec6fb59
...
@@ -38,6 +38,11 @@ class TransactionAdherentPrestataire extends Transaction
...
@@ -38,6 +38,11 @@ class TransactionAdherentPrestataire extends Transaction
protected
$cancellerFlux
;
protected
$cancellerFlux
;
/**
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private
$isCcas
=
false
;
/**
* @return string
* @return string
*/
*/
public
function
getType
()
:
string
public
function
getType
()
:
string
...
@@ -55,4 +60,16 @@ class TransactionAdherentPrestataire extends Transaction
...
@@ -55,4 +60,16 @@ class TransactionAdherentPrestataire extends Transaction
public
function
setCancellerFlux
(
$var
)
{
$this
->
cancellerFlux
=
$var
;}
public
function
setCancellerFlux
(
$var
)
{
$this
->
cancellerFlux
=
$var
;}
public
function
getCancellerFlux
()
{
return
$this
->
cancellerFlux
;}
public
function
getCancellerFlux
()
{
return
$this
->
cancellerFlux
;}
public
function
getIsCcas
()
:
?
bool
{
return
$this
->
isCcas
;
}
public
function
setIsCcas
(
bool
$isCcas
)
:
self
{
$this
->
isCcas
=
$isCcas
;
return
$this
;
}
}
}
src/Migrations/Version20240503101225.php
0 → 100644
View file @
5ec6fb59
<?php
declare
(
strict_types
=
1
);
namespace
DoctrineMigrations
;
use
Doctrine\DBAL\Schema\Schema
;
use
Doctrine\Migrations\AbstractMigration
;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final
class
Version20240503101225
extends
AbstractMigration
{
public
function
getDescription
()
:
string
{
return
''
;
}
public
function
up
(
Schema
$schema
)
:
void
{
// this up() migration is auto-generated, please modify it to your needs
$this
->
addSql
(
'ALTER TABLE flux ADD is_ccas TINYINT(1) DEFAULT \'0\''
);
}
public
function
down
(
Schema
$schema
)
:
void
{
// this down() migration is auto-generated, please modify it to your needs
$this
->
addSql
(
'ALTER TABLE flux DROP is_ccas'
);
}
}
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