-page(_($help_context = "Receive Purchase Order Items"), false, false, "", $js);
+
+//--------------------------------------------------------------------------------------------------
+
+if (isset($_GET['PONumber']) && $_GET['PONumber'] > 0 && !isset($_POST['Update']))
+{
+ $_SESSION['page_title'] = _($help_context = "Receive Purchase Order Items");
+ create_cart(ST_PURCHORDER, $_GET['PONumber']);
+ $_SESSION['PO']->trans_type = ST_SUPPRECEIVE;
+ $_SESSION['PO']->reference = $Refs->get_next(ST_SUPPRECEIVE,
+ array('date' => Today(), 'supplier' => $_SESSION['PO']->supplier_id));
+ foreach ($_SESSION['PO']->line_items as $line)
+ $line->quantity = $line->qty_ordered - $line->qty_received;
+ copy_from_cart();
+}
+elseif (isset($_GET['ModifyGRN']) && $_GET['ModifyGRN'] > 0 && !isset($_POST['Update']))
+{
+ $_SESSION['page_title'] = _($help_context = "Modify GRN #") . $_GET['ModifyGRN'];
+ create_cart(ST_SUPPRECEIVE, $_GET['ModifyGRN']);
+ copy_from_cart();
+}
+
+page($_SESSION['page_title'], false, false, "", $js);