diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 5a894317f22..6fc8bce2b98 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -21,8 +21,17 @@ * $Source$ * */ + +/** + \file htdocs/fourn/fiche.php + \ingroup fournisseur, facture + \brief Page de fiche fournisseur + \version $Revision$ +*/ + require("./pre.inc.php"); require("../contact.class.php"); +require("../facturefourn.class.php"); $langs->load("suppliers"); $langs->load("bills"); @@ -61,33 +70,48 @@ if ( $societe->fetch($socid) ) $h = 0; $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$socid; - $head[$h][1] = "Fiche société"; + $head[$h][1] = $langs->trans("Company"); $h++; if ($societe->client==1) { $head[$h][0] = DOL_URL_ROOT.'/comm/fiche.php?socid='.$socid; - $head[$h][1] = 'Client'; + $head[$h][1] = $langs->trans("Customer"); $h++; } if ($societe->client==2) { $head[$h][0] = DOL_URL_ROOT.'/comm/prospect/fiche.php?id='.$socid; - $head[$h][1] = 'Prospect'; + $head[$h][1] = $langs->trans("Prospect"); $h++; } if ($societe->fournisseur) { $hselected=$h; $head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$socid; - $head[$h][1] = 'Fournisseur'; + $head[$h][1] = $langs->trans("Supplier"); $h++; } if ($conf->produit->enabled) { $head[$h][0] = DOL_URL_ROOT.'/product/liste.php?type=0&fourn_id='.$societe->id; - $head[$h][1] = 'Produits'; + $head[$h][1] = $langs->trans("Products"); $h++; } + + $head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$societe->id; + $head[$h][1] = $langs->trans("Note"); + $h++; + + if ($user->societe_id == 0) + { + $head[$h][0] = DOL_URL_ROOT.'/docsoc.php?socid='.$societe->id; + $head[$h][1] = $langs->trans("Documents"); + $h++; + } + + $head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$societe->id; + $head[$h][1] = $langs->trans("Notifications"); + $h++; dolibarr_fiche_head($head, $hselected, $societe->nom); @@ -100,11 +124,11 @@ if ( $societe->fetch($socid) ) /* * */ - print ''; - print ''; - print ''; - print ''; - print ""; + print '
Nom'.$societe->nom.'
Adresse'.nl2br($societe->adresse).'
'.$societe->cp.' '.$societe->ville.'
Tél'.dolibarr_print_phone($societe->tel).' Fax'.dolibarr_print_phone($societe->fax).' 
Weburl\">$societe->url 
'; + print ''; + print ''; + print ''; + print '"; print '
'.$langs->trans("Name").''.$societe->nom.'
'.$langs->trans("Address").''.nl2br($societe->adresse).'
'.$societe->cp.' '.$societe->ville.'
'.$langs->trans("Phone").''.dolibarr_print_phone($societe->tel).' '.$langs->trans("Fax").''.dolibarr_print_phone($societe->fax).' 
'.$langs->trans("Web")."url\">$societe->url 
'; /* @@ -123,7 +147,7 @@ if ( $societe->fetch($socid) ) $sql .= " ORDER BY p.rowid DESC LIMIT 0,4"; if ( $db->query($sql) ) { - print ''; + print '
'; $i = 0 ; $num = $db->num_rows(); if ($num > 0) @@ -167,18 +191,19 @@ if ( $societe->fetch($socid) ) * Liste des factures associées * */ - $sql = "SELECT p.rowid,p.libelle,p.facnumber,".$db->pdate("p.datef")." as df"; + $sql = "SELECT p.rowid,p.libelle,p.facnumber,".$db->pdate("p.datef")." as df, total_ttc as amount, paye"; $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as p WHERE p.fk_soc = $societe->id"; $sql .= " ORDER BY p.datef DESC LIMIT 0,4"; if ( $db->query($sql) ) { - print '
'; + print '
'; + $var=!$var; $i = 0 ; $num = $db->num_rows(); if ($num > 0) { - print ''; - print ""; + print ""; + print ""; } while ($i < $num && $i < 5) { @@ -189,8 +214,12 @@ if ( $societe->fetch($socid) ) print ''; - print ""; + print $obj->facnumber.'
'.substr($obj->libelle,0,40).'...'; + print ""; + print ''; + $fac = new FactureFourn($db); + print ''; + print ""; $i++; } $db->free();
id\">liste des factures
id\">Liste des factures ($num)
'; print ''; print img_file(); - print $obj->facnumber.' '.$obj->libelle.'".dolibarr_print_date($obj->df)."
".dolibarr_print_date($obj->df)."'.$obj->amount.''.$fac->LibStatut($obj->paye,$obj->statut).'