Updated projected monthly sales.

This commit is contained in:
Patrick Fic
2022-02-07 18:31:06 -08:00
parent 356928ce77
commit 76fb8f453d

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