Hi
Check these notes, maybe they will help you to solve this mess
SAP Note 38501 - Intercompany billing before customer billing document
SAP Note 308989 - Consulting note for cross-company transactions
and related notes
I hope this help you
Regards
Eduardo