mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 18:44:16 +00:00
Fix #3234
This commit is contained in:
@@ -659,7 +659,7 @@ class ExportDataGenerator
|
||||
$collector = app(GroupCollectorInterface::class);
|
||||
$collector->setUser($this->user);
|
||||
$collector->setRange($this->start, $this->end)->withAccountInformation()->withCategoryInformation()->withBillInformation()
|
||||
->withBudgetInformation();
|
||||
->withBudgetInformation()->withTagInformation();
|
||||
$journals = $collector->getExtractedJournals();
|
||||
|
||||
$records = [];
|
||||
@@ -689,8 +689,9 @@ class ExportDataGenerator
|
||||
$journal['category_name'],
|
||||
$journal['budget_name'],
|
||||
$journal['bill_name'],
|
||||
implode(',', $journal['tags']),
|
||||
$this->mergeTags($journal['tags']),
|
||||
];
|
||||
|
||||
}
|
||||
|
||||
//load the CSV document from a string
|
||||
@@ -705,4 +706,22 @@ class ExportDataGenerator
|
||||
return $csv->getContent(); //returns the CSV document as a string
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $tags
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
private function mergeTags(array $tags): string
|
||||
{
|
||||
if (0 === count($tags)) {
|
||||
return '';
|
||||
}
|
||||
$smol = [];
|
||||
foreach ($tags as $tag) {
|
||||
$smol[] = $tag['name'];
|
||||
}
|
||||
|
||||
return implode(',', $smol);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user