simple_page_mode(true);
//-------------------------------------------------------------------------------------------------
-function can_process()
+function can_process($new)
{
if (strlen($_POST['user_id']) < 4)
return false;
}
- if ($_POST['password'] != "")
+ if (!$new && ($_POST['password'] != ""))
{
if (strlen($_POST['password']) < 4)
{
if (($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') && check_csrf_token())
{
- if (can_process())
+ if (can_process($Mode == 'ADD_ITEM'))
{
if ($selected_id != -1)
{
}
if ($where) $where = " WHERE ($where)";
- if ($count) {
- $group = $group == '' ? "*" : "DISTINCT $group";
-
- return "SELECT COUNT(*) FROM (SELECT $group FROM $from $where) tmp_count";
- }
+ if ($count)
+ return "SELECT COUNT(*) FROM ($this->sql) tmp_count";
$sql = "$select FROM $from $where";
if ($group) $sql.= " GROUP BY $group";
if(isset($col['ord_priority'])) {
$columns[$col['ord_priority']] = $col;
}
- }
- krsort($columns);
+ }
+ krsort($columns);
foreach ($columns as $col) {
if (isset($col['ord'])) {
}
}
}
-
+
if (count($ord)) {
$ord = array_map('db_escape_function', $ord);
$sql .= " ORDER BY " . implode(',', $ord);
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
echo "<html dir='" . $_SESSION['language']->dir . "' >\n";
echo "<head profile=\"http://www.w3.org/2005/10/profile\"><title>$title</title>";
+ if (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident/7.0; rv:11.0') != -1) // IE 11 doesn't work with input file type in form.
+ echo "<meta http-equiv='X-UA-Compatible' content='IE=10'>\n";
echo "<meta http-equiv='Content-type' content='text/html; charset=$encoding'>";
echo "<link href='$path_to_root/themes/$theme/default.css' rel='stylesheet' type='text/css'> \n";
echo "<link href='$path_to_root/themes/default/images/favicon.ico' rel='icon' type='image/x-icon'> \n";
function _format_fiscalyears($row)
{
return sql2date($row[1]) . " - " . sql2date($row[2])
- . " " . ($row[3] ? _('Closed') : _('Active')) . "</option>\n";
+ . " " . ($row[3] ? _('Closed') : _('Active'));
}
function fiscalyears_list_cells($label, $name, $selected_id=null)
$th[] = "";
if ($supp_trans->trans_type == ST_SUPPCREDIT)
{
- $th[8] = _("Qty Yet To Credit");
+ $th[7] = _("Qty Yet To Credit");
}
}
else
$stock = get_item($item->item_code);
display_error(_("The return cannot be processed because there is an insufficient quantity for item:") .
" " . $stock['stock_id'] . " - " . $stock['description'] . " - " .
- _("Quantity On Hand") . " = " . number_format2($qoh, get_qty_dec($stock['stock_id'])));
+ _("Quantity On Hand") . " = " . number_format2(get_qoh_on_date($stock['stock_id'], null,
+ $_SESSION['supp_trans']->tran_date), get_qty_dec($stock['stock_id'])));
return false;
}
}
$_POST['prev_quantity_inv'.$n], input_num('This_QuantityCredited'.$n),
$_POST['order_price'.$n], input_num('ChgPrice'.$n),
$_POST['std_cost_unit'.$n], "");
+ reset_tax_input();
}
}