Fix ref and fk_doc fields to match working entries
- Add ref field = declaration_name for both debit and credit entries - Change fk_doc from declaration->rowid to 0 to match working entries - These fields are critical for proper accounting entry creation - Based on comparison with working OD journal entries
This commit is contained in:
parent
ba62cfed7c
commit
3393759675
@ -1250,12 +1250,13 @@ class DeclarationTVA
|
||||
$debit = new Bookkeeping($this->db);
|
||||
$debit->doc_date = dol_mktime(0, 0, 0, date('m', strtotime($declaration->end_date)), date('d', strtotime($declaration->end_date)), date('Y', strtotime($declaration->end_date)));
|
||||
$debit->doc_ref = $declaration->declaration_name;
|
||||
$debit->ref = $declaration->declaration_name;
|
||||
$debit->code_journal = 'OD';
|
||||
$debit->numero_compte = $entry['account_code'];
|
||||
$debit->label_compte = $entry['account_label'];
|
||||
$debit->montant = price2num($debit_amount, 'MT');
|
||||
$debit->sens = 'D';
|
||||
$debit->fk_doc = $declaration->rowid;
|
||||
$debit->fk_doc = 0;
|
||||
$debit->fk_user_author = $user->id;
|
||||
$debit->entity = $this->entity;
|
||||
$debit->date_creation = dol_now();
|
||||
@ -1304,12 +1305,13 @@ class DeclarationTVA
|
||||
$credit = new Bookkeeping($this->db);
|
||||
$credit->doc_date = dol_mktime(0, 0, 0, date('m', strtotime($declaration->end_date)), date('d', strtotime($declaration->end_date)), date('Y', strtotime($declaration->end_date)));
|
||||
$credit->doc_ref = $declaration->declaration_name;
|
||||
$credit->ref = $declaration->declaration_name;
|
||||
$credit->code_journal = 'OD';
|
||||
$credit->numero_compte = $entry['account_code'];
|
||||
$credit->label_compte = $entry['account_label'];
|
||||
$credit->montant = price2num($credit_amount, 'MT');
|
||||
$credit->sens = 'C';
|
||||
$credit->fk_doc = $declaration->rowid;
|
||||
$credit->fk_doc = 0;
|
||||
$credit->fk_user_author = $user->id;
|
||||
$credit->entity = $this->entity;
|
||||
$credit->date_creation = dol_now();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user