X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fui%2Fui_lists.inc;h=68f67092fc50be9782661dcc99f405e7a1ee95dc;hb=3f3cfa578adbc2b71f4fd9c8d0f5536d26af43d8;hp=0240b9536c92882cc57294d77143ba8f77bd1fb9;hpb=c00e6c0f28b8924b088c26814cc303638e8d093a;p=fa-stable.git
diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc
index 0240b953..68f67092 100644
--- a/includes/ui/ui_lists.inc
+++ b/includes/ui/ui_lists.inc
@@ -443,7 +443,7 @@ function supplier_list($name, $selected_id=null, $spec_option=false, $submit_on_
if ($editkey)
set_editor('supplier', $name, $editkey);
-
+
$ret = combo_input($name, $selected_id, $sql, 'supplier_id', 'supp_name',
array(
'format' => '_format_add_curr',
@@ -529,7 +529,6 @@ function customer_list_cells($label, $name, $selected_id=null, $all_option=false
function customer_list_row($label, $name, $selected_id=null, $all_option = false,
$submit_on_change=false, $show_inactive=false, $editkey = false)
{
- global $path_to_root;
echo "
$label | ";
echo customer_list($name, $selected_id, $all_option, $submit_on_change,
@@ -563,7 +562,7 @@ function customer_branches_list($customer_id, $name, $selected_id=null,
if ($editkey)
{
$ret .= add_edit_combo('branch');
- }
+ }
return $ret;
}
//------------------------------------------------------------------------------------------------
@@ -709,7 +708,7 @@ $options = array(
if (!$showclosed)
$options['where'][] = "closed=0";
if($showtype)
- $options['where'][] = "type_=$showtype";
+ $options['where'][] = "type_=".db_escape($showtype);
return combo_input($name, $selected_id, $sql, 'id', 'ref', $options);
}
@@ -761,9 +760,8 @@ function stock_items_list($name, $selected_id=null, $all_option=false,
'order' => array('c.description','stock_id')
), $opts) );
if ($editkey)
- $ret .= add_edit_combo('item');
+ $ret .= add_edit_combo('item');
return $ret;
-
}
function _format_stock_items($row)
@@ -889,7 +887,7 @@ function stock_component_items_list($name, $parent_stock_id, $selected_id=null,
$all_option=false, $submit_on_change=false, $editkey = false)
{
return stock_items_list($name, $selected_id, $all_option, $submit_on_change,
- array('where'=>array("stock_id != '$parent_stock_id'")), $editkey);
+ array('where'=>array("stock_id != ".db_escape($parent_stock_id))), $editkey);
}
function stock_component_items_list_cells($label, $name, $parent_stock_id,
@@ -898,7 +896,7 @@ function stock_component_items_list_cells($label, $name, $parent_stock_id,
if ($label != null)
echo " | $label | \n";
echo stock_items_list($name, $selected_id, $all_option, $submit_on_change,
- array('where'=>array("stock_id != '$parent_stock_id'"), 'cells'=>true),
+ array('where'=>array("stock_id != ".db_escape($parent_stock_id)), 'cells'=>true),
$editkey);
}
//------------------------------------------------------------------------------------
@@ -1439,8 +1437,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;
@@ -1450,6 +1450,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
@@ -1482,14 +1484,16 @@ function pos_list_row($label, $name, $selected_id=null, $spec_option=false, $sub
//-----------------------------------------------------------------------------------------------
// Payment type selector for current user.
//
-function sale_payment_list($name, $category, $selected_id=null, $submit_on_change=true)
+function sale_payment_list($name, $category, $selected_id=null, $submit_on_change=true, $prepayments=true)
{
$sql = "SELECT terms_indicator, terms, inactive FROM ".TB_PREF."payment_terms";
-
+
if ($category == PM_CASH) // only cash
$sql .= " WHERE days_before_due=0 AND day_in_following_month=0";
- if ($category == PM_CREDIT) // only delayed payments
- $sql .= " WHERE days_before_due!=0 OR day_in_following_month!=0";
+ elseif ($category == PM_CREDIT) // only delayed payments
+ $sql .= " WHERE days_before_due".($prepayments ? '!=': '>')."0 OR day_in_following_month!=0";
+ elseif (!$prepayments)
+ $sql .= " WHERE days_before_due>=0";
return combo_input($name, $selected_id, $sql, 'terms_indicator', 'terms',
array(
@@ -1499,13 +1503,13 @@ function sale_payment_list($name, $category, $selected_id=null, $submit_on_chang
}
-function sale_payment_list_cells($label, $name, $category, $selected_id=null, $submit_on_change=true)
+function sale_payment_list_cells($label, $name, $category, $selected_id=null, $submit_on_change=true, $prepayments=true)
{
if ($label != null)
echo " | $label | \n";
echo "";
- echo sale_payment_list($name, $category, $selected_id, $submit_on_change);
+ echo sale_payment_list($name, $category, $selected_id, $submit_on_change, $prepayments);
echo " | \n";
}
@@ -2372,4 +2376,78 @@ function payment_services($name)
));
}
-?>
+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 "