seed data for Currency Types has wrong code for Canadian Dollars

Bug #1807998 reported by Andrea Neiman
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Low
Unassigned

Bug Description

The Currency Types grid in Acq Admin includes three stock currencies -- US Dollar, Euro, and Canadian Dollar.

Per ISO 4217, Canadian Dollar should have an alphabetic code of CAD -- we have this as CAN. Since the other two currencies list the correct ISO alphabetic code, the Canadian one should be corrected as well.

Andrea Neiman (aneiman)
description: updated
Erica Rohlfs (erohlfs)
Changed in evergreen:
status: New → Confirmed
Revision history for this message
Erica Rohlfs (erohlfs) wrote :

Confirmed in 3.2.1

I'll add (and maybe a separate bug) that attempting to manually adjust the code doesn't save.

Administration -> Acquisitions Administration -> Currency Types -> Double click the Canadian Dollar currency type -> secondary window opens, Record Editor: Currency Type -> manually adjust CAN to CAD -> Save

A message displays that the Currency Type Update Succeeded, but it did not save the change.

Revision history for this message
Andrea Neiman (aneiman) wrote :

I filed the save failure at bug 1808012.

Revision history for this message
Rogan Hamby (rogan-hamby) wrote :

I independently just found the save bug myself and didn't know there was a separate ticket for it.

Patch for seed data and setting acq.exchange_rates to_currency and from_currency to update on cascade.

patch here:

user/rogan/lp1807998cad_not_can

tags: added: pullrequest
Michele Morgan (mmorgan)
Changed in evergreen:
milestone: none → 3.next
Changed in evergreen:
assignee: nobody → Jane Sandberg (sandbej)
Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks for your patch, Rogan. A few thoughts:

1) There is a small copy/pasto on lines 4-5 of the upgrade script.

UPDATE acq.exchange_rate SET from_currency = 'CAD' WHERE code = 'CAN';
UPDATE acq.exchange_rate SET to_currency = 'CAD' WHERE code = 'CAN';

Should have from_currency and to_currency, respectively, instead of code. I'm also curious if those two lines are necessary at all. If you put the second half of the script first, the CAN => CAD change should cascade.

2) Several other tables reference currency_type, apart from exchange_rate. At a quick glance, I saw acq.fund, acq.funding_source, and acq.fund_debit. Could you please include those in your script too?

FWIW, I get this error message when I try to run your upgrade script on a concerto database:

ERROR: update or delete on table "currency_type" violates foreign key constraint "funding_source_currency_type_fkey" on table "funding_source"
DETAIL: Key (code)=(CAN) is still referenced from table "funding_source".

Changed in evergreen:
assignee: Jane Sandberg (sandbej) → nobody
tags: added: needsrepatch
removed: pullrequest
tags: added: acq-admin
tags: added: needswork
removed: needsrepatch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.