Skip to content

Commit

Permalink
add billing name
Browse files Browse the repository at this point in the history
  • Loading branch information
svenvh-ngdata committed May 11, 2018
1 parent 91b9098 commit 7d76fd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ticket_overview_by_event.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
event=$1

cat <<EOF
Copy(select u.name, s.date, st.seat, substring(o.comments from 0 for 32) from "order" o join "user" u on o.user_id = u.id join "order-ticket" t on o.id = t.order_id join "order-ticket-seat" st on st.ticket_order_id = t.id join "show" s on t.show_id = s.id join "event" e on s.event_id = e.id where e.name = '$event' order by s.date, substring(st.seat from 1 for 1), 1 - to_number(substring(st.seat from 2),'99') % 2, to_number(substring(st.seat from 2),'99')) TO STDOUT WITH CSV;
Copy(select o."billing-name", CASE WHEN o."billing-name" = u.name THEN '' ELSE u.name END, s.date, st.seat, substring(o.comments from 0 for 32) from "order" o join "user" u on o.user_id = u.id join "order-ticket" t on o.id = t.order_id join "order-ticket-seat" st on st.ticket_order_id = t.id join "show" s on t.show_id = s.id join "event" e on s.event_id = e.id where e.name = '$event' order by s.date, substring(st.seat from 1 for 1), 1 - to_number(substring(st.seat from 2),'99') % 2, to_number(substring(st.seat from 2),'99')) TO STDOUT WITH CSV;
EOF

0 comments on commit 7d76fd8

Please sign in to comment.