From fb6474ab88a8ad40917b0c8f1b199e46bebcdd12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Pocrnji=C4=8D?= Date: Tue, 6 Jan 2026 19:39:18 +0100 Subject: [PATCH] changes to old import check if for account if balance_amount and initial_amount are empty or null by default value is set to 0 --- app/Services/ImportProcessor.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Services/ImportProcessor.php b/app/Services/ImportProcessor.php index 6a7ce39..dac06bf 100644 --- a/app/Services/ImportProcessor.php +++ b/app/Services/ImportProcessor.php @@ -1656,6 +1656,10 @@ private function upsertAccount(Import $import, array $mapped, $mappings, bool $h if (in_array($field, ['balance_amount', 'initial_amount'], true) && is_string($value)) { $value = $this->normalizeDecimal($value); } + // Convert empty string to 0 for amount fields + if (in_array($field, ['balance_amount', 'initial_amount'], true) && ($value === '' || $value === null)) { + $value = 0; + } $mode = $map->apply_mode ?? 'both'; if ($mode === 'keyref') { // treat as insert-only field (lookup + create), never update