Fix: Init of var
This commit is contained in:
parent
4e2b3fc685
commit
028049b4ec
@ -178,9 +178,9 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
$sql3.= " ORDER BY dlr ASC";
|
$sql3.= " ORDER BY dlr ASC";
|
||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
$tab_sqlobjorder=array();
|
$tab_sqlobjOrder=array();
|
||||||
$tab_sqlobj=array();
|
$tab_sqlobj=array();
|
||||||
|
|
||||||
// List customer invoices
|
// List customer invoices
|
||||||
$result = $db->query($sql);
|
$result = $db->query($sql);
|
||||||
if ($result)
|
if ($result)
|
||||||
@ -195,7 +195,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
$db->free($result);
|
$db->free($result);
|
||||||
}
|
}
|
||||||
else $error++;
|
else $error++;
|
||||||
|
|
||||||
// List supplier invoices
|
// List supplier invoices
|
||||||
$result2=$db->query($sql2);
|
$result2=$db->query($sql2);
|
||||||
if ($result2)
|
if ($result2)
|
||||||
@ -210,7 +210,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
$db->free($result2);
|
$db->free($result2);
|
||||||
}
|
}
|
||||||
else $error++;
|
else $error++;
|
||||||
|
|
||||||
// List social contributions
|
// List social contributions
|
||||||
$result3=$db->query($sql3);
|
$result3=$db->query($sql3);
|
||||||
if ($result3)
|
if ($result3)
|
||||||
@ -226,8 +226,8 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
$db->free($result3);
|
$db->free($result3);
|
||||||
}
|
}
|
||||||
else $error++;
|
else $error++;
|
||||||
|
|
||||||
|
|
||||||
// Sort array
|
// Sort array
|
||||||
if (! $error)
|
if (! $error)
|
||||||
{
|
{
|
||||||
@ -251,15 +251,15 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
$paiement = '';
|
$paiement = '';
|
||||||
$ref = '';
|
$ref = '';
|
||||||
$refcomp = '';
|
$refcomp = '';
|
||||||
|
|
||||||
$var=!$var;
|
$var=!$var;
|
||||||
//$obj = $db->fetch_object($result);
|
//$obj = $db->fetch_object($result);
|
||||||
$obj = array_shift($tab_sqlobj);
|
$obj = array_shift($tab_sqlobj);
|
||||||
|
|
||||||
if ($obj->family == 'supplier_invoice')
|
if ($obj->family == 'supplier_invoice')
|
||||||
{
|
{
|
||||||
// \TODO This code is to avoid to count suppliers credit note (ff.type = 2)
|
// \TODO This code is to avoid to count suppliers credit note (ff.type = 2)
|
||||||
// Ajouter gestion des avoirs fournisseurs, champ
|
// Ajouter gestion des avoirs fournisseurs, champ
|
||||||
if (($obj->total_ttc < 0 && $obj->type != 2)
|
if (($obj->total_ttc < 0 && $obj->type != 2)
|
||||||
|| ($obj->total_ttc > 0 && $obj->type == 2))
|
|| ($obj->total_ttc > 0 && $obj->type == 2))
|
||||||
{
|
{
|
||||||
@ -294,10 +294,10 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
$socialcontribstatic->id=$obj->objid;
|
$socialcontribstatic->id=$obj->objid;
|
||||||
$socialcontribstatic->lib=$obj->type;
|
$socialcontribstatic->lib=$obj->type;
|
||||||
$ref = $socialcontribstatic->getNomUrl(1,24);
|
$ref = $socialcontribstatic->getNomUrl(1,24);
|
||||||
|
|
||||||
$paiement = -1*$socialcontribstatic->getSommePaiement(); // Payment already done
|
$paiement = -1*$socialcontribstatic->getSommePaiement(); // Payment already done
|
||||||
}
|
}
|
||||||
|
|
||||||
$total_ttc = $obj->total_ttc;
|
$total_ttc = $obj->total_ttc;
|
||||||
if ($paiement) $total_ttc = $obj->total_ttc - $paiement;
|
if ($paiement) $total_ttc = $obj->total_ttc - $paiement;
|
||||||
$solde += $total_ttc;
|
$solde += $total_ttc;
|
||||||
@ -324,7 +324,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
|
|||||||
print '<td align="left" colspan="5">'.$langs->trans("FutureBalance").'</td>';
|
print '<td align="left" colspan="5">'.$langs->trans("FutureBalance").'</td>';
|
||||||
print '<td align="right" nowrap>'.price($solde).'</td>';
|
print '<td align="right" nowrap>'.price($solde).'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user