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
272fbd00
Commit
272fbd00
authored
May 13, 2024
by
Yvon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve month display in export ccas email
parent
4f738436
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
16 deletions
+20
-16
SendCcasTransactionsExportToPrestatairesCommand.php
...mmand/SendCcasTransactionsExportToPrestatairesCommand.php
+17
-13
ccas_transactions.html.twig
...ates/themes/kohinos/email/tav/ccas_transactions.html.twig
+3
-3
No files found.
src/Command/SendCcasTransactionsExportToPrestatairesCommand.php
View file @
272fbd00
...
@@ -9,6 +9,7 @@ use App\Entity\GlobalParameter;
...
@@ -9,6 +9,7 @@ use App\Entity\GlobalParameter;
use
App\Entity\Prestataire
;
use
App\Entity\Prestataire
;
use
App\Utils\CustomEntityManager
;
use
App\Utils\CustomEntityManager
;
use
App\Utils\OperationUtils
;
use
App\Utils\OperationUtils
;
use
IntlDateFormatter
;
use
NumberFormatter
;
use
NumberFormatter
;
use
Symfony\Component\Console\Command\Command
;
use
Symfony\Component\Console\Command\Command
;
use
Symfony\Component\Console\Input\InputInterface
;
use
Symfony\Component\Console\Input\InputInterface
;
...
@@ -57,8 +58,7 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
...
@@ -57,8 +58,7 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
/**
/**
* @param Prestataire $p
* @param Prestataire $p
* @param int $month
* @param $monthYearStr
* @param $year
* @param $montant
* @param $montant
* @param $path
* @param $path
*
*
...
@@ -66,10 +66,10 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
...
@@ -66,10 +66,10 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
* @throws RuntimeError
* @throws RuntimeError
* @throws SyntaxError
* @throws SyntaxError
*/
*/
public
function
prepareMail
(
Prestataire
$p
,
int
$month
,
$yea
r
,
$montant
)
:
\Swift_Message
public
function
prepareMail
(
Prestataire
$p
,
$monthYearSt
r
,
$montant
)
:
\Swift_Message
{
{
$this
->
io
->
text
(
'Envoi du mail pour le prestataire '
.
$p
->
getRaison
());
$this
->
io
->
text
(
'Envoi du mail pour le prestataire '
.
$p
->
getRaison
());
$subject
=
"Expérimentation de Sécurité Sociale de l’Alimentation en Gironde – Facture CCAS
$month
/
$yea
r
"
;
$subject
=
"Expérimentation de Sécurité Sociale de l’Alimentation en Gironde – Facture CCAS
$month
YearSt
r
"
;
$globalParamRepo
=
$this
->
em
->
getRepository
(
GlobalParameter
::
class
);
$globalParamRepo
=
$this
->
em
->
getRepository
(
GlobalParameter
::
class
);
$mail
=
(
new
\Swift_Message
(
$subject
))
$mail
=
(
new
\Swift_Message
(
$subject
))
->
setFrom
(
$globalParamRepo
->
val
(
GlobalParameter
::
MLC_NOTIF_EMAIL
))
->
setFrom
(
$globalParamRepo
->
val
(
GlobalParameter
::
MLC_NOTIF_EMAIL
))
...
@@ -79,10 +79,9 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
...
@@ -79,10 +79,9 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
$this
->
templating
->
render
(
$this
->
templating
->
render
(
'@kohinos/email/tav/ccas_transactions.html.twig'
,
'@kohinos/email/tav/ccas_transactions.html.twig'
,
[
[
'subject'
=>
"Facture CCAS
$month
/
$yea
r
"
,
'subject'
=>
"Facture CCAS
$month
YearSt
r
"
,
'montant'
=>
$montant
,
'montant'
=>
$montant
,
'month'
=>
$month
,
'monthyear'
=>
$monthYearStr
'year'
=>
$year
,
]
]
),
),
'text/html'
'text/html'
...
@@ -200,19 +199,24 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
...
@@ -200,19 +199,24 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
$prestaRepo
=
$this
->
em
->
getRepository
(
Prestataire
::
class
);
$prestaRepo
=
$this
->
em
->
getRepository
(
Prestataire
::
class
);
$prestas
=
$prestaid
?
[
0
=>
$prestaRepo
->
find
(
$prestaid
)]
:
$prestaRepo
->
findAll
();
$prestas
=
$prestaid
?
[
0
=>
$prestaRepo
->
find
(
$prestaid
)]
:
$prestaRepo
->
findAll
();
$dateFormatter
=
new
IntlDateFormatter
(
'fr_FR'
,
IntlDateFormatter
::
NONE
,
IntlDateFormatter
::
NONE
);
$dateFormatter
->
setPattern
(
"MMMM Y"
);
$date
=
new
\DateTime
();
if
(
$yearmonth
)
{
if
(
$yearmonth
)
{
$year
=
substr
(
$yearmonth
,
0
,
4
);
$year
=
substr
(
$yearmonth
,
0
,
4
);
$month
=
intval
(
substr
(
$yearmonth
,
4
,
2
));
$month
=
intval
(
substr
(
$yearmonth
,
4
,
2
));
$date
->
setDate
(
intval
(
$year
),
$month
,
1
);
$monthYearStr
=
$dateFormatter
->
format
(
$date
);
}
else
{
}
else
{
$
now
=
new
\DateTime
(
);
$
date
->
modify
(
'previous month'
);
$
now
->
modify
(
'previous month
'
);
$
year
=
$date
->
format
(
'Y
'
);
$
year
=
$now
->
format
(
'Y'
);
$
month
=
intval
(
$date
->
format
(
'm'
)
);
$month
=
intval
(
$now
->
format
(
'm'
)
);
$month
YearStr
=
$dateFormatter
->
format
(
$date
);
}
}
$this
->
io
->
title
(
$this
->
io
->
title
(
'START. Préparation des exports pour '
.
count
(
$prestas
)
.
' prestataires '
'START. Préparation des exports pour '
.
count
(
$prestas
)
.
' prestataires '
.
'contenant les transactions CCAS
du mois '
.
$month
.
' de l\'année '
.
$yea
r
.
'contenant les transactions CCAS
pour '
.
$monthYearSt
r
);
);
//projectDir is composer.json
//projectDir is composer.json
...
@@ -238,7 +242,7 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
...
@@ -238,7 +242,7 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
//Send mail as soon as there are data or prestataire is CCAS OK
//Send mail as soon as there are data or prestataire is CCAS OK
//If there is no data, just inform there is nothing to do
//If there is no data, just inform there is nothing to do
if
(
$data
||
$p
->
getCcasOk
())
{
if
(
$data
||
$p
->
getCcasOk
())
{
$mail
=
$this
->
prepareMail
(
$p
,
$month
,
$yea
r
,
$prestaTotal
);
$mail
=
$this
->
prepareMail
(
$p
,
$month
YearSt
r
,
$prestaTotal
);
if
(
$path
)
{
if
(
$path
)
{
$mail
->
attach
(
\Swift_Attachment
::
fromPath
(
$path
));
$mail
->
attach
(
\Swift_Attachment
::
fromPath
(
$path
));
}
}
...
...
templates/themes/kohinos/email/tav/ccas_transactions.html.twig
View file @
272fbd00
...
@@ -11,8 +11,8 @@
...
@@ -11,8 +11,8 @@
</p>
</p>
{%
if
montant
>
0
%}
{%
if
montant
>
0
%}
<p>
<p>
Vous trouverez ci-joint l’état mensuel des dépenses en MonA
réalisées au cours du mois
Vous trouverez ci-joint l’état mensuel des dépenses en MonA
en
{{
month
}}
/
{{
year
}}
dans votre point de vente par les allocataires du dispositif de Sécurité Sociale
{{
monthyear
}}
dans votre point de vente par les allocataires du dispositif de Sécurité Sociale
de l'Alimentation en Gironde, pour un montant de
{{
montant
}}
euros.
de l'Alimentation en Gironde, pour un montant de
{{
montant
}}
euros.
</p>
</p>
<p>
<p>
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
</ul>
</ul>
{%
else
%}
{%
else
%}
<p>
<p>
Pour information,
au cours du mois
{{
month
}}
/
{{
year
}}
,
Pour information,
en
{{
month
year
}}
,
vous n'avez pas réalisé de transaction éligible aux reconversions CCAS et vous n'avez donc rien à faire de plus.
vous n'avez pas réalisé de transaction éligible aux reconversions CCAS et vous n'avez donc rien à faire de plus.
</p>
</p>
{%
endif
%}
{%
endif
%}
...
...
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