SELECT o.orderdate,
od.orderdetailid,
od.gifttraknumber,
'1' AS 'Lines',
od.quantity,
(od.quantity * od.productprice) AS Sales,
(od.quantity * od.vendor_price) AS COGS,
od.qtyonpackingslip
FROM orderdetails od 
JOIN orders o ON od.orderid = o.orderid 
WHERE od.gifttraknumber NOT IN (0,99) 
AND o.orderdate > '2021-12-01'
AND o.order_entry_system != 'MARKETPLACE' 
AND od.ProductCode != 'Restock'