diff --git a/admin/setup_mvp.php b/admin/setup_mvp.php index 2b6cfb6..0ad1d19 100644 --- a/admin/setup_mvp.php +++ b/admin/setup_mvp.php @@ -94,6 +94,11 @@ if ($action == 'update_vat_refund_threshold') { 'refund_threshold_enabled' => GETPOST('vat_refund_threshold_enabled', 'int') ); + // Debug: Log the received values + error_log("VAT Refund Threshold Debug - Received values:"); + error_log("refund_threshold: " . $threshold_config['refund_threshold']); + error_log("refund_threshold_enabled: " . $threshold_config['refund_threshold_enabled']); + $updated = $config->updateVATRefundThresholdConfiguration($threshold_config); if ($updated) { setEventMessages($langs->trans("VATRefundThresholdConfigurationUpdated"), null, 'mesgs'); diff --git a/core/class/declarationtva_config.class.php b/core/class/declarationtva_config.class.php index 25eabc4..2fabe45 100644 --- a/core/class/declarationtva_config.class.php +++ b/core/class/declarationtva_config.class.php @@ -760,7 +760,13 @@ class DeclarationTVA_Config public function updateVATRefundThresholdConfiguration($threshold_config) { foreach ($threshold_config as $key => $value) { - $this->set('vat_refund_' . $key, $value); + $config_key = 'vat_refund_' . $key; + error_log("Saving VAT refund threshold config: " . $config_key . " = " . $value); + $result = $this->set($config_key, $value); + if (!$result) { + error_log("Failed to save VAT refund threshold config: " . $config_key . " = " . $value); + return false; + } } return true; }