19 March 2011

Altering Year Buttons For Financial Year Dates (Australian Stores) v1.0

Instead of the year being from 01-01 to 31-12 this will alter it to 01-07 to 30-06 (Australian financial year).
#
#----------[ OPEN ]----------
#
admin/tabs/AdminStatsTab.php

#
#----------[ FIND ]----------
#
            $from = date('Y-01-01');
            $to = date('Y-12-31');
        }
        if (Tools::isSubmit('submitDateYearPrev'))
        {
            $from = (date('Y') - 1).date('-01-01');
            $to = (date('Y') - 1).date('-12-31');

#
#----------[ REPLACE WITH ]----------
#
            $from = date('Y-07-01');
            $to = (date('Y') + 1).date('-06-30');
        }
        if (Tools::isSubmit('submitDateYearPrev'))
        {
            $from = (date('Y') - 1).date('-07-01');
            $to = date('Y-06-30');
#
#----------[ OPEN ]----------
#
classes/ModuleGraph.php

#
#----------[ FIND ]----------
#
                $employee->stats_date_from = date('Y').'-01-01';
            if (empty($employee->stats_date_to)  OR $employee->stats_date_to == '0000-00-00')
                $employee->stats_date_to = date('Y').'-12-31';

#
#----------[ REPLACE WITH ]----------
#
           $employee->stats_date_from = date('Y').'-07-01';
            if (empty($employee->stats_date_to)  OR $employee->stats_date_to == '0000-00-00')
                $employee->stats_date_to = (date('Y') + 1).'-06-30';

No comments:

Post a Comment