From d819f0d3d15d272d6c3f1168631aa940b83c27d6 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Wed, 8 Oct 2025 22:54:02 +0200 Subject: [PATCH] Add comprehensive Bookkeeping object debugging - Add print_r() output for complete Bookkeeping object before create() - Add JSON encoding of Bookkeeping object for detailed inspection - Show all object properties and values - Help identify missing or incorrect field values causing empty amounts --- core/class/declarationtva.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/class/declarationtva.class.php b/core/class/declarationtva.class.php index c5d12e1..ec032d0 100644 --- a/core/class/declarationtva.class.php +++ b/core/class/declarationtva.class.php @@ -1270,6 +1270,11 @@ class DeclarationTVA error_log("DEBUG: - fk_doc: " . $debit->fk_doc); error_log("DEBUG: - fk_user_author: " . $debit->fk_user_author); + // Debug: Complete Bookkeeping object + error_log("DEBUG: Complete Debit Bookkeeping object:"); + error_log("DEBUG: " . print_r($debit, true)); + error_log("DEBUG: JSON encoded Debit object: " . json_encode($debit)); + $result = $debit->create($user); error_log("DEBUG: Debit entry create result: " . $result . " (type: " . gettype($result) . ")"); error_log("DEBUG: Debit entry error message: '" . $debit->error . "'"); @@ -1316,6 +1321,11 @@ class DeclarationTVA error_log("DEBUG: - fk_doc: " . $credit->fk_doc); error_log("DEBUG: - fk_user_author: " . $credit->fk_user_author); + // Debug: Complete Bookkeeping object + error_log("DEBUG: Complete Credit Bookkeeping object:"); + error_log("DEBUG: " . print_r($credit, true)); + error_log("DEBUG: JSON encoded Credit object: " . json_encode($credit)); + $result = $credit->create($user); error_log("DEBUG: Credit entry create result: " . $result . " (type: " . gettype($result) . ")"); error_log("DEBUG: Credit entry error message: '" . $credit->error . "'");