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;