I’ll go out on a limb here and suggest that there is no such link between a Customer (Entity) and a Ticket, because an Entity does not deal with Transactions. You cannot Pay a Ticket with an Entity, only by an Account (Payment Types).
However, you will find a link between Customer ACCOUNT and a Ticket, in one or more of the Transaction tables. That said, this would require that you Pay a Ticket using a Customer Account (then subsequently add Cash or Credit Card payment to that Account).
Then you would join the (Customer) Entity table with the (Customer) Account table.
First let me explain why I need that. It’s a local issue, but it applies to lots of countries and surely in latin america. I am in Peru. There are 2 types of manual-paper Bill:
Boleta: for anyone, has to be given to customer (otherwise business
closed+fine), used to control your own sales.
Factura: for companies, has to be given to customer, when presented
to tax authority, can be used by the company as a company cost. The factura MUST contains the company legal name, address and RUC (unique company tax number). Let’s say a company organises a dinner for its employees, the company can use the bill as company cost only if the bill is a factura.
Today electronic, IT, printers, … There is a third kind of Bill:
Ticket: printed by a cash register machine. A normal ticket is used as it is for normal customer (boleta) and can be used as a factura (and so be used by the company as a company cost) only if company name, address, RUC # are written on the ticket.
Until there, no trouble, I can print out the tickets correctly:
selecting a customer if it is a company (like factura).
Now at the end of each month I need to sent to my accountant the list of tickets. Just date, ticket #, total for “normal customer”, but for “company” customer, legal name and RUC # must appears in the report.
And that’s where I am stuck as the information is not present in the DB.
Now, I kind of understand your answer however i am a bit a affraid to apply it.
As the customer/company information is available at the moment of printing, is there a way to script-grab the customer information + ticket # and keep it somewhere (file, db), I would add that info in the available report.
I really have to find a work around for this matter in order to be able to use SambaPOS, and I want to use it, it’s a wonderfull software.