diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 1fcf4bf8427..7b455234b39 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -768,7 +768,7 @@ class Commande extends CommonOrder $sql.= ", multicurrency_code"; $sql.= ", multicurrency_tx"; $sql.= ")"; - $sql.= " VALUES ('(PROV)',".$this->socid.", '".$this->db->idate($now)."', ".$user->id; + $sql.= " VALUES ('(PROV)', ".$this->socid.", '".$this->db->idate($now)."', ".$user->id; $sql.= ", ".($this->fk_project>0?$this->fk_project:"null"); $sql.= ", '".$this->db->idate($date)."'"; $sql.= ", ".($this->source>=0 && $this->source != '' ?$this->db->escape($this->source):'null'); diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index e85cb70a74d..acd6730dc35 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -750,7 +750,7 @@ if (empty($reshook)) } } } - if ($lineIdToAddLot) + if ($lineIdToAddLot) { // add lot to existing line if ($line->fetch($lineIdToAddLot) > 0) @@ -787,7 +787,7 @@ if (empty($reshook)) } } } - else + else { setEventMessages($lotStock->error, $lotStock->errors, 'errors'); $error++; @@ -2477,7 +2477,7 @@ else if ($id || $ref) } // Create bill - if (! empty($conf->facture->enabled) && $object->statut > 0) + if (! empty($conf->facture->enabled) && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED)) { if ($user->rights->facture->creer) { @@ -2489,18 +2489,18 @@ else if ($id || $ref) // This is just to generate a delivery receipt //var_dump($object->linkedObjectsIds['delivery']); - if ($conf->livraison_bon->enabled && ($object->statut == 1 || $object->statut == 2) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0) + if ($conf->livraison_bon->enabled && ($object->statut == Expedition::STATUS_VALIDATED || $object->statut == Expedition::STATUS_CLOSED) && $user->rights->expedition->livraison->creer && count($object->linkedObjectsIds['delivery']) == 0) { print ''.$langs->trans("CreateDeliveryOrder").''; } // Close - if (! empty($conf->facture->enabled) && $object->statut > 0) + if ($object->statut == Expedition::STATUS_VALIDATED) { if ($user->rights->expedition->creer && $object->statut > 0 && ! $object->billed) { $label="Close"; $paramaction='classifyclosed'; // = Transferred/Received // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on shipments instead of orders - if (! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // TODO Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close. + if (! empty($conf->facture->enabled) && ! empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? { $label="ClassifyBilled"; $paramaction='classifybilled'; diff --git a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql index 7a27fff3218..2112e457a39 100644 --- a/htdocs/install/mysql/migration/6.0.0-7.0.0.sql +++ b/htdocs/install/mysql/migration/6.0.0-7.0.0.sql @@ -68,6 +68,8 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer; -- For 7.0 +ALTER table llx_entrepot CHANGE COLUMN label ref varchar(255); + UPDATE llx_paiementfourn SET ref = rowid WHERE ref IS NULL; UPDATE llx_paiementfourn SET entity = 1 WHERE entity IS NULL; diff --git a/htdocs/install/mysql/tables/llx_entrepot.sql b/htdocs/install/mysql/tables/llx_entrepot.sql index d93eb6e1575..cfb17c55766 100644 --- a/htdocs/install/mysql/tables/llx_entrepot.sql +++ b/htdocs/install/mysql/tables/llx_entrepot.sql @@ -1,6 +1,6 @@ -- ============================================================================ -- Copyright (C) 2003-2006 Rodolphe Quiedeville --- Copyright (C) 2004 Laurent Destailleur +-- Copyright (C) 2004-2017 Laurent Destailleur -- Copyright (C) 2012 Juanjo Menent -- -- This program is free software; you can redistribute it and/or modify @@ -21,9 +21,9 @@ create table llx_entrepot ( rowid integer AUTO_INCREMENT PRIMARY KEY, + ref varchar(255) NOT NULL, datec datetime, tms timestamp, - label varchar(255) NOT NULL, entity integer DEFAULT 1 NOT NULL, -- multi company id description text, lieu varchar(64), -- resume lieu situation diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 8aa3899f82c..88cb0efed30 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -329,6 +329,16 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''; + + /* Second column + print '
'; + print '
'; + print '
'; + print ''; + + print '
'; + print '
';*/ + print '
'; print ''; @@ -359,7 +369,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } /* - if ($user->rights->sellyoursaas->create) + if ($user->rights->mymodule->create) { if ($object->status == 1) { @@ -396,13 +406,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; // ancre // Documents - /*$comref = dol_sanitizeFileName($object->ref); + /*$objref = dol_sanitizeFileName($object->ref); $relativepath = $comref . '/' . $comref . '.pdf'; - $filedir = $conf->mymodule->dir_output . '/' . $comref; + $filedir = $conf->mymodule->dir_output . '/' . $objref; $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; $genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content $delallowed = $user->rights->mymodule->create; // If you can create/edit, you can remove a file on card - print $formfile->showdocuments('mymodule', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); + print $formfile->showdocuments('mymodule', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); */ // Show links to link elements @@ -426,13 +436,18 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; } - // Presend form - $modelmail='myobject'; - $defaulttopic='Information'; - $diroutput = $conf->mymodule->dir_output; - $trackid = 'myobject'.$object->id; - - include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; + //Select mail models is same action as presend + /* + if (GETPOST('modelselected')) $action = 'presend'; + + // Presend form + $modelmail='inventory'; + $defaulttopic='InformationMessage'; + $diroutput = $conf->product->dir_output.'/inventory'; + $trackid = 'stockinv'.$object->id; + + include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; + */ } diff --git a/htdocs/product/class/html.formproduct.class.php b/htdocs/product/class/html.formproduct.class.php index 68e80454b22..6ae31645a50 100644 --- a/htdocs/product/class/html.formproduct.class.php +++ b/htdocs/product/class/html.formproduct.class.php @@ -87,7 +87,7 @@ class FormProduct $warehouseStatus[] = Entrepot::STATUS_OPEN_INTERNAL; } - $sql = "SELECT e.rowid, e.label, e.description, e.fk_parent"; + $sql = "SELECT e.rowid, e.ref as label, e.description, e.fk_parent"; if (!empty($fk_product)) { if (!empty($batch)) @@ -125,8 +125,8 @@ class FormProduct if(!empty($exclude)) $sql.= ' AND e.rowid NOT IN('.$this->db->escape(implode(',', $exclude)).')'; - if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.label, e.description, e.fk_parent"; - $sql.= " ORDER BY e.label"; + if ($sumStock && empty($fk_product)) $sql.= " GROUP BY e.rowid, e.ref, e.description, e.fk_parent"; + $sql.= " ORDER BY e.ref"; dol_syslog(get_class($this).'::loadWarehouses', LOG_DEBUG); $resql = $this->db->query($sql); @@ -382,14 +382,14 @@ class FormProduct { $productIdArray = array($fk_product); // only show lot stock for product } - else + else { foreach($this->cache_lot as $key => $value) { $productIdArray[] = $key; } } - + foreach($productIdArray as $productId) { foreach($this->cache_lot[$productId] as $id => $arraytypes) @@ -433,21 +433,21 @@ class FormProduct if (count($productIdArray) && count($this->cache_lot)) { // check cache already loaded for product id's - foreach ($productIdArray as $productId) + foreach ($productIdArray as $productId) { $cacheLoaded = ! empty($this->cache_lot[$productId]) ? true : false; } } - if ($cacheLoaded) + if ($cacheLoaded) { return count($this->cache_lot); } - else + else { // clear cache $this->cache_lot = array(); $productIdList = implode(',', $productIdArray); - $sql = "SELECT pb.batch, pb.rowid, ps.fk_entrepot, pb.qty, e.label, ps.fk_product"; + $sql = "SELECT pb.batch, pb.rowid, ps.fk_entrepot, pb.qty, e.ref as label, ps.fk_product"; $sql.= " FROM ".MAIN_DB_PREFIX."product_batch as pb"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.rowid = pb.fk_product_stock"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on e.rowid = ps.fk_entrepot AND e.entity IN (".getEntity('stock').")"; @@ -455,8 +455,8 @@ class FormProduct { $sql.= " WHERE ps.fk_product IN (".$productIdList.")"; } - $sql.= " ORDER BY e.label, pb.batch"; - + $sql.= " ORDER BY e.ref, pb.batch"; + dol_syslog(get_class($this).'::loadLotStock', LOG_DEBUG); $resql = $this->db->query($sql); if ($resql) @@ -473,7 +473,7 @@ class FormProduct $this->cache_lot[$obj->fk_product][$obj->rowid]['qty'] = $obj->qty; $i++; } - + return $num; } else diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 4b5a74ed3dd..97fa5140fba 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -30,6 +30,7 @@ $langs->loadLangs(array("inventory","other")); // Get parameters $id = GETPOST('id', 'int'); +$ref = GETPOST('ref', 'alpha'); $action = GETPOST('action', 'alpha'); $cancel = GETPOST('cancel', 'aZ09'); $backtopage = GETPOST('backtopage', 'alpha'); @@ -53,12 +54,10 @@ foreach($object->fields as $key => $val) if (empty($action) && empty($id) && empty($ref)) $action='view'; -// Protection if external user -if ($user->societe_id > 0) -{ - //accessforbidden(); -} -//$result = restrictedArea($user, 'inventory', $id); +// Security check - Protection if external user +//if ($user->societe_id > 0) access_forbidden(); +//if ($user->societe_id > 0) $socid = $user->societe_id; +//$result = restrictedArea($user, 'mymodule', $id); // fetch optionals attributes and labels $extralabels = $extrafields->fetch_name_optionals_label($object->table_element); @@ -69,7 +68,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be inclu /* - * ACTIONS + * Actions */ $parameters=array(); @@ -86,13 +85,22 @@ if (empty($reshook)) // Actions cancel, add, update or delete include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php'; + + // Actions when printing a doc from card + include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php'; + + // Actions to send emails + /*$trigger_name='MYOBJECT_SENTBYMAIL'; + $autocopy='MAIN_MAIL_AUTOCOPY_MYOBJECT_TO'; + $trackid='myobject'.$object->id; + include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';*/ } /* - * VIEW + * View */ $form=new Form($db); @@ -128,39 +136,10 @@ if ($action == 'create') dol_fiche_head(array(), ''); print ''."\n"; - foreach($object->fields as $key => $val) - { - if (in_array($key, array('rowid', 'entity', 'date_creation', 'date_validation', 'tms', 'fk_user_creat', 'fk_user_modif', 'fk_user_valid', 'import_key'))) continue; - print ''; - print ''; - print $langs->trans($val['label']); - print ''; - print ''; - print ''; - } - + + // Common attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_add.tpl.php'; + // Other attributes include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_add.tpl.php'; @@ -171,20 +150,19 @@ if ($action == 'create') print '
'; print ''; print '  '; - print ''; // Cancel for create doe not post form + print ''; // Cancel for create does not post form if we don't know the backtopage print '
'; print ''; } - - // Part to edit record if (($id || $ref) && $action == 'edit') { print load_fiche_titre($langs->trans("Inventory")); print ''; + print ''; print ''; print ''; print ''; @@ -192,37 +170,10 @@ if (($id || $ref) && $action == 'edit') dol_fiche_head(); print '
'; - $defaultcss='minwidth100'; - if ($val['type'] == 'text') - { - print ''; - } - elseif (is_array($val['arrayofkeyval'])) - { - print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int')); - } - else - { - $cssforinput = empty($val['css'])?$defaultcss:$val['css']; - print ''; - } - print '
'."\n"; - foreach($object->fields as $key => $val) - { - if (in_array($key, array('rowid', 'entity', 'date_creation', 'tms', 'fk_user_creat', 'fk_user_modif', 'import_key'))) continue; - - print ''.$langs->trans($val['label']).''; - print ''; - print ''; - } - + + // Common attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_edit.tpl.php'; + // Other attributes include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_edit.tpl.php'; @@ -237,22 +188,19 @@ if (($id || $ref) && $action == 'edit') print ''; } - - - // Part to show record if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) { $res = $object->fetch_optionals($object->id, $extralabels); $head = inventory_prepare_head($object); - dol_fiche_head($head, 'order', $langs->trans("CustomerOrder"), -1, 'order'); + dol_fiche_head($head, 'inventory', $langs->trans("Inventory"), -1, 'inventory'); $formconfirm = ''; // Confirmation to delete if ($action == 'delete') { - $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteOrder'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1); + $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('DeleteInventory'), $langs->trans('ConfirmDeleteOrder'), 'confirm_delete', '', 0, 1); } // Confirmation of action xxxx @@ -280,13 +228,11 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $formconfirm; - // Object card // ------------------------------------------------------------ $linkback = '' . $langs->trans("BackToList") . ''; - $morehtmlref='
'; /* // Ref bis @@ -339,24 +285,25 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print '
'; print '
'; print '
'; - $defaultcss='minwidth100'; - if ($val['type'] == 'text') - { - print ''; - } - elseif (is_array($val['arrayofkeyval'])) - { - print $form->selectarray($key, $val['arrayofkeyval'], GETPOST($key, 'int')!=''?GETPOST($key, 'int'):$object->$key); - } - else - { - $cssforinput = empty($val['css'])?$defaultcss:$val['css']; - print ''; - } - print '
'."\n"; - // print ''; - // LIST_OF_TD_LABEL_FIELDS_VIEW - + // Common attributes + include DOL_DOCUMENT_ROOT . '/core/tpl/commonfields_view.tpl.php'; + // Other attributes include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php'; print '
'.$langs->trans("Label").''.$object->label.'
'; print ''; + + /* Second column print '
'; print '
'; print '
'; print ''; - - print '
'; - print '
'; + print '
';*/ + print ''; print ''; @@ -375,16 +322,24 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send - print ''."\n"; + print '' . $langs->trans('SendMail') . ''."\n"; if ($user->rights->inventory->write) { - print ''."\n"; + print ''.$langs->trans("Modify").''."\n"; } - + else + { + print ''.$langs->trans('Modify').''."\n"; + } + if ($user->rights->inventory->delete) { - print ''."\n"; + print ''.$langs->trans('Delete').''."\n"; + } + else + { + print ''.$langs->trans('Delete').''."\n"; } } print ''."\n"; @@ -400,27 +355,34 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea { print '
'; print ''; // ancre + // Documents - $comref = dol_sanitizeFileName($object->ref); - $relativepath = $comref . '/' . $comref . '.pdf'; - $filedir = $conf->product->dir_output . '/inventory/' . $comref; - $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; - $genallowed = $user->rights->inventory->read; - $delallowed = $user->rights->inventory->create; - print $formfile->showdocuments('inventory', $comref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); - + /*$objref = dol_sanitizeFileName($object->ref); + $relativepath = $comref . '/' . $comref . '.pdf'; + $filedir = $conf->mymodule->dir_output . '/' . $objref; + $urlsource = $_SERVER["PHP_SELF"] . "?id=" . $object->id; + $genallowed = $user->rights->mymodule->read; // If you can read, you can build the PDF to read content + $delallowed = $user->rights->mymodule->create; // If you can create/edit, you can remove a file on card + print $formfile->showdocuments('mymodule', $objref, $filedir, $urlsource, $genallowed, $delallowed, $object->modelpdf, 1, 0, 0, 28, 0, '', '', '', $soc->default_lang); + */ // Show links to link elements - $linktoelem = $form->showLinkToObjectBlock($object, null, array('order')); + $linktoelem = $form->showLinkToObjectBlock($object, null, array('inventory')); $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem); print '
'; + $MAXEVENT = 10; + + $morehtmlright = ''; + $morehtmlright.= $langs->trans("SeeAll"); + $morehtmlright.= ''; + // List of actions on element include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); - $somethingshown = $formactions->showactions($object, 'order', $socid, 1); + $somethingshown = $formactions->showactions($object, 'inventory', $socid, 1, '', $MAXEVENT, '', $morehtmlright); print '
'; } diff --git a/htdocs/product/inventory/class/inventory.class.php b/htdocs/product/inventory/class/inventory.class.php index 9b48c5164d4..a83602132e3 100644 --- a/htdocs/product/inventory/class/inventory.class.php +++ b/htdocs/product/inventory/class/inventory.class.php @@ -74,7 +74,7 @@ class Inventory extends CommonObject 'ref' => array('type'=>'varchar(64)', 'label'=>'Ref', 'visible'=>1, 'enabled'=>1, 'position'=>10, 'notnull'=>1, 'index'=>1, 'searchall'=>1, 'comment'=>'Reference of object',), 'entity' => array('type'=>'integer', 'label'=>'Entity', 'visible'=>0, 'enabled'=>1, 'position'=>20, 'notnull'=>1, 'index'=>1,), 'title' => array('type'=>'varchar(255)', 'label'=>'Label', 'visible'=>1, 'enabled'=>1, 'position'=>25, 'css'=>'minwidth300'), - 'fk_warehouse' => array('type'=>'integer', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'index'=>1,), + 'fk_warehouse' => array('type'=>'integer:Entrepot:product/stock/class/entrepot.class.php', 'label'=>'Warehouse', 'visible'=>1, 'enabled'=>1, 'index'=>1, 'help'=>'LinkToThirparty'), 'date_inventory' => array('type'=>'date', 'label'=>'DateValue', 'visible'=>1, 'enabled'=>1,), 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'index'=>1,), 'date_creation' => array('type'=>'datetime', 'label'=>'DateCreation', 'visible'=>-1, 'enabled'=>1, 'position'=>500,), diff --git a/htdocs/product/reassortlot.php b/htdocs/product/reassortlot.php index cf4e889e89e..be4ff835c01 100644 --- a/htdocs/product/reassortlot.php +++ b/htdocs/product/reassortlot.php @@ -114,7 +114,7 @@ $sql = 'SELECT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price $sql.= ' p.fk_product_type, p.tms as datem,'; $sql.= ' p.duration, p.tosell as statut, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.stock, p.tobatch,'; $sql.= ' ps.fk_entrepot,'; -$sql.= ' e.label as warehouse_ref, e.lieu as warehouse_lieu, e.fk_parent as warehouse_parent,'; +$sql.= ' e.ref as warehouse_ref, e.lieu as warehouse_lieu, e.fk_parent as warehouse_parent,'; $sql.= ' pb.batch, pb.eatby as oldeatby, pb.sellby as oldsellby,'; $sql.= ' pl.rowid as lotid, pl.eatby, pl.sellby,'; $sql.= ' SUM(pb.qty) as stock_physique, COUNT(pb.rowid) as nbinbatchtable'; @@ -150,13 +150,13 @@ if($catid) $sql.= " AND cp.fk_categorie = ".$catid; if ($fourn_id > 0) $sql.= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id; // Insert categ filter if ($search_categ) $sql .= " AND cp.fk_categorie = ".$db->escape($search_categ); -if ($search_warehouse) $sql .= natural_search("e.label", $search_warehouse); +if ($search_warehouse) $sql .= natural_search("e.ref", $search_warehouse); if ($search_batch) $sql .= natural_search("pb.batch", $search_batch); $sql.= " GROUP BY p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type, p.entity,"; $sql.= " p.fk_product_type, p.tms,"; $sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte, p.desiredstock, p.stock, p.tobatch,"; $sql.= " ps.fk_entrepot,"; -$sql.= " e.label, e.lieu, e.fk_parent,"; +$sql.= " e.ref, e.lieu, e.fk_parent,"; $sql.= " pb.batch, pb.eatby, pb.sellby,"; $sql.= " pl.rowid, pl.eatby, pl.sellby"; if ($toolowstock) $sql.= " HAVING SUM(".$db->ifsql('ps.reel IS NULL', '0', 'ps.reel').") < p.seuil_stock_alerte"; // Not used yet @@ -292,7 +292,7 @@ if ($resql) print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "p.ref",$param,"","",$sortfield,$sortorder); print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "p.label",$param,"","",$sortfield,$sortorder); if (! empty($conf->service->enabled) && $type == 1) print_liste_field_titre("Duration", $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder); - print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.label",$param,"",'',$sortfield,$sortorder); + print_liste_field_titre("Warehouse", $_SERVER["PHP_SELF"], "e.ref",$param,"",'',$sortfield,$sortorder); //print_liste_field_titre("DesiredStock", $_SERVER["PHP_SELF"], "p.desiredstock",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre("Batch", $_SERVER["PHP_SELF"], "pb.batch",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre("EatByDate", $_SERVER["PHP_SELF"], "pb.eatby",$param,"",'align="center"',$sortfield,$sortorder); diff --git a/htdocs/product/stock/card.php b/htdocs/product/stock/card.php index c95e805c3f5..97924d330ae 100644 --- a/htdocs/product/stock/card.php +++ b/htdocs/product/stock/card.php @@ -275,7 +275,7 @@ else { $head = stock_prepare_head($object); - dol_fiche_head($head, 'card', $langs->trans("Warehouse"), 0, 'stock'); + dol_fiche_head($head, 'card', $langs->trans("Warehouse"), -1, 'stock'); $formconfirm = ''; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index 9263fe4ba10..6ff271e062f 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -98,6 +98,8 @@ class Entrepot extends CommonObject { global $conf; + $error = 0; + $this->libelle = trim($this->libelle); // Si libelle non defini, erreur @@ -111,8 +113,8 @@ class Entrepot extends CommonObject $this->db->begin(); - $sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (entity, datec, fk_user_author, label, fk_parent)"; - $sql .= " VALUES (".$conf->entity.",'".$this->db->idate($now)."',".$user->id.",'".$this->db->escape($this->libelle)."', ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")"; + $sql = "INSERT INTO ".MAIN_DB_PREFIX."entrepot (ref, entity, datec, fk_user_author, fk_parent)"; + $sql .= " VALUES ('".$this->db->escape($this->libelle)."', ".$conf->entity.", '".$this->db->idate($now)."', ".$user->id.", ".($this->fk_parent > 0 ? $this->fk_parent : "NULL").")"; dol_syslog(get_class($this)."::create", LOG_DEBUG); $result=$this->db->query($sql); @@ -123,7 +125,16 @@ class Entrepot extends CommonObject { $this->id = $id; - if ($this->update($id, $user) > 0) + if (! $error) + { + $result = $this->update($id, $user); + if ($result <= 0) + { + $error++; + } + } + + if (! $error) { $this->db->commit(); return $id; @@ -185,7 +196,7 @@ class Entrepot extends CommonObject $this->country_id=($this->country_id > 0 ? $this->country_id : 0); $sql = "UPDATE ".MAIN_DB_PREFIX."entrepot "; - $sql .= " SET label = '" . $this->db->escape($this->libelle) ."'"; + $sql .= " SET ref = '" . $this->db->escape($this->libelle) ."'"; $sql .= ", fk_parent = " . (($this->fk_parent > 0) ? $this->fk_parent : "NULL"); $sql .= ", description = '" . $this->db->escape($this->description) ."'"; $sql .= ", statut = " . $this->statut; @@ -297,7 +308,7 @@ class Entrepot extends CommonObject { global $conf; - $sql = "SELECT rowid, fk_parent, label, description, statut, lieu, address, zip, town, fk_pays as country_id"; + $sql = "SELECT rowid, fk_parent, ref as label, description, statut, lieu, address, zip, town, fk_pays as country_id"; $sql .= " FROM ".MAIN_DB_PREFIX."entrepot"; if ($id) { @@ -306,7 +317,7 @@ class Entrepot extends CommonObject else { $sql.= " WHERE entity = " .$conf->entity; - if ($ref) $sql.= " AND label = '".$this->db->escape($ref)."'"; + if ($ref) $sql.= " AND ref = '".$this->db->escape($ref)."'"; } dol_syslog(get_class($this)."::fetch", LOG_DEBUG); @@ -319,8 +330,8 @@ class Entrepot extends CommonObject $this->id = $obj->rowid; $this->fk_parent = $obj->fk_parent; - $this->ref = $obj->rowid; - $this->label = $obj->label; + $this->ref = $obj->label; + $this->label = $obj->label; // deprecated $this->libelle = $obj->label; // deprecated $this->description = $obj->description; $this->statut = $obj->statut; @@ -409,7 +420,7 @@ class Entrepot extends CommonObject { $liste = array(); - $sql = "SELECT rowid, label"; + $sql = "SELECT rowid, ref as label"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot"; $sql.= " WHERE entity IN (".getEntity('stock').")"; $sql.= " AND statut = ".$status; @@ -574,7 +585,7 @@ class Entrepot extends CommonObject $label = ''; $label = '' . $langs->trans("ShowWarehouse").''; - $label.= '
' . $langs->trans('Ref') . ': ' . (empty($this->label)?$this->libelle:$this->label); + $label.= '
' . $langs->trans('Ref') . ': ' . (empty($this->ref)?(empty($this->label)?$this->libelle:$this->label):$this->ref); if (! empty($this->lieu)) $label.= '
' . $langs->trans('LocationSummary').': '.$this->lieu; diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 22a9e95410c..f2494592815 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -25,6 +25,7 @@ require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/product/stock/class/entrepot.class.php'; +require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; $langs->load("stocks"); $langs->load("productbatch"); @@ -37,6 +38,8 @@ $result=restrictedArea($user,'stock'); * View */ +$producttmp=new Product($db); + $help_url='EN:Module_Stocks_En|FR:Module_Stock|ES:Módulo_Stocks'; llxHeader("",$langs->trans("Stocks"),$help_url); @@ -61,7 +64,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele } -$sql = "SELECT e.label, e.rowid, e.statut"; +$sql = "SELECT e.ref as label, e.rowid, e.statut"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " WHERE e.statut in (0,1)"; $sql.= " AND e.entity IN (".getEntity('stock').")"; @@ -87,7 +90,7 @@ if ($result) while ($i < $num) { $objp = $db->fetch_object($result); - + print ''; print "rowid\">".img_object($langs->trans("ShowStock"),"stock")." ".$objp->label."\n"; print ''.$entrepot->LibStatut($objp->statut,5).''; @@ -111,8 +114,8 @@ print '
'; // Last movements $max=10; -$sql = "SELECT p.rowid, p.label as produit,"; -$sql.= " e.label as stock, e.rowid as entrepot_id,"; +$sql = "SELECT p.rowid, p.label as produit, p.tobatch, p.tosell, p.tobuy,"; +$sql.= " e.ref as stock, e.rowid as entrepot_id,"; $sql.= " m.value as qty, m.datem, m.batch, m.eatby, m.sellby"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= ", ".MAIN_DB_PREFIX."stock_mouvement as m"; @@ -144,17 +147,21 @@ if ($resql) print ''.$langs->trans("FullList").''; print "\n"; - $var=True; $i=0; while ($i < min($num,$max)) { $objp = $db->fetch_object($resql); - + print ''; print ''.dol_print_date($db->jdate($objp->datem),'dayhour').''; - print "rowid\">"; - print img_object($langs->trans("ShowProduct"),"product").' '.$objp->produit; - print "\n"; + print ""; + $producttmp->id = $objp->rowid; + $producttmp->ref = $objp->produit; + $producttmp->status_batch = $objp->tobatch; + $producttmp->status_sell = $objp->tosell; + $producttmp->status_buy = $objp->tobuy; + print $producttmp->getNomUrl(1); + print "\n"; if (! empty($conf->productbatch->enabled)) { print ''.$objp->batch.''; diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index d740a2a9d73..77991ab2909 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -40,7 +40,7 @@ $search_status=GETPOST("search_status","int"); $limit = GETPOST('limit')?GETPOST('limit','int'):$conf->liste_limit; $sortfield = GETPOST("sortfield"); $sortorder = GETPOST("sortorder"); -if (! $sortfield) $sortfield="e.label"; +if (! $sortfield) $sortfield="e.ref"; if (! $sortorder) $sortorder="ASC"; $page = GETPOST("page"); if ($page < 0) $page = 0; @@ -50,7 +50,7 @@ $year = strftime("%Y",time()); // List of fields to search into when doing a "search in all" $fieldstosearchall = array( - 'e.label'=>"Ref", + 'e.ref'=>"Ref", 'e.lieu'=>"LocationSummary", 'e.description'=>"Description", 'e.address'=>"Address", @@ -82,17 +82,17 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x', $form=new Form($db); $warehouse=new Entrepot($db); -$sql = "SELECT e.rowid, e.label as ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent,"; +$sql = "SELECT e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent,"; $sql.= " SUM(p.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue, SUM(ps.reel) as stockqty"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid"; $sql.= " WHERE e.entity IN (".getEntity('stock').")"; -if ($search_ref) $sql.= natural_search("e.label", $search_ref); // ref +if ($search_ref) $sql.= natural_search("e.ref", $search_ref); // ref if ($search_label) $sql.= natural_search("e.lieu", $search_label); // label if ($search_status != '' && $search_status >= 0) $sql.= " AND e.statut = ".$search_status; if ($sall) $sql .= natural_search(array_keys($fieldstosearchall), $sall); -$sql.= " GROUP BY e.rowid, e.label, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent"; +$sql.= " GROUP BY e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays, e.fk_parent"; $totalnboflines=0; $result=$db->query($sql); if ($result) @@ -125,10 +125,10 @@ if ($result) $param=''; if (! empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param.='&contextpage='.$contextpage; if ($limit > 0 && $limit != $conf->liste_limit) $param.='&limit='.$limit; - if ($search_ref) $param.="&search_ref=".$search_ref; - if ($search_label) $param.="&search_label=".$search_label; - if ($search_status) $param.="&search_status=".$search_status; - if ($sall) $param.="&sall=".$sall; + if ($search_ref) $param.="&search_ref=".urlencode($search_ref); + if ($search_label) $param.="&search_label=".urlencode($search_label); + if ($search_status) $param.="&search_status=".urlencode($search_status); + if ($sall) $param.="&sall=".urlencode($sall); print '
'; print ''; @@ -176,7 +176,7 @@ if ($result) print ''; print ''; - print_liste_field_titre("Ref",$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder); + print_liste_field_titre("Ref",$_SERVER["PHP_SELF"], "e.ref","",$param,"",$sortfield,$sortorder); print_liste_field_titre("LocationSummary",$_SERVER["PHP_SELF"], "e.lieu","",$param,"",$sortfield,$sortorder); print_liste_field_titre("PhysicalStock", $_SERVER["PHP_SELF"], "stockqty",'',$param,'align="right"',$sortfield,$sortorder); print_liste_field_titre("EstimatedStockValue", $_SERVER["PHP_SELF"], "estimatedvalue",'',$param,'align="right"',$sortfield,$sortorder); @@ -194,7 +194,8 @@ if ($result) $objp = $db->fetch_object($result); $warehouse->id = $objp->rowid; - $warehouse->label = $objp->ref; + $warehouse->ref = $objp->ref; + $warehouse->label = $objp->ref; $warehouse->lieu = $objp->lieu; $warehouse->fk_parent = $objp->fk_parent; diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php index a00a18222e6..f7e0cbd1bc8 100644 --- a/htdocs/product/stock/mouvement.php +++ b/htdocs/product/stock/mouvement.php @@ -95,7 +95,7 @@ $arrayfields=array( 'm.batch'=>array('label'=>$langs->trans("BatchNumberShort"), 'checked'=>1, 'enabled'=>(! empty($conf->productbatch->enabled))), 'pl.eatby'=>array('label'=>$langs->trans("EatByDate"), 'checked'=>0, 'enabled'=>(! empty($conf->productbatch->enabled))), 'pl.sellby'=>array('label'=>$langs->trans("SellByDate"), 'checked'=>0, 'position'=>10, 'enabled'=>(! empty($conf->productbatch->enabled))), - 'e.label'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(! $id > 0)), // If we are on specific warehouse, we hide it + 'e.ref'=>array('label'=>$langs->trans("Warehouse"), 'checked'=>1, 'enabled'=>(! $id > 0)), // If we are on specific warehouse, we hide it 'm.fk_user_author'=>array('label'=>$langs->trans("Author"), 'checked'=>0), 'm.inventorycode'=>array('label'=>$langs->trans("InventoryCodeShort"), 'checked'=>1), 'm.label'=>array('label'=>$langs->trans("LabelMovement"), 'checked'=>1), @@ -414,7 +414,7 @@ $formproduct=new FormProduct($db); if (!empty($conf->projet->enabled)) $formproject=new FormProjets($db); $sql = "SELECT p.rowid, p.ref as product_ref, p.label as produit, p.fk_product_type as type, p.entity,"; -$sql.= " e.label as stock, e.rowid as entrepot_id, e.lieu,"; +$sql.= " e.ref as stock, e.rowid as entrepot_id, e.lieu,"; $sql.= " m.rowid as mid, m.value as qty, m.datem, m.fk_user_author, m.label, m.inventorycode, m.fk_origin, m.origintype,"; $sql.= " m.batch,"; $sql.= " pl.rowid as lotid, pl.eatby, pl.sellby,"; @@ -529,7 +529,7 @@ if ($resql) { $head = stock_prepare_head($object); - dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), 0, 'stock'); + dol_fiche_head($head, 'movements', $langs->trans("Warehouse"), -1, 'stock'); $linkback = ''.$langs->trans("BackToList").''; @@ -783,7 +783,7 @@ if ($resql) print ''; } // Warehouse - if (! empty($arrayfields['e.label']['checked'])) + if (! empty($arrayfields['e.ref']['checked'])) { print ''; //print ''; @@ -879,7 +879,7 @@ if ($resql) if (! empty($arrayfields['m.batch']['checked'])) print_liste_field_titre($arrayfields['m.batch']['label'],$_SERVER["PHP_SELF"],'m.batch','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['pl.eatby']['checked'])) print_liste_field_titre($arrayfields['pl.eatby']['label'],$_SERVER["PHP_SELF"],'pl.eatby','',$param,'align="center"',$sortfield,$sortorder); if (! empty($arrayfields['pl.sellby']['checked'])) print_liste_field_titre($arrayfields['pl.sellby']['label'],$_SERVER["PHP_SELF"],'pl.sellby','',$param,'align="center"',$sortfield,$sortorder); - if (! empty($arrayfields['e.label']['checked'])) print_liste_field_titre($arrayfields['e.label']['label'],$_SERVER["PHP_SELF"], "e.label","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible + if (! empty($arrayfields['e.ref']['checked'])) print_liste_field_titre($arrayfields['e.ref']['label'],$_SERVER["PHP_SELF"], "e.ref","",$param,"",$sortfield,$sortorder); // We are on a specific warehouse card, no filter on other should be possible if (! empty($arrayfields['m.fk_user_author']['checked'])) print_liste_field_titre($arrayfields['m.fk_user_author']['label'],$_SERVER["PHP_SELF"], "m.fk_user_author","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['m.inventorycode']['checked'])) print_liste_field_titre($arrayfields['m.inventorycode']['label'],$_SERVER["PHP_SELF"], "m.inventorycode","",$param,"",$sortfield,$sortorder); if (! empty($arrayfields['m.label']['checked'])) print_liste_field_titre($arrayfields['m.label']['label'],$_SERVER["PHP_SELF"], "m.label","",$param,"",$sortfield,$sortorder); @@ -982,7 +982,7 @@ if ($resql) print ''. dol_print_date($objp->sellby,'day') .''; } // Warehouse - if (! empty($arrayfields['e.label']['checked'])) + if (! empty($arrayfields['e.ref']['checked'])) { print ''; print $warehousestatic->getNomUrl(1); diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php index faee4d05a6a..665940b8083 100644 --- a/htdocs/product/stock/product.php +++ b/htdocs/product/stock/product.php @@ -813,7 +813,7 @@ if ((! empty($conf->productbatch->enabled)) && $object->hasbatch()) print ''; } -$sql = "SELECT e.rowid, e.label, e.lieu, ps.reel, ps.rowid as product_stock_id, p.pmp"; +$sql = "SELECT e.rowid, e.ref as label, e.lieu, ps.reel, ps.rowid as product_stock_id, p.pmp"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e,"; $sql.= " ".MAIN_DB_PREFIX."product_stock as ps"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = ps.fk_product"; @@ -821,7 +821,7 @@ $sql.= " WHERE ps.reel != 0"; $sql.= " AND ps.fk_entrepot = e.rowid"; $sql.= " AND e.entity IN (".getEntity('stock').")"; $sql.= " AND ps.fk_product = ".$object->id; -$sql.= " ORDER BY e.label"; +$sql.= " ORDER BY e.ref"; $entrepotstatic=new Entrepot($db); $product_lot_static=new Productlot($db); diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index b959eebeb2d..c41577193ca 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -263,7 +263,7 @@ $formproduct = new FormProduct($db); $title = $langs->trans('Status'); -if(!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { +if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) { $sqldesiredtock=$db->ifsql("pse.desiredstock IS NULL", "p.desiredstock", "pse.desiredstock"); $sqlalertstock=$db->ifsql("pse.seuil_stock_alerte IS NULL", "p.seuil_stock_alerte", "pse.seuil_stock_alerte"); } else { @@ -427,9 +427,12 @@ print ''; print ''; print ''; print ''; -print '
'; -print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1); -print '
'; +if (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE)) +{ + print '
'; + print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1); + print '
'; +} print '
'; print $langs->trans('Supplier').' '.$form->select_company($fk_supplier, 'fk_supplier', 'fournisseur=1', 1); print '
'; diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index a1d68394bb0..7e6aca17f67 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -37,7 +37,7 @@ $sall=GETPOST('sall', 'alphanohtml'); $sortfield = GETPOST("sortfield"); $sortorder = GETPOST("sortorder"); -if (! $sortfield) $sortfield="e.label"; +if (! $sortfield) $sortfield="e.ref"; if (! $sortorder) $sortorder="ASC"; $page = $_GET["page"]; if ($page < 0) $page = 0; @@ -51,25 +51,22 @@ $year = strftime("%Y",time()); * View */ -$sql = "SELECT e.rowid, e.label as ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays,"; +$sql = "SELECT e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays,"; $sql.= " SUM(ps.pmp * ps.reel) as estimatedvalue, SUM(p.price * ps.reel) as sellvalue"; $sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON e.rowid = ps.fk_entrepot"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid"; $sql.= " WHERE e.entity IN (".getEntity('stock').")"; -if ($sref) -{ - $sql.= " AND e.label LIKE '%".$db->escape($sref)."%'"; -} +if ($sref) $sql.= natural_search("e.ref", $sref); if ($sall) { - $sql.= " AND (e.label LIKE '%".$db->escape($sall)."%'"; + $sql.= " AND (e.ref LIKE '%".$db->escape($sall)."%'"; $sql.= " OR e.description LIKE '%".$db->escape($sall)."%'"; $sql.= " OR e.lieu LIKE '%".$db->escape($sall)."%'"; $sql.= " OR e.address LIKE '%".$db->escape($sall)."%'"; $sql.= " OR e.town LIKE '%".$db->escape($sall)."%')"; } -$sql.= " GROUP BY e.rowid, e.label, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays"; +$sql.= " GROUP BY e.rowid, e.ref, e.statut, e.lieu, e.address, e.zip, e.town, e.fk_pays"; $sql.= $db->order($sortfield,$sortorder); $sql.= $db->plimit($limit + 1, $offset); @@ -87,7 +84,7 @@ if ($result) print ''; print ""; - print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "e.label","","","",$sortfield,$sortorder); + print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "e.ref","","","",$sortfield,$sortorder); print_liste_field_titre("LocationSummary", $_SERVER["PHP_SELF"], "e.lieu","","","",$sortfield,$sortorder); print_liste_field_titre("EstimatedStockValue", $_SERVER["PHP_SELF"], "e.valo_pmp",'','','align="right"',$sortfield,$sortorder); print_liste_field_titre("EstimatedStockValueSell", $_SERVER["PHP_SELF"], "",'','','align="right"',$sortfield,$sortorder);