LOAN REPORT BY CATEGORY WISE

Write here for anything about reporting module in SLiMS.

Moderators: wynerst, buitenzorg812, purwoko, sutriadi, ido, Dicarve, ridorido

Post Reply
RKMSLIMS
Posts: 8
Joined: 04 Nov 2016, 17:34

LOAN REPORT BY CATEGORY WISE

Post by RKMSLIMS » 07 Jan 2017, 13:10

We need loan history reporting to display Collection Type also.

Is it possible to add another header of Collection Type also in loan history?
Attachments
Untitled.png
Untitled.png (26.31 KiB) Viewed 1467 times

User avatar
heru_subekti
Posts: 58
Joined: 04 Oct 2012, 00:02
Location: Trenggalek, Jawa Timur
Contact:

Re: LOAN REPORT BY CATEGORY WISE

Post by heru_subekti » 28 Oct 2017, 19:59

hello, you can replace code between line 163 -177 with this code :

Code: Select all

    $table_spec = 'loan AS l
    LEFT JOIN member AS m ON l.member_id=m.member_id
    LEFT JOIN item AS i ON l.item_code=i.item_code
    LEFT JOIN biblio AS b ON i.biblio_id=b.biblio_id
    LEFT JOIN mst_coll_type AS mct ON mct.coll_type_id=i.coll_type_id';

    // create datagrid
    $reportgrid = new report_datagrid();
    $reportgrid->setSQLColumn('m.member_id AS \''.__('Member ID').'\'',
        'm.member_name AS \''.__('Member Name').'\'',
        'm.member_type_id AS \''.__('Membership Type').'\'',
        'l.item_code AS \''.__('Item Code').'\'',
        'mct.coll_type_name AS \''.__('Collection Type').'\'',
        'b.title AS \''.__('Title').'\'',
        'l.loan_date AS \''.__('Loan Date').'\'',
        'l.due_date AS \''.__('Due Date').'\'', 'l.is_return AS \''.__('Loan Status').'\'');
    $reportgrid->setSQLorder('l.loan_date DESC');
and

Code: Select all

..
    function loanStatus($obj_db, $array_data)
    {
        if ($array_data[7] == 0) {
            return '<strong>'.__('On Loan').'</strong>';
        } else {
            return __('Returned');
        }
    }
..
$reportgrid->modifyColumnContent(7, 'callback{loanStatus}');
change to :

Code: Select all

..
    function loanStatus($obj_db, $array_data)
    {
        if ($array_data[8] == 0) {
            return '<strong>'.__('On Loan').'</strong>';
        } else {
            return __('Returned');
        }
    }
..
$reportgrid->modifyColumnContent(8, 'callback{loanStatus}');
preview :
ct.png
ct.png (143.82 KiB) Viewed 655 times

Post Reply