ref_cells(_("Reference:"), 'Ref', '',null, _('Enter reference fragment or leave empty'));
ref_cells(_("Reference:"), 'Ref', '',null, _('Enter reference fragment or leave empty'));
date_cells(_("From:"), 'FromDate', '', null, 0, 0, -1);
date_cells(_("To:"), 'ToDate');
date_cells(_("From:"), 'FromDate', '', null, 0, 0, -1);
date_cells(_("To:"), 'ToDate');
submit_cells('Search', _("Search"), '', '', 'default');
end_row();
submit_cells('Search', _("Search"), '', '', 'default');
end_row();
function systype_name($dummy, $type)
{
return systypes::name($type);
function systype_name($dummy, $type)
{
return systypes::name($type);
pager_link(_("Edit"),
sprintf($editors[$row["type"]], $row["type_no"], $row["type"]),
ICON_EDIT) : '';
}
pager_link(_("Edit"),
sprintf($editors[$row["type"]], $row["type_no"], $row["type"]),
ICON_EDIT) : '';
}
gl.type,
gl.type_no,
refs.reference,
SUM(IF(gl.amount>0, gl.amount,0)) as amount,"
gl.type,
gl.type_no,
refs.reference,
SUM(IF(gl.amount>0, gl.amount,0)) as amount,"
." LEFT JOIN ". TB_PREF."comments as com ON
(gl.type=com.type AND gl.type_no=com.id)"
." LEFT JOIN ". TB_PREF."refs as refs ON
." LEFT JOIN ". TB_PREF."comments as com ON
(gl.type=com.type AND gl.type_no=com.id)"
." LEFT JOIN ". TB_PREF."refs as refs ON
WHERE gl.tran_date >= '" . date2sql($_POST['FromDate']) . "'
AND gl.tran_date <= '" . date2sql($_POST['ToDate']) . "'
WHERE gl.tran_date >= '" . date2sql($_POST['FromDate']) . "'
AND gl.tran_date <= '" . date2sql($_POST['ToDate']) . "'
if (isset($_POST['Ref']) && $_POST['Ref'] != "") {
$sql .= " AND reference LIKE '%". $_POST['Ref'] . "%'";
if (isset($_POST['Ref']) && $_POST['Ref'] != "") {
$sql .= " AND reference LIKE '%". $_POST['Ref'] . "%'";
_("Date") =>array('name'=>'tran_date','type'=>'date','ord'=>'desc'),
_("Type") => array('fun'=>'systype_name'),
_("Trans #") => array('fun'=>'view_link'),
_("Reference"),
_("Amount") => array('type'=>'amount'),
_("Memo"),
_("Date") =>array('name'=>'tran_date','type'=>'date','ord'=>'desc'),
_("Type") => array('fun'=>'systype_name'),
_("Trans #") => array('fun'=>'view_link'),
_("Reference"),
_("Amount") => array('type'=>'amount'),
_("Memo"),
_("View") => array('insert'=>true, 'fun'=>'gl_link'),
array('insert'=>true, 'fun'=>'edit_link')
);
_("View") => array('insert'=>true, 'fun'=>'gl_link'),
array('insert'=>true, 'fun'=>'edit_link')
);
$table =& new_db_pager('journal_tbl', $sql, $cols);
if (get_post('Search')) {
$table =& new_db_pager('journal_tbl', $sql, $cols);
if (get_post('Search')) {