# Refund issue when using customer discount

**URL:** <https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455>\
**Category:** V5 Question\
**Created:** [November 15, 2022, 4:39pm UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455 "2022-11-15T16:39:50Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![ConnorM](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@ConnorM](https://forum.sambapos.com/u/ConnorM)\
**Post date:** [November 15, 2022, 4:39pm UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/1 "2022-11-15T16:39:50Z")

</div>

Hi All,

I have a refund button setup which needs to work with the generic discount function.

At the moment when there is a 10% on the ticket and you refund all items you are giving the customer the full amount back and not the discounted amount.

how do I resolve this?

Order tags could would however this will affect another configuration for my parts picking which cant show the discount information.

any help would be great.

thank you

---

<div class="post-metadata">

**Author:** ![ConnorM](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@ConnorM](https://forum.sambapos.com/u/ConnorM)\
**Post date:** [November 16, 2022, 10:45am UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/2 "2022-11-16T10:45:32Z")

</div>

I have done further testing and configured ordertags for a discount. Unfortunately the same issue occurs.

Is there anyway I can refund a ticket and not per item. Some Ideas I have had but dont know how to configure it is:

Negative Payment type for refunding. But this messes up the total taking for their reports.

Another option is a refund button for the ticket and not per item, wouldnt know where to start with this one. unfortunately.

Can anyone advise on the correct solution for refunding items which were discounted

thank you

---

<div class="post-metadata">

**Author:** ![Bob\_be](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@Bob\_be](https://forum.sambapos.com/u/Bob_be)\
**Post date:** [November 16, 2022, 5:07pm UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/3 "2022-11-16T17:07:09Z")

</div>

Have you looked at this tutorial?

> [@How to Create a Refund Item Button?](https://forum.sambapos.com/t/how-to-create-a-refund-item-button/128):
>
> It is possible to create a refund item button in ticket so you can change previously sold items with new items. First of all we’ll start by creating a new automation command. We’ll map this automation command to ticket lines. This button should be visible for only new added lines and it will be enabled if item not gifted or voided. After Saving it we’ll create a new action. Price should be negative so we’ll use [=0-Order.Price] expression. Also We should set…

---

<div class="post-metadata">

**Author:** ![ConnorM](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@ConnorM](https://forum.sambapos.com/u/ConnorM)\
**Post date:** [November 17, 2022, 8:39am UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/4 "2022-11-17T08:39:30Z")

</div>

I have and implemented it into my system. The applied discount gets removed when refund is pressed.

I have worked around by refunding the item first and then applying the discount to the negative figures, but it is a few more steps which I want the customer to avoid doing.

any way we can create a refund ticket so it gives the calculation total as the refund and not the item orginal cost?

thanks

---

<div class="post-metadata">

**Author:** ![Bob\_be](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@Bob\_be](https://forum.sambapos.com/u/Bob_be)\
**Post date:** [November 17, 2022, 3:44pm UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/6 "2022-11-17T15:44:17Z")

</div>

I’m not sure this will work by try this. In the action **Refund Item Action** , change the price field to:  
`[=0-{VISIBLE PRICE}]`

 ![2OGsoZDzWn](https://forum.sambapos.com/uploads/default/original/3X/4/4/444bc449ceee3fd68c4b8fb559c32e2f860638b3.png)

You may have to remove the action from the rule, save the rule then re-add the action back into the rule.

---

<div class="post-metadata">

**Author:** ![ConnorM](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@ConnorM](https://forum.sambapos.com/u/ConnorM)\
**Post date:** [November 17, 2022, 4:02pm UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/7 "2022-11-17T16:02:38Z")

</div>

> [@Bob\_be](#):
>
> [=0-{VISIBLE PRICE}]

☹ Nope this didnt work. I tried both the ticket discount and the item discount then pressed refund and it still does the full value of the item and not the discounted rate.

---

<div class="post-metadata">

**Author:** ![Bob\_be](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@Bob\_be](https://forum.sambapos.com/u/Bob_be)\
**Post date:** [November 18, 2022, 1:42am UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/8 "2022-11-18T01:42:48Z")

</div>

Sorry, I’m out of any quick ideas.

---

<div class="post-metadata">

**Author:** ![ConnorM](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/c/f1d935/32.png) [@ConnorM](https://forum.sambapos.com/u/ConnorM)\
**Post date:** [November 18, 2022, 8:27am UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/9 "2022-11-18T08:27:16Z")

</div>

Thank you for all your help on this.

I am hopefully one of the other Samba Wizards will be able to provide a alternative config for this requirement.

Thanks again 🙂

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [November 18, 2022, 10:01pm UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/10 "2022-11-18T22:01:52Z")

</div>

im almost there but get complicated as you need to remove the discount and re-add to correct the refund balance

Ive basically created a refund ticket button that:

- Clones the original ticket as a new ticket
- selects all the items on the ticket and changes their price to negative
- removes the original ticket discount

Now i just need to create a new discount calculation to re-add to correct the ticket balance, not sure how long itll take me though

---

<div class="post-metadata">

**Author:** ![Bob\_be](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@Bob\_be](https://forum.sambapos.com/u/Bob_be)\
**Post date:** [November 18, 2022, 11:14pm UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/11 "2022-11-18T23:14:29Z")

</div>

Maybe a loop value might work??? This would catch multiple ticket discounts if present. You would have to capture the original ticket id…maybe use a local setting.

Something like this:

 ![3X0TK7jDSW](https://forum.sambapos.com/uploads/default/original/3X/3/c/3ccf0af3d2be899e8f89c40016a2279655824298.png)  
Looping Values: `{REPORT CALCULATION DETAILS:C.Name:T.Id={LOCAL SETTING:OriginalTicketId}::,}`

Then use the looping values to add ticket calculation(s)

 ![70HBqmWS0o](https://forum.sambapos.com/uploads/default/original/3X/1/a/1af45f1e0ad8ffd7a433438b76892f0d2d8a320b.png)  
amount: `{REPORT CALCULATION DETAILS:C.Amount:T.Id={LOCAL SETTING:OriginalTicketId} && C.Name="[:LoopValue]"}`

You will also need a **display ticket** action after the calculation, I forgot to add that in the screen shot.

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [November 18, 2022, 11:25pm UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/12 "2022-11-18T23:25:30Z")

</div>

seems to be an issue with the update orders action when updating multiple prices at the same time using [=0-Order.Prices] this works fine if only 1 item on the ticket but if trying to make more than 1 negative it doesnt work

Setting an actual number does work and changes all items so seems to be an issue with the expression to make prices negative @Jesse any ideas? ive tested and seems like the action doesnt work to update multiple order prices when using [=0-Order.Prices] in the price field

Working fine when you specify a price to change all products to, action below to set all to specific value (5.36)

 ![image](https://forum.sambapos.com/uploads/default/original/3X/a/2/a267a4f09d6ea94694758b0ebecaf0cc91276f6f.png)

Result on ticket all products correctly update to a price of 5.36

 ![image](https://forum.sambapos.com/uploads/default/original/3X/e/8/e82db71d199abeaf849e64bdd90b9d50a8de126f.jpeg)

But when tryig to update all orders to negative for a whole ticket refund, when using [=0-Order.Price] it doesnt work

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

 ![image](https://forum.sambapos.com/uploads/default/original/3X/9/f/9f045541305e17b137c8c822c62fd6806d6f9bee.jpeg)

---

<div class="post-metadata">

**Author:** ![Bob\_be](https://forum.sambapos.com/letter_avatar_proxy/v4/letter/b/e480ec/32.png) [@Bob\_be](https://forum.sambapos.com/u/Bob_be)\
**Post date:** [November 18, 2022, 11:36pm UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/13 "2022-11-18T23:36:23Z")

</div>

Try formatting the price. `[=F(0-TN('{PRICE}'),'0.00')]`

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [November 19, 2022, 1:45am UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/14 "2022-11-19T01:45:33Z")

</div>

Nope thats doesnt have any affect at all, thanks for the sugestion though

 ![image](https://forum.sambapos.com/uploads/default/original/3X/3/7/37fb0444b31f93fdb29f347d4c96beb058995857.jpeg)

---

<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:** [November 19, 2022, 2:40pm UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/15 "2022-11-19T14:40:33Z")

</div>

Hey guys. I do remember solving a similar case for one of our resellers back last summer. I will have to dig that database up and look.

---

<div class="post-metadata">

**Author:** ![RickH](https://forum.sambapos.com/user_avatar/forum.sambapos.com/rickh/32/51960_2.png) [@RickH](https://forum.sambapos.com/u/RickH)\
**Post date:** [November 19, 2022, 3:38pm UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/16 "2022-11-19T15:38:00Z")

</div>

Thanks Jesse, Ive tried everything I can think of and every setting in the action, adding ticket refreshes, removing ticket refreshes but this ones got me!

Thanks for you help 🙂

---

<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:** [November 19, 2022, 5:13pm UTC](https://forum.sambapos.com/t/refund-issue-when-using-customer-discount/26455/17 "2022-11-19T17:13:20Z")

</div>

The underlying issue is the fact that the discount is on the Ticket and the refunds are on Orders. For it to work you must spread the ticket based discount across all items evenly. I would recommend doing a transaction document for the refund based on the Ticket amount and not each order, Mark the orders as refunded using a state. Adjust your reports to subtract the refund account from your Gross Sales to get a true Net Sales.

But before you do any of that first why do you want to refund items if your really wanting to do a full ticket refund? Also am I mistaken about how you are doing a refund?
