Advertisement
Guest User

Untitled

a guest
Jul 20th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. 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`,
  2. 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
  3. LEFT JOIN sales_invoices si
  4. ON sit.sales_invoice_id = si.id
  5. LEFT JOIN sales_invoice_customer sic
  6. ON si.id = sic.sales_invoice_id
  7. LEFT JOIN transactions t
  8. ON si.id = t.sales_invoice_id
  9. LEFT JOIN passengers p
  10. ON sit.id = p.ticket_id
  11. LEFT JOIN buses b
  12. ON p.bus_id = b.id
  13. left join travel_schedules ts
  14. on sit.schedule_id= ts.id
  15. left join travel_companies tc
  16. on ts.travel_company_id=tc.id
  17. left join travel_routes tr
  18. on ts.travel_route_id = tr.id
  19.  
  20.  
  21.  
  22.  
  23. and t.`from` not in ('pos')
  24. and b.travel_company_id=1
  25. and si.payment_method not in ('cash')
  26. AND
  27. t.verified_at IS not NULL;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement