diff --git a/dev/initdata/generate-commande.php b/dev/initdata/generate-commande.php index 5e28ded927f..7be61d05284 100644 --- a/dev/initdata/generate-commande.php +++ b/dev/initdata/generate-commande.php @@ -78,7 +78,7 @@ else { print "err"; } $prodids = array(); -$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE envente=1"; +$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1"; $resql = $db->query($sql); if ($resql) { diff --git a/dev/initdata/generate-facture.php b/dev/initdata/generate-facture.php index 271518fda8a..518658f3107 100644 --- a/dev/initdata/generate-facture.php +++ b/dev/initdata/generate-facture.php @@ -71,7 +71,7 @@ if ($resql) } $prodids = array(); -$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE envente=1"; +$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1"; $resql = $db->query($sql); if ($resql) { diff --git a/dev/initdata/generate-propale.php b/dev/initdata/generate-propale.php index 1923f9dda33..16bd4d7d9a8 100644 --- a/dev/initdata/generate-propale.php +++ b/dev/initdata/generate-propale.php @@ -89,7 +89,7 @@ if ($resql) } $prodids = array(); -$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE envente=1"; +$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."product WHERE tosell=1"; $resql = $db->query($sql); if ($resql) { diff --git a/dev/initdata/initdemo.sql b/dev/initdata/initdemo.sql index d170872b536..b91d12dde55 100644 --- a/dev/initdata/initdemo.sql +++ b/dev/initdata/initdemo.sql @@ -915,7 +915,7 @@ CREATE TABLE `llx_c_field_list` ( LOCK TABLES `llx_c_field_list` WRITE; /*!40000 ALTER TABLE `llx_c_field_list` DISABLE KEYS */; -INSERT INTO `llx_c_field_list` VALUES (1,'2010-07-21 23:19:49','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2010-07-21 23:19:49','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2010-07-21 23:19:49','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'$conf->barcode->enabled',3),(4,'2010-07-21 23:19:49','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2010-07-21 23:19:49','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2010-07-21 23:19:49','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2010-07-21 23:19:49','product_default',1,'p.stock','stock','Stock','right',0,0,'$conf->stock->enabled',7),(8,'2010-07-21 23:19:49','product_default',1,'p.envente','status','Status','right',1,0,'1',8); +INSERT INTO `llx_c_field_list` VALUES (1,'2010-07-21 23:19:49','product_default',1,'p.ref','ref','Ref','left',1,1,'1',1),(2,'2010-07-21 23:19:49','product_default',1,'p.label','label','Label','left',1,1,'1',2),(3,'2010-07-21 23:19:49','product_default',1,'p.barcode','barcode','BarCode','center',1,1,'$conf->barcode->enabled',3),(4,'2010-07-21 23:19:49','product_default',1,'p.tms','datem','DateModification','center',1,0,'1',4),(5,'2010-07-21 23:19:49','product_default',1,'p.price','price','SellingPriceHT','right',1,0,'1',5),(6,'2010-07-21 23:19:49','product_default',1,'p.price_ttc','price_ttc','SellingPriceTTC','right',1,0,'1',6),(7,'2010-07-21 23:19:49','product_default',1,'p.stock','stock','Stock','right',0,0,'$conf->stock->enabled',7),(8,'2010-07-21 23:19:49','product_default',1,'p.tosell','status','Status','right',1,0,'1',8); /*!40000 ALTER TABLE `llx_c_field_list` ENABLE KEYS */; UNLOCK TABLES; @@ -3840,7 +3840,7 @@ CREATE TABLE `llx_product` ( `localtax1_tx` double(6,3) DEFAULT '0.000', `localtax2_tx` double(6,3) DEFAULT '0.000', `fk_user_author` int(11) DEFAULT NULL, - `envente` tinyint(4) DEFAULT '1', + `tosell` tinyint(4) DEFAULT '1', `fk_product_type` int(11) DEFAULT '0', `duration` varchar(6) DEFAULT NULL, `seuil_stock_alerte` int(11) DEFAULT '0', @@ -4082,7 +4082,7 @@ CREATE TABLE `llx_product_price` ( `localtax1_tx` double(6,3) DEFAULT '0.000', `localtax2_tx` double(6,3) DEFAULT '0.000', `fk_user_author` int(11) DEFAULT NULL, - `envente` tinyint(4) DEFAULT '1', + `tosell` tinyint(4) DEFAULT '1', PRIMARY KEY (`rowid`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/htdocs/cashdesk/facturation.php b/htdocs/cashdesk/facturation.php index 1d20e4462d1..d6a90ecf1c3 100644 --- a/htdocs/cashdesk/facturation.php +++ b/htdocs/cashdesk/facturation.php @@ -34,7 +34,7 @@ if ( $_GET['filtre'] ) { if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; - $sql.= " WHERE p.envente = 1"; + $sql.= " WHERE p.tosell = 1"; $sql.= " AND p.fk_product_type = 0"; $sql.= " AND (p.ref LIKE '%".$_GET['filtre']."%' OR p.label LIKE '%".$_GET['filtre']."%')"; $sql.= " ORDER BY label"; @@ -67,7 +67,7 @@ if ( $_GET['filtre'] ) { if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; - $sql.= " WHERE p.envente = 1"; + $sql.= " WHERE p.tosell = 1"; $sql.= " AND p.fk_product_type = 0"; $sql.= " ORDER BY p.label"; diff --git a/htdocs/cashdesk/facturation_dhtml.php b/htdocs/cashdesk/facturation_dhtml.php index 4655bb71cdd..9a1dcf2c3a4 100644 --- a/htdocs/cashdesk/facturation_dhtml.php +++ b/htdocs/cashdesk/facturation_dhtml.php @@ -48,7 +48,7 @@ if ( strlen ($_GET["code"]) >= 0 ) // If search criteria is on char length at le if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= ", ps.reel"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; if ($conf->stock->enabled && !empty($conf_fkentrepot)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps ON p.rowid = ps.fk_product AND ps.fk_entrepot = '".$conf_fkentrepot."'"; - $sql.= " WHERE p.envente = 1"; + $sql.= " WHERE p.tosell = 1"; $sql.= " AND p.fk_product_type = 0"; // Add criteria on ref/label if (! empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE)) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 1fcc1d02d63..024ff6b5f21 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -1981,7 +1981,7 @@ class Propal extends CommonObject $prodids = array(); $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; - $sql.= " WHERE envente = 1"; + $sql.= " WHERE tosell = 1"; $sql.= " AND entity = ".$conf->entity; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 7d2bfbe7495..ff8d4076150 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -2288,7 +2288,7 @@ class Commande extends CommonObject $prodids = array(); $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; - $sql.= " WHERE envente = 1"; + $sql.= " WHERE tosell = 1"; $sql.= " AND entity = ".$conf->entity; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 725ba42bec5..3e3457a2020 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2779,7 +2779,7 @@ class Facture extends CommonObject $prodids = array(); $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; - $sql.= " WHERE envente = 1"; + $sql.= " WHERE tosell = 1"; $sql.= " AND entity = ".$conf->entity; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 222b404e34c..614a14a1300 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -1366,7 +1366,7 @@ class Contrat extends CommonObject $prodids = array(); $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; - $sql.= " WHERE envente = 1"; + $sql.= " WHERE tosell = 1"; $sql.= " AND entity = ".$conf->entity; $resql = $this->db->query($sql); if ($resql) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 30a437b1238..d3800aceb76 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -907,11 +907,11 @@ class Form elseif($finished == 1) { $sql.= " AND p.finished = ".$finished; - if ($status >= 0) $sql.= " AND p.envente = ".$status; + if ($status >= 0) $sql.= " AND p.tosell = ".$status; } elseif($status >= 0) { - $sql.= " AND p.envente = ".$status; + $sql.= " AND p.tosell = ".$status; } if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype; // Add criteria on ref/label @@ -1113,7 +1113,7 @@ class Form $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pf.fk_soc = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pf.rowid = pfp.fk_product_fournisseur"; $sql.= " WHERE p.entity = ".$conf->entity; - $sql.= " AND p.envente = 1"; + $sql.= " AND p.tosell = 1"; if ($socid) $sql.= " AND pf.fk_soc = ".$socid; if (strval($filtertype) != '') $sql.=" AND p.fk_product_type=".$filtertype; if (! empty($filtre)) $sql.=" ".$filtre; @@ -1226,7 +1226,7 @@ class Form $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur as pf ON p.rowid = pf.fk_product"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = pf.fk_soc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON pf.rowid = pfp.fk_product_fournisseur"; - $sql.= " WHERE p.envente = 1"; + $sql.= " WHERE p.tosell = 1"; $sql.= " AND s.fournisseur = 1"; $sql.= " AND p.rowid = ".$productid; $sql.= " ORDER BY s.nom, pf.ref_fourn DESC"; diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index d14e164034a..bc62ac16599 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -901,7 +901,7 @@ class Expedition extends CommonObject $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; - $sql.= " WHERE envente = 1"; + $sql.= " WHERE tosell = 1"; $sql.= " AND entity = ".$conf->entity; $resql = $this->db->query($sql); diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index c99493abf72..8de12d235b4 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -732,7 +732,7 @@ class Fichinter extends CommonObject $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; $sql.= " AND entity = ".$conf->entity; - $sql.= " WHERE envente = 1"; + $sql.= " WHERE tosell = 1"; $resql = $this->db->query($sql); if ($resql) { diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index f904a63c0ac..1b04e9679f2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1445,7 +1445,7 @@ class CommandeFournisseur extends Commande $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; - $sql.= " WHERE envente = 1"; + $sql.= " WHERE tosell = 1"; $sql.= " AND entity = ".$conf->entity; $resql = $this->db->query($sql); diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index c0b5eb91dee..a089175fcdf 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1003,7 +1003,7 @@ class FactureFournisseur extends Facture $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; - $sql.= " WHERE envente = 1"; + $sql.= " WHERE tosell = 1"; $sql.= " AND entity = ".$conf->entity; $resql = $this->db->query($sql); diff --git a/htdocs/fourn/product/liste.php b/htdocs/fourn/product/liste.php index 274d595a67d..024bd03b7a2 100644 --- a/htdocs/fourn/product/liste.php +++ b/htdocs/fourn/product/liste.php @@ -161,7 +161,7 @@ if ($resql) llxHeader("","",$texte); - $param="&envente=$envente&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""); + $param="&tosell=$tosell&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""); print_barre_liste($texte, $page, "liste.php", $param, $sortfield, $sortorder,'',$num); diff --git a/htdocs/includes/boxes/box_produits.php b/htdocs/includes/boxes/box_produits.php index 1df6150f8f2..56b9503a333 100644 --- a/htdocs/includes/boxes/box_produits.php +++ b/htdocs/includes/boxes/box_produits.php @@ -71,7 +71,7 @@ class box_produits extends ModeleBoxes { if ($user->rights->produit->lire || $user->rights->service->lire) { - $sql = "SELECT p.rowid, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.envente"; + $sql = "SELECT p.rowid, p.label, p.price, p.price_base_type, p.price_ttc, p.fk_product_type, p.tms, p.tosell"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " WHERE p.entity = ".$conf->entity; if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)'; @@ -136,7 +136,7 @@ class box_produits extends ModeleBoxes { 'text' => dol_print_date($datem,'day')); $this->info_box_contents[$i][5] = array('td' => 'align="right" width="18"', - 'text' => $productstatic->LibStatut($objp->envente,3)); + 'text' => $productstatic->LibStatut($objp->tosell,3)); $i++; } diff --git a/htdocs/includes/modules/modProduct.class.php b/htdocs/includes/modules/modProduct.class.php index b2462890130..b5c3146cb64 100644 --- a/htdocs/includes/modules/modProduct.class.php +++ b/htdocs/includes/modules/modProduct.class.php @@ -140,13 +140,13 @@ class modProduct extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]="Products"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("produit","export")); - $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.envente'=>"OnSell",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); + $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.length'=>"Length",'p.surface'=>"Surface",'p.volume'=>"Volume",'p.weight'=>"Weight",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge ($this->export_fields_array[$r],array('p.stock'=>'Stock','p.pmp'=>'PMPValue')); if (! empty($conf->barcode->enabled)) $this->export_fields_array[$r]=array_merge ($this->export_fields_array[$r],array('p.barcode'=>'Barcode')); - $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.accountancy_code_sell'=>'product','p.accountancy_code_sell'=>'product','p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.envente'=>"product",'p.datec'=>"product",'p.tms'=>"product"); + $this->export_entities_array[$r]=array('p.rowid'=>"product",'p.ref'=>"product",'p.label'=>"product",'p.description'=>"product",'p.accountancy_code_sell'=>'product','p.accountancy_code_sell'=>'product','p.note'=>"product",'p.length'=>"product",'p.surface'=>"product",'p.volume'=>"product",'p.weight'=>"product",'p.price_base_type'=>"product",'p.price'=>"product",'p.price_ttc'=>"product",'p.tva_tx'=>"product",'p.tosell'=>"product",'p.datec'=>"product",'p.tms'=>"product"); if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge ($this->export_entities_array[$r],array('p.stock'=>'product','p.pmp'=>'product')); if (! empty($conf->barcode->enabled)) $this->export_entities_array[$r]=array_merge ($this->export_entities_array[$r],array('p.barcode'=>'product')); - $this->export_alias_array[$r]=array('p.rowid'=>"id",'p.ref'=>"ref",'p.label'=>"label",'p.description'=>"description",'p.accountancy_code_sell'=>'accountancy_code_sell','p.accountancy_code_buy'=>'accountancy_code_buy','p.note'=>"note",'p.length'=>"length",'p.surface'=>"area",'p.volume'=>"volume",'p.weight'=>"weight",'p.price_base_type'=>'pricebase','p.price'=>"priceht",'p.price_ttc'=>"pricettc",'p.tva_tx'=>'vat','p.envente'=>"onsell",'p.datec'=>'datecreation','p.tms'=>'datemodification'); + $this->export_alias_array[$r]=array('p.rowid'=>"id",'p.ref'=>"ref",'p.label'=>"label",'p.description'=>"description",'p.accountancy_code_sell'=>'accountancy_code_sell','p.accountancy_code_buy'=>'accountancy_code_buy','p.note'=>"note",'p.length'=>"length",'p.surface'=>"area",'p.volume'=>"volume",'p.weight'=>"weight",'p.price_base_type'=>'pricebase','p.price'=>"priceht",'p.price_ttc'=>"pricettc",'p.tva_tx'=>'vat','p.tosell'=>"onsell",'p.datec'=>'datecreation','p.tms'=>'datemodification'); if (! empty($conf->stock->enabled)) $this->export_alias_array[$r]=array_merge ($this->export_alias_array[$r],array('p.stock'=>'stock','p.pmp'=>'pmp')); if (! empty($conf->barcode->enabled)) $this->export_alias_array[$r]=array_merge ($this->export_alias_array[$r],array('p.barcode'=>'barcode')); @@ -165,10 +165,10 @@ class modProduct extends DolibarrModules $this->import_icon[$r]='product'; $this->import_tables_array[$r]=array('p'=>MAIN_DB_PREFIX.'product'); $this->import_tables_creator_array[$r]=array('p'=>'fk_user_author'); // Fields to store import user id - $this->import_fields_array[$r]=array('p.ref'=>"Ref*",'p.label'=>"Label*",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.envente'=>"OnSell*",'p.fk_product_type'=>"Type*",'p.finished'=>'Nature','p.duration'=>"Duration",'p.weight'=>"Weight",'p.volume'=>"Volume",'p.datec'=>'DateCreation*'); + $this->import_fields_array[$r]=array('p.ref'=>"Ref*",'p.label'=>"Label*",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"SellingPriceHT",'p.price_ttc'=>"SellingPriceTTC",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell*",'p.fk_product_type'=>"Type*",'p.finished'=>'Nature','p.duration'=>"Duration",'p.weight'=>"Weight",'p.volume'=>"Volume",'p.datec'=>'DateCreation*'); $this->import_entities_array[$r]=array(); // We define here only fields that use another picto - $this->import_regex_array[$r]=array('p.ref'=>'[^ ]','p.envente'=>'^[0|1]','p.fk_product_type'=>'^[0|1]','p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); - $this->import_examplevalues_array[$r]=array('p.ref'=>"PR123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.envente'=>"0 or 1",'p.fk_product_type'=>"0 for product, 1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31'); + $this->import_regex_array[$r]=array('p.ref'=>'[^ ]','p.tosell'=>'^[0|1]','p.fk_product_type'=>'^[0|1]','p.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$'); + $this->import_examplevalues_array[$r]=array('p.ref'=>"PR123456",'p.label'=>"My product",'p.description'=>"This is a description example for record",'p.note'=>"Some note",'p.price'=>"100",'p.price_ttc'=>"110",'p.tva_tx'=>'10','p.tosell'=>"0 or 1",'p.fk_product_type'=>"0 for product, 1 for service",'p.finished'=>'','p.duration'=>"1y",'p.datec'=>'2008-12-31'); } diff --git a/htdocs/includes/modules/modService.class.php b/htdocs/includes/modules/modService.class.php index 31c3f81b42e..373764a7abe 100644 --- a/htdocs/includes/modules/modService.class.php +++ b/htdocs/includes/modules/modService.class.php @@ -132,11 +132,11 @@ class modService extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]="Services"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("service","export")); - $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.envente'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); + $this->export_fields_array[$r]=array('p.rowid'=>"Id",'p.ref'=>"Ref",'p.label'=>"Label",'p.description'=>"Description",'p.accountancy_code_sell'=>"ProductAccountancySellCode",'p.accountancy_code_buy'=>"ProductAccountancyBuyCode",'p.note'=>"Note",'p.price_base_type'=>"PriceBase",'p.price'=>"UnitPriceHT",'p.price_ttc'=>"UnitPriceTTC",'p.tva_tx'=>'VATRate','p.tosell'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification'); if (! empty($conf->stock->enabled)) $this->export_fields_array[$r]=array_merge ($this->export_fields_array[$r],array('p.stock'=>'Stock')); - $this->export_entities_array[$r]=array('p.rowid'=>"service",'p.ref'=>"service",'p.label'=>"service",'p.description'=>"service",'p.accountancy_code_sell'=>'service','p.accountancy_code_sell'=>'service','p.note'=>"service",'p.price_base_type'=>"service",'p.price'=>"service",'p.price_ttc'=>"service",'p.tva_tx'=>"service",'p.envente'=>"service",'p.duration'=>"service",'p.datec'=>"service",'p.tms'=>"service"); + $this->export_entities_array[$r]=array('p.rowid'=>"service",'p.ref'=>"service",'p.label'=>"service",'p.description'=>"service",'p.accountancy_code_sell'=>'service','p.accountancy_code_sell'=>'service','p.note'=>"service",'p.price_base_type'=>"service",'p.price'=>"service",'p.price_ttc'=>"service",'p.tva_tx'=>"service",'p.tosell'=>"service",'p.duration'=>"service",'p.datec'=>"service",'p.tms'=>"service"); if (! empty($conf->stock->enabled)) $this->export_entities_array[$r]=array_merge ($this->export_entities_array[$r],array('p.stock'=>'product')); - $this->export_alias_array[$r]=array('p.rowid'=>"id",'p.ref'=>"ref",'p.label'=>"label",'p.description'=>"description",'p.accountancy_code_sell'=>'accountancy_code_sell','p.accountancy_code_buy'=>'accountancy_code_buy','p.note'=>"note",'p.price_base_type'=>'pricebase','p.price'=>"priceht",'p.price_ttc'=>"pricettc",'p.tva_tx'=>'vat','p.envente'=>"onsell",'p.duration'=>"duration",'p.datec'=>'datecreation','p.tms'=>'datemodification'); + $this->export_alias_array[$r]=array('p.rowid'=>"id",'p.ref'=>"ref",'p.label'=>"label",'p.description'=>"description",'p.accountancy_code_sell'=>'accountancy_code_sell','p.accountancy_code_buy'=>'accountancy_code_buy','p.note'=>"note",'p.price_base_type'=>'pricebase','p.price'=>"priceht",'p.price_ttc'=>"pricettc",'p.tva_tx'=>'vat','p.tosell'=>"onsell",'p.duration'=>"duration",'p.datec'=>'datecreation','p.tms'=>'datemodification'); if (! empty($conf->stock->enabled)) $this->export_alias_array[$r]=array_merge ($this->export_alias_array[$r],array('p.stock'=>'stock')); $this->export_sql_start[$r]='SELECT DISTINCT '; diff --git a/htdocs/includes/modules/modStock.class.php b/htdocs/includes/modules/modStock.class.php index 1ba8c92d442..3a1d46b7281 100644 --- a/htdocs/includes/modules/modStock.class.php +++ b/htdocs/includes/modules/modStock.class.php @@ -126,9 +126,9 @@ class modStock extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]="WarehousesAndProducts"; // Translation key (used only if key ExportDataset_xxx_z not found) $this->export_permission[$r]=array(array("stock","lire")); - $this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.label'=>'LabelWareHouse','e.label'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.cp'=>'Zip','e.ville'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.envente'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','ps.reel'=>'Stock'); - $this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.label'=>'warehouse','e.label'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.cp'=>'warehouse','e.ville'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.envente'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','ps.reel'=>'stock'); - $this->export_alias_array[$r]=array('e.rowid'=>'idwarehouse','e.label'=>'labelwarehouse','e.label'=>'descwarehouse','e.lieu'=>'lieuwarehouse','e.address'=>'addresswarehouse','e.cp'=>'zipwarehouse','e.ville'=>'townwarehouse','p.rowid'=>"id",'p.ref'=>"ref",'p.fk_product_type'=>"type",'p.label'=>"label",'p.description'=>"description",'p.note'=>"note",'p.price'=>"price",'p.tva_tx'=>'vat','p.envente'=>"onsell",'p.duration'=>"duration",'p.datec'=>'datecreation','p.tms'=>'datemodification','ps.reel'=>'quantity'); + $this->export_fields_array[$r]=array('e.rowid'=>'IdWarehouse','e.label'=>'LabelWareHouse','e.label'=>'DescWareHouse','e.lieu'=>'LieuWareHouse','e.address'=>'Address','e.cp'=>'Zip','e.ville'=>'Town','p.rowid'=>"ProductId",'p.ref'=>"Ref",'p.fk_product_type'=>"Type",'p.label'=>"Label",'p.description'=>"Description",'p.note'=>"Note",'p.price'=>"Price",'p.tva_tx'=>'VAT','p.tosell'=>"OnSell",'p.duration'=>"Duration",'p.datec'=>'DateCreation','p.tms'=>'DateModification','ps.reel'=>'Stock'); + $this->export_entities_array[$r]=array('e.rowid'=>'warehouse','e.label'=>'warehouse','e.label'=>'warehouse','e.lieu'=>'warehouse','e.address'=>'warehouse','e.cp'=>'warehouse','e.ville'=>'warehouse','p.rowid'=>"product",'p.ref'=>"product",'p.fk_product_type'=>"product",'p.label'=>"product",'p.description'=>"product",'p.note'=>"product",'p.price'=>"product",'p.tva_tx'=>'product','p.tosell'=>"product",'p.duration'=>"product",'p.datec'=>'product','p.tms'=>'product','ps.reel'=>'stock'); + $this->export_alias_array[$r]=array('e.rowid'=>'idwarehouse','e.label'=>'labelwarehouse','e.label'=>'descwarehouse','e.lieu'=>'lieuwarehouse','e.address'=>'addresswarehouse','e.cp'=>'zipwarehouse','e.ville'=>'townwarehouse','p.rowid'=>"id",'p.ref'=>"ref",'p.fk_product_type'=>"type",'p.label'=>"label",'p.description'=>"description",'p.note'=>"note",'p.price'=>"price",'p.tva_tx'=>'vat','p.tosell'=>"onsell",'p.duration'=>"duration",'p.datec'=>'datecreation','p.tms'=>'datemodification','ps.reel'=>'quantity'); $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p, '.MAIN_DB_PREFIX.'product_stock as ps, '.MAIN_DB_PREFIX.'entrepot as e'; diff --git a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql index 63bf6a752a1..279511ccb24 100644 --- a/htdocs/install/mysql/migration/2.9.0-3.0.0.sql +++ b/htdocs/install/mysql/migration/2.9.0-3.0.0.sql @@ -11,5 +11,7 @@ alter table llx_product add column recuperableonly integer NOT NULL DEFAUL alter table llx_product_price add column recuperableonly integer NOT NULL DEFAULT '0' after tva_tx; -alter table llx_product add column tobuy tinyint DEFAULT 1 after envente; + +alter table llx_product change column envente tosell tinyint DEFAULT 1; +alter table llx_product add column tobuy tinyint DEFAULT 1 after tosell; \ No newline at end of file diff --git a/htdocs/install/mysql/tables/llx_product.sql b/htdocs/install/mysql/tables/llx_product.sql index 9562dc9f968..ba1adc9f2c4 100644 --- a/htdocs/install/mysql/tables/llx_product.sql +++ b/htdocs/install/mysql/tables/llx_product.sql @@ -43,7 +43,7 @@ create table llx_product localtax1_tx double(6,3) DEFAULT 0, -- Spanish local VAT 1 localtax2_tx double(6,3) DEFAULT 0, -- Spanish local VAT 2 fk_user_author integer, - envente tinyint DEFAULT 1, + tosell tinyint DEFAULT 1, tobuy tinyint DEFAULT 1, fk_product_type integer DEFAULT 0, -- Type 0 for regular product, 1 for service duration varchar(6), diff --git a/htdocs/install/mysql/tables/llx_product_price.sql b/htdocs/install/mysql/tables/llx_product_price.sql index 961ac477bb2..d20fdb84f34 100644 --- a/htdocs/install/mysql/tables/llx_product_price.sql +++ b/htdocs/install/mysql/tables/llx_product_price.sql @@ -36,6 +36,6 @@ create table llx_product_price localtax1_tx double(6,3) DEFAULT 0, localtax2_tx double(6,3) DEFAULT 0, fk_user_author integer, - envente tinyint DEFAULT 1 + tosell tinyint DEFAULT 1 )type=innodb; diff --git a/htdocs/livraison/class/livraison.class.php b/htdocs/livraison/class/livraison.class.php index cd4235c7680..3020f2cc3e5 100644 --- a/htdocs/livraison/class/livraison.class.php +++ b/htdocs/livraison/class/livraison.class.php @@ -779,7 +779,7 @@ class Livraison extends CommonObject $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; - $sql.= " WHERE envente = 1"; + $sql.= " WHERE tosell = 1"; $sql.= " AND entity = ".$conf->entity; $resql = $this->db->query($sql); diff --git a/htdocs/product/canvas/default/product.default.class.php b/htdocs/product/canvas/default/product.default.class.php index 0ef72c94caa..ec28fff6cd6 100644 --- a/htdocs/product/canvas/default/product.default.class.php +++ b/htdocs/product/canvas/default/product.default.class.php @@ -224,9 +224,9 @@ class ProductDefault extends Product } } - if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0) + if (isset($_GET["tosell"]) && strlen($_GET["tosell"]) > 0) { - $sql.= " AND p.envente = ".addslashes($_GET["envente"]); + $sql.= " AND p.tosell = ".addslashes($_GET["tosell"]); } if (isset($_GET["canvas"]) && strlen($_GET["canvas"]) > 0) { diff --git a/htdocs/product/canvas/default/tpl/list.tpl.php b/htdocs/product/canvas/default/tpl/list.tpl.php index aaf30bd1e43..a6bbd200776 100644 --- a/htdocs/product/canvas/default/tpl/list.tpl.php +++ b/htdocs/product/canvas/default/tpl/list.tpl.php @@ -50,10 +50,10 @@ if ($field['enabled']) { if ($field['sort']) { ?>
- ?sortfield=&sortorder=desc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
+ ?sortfield=&sortorder=desc&begin=&tosell=&canvas=default&fourn_id=&snom=&sref=">
- ?sortfield=&sortorder=desc&begin=&envente=&canvas=default&fourn_id=&snom=&sref=">
+ ?sortfield=&sortorder=desc&begin=&tosell=&canvas=default&fourn_id=&snom=&sref=">
| '.$langs->trans("Statistics").' if ($conf->product->enabled) { $statProducts = " | |||
| '.$langs->trans("ProductsNotOnSell").' | '.round($prodser[0][0]).' | '; + $statProducts.= ''.$langs->trans("ProductsNotOnSell").' | '.round($prodser[0][0]).' | '; $statProducts.= "
| '.$langs->trans("ProductsOnSell").' | '.round($prodser[0][1]).' | '; + $statProducts.= ''.$langs->trans("ProductsOnSell").' | '.round($prodser[0][1]).' | '; $statProducts.= "
| '.$langs->trans("ServicesNotOnSell").' | '.round($prodser[1][0]).' | '; + $statServices.= ''.$langs->trans("ServicesNotOnSell").' | '.round($prodser[1][0]).' | '; $statServices.= "
| '.$langs->trans("ServicesOnSell").' | '.round($prodser[1][1]).' | '; + $statServices.= ''.$langs->trans("ServicesOnSell").' | '.round($prodser[1][1]).' | '; $statServices.= "'; * Derniers produits/services en vente */ $max=15; -$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.envente,"; +$sql = "SELECT p.rowid, p.label, p.price, p.ref, p.fk_product_type, p.tosell,"; $sql.= " p.tms as datem"; $sql.= " FROM ".MAIN_DB_PREFIX."product as p"; $sql.= " WHERE p.entity = ".$conf->entity; @@ -229,7 +229,7 @@ if ($result) print dol_print_date($db->jdate($objp->datem),'day'); print " | "; print ''; - print $product_static->LibStatut($objp->envente,5); + print $product_static->LibStatut($objp->tosell,5); print " | "; print "\n"; $i++; diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index bcd22a5fe11..2b96e5aa62c 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -123,7 +123,7 @@ else $sql = 'SELECT DISTINCT p.rowid, p.ref, p.label, p.barcode, p.price, p.price_ttc, p.price_base_type,'; $sql.= ' p.fk_product_type, p.tms as datem,'; -$sql.= ' p.duration, p.envente as statut, p.seuil_stock_alerte'; +$sql.= ' p.duration, p.tosell as statut, p.seuil_stock_alerte'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; // We'll need this table joined to the select in order to filter by categ if ($search_categ) $sql.= ", ".MAIN_DB_PREFIX."categorie_product as cp"; @@ -152,9 +152,9 @@ if (strlen($_GET["type"]) || strlen($_POST["type"])) if ($sref) $sql.= " AND p.ref like '%".$sref."%'"; if ($sbarcode) $sql.= " AND p.barcode like '%".$sbarcode."%'"; if ($snom) $sql.= " AND p.label like '%".addslashes($snom)."%'"; -if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0) +if (isset($_GET["tosell"]) && strlen($_GET["tosell"]) > 0) { - $sql.= " AND p.envente = ".addslashes($_GET["envente"]); + $sql.= " AND p.tosell = ".addslashes($_GET["tosell"]); } if (isset($_GET["canvas"]) && strlen($_GET["canvas"]) > 0) { @@ -190,9 +190,9 @@ if ($resql) exit; } - if (isset($_GET["envente"]) || isset($_POST["envente"])) + if (isset($_GET["tosell"]) || isset($_POST["tosell"])) { - $envente = (isset($_GET["envente"])?$_GET["envente"]:$_POST["envente"]); + $tosell = (isset($_GET["tosell"])?$_GET["tosell"]:$_POST["tosell"]); } $helpurl=''; @@ -213,7 +213,7 @@ if ($resql) print ''.$langs->trans("Stock").' | '; - print_liste_field_titre($langs->trans("Status"),"liste.php", "p.envente",$param,"",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),"liste.php", "p.tosell",$param,"",'align="right"',$sortfield,$sortorder); print "\n"; // Lignes des champs de filtre @@ -449,11 +449,11 @@ if ($resql) { if ($sref || $snom || $sall || $sbarcode || $_POST["search"]) { - print_barre_liste('', $page, "liste.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&envente=".$envente, $sortfield, $sortorder,'',$num); + print_barre_liste('', $page, "liste.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$tosell, $sortfield, $sortorder,'',$num); } else { - print_barre_liste('', $page, "liste.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":"")."&envente=".$envente, $sortfield, $sortorder,'',$num); + print_barre_liste('', $page, "liste.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":"")."&tosell=".$tosell, $sortfield, $sortorder,'',$num); } } diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index d41144491ec..f914ee3af0a 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -81,7 +81,7 @@ $htmlother=new FormOther($db); $title=$langs->trans("ProductsAndServices"); $sql = 'SELECT p.rowid, p.ref, p.label, p.price, p.fk_product_type, p.tms as datem,'; -$sql.= ' p.duration, p.envente as statut, p.seuil_stock_alerte,'; +$sql.= ' p.duration, p.tosell as statut, p.seuil_stock_alerte,'; $sql.= ' SUM(s.reel) as stock_physique'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product_stock as s,'; $sql.= ' '.MAIN_DB_PREFIX.'product as p'; @@ -124,9 +124,9 @@ if ($snom) { $sql.= " AND p.label like '%".addslashes($snom)."%'"; } -if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0) +if (isset($_GET["tosell"]) && strlen($_GET["tosell"]) > 0) { - $sql.= " AND p.envente = ".$_GET["envente"]; + $sql.= " AND p.tosell = ".$_GET["tosell"]; } if($catid) { @@ -159,9 +159,9 @@ if ($resql) exit; } - if (isset($_GET["envente"]) || isset($_POST["envente"])) + if (isset($_GET["tosell"]) || isset($_POST["tosell"])) { - $envente = (isset($_GET["envente"])?$_GET["envente"]:$_POST["envente"]); + $tosell = (isset($_GET["tosell"])?$_GET["tosell"]:$_POST["tosell"]); } @@ -183,7 +183,7 @@ if ($resql) if ($sref || $snom || $sall || $_POST["search"]) { - print_barre_liste($texte, $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&envente=".$_POST["envente"], $sortfield, $sortorder,'',$num); + print_barre_liste($texte, $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&tosell=".$_POST["tosell"], $sortfield, $sortorder,'',$num); } else { @@ -225,15 +225,15 @@ if ($resql) // Lignes des titres print "
| '; - print_liste_field_titre($langs->trans("Status"),"reassort.php", "p.envente","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),"reassort.php", "p.tosell","&tosell=$tosell&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder); print " | |||