diff --git a/ChangeLog b/ChangeLog index c557dc2a2ee..1274c31564f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,7 +24,8 @@ For users: - New: Can add personalised fields in emailing selectors. - New: Customer code and supplier code can be defined automatically. - New: Emailing feature can extract civility from contacts. -- New: Can creat a third party from a member of fundation module. +- New: Can create a third party from a member of fundation module. +- New: Can set a limit for stock alert to 0. - Fix: Handle correctly the comment in status changing of supplier orders. - Fix: Author, title and topic are correctly encoded in PDF. - Fix: Now HTML output is always UTF8, this solve bad PDF encoding on old users. diff --git a/htdocs/includes/modules/modProduit.class.php b/htdocs/includes/modules/modProduit.class.php index 291ebef11a5..53cdb03d3c3 100644 --- a/htdocs/includes/modules/modProduit.class.php +++ b/htdocs/includes/modules/modProduit.class.php @@ -140,9 +140,9 @@ class modProduit extends DolibarrModules $this->export_code[$r]=$this->rights_class.'_'.$r; $this->export_label[$r]="ProductsOrServices"; // 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.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','p.stock'=>'Stock','p.pmp'=>'PMPValue'); - $this->export_entities_array[$r]=array('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','p.stock'=>'product','p.pmp'=>'product'); - $this->export_alias_array[$r]=array('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','p.stock'=>'stock','p.pmp'=>'pmp'); + $this->export_fields_array[$r]=array('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'); + $this->export_entities_array[$r]=array('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'); + $this->export_alias_array[$r]=array('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'); $this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'product as p'; diff --git a/htdocs/product.class.php b/htdocs/product.class.php index e397b4cf36d..c821d80af5b 100644 --- a/htdocs/product.class.php +++ b/htdocs/product.class.php @@ -375,7 +375,6 @@ class Product extends CommonObject $this->volume_units = trim($this->volume_units); if (empty($this->tva_tx)) $this->tva_tx = 0; if (empty($this->finished)) $this->finished = 0; - if (empty($this->seuil_stock_alerte)) $this->seuil_stock_alerte = 0; $sql = "UPDATE ".MAIN_DB_PREFIX."product "; $sql .= " SET label = '" . addslashes($this->libelle) ."'"; @@ -387,7 +386,7 @@ class Product extends CommonObject $sql .= ",weight_units = " . ($this->weight_units!='' ? "'".$this->weight_units."'": 'null'); $sql .= ",volume = " . ($this->volume!='' ? "'".$this->volume."'" : 'null'); $sql .= ",volume_units = " . ($this->volume_units!='' ? "'".$this->volume_units."'" : 'null'); - $sql .= ",seuil_stock_alerte = " . ($this->seuil_stock_alerte!='' ? $this->seuil_stock_alerte : "null"); + $sql .= ",seuil_stock_alerte = " . ((isset($this->seuil_stock_alerte) && $this->seuil_stock_alerte != '') ? "'".$this->seuil_stock_alerte."'" : "null"); $sql .= ",description = '" . addslashes($this->description) ."'"; $sql .= ",stock_loc = '" . addslashes($this->stock_loc) ."'"; $sql .= ",note = '" . addslashes($this->note) ."'"; diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index b6a6a2016e8..dd0aac71e4b 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -779,7 +779,7 @@ if ($_GET["id"] || $_GET["ref"]) $product->assign_smarty_values($smarty,$_GET["action"]); } } - // END TODO RODO FINISH THIS PART + llxHeader("","",$langs->trans("CardProduct".$product->type)); @@ -1054,7 +1054,7 @@ if ($_GET["id"] || $_GET["ref"]) } else { - print ''; + print ''; } if ($product->isservice()) @@ -1081,6 +1081,7 @@ if ($_GET["id"] || $_GET["ref"]) print ' '; print $formproduct->select_measuring_units("weight_units", "weight", $product->weight_units); print ''; + print ''.$langs->trans("Volume").''; print ' '; print $formproduct->select_measuring_units("volume_units", "volume", $product->volume_units);