Add focused Bookkeeping field debugging

- Replace verbose JSON output with focused field-by-field debugging
- Show all key Bookkeeping fields with NULL detection
- Include entity, date_creation, tms, fk_user_creation, fk_user_modification
- Help identify which specific fields are missing or incorrect
This commit is contained in:
Frank Cools 2025-10-08 22:57:48 +02:00
parent d819f0d3d1
commit 5fe1509527

View File

@ -1270,10 +1270,22 @@ 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));
// Debug: Key Bookkeeping fields only
error_log("DEBUG: Key Debit Bookkeeping fields:");
error_log("DEBUG: - doc_date: " . ($debit->doc_date ?? 'NULL'));
error_log("DEBUG: - doc_ref: " . ($debit->doc_ref ?? 'NULL'));
error_log("DEBUG: - code_journal: " . ($debit->code_journal ?? 'NULL'));
error_log("DEBUG: - numero_compte: " . ($debit->numero_compte ?? 'NULL'));
error_log("DEBUG: - label_compte: " . ($debit->label_compte ?? 'NULL'));
error_log("DEBUG: - montant: " . ($debit->montant ?? 'NULL'));
error_log("DEBUG: - sens: " . ($debit->sens ?? 'NULL'));
error_log("DEBUG: - fk_doc: " . ($debit->fk_doc ?? 'NULL'));
error_log("DEBUG: - fk_user_author: " . ($debit->fk_user_author ?? 'NULL'));
error_log("DEBUG: - entity: " . ($debit->entity ?? 'NULL'));
error_log("DEBUG: - date_creation: " . ($debit->date_creation ?? 'NULL'));
error_log("DEBUG: - tms: " . ($debit->tms ?? 'NULL'));
error_log("DEBUG: - fk_user_creation: " . ($debit->fk_user_creation ?? 'NULL'));
error_log("DEBUG: - fk_user_modification: " . ($debit->fk_user_modification ?? 'NULL'));
$result = $debit->create($user);
error_log("DEBUG: Debit entry create result: " . $result . " (type: " . gettype($result) . ")");
@ -1321,10 +1333,22 @@ 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));
// Debug: Key Bookkeeping fields only
error_log("DEBUG: Key Credit Bookkeeping fields:");
error_log("DEBUG: - doc_date: " . ($credit->doc_date ?? 'NULL'));
error_log("DEBUG: - doc_ref: " . ($credit->doc_ref ?? 'NULL'));
error_log("DEBUG: - code_journal: " . ($credit->code_journal ?? 'NULL'));
error_log("DEBUG: - numero_compte: " . ($credit->numero_compte ?? 'NULL'));
error_log("DEBUG: - label_compte: " . ($credit->label_compte ?? 'NULL'));
error_log("DEBUG: - montant: " . ($credit->montant ?? 'NULL'));
error_log("DEBUG: - sens: " . ($credit->sens ?? 'NULL'));
error_log("DEBUG: - fk_doc: " . ($credit->fk_doc ?? 'NULL'));
error_log("DEBUG: - fk_user_author: " . ($credit->fk_user_author ?? 'NULL'));
error_log("DEBUG: - entity: " . ($credit->entity ?? 'NULL'));
error_log("DEBUG: - date_creation: " . ($credit->date_creation ?? 'NULL'));
error_log("DEBUG: - tms: " . ($credit->tms ?? 'NULL'));
error_log("DEBUG: - fk_user_creation: " . ($credit->fk_user_creation ?? 'NULL'));
error_log("DEBUG: - fk_user_modification: " . ($credit->fk_user_modification ?? 'NULL'));
$result = $credit->create($user);
error_log("DEBUG: Credit entry create result: " . $result . " (type: " . gettype($result) . ")");