Permalink
Browse files

Add stock information in products list.

  • Loading branch information...
1 parent f7c9564 commit b31d25e767fbc913e04f96daf37b0c4c0678da45 @eldy eldy committed Feb 6, 2009
Showing with 9 additions and 8 deletions.
  1. +2 −1 ChangeLog
  2. +3 −3 htdocs/includes/modules/modProduit.class.php
  3. +1 −2 htdocs/product.class.php
  4. +3 −2 htdocs/product/fiche.php
View
@@ -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.
@@ -140,9 +140,9 @@ function modProduit($DB)
$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';
View
@@ -375,7 +375,6 @@ function update($id, $user)
$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 @@ function update($id, $user)
$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) ."'";
View
@@ -779,7 +779,7 @@
$product->assign_smarty_values($smarty,$_GET["action"]);
}
}
- // END TODO RODO FINISH THIS PART
+
llxHeader("","",$langs->trans("CardProduct".$product->type));
@@ -1054,7 +1054,7 @@
}
else
{
- print '<input name="seuil_stock_alerte" type="hidden" value="0">';
+ print '<input name="seuil_stock_alerte" type="hidden" value="'.$product->seuil_stock_alerte.'">';
}
if ($product->isservice())
@@ -1081,6 +1081,7 @@
print '<input name="weight" size="5" value="'.$product->weight.'"> ';
print $formproduct->select_measuring_units("weight_units", "weight", $product->weight_units);
print '</td></tr>';
+
print '<tr><td>'.$langs->trans("Volume").'</td><td>';
print '<input name="volume" size="5" value="'.$product->volume.'"> ';
print $formproduct->select_measuring_units("volume_units", "volume", $product->volume_units);

0 comments on commit b31d25e

Please sign in to comment.