Club Membership renewing Members Card expiry date

Hello everyone,

I am trying to setup a social club with members.
Club members pay a fee once a year, they receive a members cards. The members card is used to swipe on the sambapos till, when the card is swiped the member they have discounted prices on products / drinks at the bar. I have this part working okay using price definitions.

When adding a club member using Entities, we add the expiry date of the card. ie if todays date is 17/08/2023 we manually type in 17/08/2024 in to the Entity - Expiry Date field.

When swiping the members card, we have a Sambapos rule which checks the date of the Entity Expiry Date field to the current date of the system. If the date is over 1 year / 365 days a pop up is displayed to day this member has expired. Along with a another rule which change a 2nd field named Member status to 0. This stops sambapos searching the price definition field for members prices.

When a member wants to renew their membership card. They pay a fixed amount for another year, at the moment we have to manually type in the members expiry date field the new date. I have searched and searched through this forum and seen the questioned asked, and tried the examples of others. I was hoping we could come up with a solid answer how to achieve this. I’m sure a lot of you would agree to this, as sambapos does and excellent job for Pubs / Restaurants but we are missing clubs.

I have managed to achieve so far adding 1 year to the expiry date. But this is not adequate enough for a club environment because of these scenarios of club members.

  1. Adding a new member, field to automatically enter the date of 1 year from the current system date.

  2. Member wanting to renew membership before the expiry date (before card expires). I.E
    Today’s date is 17/08/2023
    Card Expiry is 30/08/2023
    When renewing the expiry date automatically changes to 30/08/2023. Other wise the member loses 13 days of membership.

  3. Card has expired IE

Today’s date is 17/08/2023
Card expired 17/07/2023 (a month a go)
When renewing the rule will automatically change the date to 17/08/2023 (1 year from current date)

This is screen shots and gif of what I have so far achieve for renewing dates

Recording 2023-08-17 041637

I’m hoping we could all pull together on this to clear this up once and for all for everyone here.

PS using sambapos 5.5.4
I have read through VIP, Club Members, expiry dates etc for 3 weeks. Completley stumped on this one

HI @appygrab

very interesting problem you have going on. Its not very often questions are asked with such detailed processes

I’d be happy to help you but I am not sure what the question is, what do you need help solving?

You need to be able to add an entity and it will automatically offer 1 year from date of entry?

You are going to need to add another constraint to your rule. Something like:
{ENTITY DATA:Members:Expiry Date} Greater [=FD(ADD('{DATE}',1),'dd/MM/yyyy')]

* Adding a 1 day to the current date will include the current date in the Greater operator. Otherwise it will look for any date before the current date.

You will need to add another rule with the same Automation Command Name and similar second constraint. This time you will need to change the 2nd constraint it to look like this:
{ENTITY DATA:Members:Expiry Date} Less {DATE:dd/MM/yyyy}

You will need the same actions and information, except in your first action, in the fieldValue, change the section {ENTITY DATA:Members Expiry Date} to {DATE} keeping the rest of the formula.

* If the constraint is not working correctly, you may have to format the Expiry Date field as a date using the [=FD....]

I’ve add the first constant only, to avoid conflicts.
Selected a member who’s members card is valid, expiry date runs out in the future. The rule isn’t changing the date, it remains the same.

I haven’t set a format for the Expiry Date field using [=FD…] . I am unsure where to put this and the full command


Try this:
[=FD({ENTITY DATA:Members:Expiry Date}','dd/MM/yyyy').substr(0,10)]

I see I made a mistake in the contraint. Instead of adding 1 day it should be subtracting 1 day. It should look like this: