diff --git a/htdocs/langs/en_US/productbatch.lang b/htdocs/langs/en_US/productbatch.lang
index 763af20c6b4..71e44e8f281 100644
--- a/htdocs/langs/en_US/productbatch.lang
+++ b/htdocs/langs/en_US/productbatch.lang
@@ -37,7 +37,8 @@ ManufacturingDate=Manufacturing date
DestructionDate=Destruction date
FirstUseDate=First use date
QCFrequency=Quality control frequency (in days)
-
+ShowAllLots=Show all lots
+HideLots=Hide lots
#Traceability - qc status
OutOfOrder=Out of order
InWorkingOrder=In working order
diff --git a/htdocs/product/stock/movement_list.php b/htdocs/product/stock/movement_list.php
index 6601edd5e10..bdd22c313ee 100644
--- a/htdocs/product/stock/movement_list.php
+++ b/htdocs/product/stock/movement_list.php
@@ -276,9 +276,9 @@ if ($action == "correct_stock") {
$user,
$id,
GETPOST("nbpiece", 'int'),
- GETPOST("mouvement"),
- GETPOST("label", 'san_alpha'),
- GETPOST('unitprice'),
+ GETPOST("mouvement", 'int'),
+ GETPOST("label", 'alphanohtml'),
+ price2num(GETPOST('unitprice'), 'MT'),
$eatby,
$sellby,
$batch,
@@ -291,9 +291,9 @@ if ($action == "correct_stock") {
$user,
$id,
GETPOST("nbpiece", 'int'),
- GETPOST("mouvement"),
- GETPOST("label", 'san_alpha'),
- GETPOST('unitprice'),
+ GETPOST("mouvement", "int"),
+ GETPOST("label", 'alphanohtml'),
+ price2num(GETPOST('unitprice'), 'MT'),
GETPOST('inventorycode', 'alphanohtml'),
$origin_element,
$origin_id
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index 088ea16fcce..f8c88ce6d01 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -561,6 +561,8 @@ if ($id > 0 || $ref) {
if($(this).text().indexOf('+') > 0) {
$(".batch_warehouse" + id_entrepot).show();
$(this).html('(-)');
+ jQuery("#show_all").hide();
+ jQuery("#hide_all").show();
}
else {
$(".batch_warehouse" + id_entrepot).hide();
@@ -574,6 +576,8 @@ if ($id > 0 || $ref) {
console.log("We click on show_all");
$("[class^=batch_warehouse]").show();
$("[class^=collapse_batch]").html('(-)');
+ jQuery("#show_all").hide();
+ jQuery("#hide_all").show();
return false;
});
@@ -581,6 +585,8 @@ if ($id > 0 || $ref) {
console.log("We click on hide_all");
$("[class^=batch_warehouse]").hide();
$("[class^=collapse_batch]").html('(+)');
+ jQuery("#hide_all").hide();
+ jQuery("#show_all").show();
return false;
});
@@ -938,10 +944,11 @@ if (!$variants) {
if ((!empty($conf->productbatch->enabled)) && $object->hasbatch()) {
$colspan = 3;
- print '
';
+ print ' ';
if (!empty($conf->use_javascript_ajax)) {
- print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ExpandAll").' ';
- print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("UndoExpandAll").' ';
+ print ''.img_picto('', 'folder-open', 'class="paddingright"').$langs->trans("ShowAllLots").' ';
+ //print ' ';
+ print ''.img_picto('', 'folder', 'class="paddingright"').$langs->trans("HideLots").' ';
//print ' '.$form->textwithpicto('', $langs->trans('CollapseBatchDetailHelp'), 1, 'help', '');
}
print ' ';
@@ -1097,7 +1104,7 @@ if (!$variants) {
}
print ''.$pdluo->qty.($pdluo->qty < 0 ? ' '.img_warning() : '').' ';
print ' ';
- print '';
+ print ' ';
if ($entrepotstatic->status != $entrepotstatic::STATUS_CLOSED) {
print 'id.'&id_entrepot='.$entrepotstatic->id.'&action=transfert&pdluoid='.$pdluo->id.'">';
print img_picto($langs->trans("TransferStock"), 'add', 'class="hideonsmartphone paddingright" style="color: #a69944"');
@@ -1109,7 +1116,7 @@ if (!$variants) {
//print img_edit().' ';
}
print ' ';
- print '';
+ print ' ';
if ($entrepotstatic->status != $entrepotstatic::STATUS_CLOSED) {
print 'id.'&id_entrepot='.$entrepotstatic->id.'&action=correction&pdluoid='.$pdluo->id.'">';
print img_picto($langs->trans("CorrectStock"), 'add', 'class="hideonsmartphone paddingright" style="color: #a69944"');
diff --git a/htdocs/product/stock/tpl/stockcorrection.tpl.php b/htdocs/product/stock/tpl/stockcorrection.tpl.php
index 05d628902fb..5b119628c29 100644
--- a/htdocs/product/stock/tpl/stockcorrection.tpl.php
+++ b/htdocs/product/stock/tpl/stockcorrection.tpl.php
@@ -50,8 +50,25 @@ print '';
@@ -77,10 +94,6 @@ if ($object->element == 'product') {
$ident = $conf->global->MAIN_DEFAULT_WAREHOUSE;
}
print img_picto('', 'stock').$formproduct->selectWarehouses($ident, 'id_entrepot', 'warehouseopen,warehouseinternal', 1, 0, 0, '', 0, 0, null, 'minwidth100');
- print ' ';
- print ''.$langs->trans("Add").' ';
- print ''.$langs->trans("Delete").' ';
- print ' ';
print ' ';
}
if ($object->element == 'stock') {
@@ -88,14 +101,19 @@ if ($object->element == 'stock') {
print '';
print img_picto('', 'product');
$form->select_produits(GETPOST('product_id', 'int'), 'product_id', (empty($conf->global->STOCK_SUPPORTS_SERVICES) ? '0' : ''), 0, 0, -1, 2, '', 0, null, 0, 1, 0, 'maxwidth500');
- print ' ';
- print ''.$langs->trans("Add").' ';
- print ''.$langs->trans("Delete").' ';
- print ' ';
print ' ';
}
print ''.$langs->trans("NumberOfUnit").' ';
-print ' ';
+print '';
+if ($object->element == 'product' || $object->element == 'stock') {
+ print '';
+ print ''.$langs->trans("Add").' ';
+ print ''.$langs->trans("Delete").' ';
+ print ' ';
+ print ajax_combobox("mouvement");
+}
+print ' ';
+print ' ';
print ' ';
// If product is a Kit, we ask if we must disable stock change of subproducts
diff --git a/htdocs/product/stock/tpl/stocktransfer.tpl.php b/htdocs/product/stock/tpl/stocktransfer.tpl.php
index 27c9b2acb21..3e2adf8a169 100644
--- a/htdocs/product/stock/tpl/stocktransfer.tpl.php
+++ b/htdocs/product/stock/tpl/stocktransfer.tpl.php
@@ -89,7 +89,7 @@ if ($object->element == 'stock') {
print ''.$langs->trans("WarehouseTarget").' ';
print img_picto('', 'stock').$formproduct->selectWarehouses(GETPOST('id_entrepot_destination'), 'id_entrepot_destination', 'warehouseopen,warehouseinternal', 1);
print ' ';
-print ''.$langs->trans("NumberOfUnit").' ';
+print ''.$langs->trans("NumberOfUnit").' ';
print ' ';
// Serial / Eat-by date