# SambaCard, need AddFund button on CashScreen

**URL:** <https://forum.sambapos.com/t/sambacard-need-addfund-button-on-cashscreen/2457>\
**Category:** V4 Question\
**Created:** [September 7, 2014, 3:56am UTC](https://forum.sambapos.com/t/sambacard-need-addfund-button-on-cashscreen/2457 "2014-09-07T03:56:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![strashy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/ed8c4c/32.png) [@strashy](https://forum.sambapos.com/u/strashy)\
**Post date:** [September 7, 2014, 3:56am UTC](https://forum.sambapos.com/t/sambacard-need-addfund-button-on-cashscreen/2457/1 "2014-09-07T03:56:53Z")

</div>

Hello, after trying to put SambaCard in action. I decided to stop using Cash and CreditCard payment. I want it this way:

Order \> Scan SambaCard \> Print Bill \> Add Fund \> Settle \> SambaCard Payment

The resean I want to do it this way because I want to I know how much money a customer spent at my place. Then I can upgrade their card from Standard to Silver or Gold.

Anyone know how to do it? Thank you.

---

<div class="post-metadata">

**Author:** ![pipo](https://forum.sambapos.com/user_avatar/forum.sambapos.com/pipo/32/4085_2.png) [@pipo](https://forum.sambapos.com/u/pipo)\
**Post date:** [September 7, 2014, 10:30am UTC](https://forum.sambapos.com/t/sambacard-need-addfund-button-on-cashscreen/2457/2 "2014-09-07T10:30:10Z")

</div>

You don’t need to do payment with SambaCard credit funds to check how much they spent.  
You can use Customer accounts for that with a custom field, and still pay with cash.

Change the Customer entity type to have a ‘CardNr’ as primary field, and add a Custom Field ‘TotalSpent’ as well.

 ![](https://forum.sambapos.com/uploads/default/original/3X/d/b/db45f011224def868539512d5f5d9bb8f66f6cd0.jpeg) 

 ![](https://forum.sambapos.com/uploads/default/original/3X/c/e/ce0fca55103e43b5656ac94f656111a7ac7672aa.jpeg) 

Setup rules/actions to update the TotalSpent custom field when a payment is made:

Action: AC UpdateTotalSpent

 ![](https://forum.sambapos.com/uploads/default/original/3X/a/e/aedd8e8e69177569a0ca96b6a875659713caac01.jpeg) 

Rule: RU Add payment to customer TotalSpent

 ![](https://forum.sambapos.com/uploads/default/original/3X/c/e/ceda58b305fae9ac28f6971905c77b6ae4c5387b.jpeg) 

Are you using V4? For V3, there’s a little issue with the rule’s custom constraint which you have to be careful about. After you save the rule, you cannot edit it again or the first constraint will disappear, and you have to put it back in again every time.

When a ticket is opened, you select a customer (swiping the card to select the customer through CardNr), and when a cash payment is made, the amount will be automatically added to the customer’s TotalSpent field.

You could also do the same setup with SambaCard Customer Card entity instead of Customer entity.

To upgrade the customer status (standard, silver, gold), you add another action to the same rule which updates another Custom field of Customer entity (like ‘CustomerStatus’). Add a constraint to the action to check if the TotalSpent amount is bigger than a certain amount and smaller than the amount for the next status.  
Another approach would be to use entity states for this.

---

<div class="post-metadata">

**Author:** ![strashy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/ed8c4c/32.png) [@strashy](https://forum.sambapos.com/u/strashy)\
**Post date:** [September 7, 2014, 12:31pm UTC](https://forum.sambapos.com/t/sambacard-need-addfund-button-on-cashscreen/2457/3 "2014-09-07T12:31:24Z")

</div>

Thank you very much for you reply pipo, I’ll try your advice around and post the result up later. BTW, I’m using V4.

I’d love to hear more advices from everyone if by any chance you have other ideas. Thanks.

---

<div class="post-metadata">

**Author:** ![pipo](https://forum.sambapos.com/user_avatar/forum.sambapos.com/pipo/32/4085_2.png) [@pipo](https://forum.sambapos.com/u/pipo)\
**Post date:** [September 7, 2014, 1:13pm UTC](https://forum.sambapos.com/t/sambacard-need-addfund-button-on-cashscreen/2457/4 "2014-09-07T13:13:47Z")

</div>

For the loyalty level, you can do it like this:

Add another custom field to your Customer entity:

 ![](https://forum.sambapos.com/uploads/default/original/3X/7/8/78b90bb477ba05dc510fc320a82e37af2d25d7b1.jpeg)

Then create another action to update this field:

 ![](https://forum.sambapos.com/uploads/default/original/3X/7/0/7006843d8d740fa31b73a8d138f069a1f5511f8a.jpeg) 

clone this action and call it “AC update loyalty level 2”  
(you’re going to need this action 2 times in the same rule, so you need another instance of the same action)

Then add the actions to the previous rule with a constraint to check if the TotalSpent has reached a certain amount:

 ![](https://forum.sambapos.com/uploads/default/original/3X/e/a/eacebc989401b6babc891fde1835a03218f1a9b1.jpeg) 

rule custom constraint:  
PaymentTypeName - equals - Cash  
{ENTITY NAME:Customer} - Is Not Null

AC update TotalSpent:  
constraint:  
Amount: [=TN(’{ENTITY DATA:Customer:TotalSpent}’) + [:ProcessedAmount]]

AC update loyalty-level:  
constraint: [={ENTITY DATA:Customer:TotalSpent} + [:ProcessedAmount]]\>=500  
level: silver

AC update loyalty-level:  
constraint: [={ENTITY DATA:Customer:TotalSpent} + [:ProcessedAmount]]\>=2000  
level: gold

---

<div class="post-metadata">

**Author:** ![strashy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/ed8c4c/32.png) [@strashy](https://forum.sambapos.com/u/strashy)\
**Post date:** [September 7, 2014, 1:33pm UTC](https://forum.sambapos.com/t/sambacard-need-addfund-button-on-cashscreen/2457/5 "2014-09-07T13:33:41Z")

</div>

Oh my, you are my hero, I’m getting in to say I’ve been sucessfully put TotalSpent check into action.

For information, if people are using SambaCard as I’m now, they need to Create 2 more Accounts\>Transactions Types… let’s say, SambaCard Cash Payment and SambaCard Credit Card Payment. To make pipo first post works.

I’m checking your second reply now pipo, thanks so much.

---

<div class="post-metadata">

**Author:** ![strashy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/ed8c4c/32.png) [@strashy](https://forum.sambapos.com/u/strashy)\
**Post date:** [September 7, 2014, 1:35pm UTC](https://forum.sambapos.com/t/sambacard-need-addfund-button-on-cashscreen/2457/6 "2014-09-07T13:35:47Z")

</div>

Also, thinking about this method’s weakness is the TotalSpent for each customer won’t be showed on Accounts Balance.

---

<div class="post-metadata">

**Author:** ![strashy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/s/ed8c4c/32.png) [@strashy](https://forum.sambapos.com/u/strashy)\
**Post date:** [September 7, 2014, 2:42pm UTC](https://forum.sambapos.com/t/sambacard-need-addfund-button-on-cashscreen/2457/7 "2014-09-07T14:42:39Z")

</div>

Thank you, everything goes smoothly.

---

<div class="post-metadata">

**Author:** ![pipo](https://forum.sambapos.com/user_avatar/forum.sambapos.com/pipo/32/4085_2.png) [@pipo](https://forum.sambapos.com/u/pipo)\
**Post date:** [September 7, 2014, 3:48pm UTC](https://forum.sambapos.com/t/sambacard-need-addfund-button-on-cashscreen/2457/8 "2014-09-07T15:48:27Z")

</div>

Do you mean to show the TotalSpent values of customer in the Accounts screen, or in the {ENTITY BALANCE:Customer} tag for printing?  
For printing on tickets you can use {ENTITY DATA:Customer:TotalSpent} and {ENTITY DATA:Customer:Loyalty-level}.  
If you want to see totals spent by customers in the Accounts screen, it will require a few more steps. Keep in mind that the customer accounts are not used as credit accounts here, that’s why you don’t see them in the Accounts screen.

---

<div class="post-metadata">

**Author:** ![Gidy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/g/f05b48/32.png) [@Gidy](https://forum.sambapos.com/u/Gidy)\
**Post date:** [November 23, 2014, 11:17pm UTC](https://forum.sambapos.com/t/sambacard-need-addfund-button-on-cashscreen/2457/9 "2014-11-23T23:17:31Z")

</div>

Pipo Hello, I need some tips on how to add funds to the card magnetic.

I will detail how I want it to be my configuration.  
have a bar that doubles as night club the weekend, need to control the sale of Drunk as follows

1- The customer pays the entry worth $ 20 with right to 2 drinks

2- The official of the box makes the delivery of a magnetic card already with two drinks included for the customer

3- The client dirije to the bar balcony and delivers the magnetic card to the bar civil servant and then asks the 2 drinks desired

4- The bar civil servant passes the magnetic card to the system and the system displays the 2 card drinks and then make payment of 2 drinks, leaving the card without more drinks available

1. The civil servant returns the card to the customer

6- if the customer wishes more drinks will have to go to the civil servant box again and make the delivery of money to reload the card with more drinks

7- The official of the box receives the money and add value in drinks and returns to the client

1. The client receives the card and will go again to the bar and civil servant receives the drinks added to the card

PLEASE SOMEONE HAS AN IDEA OF HOW THIS CONFIGURATION? SAMBAPOS V4

---

<div class="post-metadata">

**Author:** ![emre](https://forum.sambapos.com/user_avatar/forum.sambapos.com/emre/32/39073_2.png) [@emre](https://forum.sambapos.com/u/emre)\
**Post date:** [November 25, 2014, 1:14am UTC](https://forum.sambapos.com/t/sambacard-need-addfund-button-on-cashscreen/2457/10 "2014-11-25T01:14:24Z")

</div>

@Gidy you don’t really add funds physically to the card itself. Card only contains an account number and you add funds to that account. When you scan card it does not read an amount. It reads account number and process that account balance. I mean we can fully operate it without using a mag card but to be able to access account number easily we prefer to use magnetic cards, barcode or qr tags.

You can start from here

> [@SambaPOS Loyalty Card Features](http://forum.sambapos.com/t/sambapos-loyalty-card-features/316):
>
> This video shows how SambaCard Sample works. Enable English subtitles for descriptions. ###Sample Database You can [Download Sample Database](http://sambapos.com/download/database/SambaCard.sdf) to test it. Copy SambaCard.sdf under [MyDocuments]\SambaPOS4 folder. Type SambaCard.sdf to Local Settings \> Connection String Restart SambaPOS.
