From af583977935872bc2c6a29a6135592efe88c6558 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Thu, 2 Oct 2025 23:35:39 +0200 Subject: [PATCH] Remove duplicate getAccountMappings() method declaration Fixed: - Removed old getAccountMappings() method on line 615 - Kept the new version that joins with chart of accounts - This fixes the 'Cannot redeclare' PHP Fatal error The new method properly retrieves account labels from Dolibarr's accounting_account table. --- core/class/declarationtva.class.php | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/core/class/declarationtva.class.php b/core/class/declarationtva.class.php index 61abc7c..a6682b3 100644 --- a/core/class/declarationtva.class.php +++ b/core/class/declarationtva.class.php @@ -607,35 +607,6 @@ class DeclarationTVA return $result !== false; } - /** - * Get account mappings - * - * @return array Account mappings - */ - public function getAccountMappings() - { - $sql = "SELECT ca3_line, account_code, account_label, vat_rate - FROM " . MAIN_DB_PREFIX . "declarationtva_account_mappings - WHERE entity = " . $this->entity . " AND is_active = 1 - ORDER BY ca3_line"; - - $result = $this->db->query($sql); - $mappings = array(); - - if ($result) { - while ($obj = $this->db->fetch_object($result)) { - $mappings[] = array( - 'ca3_line' => $obj->ca3_line, - 'account_code' => $obj->account_code, - 'account_label' => $obj->account_label, - 'vat_rate' => $obj->vat_rate - ); - } - } - - return $mappings; - } - /** * Get period information *