Add/view on F4 in supplier selector.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 18 Sep 2008 19:45:59 +0000 (19:45 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 18 Sep 2008 19:45:59 +0000 (19:45 +0000)
inventory/purchasing_data.php
purchasing/allocations/supplier_allocation_main.php
purchasing/manage/suppliers.php
purchasing/supplier_credit.php
purchasing/supplier_invoice.php
purchasing/supplier_payment.php

index 292055bea90bcf929e95caa6daea4bb7e3b1ad06..3e2f77b6733feb1fccc7aa9d7a7e642f1e68abd5 100644 (file)
@@ -13,6 +13,16 @@ include_once($path_to_root . "/includes/data_checks.inc");
 check_db_has_purchasable_items(_("There are no purchasable inventory items defined in the system."));
 check_db_has_suppliers(_("There are no suppliers defined in the system."));
 
+//----------------------------------------------------------------------------------------
+if ($ret = context_restore()) {
+       if(isset($ret['supplier_id']))
+               $_POST['supplier_id'] = $ret['supplier_id'];
+}
+if (isset($_POST['_supplier_id_editor'])) {
+       context_call($path_to_root.'/purchasing/manage/suppliers.php?supplier_id='.$_POST['supplier_id'], 
+               array( 'supplier_id', 'stock_id','_stock_id_edit', 'price', 
+                       'suppliers_uom', 'supplier_description','conversion_factor'));
+}
 simple_page_mode(true);
 //--------------------------------------------------------------------------------------------------
 
index 55e32abb14809ffb99b55c6f06392e8cb9bc874c..7f63cb6f33aa14c766a4335f46162d7b3d0c8877 100644 (file)
@@ -15,6 +15,15 @@ if ($use_popup_windows)
        $js .= get_js_open_window(900, 500);
 page(_("Supplier Allocations"), false, false, "", $js);
 
+//--------------------------------------------------------------------------------
+if ($ret = context_restore()) {
+       if(isset($ret['supplier_id']))
+               $_POST['supplier_id'] = $ret['supplier_id'];
+}
+if (isset($_POST['_supplier_id_editor'])) {
+       context_call($path_to_root.'/purchasing/manage/suppliers.php?supplier_id='.$_POST['supplier_id'] );
+}
+
 //--------------------------------------------------------------------------------
 
 function display_allocatable_transactions()
index 5ab0ea8f00b19c54d4f2616dc9661a63f4ac712a..3ac981fec411176331a9ca63434ff2a3d0a7c234 100644 (file)
@@ -12,6 +12,10 @@ include($path_to_root . "/includes/ui.inc");
 
 check_db_has_tax_groups(_("There are no tax groups defined in the system. At least one tax group is required before proceeding."));
 
+if (isset($_GET['supplier_id'])) 
+{
+       $_POST['supplier_id'] = $_GET['supplier_id'];
+}
 $new_supplier = get_post('supplier_id') == ''; 
 
 if (isset($_POST['submit'])) 
@@ -120,6 +124,10 @@ elseif (isset($_POST['delete']) && $_POST['delete'] != "")
                $Ajax->activate('_page_body');
        } //end if Delete supplier
 }
+elseif (isset($_POST['select']))
+{
+       context_return(array('supplier_id' => $_POST['supplier_id']));
+}
 
 start_form();
 
@@ -225,6 +233,7 @@ if (!$new_supplier)
 {
        submit_center_first('submit', _("Update Supplier"), 
          _('Update supplier data'), true);
+       submit_return('select', _("Return"), _("Select this supplier and return to document entry."), true);
        submit_center_last('delete', _("Delete Supplier"), 
          _('Delete supplier data if have been never used'), true);
 }
index 5729fcf53cd1bae720106b0304803b10b9eb9a7c..3f7e8ee7b47e289502926d74ad6951a11a93b987 100644 (file)
@@ -23,6 +23,18 @@ page(_("Supplier Credit Note"), 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'])) 
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'])) 
index a6021942a523975aa107234d56c3aa7e386e88a2..c731c491493581e7ed2eef3d114e1c0472d749ae 100644 (file)
@@ -31,6 +31,16 @@ check_db_has_bank_accounts(_("There are no bank accounts defined in the system."
 
 check_db_has_bank_trans_types(_("There are no bank payment types defined in the system."));
 
+//----------------------------------------------------------------------------------------
+if ($ret = context_restore()) {
+       if(isset($ret['supplier_id']))
+               $_POST['supplier_id'] = $ret['supplier_id'];
+}
+if (isset($_POST['_supplier_id_editor'])) {
+       context_call($path_to_root.'/purchasing/manage/suppliers.php?supplier_id='.$_POST['supplier_id'], 
+               array( 'supplier_id', 'bank_account', 'DatePaid', 
+                       'PaymentType', 'ref', 'amount', 'discount', 'memo_') );
+}
 //----------------------------------------------------------------------------------------
 
 if (isset($_GET['AddedID']))