<?php

 global $f;
 if (!empty($$class->po_requisition_header_id)) {
  foreach ($po_requisition_line_object as &$po_requisition_lines) {
   if (!empty($po_requisition_lines->item_id_m)) {
    $item = item::find_by_id($po_requisition_lines->item_id_m);
    $po_requisition_lines->item_number = $item->item_number;
   }
  }
 }
?>

<?php

//asign values of fields on form but not in databse only if $$class->$primary_cloumn is not nul
 if (!empty($$class->po_requisition_header_id)) {

  if (!empty($$class->po_requisition_header_id) && !empty($$class->supplier_id)) {
   $supplier_details = supplier::find_by_id($$class->supplier_id);
   $$class->supplier_name = $supplier_details->supplier_name;
   $$class->supplier_number = !empty($supplier_details->supplier_number) ? $supplier_details->supplier_number : null;
  }

 }
 $action_readonly = in_array($$class->requisition_status,array('CLOSED','INPROCESS','')) ? 1 : '';
 
     if ((is_object($$class)) && empty($$class->requisition_status)) {
      $$class->requisition_status = 'ENTERED';
   }
?>

