GQL closeTerminalTicket() BUG causes subsequent Merge Tickets failure with Tickets that have partial Payments made by Entities that were changed

@Tayfun, please report this major issue regarding the GraphQL Engine to the appropriate parties…

This issue is caused by GraphQL payTerminalTicket() mutation.

That mutation fails to update [Payments] table columns [AccountTransaction_Id] and [AccountTransaction_AccountTransactionDocumentId] when done via GQL. SambaPOS updates these columns properly.

:warning: EDIT: wow, that ^ too is incorrect. The payTerminalTicket() mutation DOES update the [Payments] table properly.

It is the changeEntityOfTerminalTicket() mutation that is causing the issue. When that mutation is executed, it is NULLing the columns mentioned in the [Payments] table, for previous Entity Accounts. SambaPOS does NOT NULL them when the Entity is changed and the Ticket is Closed.

:warning: EDIT2: I need to clarify this 1 step further. It isn’t actually changeEntityOfTerminalTicket() mutation directly. That mutation is executed, and the [Payments] table remains intact ok. But when the Ticket is closed with closeTerminalTicket() then the Entity change is actually applied, and at that time, the [Payments] table has the mentioned columns NULLed, even if the Entity was changed in SambaPOS and not through GQL.

Changing Entity through SambaPOS and closing the Ticket works ok. But if we open that same Ticket using GQL loadTerminalTicket(), then even immediately close it with closeTerminalTicket(), it is at that time that the [Payments] table goes “bad”.

The following works without issue in SambaPOS, but does not work properly when Payments are made by Entity Account, with a subsequent changeEntityOfTerminalTicket() mutation.

Steps to reproduce:

  • create Ticket

  • select Customer Entity “James”

  • add Orders

  • make partial Payment using Customer Account “James”

  • close Ticket

  • open Ticket “James”

  • change Customer Entity “James” to “John”

  • make partial Payment using Customer Account “John”

  • close Ticket

  • create another Ticket

  • add Orders

  • select Customer Entity “John”

  • make partial Payment using Customer Account “John”

  • close Ticket

  • select Entity John (shows a list of John’s Tickets (2))

  • attempt to Merge Tickets

Create Ticket “James” and make partial “James” Account Payment

Change Ticket “James” to “John” and make partial “John” Account Payment

Create NEW Ticket “John” and Close Ticket

Select Entity “John” and attempt to Merge 2 Tickets


[Payments] table

Notice the [Payments] table, where records in Green were executed via SambaPOS and records in Red were executed via GraphQL, and then the changeEntityOfTerminalTicket() mutation is executed followed by closeTerminalTicket() mutation… this is why the Cancel/Remove Payments process fails, due to the NULLs in columns [AccountTransaction_Id] and [AccountTransaction_AccountTransactionDocumentId]

3 Likes