diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 66594f53c6b..08405a5e43a 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -245,7 +245,7 @@ if ($_GET["action"] == 'payed' && $user->rights->facture->paiement) if ($_POST["action"] == 'setremise' && $user->rights->facture->creer) { $fac = new Facture($db); - $fac->fetch($facid); + $fac->fetch($_GET["facid"]); $fac->set_remise($user, $_POST["remise"]); } @@ -839,7 +839,7 @@ else if ($fac->mode_reglement == 3) { $head[$h][0] = DOL_URL_ROOT.'/compta/facture/prelevement.php?facid='.$fac->id; - $head[$h][1] = $langs->trans("Prélèvement"); + $head[$h][1] = $langs->trans("StandingOrder"); $h++; } @@ -859,7 +859,7 @@ else */ if ($_GET["action"] == 'delete') { - $html->form_confirm($_SERVER["PHP_SELF"]."?facid=$fac->id","Supprimer la facture","Etes-vous sûr de vouloir supprimer cette facture ?","confirm_delete"); + $html->form_confirm($_SERVER["PHP_SELF"]."?facid=$fac->id",$langs->trans("DeleteBill"),$langs->trans("ConfirmDeleteBill"),"confirm_delete"); } /* @@ -971,18 +971,30 @@ else print "".$langs->trans("Author")."$author->fullname"; - print 'Remise globale'; - print ''.$fac->remise_percent.''; - print '%'; + print ''.$langs->trans("GlobalDiscount").''; + if ($fac->brouillon == 1 && $user->rights->facture->creer) + { + print '
'; + print ''; + print '% '; + print ''; + print '
'; + } + else { + print ''.$fac->remise_percent.' %'; + + } + print ''; + print ''.$langs->trans("AmountHT").''; print ''.price($fac->total_ht).''; - print ''.$conf->monnaie.' HT'; + print ''.$conf->monnaie.''; print ''.$langs->trans("VAT").''.price($fac->total_tva).''; print ''.$conf->monnaie.''; print ''.$langs->trans("AmountTTC").''.price($fac->total_ttc).''; - print ''.$conf->monnaie.' TTC'; + print ''.$conf->monnaie.''; print ''.$langs->trans("Status").''.($fac->get_libstatut()).''; if ($fac->note) { @@ -994,22 +1006,16 @@ else print "
"; - if ($fac->brouillon == 1 && $user->rights->facture->creer) - { - print '
'; - print ''; - print '
Remise'; - print '%'; - print ''; - print '
'; - } - /* * Lignes de factures * */ - $sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.remise_percent, l.subprice, ".$db->pdate("l.date_start")." as date_start, ".$db->pdate("l.date_end")." as date_end "; - $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l WHERE l.fk_facture = $fac->id ORDER BY l.rowid"; + $sql = "SELECT l.fk_product, l.description, l.price, l.qty, l.rowid, l.tva_taux, l.remise_percent, l.subprice,"; + $sql .= $db->pdate("l.date_start")." as date_start, ".$db->pdate("l.date_end")." as date_end, "; + $sql .= " p.fk_product_type"; + $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l LEFT JOIN ".MAIN_DB_PREFIX."product p ON l.fk_product=p.rowid"; + $sql .= " WHERE l.fk_facture = ".$fac->id; + $sql .= " ORDER BY l.rowid"; $result = $db->query($sql); if ($result) @@ -1025,7 +1031,7 @@ else print ''.$langs->trans("VAT").''; print 'P.U. HT'; print ''.$langs->trans("Quantity").''; - print 'Remise'; + print ''.$langs->trans("Discount").''; print ''.$langs->trans("AmountHT").''; print '  '; print "\n"; @@ -1038,7 +1044,10 @@ else print ""; if ($objp->fk_product > 0) { - print ''.stripslashes(nl2br($objp->description)).''; + print ''; + if ($objp->fk_product_type) print img_object($langs->trans("ShowService"),"service"); + else print img_object($langs->trans("ShowProduct"),"product"); + print ' '.stripslashes(nl2br($objp->description)).''; if ($objp->date_start && $objp->date_end) { print " (Du ".dolibarr_print_date($objp->date_start)." au ".dolibarr_print_date($objp->date_end).")"; } if ($objp->date_start && ! $objp->date_end) { print " (A partir du ".dolibarr_print_date($objp->date_start).")"; } if (! $objp->date_start && $objp->date_end) { print " (Jusqu'au ".dolibarr_print_date($objp->date_end).")"; } @@ -1121,7 +1130,7 @@ else } else { - dolibarr_print_error($db->error()); + dolibarr_print_error($db); } /* diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php index ec786d93a1d..a3bed8036bc 100644 --- a/htdocs/compta/index.php +++ b/htdocs/compta/index.php @@ -116,7 +116,7 @@ if ($conf->facture->enabled) { print ''; print ''; - print ''; + print ''; $var = True; while ($i < $num && $i < 20) { diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 1ee3f59e087..b1f17998e32 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -21,7 +21,7 @@ * */ -/*! +/** \file htdocs/product/fiche.php \ingroup product \brief Page de la fiche produit @@ -177,7 +177,7 @@ if ($_POST["action"] == 'add_fourn' && $_POST["cancel"] <> $langs->trans("Cancel if ($product->add_fournisseur($user, $_POST["id_fourn"], $_POST["ref_fourn"]) > 0) { $action = ''; - $mesg = 'Founisseur ajouté'; + $mesg = $langs->trans("SupplierAdded"); } else { @@ -265,7 +265,7 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer) print ''; print ''; @@ -282,7 +282,7 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer) print ''; print ''; - if ($_GET["type"] == 0 && defined("MAIN_MODULE_STOCK")) + if ($_GET["type"] == 0 && $conf->stick->enabled) { print "".'"; - print "\n"; + print "\n"; print "\n"; print "\n"; print ''; @@ -755,8 +741,8 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente) $objp = $db->fetch_object( $i); $var=!$var; - print ""; - print "\n"; + print ""; + print "\n"; print "\n"; print "\n"; print ''; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index af18b130211..312fac2a8dc 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -89,14 +89,6 @@ if ($_GET["id"]) * En mode visu */ - // Zone recherche - print '
'; - print ''; - print ''; - print $langs->trans("Ref").':    '; - print $langs->trans("Label").':  '; - print '
'; - $h=0; $head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id; @@ -136,9 +128,8 @@ if ($_GET["id"]) print($mesg); print '
Factures brouillons ('.$num.')
'.$langs->trans("DraftBills").' ('.$num.')
'.$langs->trans("Ref").''; if ($_error == 1) { - print "Cette référence existe déjà"; + print $langs->trans("RefAlreadyExists"); } print '
'.$langs->trans("Label").'
Seuil stock'; print ''; @@ -332,14 +332,6 @@ else * En mode visu */ - // Zone recherche - print '
'; - print '
'; - print ''; - print $langs->trans("Ref").':    '; - print $langs->trans("Label").':  '; - print '
'; - $h=0; $head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id; @@ -623,28 +615,22 @@ print "\n
\n"; if ($_GET["action"] == '') { - if ($product->type == 0 && $user->rights->produit->commander && $num_fournisseur == 1) + if ($product->type == 0 && $user->rights->produit->commander && $num_fournisseur == 1) { - print ''.$langs->trans("Commander").''; + print ''.$langs->trans("Commander").''; } - - - - - if ( $user->rights->produit->creer) + if ( $user->rights->produit->creer) { - print ''.$langs->trans("UpdatePrice").''; + print ''.$langs->trans("UpdatePrice").''; } - - if ( $user->rights->produit->creer) + if ( $user->rights->produit->creer) { - print ''.$langs->trans("Edit").''; + print ''.$langs->trans("Edit").''; + } + if ($product->type == 0 && $conf->stock->enabled) + { + print 'Correction stock'; } -} - -if ($product->type == 0 && defined("MAIN_MODULE_STOCK")) -{ - print 'Correction stock'; } print "\n
\n"; @@ -683,7 +669,7 @@ if ($_GET["id"] && $_GET["action"] == '' && $product->envente) $objp = $db->fetch_object($i); $var=!$var; print "
propalid\">$objp->refpropalid\">$objp->refidp\">$objp->nom". strftime("%d %b",$objp->dp)."
factureid\">$objp->facnumber
factureid\">$objp->facnumberidp\">$objp->nom". strftime("%d %b",$objp->df)."
'; - print ""; - print ''; - print ''; + print ''; print ''; print ''; - print ''; + print ''; print ''; $sql = "SELECT s.nom, s.idp, pf.ref_fourn, pfp.price, pfp.quantity"; diff --git a/htdocs/product/index.php b/htdocs/product/index.php index 743d8295cc1..ad1c39bb3b1 100644 --- a/htdocs/product/index.php +++ b/htdocs/product/index.php @@ -53,19 +53,25 @@ if ($_POST["action"] == 'update') llxHeader("","",$langs->trans("ProductsAndServices")); -print '
'; -print ''; -print $langs->trans("Ref").':  '; -print '   '; -print $langs->trans("Label").':  '; -print '
'; - print_titre($langs->trans("ProductsAndServices")); print '
'.$langs->trans("Ref").''.$product->ref.''; + print '
'.$langs->trans("Ref").''.$product->ref.'
'.$langs->trans("Status").''; if ($product->envente) { print $langs->trans("OnSell"); @@ -163,7 +154,7 @@ if ($_GET["id"]) print $langs->trans("Suppliers").''.$langs->trans("Ref").''.$langs->trans("Qty").'Prix d\'achat'.$langs->trans("BuiingPrice").'
'; print '"; print "\n"; print ""; print ""; diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 9cbabf36741..6bcc75cda29 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -52,13 +52,8 @@ if ($page < 0) { $limit = $conf->liste_limit; $offset = $limit * $page ; -if ($sortfield == "") { - $sortfield="p.ref"; } - -if ($sortorder == "") -{ - $sortorder="DESC"; -} +if (! $sortfield) $sortfield="p.ref"; +if (! $sortorder) $sortorder="DESC"; if ($_POST["button_removefilter"] == $langs->trans("RemoveFilter")) { $sref=""; @@ -73,7 +68,7 @@ if ($_POST["button_removefilter"] == $langs->trans("RemoveFilter")) { $title=$langs->trans("ProductsAndServices"); -$sql = "SELECT p.rowid, p.label, p.price, p.ref"; +$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type"; $sql .= " FROM ".MAIN_DB_PREFIX."product as p"; if ($_GET["fourn_id"] > 0) @@ -89,11 +84,11 @@ if ($_POST["mode"] == 'search') } else { - if (strlen($type) == 0) + $sql .= " WHERE 1=1"; + if (isset($_GET["type"]) || isset($_POST["type"])) { - $type = 0; + $sql .= " AND p.fk_product_type = ".(isset($_GET["type"])?$_GET["type"]:$_POST["type"]); } - $sql .= " WHERE p.fk_product_type = ".$type; if ($sref) { $sql .= " AND p.ref like '%".$sref."%'"; @@ -123,34 +118,41 @@ $result = $db->query($sql) ; if ($result) { - $num = $db->num_rows(); - - $i = 0; + $num = $db->num_rows(); + + $i = 0; - if ($num == 1 && (isset($_POST["sall"]) or $snom or $sref)) + if ($num == 1 && (isset($_POST["sall"]) or $snom or $sref)) { - $objp = $db->fetch_object($i); - Header("Location: fiche.php?id=$objp->rowid"); + $objp = $db->fetch_object($i); + Header("Location: fiche.php?id=$objp->rowid"); } - - if (isset($envente) && $envente == 0) - { - if (isset($_POST["type"]) || isset($_GET["type"])) { - if ($type) { $texte = $langs->trans("ServicesNotOnSell"); } - else { $texte = $langs->trans("ProductsNotOnSell"); } - } else { - $texte = $langs->trans("ProductsAndServicesNotOnSell"); - } + + if (isset($_GET["envente"]) || isset($_POST["envente"])) { + $envente = (isset($_GET["envente"])?$_GET["envente"]:$_POST["envente"]); } - else + else { + $envente=1; + } + + if (! $envente) { - $envente=1; - if (isset($_POST["type"]) || isset($_GET["type"])) { - if ($type) { $texte = $langs->trans("ServicesOnSell"); } - else { $texte = $langs->trans("ProductsOnSell"); } - } else { - $texte = $langs->trans("ProductsAndServicesOnSell"); - } + if (isset($_GET["type"]) || isset($_POST["type"])) { + $type=isset($_GET["type"])?$_GET["type"]:$_POST["type"]; + if ($type) { $texte = $langs->trans("ServicesNotOnSell"); } + else { $texte = $langs->trans("ProductsNotOnSell"); } + } else { + $texte = $langs->trans("ProductsAndServicesNotOnSell"); + } + } + else + { + if (isset($_POST["type"]) || isset($_GET["type"])) { + if ($type) { $texte = $langs->trans("ServicesOnSell"); } + else { $texte = $langs->trans("ProductsOnSell"); } + } else { + $texte = $langs->trans("ProductsAndServicesOnSell"); + } } llxHeader("","",$texte); @@ -200,8 +202,9 @@ if ($result) $var=!$var; print "\n"; print "\n"; print ''; diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php index de4262ee007..0cde9ae3be2 100644 --- a/htdocs/product/popuprop.php +++ b/htdocs/product/popuprop.php @@ -24,7 +24,7 @@ /** \file htdocs/product/popuprop.php \ingroup propal, produit - \brief Liste des produits par popularité + \brief Liste des produits/services par popularité \version $Revision$ */ @@ -63,7 +63,7 @@ if ( $db->query($sql) ) $afficher_pagesuivante = -1; } -print_barre_liste("Liste des produits par popularité", $page, "popuprop.php","","","","",$afficher_pagesuivante); +print_barre_liste("Liste des produits et services par popularité", $page, "popuprop.php","","","","",$afficher_pagesuivante); print '
'; +/* + * Zone recherche produit/service + */ +print '
'; +print ''; +print ""; +print ''; +print "'; +print "'; +print "
'.$langs->trans("Search").'
"; +print $langs->trans("Ref").' :
"; +print $langs->trans("Label").':

"; + /* * Nombre de produits et/ou services @@ -140,7 +146,8 @@ if ($result) $var=!$var; print "
rowid\">"; - print img_file(); + if ($objp->fk_product_type) print img_object($langs->trans("ShowService"),"service"); + else print img_object($langs->trans("ShowProduct"),"product"); print " rowid\">$objp->ref$objp->label".$typeprodser[$objp->fk_product_type]."
"; print "rowid\">"; - print img_file(); - print " "; + if ($objp->fk_product_type) print img_object($langs->trans("ShowService"),"service"); + else print img_object($langs->trans("ShowProduct"),"product"); + print " "; print "rowid\">$objp->ref$objp->label'.price($objp->price).'
'; @@ -73,8 +73,9 @@ print_liste_field_titre($langs->trans("Label"),"popuprop.php", "p.label","",""," print_liste_field_titre("Nb. de proposition","popuprop.php", "c","","",'align="right"',$sortfield); print "\n"; -$sql = "select p.rowid, p.label, p.ref, count(*) as c from ".MAIN_DB_PREFIX."propaldet as pd, ".MAIN_DB_PREFIX."product as p where p.rowid = pd.fk_product group by (p.rowid)"; - +$sql = "SELECT p.rowid, p.label, p.ref, fk_product_type, count(*) as c"; +$sql .= " FROM ".MAIN_DB_PREFIX."propaldet as pd, ".MAIN_DB_PREFIX."product as p"; +$sql .= " WHERE p.rowid = pd.fk_product group by (p.rowid)"; $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit( $limit ,$offset); @@ -90,7 +91,11 @@ if ( $db->query($sql) ) $objp = $db->fetch_object( $i); $var=!$var; print ""; - print "\n"; + print "\n"; print "\n"; print ''; print "\n"; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 24fc0cd5b48..86ac1f3f3a1 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1,6 +1,6 @@ - * Copyright (C) 20004 Laurent Destailleur + * Copyright (C) 2004-2005 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 @@ -21,7 +21,7 @@ * */ -/*! +/** \file htdocs/product/price.php \ingroup product \brief Page de la fiche produit @@ -59,15 +59,6 @@ $product = new Product($db); $result = $product->fetch($_GET["id"]); -// Zone recherche -print '
'; -print '
'; -print ''; -print $langs->trans("Ref").':    '; -print $langs->trans("Label").':  '; -print '
'; - - $h=0; $head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id; diff --git a/htdocs/product/stats/fiche.php b/htdocs/product/stats/fiche.php index caf6d7c6c65..6bcfa6e3c7c 100644 --- a/htdocs/product/stats/fiche.php +++ b/htdocs/product/stats/fiche.php @@ -109,15 +109,7 @@ if ($_GET["id"]) $mesg = $langs->trans("ChartGenerated"); } - // Zone recherche - print '
'; - print '
'; - print ''; - print $langs->trans("Ref").':    '; - print $langs->trans("Label").':  '; - print '
'; - - + $h=0; $head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id; @@ -133,7 +125,7 @@ if ($_GET["id"]) if ($conf->stock->enabled) { $head[$h][0] = DOL_URL_ROOT."/product/stock/product.php?id=".$product->id; - $head[$h][1] = 'Stock'; + $head[$h][1] = $langs->trans('Stock'); $h++; } @@ -154,9 +146,10 @@ if ($_GET["id"]) print '
rowid\">$objp->refrowid\">"; + if ($objp->fk_product_type) print img_object($langs->trans("ShowService"),"service"); + else print img_object($langs->trans("ShowProduct"),"product"); + print " "; + print "rowid\">$objp->ref$objp->label'.$objp->c.'
'; - print ''; + print ''; + print ''; print ''; - print ""; + print ''; print '
'.$langs->trans("Ref").''.$product->ref.''.$langs->trans("Ref").''.$product->ref.''.$langs->trans("Statistics").'
".$langs->trans("Label")."$product->libelle
'.$langs->trans("Label").''.$product->libelle.''; // Propals if ($conf->propal->enabled) { diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index 2e9d605bb19..659e4827bd3 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -102,16 +102,6 @@ if ($_GET["id"]) if ( $product->fetch($_GET["id"])) { - - // Zone recherche - print '
'; - print '
'; - print ''; - print $langs->trans("Ref").':    '; - print $langs->trans("Label").':  '; - print '
'; - - $h=0; $head[$h][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id; @@ -145,7 +135,7 @@ if ($_GET["id"]) print ''; print ""; - print ''; + print ''; print '
'.$langs->trans("Ref").''.$product->ref.''.$langs->trans("Ref").''.$product->ref.''; if ($product->envente) { @@ -194,9 +184,9 @@ if ($_GET["id"]) * */ print '
'; - print ''; + print ''; $sql = "SELECT e.rowid, e.label, ps.reel FROM ".MAIN_DB_PREFIX."entrepot as e, ".MAIN_DB_PREFIX."product_stock as ps"; - $sql .= " WHERE ps.fk_entrepot = e.rowid AND ps.fk_product = $product->id"; + $sql .= " WHERE ps.fk_entrepot = e.rowid AND ps.fk_product = ".$product->id; $sql .= " ORDER BY lower(e.label)"; if ($db->query($sql)) @@ -227,9 +217,10 @@ if ($_GET["id"]) print "id\" method=\"post\">\n"; print ''; print '
EntrepôtValeur du stock
'.$langs->trans("Warehouse").'Valeur du stock
'; - print '
Entrepôt'.$langs->trans("Warehouse").''; print ''; - print ''; - print '
Source'.$langs->trans("Source").'Destination'.$langs->trans("Target").''; print ''; - print '
Entrepôt'.$langs->trans("Warehouse").'