diff --git a/admin/setup_mvp.php b/admin/setup_mvp.php index 3421f0e..fd2804e 100644 --- a/admin/setup_mvp.php +++ b/admin/setup_mvp.php @@ -40,13 +40,23 @@ if ($action == 'update_mappings') { $ca3_definitions = $config->getCA3LineDefinitions(); $updated_count = 0; + // Debug: Show what's being submitted + $debug_info = array(); + foreach ($ca3_definitions as $line => $definition) { + $account_codes = GETPOST('account_codes_' . $line, 'array'); + $debug_info[] = "$line: " . (is_array($account_codes) ? implode(',', $account_codes) : 'not set'); + } + setEventMessages("Debug: Form data - " . implode(' | ', $debug_info), null, 'warnings'); + foreach ($ca3_definitions as $line => $definition) { $account_codes = GETPOST('account_codes_' . $line, 'array'); - // Process all lines, even empty ones (to clear mappings) - $result = $config->updateAccountMapping($line, $account_codes); - if ($result) { - $updated_count++; + // Process all lines that have form data + if (isset($_POST['account_codes_' . $line])) { + $result = $config->updateAccountMapping($line, $account_codes); + if ($result) { + $updated_count++; + } } }