SELECT t.id, date, a.Agencia, note, p.name province, zip_code, city, c.name, consignee, invoice, delivery FROM ticket_view t JOIN address_view c ON t.address_id = c.id JOIN vn2008.Agencias a ON t.agency_id = a.Id_Agencia JOIN vn2008.province p ON c.province_id = p.province_id WHERE t.id = #ticket

OrderDetail

Delivery

()

Total

SELECT m.item_id, m.amount, m.concept, IF(m.fixed != FALSE, m.price, NULL) price, m.fixed, m.discount, o.Abreviatura, a.Categoria, a.Medida, a.Tallos, a.Color, a.Foto FROM ticket_row_view m INNER JOIN vn2008.Articles a ON m.item_id = a.Id_Article AND ticket_id = #ticket LEFT JOIN vn2008.Origen o ON a.id_origen = o.id ORDER BY concept

x