Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT si.code as 'Invoice Code',si.kind as Type ,t.from as App,sic.fullname as Fullname,sic.phone as Phone,tr.from as `From`,
- tr.`to` as `to`, sit.date as 'Departure Date', b.registration_no as 'Bus No', p.seat_no as 'Seat No',sit.code as 'Ticket Code', sit.price as Amount,si.payment_method, sit.price,si.verified_at as 'Purchase Date' FROM sales_invoice_tickets sit
- LEFT JOIN sales_invoices si
- ON sit.sales_invoice_id = si.id
- LEFT JOIN sales_invoice_customer sic
- ON si.id = sic.sales_invoice_id
- LEFT JOIN transactions t
- ON si.id = t.sales_invoice_id
- LEFT JOIN passengers p
- ON sit.id = p.ticket_id
- LEFT JOIN buses b
- ON p.bus_id = b.id
- left join travel_schedules ts
- on sit.schedule_id= ts.id
- left join travel_companies tc
- on ts.travel_company_id=tc.id
- left join travel_routes tr
- on ts.travel_route_id = tr.id
- and t.`from` not in ('pos')
- and b.travel_company_id=1
- and si.payment_method not in ('cash')
- AND
- t.verified_at IS not NULL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement