+
+
+
{dates && dates.startDate && dates.endDate && (
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
)}
diff --git a/src/components/pages/reporting/reporting.page.styles.scss b/src/components/pages/reporting/reporting.page.styles.scss
new file mode 100644
index 0000000..0caef5e
--- /dev/null
+++ b/src/components/pages/reporting/reporting.page.styles.scss
@@ -0,0 +1,8 @@
+.reporting-container {
+ height: 100%;
+ overflow-y: auto;
+ background-color: rgb(244, 244, 244);
+ & > .reporting-cards > * {
+ margin: 0.7rem;
+ }
+}
diff --git a/src/redux/reporting/reporting.sagas.js b/src/redux/reporting/reporting.sagas.js
index a56f211..7af6c47 100644
--- a/src/redux/reporting/reporting.sagas.js
+++ b/src/redux/reporting/reporting.sagas.js
@@ -1,17 +1,18 @@
import Dinero from "dinero.js";
+import _ from "lodash";
import { all, call, put, select, takeLatest } from "redux-saga/effects";
import client from "../../graphql/GraphQLClient";
import { REPORTING_GET_JOBS } from "../../graphql/reporting.queries";
import ipcTypes from "../../ipc.types";
import {
CalculateJobRpsDollars,
- CalculateJobRpsPc
+ CalculateJobRpsPc,
} from "../../util/CalculateJobRps";
import GetJobTarget from "../../util/GetJobTarget";
import {
calculateScorecard,
setReportingData,
- setScoreCard
+ setScoreCard,
} from "./reporting.actions";
import ReportingApplicationTypes from "./reporting.types";
@@ -59,6 +60,7 @@ export function* handleCalculateScoreCard({ payload: jobs }) {
});
const targets = yield select((state) => state.user.bodyshop.targets);
+ const groups = yield select((state) => state.user.bodyshop.groups);
const scoreCard = {
shopRpsTotalDollars: Dinero(),
@@ -69,6 +71,13 @@ export function* handleCalculateScoreCard({ payload: jobs }) {
allJobsSumActPrice: Dinero(),
currentRpsPc: 0,
targetRpsPc: 0,
+ scatterChart: _.sortBy(
+ groups,
+ [(group) => group.toLowerCase()],
+ ["desc"]
+ ).reduce((acc, val) => {
+ return { ...acc, [val]: [] };
+ }, {}),
};
//Get the RPS on a per job basis.
@@ -93,6 +102,19 @@ export function* handleCalculateScoreCard({ payload: jobs }) {
actPriceSum
);
+ scoreCard.scatterChart[job.group].push({
+ deviation: Math.round((jobRpsPc - jobTarget) * 1000) / 10,
+ age: job.v_age,
+ dbPriceSum,
+ dbPriceSumAmt: dbPriceSum.getAmount() / 100,
+ id: job.id,
+ owner: `${job.ownr_fn} ${job.ownr_ln}`,
+ vehicle: `${job.v_model_yr} ${job.v_makedesc} ${job.v_model} (${job.v_type}) - ${job.group}`,
+ clm_no: job.clm_no,
+ jobRpsDollars,
+ jobRpsPc,
+ });
+
//sum db price * percentage expected.
return {
...job,