Easiest way would be to use the keyword DEFAULT for the invoice number.
INSERT INTO invoices (invoicenumber, invoice_time, customer_id)
VALUES (DEFAULT, current_timestamp, 222);
Otherwise you can use nextval('invoice_seq') where invoice_seq is the name of your sequence.