clean and update code

This commit is contained in:
Philippe GRAND 2018-06-17 14:33:29 +02:00
parent 118d22cf1e
commit 4c08e2ebf3
10 changed files with 5 additions and 34 deletions

View File

@ -172,14 +172,10 @@ if ($resql)
print '</td>';
print "</tr>\n";
$var=true;
while ($i < min($num,$conf->liste_limit))
{
$obj = $db->fetch_object($resql);
print '<tr class="oddeven">';
print '<td>';
$thirdpartystatic->id=$obj->rowid;

View File

@ -568,10 +568,8 @@ if (! empty($conf->don->enabled) && $user->rights->societe->lire)
print '</tr>';
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 '<table class="noborder" width="100%">';
@ -664,7 +661,6 @@ if (! empty($conf->tax->enabled) && $user->rights->tax->charges->lire)
print '<td align="center">'.$chargestatic->getLibStatut(3).'</td>';
print '</tr>';
$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 '<div class="div-table-responsive-no-min">';
@ -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 '<tr class="liste_total"><td colspan="2">'.$langs->trans("Total").' &nbsp; <font style="font-weight: normal">('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).')</font> </td>';
@ -1057,7 +1049,6 @@ if ($resql)
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><thcolspan="2">'.$langs->trans("TasksToDo").'</th>';
print "</tr>\n";
$var = true;
$i = 0;
while ($i < $db->num_rows($resql))
{

View File

@ -589,7 +589,6 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '<td align="right">&nbsp;</td>';
print "</tr>\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 '<table class="noborder" width="100%">';

View File

@ -272,7 +272,6 @@ if ($action == 'create')
print '<td align="center">'.$langs->trans("Amount").'</td>';
print "</tr>\n";
$var=true;
$total=0;
$totalrecu=0;
@ -280,8 +279,6 @@ if ($action == 'create')
{
$objp = $charge;
print '<tr class="oddeven">';
if ($objp->date_ech > 0)
@ -325,7 +322,7 @@ if ($action == 'create')
if ($i > 1)
{
// Print total
print "<tr ".$bc[!$var].">";
print '<tr class="oddeven">';
print '<td colspan="2" align="left">'.$langs->trans("Total").':</td>';
print "<td align=\"right\"><b>".price($total_ttc)."</b></td>";
print "<td align=\"right\"><b>".price($totalrecu)."</b></td>";

View File

@ -129,7 +129,6 @@ if ($id > 0)
$resql=$db->query($sql);
if ($resql)
{
$var=true;
$num = $db->num_rows($resql);
// Boucle sur chaque facture

View File

@ -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;

View File

@ -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;

View File

@ -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 '<tr class="oddeven">';
// 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 "</tr>\n";
$var=1;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$total = $total + $obj->amount;
print '<tr class="oddeven">';
print '<td align="left">'.dol_print_date($db->jdate($obj->dm),'day').'</td>'."\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 "</tr>\n";
$var=1;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$total = $total + $obj->amount;
print '<tr class="oddeven">';
print '<td align="left">'.dol_print_date($db->jdate($obj->dm),'day').'</td>'."\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 "</tr>\n";
$var=1;
while ($i < $num)
{
$obj = $db->fetch_object($result);
$total = $total + $obj->amount;
print '<tr class="oddeven">';
print '<td align="left">'.dol_print_date($db->jdate($obj->dateep),'day').'</td>'."\n";

View File

@ -327,8 +327,7 @@ print_liste_field_titre(
"",
'align="center" width="20%"'
);
print "</tr>\n";
$var=true;
print "</tr>\n";
if (count($amount)) {
$arrayforsort=$name;

View File

@ -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;