Merge pull request #11030 from atm-florian/9.0

fix #11023
This commit is contained in:
Laurent Destailleur 2019-04-19 13:05:38 +02:00 committed by GitHub
commit 83205e6963
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -759,6 +759,7 @@ if (empty($reshook))
$qty = GETPOST('qty' . $predef);
$remise_percent = GETPOST('remise_percent' . $predef);
if (empty($remise_percent)) $remise_percent=0;
// Extrafields
$extrafieldsline = new ExtraFields($db);

View File

@ -51,7 +51,7 @@ function shipping_prepare_head($object)
{
// delivery link
$object->fetchObjectLinked($object->id,$object->element);
if (count($object->linkedObjectsIds['delivery']) > 0) // If there is a delivery
if (is_array($object->linkedObjectsIds['delivery']) && count($object->linkedObjectsIds['delivery']) > 0) // If there is a delivery
{
// Take first one element of array
$tmp = reset($object->linkedObjectsIds['delivery']);

View File

@ -307,7 +307,7 @@ class InterfaceWorkflowManager extends DolibarrTriggers
$diff_array=array_diff_assoc($qtyordred,$qtyshipped);
if (count($diff_array)==0) {
//No diff => mean everythings is shipped
$ret=$object->setStatut(Commande::STATUS_CLOSED, $object->origin_id, $object->origin);
$ret=$object->setStatut(Commande::STATUS_CLOSED, $object->origin_id, $object->origin, 'ORDER_CLOSE');
if ($ret<0) {
$this->error=$object->error; $this->errors=$object->errors;
return $ret;