New: task #185 : Can input amount when correcting stock to recalculate

PMP.
This commit is contained in:
Laurent Destailleur 2012-08-06 19:41:03 +02:00
parent 0ad8f31899
commit 1e28904d56
2 changed files with 11 additions and 9 deletions

View File

@ -26,11 +26,12 @@ For users:
- New: Suggest a method to generate a backup file for user with no access - New: Suggest a method to generate a backup file for user with no access
to mysqldump binary. to mysqldump binary.
- New: Can correct stock of a warehouse from warehouse card. - New: Can correct stock of a warehouse from warehouse card.
- New: task #185 : Can input amount when correcting stock to recalculate PMP.
- New: [ task #454 ] Add "No category" into filters on category. - New: [ task #454 ] Add "No category" into filters on category.
- New: Update language files (de, tr, pt). - New: Update language files (de, tr, pt).
- New: Auto check box on page to edit interface options of user. - New: Auto check box on page to edit interface options of user.
- New: Add great britain provinces. - New: Add great britain provinces.
- New: Update libs/tools for DoliWamp. - New: Update libs/tools/logo for DoliWamp.
- Fix: No images into product description lines as PDF generation does - Fix: No images into product description lines as PDF generation does
not work with this. not work with this.

View File

@ -74,8 +74,9 @@ if ($action == 'setstocklimit')
// Correct stock // Correct stock
if ($action == "correct_stock" && ! $_POST["cancel"]) if ($action == "correct_stock" && ! $_POST["cancel"])
{ {
if ($_POST["price"] == '') $_POST["price"] = 0; //if ($_POST["price"] == '') $_POST["price"] = 0;
if (is_numeric($_POST["nbpiece"]) && $id && is_numeric($_POST["price"])) if (isset($_POST["price"])) $priceunit=price2num($_POST["price"]);
if (is_numeric($_POST["nbpiece"]) && $id)
{ {
$product = new Product($db); $product = new Product($db);
$result=$product->fetch($id); $result=$product->fetch($id);
@ -86,7 +87,7 @@ if ($action == "correct_stock" && ! $_POST["cancel"])
$_POST["nbpiece"], $_POST["nbpiece"],
$_POST["mouvement"], $_POST["mouvement"],
$_POST["label"], $_POST["label"],
$_POST["price"] $priceunit
); // 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)
@ -336,7 +337,7 @@ if ($_GET["id"] || $_GET["ref"])
// Warehouse // Warehouse
print '<tr>'; print '<tr>';
print '<td width="20%">'.$langs->trans("Warehouse").'</td>'; print '<td width="20%" class="fieldrequired">'.$langs->trans("Warehouse").'</td>';
print '<td width="20%">'; print '<td width="20%">';
print $formproduct->selectWarehouses($_GET["dwid"],'id_entrepot','',1); print $formproduct->selectWarehouses($_GET["dwid"],'id_entrepot','',1);
print '</td>'; print '</td>';
@ -345,7 +346,7 @@ if ($_GET["id"] || $_GET["ref"])
print '<option value="0">'.$langs->trans("Add").'</option>'; print '<option value="0">'.$langs->trans("Add").'</option>';
print '<option value="1">'.$langs->trans("Delete").'</option>'; print '<option value="1">'.$langs->trans("Delete").'</option>';
print '</select></td>'; print '</select></td>';
print '<td width="20%">'.$langs->trans("NumberOfUnit").'</td><td width="20%"><input class="flat" name="nbpiece" size="10" value=""></td>'; print '<td width="20%" class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td><td width="20%"><input class="flat" name="nbpiece" size="10" value=""></td>';
print '</tr>'; print '</tr>';
// Label // Label
@ -376,13 +377,13 @@ if ($_GET["id"] || $_GET["ref"])
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
print '<tr>'; print '<tr>';
print '<td width="20%">'.$langs->trans("WarehouseSource").'</td><td width="20%">'; print '<td width="20%" class="fieldrequired">'.$langs->trans("WarehouseSource").'</td><td width="20%">';
print $formproduct->selectWarehouses($_GET["dwid"],'id_entrepot_source','',1); print $formproduct->selectWarehouses($_GET["dwid"],'id_entrepot_source','',1);
print '</td>'; print '</td>';
print '<td width="20%">'.$langs->trans("WarehouseTarget").'</td><td width="20%">'; print '<td width="20%" class="fieldrequired">'.$langs->trans("WarehouseTarget").'</td><td width="20%">';
print $formproduct->selectWarehouses('','id_entrepot_destination','',1); print $formproduct->selectWarehouses('','id_entrepot_destination','',1);
print '</td>'; print '</td>';
print '<td width="20%">'.$langs->trans("NumberOfUnit").'</td><td width="20%"><input name="nbpiece" size="10" value=""></td>'; print '<td width="20%" class="fieldrequired">'.$langs->trans("NumberOfUnit").'</td><td width="20%"><input name="nbpiece" size="10" value=""></td>';
print '</tr>'; print '</tr>';
// Label // Label