diff --git a/declarationtva_view.php b/declarationtva_view.php index 40b2272..19c6340 100644 --- a/declarationtva_view.php +++ b/declarationtva_view.php @@ -121,6 +121,11 @@ $ca3_definitions = $config->getCA3LineDefinitions(); // Helper function to format amounts with original values in brackets function formatAmountWithOriginal($amount, $line_label, $amount_type = 'vat') { + // If amount is zero, show empty field + if ($amount == 0) { + return ''; + } + // Parse original amounts from line_label if they exist if (strpos($line_label, '|ORIGINAL_') !== false) { $parts = explode('|', $line_label); @@ -130,11 +135,20 @@ function formatAmountWithOriginal($amount, $line_label, $amount_type = 'vat') { if (preg_match($pattern, $original_info, $matches)) { $original_amount = floatval($matches[1]); if ($original_amount != $amount) { - return price($amount) . ' (' . number_format($original_amount, 2) . ')'; + return number_format($amount, 0) . ' (' . number_format($original_amount, 2) . ')'; } } } - return price($amount); + return number_format($amount, 0); +} + +// Helper function to format simple amounts (no original values) +function formatAmount($amount) { + // If amount is zero, show empty field + if ($amount == 0) { + return ''; + } + return number_format($amount, 0); } // Create a lookup array for quick access @@ -199,7 +213,7 @@ $data = isset($ca3_data['16']) ? $ca3_data['16'] : array('line_label' => '', 'va print '