New: Add dm3 in volume unit
This commit is contained in:
parent
546d7368b1
commit
9fd78b04a7
@ -2419,8 +2419,9 @@ function measuring_units_string($unit,$measuring_style='')
|
||||
else if ($measuring_style == 'volume')
|
||||
{
|
||||
$measuring_units[0] = $langs->trans("VolumeUnitm3");
|
||||
$measuring_units[-3] = $langs->trans("VolumeUnitcm3");
|
||||
$measuring_units[-6] = $langs->trans("VolumeUnitmm3");
|
||||
$measuring_units[-3] = $langs->trans("VolumeUnitdm3");
|
||||
$measuring_units[-6] = $langs->trans("VolumeUnitcm3");
|
||||
$measuring_units[-9] = $langs->trans("VolumeUnitmm3");
|
||||
}
|
||||
|
||||
return $measuring_units[$unit];
|
||||
|
||||
@ -70,14 +70,12 @@ class Product extends CommonObject
|
||||
// Statut indique si le produit est en vente '1' ou non '0'
|
||||
var $status;
|
||||
|
||||
//! Unit<69>s de mesure
|
||||
var $new_weight;
|
||||
//! Unites de mesure
|
||||
var $weight;
|
||||
var $weight_units;
|
||||
var $new_volume;
|
||||
var $volume;
|
||||
var $volume_units;
|
||||
|
||||
|
||||
//! Codes barres
|
||||
var $barcode;
|
||||
var $barcode_type;
|
||||
@ -335,20 +333,20 @@ class Product extends CommonObject
|
||||
$this->description = trim($this->description);
|
||||
$this->note = trim($this->note);
|
||||
$this->stock_loc = trim($this->stock_loc);
|
||||
$this->new_weight = price2num($this->new_weight);
|
||||
$this->new_weight_units = trim($this->new_weight_units);
|
||||
$this->new_volume = price2num($this->new_volume);
|
||||
$this->new_volume_units = trim($this->new_volume_units);
|
||||
$this->weight = price2num($this->weight);
|
||||
$this->weight_units = trim($this->weight_units);
|
||||
$this->volume = price2num($this->volume);
|
||||
$this->volume_units = trim($this->volume_units);
|
||||
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."product ";
|
||||
$sql .= " SET label = '" . addslashes($this->libelle) ."'";
|
||||
if ($this->ref) $sql .= ",ref = '" . $this->ref ."'";
|
||||
$sql .= ",tva_tx = " . $this->tva_tx;
|
||||
$sql .= ",envente = " . $this->status;
|
||||
$sql .= ",weight = " . ($this->new_weight!='' ? "'".$this->new_weight."'" : 'null');
|
||||
$sql .= ",weight_units = '" . $this->new_weight_units."'";
|
||||
$sql .= ",volume = " . ($this->new_volume!='' ? "'".$this->new_volume."'" : 'null');
|
||||
$sql .= ",volume_units = '" . $this->new_volume_units."'";
|
||||
$sql .= ",weight = " . ($this->weight!='' ? "'".$this->weight."'" : 'null');
|
||||
$sql .= ",weight_units = '" . $this->weight_units."'";
|
||||
$sql .= ",volume = " . ($this->volume!='' ? "'".$this->volume."'" : 'null');
|
||||
$sql .= ",volume_units = '" . $this->volume_units."'";
|
||||
$sql .= ",seuil_stock_alerte = '" . $this->seuil_stock_alerte."'";
|
||||
$sql .= ",description = '" . addslashes($this->description) ."'";
|
||||
$sql .= ",stock_loc = '" . addslashes($this->stock_loc) ."'";
|
||||
|
||||
@ -83,10 +83,10 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer)
|
||||
$product->duration_unit = $_POST["duration_unit"];
|
||||
$product->seuil_stock_alerte = $_POST["seuil_stock_alerte"];
|
||||
$product->canvas = $_POST["canvas"];
|
||||
$product->new_weight = $_POST["weight"];
|
||||
$product->new_weight_units = $_POST["weight_units"];
|
||||
$product->new_volume = $_POST["volume"];
|
||||
$product->new_volume_units = $_POST["volume_units"];
|
||||
$product->weight = $_POST["weight"];
|
||||
$product->weight_units = $_POST["weight_units"];
|
||||
$product->volume = $_POST["volume"];
|
||||
$product->volume_units = $_POST["volume_units"];
|
||||
// MultiPrix
|
||||
if($conf->global->PRODUIT_MULTIPRICES == 1)
|
||||
{
|
||||
@ -147,10 +147,10 @@ if ($_POST["action"] == 'update' &&
|
||||
$product->duration_value = $_POST["duration_value"];
|
||||
$product->duration_unit = $_POST["duration_unit"];
|
||||
$product->canvas = $_POST["canvas"];
|
||||
$product->new_weight = $_POST["weight"];
|
||||
$product->new_weight_units = $_POST["weight_units"];
|
||||
$product->new_volume = $_POST["volume"];
|
||||
$product->new_volume_units = $_POST["volume_units"];
|
||||
$product->weight = $_POST["weight"];
|
||||
$product->weight_units = $_POST["weight_units"];
|
||||
$product->volume = $_POST["volume"];
|
||||
$product->volume_units = $_POST["volume_units"];
|
||||
|
||||
if ($product->check())
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user