Customer Purchase History Reporting


:slight_smile: Great. Your intuitive solution would be much better. I’ll try to implement better widget bridging features on further releases.


Ok One problem though that does not filter the date so thats my next thing to fix. It should be just inserting the right parameter into an expression.

@Emre this is what I was trhinking… but i cant get this to work obviously the time format has colons.

{REPORT ORDER DETAILS:O.TotalPrice.sum:(TENC.Customer=$2) and O.CreatedDateTime>=XXXXX}


You’ll define reporting date via Refresh Custom Report Widget action’s Date Filter parameter. Let me check what values that parameter supports.


That makes sense. So I can stop trying to add an expression to the tag?


Yes no need to define date expressions inside tags.


Hmm I looked up that action and you documented everything but the Date Filter parameters. In meantime I am trying to guess :stuck_out_tongue:


It supports

This Month
Past Month
This Week
Past Week
Last 10 Days (10 can be anything)
A date that represtents start date.

Unfortunately there is no date range… bah.


So that is the only snag for this working with Report tags vs SQL. I will keep this test setup just in case we visit it again in future. For now his SQL solution is great :stuck_out_tongue:


I added Date1 <> Date2 syntax for next update.


So this should work?


This is really cool - can this work in Samba Pos 4?


No. This will not work in V4.

The Tutorial contains several elements that are only available in V5.


where is that I can’t find


##PH Set Report Parameters [Automation Command Executed] (Rule)##

Rule Name: PH Set Report Parameters
Event Name: Automation Command Executed
Rule Tags:
Custom Constraint List (1):
Execute Rule if: Matches
Automation Command Name Equals PH Set Report Parameters

##Actions (7):##

PH Store Setting

Constraint: ‘[:CommandValue]’ == ‘’

settingName: PHEntityId
settingValue: {REPORT SQL DETAILS:SELECT TOP 1 e.[Id] FROM [Entities] e JOIN [EntityTypes] et on et.[Id]=e.[EntityTypeId] WHERE et.[Name]='Customers' ORDER BY e.[Id]:F.Id}
PH Store Setting

Constraint: ‘[:CommandValue]’ != ‘’

settingName: PHEntityId
settingValue: [:CommandValue]
PH Store Setting

Constraint: ‘[:CommandValue]’ == ‘’

settingName: PHEntityName
settingValue: {REPORT SQL DETAILS:SELECT e.[Name] FROM [Entities] e WHERE e.[Id]='{SETTING:PHEntityId}':F.Name}
PH Store Setting

Constraint: ‘[:CommandValue]’ != ‘’

settingName: PHEntityName
settingValue: {REPORT SQL DETAILS:SELECT e.[Name] FROM [Entities] e WHERE e.[Id]='[:CommandValue]':F.Name}
PH Store Setting

Constraint: ‘{SETTING:PHDateBEG}’ == ‘’

settingName: PHDateBEG
settingValue: [='{DATE:yyyy-MM}'+'-01']
PH Store Setting

Constraint: ‘{SETTING:PHDateEND}’ == ‘’

settingName: PHDateEND
settingValue: [=ADM('{DATE:yyyy-MM}'+'-01',1)]
PH Store Setting

Constraint: ‘{SETTING:PHDateEND}’ == ‘’

settingName: PHDateEND
settingValue: [='{:PHDateEND}'.substr(0,10)]


Not sure if its just me, but the properties for the entity search isn’t asking what entity?

The settings detailed here do not correspond with the settings on the widget editor.

I have the latest beta release.



I don’t understand what you are saying.

Show the Settings (not Properties) of your Entity Search Widget. Ensure the Widget setting for the Entity Type is set properly to match the name of your “Customers” Entity Type.

The screenshot in the Tutorial combines Widget Properties and Settings, and the Parameters are not necessarily in the same order in the screenshot as the order in the Widget Settings itself, because the image is created dynamically by reading the DB to speed up creating Tutorials using a tool that I created named “Tutorial Builder Helper” (TBH). There may also be more Settings for a Widget in later versions of SambaPOS than those shown in the image, because certain feature additions may have been made in later versions.

Also, ensure the Entity Screen configuration is set to use the “Customers” Entity Type.


I have import the db but it is not showing any display (no customer history )

Any idea how to fix it
Can you please tell me
In which order I have to input date dd/mm/yyyy or dd-mm-yyyy


Ok, so ive redone this just now.

I cheated and did the DB import, put into text wrangler and did a search and replace “customer” for “SquareCard”.

Imported and it seems to work ok, it says how much the customer has spent but doesn’t list the items or dates?

Edit, i think its cos some of the entities are Customer and Customers, i have SquareCard and SquareCard Customer Card… so isnt listing correctly


Hi, thank you very much for the Customer Purchase History, We need some change let us know if that is possible,
While we Select the customer first and take his order on the same page if we can get a customer history button ( a image is shown below)

and just by pressing it if it can show the all the previous transaction without entering the date, that is report upto date,

Like the report in the image.
This will help us know customer bill wise and also if some Ticket note is entered we can know his previous comment and see how best we can improve now.

thank you.


… deleted double post …