Skip to content
Snippets Groups Projects
Commit 6902960d authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix sign of amount debit/credit/montant

parent eaab34ee
No related branches found
No related tags found
No related merge requests found
......@@ -401,7 +401,7 @@ if (! $error && $action == 'writebookkeeping') {
$bookkeeping->numero_compte = $k;
$bookkeeping->label_operation = $val["label"];
$bookkeeping->label_compte = $langs->trans("Bank");
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
$bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt >= 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt >= 0 ? $mt : 0);
$bookkeeping->credit = ($mt < 0 ? - $mt : 0);
......@@ -462,7 +462,7 @@ if (! $error && $action == 'writebookkeeping') {
$bookkeeping->fk_doc = $key;
$bookkeeping->fk_docdet = $val["fk_bank"];
$bookkeeping->label_operation = $tabcompany[$key]['name'];
$bookkeeping->montant = ($mt < 0 ? - $mt : $mt);
$bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt < 0) ? 'D' : 'C';
$bookkeeping->debit = ($mt < 0 ? - $mt : 0);
$bookkeeping->credit = ($mt >= 0) ? $mt : 0;
......
......@@ -203,7 +203,7 @@ if ($action == 'writebookkeeping') {
$bookkeeping->label_operation = $tabuser[$key]['name'];
$bookkeeping->montant = $mt;
$bookkeeping->sens = ($mt >= 0) ? 'C' : 'D';
$bookkeeping->debit = ($mt <= 0) ? $mt : 0;
$bookkeeping->debit = ($mt <= 0) ? -$mt : 0;
$bookkeeping->credit = ($mt > 0) ? $mt : 0;
$bookkeeping->code_journal = $journal;
$bookkeeping->journal_label = $journal_label;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment