foreach($opts['search'] as $i=> $s)
$opts['search'][$i] = $s . " LIKE "
.db_escape(($class=='combo3' ? '' : '%').$txt.'%');
foreach($opts['search'] as $i=> $s)
$opts['search'][$i] = $s . " LIKE "
.db_escape(($class=='combo3' ? '' : '%').$txt.'%');
// sql completion
if (count($opts['where'])) {
$where = strpos($sql, 'WHERE')==false ? ' WHERE ':' AND ';
// sql completion
if (count($opts['where'])) {
$where = strpos($sql, 'WHERE')==false ? ' WHERE ':' AND ';
$group_pos = strpos($sql, 'GROUP BY');
if ($group_pos) {
$group = substr($sql, $group_pos);
$group_pos = strpos($sql, 'GROUP BY');
if ($group_pos) {
$group = substr($sql, $group_pos);
$skip = strtolower($type) == "account" ? false : true;
$link = $path_to_root . "/gl/inquiry/accounts_list.php?popup=1&skip=".$skip."&client_id=" . $id;
$img_title = _("Search GL accounts");
$skip = strtolower($type) == "account" ? false : true;
$link = $path_to_root . "/gl/inquiry/accounts_list.php?popup=1&skip=".$skip."&client_id=" . $id;
$img_title = _("Search GL accounts");
if ($label != null)
echo "<td>$label</td>\n";
echo sales_items_list($name, $selected_id, $all_option, $submit_on_change,
if ($label != null)
echo "<td>$label</td>\n";
echo sales_items_list($name, $selected_id, $all_option, $submit_on_change,
}
function sales_kits_list($name, $selected_id=null, $all_option=false, $submit_on_change=false)
}
function sales_kits_list($name, $selected_id=null, $all_option=false, $submit_on_change=false)
( SELECT stock_id FROM ".TB_PREF."stock_moves WHERE (type=".ST_CUSTDELIVERY." OR type=".ST_INVADJUST.") AND qty!=0 )";
$year = get_current_fiscalyear();
( SELECT stock_id FROM ".TB_PREF."stock_moves WHERE (type=".ST_CUSTDELIVERY." OR type=".ST_INVADJUST.") AND qty!=0 )";
$year = get_current_fiscalyear();
- $y = date('Y', strtotime($year['end']));
+ $begin = date2sql(add_months(sql2date($year['begin']), -1));
+ $end = date2sql(add_months(sql2date($year['end']), -1));
- $where_opts[] = "depreciation_date < '".$y."-12-01'";
- $where_opts[] = "depreciation_date >= '".($y-1)."-12-01'";
+ $where_opts[] = "depreciation_date <= '".$end."'";
+ $where_opts[] = "depreciation_date >= '".$begin."'";
function users_list_cells($label, $name, $selected_id=null, $submit_on_change=false, $spec_opt=true)
{
$where = false;
function users_list_cells($label, $name, $selected_id=null, $submit_on_change=false, $spec_opt=true)
{
$where = false;