Staff Monthly Allowance Discount - Reoccurring Automatically

This setup allows for staff/employees to receive a pre-set dollar amount of free products/services each month. With an automatic reset at the beginning of each month.

While developing this setup, I was using “Staff Benefit Discount” (SBD), when thinking of a title for this post, Staff Monthly Allowance seemed to be a better fitting title. I did not want to redo tutorial & images for the different name.

3 new custom fields will be added to an entity type. This setup is looking for a value in what is called a “Benefit Amount” field. If found, it will check the “Benefit Month” if it set to the current month format. If not set to the current month, it will adjust the “Benefit Month” and the “Benefit Balance” the the proper values. Any “Benefit Balance” that is left, will be written over, the staff member will lose the previous months “Benefit Balance” amount.

Animation Explained: How To Setup Staff Benefit & Operations

In this animation, “Staff Customer 3” will get a $10 value entered into the “Benefit Amount” field (this is amount that will be carried over from month to month). Then the customer is going to be loaded into the POS screen. Then back to the customer search screen to view the info that was automatically entered in the 2 other fields*.

* In the tutorial has these fields hidden. I have them visible to show what information written in the fields.

Samba.Presentation_H6unzJ53s6

Animation Explained: Updating Staff Benefit Field

Continuing on from the previous animation, Staff Customer 3 will have a balance of $7.00 and the “Benefit Month” is set for the current month (formatted as <Year-Month>). Staff Member 1 has a benefit amount of $10, we will update it to $12, then load Staff Customer 1. Notice the Benefit Balance column has an amount of $3.25 and the Benefit month is set to the previous month. After loading the Staff customer, notice the Staff Discount button has a $12.00 balance, then will will go back to the Customer search to view the updated information. A sale will be made, using the Ticket Remaining amount. Than another sale will be made with the remaining amount greater than the discount that is available. The system will display the Staff Customer 1 Benefit Balance as an option.

Samba.Presentation_6Jb9qGCZSo

:exclamation: This tutorial is assuming a staff member is listed as a customer. If you have a separate staff entity, replace <customers> with your <staff entity> name.

Entity Type: Customers Additional Fields

Entities → Entity Types → Customers → Custom Fields

Custom Field Name Field Type Mask Type Editing Format Hidden
Benefit Amount Number Reg Ex ([0-9]*\.[0-9][0-9])? [x]
Benefit Balance Number Reg Ex [x]
Benefit Month String Reg Ex (\d{4}-(January|February|March|April|May|June|July|August|September|October|November|December))? [x]*

*This will use the format yyyy- (2025-January). If a seasonal worker should work 1 month of the year, the use of a year and month will prevent their discount from not being updated.

These fields are meant to be hidden. There is a chance that 1 or more fields may show up on the New Customers/Edit Customer screen (POS screen → Select Customer → New Customer ). To remove the fields, right click and select “Design Mode”. Select the field(s) and right click and choose the X icon (under the “Abc” button). Right click again in a blank area, and choose “Design Mode” to exit out of design mode.

New Ticket State

Settings → States → Add State

Name: Staff Benefit Discount
State Name: SBDStatus
State Type: Ticket State
Color: <blank>
Display Format: <blank>
Quantity Format: <blank>
Price Format: <blank>
Show on End of Day Report: Checked
Show on Product Report: unchecked
Show on Ticket: `Checked’

New Account

Accounts → Accounts → Add Account

Account Name: Staff Benefit Discount
Account Type: Discount Accounts
Currency: <blank>

New Transaction Type

Accounts → Transaction Types → Add Account Transaction Type

Account Transaction Type Name: Staff Benefit Discount Transaction
Source Account Type (Debit): Receivables Account
Target Account Type (Credit): Discount Accounts
Default Source Account: Receivables
Default Target Account: Staff Benefit Discount
Currency: <blank>

Calculation Type

Tickets → Calculation Types → Add Calculation Type

Template Name: Staff Benefit Discount
Account Transaction Type: Staff Benefit Discount Transaction
Calculation Method: Fixed Amount
Rate or Amount: 0
Max Amount: 0
Rounding: 0
Include Tax: unchecked
Decrease Amount: Checked
Use Plain Sum: unchecked
Toggle: unchecked
This calculations is about Ticket: unchecked

Automation Commands

1 of 1


Name: SBD - Staff Benefit Discount
Category: <blank>
Button Header: Staff Benefit\rDiscount\r<b>Bal: {ENTITY DATA:Customers:Benefit Balance}</b>
Color: Yellow
Font Size: 26
Confirmation: None or Admin Pin
Execute Once: Checked
Clear Selection: Checked
Toggle Values: unchecked
Ask Text Input: unchecked
Ask Numeric Input: unchecked
Values: <blank>
Mappings:
Enabled States: Staff Benefit Discount
Visible States: Staff Benefit Discount

Actions

Action 1 of 7

Action Name: SBD - Ask Question
Action Type: Ask Question
Question: [:title]
Buttons: [:buttons]
Description: [:explanation]
Automation Command Name: [:command name]
The remaining fields: <blank>

Action 2 of 7

Action Name: SBD - Execute Automation Command
Action Type: Execute Automation Command
Automation Command Name: [:command name]
Command Value: [:command value]
The remaining fields: <blank>

Action 3 of 7

Action Name: SBD - Update Benefit Balance
Action Type: Update Entity Data
Entity Type Name: Customers
Entity Name: {ENTITY NAME:Customers}
Field Name: Benefit Balance
Field Value: [:balance amount]

Action 4 of 7

Action Name: SBD - Update Benefit Month
Action type: Update Entity Data
Entity Type Name: Customers
Entity Name: {ENTITY NAME:Customers}
Field Name: Benefit Month
Field Value: {DATE:yyyy-MMMM}

Action 5 of 7

Action Name: SBD - Staff Benefit Discount Calculation
Action type: Update Ticket Calculation
Calculation Type: Staff Benefit Discount
Amount: [:amount]
The remaining fields: <blank>

Action 6 of 7

Action Name: SBD - Staff Benefit Discount Status - Ticket State
Action type: Update Ticket State
State Name: SBDStatus
Current State: <blank>
State: [:state]
The remaining fields: <blank>

Action 7 of 7

Action Name: Display Ticket
Action type: Display Ticket
Ticket Id: [:ticket id]

Rules

- Rule 1 of 7

Name: SBD - Staff Benefit Discount - Ask Amount - Step 1 - Benefit Balance

Event Name: Automation Command Executed

Constraints:
Automation Command Name Equals SBD - Staff Benefit Discount
{REMAINING TOTAL} Greater [=TN('{ENTITY CUSTOMDATA BY NAME:Customers.{ENTITY NAME:Customers}:Benefit Balance}')]

Actions: 1

Action Name: SBD - Execute Automation Command
Constraint: <blank>
command name: SBD - Staff Benefit Discount - Step 2
command value: [?Discount Amount;\d{0,2}(\.\d{1,2})?;{ENTITY DATA:Customer:Benefit Balance};ONC;]

- Rule 2 of 7

SBD - Staff Benefit Discount - Ask Amount - Step 1 - Remaining Balance

Event Name: Automation Command Executed

Constraint:
Automation Command Name Equals SBD - Staff Benefit Discount
{REMAINING TOTAL} Less [={ENTITY CUSTOMDATA BY NAME:Customers.{ENTITY NAME:Customers}:Benefit Balance} +.01]

Actions: 1

Action Name: SBD - Execute Automation Command
Constraint: <blank>
command name: SBD - Staff Benefit Discount - Step 2
command value: [?Discount Amount;\d{0,2}(\.\d{1,2})?;{REMAINING TOTAL};ONC;]

- Rule 3 of 7

SBD - Staff Benefit Discount - Ask Amount - Step 2 - Error

Event Name: Automation Command Executed

Constraint:
Automation Command Name Equals SBD - Staff Benefit Discount - Step 2
Command Value Greater {REMAINING TOTAL}
Command Value Greater {ENTITY DATA:Customers:Benefit Balance}

Actions 1:

Action Name: SBD - Ask Question
Constraint: '[=TN('{ENTITY DATA:Customers:Benefit Balance}')]' < '{TICKET TOTAL}'
title: You Have Entered An Amount That Is Too High.\rPlease Enter An Amount Less than or equal to <b>$ [= '{ENTITY DATA:Customers:Benefit Balance}' > '{TICKET TOTAL}' ? '{TICKET TOTAL}' : '{ENTITY DATA:Customers:Benefit Balance}' ]</b>
explanation: <blank>
buttons: OK
command name: SBD - Staff Benefit Discount

- Rule 4 of 7

SBD - Staff Benefit Discount - Ask Amount - Step 2 - Correct

Event Name: Automation Command Executed

Constraint:
Automation Command Name Equals SBD - Staff Benefit Discount - Step 2
Command Value Less [={REMAINING TOTAL}+.01]
Command Value Less [=TN('{ENTITY DATA:Customers:Benefit Balance}')+.01]

Actions 2:

Action Name: SBD - Staff Benefit Discount Calculation
Constraint: <blank>
amount: [:CommandValue]
Action Name: Display Ticket
Constraint: <blank>
ticket id: <blank>

- Rule 5 of 7

SBD - Update Staff Benefit Balance

Event Name: Ticket Closing

Constraint:
{TICKET STATE:SBDStatus} Equals Staff Benefit Discount
Remaining Amount Equals 0.00
{TICKET DETAILS:CA.Staff Benefit Discount} Is Not Null <blank>

Actions 1:

Action Name: SBD - Staff Benefit Balance
Constraint: <blank>
balance amount: [=F(TN('{ENTITY DATA:Customers:Benefit Balance}')+TN('{TICKET DETAILS:CA.Staff Benefit Discount}'), '0.00')]

- Rule 6 of 7

SBD - Update Data on Entity Selected

Event Name: Ticket Entity Changed

Constraint:
{ENTITY DATA:Customers:Benefit Amount} Is Not Null <blank>

Actions 3:

Action Name: SBD - Staff Benefit Month
Constraint: '{ENTITY DATA:Customers:Benefit Month}' != '{DATE:yyyy-MMMM}'
Action Name: SBD - Update Benefit Balance
Constraint: '{ENTITY DATA:Customers:Benefit Month}' != '{DATE:yyyy-MMMM}'
balance amount: [=F(TN('{ENTITY DATA:Customers:Benefit Amount}'),'0.00')]
Action Name: SBD - Staff Benefit Discount Status - Ticket State
Constraint: <blank>
state: Staff Benefit Discount

- Rule 7 of 7

SBD - Remove Calculation When Staff Changed

Event Name: Ticket Entity Changed

Constraints:
<none>

Actions 2:

Action Name: SBD - Staff Benefit Discount Calculation
Constraint: <blank>
amount: <blank>
Action Name: SBD - Staff Benefit Discount Status - Ticket State
Constraint: '{ENTITY DATA:Customers:Benefit Amount}' == ''
state: <blank>

Reports

Manage → Reports → Add Report

[Staff Benefit Discount Report:1,1,1,1]
>Ticket No|Items Total|Staff Discount|Ticket Amount
@{REPORT TICKET DETAILS:EN.Customers.asc:(TS.SBDStatus=Staff Benefit Discount)::,}
>$1 - Current Benefit Amnt: {REPORT ENTITY DETAILS:EC.Benefit Amount:(EN=$1)}
{REPORT TICKET DETAILS:T.TicketNumber,=[T.TotalAmount]-[CA.Staff Benefit Discount];0.00,CA.Staff Benefit Discount,T.TotalAmount:(TS.SBDStatus=Staff Benefit Discount) && (TEN.Customers=$1):{0}|$ {1}|$ {2}|$ {3}}
>{REPORT TICKET DETAILS:=[T.TotalAmount.sum]-[CA.Staff Benefit Discount.sum];0.00,CA.Staff Benefit Discount.sum,T.TotalAmount.sum:(TS.SBDStatus=Staff Benefit Discount) && (TEN.Customers=$1):Total|$ {0}|$ {1}|$ {2}}

Report Sample:

2 Likes