Ask Question Action Limit Multiple Select & Staff Tips System

When using the ask question action and multiple select=true is there a way to limit the number of buttons selected?
I.e: Have 5 options but only allow 3 to be selected maximum.

Usage:
I am setting up a Staff Tips account to automate what is currently done with pen & paper.
Part of the flow is to ask the amount of tips and how many staff are working.
The next question asks which staff are working so as to split the total tips equally between them.
With a multiple choice ask question I need to limit the number of staff chosen to match the number of staff working.

Alternative is a single choice ask question but then I would need to loop back to ask which staff member and mark any staff members who have already received there cut of tips - thus preventing tips being allocated twice. Also would need to constrain to only run the same number of times as the number of staff working. This is a long winded way and involves a more complicated setup.

No there is not a way to do that. Not with the action.

Ok - thanks for the quick response Jesse :+1:

Long way around it is then :joy:

Could you not set working staff at shift start or something or have some basic form of clock in clock out on an entity screen and pull working staff automatically on ticket start or whatever?

Ok related question.

I need to update a data field in all entities of the same type (in this case Staff Entity).

This data field is used as basically a true or false check to see if tips have already been allocated to an account and if so don’t apply a transaction.

What I need to try to achieve is to clear this field after all tips have been allocated.
This can be achieved by creating a separate rule for each entity (load entity and update the data) - but this involves hardcoding each entity and would need a new rule every time a new member of staff is employed - I would prefer to do it all in one rule if possible.

I’m guessing this might be possible via a script but no idea where to start on the coding for it.

Script or loop values action.
I preffer scripts as gotten reasonable at them and makes single point to manage/update.
If you prefer rules and actions you would need to fire loop values action feeding in a report expression with comma separator something like report entity details: entity name where entity type is staff and entity data x is y.
The loop action will loop each value triggering an automation command event with set name passing the loop value in as the command value.
The command rule would do an update entity data action using entity name in command value and updating set field to whatever.
A script would function very similar, feed in list of entities, script would loop through them and use entity data helper function to update field.

Decided to use program values instead of entity data field.
Got it all working now but probably could streamline the number of rules/actions. :see_no_evil:

One thing I would like to do is have the entities listed automatically in an ask question as buttons rather than hard coding the options. That way when new entities (staff) are created they will automatically become choices in the ask question action. I’m sure there will be a way just need to do some more searching in the forum to work out how to implement it. Report entity details in a comma separated format perhaps?

I will post what I have done when I get it all looking more professional :joy:

You can use report tags to build your buttons. I have done that before. Trick is to use the format section of the report tag to format the output.

1 Like

Call a script from the cuttons field and have script return the expressions/list.

1 Like

I’ll get you an example but it would be something like

:{1}=command name:,}

You need to use comma for separator.

You could add more to it like color formatting etc. I have even used ternary inside it before to block some buttons from appearing

1 Like

Thanks Jesse
The following returns what I need.
{REPORT ENTITY DETAILS:E.Name.asc:(ET=Staff Tips):,}

I do like the idea of using a ternary to stop former staff entities being listed. Will look into that some more :+1:

Edit: probably best to filter out accounts which have a balance of zero.
This does the job I need for withdrawing tips from an account only if they have a balance which is not 0:

{REPORT ENTITY DETAILS:E.Name.asc,E.Balance.sum:(ET=Staff Tips):{0}::($2 != 0):,}

And this returns only staff which have a custom data field of Active set to Yes:

{REPORT ENTITY DETAILS:E.Name.asc:(ET=Staff Tips) AND (EC.Active=Yes)::,} 

Until now I have always used pen & paper to record tips given to staff on a shift then split them afterwards - sometimes some members of staff may have already left work for the evening before the tips are split and therefore a record needs to be kept so they can collect their tips on their next shift. I also at the moment find I am always short on change so encouraging staff not to take their tips until they reach £5 or £10 (or multiples thereof) has become a regular thing. This piece of paper may get lost or changed that often it becomes illegible - that’s where this new automated system comes in :slight_smile:

There are roughly 24 rules, 15 actions , 3 entity screens, 1 script, 1 entity type, 2 account types, 3 transaction types, 3 document types, 1 payment type, 1 report
This could probably (definitely) be streamlined a little more and there may even be a redundant action/rule but hey it works :slight_smile:

If you decide to give this a whirl as always make sure you backup your database first.

Optional

NV Close Screen Button (for Account Screen)

Create a new Automation Command
Name: NV Close Screen
Category: Navigation
Button Header: X
Color: Black
Font Size: 26
Tick Clear Selection
Delete any Mappings

Create a new Action
Name: NV Show Navigation Screen
Action Type: Navigate Module
Module Name: Navigation

Create a new Rule
Name: NV Close Screen
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Executed Equals NV Close Screen
Actions:

NV Show Navigation Screen

Close Entity Screen Button (for Entity Screen)

Create a new Automation Command
Name: Close Entity Screen
Category:
Button Header: < CLOSE >
Color: Black
Font Size: 26
Tick Clear Selection
Delete any Mappings

Create a new Action (You may already have a similar action to this)
Name: Close Entity Screen Open New
Action Type: Display Ticket
Ticket Id: 0

Create a new Rule
Name: NV Close Screen
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Executed Equals Close Entity Screen
Actions:

Close Entity Screen Open New

Required

Accounts

Go to Manage > Accounts

Create a new Account Type
Name: Staff Accounts

Create a new Account Type
Name: Transfer Accounts

Add a new Account (This is used as a holding account before tips are split between staff)
Account Name: Staff Tips
Account Type: Transfer Accounts

Create a new Account Screen (This can then be accessed via the admin navigation menu)
Name: Staff Accounts
Tick Display as Tree
Account Type > Select > Staff Accounts & Transfer Accounts
Automation Commands (optional) > Select >
Open Drawer (this opens cash drawer) & NV Close Screen (this takes us back to the navigation menu)

Create a new Entity Type
Name: Staff Tips
Entity Name: Staff
Custom Fields > Add Custom Field
Active (Field Type: String) (Mask Type: None)
Taken (Field Type: String) (Mask Type: None)
Accounting >
Account Type: Staff Accounts
Account Name Template: [Name]

Create a new Transaction Type
Name: New Tips Withdraw From Staff Account Transaction
Source: Staff Accounts
Target: Payment Accounts

Create a new Transaction Type
Name: New Tips Transaction
Source: Receivable Accounts
Target: Transfer Accounts
Default Source: Receivables
Default Target: Staff Tips

Create a new Transaction Type
Name: New Tips To Staff Account Transaction
Source: Transfer Accounts
Target: Staff Accounts
Default Source: Staff Tips

Create a new Document Type
Name: New Tips Transfer to Hold Account
Button Header: Transfer Cash
Account Type: Transfer Accounts
Default Amount: Balance
Description Template: Transfer Cash Tips Payment
Document Type >
Add Transaction Type > New Tips Transaction

Create a new Document Type
Name: New Tips Transfer from Hold Account
Button Header: Transfer Cash
Account Type: Staff Accounts
Default Amount: Balance
Description Template: Transfer Cash Tips Payment
Document Type >
Add Transaction Type > New Tips To Staff Account Transaction

Create a new Document Type
Name: New Tips Withdraw from Staff Account
Button Header: Withdraw Cash
Account Type: Staff Accounts
Default Amount: Balance
Description Template: Withdraw Cash Tips Payment
Document Type >
Add Transaction Type > New Tips Withdraw from Staff Account Transaction

Add a Payment Type
Template Name: Staff Account
Account Transaction Type: Staff Cash Payment
Mappings: Add default mapping * * * etc

Ticket Types

Go to Ticket Types > Ticket > Entity Type List > Select Staff Tips (tick copy)

Entity Screens

Go to Entities > Entity Screens

Create a new Entity Screen
Name: Staff Tips Screen
Button Header: Staff Tips
Ticket Type: Ticket
View Mode: Layout
Entity List: Entity Type: Staff Tips
Mappings: Add default mapping * * * etc

Create a new Entity Screen
Name: Staff Tips Account Screen
Button Header: Staff Tips
Ticket Type: Ticket
View Mode: Custom
Entity List: Entity Type: Staff Tips
Mappings: Add default mapping * * * etc

Create a new Entity Screen
Name: Staff Tips Edit Accounts Screen
Button Header: Staff Entities
Ticket Type: Ticket
View Mode: Search
Entity List: Entity Type: Staff Tips
Mappings: Add default mapping - Map to Admin only

Reports

Go to Reports > Reports

Create a new Report
Name: Staff Account List
Template:

[Account Balance:1,1]
>Name| Balance
{REPORT ENTITY DETAILS:E.Name.asc,E.Balance:(ET=Staff Tips) AND (EC.Active=Yes) :{0}|{1}}
Scripts

Many thanks to Markjw whom I shamelessly stole this script from

Go to Automation > Scripts

Create a new Script
Name: Clear Entity Data Field
Handler: @@ClearEntityDataField
Script:

function clearCustomField() {
	var entityType = 'Staff Tips';
	var entityCustomField = 'Taken';
	
	// Get entities
	qry = "SELECT count([Name]) as [CT] FROM [Entities] WHERE [EntityTypeId]=(SELECT [Id] FROM [EntityTypes] WHERE [Name]='"+entityType+"')";
	var entityCount = sql.Query(qry).First;
	
	qry = "SELECT [Name] FROM [Entities] WHERE [EntityTypeId]=(SELECT [Id] FROM [EntityTypes] WHERE [Name]='"+entityType+"') ORDER BY [Name]";
	var entities = sql.Query(qry).Delimit(',').All;
	
	for (var n = 0; n < entityCount; n++) {
	
		entityName = entities[n];
		
		// Clear custom field
		api.Entity(entityName).Data(entityCustomField).Update('No');
	
	} 
		
	return true;
}
Automation Commands

Go to Automation > Automation Commands

Create a new Automation Command
Name: ST_New Tips
Category:
Button Header: New Tips
Tick Clear Selection
Delete any Mappings

Create a new Automation Command
Name: ST_Take Tips
Category:
Button Header: Take Tips
Tick Clear Selection
Delete any Mappings

Edit Entity Screens

Go to POS
Click Select Staff

Enter Design Mode on the Staff Tips Entity Screen

Create a new Automation Command Button
Settings >
Command Name: ST_New Tips
Caption: Add Tips to Account
Font Size: 40

Create a new Automation Command Button
Settings >
Command Name: ST_Take Tips
Caption: Withdraw Tips from Account
Font Size: 40

Create a new Automation Command Button
Settings >
Command Name: PayWithTips
Caption: Pay Ticket with Tips
Font Size: 40

Optional (This button closes the entity screen and returns to the POS - similar to the big X at the top left of your screen)
Create a new Automation Command Button
Settings > Command Name: Close Entity Screen
Caption: Go back to EPOS
Font Size: 40

Position the buttons where you think best and add colour if you wish

Exit Design Mode

Go to Staff Accounts Entity Screen

Enter Design Mode

Add a custom Report Viewer
Report Name: Staff Accounts List

Create a new Automation Command Button
Settings >
Command Name: PrintBalanceReport
Caption: PRINT BALANCE REPORT
Font Size: 40

Position the report and button as you see fit

Exit Design Mode

Now the fun part …

ACTIONS

Go to Automation > Actions

Show Actions

Create a new Action
Action Type: Print Report
Report Name: Staff Account List
Printer Name: Ticket Printer

Create a new Action
Name: ST_Ask Question
Action Type: Ask Question
Question: [:Question]
Buttons: [:Buttons]
Description: [:Description]
Automation Command Name: [:Automation Command Name]
The next two parameters are optional should you wish to customize the colour of the popup box
Background Color: [:Background Colour]
Transparent Color: [:Transparent Colour]
Multi Select: False

Create a new Action
Name: ST_Change Staff Entity
Action Type: Change Ticket Entity
Can Create Ticket: True
Entity Type Name: Staff Tips
Entity Name: [:Entity Name]
Entity Search Value: [:Entity Search Value]

Create a new Action
Name: ST_Change Transfers Entity
Action Type: Change Ticket Entity
Can Create Ticket: True
Entity Type Name: Transfers
Entity Name: [:Entity Name]
Entity Search Value: [:Entity Search Value]

Create a new Action
Name: ST_Create Account Transaction Document
Action Type: Create Account Transaction Document
Account Transaction Document Name: [:Transaction Document Name]
Account Name: [:Account Name]
Account Id: [:Account Id]
Date: [:Date]
Description: [:Description]
Amount: [:Amount]

Create a new Action
Name: ST_Execute Automation Command
Action Type: Execute Automation Command
Automation Command Name: [:Automation Command]
Command Value: [:Command Value]
Background: [:Background]
Delay: [:Delay]

Create a new Action
Name: ST_Execute Script
Action Type: Execute Script
Function: [:Handler.Function]
Run In Background: False

Create a new Action
Name: ST_Load Entity
Action Type: Load Entity
Entity Type Name: Staff Tips
Entity Name: [:Entity Name]
Entity Search Value: [:Entity Search Value]

Create a new Action
Name: ST_Transfers Entity
Action Type: Load Entity
Entity Type Name: Transfers
Entity Name: [:Entity Name]
Entity Search Value: [:Entity Search Value]

Create a new Action
Name: ST_Navigate to POS
Action Type: Navigate Module
Module Name: Pos

Create a new Action
Name: ST_Show Message
Action Type: Show Message
Message: [:Message]

Create a new Action
Name: ST_Update Entity Data
Action Type: Update Entity Data
Entity Type Name: Staff Tips
Entity Name: [:Entity Name]
Field Name: [:Field Name]
Field Value: [:Field Value]

Create a new Action
Name: ST_Update Program Setting
Action Type: Update Program Setting
Setting Name: [:Setting Name]
Setting Value: [:Setting Value]
Update Type: Update
Is Local: True

Create a new Action
Name: ST_Update Program Setting Number
Action Type: Update Program Setting
Setting Name: [:Setting Name]
Setting Value: [:Setting Value]
Update Type: Decrease
Is Local: True

Create a new Action (you may already have a variation of this)
Name: Close Entity Screen Open New
Action Type: Display Ticket
Ticket Id: 0

Now the really really fun part …

RULES

Go to Automation > Rules

Print Report

Create a new Rule - This rule prints off a balance report so you can have a paper copy of current staff balances
Name: ST_PrintBalanceReport
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Name Equals PrintBalanceReport
Actions:

Print Staff Balance Report

Pay Ticket with Tips

Create a new Rule - This rule allows staff to pay for products directly from their tips account
Name: ST_Pay With Tips Open New Ticket Load Entity
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Name Equals PayWithTips
Actions:

ST_Change Staff Entity
Entity Name: {SETTING:CURRENTUSER}

ST_Navigate to POS

Withdrawal of Staff Tips

Create a new Rule
Name: ST_1 Take Tips AC Pressed
Event Name: Automation Command Executed
Custom Constraint :
Automation Command Name Equals ST_Take Tips
Actions:

ST_Ask Question
Question: Please select staff member to take tips
Buttons: {REPORT ENTITY DETAILS:E.Name.asc,E.Balance.sum:(ET=Staff Tips):{0}::($2 != 0):,},Cancel=TakeCancel
Description: Select staff member to withdraw tips from account. (Note - Only staff with credit will be shown)
Automation Command Name: ST_AskTipsTake

Create a new Rule
Name: ST_2 Take Tips Load Entity
Event Name: Automation Command Executed
Matches All
Custom Constraint :
Automation Command Name Equals ST_AskTipsTake
Command Value Not Equals TakeCancel
Actions:

ST_Update Program Setting
Setting Name: ST_StaffEntity
Setting Value: [:CommandValue]

ST_Change Staff Entity
Entity Name: {:ST_StaffEntity}

ST_Execute Automation Command
Automation Command: ST_AskAmount

Create a new Rule
Name: ST_3 Take Ask Amount
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Name Equals ST_AskAmount
Actions:

ST_Update Program Setting
Setting Name: ST_TakeDescription
Setting Value: {:CURRENTUSER}

ST_Ask Question
Question: How much would you like to take?
Buttons: 5,10,15,20,25,30,Cancel=TakeCancel
Description:
Automation Command Name: ST_AskAmountCheck

Create a new Rule
Name: ST_3a Take Ask Amount Check
Event Name: Automation Command Executed
Matches All
Custom Constraint:
Automation Command Name Equals ST_AskAmountCheck
Command Value Not Equals TakeCancel
Actions:

ST_Update Program Setting
Setting Name: ST_AmountTake
Setting Value: [:CommandValue]

ST_Ask Question
Question: Are you sure you wish to take £{:ST_AmountTake} from {:ST_StaffEntity}
Buttons: Yes=TakeYes,No=TakeCancel
Description:
Automation Command Name: ST_ApplyDebit

Create a new Rule
Name: ST_4 Take Tips Apply Debit
Event Name: Automation Command Executed
Matches All
Custom Constraint:
Automation Command Name Equals ST_ApplyDebit
Command Value Equals TakeYes
[=F(TN('{REPORT ENTITY DETAILS:E.Balance.asc:(EN={:ST_StaffEntity})::}'))] Greater [=F(TN('{:ST_AmountTake}'))]
Actions:

ST_Create Account Transaction Document
Transaction Document Name: New Tips Withdraw from Staff Account
Account Name: {:ST_StaffEntity}
Date: {DATE} {TIME}
Description: Current User Logged in recorded as {:ST_TakeDescription}
Amount: [=F(TN('{:ST_AmountTake}'))]

ST_Show Message
Message: Please take your tips {:ST_StaffEntity}

ST_Execute Automation Command
Automation Command: ST_TakeClearSettings

Clone the above rule and edit it (ST_4 Take Tips Apply Debit)
Change the name so it does not clash with the existing rule name
Name: ST_4a Take Tips Apply Debit
Change the 3rd constraint to Equals like this:
[=F(TN('{REPORT ENTITY DETAILS:E.Balance.asc:(EN={:ST_StaffEntity})::}'))] Equals [=F(TN('{:ST_AmountTake}'))]

Create a new Rule
Name: ST_4 Take Tips Apply Debit Insufficient Funds
Event Name: Automation Command Executed
Matches All
Custom Constraint:
Automation Command Name Equals ST_ApplyDebit
Command Value Equals TakeYes
[=F(TN('{REPORT ENTITY DETAILS:E.Balance.asc:(EN={:ST_StaffEntity})::}'))] Less [=F(TN('{:ST_AmountTake}'))]
Actions:

ST_Show Message
Message: Sorry you have insufficient funds in your account to withdraw £{:ST_AmountTake}

ST_Execute Automation Command
Automation Command: ST_TakeClearSettings

Create a new Rule
Name: ST_5 Take Clear Settings
Event Name: Automation Command Executed
Matches All
Custom Constraint:
Automation Command Name Equals ST_TakeClearSettings
Command Value Not Equals TakeCancel
Actions:

ST_Update Program Setting
Setting Name: ST_StaffEntity
Setting Value:

ST_Update Program Setting
Setting Name: ST_TakeDescription
Setting Value:

ST_Update Program Setting
Setting Name: ST_AmountTake
Setting Value:

Open Cash Drawer ( or whatever your existing Action is to do this)

Close Entity Screen Open New

Staff Tips Close Ticket

Distribution of Staff Tips

Create a new Rule
Name: ST_1 New Tips AC Pressed
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Name Equals ST_New Tips
Actions:

ST_Change Transfers Entity
Entity Name: Staff Tips

ST_Update Program Setting
Setting Name: ST_TotalTips
Setting Value: [?Amount of Tips £;;;ONC]

ST_Update Program Setting
Setting Name: ST_TotalStaff
Setting Value: [?Amount of Staff;;;ONC]

ST_Execute Automation Command
Automation Command: ST_NewTipsAsk

Create a new Rule
Name: ST_2 New Tips Ask
Event Name: Automation Command Executed
Matches All
Custom Constraint:
Automation Command Name Equals ST_NewTipsAsk
{SETTING:ST_TotalTips} Is Not Null
{SETTING:ST_TotalStaff} Is Not Null
Actions:

ST_Ask Question
Question: Total Tips £: {:ST_TotalTips}\rTotal Staff: {:ST_TotalStaff}\rIs this correct?
Buttons: Yes=TipsCorrect,No=TipsWrong,Cancel=TipsCancel
Description:
Automation Command Name: ST_AskTipsStaffCorrect

Create a new Rule
Name: ST_3 Select Staff Tips Blank TotalStaff Input
Event Name: Automation Command Executed
Matches All
Custom Constraint:
Automation Command Name Equals ST_NewTipsAsk
{SETTING:ST_TotalStaff} Is Null
Actions:

ST_Show Message
Message: Please input number of staff working

ST_Execute Automation Command
Automation Command: ST_New Tips

Create a new Rule
Name: ST_3 Select Staff Tips Blank TotalTips Input
Event Name: Automation Command Executed
Matches All
Custom Constraint:
Automation Command Name Equals ST_NewTipsAsk
{SETTING:ST_TotalTips} Is Null
Actions:

ST_Show Message
Message: Please input number tips amount

ST_Execute Automation Command
Automation Command: ST_New Tips

Create a new Rule
Name: ST_3 Select Staff Tips Wrong
Event Name: Automation Command Executed
Matches All
Custom Constraint:
Automation Command Name Equals ST_AskTipsStaffCorrect
Command Value Equals TipsWrong
Actions:

ST_Execute Automation Command
Automation Command: ST_New Tips

Create a new Rule
Name: ST_3 Select Staff Tips Correct
Event Name: Automation Command Executed
Matches All
Custom Constraint:
Automation Command Name Equals ST_AskTipsStaffCorrect
Command Value Equals TipsCorrect
{SETTING:ST_TotalTips} Is Not Null
{SETTING:ST_TotalStaff} Is Not Null
Actions:

ST_Update Program Setting
Setting Name: ST_SplitTips
Setting Value: [=F(TN('{:ST_TotalTips}') / ('{:ST_TotalStaff}'))]

ST_Update Program Setting
Setting Name: ST_TotalStaffRemaining
Setting Value: [=TN('{SETTING:ST_TotalStaff}')]

ST_Create Account Transaction Document
Transaction Document Name: New Tips Transfer to Hold Account
Account Name: Staff Tips
Date: {DATE} {TIME}
Description: Transfer new tips to temporary account
Amount: [=F(TN('{:ST_TotalTips}'))]

ST_Execute Automation Command
Automation Command: ST_AskWhichStaff

Create a new Rule
Name: ST_4 Ask Which Staff
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Name Equals ST_AskWhichStaff
Actions:

ST_Ask Question
Question: Please select staff members who are working
Buttons: {REPORT ENTITY DETAILS:E.Name:(ET=Staff Tips) && E.GetCustomData("Active") = "Yes" && E.GetCustomData("Taken") = "No":,},Cancel=TCancel
Description: Select staff member ( {:ST_TotalStaffRemaining} remaining) to share £ {:ST_TotalTips} which is £ {:ST_SplitTips} each
Automation Command Name: ST_WhoWorking

Create a new Rule
Name: ST_5 Confirm Who Working or Cancel
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Name Equals ST_WhoWorking
Actions:

ST_Update Program Setting
Constraint: '[:CommandValue]' != 'TCancel'
Setting Name: ST_StaffEntity
Setting Value: [:CommandValue]

ST_Ask Question
Constraint:[:CommandValue]' != 'TCancel'
Question: Please confirm {:ST_StaffEntity} is to receive {:ST_SplitTips}
Buttons: Confirm=TipsConfirm,Cancel=TipsCancel
Description: Once you confirm this can not be undone
Automation Command Name: ST_LoadEntity

ST_Ask Question
Constraint: '[:CommandValue]' == 'TCancel'
Question: You have selected cancel. There are still unissued tips of £{:ST_SplitTips}
Buttons: Go Back=TipsCancel,Cancel=SuperCancel
Description: Once you confirm cancel this can not be undone
Automation Command Name: ST_LoadEntity

Create a new Rule
Name: ST_6 Load Entity Tips Confirm or Cancel
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Name Equals ST_LoadEntity
Actions:

ST_Change Staff Entity
Constraint: '[:CommandValue]' == 'TipsConfirm'
Entity Name: {:ST_StaffEntity}

ST_Execute Automation Command
Constraint: '[:CommandValue]' == 'TipsConfirm'
Automation Command: ST_CheckAllocated

ST_Execute Automation Command
Constraint: '[:CommandValue]' == 'TipsCancel'
Automation Command: ST_AskWhichStaff

Create a new Rule
Name: ST_7 Check if Tips Already Allocated
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Name Equals ST_CheckAllocated
Actions:

ST_Execute Automation Command
Constraint: '{REPORT ENTITY DETAILS:EC.Taken:(EN={:ST_StaffEntity})::,}' != 'Yes'
Automation Command: ST_ApplyCredit

ST_Show Message
Constraint: '{REPORT ENTITY DETAILS:EC.Taken:(EN={:ST_StaffEntity})::,}' == 'Yes'
Message: £{:ST_SplitTips} Tips have already been allocated to the account of {:ST_StaffEntity}\rPlease choose a different staff member.

ST_Execute Automation Command
Constraint: '{REPORT ENTITY DETAILS:EC.Taken:(EN={:ST_StaffEntity})::,}' == 'Yes'
Automation Command: ST_AskWhichStaff

Create a new Rule
Name: ST_8 Apply Credit
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Name Equals ST_ApplyCredit
Actions:

ST_Create Account Transaction Document
Transaction Document Name: New Tips Transfer from Hold Account
Account Name: {:ST_StaffEntity}
Date: {DATE} {TIME}
Description: Staff Tips allocated by {:CURRENTUSER} to {:ST_StaffEntity}
Amount: [=F(TN('{:ST_SplitTips}'))]

ST_Update Entity Data
Entity Name: {:ST_StaffEntity}
Field Name: Taken
Field Value: Yes

ST_Show Message
Message: £{:ST_SplitTips} Tips have been allocated to the account of {:ST_StaffEntity}

ST_Execute Automation Command
Automation Command: ST_UpdateAllocatedTipsSettings

Create a new Rule
Name: ST_9 Update Staff Remaining
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Name Equals ST_UpdateAllocatedTipsSettings
Actions:

ST_Update Program Setting Numner
Setting Name: ST_TotalStaffRemaining
Setting Value: 1

ST_Execute Automation Command
Automation Command: ST_CheckAllTipsAllocated

Create a new Rule
Name: ST_10 Check if All Tips Allocated
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Name Equals ST_CheckAllTipsAllocated
Actions:

ST_Refresh Ticket

ST_Execute Automation Command
Constraint: [=TN('{:ST_TotalStaffRemaining}')] != 0
Automation Command: ST_AskWhichStaff

ST_Show Message
Constraint: [=TN('{:ST_TotalStaffRemaining}')] == 0
Message: All Tips Have Been Allocated

ST_Execute Automation Command
Constraint: [=TN('{:ST_TotalStaffRemaining}')] == 0
Automation Command: ST_ClearSettings

Create a new Rule
Name: ST_11 Clear Settings All Tips Applied
Event Name: Automation Command Executed
Custom Constraint:
Automation Command Name Equals ST_ClearSettings
Actions:

ST_Execute Script
Handler.Function: @@ClearEntityDataField.clearCustomField()

ST_Update Program Setting
Setting Name: ST_TotalTips
Setting Value:

ST_Update Program Setting
Setting Name: ST_TotalStaff
Setting Value:

ST_Update Program Setting
Setting Name: ST_SplitTips
Setting Value:

ST_Update Program Setting
Setting Name: ST_Staff Entity
Setting Value:

Close Entity Screen Open New

Staff Tips Close Ticket

Open Cash Drawer (or what ever your existing action is called)

Now go to the POS screen
Click Select Staff > Staff Entities (Entity Screen) >
Now create your staff member entities, for each one set:
Active: Yes
Taken: No
Also click Create Account

If a staff member was to leave you can change the Active to “No” to prevent them showing in the Staff Accounts Report Screen and as an option in the ask questions.

That’s it your all setup and ready to give it a try :slight_smile:

Once you have finished testing you can delete the test transactions via Manage > Accounts > Transactions