fix issue where non-primary currency code was used

refactored currency code handling for improved flow control
use primary currency code instead of 'same day' etc funds