Monday 5 March 2012

Adding a monthly dropdown to Finacial Report in RentalotPlus

Adding a monthly dropdown to Finacial Report in RentalotPlus


in administrator


> goto 'RentalotPlus'

> 'Reports'

> 'Financial Report'



Here on the drop down that says '2012'  I would like an additional drop down that breaks the Financial Report into months.



OPEN  administrator/components/com_rentalplus/models/report.php


FIND

function &getFinancial()

AND UNDER

$filter_year = $this->_app->getUserStateFromRequest(LA_COMPONENT.'.filter_year','filter_year',0,'int');
    

ADD


$filter_month = $this->_app->getUserStateFromRequest(LA_COMPONENT.'.filter_month','filter_month',0,'int');


UNDER

if ($filter_year > 0)
        $query_where .= " And year(B.date_from) = '$filter_year'";


ADD

    if ($filter_month > 0)
        $query_where .= " And month(B.date_from) = '$filter_month'";




OPEN administrator/components/com_rentalotplus/views/financial/view.html.php


IN function display($tpl = null)

FIND
    $filter_year = $app->getUserStateFromRequest(LA_COMPONENT.'.filter_year','filter_year',0,'int');
   


ADD

    $filter_month = $app->getUserStateFromRequest(LA_COMPONENT.'.filter_month','filter_month',0,'int');


FIND

    $this->lists['year'] = LA_view::make_list('filter_year', $filter_year, $this->year_list, 0, 'onchange="this.form.task.value='."''".';submitform( );"');
 


ADD

    $this->lists['month'] = LA_view::make_list('filter_month', $filter_month, $this->month_list, 0, 'onchange="this.form.task.value='."''".';submitform( );"');



And that's it.






No comments: