From 58b9e2d4fd22a62c6400fdc6c736d4d03132c0d9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Mar 2006 22:46:29 +0000 Subject: [PATCH] =?UTF-8?q?New:=20Am=E9lioration=20ergonomiques=20D=E9but?= =?UTF-8?q?=20ajout=20Aper=E7u=20client=20et=20Aper=E7u=20fournisseur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/comm/fiche.php | 57 ++---- htdocs/compta/fiche.php | 81 ++++---- htdocs/compta/recap-client.php | 68 ++++--- htdocs/facture.class.php | 80 ++++++-- htdocs/fourn/fiche.php | 219 ++++++++++----------- htdocs/fourn/fournisseur.facture.class.php | 103 +++++++--- htdocs/langs/en_US/main.lang | 7 + htdocs/langs/fr_FR/main.lang | 7 + 8 files changed, 353 insertions(+), 269 deletions(-) diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 7f5be045ac6..18c2477c37f 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -279,23 +279,7 @@ if ($socidp > 0) if ($objsoc->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); print ''; } - if ($conf->compta->enabled || $conf->comptaexpert->enabled) - { - print ''; - print ''.$langs->trans("CustomerAccountancyCode").''.$objsoc->code_compta.''; - print ''; - } - /* - if ($objsoc->fournisseur) { - print ''; - print $langs->trans('SupplierCode').''; - print $objsoc->code_fournisseur; - if ($objsoc->check_codefournisseur() <> 0) print ' '.$langs->trans("WrongSupplierCode"); - print ''; - } - */ - print "".$langs->trans('Address')."".nl2br($objsoc->adresse).""; print ''.$langs->trans('Zip').''.$objsoc->cp.""; @@ -316,31 +300,8 @@ if ($socidp > 0) print ''.$langs->transcountry('ProfId3',$objsoc->pays_code).''.$objsoc->ape.' '; } - // Type + Staff - $arr = $objsoc->typent_array($objsoc->typent_id); - $objsoc->typent= $arr[$objsoc->typent_id]; - if ($objsoc->typent || $objsoc->effectif) { - print ''.$langs->trans("Type").''.$objsoc->typent.''.$langs->trans("Staff").''.$objsoc->effectif.''; - } - // Assujeti à TVA ou pas print ''; -/* print ''; - print '
'; - print $langs->trans('VATIsUsed'); - print ''; - if ($_GET['action'] != 'editassujtva') print 'id.'">'.img_edit($langs->trans('SetMode'),1).'
'; - print ''; - if ($_GET['action'] == 'editassujtva') - { - $html->form_assujetti_tva($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->tva_assuj,'assujtva_value'); - } - else - { - $html->form_assujetti_tva($_SERVER['PHP_SELF'].'?socid='.$objsoc->id,$objsoc->tva_assuj,'none'); - } - print ""; -*/ print ''.$langs->trans('VATIsUsed').''; print yn($objsoc->tva_assuj); print ''; @@ -443,6 +404,15 @@ if ($socidp > 0) // Nbre max d'éléments des petites listes $MAXLIST=4; + // Lien recap + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'.$langs->trans("Summary").''.$langs->trans("ShowCustomerPreview").'
'; + print '
'; + /* * Dernieres propales @@ -483,7 +453,7 @@ if ($socidp > 0) } print ''.dolibarr_print_date($objp->dp)."\n"; print ''.price($objp->price).''; - print ''.$propal_static->labelstatut_short[$objp->fk_statut].''; + print ''.$propal_static->LibStatut($objp->fk_statut,2).''; $var=!$var; $i++; } @@ -710,8 +680,11 @@ if ($socidp > 0) print ''.$langs->trans("AddAction").''; - print ''.$langs->trans("AddContact").''; - + if ($user->rights->societe->contact->creer) + { + print ''.$langs->trans("AddContact").''; + } + print ''; print '
'; diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php index 8065e7efd57..e2add497cf5 100644 --- a/htdocs/compta/fiche.php +++ b/htdocs/compta/fiche.php @@ -251,21 +251,18 @@ if ($socid > 0) print ''.$langs->trans("Phone").''.dolibarr_print_phone($societe->tel,$societe->pays_code).' '.$langs->trans("Fax").''.dolibarr_print_phone($societe->fax,$societe->pays_code).' '; print ''.$langs->trans("Web")."url\" target=\"_blank\">$societe->url "; - // TVA + // Assujeti à TVA ou pas + print ''; + print ''.$langs->trans('VATIsUsed').''; + print yn($objsoc->tva_assuj); + print ''; + print ''; + + // TVA Intra print ''.$langs->trans('VATIntraVeryShort').''; print $societe->tva_intra; print ''; - print ''.$langs->trans('Capital').''; - if ($societe->capital) print $societe->capital.' '.$langs->trans("Currency".$conf->monnaie); - else print ' '; - print ''; - - // Type + Staff - $arr = $societe->typent_array($societe->typent_id); - $societe->typent= $arr[$societe->typent_id]; - print ''.$langs->trans("Type").''.$societe->typent.''.$langs->trans("Staff").''.$societe->effectif.''; - if ($societe->client == 1) { // Remise permanente @@ -312,13 +309,24 @@ if ($socid > 0) // Nbre max d'éléments des petites listes $MAXLIST=5; - $tableaushown=0; + $tableaushown=1; + + // Lien recap + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'.$langs->trans("Summary").''.$langs->trans("ShowAccountancyPreview").'
'; + print '
'; /** * Dernieres factures */ if ($conf->facture->enabled && $user->rights->facture->lire) { + $facturestatic = new Facture($db); + print ''; $sql = "SELECT s.nom, s.idp, f.facnumber, f.amount, f.total, f.total_ttc, ".$db->pdate("f.datef")." as df, f.paye as paye, f.fk_statut as statut, f.rowid as facid "; @@ -336,7 +344,7 @@ if ($socid > 0) { $tableaushown=1; print ''; - print ''; + print ''; print ''; } @@ -356,8 +364,7 @@ if ($socid > 0) } print "\n"; - $fac = new Facture($db); - print "\n"; + print '\n"; print "\n"; $i++; } @@ -413,14 +420,6 @@ if ($socid > 0) print "
'.$langs->trans("LastBills",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllBills").' ('.$num.')
'.$langs->trans("LastCustomersBills",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllBills").' ('.$num.')
".price($objp->total_ttc)."".($fac->LibStatut($objp->paye,$objp->statut,1))."'.($facturestatic->LibStatut($objp->paye,$objp->statut,2))."
"; } - // Lien recap - if ($tableaushown) print '
'; - print ''; - print ''; - print ''; - print ''; - print '
'.$langs->trans("Summary").''.$langs->trans("ShowLog").'
'; - print ""; print "\n"; @@ -431,24 +430,26 @@ if ($socid > 0) */ print '
'; - if ($user->societe_id == 0) - { - // Si société cliente ou prospect, on affiche bouton "Créer facture client" - if ($societe->client != 0 && $conf->facture->enabled && $user->rights->facture->creer) { - $langs->load("bills"); - print "id\">".$langs->trans("AddBill").""; - } + if ($user->societe_id == 0) + { + // Si société cliente ou prospect, on affiche bouton "Créer facture client" + if ($societe->client != 0 && $conf->facture->enabled && $user->rights->facture->creer) { + $langs->load("bills"); + print "id\">".$langs->trans("AddBill").""; + } + + if ($conf->deplacement->enabled) { + $langs->load("trips"); + print "id&action=create\">".$langs->trans("AddTrip").""; + } + } + + print ''.$langs->trans("AddAction").''; - if ($conf->deplacement->enabled) { - $langs->load("trips"); - print "id&action=create\">".$langs->trans("AddTrip").""; - } - } - - if ($user->rights->societe->contact->creer) - { - print "".$langs->trans("AddContact").""; - } + if ($user->rights->societe->contact->creer) + { + print "".$langs->trans("AddContact").""; + } print '
'; print "
\n"; diff --git a/htdocs/compta/recap-client.php b/htdocs/compta/recap-client.php index 590dca968bc..b6bbdd36a28 100644 --- a/htdocs/compta/recap-client.php +++ b/htdocs/compta/recap-client.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2006 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,7 +18,6 @@ * * $Id$ * $Source$ - * */ /** @@ -34,9 +33,7 @@ include_once(DOL_DOCUMENT_ROOT."/facture.class.php"); $langs->load("companies"); if ($conf->facture->enabled) $langs->load("bills"); -/* - * Sécurité accés client - */ +// Sécurité accés client $socid = $_GET["socid"]; if ($user->societe_id > 0) { @@ -46,7 +43,6 @@ if ($user->societe_id > 0) $user->getrights('facture'); -llxHeader(); /* @@ -54,14 +50,14 @@ llxHeader(); * Mode fiche * */ + +llxHeader(); + if ($socid > 0) { $societe = new Societe($db); $societe->fetch($socid, $to); // si $to='next' ajouter " AND s.idp > $socid ORDER BY idp ASC LIMIT 1"; - /* - * Affichage onglets - */ /* * Affichage onglets */ @@ -137,22 +133,24 @@ if ($socid > 0) print ($societe->prefix_comm?$societe->prefix_comm:' '); print ''; - if ($societe->client) { - print ''; - print ''.$langs->trans("CustomerCode"). ''. $societe->code_client . ''; - print ''; - print ''; - print ''.$langs->trans("CustomerAccountancyCode").''.$societe->code_compta.''; - print ''; + if ($societe->client) + { + print ''; + print ''.$langs->trans("CustomerCode"). ''. $societe->code_client . ''; + print ''; + print ''; + print ''.$langs->trans("CustomerAccountancyCode").''.$societe->code_compta.''; + print ''; } - if ($societe->fournisseur) { - print ''; - print ''.$langs->trans("SupplierCode"). ''. $societe->code_fournisseur . ''; - print ''; - print ''; - print ''.$langs->trans("SupplierAccountancyCode").''.$societe->code_compta_fournisseur.''; - print ''; + if ($societe->fournisseur) + { + print ''; + print ''.$langs->trans("SupplierCode"). ''. $societe->code_fournisseur . ''; + print ''; + print ''; + print ''.$langs->trans("SupplierAccountancyCode").''.$societe->code_compta_fournisseur.''; + print ''; } print ''.$langs->trans("Address").''.nl2br($societe->adresse).""; @@ -164,10 +162,19 @@ if ($socid > 0) print ''.$langs->trans("Phone").''.dolibarr_print_phone($societe->tel,$societe->pays_code).' '.$langs->trans("Fax").''.dolibarr_print_phone($societe->fax,$societe->pays_code).' '; - print "".$langs->transcountry("ProfId1",$societe->pays_code)."siren."\">".$societe->siren." "; - print ''.$langs->transcountry('ProfId2',$societe->pays_code).''.$societe->siret.''; + print ''.$langs->trans("Web")."url\" target=\"_blank\">$societe->url "; - print ''.$langs->transcountry('ProfId3',$societe->pays_code).''.$societe->ape.' '; + // Assujeti à TVA ou pas + print ''; + print ''.$langs->trans('VATIsUsed').''; + print yn($objsoc->tva_assuj); + print ''; + print ''; + + // TVA Intra + print ''.$langs->trans('VATIntraVeryShort').''; + print $societe->tva_intra; + print ''; print ""; @@ -182,9 +189,9 @@ if ($socid > 0) if ($conf->facture->enabled && $user->rights->facture->lire) { // Factures - print_fiche_titre($langs->trans("Bills")); + print_fiche_titre($langs->trans("AccountancyPreview")); - print ''; + print '
'; $sql = "SELECT s.nom, s.idp, f.facnumber, f.amount, ".$db->pdate("f.datef")." as df"; $sql .= " , f.paye as paye, f.fk_statut as statut, f.rowid as facid "; @@ -200,7 +207,9 @@ if ($socid > 0) if ($num > 0) { print ''; - print ''; + print ''; + print ''; + print ''; print ''; print ''; print ''; @@ -240,6 +249,7 @@ if ($socid > 0) print "\n"; print "\n"; + print ''; print '\n"; $solde = $solde + $fac->total_ttc; diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index f7487fa195c..075add34491 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -1364,7 +1364,7 @@ class Facture /** * \brief Retourne le libellé du statut d'une facture (brouillon, validée, abandonnée, payée) - * \param mode 0=libellé long, 1=libellé court + * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long * \return string Libelle */ function getLibStatut($mode=0) @@ -1373,10 +1373,10 @@ class Facture } /** - * \brief Renvoi le libellé d'un statut donn + * \brief Renvoi le libellé d'un statut donné * \param paye Etat paye * \param statut Id statut - * \param mode 0=libellé long, 1=libellé court + * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long * \return string Libellé du statut */ function LibStatut($paye,$statut,$mode=0) @@ -1384,19 +1384,77 @@ class Facture global $langs; $langs->load('bills'); - $prefix=''; + if ($mode == 0) + { + $prefix=''; + if (! $paye) + { + if ($statut == 0) return $langs->trans('Bill'.$prefix.'StatusDraft'); + if ($statut == 3) return $langs->trans('Bill'.$prefix.'StatusCanceled'); + return $langs->trans('Bill'.$prefix.'StatusValidated'); + } + else + { + return $langs->trans('Bill'.$prefix.'StatusPayed'); + } + } if ($mode == 1) + { $prefix='Short'; - if (! $paye) - { - if ($statut == 0) return $langs->trans('Bill'.$prefix.'StatusDraft'); - if ($statut == 3) return $langs->trans('Bill'.$prefix.'StatusCanceled'); - return $langs->trans('Bill'.$prefix.'StatusValidated'); + if (! $paye) + { + if ($statut == 0) return $langs->trans('Bill'.$prefix.'StatusDraft'); + if ($statut == 3) return $langs->trans('Bill'.$prefix.'StatusCanceled'); + return $langs->trans('Bill'.$prefix.'StatusValidated'); + } + else + { + return $langs->trans('Bill'.$prefix.'StatusPayed'); + } } - else + if ($mode == 2) { - return $langs->trans('Bill'.$prefix.'StatusPayed'); + $prefix='Short'; + if (! $paye) + { + if ($statut == 0) return img_picto($langs->trans('Bill'.$prefix.'StatusDraft'),'statut0').' '.$langs->trans('Bill'.$prefix.'StatusDraft'); + if ($statut == 3) return img_picto($langs->trans('Bill'.$prefix.'StatusCanceled'),'statut5').' '.$langs->trans('Bill'.$prefix.'StatusCanceled'); + return img_picto($langs->trans('Bill'.$prefix.'StatusValidated'),'statut4').' '.$langs->trans('Bill'.$prefix.'StatusValidated'); + } + else + { + return img_picto($langs->trans('Bill'.$prefix.'StatusPayed'),'statut6').' '.$langs->trans('Bill'.$prefix.'StatusPayed'); + } } + if ($mode == 3) + { + $prefix='Short'; + if (! $paye) + { + if ($statut == 0) return img_picto($langs->trans('Bill'.$prefix.'StatusDraft'),'statut0'); + if ($statut == 3) return img_picto($langs->trans('Bill'.$prefix.'StatusCanceled'),'statut5'); + return img_picto($langs->trans('Bill'.$prefix.'StatusValidated'),'statut4'); + } + else + { + return img_picto($langs->trans('Bill'.$prefix.'StatusPayed'),'statut6'); + } + } + if ($mode == 4) + { + $prefix='Short'; + if (! $paye) + { + if ($statut == 0) return img_picto($langs->trans('Bill'.$prefix.'StatusDraft'),'statut0'); + if ($statut == 3) return img_picto($langs->trans('Bill'.$prefix.'StatusCanceled'),'statut5'); + return img_picto($langs->trans('Bill'.$prefix.'StatusValidated'),'statut4'); + } + else + { + return img_picto($langs->trans('Bill'.$prefix.'StatusPayed'),'statut6'); + } + } + } /** diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index 16714857939..e4405b5c399 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -133,96 +133,64 @@ if ( $societe->fetch($socid) ) dolibarr_fiche_head($head, $hselected, $societe->nom); - /* - * - * - */ - - print '
'.$langs->trans("Date").' '.$langs->trans("Date").'  '.$langs->trans("Debit").''.$langs->trans("Credit").''.$langs->trans("Balance").'".dolibarr_print_date($fac->date)."id\">".img_object($langs->trans("ShowBill"),"bill")." ".$fac->ref."'.$fac->getLibStatut(2).''.price($fac->total_ttc)."
'; - print ''; + print '
'; - - print ''; - print ''; - + + print '
'.$langs->trans("Name").''.$societe->nom.'
'; + print '
'; + + print ''; + print ''; + print ''; - /* - if ($societe->client) { - print ''; - } - */ - - if ($societe->fournisseur) { - print ''; - print ''; - print ''; - print ''; } - print ''; - - print ''; - print ''; - print ''; - print ''; - print '"; + print ''; + + print ''; + print ''; + print ''; + print ''; + print '"; - print ""; - print ''; + // Assujeti à TVA ou pas + print ''; + print ''; + print ''; - print ''; - - // Statut juridique - print ''; - - // Type + Staff - $arr = $societe->typent_array($societe->typent_id); - $societe->typent= $arr[$societe->typent_id]; - print ''; - - print '
'.$langs->trans("Name").''.$societe->nom.'
'.$langs->trans('Prefix').''.$societe->prefix_comm.'
'; - print $langs->trans('CustomerCode').''; - print $societe->code_client; - if ($societe->check_codeclient() <> 0) print ' '.$langs->trans("WrongCustomerCode"); - print '
'; + if ($societe->fournisseur) + { + print '
'; print $langs->trans('SupplierCode').''; print $societe->code_fournisseur; if ($societe->check_codefournisseur() <> 0) print ' '.$langs->trans("WrongSupplierCode"); print '
'.$langs->trans("SupplierAccountancyCode").''.$societe->code_compta_fournisseur.'
'.$langs->trans("Address").''.nl2br($societe->adresse).'
'.$langs->trans("Zip").''.$societe->cp.''.$langs->trans("Town").''.$societe->ville.'
'.$langs->trans("Country").''.$societe->pays.'
'.$langs->trans("Phone").''.dolibarr_print_phone($societe->tel).' '.$langs->trans("Fax").''.dolibarr_print_phone($societe->fax).' 
'.$langs->trans("Web")."url\">$societe->url 
'.$langs->trans("Address").''.nl2br($societe->adresse).'
'.$langs->trans("Zip").''.$societe->cp.''.$langs->trans("Town").''.$societe->ville.'
'.$langs->trans("Country").''.$societe->pays.'
'.$langs->trans("Phone").''.dolibarr_print_phone($societe->tel).' '.$langs->trans("Fax").''.dolibarr_print_phone($societe->fax).' 
'.$langs->trans("Web")."url\">$societe->url 
".$langs->transcountry("ProfId1",$societe->pays_code)."siren."\">".$societe->siren." '.$langs->transcountry('ProfId2',$societe->pays_code).''.$societe->siret.'
'.$langs->trans('VATIsUsed').''; + print yn($objsoc->tva_assuj); + print '
'.$langs->transcountry('ProfId3',$societe->pays_code).''.$societe->ape.' 
'.$langs->trans('JuridicalStatus').''.$societe->forme_juridique.'
'.$langs->trans("Type").''.$societe->typent.''.$langs->trans("Staff").''.$societe->effectif.'
'; + print '
'; - /* - * - */ + print '
'; + $var=true; - print ''; - - - $var=true; - - /* - * Liste des produits - */ - if ($conf->produit->enabled || $conf->service->enabled) - { - $langs->load("products"); - print ''; - print ''; - print '
'.$langs->trans("ProductsAndServices").''; - print ''.$langs->trans("All").' ('.$societe->NbProduct().')'; - print '

'; - } + $MAXLIST=4; + + // Lien recap + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'.$langs->trans("Summary").''.$langs->trans("ShowSupplierPreview").'
'; + print '
'; /* * Liste des commandes associées */ - $max=4; - $sql = "SELECT p.rowid,p.ref,".$db->pdate("p.date_commande")." as dc, p.fk_statut"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as p "; $sql.= " WHERE p.fk_soc =".$societe->id; $sql.= " ORDER BY p.rowid"; - $sql.= " ".$db->plimit($max); + $sql.= " ".$db->plimit($MAXLIST); $resql=$db->query($sql); if ($resql) { @@ -233,11 +201,11 @@ if ( $societe->fetch($socid) ) print ''; print ''; print ''; } - while ($i < $num && $i <= $max) + while ($i < $num && $i <= $MAXLIST) { $obj = $db->fetch_object($resql); $var=!$var; @@ -273,8 +241,11 @@ if ( $societe->fetch($socid) ) /* * Liste des factures associées */ + $MAXLIST=5; + $langs->load('bills'); - $max=5; + $facturestatic = new FactureFournisseur($db); + $sql = 'SELECT p.rowid,p.libelle,p.facnumber,p.fk_statut,'.$db->pdate('p.datef').' as df, total_ttc as amount, paye'; $sql.= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as p'; $sql.= ' WHERE p.fk_soc = '.$societe->id; @@ -289,11 +260,10 @@ if ( $societe->fetch($socid) ) print '
'; - print ''; + print '
'.$langs->trans("LastOrders",min($num,$max)).'
'; print '
'.$langs->trans("LastOrders",($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans("AllOrders").' ('.$num.')
'; print '
'; print ''; print ''; } - $facturestatic = new FactureFournisseur($db); - while ($i < min($num,$max)) + while ($i < min($num,$MAXLIST)) { $obj = $db->fetch_object($resql); $var=!$var; @@ -301,9 +271,9 @@ if ( $societe->fetch($socid) ) print ''; - print ''; + print ''; print ''; - print ''; + print ''; print ''; $i++; } @@ -318,54 +288,69 @@ if ( $societe->fetch($socid) ) dolibarr_print_error($db); } - /* - * - * - */ - print ''; - print '
'; - print '
'.$langs->trans('LastSuppliersBills',min($num,$max)).''.$langs->trans('AllBills').' ('.$num.')
'; + print '
'.$langs->trans('LastSuppliersBills',($num<=$MAXLIST?"":$MAXLIST)).''.$langs->trans('AllBills').' ('.$num.')
'; print '
'; print ''; print img_object($langs->trans('ShowBill'),'bill').' '.$obj->facnumber.' '.dolibarr_trunc($obj->libelle,14).''.dolibarr_print_date($obj->df).''.dolibarr_print_date($obj->df).''.price($obj->amount).''.$facturestatic->LibStatutShort($obj->paye,$obj->fk_statut).''.$facturestatic->LibStatut($obj->paye,$obj->fk_statut,2).'
' . "\n"; - print ''; + /* + * Liste des produits + */ + if ($conf->produit->enabled || $conf->service->enabled) + { + $langs->load("products"); + print ''; + print ''; + print '
'.$langs->trans("ProductsAndServices").''; + print ''.$langs->trans("All").' ('.$societe->NbProduct().')'; + print '

'; + } - /* - * - * Barre d'actions - * - */ + print '
' . "\n"; + print ''; + + + /* + * + * Barre d'actions + * + */ - print '
'; + print '
'; + + if ($user->rights->fournisseur->commande->creer) + { + $langs->load("orders"); + print ''.$langs->trans("AddOrder").''; + } + + if ($user->rights->fournisseur->facture->creer) + { + $langs->load("bills"); + print ''.$langs->trans("AddBill").''; + } + + print ''.$langs->trans("AddAction").''; - if ($user->rights->fournisseur->commande->creer) - { - $langs->load("orders"); - print ''.$langs->trans("AddOrder").''; - } + if ($user->rights->societe->contact->creer) + { + print "".$langs->trans("AddContact").""; + } + + print '
'; - if ($user->rights->fournisseur->facture->creer) - { - $langs->load("bills"); - print ''.$langs->trans("AddBill").''; - } - print '
'; /* * * Liste des contacts * */ - $langs->load("companies"); - - print '
'; - - print ''; - print ''; - print ""; - - if ($user->rights->societe->contact->creer) - { - print ""; - } - - print ""; + $langs->load("companies"); + + print '
'.$langs->trans("Contact").'Poste'.$langs->trans("Tel").'".$langs->trans("Fax")."".$langs->trans("EMail")."".$langs->trans("AddContact")."
'; + + print ''; + print ''; + print ""; + print ""; + print ''; + print ""; $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as p"; @@ -405,6 +390,10 @@ if ( $societe->fetch($socid) ) print ""; } + print ''; + print "\n"; $i++; } diff --git a/htdocs/fourn/fournisseur.facture.class.php b/htdocs/fourn/fournisseur.facture.class.php index 2bde9caef81..9313f7cdb7f 100644 --- a/htdocs/fourn/fournisseur.facture.class.php +++ b/htdocs/fourn/fournisseur.facture.class.php @@ -507,54 +507,93 @@ class FactureFournisseur /** * \brief Retourne le libellé du statut d'une facture (brouillon, validée, abandonnée, payée) - * \return string Libellé + * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long + * \return string Libelle */ - function getLibStatut() + function getLibStatut($mode=0) { - return $this->LibStatut($this->paye,$this->statut); + return $this->LibStatut($this->paye,$this->statut,$mode); } /** - * \brief Renvoi le libellé court d'un statut donné - * \param paye etat paye - * \param statut id statut - * \return string Libellé long du statut + * \brief Renvoi le libellé d'un statut donné + * \param paye Etat paye + * \param statut Id statut + * \param mode 0=libellé long, 1=libellé court, 2=Picto + Libellé court, 3=Picto, 4=Picto + Libellé long + * \return string Libellé du statut */ - function LibStatutShort($paye,$statut) + function LibStatut($paye,$statut,$mode) { global $langs; $langs->load('bills'); - if (! $paye) + + if ($mode==0) { - if ($statut == 0) return $langs->trans('BillShortStatusDraft'); - if ($statut == 3) return $langs->trans('BillShortStatusCanceled'); - return $langs->trans('BillShortStatusValidated'); + if (! $paye) + { + if ($statut == 0) return $langs->trans('BillStatusDraft'); + if ($statut == 3) return $langs->trans('BillStatusCanceled'); + return $langs->trans('BillStatusValidated'); + } + else + { + return $langs->trans('BillStatusPayed'); + } } - else + if ($mode==1) { - return $langs->trans('BillShortStatusPayed'); + if (! $paye) + { + if ($statut == 0) return $langs->trans('BillShortStatusDraft'); + if ($statut == 3) return $langs->trans('BillShortStatusCanceled'); + return $langs->trans('BillShortStatusValidated'); + } + else + { + return $langs->trans('BillShortStatusPayed'); + } } - } - - /** - * \brief Renvoi le libellé long d'un statut donné - * \param paye etat paye - * \param statut id statut - * \return string Libellé long du statut - */ - function LibStatut($paye,$statut) - { - global $langs; - $langs->load('bills'); - if (! $paye) + if ($mode == 2) { - if ($statut == 0) return $langs->trans('BillStatusDraft'); - if ($statut == 3) return $langs->trans('BillStatusCanceled'); - return $langs->trans('BillStatusValidated'); + $prefix='Short'; + if (! $paye) + { + if ($statut == 0) return img_picto($langs->trans('Bill'.$prefix.'StatusDraft'),'statut0').' '.$langs->trans('Bill'.$prefix.'StatusDraft'); + if ($statut == 3) return img_picto($langs->trans('Bill'.$prefix.'StatusCanceled'),'statut5').' '.$langs->trans('Bill'.$prefix.'StatusCanceled'); + return img_picto($langs->trans('Bill'.$prefix.'StatusValidated'),'statut4').' '.$langs->trans('Bill'.$prefix.'StatusValidated'); + } + else + { + return img_picto($langs->trans('Bill'.$prefix.'StatusPayed'),'statut6').' '.$langs->trans('Bill'.$prefix.'StatusPayed'); + } } - else + if ($mode == 3) { - return $langs->trans('BillStatusPayed'); + $prefix='Short'; + if (! $paye) + { + if ($statut == 0) return img_picto($langs->trans('Bill'.$prefix.'StatusDraft'),'statut0'); + if ($statut == 3) return img_picto($langs->trans('Bill'.$prefix.'StatusCanceled'),'statut5'); + return img_picto($langs->trans('Bill'.$prefix.'StatusValidated'),'statut4'); + } + else + { + return img_picto($langs->trans('Bill'.$prefix.'StatusPayed'),'statut6'); + } + } + if ($mode == 4) + { + $prefix='Short'; + if (! $paye) + { + if ($statut == 0) return img_picto($langs->trans('Bill'.$prefix.'StatusDraft'),'statut0'); + if ($statut == 3) return img_picto($langs->trans('Bill'.$prefix.'StatusCanceled'),'statut5'); + return img_picto($langs->trans('Bill'.$prefix.'StatusValidated'),'statut4'); + } + else + { + return img_picto($langs->trans('Bill'.$prefix.'StatusPayed'),'statut6'); + } } } diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 1403c94ce64..f81c9bebbe2 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -297,6 +297,13 @@ BuildDoc=Build Doc RebuildDoc=Rebuild Doc Entity=Entity Entities=Entities +EventLogs=Logs +CustomerPreview=Customer preview +SupplierPreview=Supplier preview +AccountancyPreview=Accountancy preview +ShowCustomerPreview=Show customer preview +ShowSupplierPreview=Show supplier preview +ShowAccountancyPreview=Show accountancy preview # Countries CountryFR=France CountryBE=Belgium diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 1ea81918b09..23755e5041c 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -297,6 +297,13 @@ BuildDoc=G RebuildDoc=Regénérer le doc Entity=Entité Entities=Entités +EventLogs=Suivi +CustomerPreview=Aperçu client +SupplierPreview=Aperçu fournisseur +AccountancyPreview=Aperçu compta +ShowCustomerPreview=Afficher aperçu client +ShowSupplierPreview=Afficher aperçu fournisseur +ShowAccountancyPreview=Afficher aperçu compta # Countries CountryFR=France CountryBE=Belgique
'.$langs->trans("Firstname").' '.$langs->trans("Lastname").''.$langs->trans("Poste").''.$langs->trans("Tel").'".$langs->trans("Fax")."".$langs->trans("EMail")."  
idp\">".img_edit()."'; + print img_object($langs->trans("Rendez-Vous"),"action"); + print '