X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fui%2Fui_lists.inc;h=24939a1a0326c0f5e529ef0d5958ece20fcd974b;hb=50606312fee0bb0dbe984e2c08af53b7dab229bd;hp=cae9efbc5f16a34b74f1827e7f395965d515e3a7;hpb=a773a23cfa8bdb30986665986ea97ebdfb3d2696;p=fa-stable.git
diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc
index cae9efbc..24939a1a 100644
--- a/includes/ui/ui_lists.inc
+++ b/includes/ui/ui_lists.inc
@@ -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 "
";
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 " | \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 "$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";
}
@@ -2325,4 +2331,82 @@ function coa_list_row($label, $name, $value=null)
echo array_selector( $name, $value, $coas );
echo "\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 "$label | \n";
+ echo "";
+ echo tax_algorithm_list($name, $value, $submit_on_change);
+ echo " | \n";
+}
+
+function tax_algorithm_list_row($label, $name, $value=null, $submit_on_change=false)
+{
+ echo "$label | ";
+ tax_algorithm_list_cells(null, $name, $value, $submit_on_change);
+ echo "
\n";
+}
+//----------------------------------------------------------------------------------------------
+
+function subledger_list($name, $account, $selected_id=null)
+{
+ global $all_items;
+
+ $type = is_subledger_account($account);
+ if (!$type)
+ return '';
+
+ if($type > 0)
+ $sql = "SELECT DISTINCT d.debtor_no as id, debtor_ref as name
+ FROM "
+ .TB_PREF."debtors_master d,"
+ .TB_PREF."cust_branch c
+ WHERE d.debtor_no=c.debtor_no AND c.receivables_account=".db_escape($account);
+ else
+ $sql = "SELECT supplier_id as id, supp_ref as name
+ FROM "
+ .TB_PREF."suppliers s
+ WHERE s.payable_account=".db_escape($account);
+
+ $mode = get_company_pref('no_customer_list');
+
+ return combo_input($name, $selected_id, $sql, 'id', 'name',
+ array(
+ 'type' => 1,
+ 'size' => 20,
+ 'async' => false,
+ ) );
+}
+
+function subledger_list_cells($label, $name, $account, $selected_id=null)
+{
+ if ($label != null)
+ echo "$label | \n";
+ echo "";
+ echo subledger_list($name, $account, $selected_id);
+ echo " | \n";
+}
+
+function subledger_list_row($label, $name, $selected_id=null, $all_option = false,
+ $submit_on_change=false, $show_inactive=false, $editkey = false)
+{
+ echo "$label | ";
+ echo subledger_list($name, $account, $selected_id);
+ echo " | \n
\n";
+}
+
+
?>
\ No newline at end of file