<?php
/**********************************************************************
Copyright (C) FrontAccounting, LLC.
- Released under the terms of the GNU Affero General Public License,
- AGPL, as published by the Free Software Foundation, either version
- 3 of the License, or (at your option) any later version.
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the License here <http://www.gnu.org/licenses/agpl-3.0.html>.
+ See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
***********************************************************************/
include_once($path_to_root . "/includes/banking.inc");
include_once($path_to_root . "/includes/reserved.inc");
function stock_item_types_list_row($label, $name, $selected_id=null, $enabled=true)
{
- $types = array(
- 'M' => _("Manufactured"),
- 'B' => _("Purchased"),
- 'D' => _("Service")
- );
+ global $stock_types;
echo "<tr>";
if ($label != null)
echo "<td>$label</td>\n";
echo "<td>";
- array_selector($name, $selected_id, $types,
+ array_selector($name, $selected_id, $stock_types,
array(
'select_submit'=> true,
'disabled' => !$enabled) );
//-----------------------------------------------------------------------------------------------
-function stock_categories_list($name, $selected_id=null)
+function stock_categories_list($name, $selected_id=null, $submit_on_change=false)
{
$sql = "SELECT category_id, description FROM ".TB_PREF."stock_category";
combo_input($name, $selected_id, $sql, 'category_id', 'description',
- array('order'=>'category_id'));
+ array('order'=>'category_id',
+ 'select_submit'=> $submit_on_change,
+ 'async' => true
+ ));
}
-function stock_categories_list_cells($label, $name, $selected_id=null)
+function stock_categories_list_cells($label, $name, $selected_id=null, $submit_on_change=false)
{
if ($label != null)
echo "<td>$label</td>\n";
echo "<td>";
- stock_categories_list($name, $selected_id);
+ stock_categories_list($name, $selected_id, $submit_on_change);
echo "</td>\n";
}
-function stock_categories_list_row($label, $name, $selected_id=null)
+function stock_categories_list_row($label, $name, $selected_id=null, $submit_on_change=false)
{
echo "<tr>\n";
- stock_categories_list_cells($label, $name, $selected_id);
+ stock_categories_list_cells($label, $name, $selected_id, $submit_on_change);
echo "</tr>\n";
}