Hi Meghna,
To get it write, requirement is to avoid splitting of invoices if your partner function personnel number is different this means header had 1234 and items have 1234 & 2345, correct me if I am wrong.
If above is correct, then we need to know are you creating sales order based invoice or delivery based. Explain your process what are you doing.
Regards
Rahul