$content .= '<tr><td>Today</td><td>=</td><td class="w080">KW ' . $kw_now . '</td></tr>';
$content .= '<tr><td colspan="3" class="bold">Graph is using product level forecasting (not article level)</td></tr>';
$content .= '</table></div>';
$content .= '</div>';
$content .= '<div style="clear:both;padding-top:20px;">';
$content .= '<h2>Depot Refill using Forecast';
if ($articles_id != '*' && count($p->articles) > 0) {
    $content .= ' <span id="txt-show-all-articles" class="pointer blue smallText">&laquo;show all articles&raquo;</span>';
}
$content .= '</h2>';
foreach ($p->articles as $aid => $a) {
    $a_title = $a['length'] > 0 ? textLength($a['length']) : '<span class="notice">No Length</span>';
    $daily_sold = $p->log_articles[$aid][Product::FORECAST_DAILY_COLUMN_NAME];
    $stock_target = $p->getDIOHstockTarget($aid);
    $stock_available = $p->retrieveStockQuantity($aid);
    $stock_available_dioh = $p->displayDIOH($aid, $stock_available);
    $refill_ordered = $p->retrieveRefillQuantity($aid);
    $missing_qty = $stock_target - ($stock_available + $refill_ordered);
    if ($missing_qty < 0) {
        $missing_qty = 0;
    }
    $show_box = $articles_id == '*' || $articles_id == $aid ? '' : 'display:none;';
    $content .= '<div class="float-box w300 ui-corner-all" style="padding:5px;margin:0 10px 10px 0;' . $show_box . '"><table border="0" cellspacing="0" cellpadding="0">';
    $content .= '<tr><td colspan="3" class="bold">EAN ' . $a['products_ean'] . ' - ' . $a_title . '</td></tr>';
    $content .= '<tr><td>Daily Average <span class="red" title="' . $forecasting_conf['promotion-orders-desc'] . '">(!)</span></td><td>=</td><td>' . $daily_sold . '</td></tr>';
    $content .= '<tr><td title="Stock Target based on DIOH Target Settings">Stock Target (' . Product::$diohStopLevel[$p->stars] . ' days)</td><td>=</td><td>' . $stock_target . '</td></tr>';
    $content .= '<tr><td>Stock Available</td><td>=</td><td>' . $stock_available . '&nbsp;<span class="notice">(' . $stock_available_dioh . ')</span></td></tr>';
    $content .= '<tr><td>Refill Ordered</td><td>=</td><td>' . $refill_ordered . '</td></tr>';
    $content .= '<tr><td class="bold">Missing Quantity</td><td class="bold">=</td><td class="bold">' . $missing_qty . '</td></tr>';
    $content .= '</table></div>';
}
 $pid = $row['products_id'];
 $aid = $row['products_articles_id'];
 $is_best_product = $row['status'] == '1';
 $stock = $row['stock'] - $row['booking_active'];
 $stock_and_orders = $stock + $row['ordered'];
 if ($stock < 0) {
     $stock = 0;
 }
 if (!isset($p) || !is_object($p) || $p->id != $pid) {
     $p = new Product($pid);
     $is_in_ltf_col = $p->isLevellingProduct();
 }
 $image_html = $p->displayImage(IMAGE_SIZE_THUMBNAIL_1, IMAGE_SIZE_THUMBNAIL_1);
 $dioh = $p->getDIOH($aid, $stock);
 $dioh2 = $p->getDIOH($aid, $stock + $row['ordered']);
 $dioh_text = $p->displayDIOH($aid, $stock);
 $dioh2_text = $p->displayDIOH($aid, $stock_and_orders);
 $target = $p->getDIOHstockTarget($aid);
 $target_levelling = $p->getLevellingTarget($aid);
 $target_after_levelling = $p->getDIOHstockTargetAfterLevelling($aid);
 $missing = $target - $stock_and_orders;
 if ($missing < 0) {
     $missing = 0;
 }
 $missing_no_refill = $target - $stock;
 if ($missing_no_refill < 0) {
     $missing_no_refill = 0;
 }
 $missing_after_levelling = $target_after_levelling - $stock_and_orders;
 if ($missing_after_levelling < 0) {
     $missing_after_levelling = 0;