mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge pull request #33133 from ibuiv/patch-11
FIX Avoid remove supplier order with dispateched lines
This commit is contained in:
commit
8cbe5ae54f
|
|
@ -2656,6 +2656,18 @@ if ($action == 'create') {
|
|||
}
|
||||
}
|
||||
|
||||
// To avoid delete order with dispatched lines
|
||||
if (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_DISPATCH_ORDER')) {
|
||||
if (empty($object->lines)) {
|
||||
$object->fetch_lines();
|
||||
}
|
||||
$dispachedLines = $object->getDispachedLines(1);
|
||||
$nbDispachedLines = count($dispachedLines);
|
||||
if ($nbDispachedLines > 0) {
|
||||
$hasreception = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (in_array($object->statut, array(3, 4, 5))) {
|
||||
if (isModEnabled("supplier_order") && $usercanreceive) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/fourn/commande/dispatch.php?id='.$object->id.'">'.$labelofbutton.'</a></div>';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user