Modify

Opened 16 years ago

Closed 16 years ago

#3143 closed defect (duplicate)

All Billing Reports fail with "Report execution failed: ORDER BY column number 0 out of range - should be between 1 and 7"

Reported by: petros@… Owned by: Russ Tyndall
Priority: normal Component: TimingAndEstimationPlugin
Severity: normal Keywords: report, 0.11, upgrade, sqlite3
Cc: Trac Release: 0.11

Description

Edit report shows me this:

 
SELECT author as __group__,__style__, ticket, summary,
  newvalue as Work_added, time as datetime, _ord
FROM(
  SELECT '' as __style__, author, t.id  as ticket,
    t.summary as summary,
    CASE WHEN newvalue = '' OR newvalue IS NULL THEN 0
         ELSE CAST( newvalue AS DECIMAL ) END as newvalue,
    ticket_change.time as time, 0 as _ord
  FROM ticket_change
  JOIN ticket t on t.id = ticket_change.ticket
  LEFT JOIN ticket_custom as billable on billable.ticket = t.id
    and billable.name = 'billable'
  WHERE field = 'hours' and
    t.status IN ($ASSIGNED, $CLOSED, $NEW, $REOPENED)
      AND billable.value in ($BILLABLE, $UNBILLABLE)
      AND ticket_change.time >= $STARTDATE
      AND ticket_change.time < $ENDDATE

  UNION

  SELECT 'background-color:#DFE;' as __style__, author, NULL as ticket,
    Null as summary,
    SUM( CASE WHEN newvalue = '' OR newvalue IS NULL THEN 0
         ELSE CAST( newvalue AS DECIMAL ) END) as newvalue,
    NULL as time, 1 as _ord
  FROM ticket_change
  JOIN ticket t on t.id = ticket_change.ticket
  LEFT JOIN ticket_custom as billable on billable.ticket = t.id
    and billable.name = 'billable'
  WHERE field = 'hours' and
    t.status IN ($ASSIGNED, $CLOSED, $NEW, $REOPENED)
      AND billable.value in ($BILLABLE, $UNBILLABLE)
      AND ticket_change.time >= $STARTDATE
      AND ticket_change.time < $ENDDATE
  GROUP By author
)  as tbl
ORDER BY author,  _ord ASC, time

Thanks for your work

Attachments (0)

Change History (1)

comment:1 Changed 16 years ago by Russ Tyndall

Resolution: duplicate
Status: newclosed

This is a bug in the Trac 11 release candidate.

Checkout #3084 which deals with this and has some instructions for installing a version that is compatible with T&E billing reports.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Russ Tyndall.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.