Exemplo n.º 1
0
     $result .= printPackageTip('E', $box_date, $errinfo, $sp_name, $sp_class);
 } elseif ($item['status'] == $old_status || $item['status'] == $new_status || $is_transferred_from_real_order) {
     //If product status is finish or in package or order is transferred to dp
     if ($item['status'] == $old_status || $is_transferred_from_real_order) {
         //If product status is finish
         $order_date = strtotime($item['order_date']);
         $box_date = date('d. M', $order_date);
         //Retrieve all products from the order
         //No need for depot orders, only 1 product per order
         //FOR NOW WE ONLY USE PACKAGE FOR DEPOT ORDERS
         //FOR SEGMENT ID 1 (DEPOT HAMBURG)
         if ($item['segments_id'] == SEGMENT_ID_HAMBURG) {
             $packages = $class_do->packageUsable();
             if (count($packages) == 0) {
                 //If no usable package found for Depot, create 1
                 $package_id = $class_do->packageCreate($item['segments_id']);
             } else {
                 //If usable package found for Depot, use it
                 $package_id = $packages[0]['depot_packages_id'];
             }
             //Add product to package and update product status
             $class_do->packageInsert($package_id, $id);
             $class_do->updateStatus($id, $new_status, $session_userinfo['username']);
         } else {
             //FOR OTHER SEGMENT WE UPDATE
             //AUTOMATICALLY TO STATUS COMPLETE
             //TODO: WE NEED TO PROCEED PACKAGES FOR LOCALS WHEN NEEDED
             $class_do->updateStatus($id, '11', $session_userinfo['username']);
         }
     }
     //Check if it's a missing mixed orders