This commit is contained in:
@@ -276,7 +276,6 @@ Available filter criteria:
|
|||||||
- Work order tags
|
- Work order tags
|
||||||
- Work order item tags
|
- Work order item tags
|
||||||
|
|
||||||
|
|
||||||
#### Count of work orders created
|
#### Count of work orders created
|
||||||
|
|
||||||
Management chart showing the number of new work orders created that fit criteria selected, available as a Line or Bar chart:
|
Management chart showing the number of new work orders created that fit criteria selected, available as a Line or Bar chart:
|
||||||
@@ -287,7 +286,6 @@ Management chart showing the number of new work orders created that fit criteria
|
|||||||
|
|
||||||
These chart format widgets display counts of work orders created by selected time span and selected interval.
|
These chart format widgets display counts of work orders created by selected time span and selected interval.
|
||||||
|
|
||||||
|
|
||||||
They will automatically update every 15 minutes approximately.
|
They will automatically update every 15 minutes approximately.
|
||||||
|
|
||||||
Available to the following roles:
|
Available to the following roles:
|
||||||
@@ -304,3 +302,27 @@ Available filter criteria:
|
|||||||
- Interval
|
- Interval
|
||||||
- Work order tags
|
- Work order tags
|
||||||
- Work order item tags
|
- Work order item tags
|
||||||
|
|
||||||
|
#### Percentage of Work orders completed on time
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Management bar chart showing the percentage of work orders that were completed on time for the criteria selected.
|
||||||
|
|
||||||
|
Here, completed on time means work orders that were set to a [Completed work order status](svc-work-order-status.md#is-a-completed-status) before the Work order's [date to be completed setting](svc-workorders.md#date-to-be-completed).
|
||||||
|
|
||||||
|
They will automatically update every 15 minutes approximately.
|
||||||
|
|
||||||
|
Available to the following roles:
|
||||||
|
|
||||||
|
- Accounting
|
||||||
|
- Business administration
|
||||||
|
- Business administration - restricted
|
||||||
|
- Service manager
|
||||||
|
- Service manager - restricted
|
||||||
|
|
||||||
|
Available filter criteria:
|
||||||
|
|
||||||
|
- Time span
|
||||||
|
- Interval
|
||||||
|
- Work order tags
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
@@ -47,13 +47,21 @@ AuthorizationRoles.Accounting;
|
|||||||
bool wotagsany = options.Criteria["wotagsany"].ToObject<bool>();
|
bool wotagsany = options.Criteria["wotagsany"].ToObject<bool>();
|
||||||
string woTagsWhere = DataListSqlFilterCriteriaBuilder.KPITagFilterToSqlCriteria("aworkorder.tags", wotags, wotagsany);
|
string woTagsWhere = DataListSqlFilterCriteriaBuilder.KPITagFilterToSqlCriteria("aworkorder.tags", wotags, wotagsany);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_dataQuery = @$"SELECT row_to_json(t) as res from (
|
_dataQuery = @$"SELECT row_to_json(t) as res from (
|
||||||
with subq as (
|
with subq as (
|
||||||
SELECT COUNT(AWORKORDER.ID) wocount,
|
SELECT COUNT(AWORKORDER.ID) wocount,
|
||||||
DATE_TRUNC('{interval}',AWORKORDER.createddate) x,
|
DATE_TRUNC('{interval}',AWORKORDER.createddate) x,
|
||||||
(LASTSTATUSID IS NULL OR AWORKORDERSTATUS.COMPLETED = FALSE) z
|
(aworkorder.laststatusid is not null AND AWORKORDERSTATUS.COMPLETED = TRUE AND laststate.created < aworkorder.completebydate) Z
|
||||||
FROM AWORKORDER
|
FROM AWORKORDER
|
||||||
LEFT JOIN AWORKORDERSTATUS ON (AWORKORDER.LASTSTATUSID = AWORKORDERSTATUS.ID)
|
LEFT JOIN AWORKORDERSTATUS ON (AWORKORDER.LASTSTATUSID = AWORKORDERSTATUS.ID)
|
||||||
|
LEFT JOIN LATERAL (SELECT created
|
||||||
|
FROM aworkorderstate
|
||||||
|
WHERE aworkorderstate.workorderid = aworkorder.id
|
||||||
|
ORDER BY aworkorderstate.created DESC
|
||||||
|
LIMIT 1) AS laststate ON TRUE
|
||||||
where AWORKORDER.COMPLETEBYDATE < NOW() AND {dateWhere} {woTagsWhere}
|
where AWORKORDER.COMPLETEBYDATE < NOW() AND {dateWhere} {woTagsWhere}
|
||||||
GROUP BY x,z
|
GROUP BY x,z
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user