if ($adj_only)
{
- if ($qoh > 0)
+ if ($qoh > .0000000001) // avoid very small values
$material_cost = ($qoh * $material_cost + $qty * $price_in_home_currency) / $qoh;
}
else
$cost_adjust = true;
$qoh = 0;
}
- if ($qoh + $qty > 0)
+ if ($qoh + $qty > .0000000001) // avoid very small values
$material_cost = ($qoh * $material_cost + $qty * $price_in_home_currency) / ($qoh + $qty);
}