<?php

 $prl = new sys_profile_line();
 
 if($$class->rfq_type == 'BLANKET_RELEASE'){
  $$class = new po_rfq_header();
  $po_rfq_line_object = array(new po_rfq_line());
  $po_rfq_detail_object = array(new po_rfq_detail());
  $access_denied_msg = "<br>You cant open releases in this form. Use PO release form";
 }
 
 if (!empty($$class->po_rfq_header_id)) {
  foreach ($po_rfq_line_object as &$po_rfq_lines) {
   if (!empty($po_rfq_lines->item_id_m)) {
    $item = item::find_by_id($po_rfq_lines->item_id_m);
    $po_rfq_lines->item_number = $item->item_number;
   }
  }
 } else {
  $buyer = ino_user::find_by_user_name($session->username);
  if($buyer){
  $$class->buyer = $buyer->first_name . ' ' . $buyer->last_name;
  }
     if (empty($$class->po_rfq_status)) {
    $$class->po_rfq_status = 'ENTERED';
   }
 }

 if(!empty($$class->po_rfq_status) && ($$class->po_rfq_status == 'INPROCESS')){
  $readonly = 1 ; $mode = 2;
 }
 
 //Action values
 $action_readonly = in_array($$class->rfq_status,array('CLOSED','INPROCESS','')) ? 1 : '';
 if(empty($$class->po_rfq_header_id)){
  $$class->action_a = array(null);
 }
 
  if (empty($$class->rfq_type)) {
  $$class->rfq_type = 'STANDARD';
 }
?>