Add debugging to journal entries generation

- Added debug logging to see how many balancing entries are found
- Added logging to show each balancing entry being added
- Added total count of entries after balancing
- Should help identify if entries are being added to the PDF
This commit is contained in:
Frank Cools 2025-10-07 15:25:56 +02:00
parent aa56cf4640
commit 26345aee03

View File

@ -1871,11 +1871,14 @@ class DeclarationTVA_PDF
// Add balancing entry to ensure debits equal credits
$balancing_entries = $this->getBalancingEntries($declaration, $entries);
error_log("DeclarationTVA: Found " . count($balancing_entries) . " balancing entries");
foreach ($balancing_entries as $entry) {
if ($entry) {
error_log("DeclarationTVA: Adding balancing entry: " . $entry['account_code'] . " " . $entry['debit'] . " " . $entry['credit']);
$entries[] = $entry;
}
}
error_log("DeclarationTVA: Total entries after balancing: " . count($entries));
return $entries;
}