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
This commit is contained in:
Frank Cools 2025-10-07 14:16:24 +02:00
parent ad4fbc17a5
commit 43e4072a67

View File

@ -2107,16 +2107,7 @@ class DeclarationTVA_PDF
if (abs($rounding_diff) >= 0.01) { if (abs($rounding_diff) >= 0.01) {
if ($difference < 0) { if ($difference < 0) {
// Credit difference - rounding goes to 758000 debit // Credit difference - rounding goes to 658000 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
$balancing_entries[] = array( $balancing_entries[] = array(
'account_code' => '658000', 'account_code' => '658000',
'account_label' => $this->getAccountLabel('658000'), 'account_label' => $this->getAccountLabel('658000'),
@ -2124,6 +2115,15 @@ class DeclarationTVA_PDF
'debit' => $this->formatAmountReal(abs($rounding_diff)), 'debit' => $this->formatAmountReal(abs($rounding_diff)),
'credit' => '' '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))
);
} }
} }
} }