From 8c53d0da3b76093996c3c08fced35c7bd7aa3c07 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Wed, 29 Dec 2010 15:07:04 +0000 Subject: [PATCH] Non-voidable transactions removed from selector on voiding page. --- CHANGELOG.txt | 3 +++ admin/void_transaction.php | 6 +++++- includes/ui/ui_lists.inc | 14 ++++++++------ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 21c7026..326d4f7 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -23,6 +23,9 @@ $ -> Affected files ! Hook files inclusion moved to session.inc $ /includes/hooks.inc /includes/session.inc +# Non-voidable transactions removed from selection on voiding page. +$ /admin/void_transaction.php + /includes/ui/ui_lists.inc 27-Dec-2010 Joe Hunt ! Prepared for category icons in applications/application.php for themes diff --git a/admin/void_transaction.php b/admin/void_transaction.php index 6066d3e..951a7f8 100644 --- a/admin/void_transaction.php +++ b/admin/void_transaction.php @@ -139,12 +139,16 @@ function ref_view($row) function voiding_controls() { global $selected_id; + + $not_implemented = array(ST_PURCHORDER, ST_SUPPRECEIVE, ST_SALESORDER, + ST_SALESQUOTE, ST_COSTUPDATE); + start_form(); start_table(TABLESTYLE_NOBORDER); start_row(); - systypes_list_cells(_("Transaction Type:"), 'filterType', null, true); + systypes_list_cells(_("Transaction Type:"), 'filterType', null, true, $not_implemented); if (list_updated('filterType')) $selected_id = -1; diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index cae9efb..14eb544 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -1835,11 +1835,13 @@ function pagesizes_list_row($label, $name, $value=null) echo "\n"; } -function systypes_list($name, $value=null, $spec_opt=false, $submit_on_change=false) +function systypes_list($name, $value=null, $spec_opt=false, $submit_on_change=false, $exclude=array()) { global $systypes_array; - return array_selector($name, $value, $systypes_array, + // emove non-voidable transactions if needed + $systypes = array_diff_key($systypes_array, array_flip($exclude)); + return array_selector($name, $value, $systypes, array( 'spec_option'=> $spec_opt, 'spec_id' => ALL_NUMERIC, @@ -1849,19 +1851,19 @@ function systypes_list($name, $value=null, $spec_opt=false, $submit_on_change=fa ); } -function systypes_list_cells($label, $name, $value=null, $submit_on_change=false) +function systypes_list_cells($label, $name, $value=null, $submit_on_change=false, $exclude=array()) { if ($label != null) echo "$label\n"; echo ""; - echo systypes_list($name, $value, false, $submit_on_change); + echo systypes_list($name, $value, false, $submit_on_change, $exclude); echo "\n"; } -function systypes_list_row($label, $name, $value=null, $submit_on_change=false) +function systypes_list_row($label, $name, $value=null, $submit_on_change=false, $exclude=array()) { echo "$label"; - systypes_list_cells(null, $name, $value, $submit_on_change); + systypes_list_cells(null, $name, $value, $submit_on_change, $exclude); echo "\n"; } -- 2.30.2