return false;
}
} elseif ($_SESSION['alloc']->person_type == PT_SUPPLIER) {
- $trans = get_supp_trans($_SESSION['alloc']->allocs[$counter]->type_no, $_SESSION['alloc']->allocs[$counter]->type);
+ if ($_SESSION['alloc']->allocs[$counter]->type == ST_PURCHORDER)
+ $trans = get_po($_SESSION['alloc']->allocs[$counter]->type_no);
+ else
+ $trans = get_supp_trans($_SESSION['alloc']->allocs[$counter]->type_no, $_SESSION['alloc']->allocs[$counter]->type);
if ($trans['supplier_id'] != $_SESSION['alloc']->person_id) {
display_error(_("Allocated transaction allocated is not related to company selected."));
set_focus('amount'.$counter);
//----------------------------------------------------------------------------------------
+function get_po($order_no) {
+ $sql = "SELECT * FROM ".TB_PREF."purch_orders WHERE order_no = ".db_escape($order_no);
+ $result = db_query($sql);
+
+ return db_fetch($result);
+}
+
+//----------------------------------------------------------------------------------------
+
function read_po_header($order_no, &$order)
{
$sql = "SELECT po.*, supplier.*, loc.location_name