price_history (product_id, effective_from, price) logs list prices: a price applies from its effective_from until the product's next price takes over. There is no end-date column. order_lines (line_id, product_id, ordered_at, qty) holds order lines.
Price every order line at the price in effect when it was ordered: the product's price with the latest effective_from at or before ordered_at — a price that takes effect at the very instant of the order already applies. A line ordered before its product had any price gets NULL for both price columns, and still appears.
Columns: line_id, product_id, ordered_at, qty, unit_price, line_total (qty × unit_price). Sort by line_id.