Merge pull request #292 from atm-maxime/mko185

Mko185
This commit is contained in:
Regis Houssin 2012-08-06 10:03:59 -07:00
commit 67d90d9de2
2 changed files with 6 additions and 3 deletions

View File

@ -33,6 +33,7 @@ StockCorrection=Corriger stock
StockMovement=Transférer StockMovement=Transférer
StockMovements=Mouvements de stock StockMovements=Mouvements de stock
NumberOfUnit=Nombre de pièces NumberOfUnit=Nombre de pièces
UnitPurchaseValue=Prix d'achat unitaire
TotalStock=Total en stock TotalStock=Total en stock
StockTooLow=Stock insuffisant StockTooLow=Stock insuffisant
EnhancedValue=Valorisation EnhancedValue=Valorisation

View File

@ -74,7 +74,8 @@ if ($action == 'setstocklimit')
// Correct stock // Correct stock
if ($action == "correct_stock" && ! $_POST["cancel"]) if ($action == "correct_stock" && ! $_POST["cancel"])
{ {
if (is_numeric($_POST["nbpiece"]) && $id) if ($_POST["price"] == '') $_POST["price"] = 0;
if (is_numeric($_POST["nbpiece"]) && $id && is_numeric($_POST["price"]))
{ {
$product = new Product($db); $product = new Product($db);
$result=$product->fetch($id); $result=$product->fetch($id);
@ -85,7 +86,7 @@ if ($action == "correct_stock" && ! $_POST["cancel"])
$_POST["nbpiece"], $_POST["nbpiece"],
$_POST["mouvement"], $_POST["mouvement"],
$_POST["label"], $_POST["label"],
0 $_POST["price"]
); // We do not change value of stock for a correction ); // We do not change value of stock for a correction
if ($result > 0) if ($result > 0)
@ -350,9 +351,10 @@ if ($_GET["id"] || $_GET["ref"])
// Label // Label
print '<tr>'; print '<tr>';
print '<td width="20%">'.$langs->trans("Label").'</td>'; print '<td width="20%">'.$langs->trans("Label").'</td>';
print '<td colspan="4">'; print '<td colspan="2">';
print '<input type="text" name="label" size="40" value="">'; print '<input type="text" name="label" size="40" value="">';
print '</td>'; print '</td>';
print '<td width="20%">'.$langs->trans("UnitPurchaseValue").'</td><td width="20%"><input class="flat" name="price" size="10" value=""></td>';
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';