Add journal_label field from database
- Query accounting_journal table to get label for 'OD' journal - Set journal_label field for both debit and credit entries - Match the working OD journal entries that have proper journal labels - Complete the missing fields identified in comparison
This commit is contained in:
parent
41444f6c90
commit
b0705ecb4c
@ -1264,6 +1264,14 @@ class DeclarationTVA
|
||||
$debit->fk_user_modification = $user->id;
|
||||
$debit->label_operation = $declaration->declaration_name;
|
||||
|
||||
// Get journal label from database
|
||||
$journal_label_sql = "SELECT label FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE code = 'OD' AND entity = " . $this->entity;
|
||||
$journal_label_result = $this->db->query($journal_label_sql);
|
||||
if ($journal_label_result && $this->db->num_rows($journal_label_result) > 0) {
|
||||
$journal_label_obj = $this->db->fetch_object($journal_label_result);
|
||||
$debit->journal_label = $journal_label_obj->label;
|
||||
}
|
||||
|
||||
// Final check of montant before create
|
||||
error_log("DEBUG: Final montant check before create: " . $debit->montant);
|
||||
|
||||
@ -1307,6 +1315,14 @@ class DeclarationTVA
|
||||
$credit->fk_user_modification = $user->id;
|
||||
$credit->label_operation = $declaration->declaration_name;
|
||||
|
||||
// Get journal label from database
|
||||
$journal_label_sql = "SELECT label FROM " . MAIN_DB_PREFIX . "accounting_journal WHERE code = 'OD' AND entity = " . $this->entity;
|
||||
$journal_label_result = $this->db->query($journal_label_sql);
|
||||
if ($journal_label_result && $this->db->num_rows($journal_label_result) > 0) {
|
||||
$journal_label_obj = $this->db->fetch_object($journal_label_result);
|
||||
$credit->journal_label = $journal_label_obj->label;
|
||||
}
|
||||
|
||||
// Final check of montant before create
|
||||
error_log("DEBUG: Final montant check before create: " . $credit->montant);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user