adding a new iso code for a currency

Hi

When I try to add a new currency in lookups I only get to choose between 5 different ISO Codes(from existing currencies?) and I believe I shoiuld be able to add my own ISO Code.

How is that done?

Lars

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Re: adding a new iso code for a currency

You need to change the lookup.currency archetype.

At present, the only way to do this is by editing:

     <OPENVPMS_HOME>/update/archetypes/org/openvpms/archetype/lookup/lookup.currency.adl

and changing the code node to add your new code:

        <node displayName="ISO code" name="code" path="/code"
              type="java.lang.String" minCardinality="1" maxLength="3">
            <assertion name="lookup.local">
                <propertyList name="entries">
                    <property name="AUD" value="AUD"/>
                    <property name="NZD" value="NZD"/>
                    <property name="USD" value="USD"/>
                    <property name="EUR" value="EUR"/>
                    <property name="CAD" value="CAD"/>
                    <property name="GBP" value="GBP"/>
                    <property name="GBP" value="GBP"/>
                    <property name="<NEW_CODE>" value="<NEW_CODE>"/>
                </propertyList>
                <errorMessage>Invalid ISO Code</errorMessage>
            </assertion>
        </node>

You can then reload the archetypes with the archload.bat/.sh script in <OPENVPMS_HOME>/bin

You'll need to restart the webapp for it to get the updated archetype.

Once loaded, you can create a new currency lookup with the appropriate ISO code in the Administration -> Lookups workspace.

What currency do you want added, so I can make sure it goes into the next release?

Re: adding a new iso code for a currency

Hi Lars,

You can create the new ISO code as per the above information Tim provided but the easiest way to update the application is to import the new archetype in Administration->Archetypes.  This will update the existing and not require a Tomcat restart.

Cheers

Tony

Re: adding a new iso code for a currency

Please add ISO Code DKK for Danish Krone

Re: adding a new iso code for a currency

Done. The change will be available in the 1.6 release.

-Tim

Syndicate content