Add more debugging to getCA3LineDetails method
- Add debug logs to track method calls and return values - Help diagnose why account details are not being found - Track account count returned by getCA3LineDetails
This commit is contained in:
parent
e0e4ff5689
commit
cf9e3f76fa
@ -1437,12 +1437,15 @@ class DeclarationTVA
|
||||
*/
|
||||
public function getCA3LineDetails($declaration_id, $ca3_line)
|
||||
{
|
||||
error_log("DEBUG: getCA3LineDetails called for declaration $declaration_id, line $ca3_line");
|
||||
|
||||
// Get declaration dates
|
||||
$sql = "SELECT start_date, end_date FROM " . MAIN_DB_PREFIX . "declarationtva_declarations
|
||||
WHERE rowid = " . (int)$declaration_id . " AND entity = " . $this->entity;
|
||||
|
||||
$result = $this->db->query($sql);
|
||||
if (!$result || $this->db->num_rows($result) == 0) {
|
||||
error_log("DEBUG: No declaration dates found for declaration $declaration_id");
|
||||
return array();
|
||||
}
|
||||
|
||||
@ -1511,7 +1514,7 @@ class DeclarationTVA
|
||||
$calculated_line = $this->db->fetch_object($result_line);
|
||||
}
|
||||
|
||||
return array(
|
||||
$result = array(
|
||||
'ca3_line' => $ca3_line,
|
||||
'declaration_id' => $declaration_id,
|
||||
'start_date' => $start_date,
|
||||
@ -1525,6 +1528,9 @@ class DeclarationTVA
|
||||
),
|
||||
'account_count' => count($details)
|
||||
);
|
||||
|
||||
error_log("DEBUG: getCA3LineDetails returning " . count($details) . " account details for line $ca3_line");
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user