I think you have no GR based invoice verification in place, hence the first invoice covers the existing receipt and the second invoice can be entered for a future receipt.
If you would work with GR based IV then you can only post invoices after the receipt, and just as much as you have received if you have your tolerances in place.
also helpful is a check for duplicate invoices, which makes it impossible to enter the same invoice twice