diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index 3133022b9e6..65b8033db4a 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -69,7 +69,7 @@ else $typeid=$_REQUEST['typeid']; } -if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both test are required to be compatible with all browsers +if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETPOST("button_removefilter")) // All test are required to be compatible with all browsers { $search_ref=""; $search_label=""; @@ -210,6 +210,8 @@ if ($resql) print ''; print "\n"; + $i=0; + $totalarray=array(); while ($i < min($num,$limit)) { $obj = $db->fetch_object($resql); @@ -243,8 +245,12 @@ if ($resql) } print ''; + // Amount print ''.price($obj->amount).''; - + if (! $i) $totalarray['nbfield']++; + if (! $i) $totalarray['totalttcfield']=$totalarray['nbfield']; + $totalarray['totalttc'] += $obj->amount; + // Due date print ''.dol_print_date($db->jdate($obj->date_ech), 'day').''; @@ -256,6 +262,22 @@ if ($resql) $i++; } + // Show total line + if (isset($totalarray['totalttcfield'])) + { + print ''; + if ($num < $limit) print ''.$langs->trans("Total").''; + else print ''.$langs->trans("Totalforthispage").''; + print ''; + print ''; + print ''; + print ''.price($totalarray['totalttc']).''; + print ''; + print ''; + print ''; + print ''; + } + print ''; } print '';