Add detailed date debugging for accounting entries
- Show doc_date (operation date) for each entry - Show date_creation (creation timestamp) for each entry - Show tms (modification timestamp) for each entry - Help identify if date filtering is causing journal display issues
This commit is contained in:
parent
7dbd4f3486
commit
cd70757bcf
@ -1350,14 +1350,17 @@ class DeclarationTVA
|
||||
}
|
||||
|
||||
// Check what's actually in the database
|
||||
$detail_check_sql = "SELECT rowid, doc_date, doc_ref, code_journal, numero_compte, label_compte, montant, sens, fk_doc, entity FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping
|
||||
$detail_check_sql = "SELECT rowid, doc_date, doc_ref, code_journal, numero_compte, label_compte, montant, sens, fk_doc, entity, date_creation, tms FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping
|
||||
WHERE doc_ref = '" . $this->db->escape($declaration->declaration_name) . "'
|
||||
ORDER BY rowid DESC LIMIT 5";
|
||||
$detail_check_result = $this->db->query($detail_check_sql);
|
||||
if ($detail_check_result && $this->db->num_rows($detail_check_result) > 0) {
|
||||
error_log("DEBUG: Recent entries in database:");
|
||||
error_log("DEBUG: Recent entries in database with dates:");
|
||||
while ($detail_obj = $this->db->fetch_object($detail_check_result)) {
|
||||
error_log("DEBUG: Entry ID: " . $detail_obj->rowid . ", Account: " . $detail_obj->numero_compte . ", Amount: " . $detail_obj->montant . ", Sens: " . $detail_obj->sens . ", Journal: " . $detail_obj->code_journal . ", Entity: " . $detail_obj->entity . ", Date: " . $detail_obj->doc_date);
|
||||
error_log("DEBUG: Entry ID: " . $detail_obj->rowid . ", Account: " . $detail_obj->numero_compte . ", Amount: " . $detail_obj->montant . ", Sens: " . $detail_obj->sens . ", Journal: " . $detail_obj->code_journal . ", Entity: " . $detail_obj->entity);
|
||||
error_log("DEBUG: - doc_date: " . $detail_obj->doc_date . " (operation date)");
|
||||
error_log("DEBUG: - date_creation: " . $detail_obj->date_creation . " (creation date)");
|
||||
error_log("DEBUG: - tms: " . $detail_obj->tms . " (modification date)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user