From 845b7a3530f8c4038b27f70c4c760bc0cb790005 Mon Sep 17 00:00:00 2001 From: Frank Cools Date: Thu, 2 Oct 2025 20:44:32 +0200 Subject: [PATCH] Fix duplicate createCA3Line() and updateDeclarationTotals() methods Fixed: - Removed duplicate createCA3Line() method declaration - Removed duplicate updateDeclarationTotals() method declaration - Kept the original methods that were already working - Resolves PHP Fatal error: Cannot redeclare methods --- core/class/declarationtva.class.php | 40 ----------------------------- 1 file changed, 40 deletions(-) diff --git a/core/class/declarationtva.class.php b/core/class/declarationtva.class.php index 1526b1a..0c343c3 100644 --- a/core/class/declarationtva.class.php +++ b/core/class/declarationtva.class.php @@ -511,47 +511,7 @@ class DeclarationTVA } - /** - * Create CA-3 line record - * - * @param int $declaration_id Declaration ID - * @param string $ca3_line CA-3 line code - * @param string $line_label Line label - * @param array $amounts Amounts - * @return bool Success - */ - public function createCA3Line($declaration_id, $ca3_line, $line_label, $amounts) - { - $sql = "INSERT INTO " . MAIN_DB_PREFIX . "declarationtva_ca3_lines - (declaration_id, ca3_line, line_label, base_amount, vat_amount, total_amount, created_date) - VALUES (" . $declaration_id . ", '" . $this->db->escape($ca3_line) . "', - '" . $this->db->escape($line_label) . "', " . $amounts['base_amount'] . ", - " . $amounts['vat_amount'] . ", " . $amounts['total_amount'] . ", NOW())"; - - return $this->db->query($sql); - } - /** - * Update declaration totals - * - * @param int $declaration_id Declaration ID - * @param float $total_vat_collected Total VAT collected - * @param float $total_vat_deductible Total VAT deductible - * @param float $net_vat_due Net VAT due - * @param float $vat_credit VAT credit - * @return bool Success - */ - public function updateDeclarationTotals($declaration_id, $total_vat_collected, $total_vat_deductible, $net_vat_due, $vat_credit) - { - $sql = "UPDATE " . MAIN_DB_PREFIX . "declarationtva_declarations - SET total_vat_collected = " . $total_vat_collected . ", - total_vat_deductible = " . $total_vat_deductible . ", - net_vat_due = " . $net_vat_due . ", - vat_credit = " . $vat_credit . " - WHERE rowid = " . $declaration_id; - - return $this->db->query($sql); - } /** * Recalculate CA-3 amounts for a declaration