Updated projected monthly sales.

This commit is contained in:
Patrick Fic
2022-02-07 18:31:06 -08:00
parent 91c5560fe8
commit a17b2b0923
2 changed files with 34 additions and 8 deletions

View File

@@ -38,7 +38,6 @@ export default function DashboardMonthlyEmployeeEfficiency({
if (!!ticketsByDate[val]) {
dailyHrs = ticketsByDate[val].reduce(
(dayAcc, dayVal) => {
console.log(dayAcc);
return {
actual: dayAcc.actual + dayVal.actualhrs,
productive: dayAcc.actual + dayVal.productivehrs,

View File

@@ -34,16 +34,43 @@ export const DashboardProjectedMonthlySalesGql = `
projected_monthly_sales: jobs(where: {
voided: {_eq: false},
_or: [
{_and: [{date_invoiced: {_gte: "${moment()
.startOf("month").startOf('day').toISOString()}"}}, {date_invoiced: {_lte: "${moment()
.endOf("month").endOf('day').toISOString()}"}}]},
{_and: [
{date_invoiced:{_is_null: false }},
{date_invoiced: {_gte: "${moment()
.startOf("month")
.startOf("day")
.toISOString()}"}}, {date_invoiced: {_lte: "${moment()
.endOf("month")
.endOf("day")
.toISOString()}"}}]},
{
_and:[
{date_invoiced:{_is_null: true }},
{actual_completion: {_gte: "${moment()
.startOf("month")
.startOf("day")
.toISOString()}"}}, {actual_completion: {_lte: "${moment()
.endOf("month")
.endOf("day")
.toISOString()}"}}
]
},
{_and: [
{date_invoiced: {_is_null: true}},
{actual_completion: {_is_null: true}}
{scheduled_completion: {_gte: "${moment()
.startOf("month")
.startOf('day').toISOString()}"}}, {scheduled_completion: {_lte: "${moment()
.endOf("month").endOf('day').toISOString()}"}}]}
.startOf("month")
.startOf("day")
.toISOString()}"}}, {scheduled_completion: {_lte: "${moment()
.endOf("month")
.endOf("day")
.toISOString()}"}}
]}
]}) {
id