Merge pull request #1942 from fappels/develop
Fix increase stock on shipment validation
This commit is contained in:
commit
5a8f625ff1
@ -1453,7 +1453,6 @@ else if ($id || $ref)
|
|||||||
// Batch number managment
|
// Batch number managment
|
||||||
if (! empty($conf->productbatch->enabled)) {
|
if (! empty($conf->productbatch->enabled)) {
|
||||||
if (isset($lines[$i]->detail_batch) ) {
|
if (isset($lines[$i]->detail_batch) ) {
|
||||||
$flagBatch = true;
|
|
||||||
print '<td align="center">';
|
print '<td align="center">';
|
||||||
$detail = '';
|
$detail = '';
|
||||||
foreach ($lines[$i]->detail_batch as $dbatch) {
|
foreach ($lines[$i]->detail_batch as $dbatch) {
|
||||||
@ -1542,16 +1541,9 @@ else if ($id || $ref)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($user->rights->expedition->supprimer)
|
if ($user->rights->expedition->supprimer)
|
||||||
{
|
|
||||||
if (empty($conf->productbatch->enabled) || (!empty($conf->productbatch->enabled) && !$conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !isset($flagBatch))
|
|
||||||
{
|
{
|
||||||
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete">'.$langs->trans("Delete").'</a>';
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<a class="butActionRefused" href="#">'.$langs->trans('Delete').'</a>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print "<br>\n";
|
print "<br>\n";
|
||||||
|
|||||||
@ -588,10 +588,9 @@ class Expedition extends CommonObject
|
|||||||
$cpt = $this->db->num_rows($resql);
|
$cpt = $this->db->num_rows($resql);
|
||||||
for ($i = 0; $i < $cpt; $i++)
|
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);
|
$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]);
|
//var_dump($this->lines[$i]);
|
||||||
$mouvS = new MouvementStock($this->db);
|
$mouvS = new MouvementStock($this->db);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user