diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php
index 437361b5cf5..9185406a6ef 100644
--- a/htdocs/product/stock/replenish.php
+++ b/htdocs/product/stock/replenish.php
@@ -53,6 +53,8 @@ $type = GETPOST('type','int');
$tobuy = GETPOST('tobuy', 'int');
$salert = GETPOST('salert', 'alpha');
$mode = GETPOST('mode','alpha');
+$draftorder = GETPOST('draftorder','alpha');
+
$fourn_id = GETPOST('fourn_id','int');
$fk_supplier = GETPOST('fk_supplier','int');
@@ -96,7 +98,9 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter.x") || GETP
$snom = '';
$sal = '';
$salert = '';
+ $draftorder='';
}
+if($draftorder == 'on') $draftchecked = "checked";
// Create orders
if ($action == 'order' && isset($_POST['valid']))
@@ -421,6 +425,7 @@ print '';
print '';
print '';
print '';
+print '';
print '';
print '
';
print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1);
@@ -433,10 +438,11 @@ print '';
$param = (isset($type)? '&type=' . $type : '');
-$param .= '&fourn_id=' . $fourn_id . '&snom='. $snom . '&salert=' . $salert;
+$param .= '&fourn_id=' . $fourn_id . '&snom='. $snom . '&salert=' . $salert . '&draftorder='.$draftorder;
$param .= '&sref=' . $sref;
$param .= '&mode=' . $mode;
$param .= '&fk_supplier=' . $fk_supplier;
@@ -517,7 +524,7 @@ if (!empty($conf->service->enabled) && $type == 1) print '
| ';
print ' | ';
print '' . $langs->trans('AlertOnly') . ' | ';
-print ' | ';
+print '' . $langs->trans('Draft') . ' | ';
print ' | ';
print '';
$searchpitco=$form->showFilterAndCheckAddButtons(0);
@@ -567,7 +574,12 @@ while ($i < ($limit ? min($num, $limit) : $num))
}
// Force call prod->load_stats_xxx to choose status to count (otherwise it is loaded by load_stock function)
- $result=$prod->load_stats_commande_fournisseur(0,'1,2,3,4');
+ if(isset($draftchecked)){
+ $result=$prod->load_stats_commande_fournisseur(0,'0,1,2,3,4');
+ }else {
+ $result=$prod->load_stats_commande_fournisseur(0,'1,2,3,4');
+ }
+
$result=$prod->load_stats_reception(0,'4');
//print $prod->stats_commande_fournisseur['qty'].' '."\n";
@@ -654,11 +666,12 @@ print '';
if ($num > $conf->liste_limit)
{
- if ($sref || $snom || $sall || $salert || GETPOST('search', 'alpha'))
+ if ($sref || $snom || $sall || $salert || $draftorder || GETPOST('search', 'alpha'))
{
$filters = '&sref=' . $sref . '&snom=' . $snom;
$filters .= '&sall=' . $sall;
$filters .= '&salert=' . $salert;
+ $filters .= '&draftorder=' . $draftorder;
$filters .= '&mode=' . $mode;
$filters .= '&fk_supplier=' . $fk_supplier;
$filters .= '&fk_entrepot=' . $fk_entrepot;
@@ -670,6 +683,7 @@ if ($num > $conf->liste_limit)
$filters .= '&fourn_id=' . $fourn_id;
$filters .= (isset($type)? '&type=' . $type : '');
$filters .= '&salert=' . $salert;
+ $filters .= '&draftorder=' . $draftorder;
$filters .= '&mode=' . $mode;
$filters .= '&fk_supplier=' . $fk_supplier;
$filters .= '&fk_entrepot=' . $fk_entrepot;
|