Fixing style errors.

This commit is contained in:
stickler-ci 2020-04-23 05:54:13 +00:00
parent 47654fd629
commit ff694c22d1
2 changed files with 9 additions and 12 deletions

View File

@ -461,10 +461,9 @@ if (empty($reshook))
}
}
}
elseif ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->expedition->supprimer)
{
$also_update_stock = (GETPOST('alsoUpdateStock', 'alpha') ? 1 : 0);
$result = $object->cancel(0, $also_update_stock);
if ($result > 0)
@ -475,9 +474,8 @@ if (empty($reshook))
{
setEventMessages($object->error, $object->errors, 'errors');
}
}
elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expedition->supprimer)
{
$also_update_stock = (GETPOST('alsoUpdateStock', 'alpha') ? 1 : 0);
@ -2592,15 +2590,15 @@ elseif ($id || $ref)
}
}
// Cancel
// Cancel
if ($object->statut == Expedition::STATUS_VALIDATED)
{
{
if ($user->rights->expedition->supprimer)
{
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=cancel">'.$langs->trans("Cancel").'</a>';
}
}
// Delete
if ($user->rights->expedition->supprimer)
{

View File

@ -180,7 +180,7 @@ class Expedition extends CommonObject
* Canceled status
*/
const STATUS_CANCELED = -1;
/**
* Constructor
@ -1170,7 +1170,7 @@ class Expedition extends CommonObject
}
}
/**
* Cancel shipment.
*
@ -1291,7 +1291,7 @@ class Expedition extends CommonObject
}
}
if (!$error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."expeditiondet";
@ -1388,9 +1388,8 @@ class Expedition extends CommonObject
$this->db->rollback();
return -1;
}
}
/**
* Delete shipment.
* Warning, do not delete a shipment if a delivery is linked to (with table llx_element_element)