Merge pull request #1942 from fappels/develop

Fix increase stock on shipment validation
This commit is contained in:
Laurent Destailleur 2014-10-12 01:36:22 +02:00
commit 5a8f625ff1
2 changed files with 3 additions and 12 deletions

View File

@ -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 '<td align="center">';
$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 '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans("Delete").'</a>';
}
else
{
print '<a class="butActionRefused" href="#">'.$langs->trans('Delete').'</a>';
}
print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&amp;action=delete">'.$langs->trans("Delete").'</a>';
}
print '</div>';

View File

@ -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);