IssueReturn.PerformMaterialMovement ttIssueReturn contains redundant rows for customer owned inventory

We have a BPM (IssueReturn.PerformMaterialMovement) that is trying to report remaining customer inventory when such material issue issued. What we have found is that the wrong count is being reported. I traced the problem to the ttIssueReturn table being passed into the BPM which for some reason contains duplicate information. It only seems to do this for customer owned inventory and not regular inventory, i.e. inventory from places like the component warehouse only have a single row.

Is there a reason why there is a duplicate row? Is there some configuration somewhere that could fix this? I’m not sure what the proper way to handle this issue. For instance, is it safe to assume that there should only be one row with non-zero quantity and just ignore the rest? Or is it possible that there might be a valid reason for other rows to have additional quantity? In the test cases I have looked at, for COI there are two rows containing the quantity being issued, and one row containing a zero quantity but I don’t know if this would always be true.

Turns out I needed to look at the ttIssueReturn RowMod field and ignore the row if it wasn’t “A” or “U”.