From 81e203eef13363307714a13b3b2757566cb9df5a Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 15 Nov 2014 20:48:39 +0100 Subject: [PATCH] Fix: Ref was not visible. --- htdocs/fourn/card.php | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 93ea02b0759..1f7f7fc079d 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Eric Seigne - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent * Copyright (C) 2014 Jean Heimburger @@ -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 ''; print ''; print ''; - print img_object($langs->trans('ShowBill'),'bill').' '.$obj->ref_supplier.' '.dol_trunc($obj->libelle,14).''; + $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.''; + print ' '.dol_trunc($obj->libelle,14); + print ''; print ''.dol_print_date($db->jdate($obj->df),'day').''; print ''.price($obj->amount).''; print ''; @@ -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 '
'; - + if ($user->rights->fournisseur->commande->creer) { $langs->load("orders"); @@ -471,7 +477,7 @@ if ($object->fetch($id)) $langs->load("bills"); print ''.$langs->trans("AddBill").''; } - + if ($user->rights->fournisseur->facture->creer) { if (! empty($orders2invoice) && $orders2invoice > 0) print '';