From 018dbca5c0a0cfdf5a4b6b0dd10d56e3d97a8108 Mon Sep 17 00:00:00 2001 From: mschamp <34092708+mschamp@users.noreply.github.com> Date: Sat, 18 Sep 2021 12:51:32 +0200 Subject: [PATCH 1/6] Show inventory in table toConsume Add a column with the reel inventory to the production screen of manufacturing orders. This gives the user an indication if production is possible. --- htdocs/mrp/mo_production.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 678865805d7..458bcfca7ba 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -721,6 +721,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $langs->trans("Warehouse"); } print ''; + // Available + print ''; + if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { + print $langs->trans("Available"); + } + print ''; // Lot - serial if ($conf->productbatch->enabled) { print ''; @@ -864,6 +870,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; print ''; // Warehouse print ''; + print ''; + if ($tmpproduct->stock_reel < ($line->qty-$alreadyconsumed)) { + print img_warning($langs->trans('StockTooLow')).' '; + } + print $tmpproduct->stock_reel; // Available + print ''; if ($conf->productbatch->enabled) { print ''; // Lot } From b8d37ec37e77b416c2bfc16572943315afd4cb94 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Sep 2021 16:12:10 +0200 Subject: [PATCH 2/6] Update mo_production.php --- htdocs/mrp/mo_production.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 42aa1b6c14e..c2a69651868 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -873,7 +873,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } print ' '.$alreadyconsumed; print ''; - print ''; // Warehouse + // Warehouse + print ''; print ''; print ''; if ($tmpproduct->stock_reel < ($line->qty-$alreadyconsumed)) { From e9e0258444265bd7422f054fd6fee6a8a269d97c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Sep 2021 16:14:42 +0200 Subject: [PATCH 3/6] Update mo_production.php --- htdocs/mrp/mo_production.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index c2a69651868..75be12ffc39 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -726,12 +726,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print $langs->trans("Warehouse"); } print ''; - // Available - print ''; - if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { - print $langs->trans("Available"); + if ($conf->productbatch->enabled) { + // Available + print ''; + if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { + print $langs->trans("Available"); + } + print ''; } - print ''; // Lot - serial if ($conf->productbatch->enabled) { print ''; From c37767c5a05e77e0be8630845d560d9f8cf36c91 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Sep 2021 16:15:21 +0200 Subject: [PATCH 4/6] Update mo_production.php --- htdocs/mrp/mo_production.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 75be12ffc39..97246d120c8 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -878,12 +878,14 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Warehouse print ''; print ''; - print ''; - if ($tmpproduct->stock_reel < ($line->qty-$alreadyconsumed)) { - print img_warning($langs->trans('StockTooLow')).' '; + if ($conf->stock->enabled) { + print ''; + if ($tmpproduct->stock_reel < ($line->qty-$alreadyconsumed)) { + print img_warning($langs->trans('StockTooLow')).' '; + } + print $tmpproduct->stock_reel; // Available + print ''; } - print $tmpproduct->stock_reel; // Available - print ''; if ($conf->productbatch->enabled) { print ''; // Lot } From 91bf2a8d7704d064d733946311c85ece360b5a5e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Sep 2021 16:16:28 +0200 Subject: [PATCH 5/6] Update mo_production.php --- htdocs/mrp/mo_production.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 97246d120c8..60e05f90da1 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -880,7 +880,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea print ''; if ($conf->stock->enabled) { print ''; - if ($tmpproduct->stock_reel < ($line->qty-$alreadyconsumed)) { + if ($tmpproduct->stock_reel < ($line->qty - $alreadyconsumed)) { print img_warning($langs->trans('StockTooLow')).' '; } print $tmpproduct->stock_reel; // Available From a81ee14593b241b40994a08dcfc3d17113d10886 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 18 Sep 2021 16:18:09 +0200 Subject: [PATCH 6/6] Update mo_production.php --- htdocs/mrp/mo_production.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/mrp/mo_production.php b/htdocs/mrp/mo_production.php index 60e05f90da1..929e82824d6 100644 --- a/htdocs/mrp/mo_production.php +++ b/htdocs/mrp/mo_production.php @@ -730,7 +730,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea // Available print ''; if ($collapse || in_array($action, array('consumeorproduce', 'consumeandproduceall'))) { - print $langs->trans("Available"); + print $langs->trans("Stock"); } print ''; }