Listing samba cards by last used?

Been asked if there is a way of listing samba card by last used, a bit like when listing files by last modified.

He wants to list all accounts in order that they were last used on the till so he can see the people who no longer use their accounts.

He also later wants to see how many visits they have done on each card. I’m pretty sure I can do that with the store setting and a custom field in the entity though.

Any one have any ideas how I can get over the first bit?

Matt

I’m not sure it’s possible up to now. But I’m thinking of adding a custom entity field of last date visited and saving the final transaction for samba card card customers into a store setting. We could probably list then providing the date format is correct

With a bit of creative SQL/reporting it should be possible… joining ticket date where entity is selected with sort desc and limited to 1 will show last visit and ordering the entity list by that.
Q is probably the one to ask on that but pretty sure it could be achieved.

I’m not fully up on my sql so community help would be very much appreciated. Besides I feel it would be something useful to more than just my client

The Account Statement Tutorial pretty much does this already. By default, it lists Purchase and Payment transactions on the Customer Account in descending order by date, so you can see how long it has been since their account had any activity.

The difference I suppose in this case is that you are talking about Card Entities/Accounts rather than Customer Entities/Accounts, so it might be just a matter of changing the Entity Type in the SQL script (@@getStatement). That variable is hard-coded at the top of the script.

1 Like

I’ll have a look and see how I get in.

Just dived I to something bigger at the mo :o