From 2bdb44ee00675244362dfa80306c7b7e95e68c10 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Wed, 8 Oct 2025 21:57:36 +0200 Subject: [PATCH] Add debugging to bookkeeping entry creation - Add debug logs to track each accounting entry being created - Add debug logs to track bookkeeping create results - Help identify why entries are not being saved to database --- core/class/declarationtva.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/class/declarationtva.class.php b/core/class/declarationtva.class.php index 9ed7748..d5be98f 100644 --- a/core/class/declarationtva.class.php +++ b/core/class/declarationtva.class.php @@ -1225,6 +1225,8 @@ class DeclarationTVA $bookkeeping = new Bookkeeping($this->db); foreach ($entries as $entry) { + error_log("DEBUG: Creating accounting entry for account: " . $entry['account_code'] . ", debit: " . $entry['debit'] . ", credit: " . $entry['credit']); + // Create accounting entry $bookkeeping->doc_type = 'declarationtva'; $bookkeeping->doc_ref = $declaration->declaration_name; @@ -1237,6 +1239,7 @@ class DeclarationTVA $bookkeeping->entity = $this->entity; $result = $bookkeeping->create($user); + error_log("DEBUG: Bookkeeping create result: " . ($result ? "SUCCESS" : "FAILED - " . $bookkeeping->error)); if (!$result) { $this->error = 'Failed to create accounting entry: ' . $bookkeeping->error; return false;