Allow reuse of references previously used on voided documents.
[fa-stable.git] / purchasing / po_entry_items.php
index 83923ccbaf09887ac24026c83c0368b3ee5f18f6..ed6308c953d613f746320154e8ea2e8073b46fc1 100644 (file)
@@ -14,6 +14,7 @@ $page_security = 'SA_PURCHASEORDER';
 include_once($path_to_root . "/purchasing/includes/po_class.inc");
 include_once($path_to_root . "/includes/session.inc");
 include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc");
+include_once($path_to_root . "/purchasing/includes/db/suppliers_db.inc");
 include_once($path_to_root . "/reporting/includes/reporting.inc");
 
 set_page_security( @$_SESSION['PO']->trans_type,
@@ -413,8 +414,7 @@ function handle_commit_order()
                        meta_forward($_SERVER['PHP_SELF'], "AddedGRN=$grn_no");
                        }
 //                     Direct Purchase Invoice
-                       $inv = new supp_trans;
-                       $inv->is_invoice = true;
+                       $inv = new supp_trans(ST_SUPPINVOICE);
                        $inv->Comments = $cart->Comments;
                        $inv->supplier_id = $cart->supplier_id;
                        $inv->tran_date = $cart->orig_order_date;