Importing Sales Journal from CSV - Get duplicate reference warning but import is still successful

Whenever I import an invoice from csv, the invoice will import completely correctly but I'll always get the "Warning! The reference number has already been used" duplicate reference error at the very end of the import. And the location of the error will always be the last line of that invoice.

Because it's always throwing the error during the last line, I thought it might have something to do with the Number of Distributions or Invoice Distribution number column. I thought I might just be entering those counts incorrectly, and it was expecting either more or fewer lines than the number I gave it. But if I make any changes to those columns the entire import would fail. 

Then I thought maybe since the import tells Sage how many lines there are and what number it's on, perhaps I don't need to repeat the invoice number on each line even though that's how it gets exported. I tried only filling in the invoice number for the first line of the invoice. I didn't get the error but what I got was duplicates of the invoice but none of which had any invoice number associated with them.  

So I'm left with a situation where I just have to know to ignore a duplicate reference number error. But it makes me uneasy so I always double check the imported invoices anyway.

If anyone can help me figure out what's going on with the imports so that the error doesn't show up I would greatly appreciate it.