class UserReport extends Report { get name() { return "User Work Time"; } get fieldInformation() { return { work: { displayName: "Work", aggregationLabel: "Total" }, total_duration: { displayName: "Total Time", type: "number", aggregation: "sum", round: 3 }, total_value: { displayName: "Total Value", type: "currency", aggregation: "sum" } }; } get filterParameters() { return [ { from_date: { type: "date", default: Time.getLastMonthStartDate(), label: "From" }, to_date: { type: "date", default: Time.getLastMonthEndDate(), label: "to" } }, { project_id: { type: "project_select", label: "Project" } }, { invoiced: { type: "select", default: "all", label: "Show", values: { all: "all", invoiced_only: "invoiced only", not_invoiced_only: "not yet invoiced only" } } } ]; } get requestPath() { return "Reports/User"; } getTextOrientationForField(fieldName, fieldInformation) { if (fieldName != "work" && fieldName != "total_duration" && fieldName != "total_value") { return "vertical"; } return super.getTextOrientationForField(fieldName, fieldInformation); } getFieldInformation(fieldName) { if (fieldName.match(/[0-9]{4}-[0-9]{2}-[0-9]{2}/)) { var fieldInformation = structuredClone(this.defaultFieldInformation); fieldInformation.type = "number"; fieldInformation.aggregation = "sum"; fieldInformation.displayName = fieldName; return fieldInformation; } return super.getFieldInformation(fieldName); } }