Fix: ajout de la correspondance des volumes
This commit is contained in:
parent
c7df8f8807
commit
024290068c
@ -159,13 +159,6 @@ class FormProduct
|
|||||||
$measuring_units[-6] = $langs->trans("VolumeUnitcm3");
|
$measuring_units[-6] = $langs->trans("VolumeUnitcm3");
|
||||||
$measuring_units[-9] = $langs->trans("VolumeUnitmm3");
|
$measuring_units[-9] = $langs->trans("VolumeUnitmm3");
|
||||||
}
|
}
|
||||||
else if ($measuring_style == 'volume_liquide')
|
|
||||||
{
|
|
||||||
$measuring_units[0] = $langs->trans("VolumeUnitm3");
|
|
||||||
$measuring_units[-3] = $langs->trans("VolumeUnitl");
|
|
||||||
$measuring_units[-4] = $langs->trans("VolumeUnitdl");
|
|
||||||
$measuring_units[-6] = $langs->trans("VolumeUnitml");
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<select class="flat" name="'.$name.'">';
|
print '<select class="flat" name="'.$name.'">';
|
||||||
if ($adddefault) print '<option value="0">'.$langs->trans("Default").'</option>';
|
if ($adddefault) print '<option value="0">'.$langs->trans("Default").'</option>';
|
||||||
|
|||||||
@ -87,15 +87,11 @@ SurfaceUnitdm2=dm2
|
|||||||
SurfaceUnitcm2=cm2
|
SurfaceUnitcm2=cm2
|
||||||
SurfaceUnitmm2=mm2
|
SurfaceUnitmm2=mm2
|
||||||
Volume=Volume
|
Volume=Volume
|
||||||
Volume_liquide=Volume liquide
|
|
||||||
VolumeUnitl=l
|
|
||||||
VolumeUnitdl=dl
|
|
||||||
VolumeUnitml=ml
|
|
||||||
TotalVolume=Volume total
|
TotalVolume=Volume total
|
||||||
VolumeUnitm3=m3
|
VolumeUnitm3=m3
|
||||||
VolumeUnitdm3=dm3
|
VolumeUnitdm3=dm3 (l)
|
||||||
VolumeUnitcm3=cm3
|
VolumeUnitcm3=cm3 (ml)
|
||||||
VolumeUnitmm3=mm3
|
VolumeUnitmm3=mm3 (µl)
|
||||||
Size=taille
|
Size=taille
|
||||||
SizeUnitm=m
|
SizeUnitm=m
|
||||||
SizeUnitdm=dm
|
SizeUnitdm=dm
|
||||||
|
|||||||
@ -315,13 +315,6 @@ function measuring_units_string($unit,$measuring_style='')
|
|||||||
$measuring_units[-6] = $langs->trans("VolumeUnitcm3");
|
$measuring_units[-6] = $langs->trans("VolumeUnitcm3");
|
||||||
$measuring_units[-9] = $langs->trans("VolumeUnitmm3");
|
$measuring_units[-9] = $langs->trans("VolumeUnitmm3");
|
||||||
}
|
}
|
||||||
else if ($measuring_style == 'volume_liquide')
|
|
||||||
{
|
|
||||||
$measuring_units[0] = $langs->trans("VolumeUnitm3");
|
|
||||||
$measuring_units[-3] = $langs->trans("VolumeUnitl");
|
|
||||||
$measuring_units[-4] = $langs->trans("VolumeUnitdl");
|
|
||||||
$measuring_units[-6] = $langs->trans("VolumeUnitml");
|
|
||||||
}
|
|
||||||
|
|
||||||
return $measuring_units[$unit];
|
return $measuring_units[$unit];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -155,8 +155,6 @@ if ($_POST["action"] == 'add' && ($user->rights->produit->creer || $user->rights
|
|||||||
$product->surface_units = $_POST["surface_units"];
|
$product->surface_units = $_POST["surface_units"];
|
||||||
$product->volume = $_POST["volume"];
|
$product->volume = $_POST["volume"];
|
||||||
$product->volume_units = $_POST["volume_units"];
|
$product->volume_units = $_POST["volume_units"];
|
||||||
$product->volume_liquide = $_POST["volume_liquide"];
|
|
||||||
$product->volume_l_units = $_POST["volume_l_units"];
|
|
||||||
$product->finished = $_POST["finished"];
|
$product->finished = $_POST["finished"];
|
||||||
$product->hidden = $_POST["hidden"]=='yes'?1:0;
|
$product->hidden = $_POST["hidden"]=='yes'?1:0;
|
||||||
|
|
||||||
@ -225,8 +223,6 @@ if ($_POST["action"] == 'update' && ($user->rights->produit->creer || $user->rig
|
|||||||
$product->surface_units = $_POST["surface_units"];
|
$product->surface_units = $_POST["surface_units"];
|
||||||
$product->volume = $_POST["volume"];
|
$product->volume = $_POST["volume"];
|
||||||
$product->volume_units = $_POST["volume_units"];
|
$product->volume_units = $_POST["volume_units"];
|
||||||
$product->volume_liquide = $_POST["volume_liquide"];
|
|
||||||
$product->volume_l_units = $_POST["volume_l_units"];
|
|
||||||
$product->finished = $_POST["finished"];
|
$product->finished = $_POST["finished"];
|
||||||
$product->hidden = $_POST["hidden"]=='yes'?1:0;
|
$product->hidden = $_POST["hidden"]=='yes'?1:0;
|
||||||
|
|
||||||
@ -763,11 +759,6 @@ if ($_GET["action"] == 'create' && ($user->rights->produit->creer || $user->righ
|
|||||||
print '<input name="volume" size="4" value="'.$_POST["volume"].'">';
|
print '<input name="volume" size="4" value="'.$_POST["volume"].'">';
|
||||||
print $formproduct->select_measuring_units("volume_units","volume");
|
print $formproduct->select_measuring_units("volume_units","volume");
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// Volume liquide
|
|
||||||
print '<tr><td>'.$langs->trans("Volume_liquide").'</td><td>';
|
|
||||||
print '<input name="volume_liquide" size="4" value="'.$_POST["volume_liquide"].'">';
|
|
||||||
print $formproduct->select_measuring_units("volume_l_units","volume_liquide");
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hidden
|
// Hidden
|
||||||
@ -1024,17 +1015,6 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
print ' ';
|
print ' ';
|
||||||
}
|
}
|
||||||
print "</td></tr>\n";
|
print "</td></tr>\n";
|
||||||
// Volume liquide
|
|
||||||
print '<tr><td>'.$langs->trans("Volume_liquide").'</td><td colspan="2">';
|
|
||||||
if ($product->volume_liquide != '')
|
|
||||||
{
|
|
||||||
print $product->volume_liquide." ".measuring_units_string($product->volume_l_units,"volume_liquide");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print ' ';
|
|
||||||
}
|
|
||||||
print "</td></tr>\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hidden
|
// Hidden
|
||||||
@ -1180,11 +1160,6 @@ if ($_GET["id"] || $_GET["ref"])
|
|||||||
print '<input name="volume" size="5" value="'.$product->volume.'"> ';
|
print '<input name="volume" size="5" value="'.$product->volume.'"> ';
|
||||||
print $formproduct->select_measuring_units("volume_units", "volume", $product->volume_units);
|
print $formproduct->select_measuring_units("volume_units", "volume", $product->volume_units);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
// Volume liquide
|
|
||||||
print '<tr><td>'.$langs->trans("Volume_liquide").'</td><td>';
|
|
||||||
print '<input name="volume_liquide" size="5" value="'.$product->volume_liquide.'"> ';
|
|
||||||
print $formproduct->select_measuring_units("volume_l_units", "volume_liquide", $product->volume_l_units);
|
|
||||||
print '</td></tr>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hidden
|
// Hidden
|
||||||
|
|||||||
@ -94,8 +94,6 @@ class Product extends CommonObject
|
|||||||
var $surface_units;
|
var $surface_units;
|
||||||
var $volume;
|
var $volume;
|
||||||
var $volume_units;
|
var $volume_units;
|
||||||
var $volume_liquide;
|
|
||||||
var $volume_l_units;
|
|
||||||
|
|
||||||
var $accountancy_code_buy;
|
var $accountancy_code_buy;
|
||||||
var $accountancy_code_sell;
|
var $accountancy_code_sell;
|
||||||
@ -411,8 +409,6 @@ class Product extends CommonObject
|
|||||||
$this->surface_units = trim($this->surface_units);
|
$this->surface_units = trim($this->surface_units);
|
||||||
$this->volume = price2num($this->volume);
|
$this->volume = price2num($this->volume);
|
||||||
$this->volume_units = trim($this->volume_units);
|
$this->volume_units = trim($this->volume_units);
|
||||||
$this->volume_liquide = price2num($this->volume_liquide);
|
|
||||||
$this->volume_l_units = trim($this->volume_l_units);
|
|
||||||
if (empty($this->tva_tx)) $this->tva_tx = 0;
|
if (empty($this->tva_tx)) $this->tva_tx = 0;
|
||||||
if (empty($this->finished)) $this->finished = 0;
|
if (empty($this->finished)) $this->finished = 0;
|
||||||
if (empty($this->hidden)) $this->hidden = 0;
|
if (empty($this->hidden)) $this->hidden = 0;
|
||||||
@ -434,8 +430,6 @@ class Product extends CommonObject
|
|||||||
$sql.= ",surface_units = " . ($this->surface_units!='' ? "'".$this->surface_units."'" : 'null');
|
$sql.= ",surface_units = " . ($this->surface_units!='' ? "'".$this->surface_units."'" : 'null');
|
||||||
$sql.= ",volume = " . ($this->volume!='' ? "'".$this->volume."'" : 'null');
|
$sql.= ",volume = " . ($this->volume!='' ? "'".$this->volume."'" : 'null');
|
||||||
$sql.= ",volume_units = " . ($this->volume_units!='' ? "'".$this->volume_units."'" : 'null');
|
$sql.= ",volume_units = " . ($this->volume_units!='' ? "'".$this->volume_units."'" : 'null');
|
||||||
$sql .= ",volume_liquide = " . ($this->volume_liquide!='' ? "'".$this->volume_liquide."'" : 'null');
|
|
||||||
$sql .= ",volume_l_units = " . ($this->volume_l_units!='' ? "'".$this->volume_l_units."'" : 'null');
|
|
||||||
$sql.= ",seuil_stock_alerte = " . ((isset($this->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.= ",description = '" . addslashes($this->description) ."'";
|
||||||
$sql.= ",note = '" . addslashes($this->note) ."'";
|
$sql.= ",note = '" . addslashes($this->note) ."'";
|
||||||
@ -932,7 +926,7 @@ class Product extends CommonObject
|
|||||||
$sql = "SELECT rowid, ref, label, description, note, price, price_ttc,";
|
$sql = "SELECT rowid, ref, label, description, note, price, price_ttc,";
|
||||||
$sql.= " price_min, price_min_ttc, price_base_type, tva_tx, envente,";
|
$sql.= " price_min, price_min_ttc, price_base_type, tva_tx, envente,";
|
||||||
$sql.= " fk_product_type, duration, seuil_stock_alerte, canvas,";
|
$sql.= " fk_product_type, duration, seuil_stock_alerte, canvas,";
|
||||||
$sql.= " weight, weight_units, length, length_units, surface, surface_units, volume, volume_units, volume_liquide, volume_l_units, barcode, fk_barcode_type, finished, hidden,";
|
$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,";
|
$sql.= " accountancy_code_buy, accountancy_code_sell, stock, pmp,";
|
||||||
$sql.= " import_key";
|
$sql.= " import_key";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."product";
|
$sql.= " FROM ".MAIN_DB_PREFIX."product";
|
||||||
@ -973,8 +967,6 @@ class Product extends CommonObject
|
|||||||
$this->surface_units = $result["surface_units"];
|
$this->surface_units = $result["surface_units"];
|
||||||
$this->volume = $result["volume"];
|
$this->volume = $result["volume"];
|
||||||
$this->volume_units = $result["volume_units"];
|
$this->volume_units = $result["volume_units"];
|
||||||
$this->volume_liquide = $result["volume_liquide"];
|
|
||||||
$this->volume_l_units = $result["volume_l_units"];
|
|
||||||
$this->barcode = $result["barcode"];
|
$this->barcode = $result["barcode"];
|
||||||
$this->barcode_type = $result["fk_barcode_type"];
|
$this->barcode_type = $result["fk_barcode_type"];
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user