
INSERT INTO invoices (inserted, order_id)
	(SELECT orders.inserted, orders.id FROM orders WHERE orders.id > 798717 and orders.payment_type = 'agreement' order by orders.id);
