Create Ticket Action: Custom Clone Ticket Values

I would like to request an update to the Create Ticket Action in particular the function of Clone Current Ticket. It would be very useful and lead to a more reliable way to refund items if it could Clone Selected Order.

If you do reverse transactions this would be a great way to integrate single item returns and give you the ability to track them through accounting and reports.

Example of work flow:

Refunding entire ticket modifies the original ticket and performs a reverse transaction sending it through its own accounting.

Refunding a single item using the new action and rules to support it you would select the items you wish to refund when you press the refund button it would create a new ticket (Refund Ticket Type) clone the selected orders and a reverse transaction would occur running it through its own accounting.

The original ticket would have the two items removed via update order action that already exists this would also automatically recalculate the tax so it would reflect it correctly. The refund ticket would have its own tax calculation so you would be able to refund the correct tax as well.

This looks to me like it would work quite well and shouldn’t be too hard to implement. I could be wrong as I am many times. If you need me to explain further if I was not clear enough or if you have any questions just ask.

You could easily use ticket tags and states to link the two receipts for tracking.

1 Like

If this is possible I will quickly implement it and Write tutorials around it. I feel this could be a huge boost solving a lot of issues with refunds etc.

Yes sorry I forgot to mention it should work fine with 4.1.52

ooh going to check it out.

Just a couple things. It works flawlessly if you turn on Clone all orders…

But I want it to only clone selected orders… I set it to false on clone all orders… I reopened a ticket and selected a couple orders… pressed the button which was mapped to order line… it cloned just 1 order i assume the first order instead of cloning the selected orders.

Is there a way I can set a Variable for Clone All Orders and then use a tag for Selected Orders… if that exists? Or would you have to hard code that?

Here is how I would use it… maybe this will help you see what I am trying to do.

I reopen ticket, cancel payments, Select items I want to refund, Press Refund Cash or Refund Credit button… It will update order and take the 2 orders off the original ticket, Resettle ticket as Cash or Credit depending on if I press Refund Cash or Refund Credit buttons. It creates a new ticket and clones the 2 orders that were selected I then settle it with Refund Payment type button.

I would have to support that with several rules/actions/constraints… I am not even sure if its possible to update order and take the 2 orders off and then clone ticket with those selected orders or not. Maybe the update order on original ticket should happen after I settle the new cloned ticket as refund…

What this would do is offer a true reverse transaction for just specific orders on a ticket.

EDIT: It seems the behavior when it clones the ticket it just closes the original ticket as it was before any changes… and then transfers those changes to the new ticket… I put an update order action in my command and put it BEFORE the clone ticket action… it closed the original ticket without any changes, and cloned the order sinto new ticket with update order performed on new ticket.

I can get most of it to work… I would still need it to clone only selected orders… and somehow a way for it to Clone the Ticket and The selected orders BEFORE I update the original ticket and settle/close it.

So it would look something like this:

Reopen Ticket
Select items for refund
Press Refund Cash or Refund Credit depending on how ticket was paid
Clones Ticket and selected orders but does not display it yet.
Update Order Action is fired that basically performs a void
Resettles with the payment type originally used
closes ticket
Then it displays the cloned ticket with the cloned orders you can resettle that with refund payment type.

Sounds complicated and may not even work. But maybe that explains my intentions better.

I am able to get it to update order and resettle/close but it 1. doesnt clone just selected… 2. clones the newly updated orders that were voided as voided status in new ticket.

EDIT: I can ALMOST get it to work. I reinserted another Update order after the clone ticket action… it updated 1 order back to normal status but not the other.

EDIT: So it seems 2 things need to change. 1 clone Order to only clone selected… and 2.Update order should update all selected items if more than 1 selected. This should allow the function to work.

EDIT: ODD thing is Update Order does update all selected items if it is not followed by Clone Ticket. If you put CLone ticket after Update order it only updates the first selected.

EDIT: I got EVERYTHING to work except . Update Order not updating all selected orders when Clone Ticket is used. Clone ticket/Clone Order needs to clone only selected orders.

It is working for single item refunds. This will do for now but in future it would be nice if you can somehow do some magic and get it to Clone just selected orders, and somehow fix the problem of Update Order action only updating first selected item if its followed by Clone Ticket action in same rule.

Did you enabled Execute Once setting on automation command? If not it executes automation command for each selected orders once.

No Execute Once is not enabled. I have narrowed it down to this behavior.

I have it set to pay ticket after Update Order is performed in the same Rule. If Pay Ticket action is used after Update Order it will only update first selected order regardless of Execute Once enabled or disabled. if I take Pay Ticket out it will updated all selected orders correctly.

I need Pay Ticket in so it settles the ticket before it Clones it.

I don’t think you’ll be able to do all of them in a single rule. When you create a new ticket all actions will run against that ticket. It is a little complicated.

  1. You’ll repoen ticket.
  2. You’ll void orders.
  3. You’ll settle ticket.
  4. You’ll clone ticket.

But you’ll loose selection until you’ll be able to clone ticket. So it seems what you really need is not cloning selected orders. You need to clone orders that have a specific state.

Note: You should enable Exeucte Once setting to be able to clone selected orders.

Or

  1. You’ll reopen ticket.
  2. Store ticket id somewhere.
  3. Void orders.
  4. Clone ticket
  5. update orders on cloned ticket.
  6. Close cloned ticket.
  7. Reload original ticket with stored id.
  8. Settle original ticket.

Ok I will play around with it more today. I understand what you are saying. I may need to just do some more rule magic.

Ok I have some strange behavior. I am using a couple constraints. I am avoiding tickets with 0 items and 0 payment by putting {ORDER COUNT} Equals 1 and {ORDER COUNT} Greater 1 with an Ask Question when you press the Return Item button…

Basically if Order Count is greater than 1 it will Ask the question and then procede with a response that does the clone ticket method…

If order count equals 1 then it does not ask the question and it does not clone order it just converts the ticket to refund and processes it through refund transaction. This prevents tickets with 0 value.

Here is the strange behavior:

Update Order seems to work if I set Execute Once on my Ask Question Automation Command. I can select multiple items press Return Item Command and it will Ask the question Void all of the selected items. pay ticket and clone ticket… HOWEVER the cloned ticket has cloned ALL of the orders even though I set the action to False.

I am still playing with the rules but I thought this behavior was kind of odd.

EDIT: it seems like if the Clone Ticket action is fired from an Ask Question Action and the Ask Question Action is set as Execute Once it skips the False validation on the Clone Ticket/Clone All Orders

Just to clarify… the rule is closing ticket and then cloning in same rule. I know it can catch the False validation if I insert it after close ticket in same rule because it was cloning first selected item before I put the Execute Once validation in. But after selecting Execute Once on the Ask Question Command button it started skipping the false validation completely

I will try using state tracking and play around with that see if I can get different result.

EDIT: after rereading your post. I think I understand why it is doing this behavior. I am trying States now. I think the States method might work better. It seems to be a more natural approach vs trying to open, close, store ticket, and editing both tickets etc.

@Jesse I’ve implemeneted some actions to store selected orders and restore them when needed so probably that will solve your issue.

However I want to clarify something. If we refund $40 of a $100 sale shouldn’t our Account screen display something like that?

Account Name     |   Debit     |   Credit    |   Balance  |   
Sales Accounts   |       40.00 |      300.00 |     260.00 |
  Sales          |             |      300.00 |     300.00 |
  Refunds        |       40.00 |             |      40.00 |
Payment Accounts |      300.00 |       40.00 |     260.00 |
  Cash           |      100.00 |       40.00 |      60.00 |
  CC             |      200.00 |             |     200.00 |

Yes I have some technical formatting to do so it all reports correctly. The main thing is how it handles Calculations. Currently I have not found a way for it to handle that. When you cancel payments it cancels the tip calculation as well. For it to be accurate it should not cancel the tip calculation.

Imho you shouldn’t alter past tickets. You’ll just create a ticket for what you’re refunding. If you’re refunding tax, that ticket will include tax or if you refund tips (in some cases it may happen) it should include tips.

It is creating a new ticket. and it is calculating tax… I just have it hidden on my general screen. The only refund that is not creating a new ticket is a full ticket refund… in other words everything on the ticket I just convert it to Refund ticket.

… but you’re also voiding items on original ticket. Why you need that?

Edit: you can also create a new ticket for full refund. I don’t think you need to handle another case for it. It unnecessarily increases complexity.

Because I have refunds running completely separate including the sales. It is so my Sales Accounts are accurate. I have Refunds Sales accounts that I view to track refunds. In other words my refund Sales do not decrease my main sales accounts balance.

I could get it to work the way you described however… it may be easier I could avoid what I am trying to do now. I will look into that.