From e2f85b6d440d6c5c332fd859a33f1ccca0fb2307 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 7 Jul 2007 13:20:36 +0000 Subject: [PATCH] Uniformisation facture fournisseur sur facture client dans espace compta --- htdocs/compta/index.php | 404 +++++++++++++++++++++------------ htdocs/fourn/facture/index.php | 6 +- htdocs/langs/en_US/bills.lang | 5 +- htdocs/langs/en_US/main.lang | 1 + htdocs/langs/fr_FR/bills.lang | 5 +- htdocs/langs/fr_FR/main.lang | 1 + htdocs/lib/company.lib.php | 33 +-- 7 files changed, 285 insertions(+), 170 deletions(-) diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index a8b0047ccba..c714774ba70 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -30,8 +30,9 @@ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/facture.class.php'); +require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.facture.class.php'); if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/commande.class.php'); -if ($conf->facture->enabled) require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.facture.class.php'); +if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/fourn/fournisseur.commande.class.php'); if ($conf->tax->enabled) require_once(DOL_DOCUMENT_ROOT.'/chargesociales.class.php'); $user->getrights(); // On a besoin des permissions sur plusieurs modules @@ -89,6 +90,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'del_bookmark') */ $facturestatic=new Facture($db); +$facturesupplierstatic=new FactureFournisseur($db); llxHeader("",$langs->trans("AccountancyTreasuryArea")); @@ -103,21 +105,30 @@ print ''; */ if ($conf->facture->enabled) { - print '
'; - + print ''; print ''; print ""; - print ''; + print ''; print "'; print ''; print "'; print ''; print "
'.$langs->trans("SearchABill").'
'.$langs->trans("SearchACustomerInvoice").'
".$langs->trans("Ref").':
".$langs->trans("Other").':

"; + + print '
'; + print ''; + print ""; + print ''; + print "'; + print ''; + //print "'; + print ''; + print "
'.$langs->trans("SearchASupplierInvoice").'
".$langs->trans("Ref").':
".$langs->trans("Other").':

"; } /** - * Factures brouillons + * Factures clients brouillons */ if ($conf->facture->enabled && $user->rights->facture->lire) { @@ -129,60 +140,137 @@ if ($conf->facture->enabled && $user->rights->facture->lire) $sql .= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - if ($socid) - { - $sql .= " AND f.fk_soc = $socid"; - } + if ($socid) + { + $sql .= " AND f.fk_soc = $socid"; + } - $resql = $db->query($sql); + $resql = $db->query($sql); - if ( $resql ) - { - $num = $db->num_rows($resql); - if ($num) - { - $companystatic=new Societe($db); + if ( $resql ) + { + $var = false; + $num = $db->num_rows($resql); 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 ''; + if ($num) + { + $companystatic=new Societe($db); - print ''; - print ''; - print ''; + $i = 0; + $tot_ttc = 0; + while ($i < $num && $i < 20) + { + $obj = $db->fetch_object($resql); + print ''; + print ''; + print ''; + print ''; + $tot_ttc+=$obj->total_ttc; + $i++; + $var=!$var; + } - 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->socid; - $companystatic->nom=$obj->nom; - $companystatic->client=1; - print $companystatic->getNomUrl(1,'',16); - print ''.price($obj->total_ttc).'
'.$langs->trans("CustomersDraftInvoices").($num?' ('.$num.')':'').'
'.$langs->trans("Total").''.price($tot_ttc).'
'; + $facturestatic->ref=$obj->facnumber; + $facturestatic->id=$obj->rowid; + $facturestatic->type=$obj->type; + print $facturestatic->getNomUrl(1,''); + print ''; + $companystatic->id=$obj->socid; + $companystatic->nom=$obj->nom; + $companystatic->client=1; + print $companystatic->getNomUrl(1,'',16); + print ''.price($obj->total_ttc).'

"; - } - $db->free($resql); - } - else - { - dolibarr_print_error($db); - } + print ''.$langs->trans("Total").''; + print ''.price($tot_ttc).''; + print ''; + } + else + { + print ''.$langs->trans("NoInvoice").''; + } + print "
"; + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } +} + +/** + * Factures fournisseurs brouillons + */ +if ($conf->facture->enabled && $user->rights->facture->lire) +{ + $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,"; + $sql.= " s.nom, s.rowid as socid"; + if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; + $sql .= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s"; + if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql .= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0"; + if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + + if ($socid) + { + $sql .= " AND f.fk_soc = $socid"; + } + + $resql = $db->query($sql); + + if ( $resql ) + { + $var = false; + $num = $db->num_rows($resql); + + print ''; + print ''; + print ''; + if ($num) + { + $companystatic=new Societe($db); + + $i = 0; + $tot_ttc = 0; + while ($i < $num && $i < 20) + { + $obj = $db->fetch_object($resql); + print ''; + print ''; + print ''; + print ''; + $tot_ttc+=$obj->total_ttc; + $i++; + $var=!$var; + } + + print ''; + print ''; + print ''; + } + else + { + print ''; + } + print "
'.$langs->trans("SuppliersDraftInvoices").($num?' ('.$num.')':'').'
'; + $facturesupplierstatic->ref=$obj->facnumber; + $facturesupplierstatic->id=$obj->rowid; + $facturesupplierstatic->type=$obj->type; + print $facturesupplierstatic->getNomUrl(1,''); + print ''; + $facturesupplierstatic->id=$obj->socid; + $facturesupplierstatic->nom=$obj->nom; + $facturesupplierstatic->fournisseur=1; + print $facturesupplierstatic->getNomUrl(1,'',16); + print ''.price($obj->total_ttc).'
'.$langs->trans("Total").''.price($tot_ttc).'
'.$langs->trans("NoInvoice").'

"; + $db->free($resql); + } + else + { + dolibarr_print_error($db); + } } /** @@ -200,22 +288,21 @@ if ($conf->tax->enabled) $sql.= " WHERE c.fk_type = cc.id AND c.paye=0"; $resql = $db->query($sql); - if ( $resql ) { - $num = $db->num_rows($resql); + $var = false; + $num = $db->num_rows($resql); + + print ''; + print ''; + print ''; if ($num) { - print '
'.$langs->trans("ContributionsToPay").($num?' ('.$num.')':'').'
'; - print ''; - print ''; $i = 0; $tot_ttc=0; - $var = True; while ($i < $num) { $obj = $db->fetch_object($resql); - $var = !$var; print ""; $chargestatic->id=$obj->rowid; $chargestatic->lib=$obj->libelle; @@ -223,15 +310,19 @@ if ($conf->tax->enabled) print ''; print ''; $tot_ttc+=$obj->amount; + $var = !$var; $i++; } print ''; print ''; print ''; - - print '
'.$langs->trans("ContributionsToPay").' ('.$num.')
'.price($obj->amount).'
'.$langs->trans("Total").''.price($tot_ttc).'

'; } + else + { + print ''.$langs->trans("None").''; + } + print "
"; $db->free($resql); } else @@ -307,16 +398,17 @@ if ($user->rights->societe->lire) if ($result) { + $var=false; $num = $db->num_rows($result); $i = 0; + print ''; + print ''; + print ''; + print ''; if ($num) { - print '
'.$langs->trans("BoxTitleLastCustomers",min($max,$num)).''.$langs->trans("Date").'
'; - print ''; - print ''; - print ''; $var = True; $total_ttc = $totalam = $total = 0; @@ -336,8 +428,12 @@ if ($user->rights->societe->lire) $i++; } - print '
'.$langs->trans("BoxTitleLastCustomers",min($max,$num)).''.$langs->trans("Date").'

'; } + else + { + print ''.$langs->trans("None").''; + } + print '
'; } } @@ -365,42 +461,44 @@ if ($user->rights->societe->lire) if ($result) { + $var=false; $num = $db->num_rows($result); $i = 0; + print ''; + print ''; + print ''; + print ''; if ($num) { - print '
'.$langs->trans("BoxTitleLastSuppliers",min($max,$num)).''.$langs->trans("Date").'
'; - print ''; - print ''; - print ''; - $var = True; $total_ttc = $totalam = $total = 0; $customerstatic=new Client($db); - $var=true; while ($i < $num && $i < $max) { $objp = $db->fetch_object($result); $customerstatic->id=$objp->rowid; $customerstatic->nom=$objp->nom; - $var=!$var; print ''; print ''; print ''; print ''; - + $var=!$var; $i++; } - print '
'.$langs->trans("BoxTitleLastSuppliers",min($max,$num)).''.$langs->trans("Date").'
'.$customerstatic->getNomUrl(1).''.dolibarr_print_date($objp->dc,'day').'

'; } + else + { + print ''.$langs->trans("None").''; + } + print '
'; } } /* - * Commandes à facturer + * Commandes clients à facturer */ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->commande->lire) { @@ -429,7 +527,9 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman if ( $resql ) { + $var=false; $num = $db->num_rows($resql); + if ($num) { $i = 0; @@ -441,12 +541,10 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman print ''.$langs->trans("ToBill").''; print ' '; print ''; - $var = True; $tot_ht=$tot_ttc=$tot_tobill=0; while ($i < $num) { $obj = $db->fetch_object($resql); - $var=!$var; print ""; print "rowid\">".img_object($langs->trans("ShowOrder"),"order").' '; print "rowid\">".$obj->ref.''; @@ -463,8 +561,8 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman //print "x".$tot_ttc."z".$obj->tot_fttc; $tot_tobill += ($obj->total_ttc-$obj->tot_fttc); $i++; + $var=!$var; } - $var=!$var; print ''.$langs->trans("Total").'   ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).') '; if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''.price($tot_ht).''; @@ -483,7 +581,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman } /* - * Factures impayées + * Factures clients impayées */ if ($conf->facture->enabled && $user->rights->facture->lire) { @@ -506,25 +604,24 @@ if ($conf->facture->enabled && $user->rights->facture->lire) $resql = $db->query($sql); if ($resql) { + $var=true; $num = $db->num_rows($resql); $i = 0; + print ''; + print ''; + if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + print ''; + print ''; + print ''; + print ''; if ($num) { - print '
'.$langs->trans("BillsCustomersUnpayed",min($conf->liste_limit,$num)).' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Received").' 
'; - print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; - print ''; - print ''; - print ''; - print ''; - $var = True; $total_ttc = $totalam = $total = 0; while ($i < $num && $i < $conf->liste_limit) { $obj = $db->fetch_object($resql); - $var=!$var; print ''; print ''; if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; @@ -553,8 +650,14 @@ if ($conf->facture->enabled && $user->rights->facture->lire) print ''; print ''; print ''; - print '
'.$langs->trans("BillsCustomersUnpayed",min($conf->liste_limit,$num)).' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Received").' 
'; $facturestatic->ref=$obj->facnumber; @@ -543,9 +640,9 @@ if ($conf->facture->enabled && $user->rights->facture->lire) $total_ttc += $obj->total_ttc; $total += $obj->total; $totalam += $obj->am; + $var=!$var; $i++; } - $var=!$var; print '
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToTake").': '.price($total_ttc-$totalam).') '.price($total).''.price($totalam).' 

'; } + else + { + $colspan=5; + if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; + print ''.$langs->trans("NoInvoice").''; + } + print '
'; $db->free($resql); } else @@ -564,79 +667,82 @@ if ($conf->facture->enabled && $user->rights->facture->lire) } /* - * Factures a payer + * Factures fournisseurs impayées */ if ($conf->facture->enabled && $user->rights->facture->lire) { $facstatic=new FactureFournisseur($db); - if ($user->societe_id == 0) + $sql = "SELECT ff.rowid, ff.facnumber, ff.fk_statut, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc,"; + $sql.= " sum(pf.amount) as am,"; + $sql.= " s.nom, s.rowid as socid"; + if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; + $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; + $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; + if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; + $sql.= " WHERE s.rowid = ff.fk_soc"; + $sql.= " AND ff.paye=0 AND ff.fk_statut = 1"; + if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; + if ($socid) $sql .= " AND f.fk_soc = ".$socid; + $sql.= " GROUP BY ff.rowid, ff.facnumber, ff.fk_statut, ff.total, ff.total_ttc, s.nom, s.rowid"; + + $resql=$db->query($sql); + if ($resql) { - $sql = "SELECT ff.rowid, ff.facnumber, ff.fk_statut, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc,"; - $sql.= " sum(pf.amount) as am,"; - $sql.= " s.nom, s.rowid as socid"; - if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user "; - $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff"; - $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn"; - if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; - $sql.= " WHERE s.rowid = ff.fk_soc"; - $sql.= " AND ff.paye=0 AND ff.fk_statut = 1"; - if (!$user->rights->commercial->client->voir && !$socid) $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; - $sql.= " GROUP BY ff.rowid, ff.facnumber, ff.fk_statut, ff.total, ff.total_ttc, s.nom, s.rowid"; + $var=false; + $num = $db->num_rows($resql); - $resql=$db->query($sql); - if ($resql) + print ''; + print ''; + if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + print ''; + print ''; + print ''; + print "\n"; + if ($num) { - $num = $db->num_rows($resql); - if ($num) + $i = 0; + $total = $total_ttc = $totalam = 0; + while ($i < $num) { - print '
'.$langs->trans("BillsSuppliersUnpayed").' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Payed").' 
'; - print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; - print ''; - print ''; - print ''; - print "\n"; - $i = 0; - $var = True; - $total = $total_ttc = $totalam = 0; - while ($i < $num) - { - $obj = $db->fetch_object($resql); - $var = !$var; - print ''; - print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; - print ''; - print ''; - print ''; - print ''; - $total += $obj->total_ht; - $total_ttc += $obj->total_ttc; - $totalam += $obj->am; - $i++; - } - $var=!$var; - - print ''; - if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; - print ''; - print ''; - print ''; + $obj = $db->fetch_object($resql); + print ''; + print ''; + if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''; + print ''; + print ''; + print ''; print ''; - print '
'.$langs->trans("BillsSuppliersUnpayed").' ('.$num.')'.$langs->trans("AmountHT").''.$langs->trans("AmountTTC").''.$langs->trans("Payed").' 
'; - $facstatic->ref=$obj->facnumber; - $facstatic->id=$obj->rowid; - print $facstatic->getNomUrl(1,''); - print ''.img_object($langs->trans("ShowSupplier"),"company").' '.dolibarr_trunc($obj->nom,44).''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).''.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'
'.$langs->trans("Total").'   ('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).') '.price($total).''.price($total_ttc).''.price($totalam).' 
'; + $facstatic->ref=$obj->facnumber; + $facstatic->id=$obj->rowid; + print $facstatic->getNomUrl(1,''); + print ''.img_object($langs->trans("ShowSupplier"),"company").' '.dolibarr_trunc($obj->nom,44).''.price($obj->total_ht).''.price($obj->total_ttc).''.price($obj->am).''.$facstatic->LibStatut($obj->paye,$obj->fk_statut,3).'

'; + $total += $obj->total_ht; + $total_ttc += $obj->total_ttc; + $totalam += $obj->am; + $i++; + $var = !$var; } + + print ''.$langs->trans("Total").'   ('.$langs->trans("RemainderToPay").': '.price($total_ttc-$totalam).') '; + if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) print ''.price($total).''; + print ''.price($total_ttc).''; + print ''.price($totalam).''; + print ' '; + print ''; } else { - dolibarr_print_error($db); + $colspan=5; + if ($conf->global->MAIN_SHOW_HT_ON_SUMMARY) $colspan++; + print ''.$langs->trans("NoInvoice").''; } + print '
'; + } + else + { + dolibarr_print_error($db); } - } diff --git a/htdocs/fourn/facture/index.php b/htdocs/fourn/facture/index.php index be1c96f1714..dc65ee92ea5 100644 --- a/htdocs/fourn/facture/index.php +++ b/htdocs/fourn/facture/index.php @@ -111,9 +111,9 @@ if ($_GET["filtre"]) } } -if ($_GET["search_ref"]) +if ($_REQUEST["search_ref"]) { - $sql .= " AND fac.facnumber like '%".addslashes($_GET["search_ref"])."%'"; + $sql .= " AND fac.facnumber like '%".addslashes($_REQUEST["search_ref"])."%'"; } if ($_GET["search_libelle"]) @@ -167,7 +167,7 @@ if ($resql) print ''; print ''; - print ''; + print ''; print ' '; print ''; print ''; diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 3f039f2eb31..f529da2db63 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -66,7 +66,8 @@ ClassifyClosed=Classify 'Closed' CreateBill=Create Invoice AddBill=Add invoice or credit note DeleteBill=Delete invoice -SearchABill=Search an invoice +SearchACustomerInvoice=Search a customer invoice +SearchASupplierInvoice=Search a supplier invoice CancelBill=Cancel an invoice SendByMail=EMail SendRemindByMail=EMail reminder @@ -121,6 +122,8 @@ LastSuppliersBills=Last %s suppliers invoices AllBills=All invoices OtherBills=Other invoices DraftBills=Draft invoices +CustomersDraftInvoices=Customers draft invoices +SuppliersDraftInvoices=Suppliers draft invoices Unpayed=Unpayed ConfirmDeleteBill=Are you sure you want to delete this invoice ? ConfirmValidateBill=Are you sure you want to validate this invoice with reference %s ? diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index d9bad2284f9..02b66f06023 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -278,6 +278,7 @@ Unknown=Unknown General=General Size=Size Received=Received +Payed=Payed Topic=Sujet ByCompanies=By companies ByUsers=By users diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index cca0561be94..8ae635e16e2 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -66,7 +66,8 @@ ClassifyClosed=Classer 'Ferm CreateBill=Créer Facture AddBill=Créer facture ou avoir DeleteBill=Supprimer facture -SearchABill=Rechercher une facture +SearchACustomerInvoice=Rechercher une facture client +SearchASupplierInvoice=Rechercher une facture fournisseur CancelBill=Annuler une facture SendByMail=Envoyer SendRemindByMail=Envoyer rappel @@ -121,6 +122,8 @@ LastSuppliersBills=Les %s derni AllBills=Toutes les factures OtherBills=Autres factures DraftBills=Factures brouillons +CustomersDraftInvoices=Factures clients brouillons +SuppliersDraftInvoices=Factures fournisseurs brouillons Unpayed=Impayées ConfirmDeleteBill=Êtes-vous sûr de vouloir supprimer cette facture ? ConfirmValidateBill=Êtes-vous sûr de vouloir valider cette facture sous la référence %s ? diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index be7b02f5834..85badc9b6ca 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -279,6 +279,7 @@ Unknown=Inconnu General=Général Size=Taille Received=Reçu +Payed=Payé Topic=Sujet ByCompanies=Par société ByUsers=Par utilisateur diff --git a/htdocs/lib/company.lib.php b/htdocs/lib/company.lib.php index 9aa96e3be58..ffe8a0e8319 100644 --- a/htdocs/lib/company.lib.php +++ b/htdocs/lib/company.lib.php @@ -33,14 +33,24 @@ function societe_prepare_head($objsoc) { - global $langs, $conf, $user; - $h = 0; - $head = array(); + global $langs, $conf, $user; + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$objsoc->id; + $head[$h][1] = $langs->trans("Company"); + $head[$h][2] = 'company'; + $h++; + + //affichage onglet catégorie + if ($conf->categorie->enabled) + { + $head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$objsoc->id; + $head[$h][1] = $langs->trans('Categories'); + $head[$h][2] = 'category'; + $h++; + } - $head[$h][0] = DOL_URL_ROOT.'/soc.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans("Company"); - $head[$h][2] = 'company'; - $h++; if ($objsoc->client==1) { @@ -64,15 +74,6 @@ function societe_prepare_head($objsoc) $h++; } - //affichage onglet catégorie - if ($conf->categorie->enabled) - { - $head[$h][0] = DOL_URL_ROOT.'/categories/categorie.php?socid='.$objsoc->id; - $head[$h][1] = $langs->trans('Categories'); - $head[$h][2] = 'category'; - $h++; - } - if ($conf->facture->enabled || $conf->compta->enabled || $conf->comptaexpert->enabled) { $langs->load("compta");