Merge pull request #18940 from PyroShape/develop2
NEW : info of number of product still to dispatched in a supplier order
This commit is contained in:
commit
f2bfa8b2a1
@ -159,6 +159,25 @@ function ordersupplier_prepare_head($object)
|
|||||||
$langs->load("stocks");
|
$langs->load("stocks");
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$object->id;
|
||||||
$head[$h][1] = $langs->trans("OrderDispatch");
|
$head[$h][1] = $langs->trans("OrderDispatch");
|
||||||
|
|
||||||
|
//If dispach process running we add the number of item to dispatch into the head
|
||||||
|
if ($object->statut == '3' OR $object->statut == '4' OR $object->statut == '5') {
|
||||||
|
$object->fetch_lines();
|
||||||
|
$nbLinesOrdered = count($object->lines);
|
||||||
|
$dispachedLines = $object->getDispachedLines(1);
|
||||||
|
$nbDispachedLines = count($dispachedLines);
|
||||||
|
|
||||||
|
$sumQtyAllreadyDispatched = 0;
|
||||||
|
for ($line = 0 ; $line < $nbDispachedLines; $line++) {
|
||||||
|
$sumQtyAllreadyDispatched = $sumQtyAllreadyDispatched + $dispachedLines[$line]['qty'];
|
||||||
|
}
|
||||||
|
$sumQtyOrdered = 0;
|
||||||
|
for ($line = 0 ; $line < $nbLinesOrdered; $line++) {
|
||||||
|
$sumQtyOrdered = $sumQtyOrdered + $object->lines[$line]->qty;
|
||||||
|
}
|
||||||
|
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$sumQtyAllreadyDispatched.' / '.$sumQtyOrdered.'</span>';
|
||||||
|
}
|
||||||
|
|
||||||
$head[$h][2] = 'dispatch';
|
$head[$h][2] = 'dispatch';
|
||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2274,7 +2274,6 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Set a delivery in database for this supplier order
|
* Set a delivery in database for this supplier order
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user