insert first row to Invoice table like
CREATE PROCEDURE PROCEDURENAME
@Parameter1 dataType,
@Parameter2 dataType,
@Parameter3 dataType,
@InvoiceNo BigInt,
@LastId BigInt=0 OUTPUT
AS
BEGIN
INSERT INTO Invoice(Field1,Field2...)Values(@Parameter1,@Parameter2....)
SELECT @InvoiceNo= MAX(InvoiceNo) FROM Invoice
SET @LastId=@InvoiceNo
END
Now you will get invoice no for inserted row..in @LastId you can pass it to second query ..
and follow same method in second sp to get the primary key of second table...