diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index 67622c3..23bd74c 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -2087,34 +2087,18 @@ class DeclarationTVA_PDF error_log("DeclarationTVA: Total difference: " . $difference); error_log("DeclarationTVA: Difference > 0: " . ($difference > 0 ? 'true' : 'false')); - // Simple: rounded difference on 4455100, real difference on 758000 + // Only real difference on 758000, no main balancing entry if (abs($difference) >= 0.01) { - $rounded_amount = round($difference); - $rounding_diff = $difference - $rounded_amount; + error_log("DeclarationTVA: *** SINGLE ENTRY *** Creating 758000 entry with real difference: " . $difference); - error_log("DeclarationTVA: Difference: " . $difference . ", Rounded: " . $rounded_amount . ", Rounding diff: " . $rounding_diff); - error_log("DeclarationTVA: *** NEW LOGIC *** Creating 4455100 entry with amount: " . abs($rounded_amount)); - error_log("DeclarationTVA: *** NEW LOGIC *** Creating 758000 entry with amount: " . abs($rounding_diff)); - - // Rounded difference on 4455100 + // Only real difference on 758000 $balancing_entries[] = array( - 'account_code' => '4455100', - 'account_label' => $this->getAccountLabel('4455100'), + 'account_code' => '758000', + 'account_label' => $this->getAccountLabel('758000'), 'entry_label' => $declaration->declaration_name, 'debit' => '', - 'credit' => $this->formatAmount(abs($rounded_amount)) + 'credit' => $this->formatAmountReal(abs($difference)) ); - - // Real difference on 758000 - if (abs($rounding_diff) >= 0.01) { - $balancing_entries[] = array( - 'account_code' => '758000', - 'account_label' => $this->getAccountLabel('758000'), - 'entry_label' => $declaration->declaration_name, - 'debit' => '', - 'credit' => $this->formatAmountReal(abs($rounding_diff)) - ); - } } return $balancing_entries;