<?php

if (empty($search_result) && !empty($_GET['search_class_name'])) {
 $inv_res = new inv_reservation();
 if (!empty($_GET['sd_so_line_id'])) {
 $inv_res->sd_so_line_id = is_array($_GET['sd_so_line_id']) ? $_GET['sd_so_line_id'][0] : $_GET['sd_so_line_id'];
 if (!empty($inv_res->sd_so_line_id)) {
  $so_details = sd_so_all_v::find_by_soLineId($inv_res->sd_so_line_id);
// pa($so_details);
  $inv_res->so_number = $so_details->so_number;
  $inv_res->so_line_number = $so_details->line_number;
  $inv_res->sd_so_header_id = $so_details->sd_so_header_id;
  $inv_res->demand_type = 'SALES_ORDER';
  $inv_res->uom_id =  $so_details->uom_id;
  $inv_res->need_by_date =  $so_details->schedule_ship_date;
  $inv_res->demand_quantity =  $so_details->line_quantity - $so_details->shipped_quantity;
  $inv_res->item_id_m = $so_details->item_id_m;
  $inv_res->org_id = $so_details->shipping_org_id;
  if (!empty($$class->item_id_m)) {
   $item_i = item::find_by_item_id_m($$class->item_id_m);
   $inv_res->item_number = $item_i->item_number;
   $inv_res->item_description = $item_i->item_description;
  }
 }
}
$search_result = [$inv_res];
}


?>