diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index c2649e5f8df..14ef8738b73 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -1453,7 +1453,6 @@ else if ($id || $ref)
// Batch number managment
if (! empty($conf->productbatch->enabled)) {
if (isset($lines[$i]->detail_batch) ) {
- $flagBatch = true;
print '
';
$detail = '';
foreach ($lines[$i]->detail_batch as $dbatch) {
@@ -1543,14 +1542,7 @@ else if ($id || $ref)
if ($user->rights->expedition->supprimer)
{
- if (empty($conf->productbatch->enabled) || (!empty($conf->productbatch->enabled) && !$conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !isset($flagBatch))
- {
- print 'id.'&action=delete">'.$langs->trans("Delete").'';
- }
- else
- {
- print ''.$langs->trans('Delete').'';
- }
+ print 'id.'&action=delete">'.$langs->trans("Delete").'';
}
print '';
diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php
index 019ef22f769..898a65a05b8 100644
--- a/htdocs/expedition/class/expedition.class.php
+++ b/htdocs/expedition/class/expedition.class.php
@@ -588,10 +588,9 @@ class Expedition extends CommonObject
$cpt = $this->db->num_rows($resql);
for ($i = 0; $i < $cpt; $i++)
{
- if($obj->qty <= 0) continue;
-
- dol_syslog(get_class($this)."::valid movement index ".$i);
$obj = $this->db->fetch_object($resql);
+ if($obj->qty <= 0) continue;
+ dol_syslog(get_class($this)."::valid movement index ".$i);
//var_dump($this->lines[$i]);
$mouvS = new MouvementStock($this->db);
|