$segments_id = tep_db_prepare_input($_POST['segments_id']);
     $products_id = tep_db_prepare_input($_POST['params']['pid']);
     $articles_id = tep_db_prepare_input($_POST['params']['aid']);
     $products_ean = tep_db_prepare_input($_POST['params']['ean']);
     $qty_full = tep_db_prepare_input($_POST['params']['qty_full']);
     $qty_batch = tep_db_prepare_input($_POST['params']['qty_batch']);
     $suppliers_id = tep_db_prepare_input($_POST['params']['suppliers_id']);
     $price = tep_db_prepare_input($_POST['params']['price']);
     //handle when user use comma as decimal separator in price
     $price = str_replace(',', '.', $price);
     $price_cur = tep_db_prepare_input($_POST['params']['price_cur']);
     $total_qty_ordered = 0;
     $ids_created = array();
     while ($total_qty_ordered < $qty_full) {
         $order_qty = $total_qty_ordered + $qty_batch > $qty_full ? $qty_full - $total_qty_ordered : $qty_batch;
         $items_id = $class_do->newOrderOutsourced($segments_id, $products_id, $articles_id, $products_ean, $order_qty, $suppliers_id, $price, $price_cur, true);
         $total_qty_ordered += $order_qty;
         $ids_created[] = $items_id;
     }
     $ajaxResult = array();
     $ajaxResult['total_qty'] = $total_qty_ordered;
     $ajaxResult['total_orders'] = count($ids_created);
     $ajaxResult['ids_created'] = implode(',', $ids_created);
     ajaxReturn($ajaxResult);
     exit;
 } elseif ($_POST['me_action'] == 'CREATENRFINTERNALORDER') {
     $segments_id = tep_db_prepare_input($_POST['segments_id']);
     $products_id = tep_db_prepare_input($_POST['products_id']);
     $articles_id = tep_db_prepare_input($_POST['articles_id']);
     $products_ean = tep_db_prepare_input($_POST['products_ean']);
     $group_name = tep_db_prepare_input($_POST['group_name']);