Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Quarters Missing From Periods - SOLVED?
12-10-2018, 10:24 PM, (This post was last modified: 12-10-2018, 11:21 PM by VortecCPI.)
#1
Quarters Missing From Periods - SOLVED?
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?
https://www.linkedin.com/in/eclipsepaulbecker
Reply
12-10-2018, 11:16 PM,
#2
RE: Quarters Missing From Periods?
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
Reply
12-10-2018, 11:20 PM,
#3
RE: Quarters Missing From Periods?
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.
https://www.linkedin.com/in/eclipsepaulbecker
Reply
12-20-2018, 08:09 PM,
#4
RE: Quarters Missing From Periods - SOLVED?
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
Reply
12-20-2018, 08:37 PM, (This post was last modified: 12-20-2018, 08:40 PM by VortecCPI.)
#5
RE: Quarters Missing From Periods - SOLVED?
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?
https://www.linkedin.com/in/eclipsepaulbecker
Reply
12-20-2018, 08:43 PM, (This post was last modified: 12-20-2018, 08:44 PM by TimSchofield.)
#6
RE: Quarters Missing From Periods - SOLVED?
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
Reply
12-20-2018, 09:24 PM,
#7
RE: Quarters Missing From Periods - SOLVED?
Ah... Thank you Tim!
https://www.linkedin.com/in/eclipsepaulbecker
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)