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.
This commit is contained in:
Frank Cools 2025-10-02 23:35:39 +02:00
parent 5cbffd799a
commit af58397793

View File

@ -607,35 +607,6 @@ class DeclarationTVA
return $result !== false; 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 * Get period information
* *