mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-01-10 04:21:20 +00:00
Fixes #1586
This commit is contained in:
@@ -133,9 +133,9 @@ class ImportableConverter
|
||||
/**
|
||||
* @param string|null $date
|
||||
*
|
||||
* @return string
|
||||
* @return string|null
|
||||
*/
|
||||
private function convertDateValue(string $date = null): string
|
||||
private function convertDateValue(string $date = null): ?string
|
||||
{
|
||||
$result = null;
|
||||
if (null !== $date) {
|
||||
@@ -147,11 +147,6 @@ class ImportableConverter
|
||||
Log::error($e->getTraceAsString());
|
||||
}
|
||||
}
|
||||
if (null === $result) {
|
||||
$object = new Carbon;
|
||||
$result = $object->format('Y-m-d');
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -167,6 +162,8 @@ class ImportableConverter
|
||||
$foreignAmount = $importable->calculateForeignAmount();
|
||||
$amount = $importable->calculateAmount();
|
||||
|
||||
Log::debug('All meta data: ', $importable->meta);
|
||||
|
||||
if ('' === $amount) {
|
||||
$amount = $foreignAmount;
|
||||
}
|
||||
@@ -215,7 +212,7 @@ class ImportableConverter
|
||||
|
||||
return [
|
||||
'type' => $transactionType,
|
||||
'date' => $this->convertDateValue($importable->date),
|
||||
'date' => $this->convertDateValue($importable->date) ?? Carbon::create()->format('Y-m-d'),
|
||||
'tags' => $importable->tags,
|
||||
'user' => $this->importJob->user_id,
|
||||
'notes' => $importable->note,
|
||||
|
||||
Reference in New Issue
Block a user