function display_gl_heading($myrow)
{
    global $systypes_array;
    $title = "";
    //moodlearning
    if ($myrow['type'] == 55 || $myrow['type'] == 1) {
        if ($myrow['type'] == 0) {
            $title = "JV No.";
            $num = substr($ser['year'], 2);
        }
        if ($myrow['type'] == 55) {
            $voucher_type = "Check Voucher";
            $title = "CV No.";
            $myDateTime = DateTime::createFromFormat('Y-m-d', $myrow['tran_date']);
            $newDateString = $myDateTime->format('d-m-Y');
            $year = substr($newDateString, 8) . "-";
        }
    }
    $trans_name = $systypes_array[$_GET['type_id']];
    start_table(TABLESTYLE, "width=95%");
    if ($myrow['type'] == 0 || $myrow['type'] == 1 || $myrow['type'] == 55) {
        $th = array(_("General Ledger Transaction Details"), _("Reference"), _("Date"), _("Person/Item"), $title);
    } else {
        $th = array(_("General Ledger Transaction Details"), _("Reference"), _("Date"), _("Person/Item"));
    }
    table_header($th);
    start_row();
    if ($custom == 0) {
        label_cell("{$trans_name} #" . $_GET['type_id']);
    } else {
        label_cell("{$trans_name} #" . get_customized_no($myrow['type'], $myrow['type_no']));
    }
    label_cell($myrow["reference"]);
    label_cell(sql2date($myrow["tran_date"]));
    label_cell(payment_person_name($myrow["person_type_id"], $myrow["person_id"]));
    if ($myrow['type'] == 0 || $myrow['type'] == 1 || $myrow['type'] == 55) {
        label_cell($year . str_pad(get_customized_no($myrow['type'], $myrow['type_no']), 4, 0, STR_PAD_LEFT));
    }
    //moodlearning
    end_row();
    comments_display_row($_GET['type_id'], $_GET['trans_no']);
    end_table(1);
}
function ref_view($row)
{
    $custom = get_customized_no($row['type'], $row['trans_no']);
    $formatted = substr($row['trans_date'], 0, 4) . "-" . str_pad($custom, 4, 0, STR_PAD_LEFT);
    if ($row['type'] == ST_DISBURSEMENT || $row['type'] == ST_JOURNAL) {
        return $formatted;
    }
    if ($row['type'] == ST_CUSTCREDIT || $row['type'] == ST_SALESINVOICE) {
        return $custom;
    } else {
        return $row['ref'];
    }
}