Example #1
0
$class_do = new depot_orders();
use_class('products_minierp');
$class_pm = new products_minierp();
use_class('products_articles');
$class_pa = new products_articles();
$whid_material = '1';
//1 is default warehuse for elements
$whid_fg_hh = '5';
//5 is default warehouse for depot in HH
$order_id = tep_db_prepare_input($_GET['id']);
if (isset($_POST['me_action'])) {
    if ($_POST['me_action'] == 'SETSTATUS') {
        $newstatus = tep_db_prepare_input($_POST['newstatus']);
        $class_do->updateStatus($order_id, $newstatus, $session_userinfo['username']);
        if ($newstatus == '1') {
            $class_do->updateStockStatus($order_id, '0');
        }
        $newstatus_msg['1'] = 'Order is set back as <strong>' . statusName('1') . '<strong>!';
        $newstatus_msg['8'] = 'Order is set as <strong>' . statusName('8') . '<strong>!';
        $newstatus_msg['10'] = 'Order is <strong>Canceled<strong>!';
        $messagebox->add($newstatus_msg[$newstatus], 'green');
        if ($newstatus == '1' || $newstatus == '10') {
            $subject = 'MISSING PRODUCT!';
            $message = 'A Product from Depot Order has been reported missing (sent to HH but never receive): ';
            $message .= '<a href="http://manobo.de/?open=depot-order&amp;id=' . $order_id . '">DP-' . $order_id . '</a>';
        } elseif ($newstatus == '8') {
            $subject = 'MANUAL SET STATUS!';
            $message = 'A Product from Depot Order has been set manually as received in HH by ' . $session_userinfo['username'] . ': ';
            $message .= '<a href="http://manobo.de/?open=depot-order&amp;id=' . $order_id . '">DP-' . $order_id . '</a>';
        }
        if ($subject != '' && $message != '') {