# Custom Reports -Customer Balance

**URL:** <https://forum.sambapos.com/t/custom-reports-customer-balance/7247>\
**Category:** V5 Question\
**Created:** [September 22, 2015, 9:07pm UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247 "2015-09-22T21:07:42Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![gsreddy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/g/e9c0ed/32.png) [@gsreddy](https://forum.sambapos.com/u/gsreddy)\
**Post date:** [December 3, 2015, 2:27am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/21 "2015-12-03T02:27:50Z")

</div>

thank a lot , I just started liking /bookmark posts so can track easily before I just read that way I missed many posts,and its difficult find them back

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 5, 2015, 5:48pm UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/22 "2015-12-05T17:48:35Z")

</div>

I have Customer Entities names being changed into member, and have modified gsreddy’s template into :

[code]  
[Member Balance:2,2,3, 2]

> Member ID|Name|Address|Balance  
> {REPORT ENTITY DETAILS:EC.Member Name,E.Name,EC.Address,E.Balance:(ET=Members) && E.AccountId\>0:::$4!=0}[/code]

But showing negative balance while the member has positive balance :  
 ![](https://forum.sambapos.com/uploads/default/original/3X/b/0/b0b3850d835e0876ecb3f0e64f3de3892cbb724a.png)

The Members balance that i have followed is [Custom Simple Loyalty Card Features](http://forum.sambapos.com/t/custom-simple-loyalty-card-features/3493) tutorial.

Also how to display Member ID custom field from “Members” entity type ? . And the template that i wanted to display is like this :

```auto
No. "Member ID" Name Address Balance
1. 0001 Prodigy Asia $100

```

How to display the report like above ?

---

<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:** [December 6, 2015, 12:35am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/23 "2015-12-06T00:35:30Z")

</div>

First of all that template is wrong. You should write E.Balance field as `E.Balance.sum`.

> [@Prodigy](#):
>
> But showing negative balance while the member has positive balance :

What do you mean by negative balance? Did you credited customer’s account?

> [@Prodigy](#):
>
> Also how to display Member ID custom field from “Members” entity type ? . And the template that i wanted to display is like this :

Try adding `EC.Member ID` field to the report.

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 6, 2015, 4:30am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/24 "2015-12-06T04:30:30Z")

</div>

@emre  
Thanks, based on your reply i have modified as following :

```auto
[Member Balance:5,5,5,5, 5]

>Member ID|Name|Address|Balance

{REPORT ENTITY DETAILS:EC.Member EC.Member ID,Name,E.Name,EC.Address,E.Balance.sum:(ET=Members) && E.AccountId>0:::$4!=0}
```

But the the preview or report now returning a empty reply  
Changing EC.Member ID into EC.Member.Member ID also returning a empty reply

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

Yes i have credited 100 amount to the Name Prodigy

 ![](https://forum.sambapos.com/uploads/default/original/3X/f/4/f4a90e19035fc245aebd0da570fbd71ab0dbfee1.png)

Also what does “[Member Balance:5,5,5,5, 5]” means?, formatting ?, it means 5 column ?

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 6, 2015, 4:42am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/25 "2015-12-06T04:42:16Z")

</div>

Your missing a `,` after `EC.Member`

Also your expression `$4!=0` is telling it E.Name has to not equal 0. I am sure you did not mean for E.Name to be evaluated if it equals 0?

Try this instead:

```auto
[Member Balance:5,5,5,5,5, 5]
>Member ID|Name|Address|Balance
{REPORT ENTITY DETAILS:EC.Member,EC.Member ID,Name,E.Name,EC.Address,E.Balance.sum:(ET=Members) && E.AccountId>0:::$6!=0}

```

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 6, 2015, 4:46am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/26 "2015-12-06T04:46:40Z")

</div>

@kendash  
My custom field in Members entity is “Member ID” so space is intended ?.

Or do you mean like this :

[code]  
[Member Balance:5,5,5,5, 5]

> Member ID|Name|Address|Balance

{REPORT ENTITY DETAILS:EC.Member, EC.Member ID,Name,E.Name,EC.Address,E.Balance.sum:(ET=Members) && E.AccountId\>0:::$4!=0}[/code]

Still returning empty reply ☹

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 6, 2015, 4:47am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/27 "2015-12-06T04:47:02Z")

</div>

What is EC.Member for? Your using 6 fields but defined only 4 columns.

I see another mistake you had…

Try this:

```auto
[Member Balance:5,5,5, 5]
>Member ID|Name|Address|Balance
{REPORT ENTITY DETAILS:EC.Member ID,E.Name,EC.Address,E.Balance.sum:(ET=Members) && E.AccountId>0:::$4!=0}

```

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 6, 2015, 4:53am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/28 "2015-12-06T04:53:39Z")

</div>

> [@Jesse](#):
>
> I see another mistake you had…
> 
> Try this:

Thanks!, It works partially as the field name and column being truncated and the balance still displayed as a negative

![](https://forum.sambapos.com/uploads/default/original/3X/f/a/fa4a21a25363d4dbdca441e795736b9ec4904762.png)

How to expand the column ?

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 6, 2015, 4:54am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/29 "2015-12-06T04:54:28Z")

</div>

You should increase width of the report and copy the most recent syntax I gave you I made an edit.

BTW the part where you have `[Member Balance:5,5,5, 5]` the 5,5,5, 5 is column width percents.

> [@Prodigy](#):
>
> the balance still displayed as a negative

You probably have the accounting messed up and are putting it in the wrong line.

> [@emre](#):
>
> What do you mean by negative balance? Did you credited customer’s account?

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 6, 2015, 4:59am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/30 "2015-12-06T04:59:31Z")

</div>

Are you wanting your Customer Accounts to behave like a Debit system where you put money into the account and then they spend it? Or are you wanting it to run like credit where they build up a tab?

EDIT: Ok your using Loyalty system. You setup your transaction type wrong for adding funds to loyalty card. It should go into Debit not Credit. Credit is where funds go when they use their card to purchase something. Maybe you should read the tutorial a little closer and be sure you setup your transaction types correctly. It appears you set it up backwards.

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 6, 2015, 5:13am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/31 "2015-12-06T05:13:31Z")

</div>

> [@Jesse](#):
>
> Are you wanting your Customer Accounts to behave like a Debit system where you put money into the account and then they spend it? Or are you wanting it to run like credit where they build up a tab?

I think for now like a debit system, customer also able to pay by cash, cc, voucher, and member balance (credited funds)

> [@Jesse](#):
>
> EDIT: Ok your using Loyalty system. You setup your transaction type wrong for adding funds to loyalty card. It should go into Debit not Credit. Credit is where funds go when they use their card to purchase something. Maybe you should read the tutorial a little closer and be sure you setup your transaction types correctly. It appears you set it up backwards.

Can you help me, i have setup transaction types as such in the tutorial, i have change the name Customer Accounts into Member Accounts for easy recognizing.

 ![](https://forum.sambapos.com/uploads/default/original/3X/3/c/3c841886fbf04c5c30fdc9899e893c091cb69198.png)

 ![](https://forum.sambapos.com/uploads/default/original/3X/0/6/0663f80f4ddd2d831e2da8caab4ad2d05195c700.png)

The setup working fine, spending member balance works fine.

---

<div class="post-metadata">

**Author:** ![Jesse](https://forum.sambapos.com/user_avatar/forum.sambapos.com/jesse/32/61493_2.png) [@Jesse](https://forum.sambapos.com/u/Jesse)\
**Post date:** [December 6, 2015, 5:17am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/32 "2015-12-06T05:17:06Z")

</div>

Did you change the Account Type for Member Accounts to Credit? Can you show the transactions for that member?

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 6, 2015, 5:53am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/33 "2015-12-06T05:53:37Z")

</div>

> [@Jesse](#):
>
> Did you change the Account Type for Member Accounts to Credit? Can you show the transactions for that member?

Yes Member Accounts is already Credit, transactions :

 ![](https://forum.sambapos.com/uploads/default/original/3X/b/5/b5afd05c1c2e8043c6193657734924c5473ddea3.png)

---

<div class="post-metadata">

**Author:** ![pauln](https://forum.sambapos.com/user_avatar/forum.sambapos.com/pauln/32/12698_2.png) [@pauln](https://forum.sambapos.com/u/pauln)\
**Post date:** [December 6, 2015, 6:03am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/34 "2015-12-06T06:03:21Z")

</div>

Hey @Prodigy  
The syntax `$4!=0` means “not equal” so I think you need to use $4\>0 to test if the E.Balance.Sum \> 0?  
EDIT: Oh I see you want the -100 to show as just $100 or I what I do is ($100).  
Sorry misread I think - stab in the dark multiply by sum by “-1” but if they owe money it will reverse the result…

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 6, 2015, 6:12am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/35 "2015-12-06T06:12:29Z")

</div>

> [@pauln](#):
>
> Hey @ProdigyThe syntax $4!=0 means “not equal” so I think you need to use $4\>0 to test if the E.Balance.Sum \> 0?EDIT: Oh I see you want the -100 to show as just $100 or I what I do is ($100).Sorry misread I think - stab in the dark multiply by sum by “-1” but if they owe money it will reverse the result…

Yes the balance is incorrectly displayed or incorrectly credited as @Jesse mentioned ☹, that would be not proper solution…

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 6, 2015, 1:45pm UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/36 "2015-12-06T13:45:19Z")

</div>

A “negative balance” indicates that the Account has Credit - that is, the account contains funds that are available to spend. This is normal, and is by design in the way that the SambaPOS Accounts work (and any “real” accounting system for that matter).

I implore you, do **not** change this by modifying your Transactions Types. The Balance showing as (negative) is normal. If the customer account has a “positive” balance that means it is _overdrawn_, and the customer _ **owes** _ money to their account. When a payment to their account is made, it reduces the value to bring it closer to zero (it becomes more negative).

Have you never noticed that when you make a Sale and look at the Sales account that it is shown as (negative)? Again, this is normal… it is in a “Credit” state. If you change it for Customer Accounts, you need to change if for everything else - every Account, including Sales, etc. and every Transaction Type in your system needs to be reversed. Do not do this.

I understand why you may think this is backwards - I had a very hard time with the concept for a very long time… I finally accepted it as “that is the way it is”, and eventually, I came realize it makes sense.

If you do not like the way it appears in the Report, simply multiply the value by -1 to get your desired visual result… but please, do not mess with the accounts.

---

<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:** [December 6, 2015, 2:09pm UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/37 "2015-12-06T14:09:07Z")

</div>

Think it like your personal credit card account. As you spend from your credit card your cc account balance increases positively. As you pay… account balance decreases. If you pay more than you spend it becomes a negative balance so it means bank owes you money. So when you see a negative customer account amount that means customer paid more than he spent and you owe him. If it becomes positive that means customer owes you money and he needs to pay.

---

<div class="post-metadata">

**Author:** ![Prodigy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/p/8491ac/32.png) [@Prodigy](https://forum.sambapos.com/u/Prodigy)\
**Post date:** [December 6, 2015, 2:15pm UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/38 "2015-12-06T14:15:15Z")

</div>

That’s totally make sense, i thought that i have setup it wrong but now it become clear. Minus sign is a some-kind preserved values/balances 😄.

Thanks alot to kendash, pauln, QMcKay, emre.

---

<div class="post-metadata">

**Author:** ![QMcKay](https://forum.sambapos.com/user_avatar/forum.sambapos.com/qmckay/32/27925_2.png) [@QMcKay](https://forum.sambapos.com/u/QMcKay)\
**Post date:** [December 6, 2015, 2:17pm UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/39 "2015-12-06T14:17:34Z")

</div>

> [@emre](#):
>
> Think it like your personal credit card account. As you spend from your credit card your cc account balance increases positively. As you pay… account balance decreases. If you pay more than you spend it becomes a negative balance so it means bank owes you money.

That is a great explanation! I wish someone had said this to me a long time ago. 😜

---

<div class="post-metadata">

**Author:** ![gsreddy](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/g/e9c0ed/32.png) [@gsreddy](https://forum.sambapos.com/u/gsreddy)\
**Post date:** [May 26, 2016, 10:41am UTC](https://forum.sambapos.com/t/custom-reports-customer-balance/7247/40 "2016-05-26T10:41:45Z")

</div>

@emre Thats all fine above discussion but i have a experience yesterday one customer asked for statement and he totally confused even my staff i was not there , how can we explain - means you are in credit . Is there any way to show as it should like formal way to keep clear everybody mind?

Also all reciepts i have show thier samba card balance as negetive , no body asked this but could be? thanks

[Previous page](https://forum.sambapos.com/t/custom-reports-customer-balance/7247.md?page=1)

[Next page](https://forum.sambapos.com/t/custom-reports-customer-balance/7247.md?page=3)
