Correct error in addPreviouslyRefundedAmount

- correct logic
- create test
Minor nit, but `currentRefundId` would be a better and more concise name.