webERP Forum

Full Version: Quarters Missing From Periods - SOLVED?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I noticed in the GIT version we do not have period options for quarterly-based GL reports (i.e., This Quarter, Last Quarter, etc.).

Is this on purpose or was it some sort of work in process?
Hmmm, this functionality came from here http://www.weberp.org/forum/showthread.p...0#pid14600 but it looks like when it got committed the quarters got left out of the drop down list in ReportPeriodList(). The code is there in ReportList() to show quarters so it just needs adding in the drop down list. So ReportPeriodList() becomes:

PHP Code:
function ReportPeriodList($Choice$Options = array('t''l''n')) {
    
$Periods = array();

    if (
in_array('t'$Options)) {
        
$Periods[] = _('This Month');
        
$Periods[] = _('This Quarter');
        
$Periods[] = _('This Year');
        
$Periods[] = _('This Financial Year');
    }

    if (
in_array('l'$Options)) {
        
$Periods[] = _('Last Month');
        
$Periods[] = _('Last Quarter');
        
$Periods[] = _('Last Year');
        
$Periods[] = _('Last Financial Year');
    }

    if (
in_array('n'$Options)) {
        
$Periods[] = _('Next Month');
        
$Periods[] = _('Next Quarter');
        
$Periods[] = _('Next Year');
        
$Periods[] = _('Next Financial Year');
    }

    
$Count count($Periods);

    
$HTML '<select name="Period">
                <option value=""></option>'
;

    for (
$x 0;$x $Count;++$x) {
        if (!empty(
$Choice) && $Choice == $Periods[$x]) {
            
$HTML.= '<option value="' $Periods[$x] . '" selected>' $Periods[$x] . '</option>';
        } else {
            
$HTML.= '<option value="' $Periods[$x] . '">' $Periods[$x] . '</option>';
        }
    }

    
$HTML.= '</select>';

    return 
$HTML;


Looks like it might be my error again Sad
I thought maybe it needed to be tested further or was still in WIP.

In our case reports by quarters are important, which is why I asked.

So far GIT version looks great and I look forward to implementing 4.15.1.
Just looking at this, and the ReportList() function appears to fail when the current month is either 1 or 12, so needs small change to work around this.

Tim
Thank you Tim. I tried it on my side and it works so perhaps I have done something that is not in GIT?

I will have a look and compare later today...
Also... Do we want to add Periods to GLAccountInquiry.php as well?
Hi Paul, it is the call to the cal_days_in_month() function that will fail because it has a month number parameter of zero or 13. It only fails with a "Warning", so you may not see it. Not sure what the affect of that is elsewhere, but it should be put right anyway Smile

If you set your error_reporting level in config.php to just E_ALL you should see what I mean.

Tim
Ah... Thank you Tim!