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:
Laurent Destailleur 2021-11-15 13:58:43 +01:00 committed by GitHub
commit f2bfa8b2a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View File

@ -159,6 +159,25 @@ function ordersupplier_prepare_head($object)
$langs->load("stocks");
$head[$h][0] = DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$object->id;
$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';
$h++;
}

View File

@ -2274,7 +2274,6 @@ class CommandeFournisseur extends CommonOrder
return $ret;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Set a delivery in database for this supplier order