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
3
Merge Requests
3
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
d18f317b
Commit
d18f317b
authored
8 months ago
by
Yvon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use semicolon as separator instead of komma for excel auto column split
parent
6a72ef72
1 merge request
!109
Modifs suite retour mail et justif reconv ccas
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
SendCcasTransactionsExportToPrestatairesCommand.php
...mmand/SendCcasTransactionsExportToPrestatairesCommand.php
+11
-6
No files found.
src/Command/SendCcasTransactionsExportToPrestatairesCommand.php
View file @
d18f317b
...
...
@@ -98,6 +98,11 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
return
$mail
;
}
private
function
fputcsvSeparatedBySemicolon
(
$file
,
$arr
)
{
fputcsv
(
$file
,
$arr
,
";"
);
}
/**
* @param $year
* @param int $month
...
...
@@ -121,8 +126,8 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
$file
=
fopen
(
$path
,
'w'
);
//Write header
fputcsv
(
$file
,
[
"Num
é
ro d'anonymisation"
,
$this
->
fputcsvSeparatedBySemicolon
(
$file
,
[
"Num
e
ro d'anonymisation"
,
'Montant (€)'
,
'Montant en lettres'
,
'Date'
,
...
...
@@ -137,7 +142,7 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
foreach
(
$data
as
$row
)
{
//Write intermediate total line before moving to next client
if
(
$previousAnonymousToken
!==
$row
[
'anonymous_token'
])
{
fputcsv
(
$file
,
[
$this
->
fputcsvSeparatedBySemicolon
(
$file
,
[
'TOTAL '
.
$row
[
'anonymous_token'
],
$clientTotal
,
$nf
->
format
(
$clientTotal
),
...
...
@@ -146,7 +151,7 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
$clientTotal
=
0
;
}
//Write transaction line
fputcsv
(
$file
,
[
$this
->
fputcsvSeparatedBySemicolon
(
$file
,
[
$row
[
'anonymous_token'
],
$row
[
'montant'
],
$this
->
currencySpellout
(
$nf
,
$row
[
'montant'
]),
...
...
@@ -156,14 +161,14 @@ class SendCcasTransactionsExportToPrestatairesCommand extends Command
$prestaTotal
+=
$row
[
'montant'
];
}
//Write last intermediate total line
fputcsv
(
$file
,
[
$this
->
fputcsvSeparatedBySemicolon
(
$file
,
[
'TOTAL '
.
$row
[
'anonymous_token'
],
number_format
(
$clientTotal
,
2
),
$this
->
currencySpellout
(
$nf
,
$clientTotal
),
''
,
]);
//Write final total line
fputcsv
(
$file
,
[
$this
->
fputcsvSeparatedBySemicolon
(
$file
,
[
'TOTAL '
.
$p
->
getRaison
(),
number_format
(
$prestaTotal
,
2
),
$this
->
currencySpellout
(
$nf
,
$prestaTotal
),
...
...
This diff is collapsed.
Click to expand it.
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