From c5787a4bbab807b9c75034e724bd9c5563235364 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Sat, 23 Apr 2016 16:02:18 +0200 Subject: [PATCH] New add remain to pay column in invoice list (was present in previous versions) --- htdocs/compta/facture/list.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index e2883081452..905e6362500 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -153,6 +153,7 @@ $arrayfields=array( 'f.total_vat'=>array('label'=>$langs->trans("AmountVAT"), 'checked'=>0), 'f.total_ttc'=>array('label'=>$langs->trans("AmountTTC"), 'checked'=>0), 'am'=>array('label'=>$langs->trans("Received"), 'checked'=>0), + 'rtp'=>array('label'=>$langs->trans("Rest"), 'checked'=>0), 'f.datec'=>array('label'=>$langs->trans("DateCreation"), 'checked'=>0, 'position'=>500), 'f.tms'=>array('label'=>$langs->trans("DateModificationShort"), 'checked'=>0, 'position'=>500), 'f.fk_statut'=>array('label'=>$langs->trans("Status"), 'checked'=>1, 'position'=>1000), @@ -997,6 +998,7 @@ if ($resql) if (! empty($arrayfields['f.total_vat']['checked'])) print_liste_field_titre($arrayfields['f.total_vat']['label'],$_SERVER['PHP_SELF'],'f.tva','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['f.total_ttc']['checked'])) print_liste_field_titre($arrayfields['f.total_ttc']['label'],$_SERVER['PHP_SELF'],'f.total_ttc','',$param,'align="right"',$sortfield,$sortorder); if (! empty($arrayfields['am']['checked'])) print_liste_field_titre($arrayfields['am']['label'],$_SERVER['PHP_SELF'],'am','',$param,'align="right"',$sortfield,$sortorder); + if (! empty($arrayfields['rtp']['checked'])) print_liste_field_titre($arrayfields['rtp']['label'],$_SERVER['PHP_SELF'],'rtp','',$param,'align="right"',$sortfield,$sortorder); // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -1117,6 +1119,11 @@ if ($resql) print ''; print ''; } + if (! empty($arrayfields['rtp']['checked'])) + { + print ''; + print ''; + } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) { @@ -1195,6 +1202,7 @@ if ($resql) $facturestatic->date_lim_reglement=$db->jdate($obj->datelimite); $notetoshow=dol_string_nohtmltag(($user->societe_id>0?$obj->note_public:$obj->note_private),1); $paiement = $facturestatic->getSommePaiement(); + $remaintopay = $obj->total_ttc - $paiement; print ''; @@ -1347,6 +1355,14 @@ if ($resql) if (! $i) $totalarray['totalamfield']=$totalarray['nbfield']; $totalarray['totalam'] += $paiement; } + + if (! empty($arrayfields['rtp']['checked'])) + { + print ''; + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalrtpfield']=$totalarray['nbfield']; + $totalarray['totalrtp'] += $remaintopay; + } // Extra fields if (is_array($extrafields->attribute_label) && count($extrafields->attribute_label)) @@ -1425,6 +1441,7 @@ if ($resql) elseif ($totalarray['totalvatfield'] == $i) print ''; elseif ($totalarray['totalttcfield'] == $i) print ''; elseif ($totalarray['totalamfield'] == $i) print ''; + elseif ($totalarray['totalrtpfield'] == $i) print ''; else print ''; } print '';
'.(! empty($remaintopay)?price($remaintopay,0,$langs):' ').''.price($totalarray['totalvat']).''.price($totalarray['totalttc']).''.price($totalarray['totalam']).''.price($totalarray['totalrtp']).'