handle multiple currencies

This fixes pivotal 48393903.  It's tested but I'd suggest not merging it until we hear back from the customer in case this does not address his problem.