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
This commit is contained in:
Frank Cools 2025-10-07 11:56:59 +02:00
parent 4f82e24e29
commit 8336fff139

View File

@ -2129,17 +2129,8 @@ class DeclarationTVA_PDF
return $obj->label; return $obj->label;
} }
// Fallback to default labels // If account not found in chart of accounts, return generic label
switch ($account_code) { return 'Compte ' . $account_code;
case '4456700':
return 'TVA à payer';
case '658000':
return 'Charges exceptionnelles';
case '758000':
return 'Produits exceptionnels';
default:
return 'Compte ' . $account_code;
}
} }
/** /**