include_once($path_to_root . "/includes/date_functions.inc");
include_once($path_to_root . "/includes/ui.inc");
$js = "";
-if ($use_popup_windows)
+if ($SysPrefs->use_popup_windows)
$js .= get_js_open_window(800, 500);
-if ($use_date_picker)
+if (user_use_date_picker())
$js .= get_js_date_picker();
page(_($help_context = "Journal Inquiry"), false, false, "", $js);
function edit_link($row)
{
- return edit_trans_link($row["type"], $row["type_no"]);
+
+ $ok = true;
+ if ($row['type'] == ST_SALESINVOICE)
+ {
+ $myrow = get_customer_trans($row["type_no"], $row["type"]);
+ if ($myrow['alloc'] != 0 || get_voided_entry(ST_SALESINVOICE, $row["type_no"]) !== false)
+ $ok = false;
+ }
+ return $ok ? trans_editor_link($row["type"], $row["type_no"]) : '';
}
$sql = get_sql_for_journal_inquiry(get_post('filterType', -1), get_post('FromDate'),
$cols = array(
_("#") => array('fun'=>'journal_pos', 'align'=>'center'),
- _("Date") =>array('name'=>'tran_date','type'=>'date', 'ord' => check_value('AlsoClosed') ? 'asc' : 'desc'),
+ _("Date") =>array('name'=>'tran_date','type'=>'date','ord'=>'desc'),
_("Type") => array('fun'=>'systype_name'),
_("Trans #") => array('fun'=>'view_link'),
_("Reference"),
end_form();
end_page();
-?>