#64836 Incident ID:15669 - *Selecting to query the ‘Time-Phased Bookings’ screen without selecting any period generates a DB log error

open
nobody
None
5
2011-09-14
2011-09-14
omfgppc
No

Description:

Querying without selecting any period generates a DB log error in ‘Time-Phased Bookings’ screen

#####Screenshot attached#####

Steps to Reproduce:
1. Sales->Analysis->Time-Phased Bookings
2. Select a calendar from the drop down list
3. Un Select all the periods and click on Query button
4. Observe that an error message is displayed and a DB log error is generated

DB log error:
Wed 14. Sep 18:10:23 2011 ERROR: syntax error at or near ")"
LINE 34: )
^
QPSQL: Unable to create query
-- Group: timePhasedBookings
-- Name: detail
-- Notes:

SELECT

cust_id, cust_number, cust_name,

uom, warehous_code
-- Loop through each period bucket to find bookings for period

FROM (
SELECT cohead_orderdate,

cust_id, cust_number, cust_name

, warehous_code

, round((coitem_qtyord * coitem_qty_invuomratio) * (currtobase(cohead_curr_id, coitem_price, cohead_orderdate) / coitem_price_invuomratio), 2) AS amount
, ' USD-$' ::text AS uom

FROM coitem
JOIN cohead ON (coitem_cohead_id=cohead_id)
JOIN itemsite ON (coitem_itemsite_id=itemsite_id)
JOIN item ON (itemsite_item_id=item_id)

JOIN site() ON (itemsite_warehous_id=warehous_id)

JOIN custinfo ON (cohead_cust_id=cust_id)

WHERE ((coitem_status != 'X')
AND (cohead_orderdate BETWEEN
)
)) data
GROUP BY

cust_id, cust_number, cust_name,

uom, warehous_code
ORDER BY

cust_number,

uom, warehous_code;

Additional information

For the entire bug information, please visit

http://www.xtuple.org/xtincident/view/bugs/15669

Discussion