chane to import

This commit is contained in:
Simon Pocrnjič 2025-10-10 19:00:29 +02:00
parent 0598261cdc
commit afaefa8a9d

View File

@ -1346,7 +1346,12 @@ private function upsertAccount(Import $import, array $mapped, $mappings): array
$applyInsert[$field] = $value; $applyInsert[$field] = $value;
} }
if (in_array($mode, ['update', 'both'])) { if (in_array($mode, ['update', 'both'])) {
$applyUpdate[$field] = $value; // Do not allow updating initial_amount when mapping is update-only
if ($field === 'initial_amount' && $mode === 'update') {
// skip: initial_amount can change only on insert, or when mapping mode is 'both'
} else {
$applyUpdate[$field] = $value;
}
} }
} }