Add/view on F4 in supplier selector.
[fa-stable.git] / purchasing / supplier_invoice.php
index 07b41b282fc1f991eb7c1aae436c6bb7cc12e5ab..24aff0759561ccbbad6fc1b57a5119ece3e2d2b2 100644 (file)
@@ -23,6 +23,18 @@ page(_("Enter Supplier Invoice"), false, false, "", $js);
 
 check_db_has_suppliers(_("There are no suppliers defined in the system."));
 
+//---------------------------------------------------------------------------------------------------------------
+if ($ret = context_restore()) {
+ // return from supplier editor
+       copy_from_trans($_SESSION['supp_trans']);
+       if(isset($ret['supplier_id']))
+               $_POST['supplier_id'] = $ret['supplier_id'];
+}
+if (isset($_POST['_supplier_id_editor'])) {
+       copy_to_trans($_SESSION['supp_trans']);
+       context_call($path_to_root.'/purchasing/manage/suppliers.php?supplier_id='.$_POST['supplier_id'], 'supp_trans');
+}
+
 //---------------------------------------------------------------------------------------------------------------
 
 if (isset($_GET['AddedID']))