Your mistake is simple: you don't list the columns you are INSERTing into:
insert into purchaseInvoiceDetails values (@purchaseID,@proID,@quan,
@totPrice,@proExpiry)
Because of that, SQL tires to insert the data in the order that the table items are defined:
CREATE TABLE purchaseInvoiceDetails(
pid_id bigint IDENTITY NOT NULL,
pid_purchaseID bigint NOT NULL,
pid_proID int NOT NULL,
pid_proquan int NOT NULL,
pid_totprice money NOT NULL,
pid_proexpiry date NULL
The first column is an IDENTITY column, and you can't write to that at all, so the SP fails to do any INSERT operation.
List your columns, and it'll start to work:
INSERT INTO purchaseInvoiceDetails (pid_purchaseID, pid_proID, pid_proquan, pid_totprice, pid_proexpiry) VALUES (@purchaseID,@proID,@quan,
@totPrice,@proExpiry)
Always list the columns you are trying to INSERT or SELECT - it's just asking for problems if you don't!