diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php index 85c5242ef1d..f2c09e73136 100644 --- a/htdocs/fourn/index.php +++ b/htdocs/fourn/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2006 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -37,8 +37,6 @@ $langs->load("suppliers"); $langs->load("orders"); $langs->load("companies"); -llxHeader(); - // Sécurité accés client $socid=''; if ($user->societe_id > 0) @@ -47,6 +45,17 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } + +/* +* Affichage page +*/ + +$facturestatic=new Facture($db); + +llxHeader("",$langs->trans("SuppliersArea")); + +print_fiche_titre($langs->trans("SuppliersArea")); + print ''; print '
'; @@ -87,6 +96,8 @@ else { dolibarr_print_error($db); } + + /* * */ @@ -130,6 +141,72 @@ else dolibarr_print_error($db); } + +/** + * Factures brouillons + */ +if ($conf->facture->enabled && $user->rights->fournisseur->facture->lire) +{ + $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,"; + $sql.= " s.nom, s.idp"; + $sql .= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s"; + $sql .= " WHERE s.idp = f.fk_soc AND f.fk_statut = 0"; + if ($socid) + { + $sql .= " AND f.fk_soc = ".$socid; + } + + $resql = $db->query($sql); + + if ( $resql ) + { + $num = $db->num_rows($resql); + if ($num) + { + $companystatic=new Societe($db); + + print '
'; + print ''; + print ''; + $i = 0; + $tot_ttc = 0; + $var = True; + while ($i < $num && $i < 20) + { + $obj = $db->fetch_object($resql); + $var=!$var; + print ''; + print ''; + print ''; + print ''; + $tot_ttc+=$obj->total_ttc; + $i++; + } + + print ''; + print ''; + print ''; + + print "
'.$langs->trans("DraftBills").' ('.$num.')
'; + $facturestatic->ref=$obj->facnumber; + $facturestatic->id=$obj->rowid; + $facturestatic->type=$obj->type; + print $facturestatic->getNomUrl(1,''); + print ''; + $companystatic->id=$obj->idp; + $companystatic->nom=$obj->nom; + $companystatic->client=1; + print $companystatic->getNomUrl(1,'',16); + print ''.price($obj->total_ttc).'
'.$langs->trans("Total").''.price($tot_ttc).'

"; + } + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } +} + /* * * diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index a46e8d2425d..5472ca77859 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -17,4 +17,5 @@ ErrorQtyTooLowForThisSupplier=Quantity too low for this supplier ErrorSupplierCountryIsNotDefined=Country for this supplier is not defined. Correct this first. ProductHasAlreadyReferenceInThisSupplier=This product has already a reference in this supplier NoRecordedSuppliers=No suppliers recorded -SupplierPayment=Supplier payment \ No newline at end of file +SupplierPayment=Supplier payment +SuppliersArea=Suppliers area \ No newline at end of file diff --git a/htdocs/langs/fr_FR/suppliers.lang b/htdocs/langs/fr_FR/suppliers.lang index 25135eb09be..3e19a71b5ed 100644 --- a/htdocs/langs/fr_FR/suppliers.lang +++ b/htdocs/langs/fr_FR/suppliers.lang @@ -17,4 +17,5 @@ ErrorQtyTooLowForThisSupplier=Quantit ErrorSupplierCountryIsNotDefined=Le pays de ce fournisseur n'est pas défini. Corriger sur sa fiche. ProductHasAlreadyReferenceInThisSupplier=Ce produit a déjà une référence chez ce fournisseur NoRecordedSuppliers=Pas de fournisseurs enregistrés -SupplierPayment=Paiement fournisseur \ No newline at end of file +SupplierPayment=Paiement fournisseur +SuppliersArea=Espace fournisseurs \ No newline at end of file