Skip to content

Commit

Permalink
added column for total of each entry. close #2159
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dimension committed Oct 29, 2023
1 parent 70a52c0 commit 52b9595
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ public ReportResult invokeReport(String reportId, Object... params) throws Excep
} else if (Reports.RPT_TSHEETS_OPEN_POSITIONS.equals(reportId)) {
String query = "SELECT cases.id, cases.fileNumber as Aktenzeichen, cases.name as Rubrum, cases.reason as wegen, \n"
+ " ts.name as Projektname, ts.description as Projektbeschreibung, ts.interval_minutes as Taktung,\n"
+ " DATE_FORMAT(tsp.time_started,'%Y-%m-%d %H:%i') as von, DATE_FORMAT(tsp.time_stopped,'%Y-%m-%d %H:%i') as bis, greatest(1, TIMESTAMPDIFF(MINUTE, tsp.time_started, tsp.time_stopped)) AS Minuten, greatest(1, CEILING(TIMESTAMPDIFF(MINUTE, tsp.time_started, tsp.time_stopped)/ts.interval_minutes))*ts.interval_minutes DIV 1 AS MinutenInTaktung, tsp.name as Aktivitaet, tsp.description as Taetigkeiten, tsp.principal as GebuchtDurch, tsp.tax_rate as Steuersatz, tsp.unit_price as Stundensatz\n"
+ " DATE_FORMAT(tsp.time_started,'%Y-%m-%d %H:%i') as von, DATE_FORMAT(tsp.time_stopped,'%Y-%m-%d %H:%i') as bis, greatest(1, TIMESTAMPDIFF(MINUTE, tsp.time_started, tsp.time_stopped)) AS Minuten, greatest(1, CEILING(TIMESTAMPDIFF(MINUTE, tsp.time_started, tsp.time_stopped)/ts.interval_minutes))*ts.interval_minutes DIV 1 AS MinutenInTaktung, tsp.name as Aktivitaet, tsp.description as Taetigkeiten, tsp.principal as GebuchtDurch, tsp.tax_rate as Steuersatz, tsp.unit_price as Stundensatz, (greatest(1, CEILING(TIMESTAMPDIFF(MINUTE, tsp.time_started, tsp.time_stopped)/ts.interval_minutes))*ts.interval_minutes DIV 1) / 60 * tsp.unit_price as Positionsbetrag\n"
+ " FROM timesheet_positions tsp\n"
+ "left join timesheets ts on ts.id=tsp.timesheet_id \n"
+ "left join cases cases on ts.case_id=cases.id\n"
Expand Down

0 comments on commit 52b9595

Please sign in to comment.