Skip to content
Snippets Groups Projects
Commit ca6ce2ba authored by arnaud's avatar arnaud
Browse files

FIX status were wrong on product referent list

parent 480587c8
No related branches found
No related tags found
No related merge requests found
......@@ -1431,10 +1431,10 @@ if ($resql)
// Status
if (! empty($arrayfields['f.fk_statut']['checked']))
{
print '<td align="right" class="nowrap">';
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type);
print "</td>";
if (! $i) $totalarray['nbfield']++;
print '<td align="right" class="nowrap">';
print $facturestatic->LibStatut($obj->paye,$obj->fk_statut,5,$paiement,$obj->type);
print "</td>";
if (! $i) $totalarray['nbfield']++;
}
// Action column
......
......@@ -141,7 +141,7 @@ if ($id > 0 || ! empty($ref))
elseif ($user->rights->facture->lire)
{
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client,";
$sql.= " f.facnumber, f.datef, f.paye, f.fk_statut as statut, f.rowid as facid,";
$sql.= " f.facnumber, f.datef, f.paye, f.type, f.fk_statut as statut, f.rowid as facid,";
$sql.= " d.rowid, d.total_ht as total_ht, d.qty"; // We must keep the d.rowid here to not loose record because of the distinct used to ignore duplicate line when link on societe_commerciaux is used
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
......@@ -232,23 +232,24 @@ if ($id > 0 || ! empty($ref))
$var=True;
while ($i < min($num,$conf->liste_limit))
{
$objp = $db->fetch_object($result);
$objp = $db->fetch_object($result);
$invoicestatic->id=$objp->facid;
$invoicestatic->ref=$objp->facnumber;
$societestatic->fetch($objp->socid);
$paiement = $invoicestatic->getSommePaiement();
$var=!$var;
print '<tr '.$bc[$var].'>';
print '<td>';
$invoicestatic->id=$objp->facid;
$invoicestatic->ref=$objp->facnumber;
print $invoicestatic->getNomUrl(1);
print "</td>\n";
$societestatic->fetch($objp->socid);
print '<td>'.$societestatic->getNomUrl(1).'</td>';
print "<td>".$objp->code_client."</td>\n";
print '<td align="center">';
print dol_print_date($db->jdate($objp->datef),'day')."</td>";
print '<td align="center">'.$objp->qty."</td>\n";
print '<td align="right">'.price($objp->total_ht)."</td>\n";
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5).'</td>';
print '<td align="right">'.$invoicestatic->LibStatut($objp->paye,$objp->statut,5,$paiement,$objp->type).'</td>';
print "</tr>\n";
$i++;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment