From b37827944089c9963f6eee1c0bcecb0ccc7e5b4d Mon Sep 17 00:00:00 2001 From: Quentin Vial-Gouteyron Date: Mon, 6 Mar 2017 15:50:17 +0100 Subject: [PATCH] New_filter_to_add_draft_order_to_validated_one --- htdocs/product/stock/replenish.php | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index c050acc7663..2f8a9ba39b4 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'])) @@ -438,6 +442,7 @@ print ''; print ''; print ''; print ''; +print ''; print ''; print '
'; print $langs->trans('Warehouse').' '.$formproduct->selectWarehouses($fk_entrepot, 'fk_entrepot', '', 1); @@ -450,10 +455,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; @@ -534,7 +541,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); @@ -584,7 +591,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"; @@ -671,11 +683,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; @@ -687,6 +700,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;