Try to get the line item value of a field called orderdoc. It might hold the item fulfillment id.
If it doesn't work , than on the before load event of the invouce creation try to get the line item value of the "line" field, there is a chance that it will contain the item fulfillment id + "_" + line index.