Superbill report problem

gutiersa wrote on Tuesday, June 10, 2008:

For some reason when I try to print the superbills from 20080607 to 20080607 from the reports page, I get a report with only my company name and address.
If I enter from 20080607 to 20080608 then I get the superbills for both days. What’s happening? How can I fix it?

gutiersa wrote on Wednesday, June 11, 2008:

got it. In custom_report_range.php change this line:

$res = sqlStatement("select * from forms where " .
    "form_name = ‘New Patient Encounter’ and " .
    "date between ‘$start’ and ‘$end’ " .
    “order by date DESC”);

to

$res = sqlStatement("select * from forms where " .
    "form_name = ‘New Patient Encounter’ and " .
    "date between ‘$start 00:00:00’ and ‘$end 23:59:59’ " .
    “order by date DESC”);

rmehenda wrote on Tuesday, June 02, 2009:

Had the same problem and the above fix did not work because the DATE comparison fails due to incorrrect format: ‘$end 23:59:59’ expands to YYYYMMDD 23:59:59 which is not in DATETIME type format.

The following changes, although a kludge, work to produce daily superbill reports:

15,16c15,16
<     $startdate = date(‘Y-m-d’, (time() - 30*24*60*60));
<     $enddate = date(‘Y-m-d’, time());

>     $startdate = date(‘Ymd’, (time() - 30*24*60*60));
>     $enddate = date(‘Ymd’, time());
142c142
<                         “date between CAST(’$start’ AS DATETIME) and CAST(’$end 23:59:59’ AS DATETIME)” .

>                         “date between ‘$start’ and ‘$end’ " .
262,263c262,263
<  Calendar.setup({inputField:“start”, ifFormat:”%Y-%m-%d", button:“img_from_date”});
<  Calendar.setup({inputField:“end”, ifFormat:"%Y-%m-%d", button:“img_to_date”});

>  Calendar.setup({inputField:“start”, ifFormat:"%Y%m%d", button:“img_from_date”});
>  Calendar.setup({inputField:“end”, ifFormat:"%Y%m%d", button:“img_to_date”});