From 43e4072a675635ede2ad65b6075f4e36f3a77769 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Tue, 7 Oct 2025 14:16:24 +0200 Subject: [PATCH] Fix rounding entry side for proper balancing - Debit difference: 758000 credit (not debit) for rounding - Credit difference: 658000 debit for rounding - Now matches user examples where debit difference uses 758000 credit - Should show correct rounding entries in journal table --- core/class/declarationtva_pdf.class.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index b74aa37..b86dab6 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -2107,16 +2107,7 @@ class DeclarationTVA_PDF if (abs($rounding_diff) >= 0.01) { if ($difference < 0) { - // Credit difference - rounding goes to 758000 debit - $balancing_entries[] = array( - 'account_code' => '758000', - 'account_label' => $this->getAccountLabel('758000'), - 'entry_label' => $declaration->declaration_name, - 'debit' => $this->formatAmountReal(abs($rounding_diff)), - 'credit' => '' - ); - } else { - // Debit difference - rounding goes to 658000 debit + // Credit difference - rounding goes to 658000 debit $balancing_entries[] = array( 'account_code' => '658000', 'account_label' => $this->getAccountLabel('658000'), @@ -2124,6 +2115,15 @@ class DeclarationTVA_PDF 'debit' => $this->formatAmountReal(abs($rounding_diff)), 'credit' => '' ); + } else { + // Debit difference - rounding goes to 758000 credit + $balancing_entries[] = array( + 'account_code' => '758000', + 'account_label' => $this->getAccountLabel('758000'), + 'entry_label' => $declaration->declaration_name, + 'debit' => '', + 'credit' => $this->formatAmountReal(abs($rounding_diff)) + ); } } }