$package_id = tep_db_prepare_input($_GET['pid']);
    $orders_array = $class_mp->getOrders($package_id);
    $items_array = $class_mp->getProducts($package_id);
} elseif (isset($_GET['id']) && $_GET['id'] != '') {
    //	$invoice_id = tep_db_prepare_input($_GET['id']);
    //	$invoice = $class_mi->retrieveDetail($invoice_id);
    //	$orders_array = array($invoice['orders_id']);
    //
    $orders = tep_db_prepare_input($_GET['id']);
    $orders_array = explode(',', $orders);
} else {
    exit;
}
$order_counter = 0;
foreach ($orders_array as $order_id) {
    $pdf->AddPage();
    $order = $class_o->retrieveDetail($order_id, true);
    $items = $class_o->retrieveProducts($order_id, true);
    foreach ($items as $key => $item) {
        if ($class_o->productStatusIsCancelled($item['status'])) {
            unset($items[$key]);
        }
    }
    $print_delivery_note = false;
    $class_pi = new payone_invoice();
    //        echo "<pre>";var_dump($items);die();
    if (strtoupper($order['payment_method']) == strtoupper(PAYMENT_METHOD_BANK_TRANSFER)) {
        //Vorkasse
        $class_pi->createFromOrderJNG($order, $items, '+1 month');
    } elseif (strtoupper($order['payment_method']) == strtoupper(PAYMENT_METHOD_DIRECT_DEBIT)) {
        //Bankeinzug