kohabug 2224 Second installment: Correcting NULL field display
Query references to the unused aqorderdelivery table caused a NULL field to be displayed in the report results. This patch removes those references. Signed-off-by: Galen Charlton <galen.charlton@liblime.com> Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
909a548e15
commit
d8ea5fc339
2 changed files with 12 additions and 9 deletions
|
@ -156,8 +156,8 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>Received On</td>
|
||||
<td><input type="radio" name="Line" value="aqorderdelivery.deliverydate" /></td>
|
||||
<td><input type="radio" name="Column" value="aqorderdelivery.deliverydate" /></td>
|
||||
<td><input type="radio" name="Line" value="aqorderbreakdown.datereceived" /></td>
|
||||
<td><input type="radio" name="Column" value="aqorderbreakdown.datereceived" /></td>
|
||||
<td> From <input type="text" size="10" id="fromRO" name="Filter" value="" />
|
||||
<img src="<!-- TMPL_VAR Name="themelang" -->/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="openCalendarFromRO" style="cursor: pointer;" />
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -415,11 +415,12 @@ sub calculate {
|
|||
"SELECT DISTINCTROW $linefield FROM (aqorders, aqbasket,aqorderbreakdown)
|
||||
LEFT JOIN items ON (aqorders.biblionumber= items.biblionumber)
|
||||
LEFT JOIN biblioitems ON (aqorders.biblionumber= biblioitems.biblionumber)
|
||||
LEFT JOIN aqorderdelivery ON (aqorders.ordernumber =aqorderdelivery.ordernumber )
|
||||
LEFT JOIN aqbooksellers ON (aqbasket.booksellerid=aqbooksellers.id) WHERE (aqorders.basketno=aqbasket.basketno)
|
||||
AND (aqorderbreakdown.ordernumber=aqorders.ordernumber) AND $line IS NOT NULL ";
|
||||
|
||||
if (@linefilter) {
|
||||
# LEFT JOIN aqorderdelivery ON (aqorders.ordernumber =aqorderdelivery.ordernumber )
|
||||
|
||||
if (@linefilter) {
|
||||
if ( $linefilter[1] ) {
|
||||
if ( $linefilter[0] ) {
|
||||
$strsth .= " AND $line BETWEEN ? AND ? ";
|
||||
|
@ -526,11 +527,12 @@ sub calculate {
|
|||
"SELECT distinctrow $colfield FROM (aqorders, aqbasket,aqorderbreakdown)
|
||||
LEFT JOIN items ON (aqorders.biblionumber= items.biblionumber)
|
||||
LEFT JOIN biblioitems ON (aqorders.biblionumber= biblioitems.biblionumber)
|
||||
LEFT JOIN aqorderdelivery ON (aqorders.ordernumber =aqorderdelivery.ordernumber )
|
||||
LEFT JOIN aqbooksellers ON (aqbasket.booksellerid=aqbooksellers.id)
|
||||
WHERE (aqorders.basketno=aqbasket.basketno) AND (aqorderbreakdown.ordernumber=aqorders.ordernumber)
|
||||
AND $column IS NOT NULL";
|
||||
|
||||
# LEFT JOIN aqorderdelivery ON (aqorders.ordernumber =aqorderdelivery.ordernumber )
|
||||
|
||||
if (@colfilter) {
|
||||
if ( $colfilter[1] ) {
|
||||
if ( $colfilter[0] ) {
|
||||
|
@ -606,21 +608,22 @@ sub calculate {
|
|||
$strcalc .= "FROM (aqorders, aqbasket,aqorderbreakdown)
|
||||
LEFT JOIN items ON (aqorders.biblionumber= items.biblionumber)
|
||||
LEFT JOIN biblioitems ON (aqorders.biblionumber= biblioitems.biblionumber)
|
||||
LEFT JOIN aqorderdelivery ON (aqorders.ordernumber =aqorderdelivery.ordernumber )
|
||||
LEFT JOIN aqbooksellers ON (aqbasket.booksellerid=aqbooksellers.id) WHERE (aqorders.basketno=aqbasket.basketno)
|
||||
AND (aqorderbreakdown.ordernumber=aqorders.ordernumber) ";
|
||||
|
||||
@$filters[0] =~ s/\*/%/g if ( @$filters[0] );
|
||||
# LEFT JOIN aqorderdelivery ON (aqorders.ordernumber =aqorderdelivery.ordernumber )
|
||||
|
||||
@$filters[0] =~ s/\*/%/g if ( @$filters[0] );
|
||||
$strcalc .= " AND aqbasket.closedate >= '" . @$filters[0] . "'"
|
||||
if ( @$filters[0] );
|
||||
@$filters[1] =~ s/\*/%/g if ( @$filters[1] );
|
||||
$strcalc .= " AND aqbasket.closedate <= '" . @$filters[1] . "'"
|
||||
if ( @$filters[1] );
|
||||
@$filters[2] =~ s/\*/%/g if ( @$filters[2] );
|
||||
$strcalc .= " AND aqorderdelivery.deliverydate >= '" . @$filters[2] . "'"
|
||||
$strcalc .= " AND aqorderbreakdown.datereceived >= '" . @$filters[2] . "'"
|
||||
if ( @$filters[2] );
|
||||
@$filters[3] =~ s/\*/%/g if ( @$filters[3] );
|
||||
$strcalc .= " AND aqorderdelivery.deliverydate <= '" . @$filters[3] . "'"
|
||||
$strcalc .= " AND aqorderbreakdown.datereceived <= '" . @$filters[3] . "'"
|
||||
if ( @$filters[3] );
|
||||
# @$filters[4] =~ s/\*/%/g if ( @$filters[4] );
|
||||
# $strcalc .= " AND aqbasket.closedate >= '" . @$filters[4] . "'"
|
||||
|
|
Loading…
Reference in a new issue