From 21ad4110e726998f24f976b9c5e871d891d1a4e5 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Thu, 2 Oct 2025 21:36:57 +0200 Subject: [PATCH] Add debugging for CA-3 line processing Added: - Log which CA-3 lines have mappings - Log account codes being processed - Log amounts found for each account - Log when no mappings found for a line - This will help identify why field 08 isn't working --- core/class/declarationtva.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/class/declarationtva.class.php b/core/class/declarationtva.class.php index f32613e..d4dcbf8 100644 --- a/core/class/declarationtva.class.php +++ b/core/class/declarationtva.class.php @@ -218,14 +218,20 @@ class DeclarationTVA // Sum all accounts for this CA-3 line (if any mappings exist) if (isset($grouped_mappings[$ca3_line])) { + error_log("DeclarationTVA: Processing CA-3 line $ca3_line with " . count($grouped_mappings[$ca3_line]) . " mapped accounts"); foreach ($grouped_mappings[$ca3_line] as $mapping) { + error_log("DeclarationTVA: Processing account " . $mapping['account_code'] . " for line $ca3_line"); $amounts = $this->getAccountAmounts($mapping['account_code'], $period['start_date'], $period['end_date']); $line_total_base += $amounts['base_amount']; $line_total_vat += $amounts['vat_amount']; $line_total_amount += $amounts['total_amount']; $account_labels[] = $mapping['account_label']; + + error_log("DeclarationTVA: Account " . $mapping['account_code'] . " amounts: base=" . $amounts['base_amount'] . ", vat=" . $amounts['vat_amount']); } + } else { + error_log("DeclarationTVA: No mappings found for CA-3 line $ca3_line"); } // Create CA-3 line record with summed amounts (even if zero)