Commit 2b873063 authored by Frank Bergmann's avatar Frank Bergmann

Initial Import

parents
Pipeline #575 failed with stages
<?xml version="1.0"?>
<!-- Generated by the OpenACS Package Manager -->
<package key="ref-currency" url="http://www.mayuli.com/acs-repository/apm/packages/ref-currency" type="apm_service">
<package-name>Reference Data - Currency</package-name>
<pretty-plural>Reference Data - Currencies</pretty-plural>
<initial-install-p>f</initial-install-p>
<singleton-p>t</singleton-p>
<version name="0.3" url="http://www.mayuli.com/acs-repository/download/apm/ref-currency-0.3.apm">
<database-support>
<database>oracle</database>
<database>postgresql</database>
</database-support>
<owner url="mailto:jon@jongriffin.com">Jon Griffin</owner>
<summary>Currency Data, ISO 4217 for acs-reference.</summary>
<vendor url="http://www.mayuli.com">Mayuli Enterprises, LLC</vendor>
<description format="text/plain">This is the currency sub-module for acs-reference.
It provides ISO 4217 compatibility.</description>
<provides url="ref-currency" version="0.3"/>
<requires url="acs-kernel" version="4.6.2"/>
<requires url="acs-reference" version="0.1d"/>
<requires url="ref-countries" version="0.1d"/>
<requires url="ref-language" version="0.1d"/>
<files>
<file type="package_spec" path="ref-currency.info"/>
<file type="data_model" db_type="oracle" path="sql/common/ref-currency-data.sql"/>
<file type="data_model_create" db_type="oracle" path="sql/oracle/ref-currency-create.sql"/>
<file type="data_model_drop" db_type="oracle" path="sql/oracle/ref-currency-drop.sql"/>
<file type="data_model_create" db_type="postgresql" path="sql/postgresql/ref-currency-create.sql"/>
<file type="data_model_drop" db_type="postgresql" path="sql/postgresql/ref-currency-drop.sql"/>
<file type="documentation" path="www/doc/index.html"/>
</files>
<parameters>
<!-- No version parameters -->
</parameters>
</version>
</package>
NA,, ,,No universal currency
ADP,20,0,,Andorran Peseta
AED,784,2,,UAE Dirham
AFA,4,2,,Afghani
ALL,8,2,,Lek
AMD,51,2,,Armenian Dram
ANG,532,2,,Netherlands Antillan Guilder
AOA,973,2,,Kwanza
ARS,32,2,,Argentine Peso
ATS,40,2,,Schilling
AUD,36,2,,Australian Dollar
AWG,533,2,,Aruban Guilder
AZM,31,2,,Azerbaijanian Manat
BAM,977,2,,Convertible Marks
BBD,52,2,,Barbados Dollar
BDT,50,2,,Taka
BEF,56,0,,Belgian Franc
BGL,100,2,,Lev
BGN,975,2,,Bulgarian Lev
BHD,48,3,,Bahraini Dinar
BIF,108,0,,Burundi Franc
BMD,60,2,,Bermudian Dollar
BND,96,2,,Brunei Dollar
BOB,68,2,,Boliviano
BOV,984,2,,Mvdol
BRL,986,2,,Brazilian Real
BSD,44,2,,Bahamian Dollar
BTN,64,2,,Ngultrum
BWP,72,2,,Pula
BYB,112,0,,Belarussian Ruble
BYR,974,0,,Belarussian Ruble
BZD,84,2,,Belize Dollar
CAD,124,2,,Canadian Dollar
CDF,976,2,,Franc Congolais
CHF,756,2,,Swiss Franc
CLF,990,0,,Unidades de fomento
CLP,152,0,,Chilean Peso
CNY,156,2,,Yuan Renminbi
COP,170,2,,Colombian Peso
CRC,188,2,,Costa Rican Colon
CUP,192,2,,Cuban Peso
CVE,132,2,,Cape Verde Escudo
CYP,196,2,,Cyprus Pound
CZK,203,2,,Czech Koruna
DEM,276,2,,Deutsche Mark
DJF,262,0,,Djibouti Franc
DKK,208,2,,Danish Krone
DOP,214,2,,Dominican Peso
DZD,12,2,,Algerian Dinar
EEK,233,2,,Kroon
EGP,818,2,,Egyptian Pound
ERN,232,2,,Nakfa
ESP,724,0,,Spanish Peseta
ETB,230,2,,Ethiopian Birr
EUR,280,2,,Euro
FIM,246,2,,Markka
FJD,242,2,,Fiji Dollar
FKP,238,2,,Falkland Islands Pound
FRF,250,2,,French Franc
GBP,826,2,,Pound Sterling
GEL,981,2,,Lari
GHC,288,2,,Cedi
GIP,292,2,,Gibraltar Pound
GMD,270,2,,Dalasi
GNF,324,0,,Guinea Franc
GRD,300,0,,Drachma
GTQ,320,2,,Quetzal
GWP,624,2,,Guinea-Bissau Peso
GYD,328,2,,Guyana Dollar
HKD,344,2,,Hong Kong Dollar
HNL,340,2,,Lempira
HRK,191,2,,Croatian kuna
HTG,332,2,,Gourde
HUF,348,2,,Forint
IDR,360,2,,Rupiah
IEP,372,2,,Irish Pound
ILS,376,2,,New Israeli Sheqel
INR,356,2,,Indian Rupee
IQD,368,3,,Iraqi Dinar
IRR,364,2,,Iranian Rial
ISK,352,2,,Iceland Krona
ITL,380,0,,Italian Lira
JMD,388,2,,Jamaican Dollar
JOD,400,3,,Jordanian Dinar
JPY,392,0,,Yen
KES,404,2,,Kenyan Shilling
KGS,417,2,,Som
KHR,116,2,,Riel
KMF,174,0,,Comoro Franc
KPW,408,2,,North Korean Won
KRW,410,0,,Won
KWD,414,3,,Kuwaiti Dinar
KYD,136,2,,Cayman Islands Dollar
KZT,398,2,,Tenge
LAK,418,2,,Kip
LBP,422,2,,Lebanese Pound
LKR,144,2,,Sri Lanka Rupee
LRD,430,2,,Liberian Dollar
LSL,426,2,,Loti
LTL,440,2,,Lithuanian Litus
LUF,442,0,,Luxembourg Franc
LVL,428,2,,Latvian Lats
LYD,434,3,,Lybian Dinar
MAD,504,2,,Moroccan Dirham
MDL,498,2,,Moldovan Leu
MGF,450,0,,Malagasy Franc
MKD,807,2,,Denar
MMK,104,2,,Kyat
MNT,496,2,,Tugrik
MOP,446,2,,Pataca
MRO,478,2,,Ouguiya
MTL,470,2,,Maltese Lira
MUR,480,2,,Mauritius Rupee
MVR,462,2,,Rufiyaa
MWK,454,2,,Kwacha
MXN,484,2,,Mexican Peso
MXV,979,2,,Mexican Unidad de Inversion (UDI)
MYR,458,2,,Malaysian Ringgit
MZM,508,2,,Metical
NAD,516,2,,Namibia Dollar
NGN,566,2,,Naira
NIO,558,2,,Cordoba Oro
NLG,528,2,,Netherlands Guilder
NOK,578,2,,Norvegian Krone
NPR,524,2,,Nepalese Rupee
NZD,554,2,,New Zealand Dollar
OMR,512,3,,Rial Omani
PAB,590,2,,Balboa
PEN,604,2,,Nuevo Sol
PGK,598,2,,Kina
PHP,608,2,,Philippine Peso
PKR,586,2,,Pakistan Rupee
PLN,985,2,,Zloty
PTE,620,0,,Portuguese Escudo
PYG,600,0,,Guarani
QAR,634,2,,Qatari Rial
ROL,642,2,,Leu
RUB,643,2,,Russian Ruble
RUR,810,2,,Russian Ruble
RWF,646,0,,Rwanda Franc
SAR,682,2,,Saudi Riyal
SBD,90,2,,Solomon Islands Dollar
SCR,690,2,,Seychelles Rupee
SDD,736,2,,Sudanese Dinar
SEK,752,2,,Swedish Krona
SGD,702,2,,Singapore Dollar
SHP,654,2,,Saint Helena Pound
SIT,705,2,,Tolar
SKK,703,2,,Slovak Koruna
SLL,694,2,,Leone
SOS,706,2,,Somali Shilling
SRG,740,2,,Suriname Guilder
STD,678,2,,Dobra
SVC,222,2,,El Salvador Colon
SYP,760,2,,Syrian Pound
SZL,748,2,,Lilangeni
THB,764,2,,Baht
TJR,762,0,,Tajik Ruble
TJS,972,0,,Somoni
TMM,795,2,,Manat
TND,788,3,,Tunisian Dinar
TOP,776,2,,Paaaaanga
TPE,626,0,,Timor Escudo
TRL,792,0,,Turkish Lira
TTD,780,2,,Trinidad and Tobago Dollar
TWD,901,2,,New Taiwan Dollar
TZS,834,2,,Tanzanian Shilling
UAH,980,2,,Hryvnia
UGX,800,2,,Uganda Shilling
USD,840,2,,US Dollar
USN,997,2,,US Dollar (Next day)
USS,998,2,,US Dollar (Same day)
UYU,858,2,,Peso Uruguayo
UZS,860,2,,Uzbekistan Sum
VEB,862,2,,Bolivar
VND,704,2,,Dong
VUV,548,0,,Vatu
WST,882,2,,Tala
XAF,950,0,,CFA Franc BEAC
XCD,951,2,,East Carribbean Dollar
XOF,952,0,,CFA Franc BCEAO
XPF,953,0,,CFP Franc
YER,886,2,,Yemeni Rial
YUM,891,2,,Yugoslavian Dinar
ZAR,710,2,,Rand
ZMK,894,2,,Kwacha
ZWD,716,2,,Zimbabwe Dollar
load data infile '[acs_root_dir]/packages/ref-currency/sql/common/currencies.dat'
into table currencies
replace
fields terminated by "," optionally enclosed by "'"
(codeA,codeN,minor_unit,note,default_name)
-- packages/acs-reference/sql/oracle/ref-currency-create.sql
--
-- @author jon@jongriffin.com
-- @creation-date 2001-08-27
-- @cvs-id $Id$
create table currencies (
-- since currencies
-- 3 char alphabetic
codeA char(3)
constraint currencies_code_a_pk
primary key,
-- this is the currency #
codeN number,
-- this is the minor unit
-- not sure of the use but it is in the standar
minor_unit char(1),
-- explanation per iso
note varchar(4000),
-- this violates 3nf but is used for 2 reasons
-- 1. to help efficiency
-- 2. to make querys not fail if no translation exists yet
default_name varchar(100)
constraint currencies_default_name_nn
not null
);
comment on table currencies is '
This is the currency code/english name table from ISO 4217.
';
-- add this table into the reference repository
declare
v_id integer;
begin
v_id := acs_reference.new(
table_name => 'CURRENCIES',
source => 'ISO 4217',
source_url => 'http://www.iso.ch',
last_update => to_date('2000-10-30','YYYY-MM-DD'),
effective_date => sysdate
);
commit;
end;
/
-- This is the translated mapping of country names
create table currency_names (
-- lookup into the countries table
codeA char(3)
constraint currency_names_iso_fk
references currencies (codeA),
-- lookup into the language_codes table
language_code
constraint currency_names_lang_code_fk
references language_codes (language_id),
-- the translated name
name varchar(100)
);
comment on table currency_names is '
This is the translated mapping of currency names and language codes.
';
comment on column currency_names.language_code is '
This is a lookup into the iso languages table.
';
declare
v_id integer;
begin
v_id := acs_reference.new(
table_name => 'CURRENCY_NAMES',
source => 'ISO 4217',
source_url => 'http://www.iso.ch',
last_update => to_date('2000-10-30','YYYY-MM-DD'),
effective_date => sysdate
);
commit;
end;
/
-- map from currencies to country
create table currency_country_map (
codeA char(3)
constraint currency_country_map_code_fk
references currencies (codeA),
-- foreign key to relate country to currency
-- this can by one => many therefor can't be unique
-- i.e. Cuba has USD and CUP
country_code char(2)
constraint curr_cntry_map_country_fk
references countries (iso)
);
declare
v_id integer;
begin
v_id := acs_reference.new(
table_name => 'CURRENCY_COUNTRY_MAP',
source => 'ISO 4217',
source_url => 'http://www.iso.ch',
last_update => to_date('2000-10-30','YYYY-MM-DD'),
effective_date => sysdate
);
commit;
end;
/
-- I will add a view to join this stuff later.
-- Drop the ACS Reference Currency data
--
-- @author jon@jongriffin.com
-- @cvs-id $Id$
set serveroutput on
-- drop all associated tables and packages
-- I am not sure this is a good idea since we have no way to register
-- if any other packages are using this data.
-- This will probably fail if their is a child table using this.
-- I can probably make this cleaner also, but ... no time today
declare
cursor refsrc_cur is
select table_name,
package_name,
repository_id
from acs_reference_repositories
where upper(table_name) like 'CURRENC%'
order by repository_id desc;
begin
for rec in refsrc_cur loop
dbms_output.put_line('Dropping ' || rec.table_name);
execute immediate 'drop table ' || rec.table_name;
if rec.package_name is not null then
execute immediate 'drop package ' || rec.package_name;
end if;
acs_reference.del(rec.repository_id);
end loop;
end;
/
show errors
\copy currencies from '[acs_root_dir]/packages/ref-currency/sql/common/currencies.dat' WITH DELIMITER AS ',' null as ''
-- packages/ref-currency/sql/postgresql/ref-currency-create.sql
--
-- @author jon@jongriffin.com
-- @creation-date 2001-08-27
-- @cvs-id $Id$
create table currencies (
-- since currencies
-- 3 char alphabetic
codeA char(3)
constraint currencies_code_a_pk
primary key,
-- this is the currency #
codeN numeric,
-- this is the minor unit
-- not sure of the use but it is in the standar
minor_unit char(1),
-- explanation per iso
note varchar(4000),
-- this violates 3nf but is used for 2 reasons
-- 1. to help efficiency
-- 2. to make querys not fail if no translation exists yet
default_name varchar(100)
constraint currencies_default_name_nn
not null
);
comment on table currencies is '
This is the currency code/english name table from ISO 4217.
';
-- add this table into the reference repository
select acs_reference__new (
'CURRENCIES', -- table_name
'2000-10-30',
'ISO 4217', -- source
'http://www.iso.ch', -- source_url
now() -- effective_date
);
-- This is the translated mapping of country names
create table currency_names (
-- lookup into the countries table
codeA char(3)
constraint currency_names_iso_fk
references currencies (codeA),
-- lookup into the language_codes table
language_code char(2)
constraint currency_names_lang_code_fk
references language_codes (language_id),
-- the translated name
name varchar(100)
);
comment on table currency_names is '
This is the translated mapping of currency names and language codes.
';
comment on column currency_names.language_code is '
This is a lookup into the iso languages table.
';
-- add this table into the reference repository
select acs_reference__new (
'CURRENCY_NAMES', -- table_name
'2000-10-30',
'ISO 4217', -- source
'http://www.iso.ch', -- source_url
now() -- effective_date
);
-- map from currencies to country
create table currency_country_map (
codeA char(3)
constraint currency_country_map_code_fk
references currencies (codeA),
-- foreign key to relate country to currency
-- this can by one => many therefor can't be unique
-- i.e. Cuba has USD and CUP
country_code char(2)
constraint curr_cntry_map_country_fk
references countries (iso)
);
-- add this table into the reference repository
select acs_reference__new (
'CURRENCY_COUNTRY_MAP', -- table_name
'2000-10-30',
'ISO 4217', -- source
'http://www.iso.ch', -- source_url
now() -- effective_date
);
-- I will add a view to join this stuff later.
-- Drop the ACS Reference Currency data
--
-- @author jon@jongriffin.com
-- @cvs-id $Id$
-- drop all associated tables and packages
-- I am not sure this is a good idea since we have no way to register
-- if any other packages are using this data.
-- This will probably fail if their is a child table using this.
-- I can probably make this cleaner also, but ... no time today
create or replace function inline_0() returns integer as '
declare
rec acs_reference_repositories%ROWTYPE;
begin
for rec in select * from acs_reference_repositories where upper(table_name) like ''CURRENC%'' loop
execute ''drop table '' || rec.table_name || '' cascade'';
perform acs_reference__delete(rec.repository_id);
end loop;
return 0;
end;' language 'plpgsql';
select inline_0();
drop function inline_0();
<!-- $Id$ -->
<html>
<head><title>Reference Currency Documentation</title></head>
<body bgcolor=#ffffff>
<h2>Reference Currency Documentation</h2>
<hr>
<h3>Engineering Docs</h3>
<ul>
<li> <em>None</em>
</ul>
Current docs are always at:<br>
<a href="http://www.jongriffin.com/static/openacs">jongriffin.com</a>
<h3>Release Notes</h3>
<p>Please file bugs in the <a href="http://www.openacs.org/sdm/">SDM</a>.</p>
<hr>
<address><a href="mailto:jon@jongriffin.com">jon@jongriffin.com</a></address></body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment