X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fpo_entry_items.php;h=22f383819b0f0ab0980f6a23b11fa808df88032d;hb=2758ae02d6477d7e6df35f19f44fb08e38900f50;hp=4362ea1658c312709ee252064abde0661538a170;hpb=e9ad9e87f5eb2682d2e91c93134250fd8a8d2ad9;p=fa-stable.git diff --git a/purchasing/po_entry_items.php b/purchasing/po_entry_items.php index 4362ea16..22f38381 100644 --- a/purchasing/po_entry_items.php +++ b/purchasing/po_entry_items.php @@ -53,9 +53,14 @@ if (isset($_GET['ModifyOrderNumber']) && is_numeric($_GET['ModifyOrderNumber'])) copy_from_cart(); } elseif (isset($_GET['NewInvoice'])) { - $_SESSION['page_title'] = _($help_context = "Direct Purchase Invoice Entry"); create_new_po(ST_SUPPINVOICE, 0); copy_from_cart(); + + if (isset($_GET['FixedAsset'])) { + $_SESSION['page_title'] = _($help_context = "Fixed Asset Purchase Invoice Entry"); + $_SESSION['PO']->fixed_asset = true; + } else + $_SESSION['page_title'] = _($help_context = "Direct Purchase Invoice Entry"); } page($_SESSION['page_title'], false, false, "", $js); @@ -67,8 +72,6 @@ if (isset($_GET['ModifyOrderNumber'])) check_db_has_suppliers(_("There are no suppliers defined in the system.")); -check_db_has_purchasable_items(_("There are no purchasable inventory items defined in the system.")); - //--------------------------------------------------------------------------------------------------------------- if (isset($_GET['AddedID'])) @@ -88,6 +91,7 @@ if (isset($_GET['AddedID'])) hyperlink_params($path_to_root . "/purchasing/po_receive_items.php", _("&Receive Items on this Purchase Order"), "PONumber=$order_no"); + // TODO, for fixed asset hyperlink_params($_SERVER['PHP_SELF'], _("Enter &Another Purchase Order"), "NewOrder=yes"); hyperlink_no_params($path_to_root."/purchasing/inquiry/po_search.php", _("Select An &Outstanding Purchase Order")); @@ -138,6 +142,11 @@ if (isset($_GET['AddedID'])) display_footer_exit(); } + +if ($_SESSION['PO']->fixed_asset) + check_db_has_purchasable_fixed_assets(_("There are no purchasable fixed assets defined in the system.")); +else + check_db_has_purchasable_items(_("There are no purchasable inventory items defined in the system.")); //-------------------------------------------------------------------------------------------------- function line_start_focus() { @@ -185,13 +194,18 @@ function handle_cancel_po() . "
" . _("The line item quantities may be modified to quantities more than already received. prices cannot be altered for lines that have already been received and quantities cannot be reduced below the quantity already received.")); return; } - + + $fixed_asset = $_SESSION['PO']->fixed_asset; + if($_SESSION['PO']->order_no != 0) - { delete_po($_SESSION['PO']->order_no); - } else { + else { unset($_SESSION['PO']); - meta_forward($path_to_root.'/index.php','application=AP'); + + if ($fixed_asset) + meta_forward($path_to_root.'/index.php','application=assets'); + else + meta_forward($path_to_root.'/index.php','application=AP'); } $_SESSION['PO']->clear_items(); @@ -350,8 +364,6 @@ function can_commit() { if (!check_reference(get_post('ref'), $_SESSION['PO']->trans_type)) { - _vd("bad reference"); - exit; set_focus('ref'); return false; }