What I want to do is add the amount to the ticket tag instead of just replacing it like now.
But I think the dynamic parameter construction still doesn’t work as it should.
This is what I have now:
But it’s still just replacing the value of the Ticket tag instead of adding to it…
It seems like the ticket tag is still not being used (=0) in the action parameter. Same thing as in the ShowMessage, it works for ITEM TAG but not for TICKET TAG…
I just realize I’m doing it all wrong anyway!
I wanted to follow the outline I described before:
whenever an order is added to the ticket
– you get the amounts for each discount-level, and add them to a program setting or ticket tag
– if there’s already a customer entity linked to the ticket, you apply the appropriate discount to the ticket, based on the customer’s custom data
whenever an order is removed from the ticket
– you get the amounts for each discount-level, and distract them from the program setting or ticket tag
– if there’s already a customer entity linked to the ticket, you apply the appropriate discount to the ticket, based on the customer’s custom data
when the Ticket Entity Changed event is fired:
– if there’s a customer entity, you apply the appropriate discount to the ticket, based on the customer’s custom data
– if there’s no customer entity (the customer has been removed), you discard any ticket discount that was already there
So obviously I have to take the discount for every discount-level!
I think I’m too tired, I’m really messing up now!
… and I immediately see another problem, which I already had before, trying to implement something else (which is when I first started thinking I need an order looper):
I cannot catch the clicking of the plus and minus sign to increase/decrease the order quantity, so this method is again going to be useless…
Yes, but no matter how you do it, the problem is still:
You need to add to the number every time an order is added or increased, and distract when an order is removed/cancelled/voided/decreased. Most of these are not a problem, but the increase/decrease order quantity (plus and minus sign) cannot be caught with an event, so it’s impossible to implement this way…
I’m not sure how to use Ticket Total Change to detect that the plus/minus buttons have been pressed.
I first thought something like this:
if [:TicketTotal] Equals [:PreviousTotal] - {PRICE}
then
[=TN(’{TICKET TAG:D1}’)-TN(’{ITEM TAG:D1}’)]
[=TN(’{TICKET TAG:D2}’)-TN(’{ITEM TAG:D2}’)]
[=TN(’{TICKET TAG:D3}’)-TN(’{ITEM TAG:D3}’)]
if [:TicketTotal] Equals [:PreviousTotal] + {PRICE}
then
[=TN(’{TICKET TAG:D1}’)+TN(’{ITEM TAG:D1}’)]
[=TN(’{TICKET TAG:D2}’)+TN(’{ITEM TAG:D2}’)]
[=TN(’{TICKET TAG:D3}’)+TN(’{ITEM TAG:D3}’)]
… but that could also be another order added to the ticket…
Hmm…
[=Order.Model.GetVisiblePrice()] and [=Order.Price]
both show 0
Maybe the order data is just not accessible in Ticket Total Changed?
EDIT: they’re also not accessible when I add an order (and Ticket Total Changed is also triggered)
Yes, @emre has mentioned getting rid of some of the hard-coded buttons, such as Change Price, maybe Ticket Note… not certain what his plans are for +/-.
You can already hide the Select Entity buttons if you don’t map them to the Ticket Type…
… and this has something to do with Entities too, but I haven’t played with it…
Nice!
Does that mean you can open new tickets without having to close (and lock) the previous ticket?
Or will this just change the table for the current ticket when you click on another table?