From 0dcab38b4a90620e8fac9544739ee452f0629e68 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Wed, 8 Oct 2025 22:00:55 +0200 Subject: [PATCH] Add debugging for bank account details - Add debug logs to track bank account ID from config - Add debug logs to show bank account query and results - Help identify why bank account code is empty --- core/class/declarationtva.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/class/declarationtva.class.php b/core/class/declarationtva.class.php index d5be98f..f5733a2 100644 --- a/core/class/declarationtva.class.php +++ b/core/class/declarationtva.class.php @@ -999,8 +999,11 @@ class DeclarationTVA $bank_config = $config->getBankAccountConfiguration(); $bank_account_id = $bank_config['bank_account']; + error_log("DEBUG: Bank account ID from config: " . $bank_account_id); + if (empty($bank_account_id) || $bank_account_id == 0) { // No bank account configured - skip bank entries + error_log("DEBUG: No bank account configured - skipping bank entries"); return true; } @@ -1262,11 +1265,15 @@ class DeclarationTVA LEFT JOIN " . MAIN_DB_PREFIX . "accounting_account a ON a.rowid = ba.account_number WHERE ba.rowid = " . (int)$bank_account_id . " AND ba.entity = " . $this->entity; + error_log("DEBUG: Bank account query: " . $sql); $result = $this->db->query($sql); if ($result && $this->db->num_rows($result) > 0) { - return $this->db->fetch_array($result); + $bank_data = $this->db->fetch_array($result); + error_log("DEBUG: Bank account data: " . print_r($bank_data, true)); + return $bank_data; } + error_log("DEBUG: No bank account found for ID: " . $bank_account_id); return false; }