From 8336fff1391414cd8fd76bc3ffc3d6f3c573c66c Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Tue, 7 Oct 2025 11:56:59 +0200 Subject: [PATCH] Fix getAccountLabel to fetch real account names from Dolibarr chart of accounts - Removed hardcoded fallback labels that were made up - Now properly queries accounting_account table for real account labels - Uses entity filtering and active account filtering - Falls back to generic 'Compte XXXX' only if account not found - Journal table now shows actual account names from your chart of accounts --- core/class/declarationtva_pdf.class.php | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/core/class/declarationtva_pdf.class.php b/core/class/declarationtva_pdf.class.php index 64f2e30..6ad4fbb 100644 --- a/core/class/declarationtva_pdf.class.php +++ b/core/class/declarationtva_pdf.class.php @@ -2129,17 +2129,8 @@ class DeclarationTVA_PDF return $obj->label; } - // Fallback to default labels - switch ($account_code) { - case '4456700': - return 'TVA à payer'; - case '658000': - return 'Charges exceptionnelles'; - case '758000': - return 'Produits exceptionnels'; - default: - return 'Compte ' . $account_code; - } + // If account not found in chart of accounts, return generic label + return 'Compte ' . $account_code; } /**