Added system tale for transaction edition entry points.
[fa-stable.git] / includes / ui / ui_lists.inc
index cae9efbc5f16a34b74f1827e7f395965d515e3a7..0fde17de1c1a5ec20e6bdbc4bb3c43dce8890254 100644 (file)
@@ -1407,8 +1407,10 @@ function bank_accounts_list_row($label, $name, $selected_id=null, $submit_on_cha
 }
 //-----------------------------------------------------------------------------------------------
 
-function cash_accounts_list_row($label, $name, $selected_id=null, $submit_on_change=false)
+function cash_accounts_list_row($label, $name, $selected_id=null, $submit_on_change=false, $all_option=false)
 {
+       global $all_items;
+
        $sql = "SELECT ".TB_PREF."bank_accounts.id, bank_account_name, bank_curr_code, inactive
                FROM ".TB_PREF."bank_accounts
                WHERE ".TB_PREF."bank_accounts.account_type=".BT_CASH;
@@ -1418,6 +1420,8 @@ function cash_accounts_list_row($label, $name, $selected_id=null, $submit_on_cha
        echo "<td>";
        echo combo_input($name, $selected_id, $sql, 'id', 'bank_account_name',
        array(
+               'spec_option' => $all_option,
+               'spec_id' => $all_items,
                'format' => '_format_add_curr',
                'select_submit'=> $submit_on_change,
                'async' => true
@@ -1835,11 +1839,13 @@ function pagesizes_list_row($label, $name, $value=null)
        echo "</td></tr>\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 +1855,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 "<td>$label</td>\n";
        echo "<td>";
-       echo systypes_list($name, $value, false, $submit_on_change);
+       echo systypes_list($name, $value, false, $submit_on_change, $exclude);
        echo "</td>\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 "<tr><td class='label'>$label</td>";
-       systypes_list_cells(null, $name, $value, $submit_on_change);
+       systypes_list_cells(null, $name, $value, $submit_on_change, $exclude);
        echo "</tr>\n";
 }
 
@@ -2325,4 +2331,32 @@ function coa_list_row($label, $name, $value=null)
        echo array_selector( $name, $value, $coas );
        echo "</td></tr>\n";
 }
+
+function tax_algorithm_list($name, $value=null, $submit_on_change = false)
+{
+       global $tax_algorithms;
+       
+       return array_selector($name, $value, $tax_algorithms, 
+               array( 
+                       'select_submit'=> $submit_on_change,
+                       'async' => true,
+                       )
+       );
+}
+
+function tax_algorithm_list_cells($label, $name, $value=null, $submit_on_change=false)
+{
+       if ($label != null)
+               echo "<td>$label</td>\n";
+       echo "<td>";
+       echo tax_algorithm_list($name, $value, $submit_on_change);
+       echo "</td>\n";
+}
+
+function tax_algorithm_list_row($label, $name, $value=null, $submit_on_change=false)
+{
+       echo "<tr><td class='label'>$label</td>";
+       tax_algorithm_list_cells(null, $name, $value, $submit_on_change);
+       echo "</tr>\n";
+}
 ?>
\ No newline at end of file