Print Deliveries: Fixed not working print as packing slip option.
[fa-stable.git] / purchasing / po_entry_items.php
index 17e123f9c6f891a54bd3c4e85e134d686de29792..4a5aa39dea106fac0d1171781303a6f8ecc8066e 100644 (file)
@@ -133,6 +133,9 @@ if (isset($_GET['AddedID']))
 
        display_note(get_gl_view_str($trans_type, $trans_no, _("View the GL Journal Entries for this Invoice")), 1);
 
+       hyperlink_params("$path_to_root/purchasing/supplier_payment.php", _("Entry supplier &payment for this invoice"),
+               "trans_type=$trans_type&PInvoice=".$trans_no);
+
        hyperlink_params("$path_to_root/admin/attachments.php", _("Add an Attachment"), 
                "filterType=$trans_type&trans_no=$trans_no");
 
@@ -353,22 +356,14 @@ function can_commit()
 
        if (!$_SESSION['PO']->order_no) 
        {
-       if (!$Refs->is_valid(get_post('ref'))) 
+       if (!check_reference(get_post('ref'), $_SESSION['PO']->trans_type))
        {
-               display_error(_("There is no reference entered for this purchase order."));
-                       set_focus('ref');
-               return false;
-       } 
-
-       if (!is_new_reference(get_post('ref'), $_SESSION['PO']->trans_type)) 
-       {
-               display_error(_("The entered reference is already in use."));
                        set_focus('ref');
                return false;
        }
        }
 
-       if ($_SESSION['PO']->trans_type == ST_SUPPINVOICE && !$Refs->is_valid(get_post('supp_ref'))) 
+       if ($_SESSION['PO']->trans_type == ST_SUPPINVOICE && trim(get_post('supp_ref')) == false)
        {
                display_error(_("You must enter a supplier's invoice reference."));
                set_focus('supp_ref');
@@ -437,6 +432,11 @@ function handle_commit_order()
        }
 }
 //---------------------------------------------------------------------------------------------------
+if (isset($_POST['update'])) {
+       copy_to_cart();
+       $Ajax->activate('items_table');
+}
+
 $id = find_submit('Delete');
 if ($id != -1)
        handle_delete_item($id);