diff --git a/ayanova/src/components/dash-labor-hours-personal.vue b/ayanova/src/components/dash-labor-hours-personal.vue index 446b6d85..249660a6 100644 --- a/ayanova/src/components/dash-labor-hours-personal.vue +++ b/ayanova/src/components/dash-labor-hours-personal.vue @@ -117,6 +117,31 @@ export default { //todo: need a equivalent of a datalist at the server but that can take the minimal criteria offered here and return the data easily digestable //do not want the client end to have to do math or anything and also it needs to drive reporting of the same type as the widget display //so as similar as possible to the datatable system but handles the math and summarizing ideally in the db server itself + /* + DateTrunc https://www.postgresqltutorial.com/postgresql-date_trunc/ will respect changes of month or year or whatever so this works + SELECT SUM(AWORKORDERITEMLABOR.serviceratequantity), date_trunc('day',AWORKORDERITEMLABOR.servicestartdate) m + +FROM AWORKORDER + LEFT JOIN AWORKORDERITEM ON AWORKORDER.ID = AWORKORDERITEM.WORKORDERID + LEFT JOIN AWORKORDERITEMLABOR ON AWORKORDERITEM.ID = AWORKORDERITEMLABOR.WORKORDERITEMID + WHERE AWORKORDERITEMLABOR.userid = 10 + +GROUP BY m +ORDER BY m ASC; + + +SELECT SUM(AWORKORDERITEMLABOR.serviceratequantity), date_trunc('month',AWORKORDERITEMLABOR.servicestartdate) m + +FROM AWORKORDER + LEFT JOIN AWORKORDERITEM ON AWORKORDER.ID = AWORKORDERITEM.WORKORDERID + LEFT JOIN AWORKORDERITEMLABOR ON AWORKORDERITEM.ID = AWORKORDERITEMLABOR.WORKORDERITEMID + WHERE AWORKORDERITEMLABOR.userid = 10 + +GROUP BY m +ORDER BY m ASC; + + + */ // try { // this.errorMessage = null; // const res = await window.$gz.api.post("schedule/personal", {