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
This commit is contained in:
parent
308b8c701d
commit
845b7a3530
@ -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
|
* Recalculate CA-3 amounts for a declaration
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user