SELECT B.booking_no as [Booking Number],
B.organizationv6 as [Company],
B.Showname as [ShowName],
B.DateLastModified as [Cancellation Date],
B.dDate [Warehouse Out Date],
B.ShowSdate as [Show Start Date],
S.salesperson_name AS [Salesperson],
CASE
WHEN c.StatusBeforeCan = 0 THEN 'Quote'
WHEN c.StatusBeforeCan = 1 THEN 'Light Pencil'
WHEN c.StatusBeforeCan = 2 THEN 'Heavy Pencil'
WHEN c.StatusBeforeCan = 3 THEN 'Confirmed'
ELSE 'Cancelled'
END AS [Status Before Cancellation],
A.Operators as [Operator],
CAST((b.price_quoted - (b.tax1 + b.tax2) ) as DECIMAL(9,2)) as [Revenue Less Tax],
C.reason as [Cancellation Reason]
FROM tblbookings B left outer join tblCancelBR C on b.booking_no = c.booking_no
left outer join tblAudit A on b.booking_no = A.booking_no
LEFT OUTER JOIN tblsalesper S ON B.salesperson = S.salesperson_code
WHERE (B.BookingProgressStatus = 4 and A.audit_type = 29 and C.Reason = 'COVID19')
ORDER BY B.Booking_no