Help with SQL queries to build an iPhone app for SambaPOS

Hello, i’m an iOS developer and currenty i’m trying to build an iPhone app for SambaPOS that would let a user take orders and complete payments. I’m using a node.js app to connect my iPhone app with the MSSQL database.
I have already developed the part of selecting an entity, getting categories, products and order tags. I’m stuck at the part of creating new order/ticket. If i select an empty entity(table) which database tables should i insert/update?
I would appreciate some help with the SQL statements that i should use.

1 Like

[Orders] holds all orders, with reference to [Tickets].
[Tickets] contains tickets.
[TicketEntities] contains Entities assigned to the Ticket, with reference to [Tickets].

Actual Ticket creation occurs when the Ticket is closed (orders submitted). Not to be confused with the Ticket having been Paid (or not).

When the Ticket is closed, updates are made to the Accounting tables.

See here for a general Overview (this does not depict DB relation however):

Thank you for your response.
So let’s say i want to create a new order on an empty Entity. I press the Entity button, select the category -> product and ->order tags (if available). I repeat the same for other order items. Then i press the submit button. The only tables i have to update to view the order in SambaPOS are [Orders], [Tickets] and [TicketEntities] ?

There will be more to it than that, but it may suffice for your need.

You should try Express Profiler:

Or SQL Profiler:

https://msdn.microsoft.com/en-us/library/ms181091.aspx

1 Like

You have to update some of the account table.
(AccountTransactions) For example, Samba uses Accounts for everything. If you have calculation selector or tax, you need to update the accounts table with the relevant account id

1 Like

what about tacke out orders which does not need to reserve table. just need to select customer to assign the order ticket to. good to be consider in your solution

Right now i’m only interested for orders that are taken from sit in customers. If everything goes smooth, i will implement the take out too.

Hi friend,

Could you suceseeded with your implementation?

Your try is important to every member and wish you can make it.

Wish I can help you but I belives
Emre , Kendash and other supportive leaders they will be happy to help you