diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index 268b5fa69c2..524326e320c 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -357,7 +357,7 @@ class AccountancyExport $Tab['libelle_ecriture'] = str_pad(self::trunc($data->doc_ref . ' ' . $data->label_compte, 20), 20); $Tab['sens'] = $data->sens; // C or D $Tab['signe_montant'] = '+'; - $Tab['montant'] = str_pad(abs($data->montant) * 100, 12, '0', STR_PAD_LEFT); // TODO manage negative amount + $Tab['montant'] = str_pad(abs($data->montant), 12, '0', STR_PAD_LEFT); // TODO manage negative amount $Tab['contrepartie'] = str_repeat(' ', 8); if (! empty($data->date_echeance)) $Tab['date_echeance'] = dol_print_date($data->date_echeance, $conf->global->ACCOUNTING_EXPORT_DATE); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index d9e5ae8ce23..8d0cc61d5d6 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1216,6 +1216,12 @@ if ($resql) $facturestatic->type=$obj->type; $facturestatic->statut=$obj->fk_statut; $facturestatic->date_lim_reglement=$db->jdate($obj->datelimite); + + $paiement = $facturestatic->getSommePaiement(); + $totalcreditnotes = $facturestatic->getSumCreditNotesUsed(); + $totaldeposits = $facturestatic->getSumDepositsUsed(); + $totalpay = $paiement + $totalcreditnotes + $totaldeposits; + $remaintopay = $obj->total_ttc - $totalpay; print '
| '; @@ -1372,10 +1376,10 @@ if ($resql) if (! empty($arrayfields['dynamount_payed']['checked'])) { - print ' | '.(! empty($paiement)?price($paiement,0,$langs):' ').' | '; // TODO Use a denormalized field + print ''.(! empty($totalpay)?price($totalpay,0,$langs):' ').' | '; // TODO Use a denormalized field if (! $i) $totalarray['nbfield']++; if (! $i) $totalarray['totalamfield']=$totalarray['nbfield']; - $totalarray['totalam'] += $paiement; + $totalarray['totalam'] += $totalpay; } if (! empty($arrayfields['rtp']['checked']))