$pocode = 'PO ' . $po_number . ' TPP   (' . $eo->detail['suppliers_name'] . ')';
} else {
    $print_topup = false;
    $items2print = $eo->items;
    $pocode = 'PO ' . $po_number . ' (' . $eo->detail['suppliers_name'] . ')';
}
if (count($items2print) == 0) {
    echo "<h1>No Last Received Bad Elements in this PO.<br />There's no need to print Top Up List</h1>";
    exit;
}
//exclude cancelled elements
$items2print_clean = array();
foreach ($items2print as $key => $e) {
    $elid = $e['elements_id'];
    if ($elid > 0) {
        if ($eo->elementIsCancelled($elid)) {
            continue;
        }
        $items2print_clean[$key] = $e;
    }
}
$items2print = $items2print_clean;
if ($mode == 'xls') {
    //EXCEL FORMAT for Kapitmas (save as html page and open with "Excel" directly)
    $header = array();
    $header['n'] = 'Nr|50';
    $header['i'] = 'Image|90';
    $header['d'] = 'ID|90';
    $header['c'] = 'Supplier Code|160';
    $header['w'] = 'Weight|90';
    $header['u'] = 'Order Unit|90';