Refund with Action to increase Inventory isnt working

Sorry for lack of response I was working all day. I am looking at it again.

Rick I am not sure why it is not working on yours but it is just fine on mine. Let me see if its a V5 only thing. I am installing it into 4.1.82 to test it.

I just tested it in 4.1.82 and it worked just fine. Only changes I made were what I showed you in the screenshots.

This is from the DB you sent me. I restored it and only change I made was what I showed you in screenshot. Here is it working:

Before Refund:

After Refund:

no probs ive been at work all day too :slight_smile: its 22.50 over here now and i really should be doing some work but spent all night trying to figure this out, it just gets too addictive lol

i dont get why it doesnt work for me, ill change the actions again to what you posted and give it another try. ill let you know in a few mins :slight_smile:

I noticed its not updating the price thoughā€¦ So what did you do to get it to update the price? Btw it all works in v5 with changes I made so something with how v5 handles the actions and v4 is different.

Either way can I ask why your using negative values for cash instead of just putting it in as a debit on sales?

Thats the issue i had the price didnt update and still show as positive instead if (1.25), i changed the action back so the price was correct but then inventory didnt update correctly. it seems like the action doesnt allow price and inventory to be changed together??

Mine inventory had updated correctly but like you, the price is now wrong, i can correct the price but then inventory doesnt update correctly

Ok we may be trying to do something not intended I will look at it some more. But can you answer my question above about Sales accounts and cash accounts etc. To use the accounting properly you wouldnā€™t use a negative transaction.

1 Like

LOL, it must be the negative Sale throwing it off. You know, 2 negatives make a positive.

Have you tried changing the Saleable Stock Order Update to Decrease Inventory = True?

im used to refunds being a negative value, and have i a separate change message that appears that only happens when total is a minus so my message changes from tendered amount and change to just refund Ā£x.xx

also in my accounts i have it so that refunds appear on the refund line so the end displays the total refunds (i have customer and store receipts that print so i can add up the store refund receipts, they should match my figure in accounts screen, then i can balance refunds so that no figures carry over to the next work period (a kind of cash up system ive created using accounts)

i dont know if your suggestion would make any difference to my accounts and cash up, or whether i just need to swap some rules around, to be honest i never thought about it, the way i set up refunds is the first thing i tried

yep i thought that too, so i tried it and it didnt work either

same effect here @QMcKay, the 0-Order.Price still doesnt work on the price as its still positive

Ok RickH I dont know if you realize it but when you use a negative amount its putting a positive number into the Credit line of Cash Accountā€¦ it does not actually record it as a negative. So what I meant was why use it as a negative price just change your Transaction Type for that payment type so it puts the positive amount into Credit for Cash Account and you dont have to make it a negative price.

Basically when you change price of something to a negative and you settle a negative price its going to put a positive number into the Credit portion of Cash Account.

You can accomplish the exact same thing by not using negative price and setting Transaction Document linked to the Refund Cash payment type that puts the money into the Cash Acccount Credit line. This would allow the adding to inventory to work.

I will build it into your database and let you see what im talking about.

I know for you its a visual thingā€¦ until Version 5 (Which your setup actually works btw) this would give you a working solution. You would just have to imagine its a negative lol. Or we could maybe do some fancy visual hacks sort of to get it to produce something that looks like that.

I am not sure it would even work but you could try for visual satisfaction letting it show the negative priceā€¦ settle a negative amount but use some math and automation to convert it to the normal process at point of payment.

1 Like

Canā€™t say Iā€™ve seen that beforeā€¦

1 Like

PS: Its probably an undocumented change that has to do with some internal handling or enginesā€¦ but it does work just fine with v5.

I can verify that something blocks it from working on v4. I am thinking its because you shouldnt have a negative order count.

its come from @kendash suggestion of putting -1 in quantity in the action

2 Likes

Yes I suggested that because it was the only way to get it to increase inventory without rewriting your entire method. I am certain its not meant to be used this way.

I am revisiting refunds. I know you want something little more concrete and more traditional like retail for refunds and I do too. My refund system I have for v5 is being built from ground up. Its still a reverse transaction but it will be very seemless and not as complicated as I have had it in the past.

it was worth a try though :slight_smile:

1 Like

BTW I can confirm it works just fine if you dont use the negative prices. I have not tested trying to do the visual tricks I suggested yet. Looks like you took inspiration from the reverse transaction system I was using and modified it to your liking.

Seems like you want it to show a negative value because its what your used too. That is fine. We just need to work through this step by step and figure out a solution that works.

First we need to be certain how Samba handles negative transactions. We should start from basics and test it.

Take out all the extra actions and rules and lets start from basic setup with negative transactions and get a good grasp on what Samba is doing with them.

Then start adding in a few actions and test the various settings and how Samba reacts with those while doing negative transactionsā€¦

PS From looking at the Rule Debugger you have a lot going on. Some of which you probably didnt mean to happen. Example all your ticket closing, ticket closed events are firing and changing out states etc on refundsā€¦

yep i did get a lot out of looking at your database :slight_smile: it was a great help

thanks for your help again with this :slight_smile:

the state should just change to refund i think, didnt mean for all the rest to happen

OK all stripped back to one rule and 1 action, so same process as before add order to ticket, select it, press refund item button, then select the return reason (which now updates to the item, the ask question overuled this before) and this is what i get before settling

quantity stays positive, +1 and price goes to a minus (1,25)

process the refund and as the ticket value is a minus my refund message appears in screen instead of my change message that appears for a sale where the ticket total is greater than zero

Action

Rule

Inventory
still shows minus 1 instead of plus 1 so it hasnt increased inventory as per the action???

so even with just the basic 1 update order action set to increase inventory true, the inventory still doesnt increase and decreases instead??

I think the simplest and easiest thing is to wait for V5 if it works how ive got it setup :slight_smile:

(taking the easy way out haha)

@RickH, Iā€™m not sure that is your best choice. Exploiting what could be a bug or glitch in v5 might break your implementation later on.

Rather, if you can get used to not seeing a (1.25) value, and instead use what @Jesse mentioned regrading properly crediting the Account, I think that would be the way to go.

That said, has anyone tried putting a variable to the [:Quantity] for the Update Order Action? Then in the Rule, do something like [=-1*TN('{QUANTITY}')]