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
3ae5203e
Commit
3ae5203e
authored
Jun 06, 2022
by
Julien Jorry
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Solidoume : fix check in redistribution
parent
c52d983a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
PrestataireAdmin.php
src/Admin/PrestataireAdmin.php
+1
-1
SolidoumeCommand.php
src/Command/SolidoumeCommand.php
+21
-2
No files found.
src/Admin/PrestataireAdmin.php
View file @
3ae5203e
...
@@ -405,7 +405,7 @@ class PrestataireAdmin extends AbstractAdmin
...
@@ -405,7 +405,7 @@ class PrestataireAdmin extends AbstractAdmin
$em
=
$this
->
getConfigurationPool
()
->
getContainer
()
->
get
(
'doctrine'
)
->
getManager
();
$em
=
$this
->
getConfigurationPool
()
->
getContainer
()
->
get
(
'doctrine'
)
->
getManager
();
foreach
(
$users
as
$user
)
{
foreach
(
$users
as
$user
)
{
$newUser
=
false
;
$newUser
=
false
;
if
(
null
==
$user
->
getId
())
{
if
(
null
==
$user
||
null
==
$user
->
getId
())
{
$newUser
=
true
;
$newUser
=
true
;
$emailExist
=
$em
->
getRepository
(
User
::
class
)
->
findBy
([
'email'
=>
$user
->
getEmail
()]);
$emailExist
=
$em
->
getRepository
(
User
::
class
)
->
findBy
([
'email'
=>
$user
->
getEmail
()]);
if
(
count
(
$emailExist
)
>
0
)
{
if
(
count
(
$emailExist
)
>
0
)
{
...
...
src/Command/SolidoumeCommand.php
View file @
3ae5203e
...
@@ -236,7 +236,7 @@ class SolidoumeCommand extends Command
...
@@ -236,7 +236,7 @@ class SolidoumeCommand extends Command
private
function
executeProgram
()
private
function
executeProgram
()
{
{
$nowDay
=
(
new
\DateTime
(
'now'
,
new
\DateTimeZone
(
'UTC'
)))
->
format
(
'd'
);
$nowDay
=
(
new
\DateTime
(
'now'
,
new
\DateTimeZone
(
'UTC'
)))
->
format
(
'd'
);
// @TODO : uncomment this !
if
(
!
$this
->
testExecute
&&
$nowDay
!=
$this
->
param
->
getExecutionDate
())
{
if
(
!
$this
->
testExecute
&&
$nowDay
!=
$this
->
param
->
getExecutionDate
())
{
$this
->
io
->
warning
(
"Ce n'est pas le jour d'execution du programme ("
.
$this
->
param
->
getExecutionDate
()
.
')'
);
$this
->
io
->
warning
(
"Ce n'est pas le jour d'execution du programme ("
.
$this
->
param
->
getExecutionDate
()
.
')'
);
}
else
{
}
else
{
...
@@ -250,7 +250,7 @@ class SolidoumeCommand extends Command
...
@@ -250,7 +250,7 @@ class SolidoumeCommand extends Command
$countPerson
=
0
;
$countPerson
=
0
;
$countParticipants
=
0
;
$countParticipants
=
0
;
foreach
(
$items
as
$item
)
{
foreach
(
$items
as
$item
)
{
if
(
$
item
->
isEnabled
(
))
{
if
(
$
this
->
isItemPayedThisMonth
(
$item
))
{
$total
+=
$item
->
getAmount
();
$total
+=
$item
->
getAmount
();
if
(
!
$item
->
getIsDonation
())
{
if
(
!
$item
->
getIsDonation
())
{
++
$countParticipants
;
++
$countParticipants
;
...
@@ -313,6 +313,25 @@ class SolidoumeCommand extends Command
...
@@ -313,6 +313,25 @@ class SolidoumeCommand extends Command
return
null
;
return
null
;
}
}
private
function
isItemPayedThisMonth
(
SolidoumeItem
$item
)
:
bool
{
$nowMonth
=
intval
((
new
\DateTime
(
'now'
,
new
\DateTimeZone
(
'UTC'
)))
->
format
(
'Ym'
));
$lastMonth
=
intval
((
new
\DateTime
(
'now -1month'
,
new
\DateTimeZone
(
'UTC'
)))
->
format
(
'Ym'
));
if
(
$item
->
isEnabled
()
&&
null
!=
$item
->
getLastMonthPayed
())
{
if
(
$item
->
getPaiementDate
()
<=
$this
->
param
->
getExecutionDate
()
&&
$item
->
getPaiementDate
()
>=
1
)
{
if
(
$item
->
getLastMonthPayed
()
==
$nowMonth
)
{
return
true
;
}
}
else
{
if
(
$item
->
getLastMonthPayed
()
==
$lastMonth
)
{
return
true
;
}
}
}
return
false
;
}
/**
/**
* Has to execute reminder by email ? Check date of paiement choose by adherent and number of days before remind.
* Has to execute reminder by email ? Check date of paiement choose by adherent and number of days before remind.
*
*
...
...
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