Added check for shipments before deleting invoice