mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 10:16:49 +00:00
Bunq import can now handle timestamps.
This commit is contained in:
@@ -457,7 +457,7 @@ class ImportArrayStorage
|
|||||||
|
|
||||||
Log::debug(sprintf('Going to store entry %d of %d', $index + 1, $count));
|
Log::debug(sprintf('Going to store entry %d of %d', $index + 1, $count));
|
||||||
// convert the date to an object:
|
// convert the date to an object:
|
||||||
$store['date'] = Carbon::createFromFormat('Y-m-d', $store['date']);
|
$store['date'] = Carbon::parse($store['date'], config('app.timezone'));
|
||||||
$store['description'] = '' === $store['description'] ? '(empty description)' : $store['description'];
|
$store['description'] = '' === $store['description'] ? '(empty description)' : $store['description'];
|
||||||
// store the journal.
|
// store the journal.
|
||||||
try {
|
try {
|
||||||
@@ -556,7 +556,7 @@ class ImportArrayStorage
|
|||||||
Log::debug(sprintf('Comparison is a hit! (%s)', $hits));
|
Log::debug(sprintf('Comparison is a hit! (%s)', $hits));
|
||||||
|
|
||||||
// compare date:
|
// compare date:
|
||||||
$transferDate = $transfer->date->format('Y-m-d');
|
$transferDate = $transfer->date->format('Y-m-d H:i:s');
|
||||||
Log::debug(sprintf('Comparing dates "%s" to "%s"', $transaction['date'], $transferDate));
|
Log::debug(sprintf('Comparing dates "%s" to "%s"', $transaction['date'], $transferDate));
|
||||||
if ($transaction['date'] !== $transferDate) {
|
if ($transaction['date'] !== $transferDate) {
|
||||||
continue; // @codeCoverageIgnore
|
continue; // @codeCoverageIgnore
|
||||||
|
@@ -105,7 +105,10 @@ class PaymentConverter
|
|||||||
$type = TransactionType::TRANSFER;
|
$type = TransactionType::TRANSFER;
|
||||||
Log::debug('Because both transctions are asset, will make it a transfer.');
|
Log::debug('Because both transctions are asset, will make it a transfer.');
|
||||||
}
|
}
|
||||||
$created = new Carbon($payment->getCreated());
|
Log::debug(sprintf('Bunq created = %s', $payment->getCreated()));
|
||||||
|
$created = new Carbon($payment->getCreated(), 'UTC');
|
||||||
|
// correct timezone to system timezone.
|
||||||
|
$created->setTimezone(config('app.timezone'));
|
||||||
|
|
||||||
$description = $payment->getDescription();
|
$description = $payment->getDescription();
|
||||||
if ('' === $payment->getDescription() && 'SAVINGS' === $payment->getType()) {
|
if ('' === $payment->getDescription() && 'SAVINGS' === $payment->getType()) {
|
||||||
@@ -115,7 +118,7 @@ class PaymentConverter
|
|||||||
$storeData = [
|
$storeData = [
|
||||||
'user' => $this->importJob->user_id,
|
'user' => $this->importJob->user_id,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'date' => $created->format('Y-m-d'),
|
'date' => $created->format('Y-m-d H:i:s'),
|
||||||
'timestamp' => $created->toAtomString(),
|
'timestamp' => $created->toAtomString(),
|
||||||
'description' => $description,
|
'description' => $description,
|
||||||
'piggy_bank_id' => null,
|
'piggy_bank_id' => null,
|
||||||
@@ -151,7 +154,7 @@ class PaymentConverter
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
Log::info(sprintf('Parsed %s: "%s" (%s).', $created->format('Y-m-d'), $storeData['description'], $storeData['transactions'][0]['amount']));
|
Log::info(sprintf('Parsed %s: "%s" (%s).', $created->format('Y-m-d H:i:s'), $storeData['description'], $storeData['transactions'][0]['amount']));
|
||||||
|
|
||||||
return $storeData;
|
return $storeData;
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ class AuditLogger
|
|||||||
*/
|
*/
|
||||||
public function __invoke($logger)
|
public function __invoke($logger)
|
||||||
{
|
{
|
||||||
$processor = new AuditProcessor();
|
$processor = new AuditProcessor;
|
||||||
$logger->pushProcessor($processor);
|
$logger->pushProcessor($processor);
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -108,7 +108,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width:30%;">{{ trans('list.date') }}</td>
|
<td style="width:30%;">{{ trans('list.date') }}</td>
|
||||||
<td>{{ journal.date.formatLocalized(monthAndDayFormat) }}</td>
|
<td>{{ journal.date.formatLocalized(dateTimeFormat) }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
Reference in New Issue
Block a user