Remove translation function calls - use raw journal label

- Remove dol_translate() calls that are causing fatal errors
- Use raw journal label from database without translation
- Focus on getting the accounting entries working first
- Can add translation later if needed
This commit is contained in:
Frank Cools 2025-10-09 00:22:31 +02:00
parent 01abbb8af9
commit ba62cfed7c

View File

@ -1269,9 +1269,8 @@ class DeclarationTVA
$journal_label_result = $this->db->query($journal_label_sql); $journal_label_result = $this->db->query($journal_label_sql);
if ($journal_label_result && $this->db->num_rows($journal_label_result) > 0) { if ($journal_label_result && $this->db->num_rows($journal_label_result) > 0) {
$journal_label_obj = $this->db->fetch_object($journal_label_result); $journal_label_obj = $this->db->fetch_object($journal_label_result);
$translated_label = dol_translate($journal_label_obj->label); $debit->journal_label = $journal_label_obj->label;
$debit->journal_label = $translated_label; error_log("DEBUG: Retrieved journal label: " . $journal_label_obj->label);
error_log("DEBUG: Retrieved journal label: " . $journal_label_obj->label . " -> " . $translated_label);
} else { } else {
error_log("DEBUG: No journal label found for OD code"); error_log("DEBUG: No journal label found for OD code");
} }
@ -1324,9 +1323,8 @@ class DeclarationTVA
$journal_label_result = $this->db->query($journal_label_sql); $journal_label_result = $this->db->query($journal_label_sql);
if ($journal_label_result && $this->db->num_rows($journal_label_result) > 0) { if ($journal_label_result && $this->db->num_rows($journal_label_result) > 0) {
$journal_label_obj = $this->db->fetch_object($journal_label_result); $journal_label_obj = $this->db->fetch_object($journal_label_result);
$translated_label = dol_translate($journal_label_obj->label); $credit->journal_label = $journal_label_obj->label;
$credit->journal_label = $translated_label; error_log("DEBUG: Retrieved journal label: " . $journal_label_obj->label);
error_log("DEBUG: Retrieved journal label: " . $journal_label_obj->label . " -> " . $translated_label);
} else { } else {
error_log("DEBUG: No journal label found for OD code"); error_log("DEBUG: No journal label found for OD code");
} }