🤖 Auto commit for release 'develop' on 2026-01-23

This commit is contained in:
JC5
2026-01-23 15:14:29 +01:00
parent 8f15a32bd6
commit eeeba86d38
888 changed files with 10732 additions and 10387 deletions

View File

@@ -83,30 +83,31 @@ class IndexController extends Controller
// get first transaction in DB:
$firstDate = today(config('app.timezone'));
$firstDate->subYear();
$journal = $this->journalRepository->firstNull();
$journal = $this->journalRepository->firstNull();
if ($journal instanceof TransactionJournal) {
Log::debug('First journal is NULL, using today() - 1 year.');
$firstDate = clone $journal->date;
}
$generator->setStart($firstDate);
$result = $generator->export();
$result = $generator->export();
$name = sprintf('%s_transaction_export.csv', Carbon::now()->format('Y_m_d'));
$quoted = sprintf('"%s"', addcslashes($name, '"\\'));
$name = sprintf('%s_transaction_export.csv', Carbon::now()->format('Y_m_d'));
$quoted = sprintf('"%s"', addcslashes($name, '"\\'));
// headers for CSV file.
/** @var LaravelResponse $response */
$response = response($result['transactions']);
$response = response($result['transactions']);
$response
->header('Content-Description', 'File Transfer')
->header('Content-Type', 'text/x-csv')
->header('Content-Disposition', 'attachment; filename=' . $quoted)
->header('Content-Disposition', 'attachment; filename='.$quoted)
// ->header('Content-Transfer-Encoding', 'binary')
->header('Connection', 'Keep-Alive')
->header('Expires', '0')
->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
->header('Pragma', 'public')
->header('Content-Length', (string) strlen((string) $result['transactions']));
->header('Content-Length', (string) strlen((string) $result['transactions']))
;
// return CSV file made from 'transactions' array.
return $response;