Fix: Ref was not visible.

This commit is contained in:
Laurent Destailleur 2014-11-15 20:48:39 +01:00
parent c186f13218
commit 81e203eef1

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Eric Seigne <erics@rycks.com>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2014 Jean Heimburger <jean@tiaris.info>
@ -304,8 +304,8 @@ if ($object->fetch($id))
if ($user->rights->fournisseur->commande->lire)
{
// TODO move to DAO class
// Check if there are supplier orders billable
$sql2 = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_supplier,';
@ -325,7 +325,7 @@ if ($object->fetch($id))
} else {
setEventMessage($db->lasterror(),'errors');
}
// TODO move to DAO class
$sql = "SELECT p.rowid,p.ref, p.date_commande as dc, p.fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p ";
@ -394,7 +394,7 @@ if ($object->fetch($id))
if ($user->rights->fournisseur->facture->lire)
{
// TODO move to DAO class
$sql = 'SELECT f.rowid,f.libelle,f.ref_supplier,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,';
$sql = 'SELECT f.rowid,f.libelle,f.ref,f.ref_supplier,f.fk_statut,f.datef as df,f.total_ttc as amount,f.paye,';
$sql.= ' SUM(pf.amount) as am';
$sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON f.rowid=pf.fk_facturefourn';
@ -425,7 +425,13 @@ if ($object->fetch($id))
print '<tr '.$bc[$var].'>';
print '<td>';
print '<a href="facture/card.php?facid='.$obj->rowid.'">';
print img_object($langs->trans('ShowBill'),'bill').' '.$obj->ref_supplier.'</a> '.dol_trunc($obj->libelle,14).'</td>';
$facturestatic->id=$obj->rowid;
$facturestatic->ref=($obj->ref?$obj->ref:$obj->rowid).($obj->ref_supplier?' - '.$obj->ref_supplier:'');
//$facturestatic->ref_supplier=$obj->ref_supplier;
print $facturestatic->getNomUrl(1);
//print img_object($langs->trans('ShowBill'),'bill').' '.($obj->ref?$obj->ref:$obj->rowid).' - '.$obj->ref_supplier.'</a>';
print ' '.dol_trunc($obj->libelle,14);
print '</td>';
print '<td align="center" class="nowrap">'.dol_print_date($db->jdate($obj->df),'day').'</td>';
print '<td align="right" class="nowrap">'.price($obj->amount).'</td>';
print '<td align="right" class="nowrap">';
@ -455,11 +461,11 @@ if ($object->fetch($id))
$parameters = array();
$reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been
// modified by hook
if (empty($reshook))
if (empty($reshook))
{
print '<div class="tabsAction">';
if ($user->rights->fournisseur->commande->creer)
{
$langs->load("orders");
@ -471,7 +477,7 @@ if ($object->fetch($id))
$langs->load("bills");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&socid='.$object->id.'">'.$langs->trans("AddBill").'</a>';
}
if ($user->rights->fournisseur->facture->creer)
{
if (! empty($orders2invoice) && $orders2invoice > 0) print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/orderstoinvoice.php?socid='.$object->id.'">'.$langs->trans("CreateInvoiceForThisCustomer").'</a></div>';