From 5b8ee3cb748382ab5a2665a620183f08c8ba204b Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Thu, 18 Sep 2008 19:45:59 +0000 Subject: [PATCH] Add/view on F4 in supplier selector. --- inventory/purchasing_data.php | 10 ++++++++++ purchasing/allocations/supplier_allocation_main.php | 9 +++++++++ purchasing/manage/suppliers.php | 9 +++++++++ purchasing/supplier_credit.php | 12 ++++++++++++ purchasing/supplier_invoice.php | 12 ++++++++++++ purchasing/supplier_payment.php | 10 ++++++++++ 6 files changed, 62 insertions(+) diff --git a/inventory/purchasing_data.php b/inventory/purchasing_data.php index 292055be..3e2f77b6 100644 --- a/inventory/purchasing_data.php +++ b/inventory/purchasing_data.php @@ -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); //-------------------------------------------------------------------------------------------------- diff --git a/purchasing/allocations/supplier_allocation_main.php b/purchasing/allocations/supplier_allocation_main.php index 55e32abb..7f63cb6f 100644 --- a/purchasing/allocations/supplier_allocation_main.php +++ b/purchasing/allocations/supplier_allocation_main.php @@ -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() diff --git a/purchasing/manage/suppliers.php b/purchasing/manage/suppliers.php index 5ab0ea8f..3ac981fe 100644 --- a/purchasing/manage/suppliers.php +++ b/purchasing/manage/suppliers.php @@ -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); } diff --git a/purchasing/supplier_credit.php b/purchasing/supplier_credit.php index 5729fcf5..3f7e8ee7 100644 --- a/purchasing/supplier_credit.php +++ b/purchasing/supplier_credit.php @@ -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'])) diff --git a/purchasing/supplier_invoice.php b/purchasing/supplier_invoice.php index 07b41b28..24aff075 100644 --- a/purchasing/supplier_invoice.php +++ b/purchasing/supplier_invoice.php @@ -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'])) diff --git a/purchasing/supplier_payment.php b/purchasing/supplier_payment.php index a6021942..c731c491 100644 --- a/purchasing/supplier_payment.php +++ b/purchasing/supplier_payment.php @@ -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'])) -- 2.30.2