From 1fc83fe5d07f6f88975ab3ca16cbc13790a85d92 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Thu, 9 Oct 2025 00:51:58 +0200 Subject: [PATCH] Add comprehensive debugging for accounting entry creation - Add debug logging to track if createAccountingEntries is called multiple times - Add debug logging for bank journal entries creation process - Help identify why bank entries are not being created - Track the flow of both OD and bank journal entry creation --- core/class/declarationtva.class.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/class/declarationtva.class.php b/core/class/declarationtva.class.php index 43e5efa..f384c78 100644 --- a/core/class/declarationtva.class.php +++ b/core/class/declarationtva.class.php @@ -895,6 +895,8 @@ class DeclarationTVA */ public function createAccountingEntries($declaration_id, $user) { + error_log("DEBUG: createAccountingEntries called for declaration ID: " . $declaration_id); + // Get declaration data $fetch_result = $this->fetch($declaration_id); if (!$fetch_result) { @@ -962,10 +964,13 @@ class DeclarationTVA } // Create bank journal entries + error_log("DEBUG: About to create bank journal entries"); $bank_entries = $this->createBankJournalEntries($declaration, $ca3_lookup, $journal_config, $user); if (!$bank_entries) { + error_log("DEBUG: Bank journal entries creation failed: " . $this->error); return false; } + error_log("DEBUG: Bank journal entries creation result: " . ($bank_entries === true ? 'SUCCESS' : 'FAILED')); return true; } @@ -1017,6 +1022,8 @@ class DeclarationTVA */ private function createBankJournalEntries($declaration, $ca3_lookup, $journal_config, $user) { + error_log("DEBUG: createBankJournalEntries called"); + // Get bank account configuration require_once DOL_DOCUMENT_ROOT . '/custom/declarationtva/core/class/declarationtva_config.class.php'; $config = new DeclarationTVA_Config($this->db, $this->entity);