AOR - Date Conditions - "Month"

Hi SuiteCRM :slight_smile:

Wondering if anyone has had this issue / how to resolve

We are writing a report for “Sales” over the past 3 months

In AOR we are able to do the following conditions

Start Date / Greater Than or Equal to / Date / Now / - / 3 / Months

Now this does work but it is limited in the results

Now is 11/09/2018

  • 3 months

= 11/06/2018

In my “sales report” for the “last 3 months”

I am now technically missing all sales from 01/06/2018 > 11/06/2018

Thought in the “date” options, additional to “Now” “Today” and “Date Created” etc there could be the Period options like “This Month”

I seem to be between the two options “Date” and “Period” one gives me the month and the other gives me the ability to say “Greater than or equal to”

End result I am aiming for is

To be able to say if it the Start Date “is greater than or equal to” / “This Month” / " - 3 Months"

So if I am in “September” it takes the entire month, - 3 months, June and includes all of June in the result


One thing I don’t understand from your description: do you think this is a bug in the current functionality, or are you asking for an enhancement? Thanks

I would say this is an enhancement to the existing AOR - Or do you know an existing workaround within the current condition feature?

To be able to put conditions together for it to show results for the full “month” and the 3 full months before?

The report conditions being based on “now” limit it to the specific day but if the option “this month” was available it would include the entire month

I’m afraid I don’t know of any way to do it with the current available options…

Unless you try playing with Workflows and Calculated Fields, to set up an auxiliary field which you can then use in the report.

1 Like

Maybe you could do something like the following:
. create somewhere a custom field in which you calculate with a workflow calculated field the last (or first) day of the current month and let this workflow run every night.

(alternatively you could create a config variable inside config_override.php and run a custom scheduler every night at 0.00 that updates the value (not complicated)

Then your report could refer to the value (eithr config or where you decided to store it) and act accordingly.

Obviously this is a hack but it should allow you to get what you are looking for. I would prefer the custom scheduler route, which would give you more flexibility and manipulate all what you need. You may add other config values that could instruct the custom scheduler and tell it what to calculate, the number of months or even calculate a number of other values for you and store them in the config array.

Your suggested enhancement would clearly be the best solution.

I see that Pedro and I have had the same idea at the same time!!! :wink:

1 Like