Modify

Opened 14 years ago

Last modified 7 years ago

#7271 new defect

[Patch] Reports not working with Postgres 8.4 (TimingAndEstimation plugin)

Reported by: ricardo.ichizo@… Owned by:
Priority: normal Component: ClientsPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.11

Description

The reports Ticket Hours Grouped By Client and Ticket Hours Grouped By Client with Description that are viewed by TimingAndEstimation plugin are sending invalid SQL statement to the database.

The description of the problem is attached in this ticket.

The following piece of code resolved the problem:

  • reports.py

     
    7070       component as __component__,version, severity, milestone, status, owner,
    7171       CAST(estimatedhours.value as DECIMAL) as estimate_work,
    7272       CAST(totalhours.value as DECIMAL) as Total_work,
    73        CASE WHEN billable.value = 1 THEN 'Y'
     73       CASE WHEN billable.value = ($BILLABLE) THEN 'Y'
    7474            else 'N'
    7575       END as billable,
    7676       time AS created, changetime AS modified,         -- ## Dates are formatted
     
    131131 
    132132  WHERE t.status IN ($NEW, $ASSIGNED, $REOPENED, $CLOSED)
    133133    AND billable.value in ($BILLABLE, $UNBILLABLE)
    134   GROUP BY client.value
     134  GROUP BY client.value, t.component
    135135)  as tbl
    136136ORDER BY __group__, _ord ASC,ticket
    137137    """
     
    153153       component as __component__,version, severity, milestone, status, owner,
    154154       CAST(estimatedhours.value as DECIMAL) as estimate_work,
    155155       CAST(totalhours.value as DECIMAL) as Total_work,
    156        CASE WHEN billable.value = 1 THEN 'Y'
     156       CASE WHEN billable.value = ($BILLABLE) THEN 'Y'
    157157            else 'N'
    158158       END as billable,
    159159       time AS created, changetime AS modified,         -- ## Dates are formatted
     
    214214 
    215215  WHERE t.status IN ($NEW, $ASSIGNED, $REOPENED, $CLOSED)
    216216    AND billable.value in ($BILLABLE, $UNBILLABLE)
    217   GROUP BY client.value
     217  GROUP BY client.value, t.component
    218218)  as tbl
    219219ORDER BY __group__, _ord ASC,ticket
    220220    """

Attachments (2)

problem1.log (3.1 KB) - added by ricardo.ichizo@… 14 years ago.
Wrong type comparation
problem2.log (3.0 KB) - added by ricardo.ichizo@… 14 years ago.
Wrong "group by" clause

Download all attachments as: .zip

Change History (3)

Changed 14 years ago by ricardo.ichizo@…

Attachment: problem1.log added

Wrong type comparation

Changed 14 years ago by ricardo.ichizo@…

Attachment: problem2.log added

Wrong "group by" clause

comment:1 Changed 7 years ago by Ryan J Ollos

Owner: Colin Guthrie deleted

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


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

 
Note: See TracTickets for help on using tickets.