Qual: Renamed french field "envente" into "tosell".

This commit is contained in:
Laurent Destailleur 2010-08-11 18:35:31 +00:00
parent d7f40000c6
commit 5affcd3b3f
34 changed files with 93 additions and 91 deletions

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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 */;

View File

@ -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";

View File

@ -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))

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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";

View File

@ -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);

View File

@ -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)
{

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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++;
}

View File

@ -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');
}

View File

@ -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 ';

View File

@ -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';

View File

@ -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;

View File

@ -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),

View File

@ -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;

View File

@ -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);

View File

@ -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)
{

View File

@ -50,10 +50,10 @@
if ($field['enabled']) {
if ($field['sort']) { ?>
<td class="liste_titre" align="<?php echo $field['align']; ?>"><?php echo $field['title']; ?>
<a href="<?php echo $_SERVER["PHP_SELF"];?>?sortfield=<?php echo $field['name']; ?>&amp;sortorder=asc&amp;begin=&amp;envente=&amp;canvas=default&amp;fourn_id=&amp;snom=&amp;sref=">
<a href="<?php echo $_SERVER["PHP_SELF"];?>?sortfield=<?php echo $field['name']; ?>&amp;sortorder=asc&amp;begin=&amp;tosell=&amp;canvas=default&amp;fourn_id=&amp;snom=&amp;sref=">
<img src="<?php echo DOL_URL_ROOT; ?>/theme/<?php echo $conf->theme; ?>/img/1downarrow.png" border="0" alt="A-Z" title="A-Z">
</a>
<a href="<?php echo $_SERVER["PHP_SELF"];?>?sortfield=<?php echo $field['name']; ?>&amp;sortorder=desc&amp;begin=&amp;envente=&amp;canvas=default&amp;fourn_id=&amp;snom=&amp;sref=">
<a href="<?php echo $_SERVER["PHP_SELF"];?>?sortfield=<?php echo $field['name']; ?>&amp;sortorder=desc&amp;begin=&amp;tosell=&amp;canvas=default&amp;fourn_id=&amp;snom=&amp;sref=">
<img src="<?php echo DOL_URL_ROOT; ?>/theme/<?php echo $conf->theme; ?>/img/1uparrow.png" border="0" alt="Z-A" title="Z-A">
</a>
</td>

View File

@ -141,7 +141,7 @@ class ProductService extends Product
$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";
@ -160,9 +160,9 @@ class ProductService extends Product
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)
{

View File

@ -50,10 +50,10 @@
if ($field['enabled']) {
if ($field['sort']) { ?>
<td class="liste_titre" align="<?php echo $field['align']; ?>"><?php echo $field['title']; ?>
<a href="<?php echo $_SERVER["PHP_SELF"];?>?sortfield=<?php echo $field['name']; ?>&amp;sortorder=asc&amp;begin=&amp;envente=&amp;canvas=default&amp;fourn_id=&amp;snom=&amp;sref=">
<a href="<?php echo $_SERVER["PHP_SELF"];?>?sortfield=<?php echo $field['name']; ?>&amp;sortorder=asc&amp;begin=&amp;tosell=&amp;canvas=default&amp;fourn_id=&amp;snom=&amp;sref=">
<img src="<?php echo DOL_URL_ROOT; ?>/theme/<?php echo $conf->theme; ?>/img/1downarrow.png" border="0" alt="A-Z" title="A-Z">
</a>
<a href="<?php echo $_SERVER["PHP_SELF"];?>?sortfield=<?php echo $field['name']; ?>&amp;sortorder=desc&amp;begin=&amp;envente=&amp;canvas=default&amp;fourn_id=&amp;snom=&amp;sref=">
<a href="<?php echo $_SERVER["PHP_SELF"];?>?sortfield=<?php echo $field['name']; ?>&amp;sortorder=desc&amp;begin=&amp;tosell=&amp;canvas=default&amp;fourn_id=&amp;snom=&amp;sref=">
<img src="<?php echo DOL_URL_ROOT; ?>/theme/<?php echo $conf->theme; ?>/img/1uparrow.png" border="0" alt="Z-A" title="Z-A">
</a>
</td>

View File

@ -445,7 +445,7 @@ class Product extends CommonObject
$sql.= ",localtax1_tx = " . $this->localtax1_tx;
$sql.= ",localtax2_tx = " . $this->localtax2_tx;
$sql.= ",envente = " . $this->status;
$sql.= ",tosell = " . $this->status;
$sql.= ",finished = " . ($this->finished<0 ? "null" : $this->finished);
$sql.= ",hidden = " . ($this->hidden<0 ? "null" : $this->hidden);
$sql.= ",weight = " . ($this->weight!='' ? "'".$this->weight."'" : 'null');
@ -704,7 +704,7 @@ class Product extends CommonObject
$now=dol_now();
// Add new price
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_price(price_level,date_price,fk_product,fk_user_author,price,price_ttc,price_base_type,envente,tva_tx,recuperableonly,";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."product_price(price_level,date_price,fk_product,fk_user_author,price,price_ttc,price_base_type,tosell,tva_tx,recuperableonly,";
$sql.= " localtax1_tx, localtax2_tx, price_min,price_min_ttc) ";
$sql.= " VALUES(".($level?$level:1).", ".$this->db->idate($now).",".$this->id.",".$user->id.",".$this->price.",".$this->price_ttc.",'".$this->price_base_type."',".$this->status.",".$this->tva_tx.",".$this->tva_npr.",";
$sql.= " ".$this->localtax1_tx.",".$this->localtax2_tx.",".$this->price_min.",".$this->price_min_ttc;
@ -967,7 +967,7 @@ class Product extends CommonObject
}
$sql = "SELECT rowid, ref, label, description, note, price, price_ttc,";
$sql.= " price_min, price_min_ttc, price_base_type, tva_tx, recuperableonly as tva_npr, localtax1_tx, localtax2_tx, envente,";
$sql.= " price_min, price_min_ttc, price_base_type, tva_tx, recuperableonly as tva_npr, localtax1_tx, localtax2_tx, tosell,";
$sql.= " fk_product_type, duration, seuil_stock_alerte, canvas,";
$sql.= " weight, weight_units, length, length_units, surface, surface_units, volume, volume_units, barcode, fk_barcode_type, finished, hidden,";
$sql.= " accountancy_code_buy, accountancy_code_sell, stock, pmp,";
@ -1000,7 +1000,7 @@ class Product extends CommonObject
$this->localtax2_tx = $result["localtax2_tx"];
$this->type = $result["fk_product_type"];
$this->status = $result["envente"];
$this->status = $result["tosell"];
$this->finished = $result["finished"];
$this->hidden = $result["hidden"];
$this->duration = $result["duration"];
@ -1067,7 +1067,7 @@ class Product extends CommonObject
for ($i=1; $i <= $conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++)
{
$sql = "SELECT price, price_ttc, price_min, price_min_ttc,";
$sql.= " price_base_type, tva_tx, envente";
$sql.= " price_base_type, tva_tx, tosell";
$sql.= " FROM ".MAIN_DB_PREFIX."product_price";
$sql.= " where price_level=".$i." and";
$sql.= " fk_product = '".$this->id."'";
@ -1876,8 +1876,8 @@ class Product extends CommonObject
// les prix
$sql = "INSERT ".MAIN_DB_PREFIX."product_price ("
. " fk_product, date_price, price, tva_tx, localtax1_tx, localtax2_tx, fk_user_author, envente )"
. " SELECT ".$toId . ", date_price, price, tva_tx, localtax1_tx, localtax2_tx, fk_user_author, envente "
. " fk_product, date_price, price, tva_tx, localtax1_tx, localtax2_tx, fk_user_author, tosell )"
. " SELECT ".$toId . ", date_price, price, tva_tx, localtax1_tx, localtax2_tx, fk_user_author, tosell "
. " FROM ".MAIN_DB_PREFIX."product_price "
. " WHERE fk_product = ". $fromId;

View File

@ -105,14 +105,14 @@ print "</table></form><br>";
$prodser = array();
$prodser[0][0]=$prodser[0][1]=$prodser[1][0]=$prodser[1][1]=0;
$sql = "SELECT COUNT(p.rowid) as total, p.fk_product_type, p.envente";
$sql = "SELECT COUNT(p.rowid) as total, p.fk_product_type, p.tosell";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE p.entity = ".$conf->entity;
$sql.= " GROUP BY p.fk_product_type, p.envente";
$sql.= " GROUP BY p.fk_product_type, p.tosell";
$result = $db->query($sql);
while ($objp = $db->fetch_object($result))
{
$prodser[$objp->fk_product_type][$objp->envente]=$objp->total;
$prodser[$objp->fk_product_type][$objp->tosell]=$objp->total;
}
print '<table class="noborder" width="100%">';
@ -120,19 +120,19 @@ print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</
if ($conf->product->enabled)
{
$statProducts = "<tr $bc[0]>";
$statProducts.= '<td><a href="liste.php?type=0&amp;envente=0">'.$langs->trans("ProductsNotOnSell").'</a></td><td align="right">'.round($prodser[0][0]).'</td>';
$statProducts.= '<td><a href="liste.php?type=0&amp;tosell=0">'.$langs->trans("ProductsNotOnSell").'</a></td><td align="right">'.round($prodser[0][0]).'</td>';
$statProducts.= "</tr>";
$statProducts.= "<tr $bc[1]>";
$statProducts.= '<td><a href="liste.php?type=0&amp;envente=1">'.$langs->trans("ProductsOnSell").'</a></td><td align="right">'.round($prodser[0][1]).'</td>';
$statProducts.= '<td><a href="liste.php?type=0&amp;tosell=1">'.$langs->trans("ProductsOnSell").'</a></td><td align="right">'.round($prodser[0][1]).'</td>';
$statProducts.= "</tr>";
}
if ($conf->service->enabled)
{
$statServices = "<tr $bc[0]>";
$statServices.= '<td><a href="liste.php?type=1&amp;envente=0">'.$langs->trans("ServicesNotOnSell").'</a></td><td align="right">'.round($prodser[1][0]).'</td>';
$statServices.= '<td><a href="liste.php?type=1&amp;tosell=0">'.$langs->trans("ServicesNotOnSell").'</a></td><td align="right">'.round($prodser[1][0]).'</td>';
$statServices.= "</tr>";
$statServices.= "<tr $bc[1]>";
$statServices.= '<td><a href="liste.php?type=1&amp;envente=1">'.$langs->trans("ServicesOnSell").'</a></td><td align="right">'.round($prodser[1][1]).'</td>';
$statServices.= '<td><a href="liste.php?type=1&amp;tosell=1">'.$langs->trans("ServicesOnSell").'</a></td><td align="right">'.round($prodser[1][1]).'</td>';
$statServices.= "</tr>";
}
$total=0;
@ -162,7 +162,7 @@ print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
* 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 "</td>";
print '<td align="right" nowrap="nowrap">';
print $product_static->LibStatut($objp->envente,5);
print $product_static->LibStatut($objp->tosell,5);
print "</td>";
print "</tr>\n";
$i++;

View File

@ -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 '<div class="warning">'.$langs->trans("ProductDeleted",$_GET['delprod']).'</div><br>';
}
$param="&amp;sref=".$sref.($sbarcode?"&amp;sbarcode=".$sbarcode:"")."&amp;snom=".$snom."&amp;sall=".$sall."&amp;envente=".$envente;
$param="&amp;sref=".$sref.($sbarcode?"&amp;sbarcode=".$sbarcode:"")."&amp;snom=".$snom."&amp;sall=".$sall."&amp;tosell=".$tosell;
$param.=($fourn_id?"&amp;fourn_id=".$fourn_id:"");
$param.=isset($type)?"&amp;type=".$type:"";
print_barre_liste($texte, $page, "liste.php", $param, $sortfield, $sortorder,'',$num);
@ -309,7 +309,7 @@ if ($resql)
if ($conf->service->enabled && $type != 0) print_liste_field_titre($langs->trans("Duration"),"liste.php", "p.duration",$param,"",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("SellingPrice"),"liste.php", "p.price",$param,"",'align="right"',$sortfield,$sortorder);
if ($conf->stock->enabled && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("Stock").'</td>';
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 "</tr>\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", "&amp;sref=".$sref."&amp;snom=".$snom."&amp;sall=".$sall."&amp;envente=".$envente, $sortfield, $sortorder,'',$num);
print_barre_liste('', $page, "liste.php", "&amp;sref=".$sref."&amp;snom=".$snom."&amp;sall=".$sall."&amp;tosell=".$tosell, $sortfield, $sortorder,'',$num);
}
else
{
print_barre_liste('', $page, "liste.php", "&amp;sref=$sref&amp;snom=$snom&amp;fourn_id=$fourn_id".(isset($type)?"&amp;type=$type":"")."&amp;envente=".$envente, $sortfield, $sortorder,'',$num);
print_barre_liste('', $page, "liste.php", "&amp;sref=$sref&amp;snom=$snom&amp;fourn_id=$fourn_id".(isset($type)?"&amp;type=$type":"")."&amp;tosell=".$tosell, $sortfield, $sortorder,'',$num);
}
}

View File

@ -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."&amp;sall=".$sall."&amp;envente=".$_POST["envente"], $sortfield, $sortorder,'',$num);
print_barre_liste($texte, $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&amp;sall=".$sall."&amp;tosell=".$_POST["tosell"], $sortfield, $sortorder,'',$num);
}
else
{
@ -225,15 +225,15 @@ if ($resql)
// Lignes des titres
print "<tr class=\"liste_titre\">";
print_liste_field_titre($langs->trans("Ref"),"reassort.php", "p.ref","&amp;envente=$envente".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),"reassort.php", "p.label","&envente=$envente&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","","",$sortfield,$sortorder);
if ($conf->service->enabled && $type == 1) print_liste_field_titre($langs->trans("Duration"),"reassort.php", "p.duration","&envente=$envente&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("MininumStock"),"reassort.php", "p.seuil_stock_alerte","&envente=$envente&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PhysicalStock"),"reassort.php", "stock_physique","&envente=$envente&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Ref"),"reassort.php", "p.ref","&amp;tosell=$tosell".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),"reassort.php", "p.label","&tosell=$tosell&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","","",$sortfield,$sortorder);
if ($conf->service->enabled && $type == 1) print_liste_field_titre($langs->trans("Duration"),"reassort.php", "p.duration","&tosell=$tosell&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("MininumStock"),"reassort.php", "p.seuil_stock_alerte","&tosell=$tosell&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("PhysicalStock"),"reassort.php", "stock_physique","&tosell=$tosell&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","",'align="right"',$sortfield,$sortorder);
// TODO Add info of running suppliers/customers orders
//print_liste_field_titre($langs->trans("TheoreticalStock"),"reassort.php", "stock_theorique","&envente=$envente&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","",'align="right"',$sortfield,$sortorder);
//print_liste_field_titre($langs->trans("TheoreticalStock"),"reassort.php", "stock_theorique","&tosell=$tosell&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","",'align="right"',$sortfield,$sortorder);
print '<td class="liste_titre">&nbsp;</td>';
print_liste_field_titre($langs->trans("Status"),"reassort.php", "p.envente","&envente=$envente&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","",'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),"reassort.php", "p.tosell","&tosell=$tosell&".(isset($type)?"&amp;type=$type":"")."&fourn_id=$fourn_id&amp;snom=$snom&amp;sref=$sref","",'align="right"',$sortfield,$sortorder);
print "</tr>\n";
// Lignes des champs de filtre
@ -318,7 +318,7 @@ if ($resql)
{
if ($sref || $snom || $sall || $_POST["search"])
{
print_barre_liste('', $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&amp;sall=".$sall."&amp;envente=".$_POST["envente"], $sortfield, $sortorder,'',$num, 0, '');
print_barre_liste('', $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&amp;sall=".$sall."&amp;tosell=".$_POST["tosell"], $sortfield, $sortorder,'',$num, 0, '');
}
else
{

View File

@ -56,7 +56,7 @@ $db->free();
$sql = "SELECT count(*)";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE p.envente = 0";
$sql.= " WHERE p.tosell = 0";
if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
$sql.= " AND p.fk_product_type <> '1'";
@ -116,7 +116,7 @@ if ($conf->service->enabled)
$sql = "SELECT count(*)";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$sql.= " WHERE p.envente = 0";
$sql.= " WHERE p.tosell = 0";
if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
$sql.= " AND p.fk_product_type = '1'";

View File

@ -659,7 +659,7 @@ class Project 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);