1

We have civi 5.53 and Wordpress.

I am wanting to deal with overdue memberships. We have an end date of the last day of the month. Start date doesn't work for us so using end date.

I can use the option for month before previous month to get all our 30 day overdues. I would like to be able to find all those end dates for membership that are 3 months and 4 months over due.

I'm wanting this to be an automatic search - so whilst I can do this manually does anyone know how I could do this so that I can save a report with the criteria in for 3 months and 4 months ago?

1 Answer 1

4

Have you tried using Search Kit?

enter image description here

Code:

[
  [
    "SavedSearch",
    "save",
    {
      "records": [
        {
          "name": "Last_4_month",
          "label": "Last 4 month",
          "form_values": null,
          "mapping_id": null,
          "search_custom_id": null,
          "api_entity": "Membership",
          "api_params": {
            "version": 4,
            "select": [
              "id",
              "Membership_Contact_contact_id_01.display_name",
              "end_date"
            ],
            "orderBy": [],
            "where": [
              [
                "end_date",
                "<=",
                "now - 4 month"
              ]
            ],
            "groupBy": [],
            "join": [
              [
                "Contact AS Membership_Contact_contact_id_01",
                "LEFT",
                [
                  "contact_id",
                  "=",
                  "Membership_Contact_contact_id_01.id"
                ]
              ]
            ],
            "having": []
          },
          "expires_date": null,
          "description": null
        }
      ],
      "match": [
        "name"
      ]
    }
  ]
]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.