<?php
if(empty($$class->demand_type)){
 $$class->demand_type = 'SALES_ORDER';
}
if(empty($$class->supply_type)){
 $$class->supply_type = 'ONHAND';
}

if(!empty($$class->item_id_m)){
 $item_i = item::find_by_item_id_m($$class->item_id_m);
 $$class->item_number  = $item_i->item_number;
 $$class->item_description  = $item_i->item_description;
}

if(!empty($$class->sd_so_line_id)){
 $so_details = sd_so_all_v::find_by_soLineId($$class->sd_so_line_id);
// pa($so_details);
 $$class->so_number  = $so_details->so_number;
 $$class->so_line_number  = $so_details->line_number;
}

if(!empty($$class->onhand_id)){
 $onhand_i = onhand_v::find_by_id($$class->onhand_id);
 $$class->onhand  = $onhand_i->onhand;
 $$class->reservable_onhand  = $onhand_i->reservable_onhand;
}

?>