reformat
This commit is contained in:
parent
3b6fa4a52b
commit
787125cf12
@ -34,9 +34,12 @@ $langs->load("stocks");
|
|||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
|
|
||||||
// Security check
|
// Security check
|
||||||
if ($user->societe_id) $socid=$user->societe_id;
|
if ($user->societe_id) {
|
||||||
|
$socid = $user->societe_id;
|
||||||
|
}
|
||||||
$result=restrictedArea($user,'produit|service');
|
$result=restrictedArea($user,'produit|service');
|
||||||
|
|
||||||
|
//checks if a product has been ordered
|
||||||
function ordered($product_id) {
|
function ordered($product_id) {
|
||||||
global $db;
|
global $db;
|
||||||
$sql = 'SELECT DISTINCT cfd.fk_product, SUM(cfd.qty) from ';
|
$sql = 'SELECT DISTINCT cfd.fk_product, SUM(cfd.qty) from ';
|
||||||
@ -58,7 +61,7 @@ function ordered($product_id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$error=$db->lasterror();
|
$error = $db->lasterror();
|
||||||
dol_print_error($db);
|
dol_print_error($db);
|
||||||
dol_syslog('replenish.php: ' . $error, LOG_ERROR);
|
dol_syslog('replenish.php: ' . $error, LOG_ERROR);
|
||||||
return $langs->trans('error');
|
return $langs->trans('error');
|
||||||
@ -77,8 +80,14 @@ $tobuy = GETPOST('tobuy');
|
|||||||
$sortfield = GETPOST('sortfield','alpha');
|
$sortfield = GETPOST('sortfield','alpha');
|
||||||
$sortorder = GETPOST('sortorder','alpha');
|
$sortorder = GETPOST('sortorder','alpha');
|
||||||
$page = GETPOST('page','int');
|
$page = GETPOST('page','int');
|
||||||
if (! $sortfield) $sortfield = 'stock_physique';
|
|
||||||
if (! $sortorder) $sortorder = 'ASC';
|
if (!$sortfield) {
|
||||||
|
$sortfield = 'stock_physique';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$sortorder) {
|
||||||
|
$sortorder = 'ASC';
|
||||||
|
}
|
||||||
$limit = $conf->liste_limit;
|
$limit = $conf->liste_limit;
|
||||||
$offset = $limit * $page ;
|
$offset = $limit * $page ;
|
||||||
|
|
||||||
@ -279,10 +288,12 @@ if ($resql) {
|
|||||||
$head[1][2] = 'replenishorders';
|
$head[1][2] = 'replenishorders';
|
||||||
dol_fiche_head($head, 'replenish', $title, 0, 'stock');
|
dol_fiche_head($head, 'replenish', $title, 0, 'stock');
|
||||||
if ($sref || $snom || $sall || GETPOST('search')) {
|
if ($sref || $snom || $sall || GETPOST('search')) {
|
||||||
|
$filters = '&sref=' . $sref . '&snom=' . $snom;
|
||||||
|
$filters .= '&sall=' . $sall;
|
||||||
print_barre_liste($texte,
|
print_barre_liste($texte,
|
||||||
$page,
|
$page,
|
||||||
'replenish.php',
|
'replenish.php',
|
||||||
'&sref=' . $sref . '&snom=' . $snom . '&sall=' . $sall,
|
$filters,
|
||||||
$sortfield,
|
$sortfield,
|
||||||
$sortorder,
|
$sortorder,
|
||||||
'',
|
'',
|
||||||
@ -290,10 +301,13 @@ if ($resql) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$filters = '&sref=' . $sref . '&snom=' . $snom;
|
||||||
|
$filters .= '&fourn_id=' . $fourn_id;
|
||||||
|
$filters .= (isset($type)?'&type=' . $type:'');
|
||||||
print_barre_liste($texte,
|
print_barre_liste($texte,
|
||||||
$page,
|
$page,
|
||||||
'replenish.php',
|
'replenish.php',
|
||||||
'&sref=$sref&snom=$snom&fourn_id=$fourn_id' . (isset($type)?'&type=$type':''),
|
$filters,
|
||||||
$sortfield,
|
$sortfield,
|
||||||
$sortorder,
|
$sortorder,
|
||||||
'',
|
'',
|
||||||
@ -336,8 +350,9 @@ if ($resql) {
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$param = (isset($type)? '&type=$type' : '');
|
$param = (isset($type)? '&type=' . $type : '');
|
||||||
$param .= '&fourn_id=' . $fourn_id . '&snom='. $snom . '&sref=' . $sref;
|
$param .= '&fourn_id=' . $fourn_id . '&snom='. $snom;
|
||||||
|
$param .= '&sref=' . $sref;
|
||||||
|
|
||||||
// Lignes des titres
|
// Lignes des titres
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
@ -566,10 +581,12 @@ if ($resql) {
|
|||||||
|
|
||||||
if ($num > $conf->liste_limit) {
|
if ($num > $conf->liste_limit) {
|
||||||
if ($sref || $snom || $sall || GETPOST('search')) {
|
if ($sref || $snom || $sall || GETPOST('search')) {
|
||||||
|
$filters = '&sref=' . $sref . '&snom=' . $snom;
|
||||||
|
$filters .= '&sall=' . $sall;
|
||||||
print_barre_liste('',
|
print_barre_liste('',
|
||||||
$page,
|
$page,
|
||||||
'replenish.php',
|
'replenish.php',
|
||||||
'&sref=' . $sref . '&snom=' . $snom . '&sall=' . $sall,
|
$filters,
|
||||||
$sortfield,
|
$sortfield,
|
||||||
$sortorder,
|
$sortorder,
|
||||||
'',
|
'',
|
||||||
@ -579,10 +596,13 @@ if ($resql) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
$filters = '&sref=' . $sref . '&snom=' . $snom;
|
||||||
|
$filters .= '&fourn_id=' . $fourn_id;
|
||||||
|
$filters .= (isset($type)? '&type=' . $type : '');
|
||||||
print_barre_liste('',
|
print_barre_liste('',
|
||||||
$page,
|
$page,
|
||||||
'replenish.php',
|
'replenish.php',
|
||||||
"&sref=$sref&snom=$snom&fourn_id=$fourn_id" . (isset($type)?"&type=$type":""),
|
$filters,
|
||||||
$sortfield,
|
$sortfield,
|
||||||
$sortorder,
|
$sortorder,
|
||||||
'',
|
'',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user