From 4c08e2ebf342bb243b16544d7e07349940e2869c Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sun, 17 Jun 2018 14:33:29 +0200 Subject: [PATCH] clean and update code --- htdocs/compta/clients.php | 4 ---- htdocs/compta/index.php | 9 --------- htdocs/compta/paiement.php | 3 --- htdocs/compta/paiement_charge.php | 5 +---- htdocs/compta/recap-compta.php | 1 - htdocs/compta/salaries/index.php | 1 - htdocs/compta/sociales/index.php | 1 - htdocs/compta/sociales/payments.php | 11 +++-------- htdocs/compta/stats/cabyuser.php | 3 +-- htdocs/compta/tva/list.php | 1 - 10 files changed, 5 insertions(+), 34 deletions(-) diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php index aba6460d8e2..ceb9324961e 100644 --- a/htdocs/compta/clients.php +++ b/htdocs/compta/clients.php @@ -172,14 +172,10 @@ if ($resql) print ''; print "\n"; - $var=true; - while ($i < min($num,$conf->liste_limit)) { $obj = $db->fetch_object($resql); - - print ''; print ''; $thirdpartystatic->id=$obj->rowid; diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index 112b7479621..09a528b1ce7 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -568,10 +568,8 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire) print ''; if ($num) { - $var = true; $total_ttc = $totalam = $total = 0; - $var=true; while ($i < $num && $i < $max) { $objp = $db->fetch_object($result); @@ -632,7 +630,6 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $resql = $db->query($sql); if ( $resql ) { - $var = false; $num = $db->num_rows($resql); print ''; @@ -664,7 +661,6 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print ''; print ''; $tot_ttc+=$obj->amount; - $var = !$var; $i++; } @@ -722,7 +718,6 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us $resql = $db->query($sql); if ( $resql ) { - $var=false; $num = $db->num_rows($resql); if ($num) @@ -838,7 +833,6 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire) $resql = $db->query($sql); if ($resql) { - $var=false; $num = $db->num_rows($resql); $i = 0; @@ -972,7 +966,6 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $resql=$db->query($sql); if ($resql) { - $var=false; $num = $db->num_rows($resql); print '
'; @@ -1023,7 +1016,6 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture- $total_ttc += $obj->total_ttc; $totalam += $obj->am; $i++; - $var = !$var; } print '
'; @@ -1057,7 +1049,6 @@ if ($resql) print '
'.$chargestatic->getLibStatut(3).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')
'; print ''.$langs->trans("TasksToDo").''; print "\n"; - $var = true; $i = 0; while ($i < $db->num_rows($resql)) { diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 6c9f8014e19..c2ce95dd827 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -589,7 +589,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print ''; print "\n"; - $var=true; $total=0; $totalrecu=0; $totalrecucreditnote=0; @@ -599,7 +598,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { $objp = $db->fetch_object($resql); - $soc = new Societe($db); $soc->fetch($objp->socid); @@ -842,7 +840,6 @@ if (! GETPOST('action','aZ09')) { $num = $db->num_rows($resql); $i = 0; - $var=true; print_barre_liste($langs->trans('Payments'), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num); print '
 
'; diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index cadf897c57f..fba8723d818 100644 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -272,7 +272,6 @@ if ($action == 'create') print ''; print "\n"; - $var=true; $total=0; $totalrecu=0; @@ -280,8 +279,6 @@ if ($action == 'create') { $objp = $charge; - - print ''; if ($objp->date_ech > 0) @@ -325,7 +322,7 @@ if ($action == 'create') if ($i > 1) { // Print total - print ""; + print ''; print ''; print ""; print ""; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index b6e2ea26647..3a22666e2f7 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -129,7 +129,6 @@ if ($id > 0) $resql=$db->query($sql); if ($resql) { - $var=true; $num = $db->num_rows($resql); // Boucle sur chaque facture diff --git a/htdocs/compta/salaries/index.php b/htdocs/compta/salaries/index.php index 8b8d732e9b8..0b70275654f 100644 --- a/htdocs/compta/salaries/index.php +++ b/htdocs/compta/salaries/index.php @@ -140,7 +140,6 @@ if ($result) $num = $db->num_rows($result); $i = 0; $total = 0 ; - $var=true; $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; diff --git a/htdocs/compta/sociales/index.php b/htdocs/compta/sociales/index.php index c5f9cfcbead..bd323c972fe 100644 --- a/htdocs/compta/sociales/index.php +++ b/htdocs/compta/sociales/index.php @@ -137,7 +137,6 @@ if ($resql) { $num = $db->num_rows($resql); $i = 0; - $var=true; $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; diff --git a/htdocs/compta/sociales/payments.php b/htdocs/compta/sociales/payments.php index 379abd7af09..3b7f68f8c83 100644 --- a/htdocs/compta/sociales/payments.php +++ b/htdocs/compta/sociales/payments.php @@ -158,12 +158,10 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) $total = 0; $totalnb = 0; $totalpaye = 0; - $var=true; while ($i < min($num, $limit)) { $obj = $db->fetch_object($resql); - $var = !$var; print ''; // Ref payment $payment_sc_static->id=$obj->pid; @@ -253,14 +251,13 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire) print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"pv.datev","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; - $var=1; + while ($i < $num) { $obj = $db->fetch_object($result); $total = $total + $obj->amount; - print ''; print ''."\n"; @@ -355,14 +352,13 @@ while($j<$numlt) print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"pv.datep","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"pv.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; - $var=1; + while ($i < $num) { $obj = $db->fetch_object($result); $total = $total + $obj->amount; - print ''; print ''."\n"; @@ -437,14 +433,13 @@ if (! empty($conf->salaries->enabled) && $user->rights->salaries->read) print_liste_field_titre("DatePayment",$_SERVER["PHP_SELF"],"s.datep","",$param,'align="center"',$sortfield,$sortorder); print_liste_field_titre("PayedByThisPayment",$_SERVER["PHP_SELF"],"s.amount","",$param,'align="right"',$sortfield,$sortorder); print "\n"; - $var=1; + while ($i < $num) { $obj = $db->fetch_object($result); $total = $total + $obj->amount; - print ''; print ''."\n"; diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php index 8b1e1f0f106..dbd5d46e61a 100644 --- a/htdocs/compta/stats/cabyuser.php +++ b/htdocs/compta/stats/cabyuser.php @@ -327,8 +327,7 @@ print_liste_field_titre( "", 'align="center" width="20%"' ); -print "\n"; -$var=true; +print "\n"; if (count($amount)) { $arrayforsort=$name; diff --git a/htdocs/compta/tva/list.php b/htdocs/compta/tva/list.php index 97932d7b1ba..d835b0264e1 100644 --- a/htdocs/compta/tva/list.php +++ b/htdocs/compta/tva/list.php @@ -141,7 +141,6 @@ if ($result) $num = $db->num_rows($result); $i = 0; $total = 0 ; - $var=true; $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage;
'.$langs->trans("Amount").'
'.$langs->trans("Total").':".price($total_ttc)."".price($totalrecu)."
'.dol_print_date($db->jdate($obj->dm),'day').'
'.dol_print_date($db->jdate($obj->dm),'day').'
'.dol_print_date($db->jdate($obj->dateep),'day').'