Using now currency names from k-i18n Currency
This commit is contained in:
parent
adf2fce145
commit
af7260db70
|
@ -7,7 +7,10 @@ class InvoiceDetails(
|
||||||
val invoiceNumber: String,
|
val invoiceNumber: String,
|
||||||
val invoiceDate: LocalDate,
|
val invoiceDate: LocalDate,
|
||||||
|
|
||||||
val currency: Currency = Currency.EUR,
|
val currency: Currency = Currency.Euro,
|
||||||
|
|
||||||
|
// val orderNumber: String? = null,
|
||||||
|
// val orderDate: LocalDate? = null,
|
||||||
|
|
||||||
val dueDate: LocalDate? = null,
|
val dueDate: LocalDate? = null,
|
||||||
val paymentDescription: String? = null,
|
val paymentDescription: String? = null,
|
||||||
|
|
|
@ -1,184 +1,184 @@
|
||||||
package net.codinux.invoicing.model.codes
|
package net.codinux.invoicing.model.codes
|
||||||
|
|
||||||
enum class Currency(val alpha3Code: String, val currencySymbol: String?, val englishName: String, val countries: Set<String>, val isFrequentlyUsedValue: Boolean) {
|
enum class Currency(val alpha3Code: String, val currencySymbol: String?, val englishName: String, val countries: Set<String>, val isFrequentlyUsedValue: Boolean) {
|
||||||
AED("AED", "AED", "UAE Dirham", setOf("UNITED ARAB EMIRATES (THE)"), false),
|
UAEDirham("AED", "AED", "UAE Dirham", setOf("UNITED ARAB EMIRATES (THE)"), false),
|
||||||
AFN("AFN", "AFN", "Afghani", setOf("AFGHANISTAN"), false),
|
Afghani("AFN", "AFN", "Afghani", setOf("AFGHANISTAN"), false),
|
||||||
ALL("ALL", "ALL", "Lek", setOf("ALBANIA"), false),
|
Lek("ALL", "ALL", "Lek", setOf("ALBANIA"), false),
|
||||||
AMD("AMD", "AMD", "Armenian Dram", setOf("ARMENIA"), false),
|
ArmenianDram("AMD", "AMD", "Armenian Dram", setOf("ARMENIA"), false),
|
||||||
ANG("ANG", "ANG", "Netherlands Antillean Guilder", setOf("CURAÇAO", "SINT MAARTEN (DUTCH PART)"), false),
|
NetherlandsAntilleanGuilder("ANG", "ANG", "Netherlands Antillean Guilder", setOf("CURAÇAO", "SINT MAARTEN (DUTCH PART)"), false),
|
||||||
AOA("AOA", "AOA", "Kwanza", setOf("ANGOLA"), false),
|
AOA("AOA", "AOA", "Kwanza", setOf("ANGOLA"), false),
|
||||||
ARS("ARS", "ARS", "Argentine Peso", setOf("ARGENTINA"), false),
|
ArgentinePeso("ARS", "ARS", "Argentine Peso", setOf("ARGENTINA"), false),
|
||||||
AUD("AUD", "A$", "Australian Dollar", setOf("AUSTRALIA", "CHRISTMAS ISLAND", "COCOS (KEELING) ISLANDS (THE)", "HEARD ISLAND AND McDONALD ISLANDS", "KIRIBATI", "NAURU", "NORFOLK ISLAND", "TUVALU"), false),
|
AustralianDollar("AUD", "A$", "Australian Dollar", setOf("AUSTRALIA", "CHRISTMAS ISLAND", "COCOS (KEELING) ISLANDS (THE)", "HEARD ISLAND AND McDONALD ISLANDS", "KIRIBATI", "NAURU", "NORFOLK ISLAND", "TUVALU"), false),
|
||||||
AWG("AWG", "AWG", "Aruban Florin", setOf("ARUBA"), false),
|
ArubanFlorin("AWG", "AWG", "Aruban Florin", setOf("ARUBA"), false),
|
||||||
AZN("AZN", "AZN", "Azerbaijan Manat", setOf("AZERBAIJAN"), false),
|
AzerbaijanManat("AZN", "AZN", "Azerbaijan Manat", setOf("AZERBAIJAN"), false),
|
||||||
BAM("BAM", "BAM", "Convertible Mark", setOf("BOSNIA AND HERZEGOVINA"), false),
|
ConvertibleMark("BAM", "BAM", "Convertible Mark", setOf("BOSNIA AND HERZEGOVINA"), false),
|
||||||
BBD("BBD", "BBD", "Barbados Dollar", setOf("BARBADOS"), false),
|
BarbadosDollar("BBD", "BBD", "Barbados Dollar", setOf("BARBADOS"), false),
|
||||||
BDT("BDT", "BDT", "Taka", setOf("BANGLADESH"), false),
|
Taka("BDT", "BDT", "Taka", setOf("BANGLADESH"), false),
|
||||||
BGN("BGN", "BGN", "Bulgarian Lev", setOf("BULGARIA"), false),
|
BulgarianLev("BGN", "BGN", "Bulgarian Lev", setOf("BULGARIA"), false),
|
||||||
BHD("BHD", "BHD", "Bahraini Dinar", setOf("BAHRAIN"), false),
|
BahrainiDinar("BHD", "BHD", "Bahraini Dinar", setOf("BAHRAIN"), false),
|
||||||
BIF("BIF", "BIF", "Burundi Franc", setOf("BURUNDI"), false),
|
BurundiFranc("BIF", "BIF", "Burundi Franc", setOf("BURUNDI"), false),
|
||||||
BMD("BMD", "BMD", "Bermudian Dollar", setOf("BERMUDA"), false),
|
BermudianDollar("BMD", "BMD", "Bermudian Dollar", setOf("BERMUDA"), false),
|
||||||
BND("BND", "BND", "Brunei Dollar", setOf("BRUNEI DARUSSALAM"), false),
|
BruneiDollar("BND", "BND", "Brunei Dollar", setOf("BRUNEI DARUSSALAM"), false),
|
||||||
BOB("BOB", "BOB", "Boliviano", setOf("BOLIVIA (PLURINATIONAL STATE OF)"), false),
|
Boliviano("BOB", "BOB", "Boliviano", setOf("BOLIVIA (PLURINATIONAL STATE OF)"), false),
|
||||||
BOV("BOV", "BOV", "Mvdol", setOf("BOLIVIA (PLURINATIONAL STATE OF)"), false),
|
Mvdol("BOV", "BOV", "Mvdol", setOf("BOLIVIA (PLURINATIONAL STATE OF)"), false),
|
||||||
BRL("BRL", "R$", "Brazilian Real", setOf("BRAZIL"), false),
|
BrazilianReal("BRL", "R$", "Brazilian Real", setOf("BRAZIL"), false),
|
||||||
BSD("BSD", "BSD", "Bahamian Dollar", setOf("BAHAMAS (THE)"), false),
|
BahamianDollar("BSD", "BSD", "Bahamian Dollar", setOf("BAHAMAS (THE)"), false),
|
||||||
BTN("BTN", "BTN", "Ngultrum", setOf("BHUTAN"), false),
|
Ngultrum("BTN", "BTN", "Ngultrum", setOf("BHUTAN"), false),
|
||||||
BWP("BWP", "BWP", "Pula", setOf("BOTSWANA"), false),
|
Pula("BWP", "BWP", "Pula", setOf("BOTSWANA"), false),
|
||||||
BYN("BYN", "BYN", "Belarusian Ruble", setOf("BELARUS"), false),
|
BYN("BYN", "BYN", "Belarusian Ruble", setOf("BELARUS"), false),
|
||||||
BZD("BZD", "BZD", "Belize Dollar", setOf("BELIZE"), false),
|
BelizeDollar("BZD", "BZD", "Belize Dollar", setOf("BELIZE"), false),
|
||||||
CAD("CAD", "CA$", "Canadian Dollar", setOf("CANADA"), false),
|
CanadianDollar("CAD", "CA$", "Canadian Dollar", setOf("CANADA"), false),
|
||||||
CDF("CDF", "CDF", "Congolese Franc", setOf("CONGO (THE DEMOCRATIC REPUBLIC OF THE)"), false),
|
CongoleseFranc("CDF", "CDF", "Congolese Franc", setOf("CONGO (THE DEMOCRATIC REPUBLIC OF THE)"), false),
|
||||||
CHE("CHE", "CHE", "WIR Euro", setOf("SWITZERLAND"), false),
|
WIREuro("CHE", "CHE", "WIR Euro", setOf("SWITZERLAND"), false),
|
||||||
CHF("CHF", "CHF", "Swiss Franc", setOf("LIECHTENSTEIN", "SWITZERLAND"), true),
|
SwissFranc("CHF", "CHF", "Swiss Franc", setOf("LIECHTENSTEIN", "SWITZERLAND"), true),
|
||||||
CHW("CHW", "CHW", "WIR Franc", setOf("SWITZERLAND"), false),
|
WIRFranc("CHW", "CHW", "WIR Franc", setOf("SWITZERLAND"), false),
|
||||||
CLF("CLF", "CLF", "Unidad de Fomento", setOf("CHILE"), false),
|
UnidadDeFomento("CLF", "CLF", "Unidad de Fomento", setOf("CHILE"), false),
|
||||||
CLP("CLP", "CLP", "Chilean Peso", setOf("CHILE"), false),
|
ChileanPeso("CLP", "CLP", "Chilean Peso", setOf("CHILE"), false),
|
||||||
CNY("CNY", "CN¥", "Yuan Renminbi", setOf("CHINA"), false),
|
YuanRenminbi("CNY", "CN¥", "Yuan Renminbi", setOf("CHINA"), false),
|
||||||
COP("COP", "COP", "Colombian Peso", setOf("COLOMBIA"), false),
|
ColombianPeso("COP", "COP", "Colombian Peso", setOf("COLOMBIA"), false),
|
||||||
COU("COU", "COU", "Unidad de Valor Real", setOf("COLOMBIA"), false),
|
UnidadDeValorReal("COU", "COU", "Unidad de Valor Real", setOf("COLOMBIA"), false),
|
||||||
CRC("CRC", "CRC", "Costa Rican Colon", setOf("COSTA RICA"), false),
|
CostaRicanColon("CRC", "CRC", "Costa Rican Colon", setOf("COSTA RICA"), false),
|
||||||
CUC("CUC", "CUC", "Peso Convertible", setOf("CUBA"), false),
|
PesoConvertible("CUC", "CUC", "Peso Convertible", setOf("CUBA"), false),
|
||||||
CUP("CUP", "CUP", "Cuban Peso", setOf("CUBA"), false),
|
CubanPeso("CUP", "CUP", "Cuban Peso", setOf("CUBA"), false),
|
||||||
CVE("CVE", "CVE", "Cabo Verde Escudo", setOf("CABO VERDE"), false),
|
CaboVerdeEscudo("CVE", "CVE", "Cabo Verde Escudo", setOf("CABO VERDE"), false),
|
||||||
CZK("CZK", "CZK", "Czech Koruna", setOf("CZECHIA"), true),
|
CzechKoruna("CZK", "CZK", "Czech Koruna", setOf("CZECHIA"), true),
|
||||||
DJF("DJF", "DJF", "Djibouti Franc", setOf("DJIBOUTI"), false),
|
DjiboutiFranc("DJF", "DJF", "Djibouti Franc", setOf("DJIBOUTI"), false),
|
||||||
DKK("DKK", "DKK", "Danish Krone", setOf("DENMARK", "FAROE ISLANDS (THE)", "GREENLAND"), true),
|
DanishKrone("DKK", "DKK", "Danish Krone", setOf("DENMARK", "FAROE ISLANDS (THE)", "GREENLAND"), true),
|
||||||
DOP("DOP", "DOP", "Dominican Peso", setOf("DOMINICAN REPUBLIC (THE)"), false),
|
DominicanPeso("DOP", "DOP", "Dominican Peso", setOf("DOMINICAN REPUBLIC (THE)"), false),
|
||||||
DZD("DZD", "DZD", "Algerian Dinar", setOf("ALGERIA"), false),
|
AlgerianDinar("DZD", "DZD", "Algerian Dinar", setOf("ALGERIA"), false),
|
||||||
EGP("EGP", "EGP", "Egyptian Pound", setOf("EGYPT"), false),
|
EgyptianPound("EGP", "EGP", "Egyptian Pound", setOf("EGYPT"), false),
|
||||||
ERN("ERN", "ERN", "Nakfa", setOf("ERITREA"), false),
|
Nakfa("ERN", "ERN", "Nakfa", setOf("ERITREA"), false),
|
||||||
ETB("ETB", "ETB", "Ethiopian Birr", setOf("ETHIOPIA"), false),
|
EthiopianBirr("ETB", "ETB", "Ethiopian Birr", setOf("ETHIOPIA"), false),
|
||||||
EUR("EUR", "€", "Euro", setOf("ÅLAND ISLANDS", "ANDORRA", "AUSTRIA", "BELGIUM", "CYPRUS", "ESTONIA", "EUROPEAN UNION", "FINLAND", "FRANCE", "FRENCH GUIANA", "FRENCH SOUTHERN TERRITORIES (THE)", "GERMANY", "GREECE", "GUADELOUPE", "HOLY SEE (THE)", "IRELAND", "ITALY", "LATVIA", "LITHUANIA", "LUXEMBOURG", "MALTA", "MARTINIQUE", "MAYOTTE", "MONACO", "MONTENEGRO", "NETHERLANDS (THE)", "PORTUGAL", "RÉUNION", "SAINT BARTHÉLEMY", "SAINT MARTIN (FRENCH PART)", "SAINT PIERRE AND MIQUELON", "SAN MARINO", "SLOVAKIA", "SLOVENIA", "SPAIN"), true),
|
Euro("EUR", "€", "Euro", setOf("ÅLAND ISLANDS", "ANDORRA", "AUSTRIA", "BELGIUM", "CYPRUS", "ESTONIA", "EUROPEAN UNION", "FINLAND", "FRANCE", "FRENCH GUIANA", "FRENCH SOUTHERN TERRITORIES (THE)", "GERMANY", "GREECE", "GUADELOUPE", "HOLY SEE (THE)", "IRELAND", "ITALY", "LATVIA", "LITHUANIA", "LUXEMBOURG", "MALTA", "MARTINIQUE", "MAYOTTE", "MONACO", "MONTENEGRO", "NETHERLANDS (THE)", "PORTUGAL", "RÉUNION", "SAINT BARTHÉLEMY", "SAINT MARTIN (FRENCH PART)", "SAINT PIERRE AND MIQUELON", "SAN MARINO", "SLOVAKIA", "SLOVENIA", "SPAIN"), true),
|
||||||
FJD("FJD", "FJD", "Fiji Dollar", setOf("FIJI"), false),
|
FijiDollar("FJD", "FJD", "Fiji Dollar", setOf("FIJI"), false),
|
||||||
FKP("FKP", "FKP", "Falkland Islands Pound", setOf("FALKLAND ISLANDS (THE) [MALVINAS]"), false),
|
FalklandIslandsPound("FKP", "FKP", "Falkland Islands Pound", setOf("FALKLAND ISLANDS (THE) [MALVINAS]"), false),
|
||||||
GBP("GBP", "£", "Pound Sterling", setOf("GUERNSEY", "ISLE OF MAN", "JERSEY", "UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND (THE)"), true),
|
PoundSterling("GBP", "£", "Pound Sterling", setOf("GUERNSEY", "ISLE OF MAN", "JERSEY", "UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND (THE)"), true),
|
||||||
GEL("GEL", "GEL", "Lari", setOf("GEORGIA"), false),
|
Lari("GEL", "GEL", "Lari", setOf("GEORGIA"), false),
|
||||||
GHS("GHS", "GHS", "Ghana Cedi", setOf("GHANA"), false),
|
GhanaCedi("GHS", "GHS", "Ghana Cedi", setOf("GHANA"), false),
|
||||||
GIP("GIP", "GIP", "Gibraltar Pound", setOf("GIBRALTAR"), false),
|
GibraltarPound("GIP", "GIP", "Gibraltar Pound", setOf("GIBRALTAR"), false),
|
||||||
GMD("GMD", "GMD", "Dalasi", setOf("GAMBIA (THE)"), false),
|
Dalasi("GMD", "GMD", "Dalasi", setOf("GAMBIA (THE)"), false),
|
||||||
GNF("GNF", "GNF", "Guinean Franc", setOf("GUINEA"), false),
|
GuineanFranc("GNF", "GNF", "Guinean Franc", setOf("GUINEA"), false),
|
||||||
GTQ("GTQ", "GTQ", "Quetzal", setOf("GUATEMALA"), false),
|
Quetzal("GTQ", "GTQ", "Quetzal", setOf("GUATEMALA"), false),
|
||||||
GYD("GYD", "GYD", "Guyana Dollar", setOf("GUYANA"), false),
|
GuyanaDollar("GYD", "GYD", "Guyana Dollar", setOf("GUYANA"), false),
|
||||||
HKD("HKD", "HK$", "Hong Kong Dollar", setOf("HONG KONG"), false),
|
HongKongDollar("HKD", "HK$", "Hong Kong Dollar", setOf("HONG KONG"), false),
|
||||||
HNL("HNL", "HNL", "Lempira", setOf("HONDURAS"), false),
|
Lempira("HNL", "HNL", "Lempira", setOf("HONDURAS"), false),
|
||||||
HTG("HTG", "HTG", "Gourde", setOf("HAITI"), false),
|
Gourde("HTG", "HTG", "Gourde", setOf("HAITI"), false),
|
||||||
HUF("HUF", "HUF", "Forint", setOf("HUNGARY"), false),
|
Forint("HUF", "HUF", "Forint", setOf("HUNGARY"), false),
|
||||||
IDR("IDR", "IDR", "Rupiah", setOf("INDONESIA"), false),
|
Rupiah("IDR", "IDR", "Rupiah", setOf("INDONESIA"), false),
|
||||||
ILS("ILS", "₪", "New Israeli Sheqel", setOf("ISRAEL"), false),
|
NewIsraeliSheqel("ILS", "₪", "New Israeli Sheqel", setOf("ISRAEL"), false),
|
||||||
INR("INR", "₹", "Indian Rupee", setOf("BHUTAN", "INDIA"), false),
|
IndianRupee("INR", "₹", "Indian Rupee", setOf("BHUTAN", "INDIA"), false),
|
||||||
IQD("IQD", "IQD", "Iraqi Dinar", setOf("IRAQ"), false),
|
IraqiDinar("IQD", "IQD", "Iraqi Dinar", setOf("IRAQ"), false),
|
||||||
IRR("IRR", "IRR", "Iranian Rial", setOf("IRAN (ISLAMIC REPUBLIC OF)"), false),
|
IranianRial("IRR", "IRR", "Iranian Rial", setOf("IRAN (ISLAMIC REPUBLIC OF)"), false),
|
||||||
ISK("ISK", "ISK", "Iceland Krona", setOf("ICELAND"), true),
|
IcelandKrona("ISK", "ISK", "Iceland Krona", setOf("ICELAND"), true),
|
||||||
JMD("JMD", "JMD", "Jamaican Dollar", setOf("JAMAICA"), false),
|
JamaicanDollar("JMD", "JMD", "Jamaican Dollar", setOf("JAMAICA"), false),
|
||||||
JOD("JOD", "JOD", "Jordanian Dinar", setOf("JORDAN"), false),
|
JordanianDinar("JOD", "JOD", "Jordanian Dinar", setOf("JORDAN"), false),
|
||||||
JPY("JPY", "¥", "Yen", setOf("JAPAN"), false),
|
Yen("JPY", "¥", "Yen", setOf("JAPAN"), false),
|
||||||
KES("KES", "KES", "Kenyan Shilling", setOf("KENYA"), false),
|
KenyanShilling("KES", "KES", "Kenyan Shilling", setOf("KENYA"), false),
|
||||||
KGS("KGS", "KGS", "Som", setOf("KYRGYZSTAN"), false),
|
Som("KGS", "KGS", "Som", setOf("KYRGYZSTAN"), false),
|
||||||
KHR("KHR", "KHR", "Riel", setOf("CAMBODIA"), false),
|
Riel("KHR", "KHR", "Riel", setOf("CAMBODIA"), false),
|
||||||
KMF("KMF", "KMF", "Comorian Franc", setOf("COMOROS (THE)"), false),
|
ComorianFranc("KMF", "KMF", "Comorian Franc", setOf("COMOROS (THE)"), false),
|
||||||
KPW("KPW", "KPW", "North Korean Won", setOf("KOREA (THE DEMOCRATIC PEOPLE’S REPUBLIC OF)"), false),
|
NorthKoreanWon("KPW", "KPW", "North Korean Won", setOf("KOREA (THE DEMOCRATIC PEOPLE’S REPUBLIC OF)"), false),
|
||||||
KRW("KRW", "₩", "Won", setOf("KOREA (THE REPUBLIC OF)"), false),
|
Won("KRW", "₩", "Won", setOf("KOREA (THE REPUBLIC OF)"), false),
|
||||||
KWD("KWD", "KWD", "Kuwaiti Dinar", setOf("KUWAIT"), false),
|
KuwaitiDinar("KWD", "KWD", "Kuwaiti Dinar", setOf("KUWAIT"), false),
|
||||||
KYD("KYD", "KYD", "Cayman Islands Dollar", setOf("CAYMAN ISLANDS (THE)"), false),
|
CaymanIslandsDollar("KYD", "KYD", "Cayman Islands Dollar", setOf("CAYMAN ISLANDS (THE)"), false),
|
||||||
KZT("KZT", "KZT", "Tenge", setOf("KAZAKHSTAN"), false),
|
Tenge("KZT", "KZT", "Tenge", setOf("KAZAKHSTAN"), false),
|
||||||
LAK("LAK", "LAK", "Lao Kip", setOf("LAO PEOPLE’S DEMOCRATIC REPUBLIC (THE)"), false),
|
LaoKip("LAK", "LAK", "Lao Kip", setOf("LAO PEOPLE’S DEMOCRATIC REPUBLIC (THE)"), false),
|
||||||
LBP("LBP", "LBP", "Lebanese Pound", setOf("LEBANON"), false),
|
LebanesePound("LBP", "LBP", "Lebanese Pound", setOf("LEBANON"), false),
|
||||||
LKR("LKR", "LKR", "Sri Lanka Rupee", setOf("SRI LANKA"), false),
|
SriLankaRupee("LKR", "LKR", "Sri Lanka Rupee", setOf("SRI LANKA"), false),
|
||||||
LRD("LRD", "LRD", "Liberian Dollar", setOf("LIBERIA"), false),
|
LiberianDollar("LRD", "LRD", "Liberian Dollar", setOf("LIBERIA"), false),
|
||||||
LSL("LSL", "LSL", "Loti", setOf("LESOTHO"), false),
|
LSL("LSL", "LSL", "Loti", setOf("LESOTHO"), false),
|
||||||
LYD("LYD", "LYD", "Libyan Dinar", setOf("LIBYA"), false),
|
LibyanDinar("LYD", "LYD", "Libyan Dinar", setOf("LIBYA"), false),
|
||||||
MAD("MAD", "MAD", "Moroccan Dirham", setOf("MOROCCO", "WESTERN SAHARA"), false),
|
MoroccanDirham("MAD", "MAD", "Moroccan Dirham", setOf("MOROCCO", "WESTERN SAHARA"), false),
|
||||||
MDL("MDL", "MDL", "Moldovan Leu", setOf("MOLDOVA (THE REPUBLIC OF)"), false),
|
MoldovanLeu("MDL", "MDL", "Moldovan Leu", setOf("MOLDOVA (THE REPUBLIC OF)"), false),
|
||||||
MGA("MGA", "MGA", "Malagasy Ariary", setOf("MADAGASCAR"), false),
|
MalagasyAriary("MGA", "MGA", "Malagasy Ariary", setOf("MADAGASCAR"), false),
|
||||||
MKD("MKD", "MKD", "Denar", setOf("MACEDONIA (THE FORMER YUGOSLAV REPUBLIC OF)"), false),
|
Denar("MKD", "MKD", "Denar", setOf("MACEDONIA (THE FORMER YUGOSLAV REPUBLIC OF)"), false),
|
||||||
MMK("MMK", "MMK", "Kyat", setOf("MYANMAR"), false),
|
Kyat("MMK", "MMK", "Kyat", setOf("MYANMAR"), false),
|
||||||
MNT("MNT", "MNT", "Tugrik", setOf("MONGOLIA"), false),
|
Tugrik("MNT", "MNT", "Tugrik", setOf("MONGOLIA"), false),
|
||||||
MOP("MOP", "MOP", "Pataca", setOf("MACAO"), false),
|
Pataca("MOP", "MOP", "Pataca", setOf("MACAO"), false),
|
||||||
MRU("MRU", "MRU", "Ouguiya", setOf("MAURITANIA"), false),
|
Ouguiya("MRU", "MRU", "Ouguiya", setOf("MAURITANIA"), false),
|
||||||
MUR("MUR", "MUR", "Mauritius Rupee", setOf("MAURITIUS"), false),
|
MauritiusRupee("MUR", "MUR", "Mauritius Rupee", setOf("MAURITIUS"), false),
|
||||||
MVR("MVR", "MVR", "Rufiyaa", setOf("MALDIVES"), false),
|
Rufiyaa("MVR", "MVR", "Rufiyaa", setOf("MALDIVES"), false),
|
||||||
MWK("MWK", "MWK", "Malawi Kwacha", setOf("MALAWI"), false),
|
MalawiKwacha("MWK", "MWK", "Malawi Kwacha", setOf("MALAWI"), false),
|
||||||
MXN("MXN", "MX$", "Mexican Peso", setOf("MEXICO"), false),
|
MXN("MXN", "MX$", "Mexican Peso", setOf("MEXICO"), false),
|
||||||
MXV("MXV", "MXV", "Mexican Unidad de Inversion (UDI)", setOf("MEXICO"), false),
|
MexicanUnidadDeInversionUDI("MXV", "MXV", "Mexican Unidad de Inversion (UDI)", setOf("MEXICO"), false),
|
||||||
MYR("MYR", "MYR", "Malaysian Ringgit", setOf("MALAYSIA"), false),
|
MalaysianRinggit("MYR", "MYR", "Malaysian Ringgit", setOf("MALAYSIA"), false),
|
||||||
MZN("MZN", "MZN", "Mozambique Metical", setOf("MOZAMBIQUE"), false),
|
MozambiqueMetical("MZN", "MZN", "Mozambique Metical", setOf("MOZAMBIQUE"), false),
|
||||||
NAD("NAD", "NAD", "Namibia Dollar", setOf("NAMIBIA"), false),
|
NamibiaDollar("NAD", "NAD", "Namibia Dollar", setOf("NAMIBIA"), false),
|
||||||
NGN("NGN", "NGN", "Naira", setOf("NIGERIA"), false),
|
Naira("NGN", "NGN", "Naira", setOf("NIGERIA"), false),
|
||||||
NIO("NIO", "NIO", "Cordoba Oro", setOf("NICARAGUA"), false),
|
CordobaOro("NIO", "NIO", "Cordoba Oro", setOf("NICARAGUA"), false),
|
||||||
NOK("NOK", "NOK", "Norwegian Krone", setOf("BOUVET ISLAND", "NORWAY", "SVALBARD AND JAN MAYEN"), true),
|
NorwegianKrone("NOK", "NOK", "Norwegian Krone", setOf("BOUVET ISLAND", "NORWAY", "SVALBARD AND JAN MAYEN"), true),
|
||||||
NPR("NPR", "NPR", "Nepalese Rupee", setOf("NEPAL"), false),
|
NepaleseRupee("NPR", "NPR", "Nepalese Rupee", setOf("NEPAL"), false),
|
||||||
NZD("NZD", "NZ$", "New Zealand Dollar", setOf("COOK ISLANDS (THE)", "NEW ZEALAND", "NIUE", "PITCAIRN", "TOKELAU"), false),
|
NewZealandDollar("NZD", "NZ$", "New Zealand Dollar", setOf("COOK ISLANDS (THE)", "NEW ZEALAND", "NIUE", "PITCAIRN", "TOKELAU"), false),
|
||||||
OMR("OMR", "OMR", "Rial Omani", setOf("OMAN"), false),
|
RialOmani("OMR", "OMR", "Rial Omani", setOf("OMAN"), false),
|
||||||
PAB("PAB", "PAB", "Balboa", setOf("PANAMA"), false),
|
Balboa("PAB", "PAB", "Balboa", setOf("PANAMA"), false),
|
||||||
PEN("PEN", "PEN", "Sol", setOf("PERU"), false),
|
PEN("PEN", "PEN", "Sol", setOf("PERU"), false),
|
||||||
PGK("PGK", "PGK", "Kina", setOf("PAPUA NEW GUINEA"), false),
|
Kina("PGK", "PGK", "Kina", setOf("PAPUA NEW GUINEA"), false),
|
||||||
PHP("PHP", "₱", "Philippine Peso", setOf("PHILIPPINES (THE)"), false),
|
PhilippinePeso("PHP", "₱", "Philippine Peso", setOf("PHILIPPINES (THE)"), false),
|
||||||
PKR("PKR", "PKR", "Pakistan Rupee", setOf("PAKISTAN"), false),
|
PakistanRupee("PKR", "PKR", "Pakistan Rupee", setOf("PAKISTAN"), false),
|
||||||
PLN("PLN", "PLN", "Zloty", setOf("POLAND"), true),
|
PLN("PLN", "PLN", "Zloty", setOf("POLAND"), true),
|
||||||
PYG("PYG", "PYG", "Guarani", setOf("PARAGUAY"), false),
|
Guarani("PYG", "PYG", "Guarani", setOf("PARAGUAY"), false),
|
||||||
QAR("QAR", "QAR", "Qatari Rial", setOf("QATAR"), false),
|
QatariRial("QAR", "QAR", "Qatari Rial", setOf("QATAR"), false),
|
||||||
RON("RON", "RON", "Romanian Leu", setOf("ROMANIA"), false),
|
RomanianLeu("RON", "RON", "Romanian Leu", setOf("ROMANIA"), false),
|
||||||
RSD("RSD", "RSD", "Serbian Dinar", setOf("SERBIA"), false),
|
SerbianDinar("RSD", "RSD", "Serbian Dinar", setOf("SERBIA"), false),
|
||||||
RUB("RUB", "RUB", "Russian Ruble", setOf("RUSSIAN FEDERATION (THE)"), false),
|
RUB("RUB", "RUB", "Russian Ruble", setOf("RUSSIAN FEDERATION (THE)"), false),
|
||||||
RWF("RWF", "RWF", "Rwanda Franc", setOf("RWANDA"), false),
|
RwandaFranc("RWF", "RWF", "Rwanda Franc", setOf("RWANDA"), false),
|
||||||
SAR("SAR", "SAR", "Saudi Riyal", setOf("SAUDI ARABIA"), false),
|
SaudiRiyal("SAR", "SAR", "Saudi Riyal", setOf("SAUDI ARABIA"), false),
|
||||||
SBD("SBD", "SBD", "Solomon Islands Dollar", setOf("SOLOMON ISLANDS"), false),
|
SolomonIslandsDollar("SBD", "SBD", "Solomon Islands Dollar", setOf("SOLOMON ISLANDS"), false),
|
||||||
SCR("SCR", "SCR", "Seychelles Rupee", setOf("SEYCHELLES"), false),
|
SeychellesRupee("SCR", "SCR", "Seychelles Rupee", setOf("SEYCHELLES"), false),
|
||||||
SDG("SDG", "SDG", "Sudanese Pound", setOf("SUDAN (THE)"), false),
|
SDG("SDG", "SDG", "Sudanese Pound", setOf("SUDAN (THE)"), false),
|
||||||
SEK("SEK", "SEK", "Swedish Krona", setOf("SWEDEN"), true),
|
SwedishKrona("SEK", "SEK", "Swedish Krona", setOf("SWEDEN"), true),
|
||||||
SGD("SGD", "SGD", "Singapore Dollar", setOf("SINGAPORE"), false),
|
SingaporeDollar("SGD", "SGD", "Singapore Dollar", setOf("SINGAPORE"), false),
|
||||||
SHP("SHP", "SHP", "Saint Helena Pound", setOf("SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA"), false),
|
SaintHelenaPound("SHP", "SHP", "Saint Helena Pound", setOf("SAINT HELENA, ASCENSION AND TRISTAN DA CUNHA"), false),
|
||||||
SLE("SLE", "SLE", "Sierra Leone (new valuation 2022)", setOf("SIERRA LEONE (new valuation 2022)"), false),
|
SLE("SLE", "SLE", "Sierra Leone (new valuation 2022)", setOf("SIERRA LEONE (new valuation 2022)"), false),
|
||||||
SOS("SOS", "SOS", "Somali Shilling", setOf("SOMALIA"), false),
|
SomaliShilling("SOS", "SOS", "Somali Shilling", setOf("SOMALIA"), false),
|
||||||
SRD("SRD", "SRD", "Surinam Dollar", setOf("SURINAME"), false),
|
SurinamDollar("SRD", "SRD", "Surinam Dollar", setOf("SURINAME"), false),
|
||||||
SSP("SSP", "SSP", "South Sudanese Pound", setOf("SOUTH SUDAN"), false),
|
SouthSudanesePound("SSP", "SSP", "South Sudanese Pound", setOf("SOUTH SUDAN"), false),
|
||||||
STN("STN", "STN", "Dobra", setOf("SAO TOME AND PRINCIPE"), false),
|
Dobra("STN", "STN", "Dobra", setOf("SAO TOME AND PRINCIPE"), false),
|
||||||
SVC("SVC", "SVC", "El Salvador Colon", setOf("EL SALVADOR"), false),
|
ElSalvadorColon("SVC", "SVC", "El Salvador Colon", setOf("EL SALVADOR"), false),
|
||||||
SYP("SYP", "SYP", "Syrian Pound", setOf("SYRIAN ARAB REPUBLIC"), false),
|
SyrianPound("SYP", "SYP", "Syrian Pound", setOf("SYRIAN ARAB REPUBLIC"), false),
|
||||||
SZL("SZL", "SZL", "Lilangeni", setOf("ESWATINI"), false),
|
Lilangeni("SZL", "SZL", "Lilangeni", setOf("ESWATINI"), false),
|
||||||
THB("THB", "THB", "Baht", setOf("THAILAND"), false),
|
Baht("THB", "THB", "Baht", setOf("THAILAND"), false),
|
||||||
TJS("TJS", "TJS", "Somoni", setOf("TAJIKISTAN"), false),
|
Somoni("TJS", "TJS", "Somoni", setOf("TAJIKISTAN"), false),
|
||||||
TMT("TMT", "TMT", "Turkmenistan New Manat", setOf("TURKMENISTAN"), false),
|
TurkmenistanNewManat("TMT", "TMT", "Turkmenistan New Manat", setOf("TURKMENISTAN"), false),
|
||||||
TND("TND", "TND", "Tunisian Dinar", setOf("TUNISIA"), false),
|
TunisianDinar("TND", "TND", "Tunisian Dinar", setOf("TUNISIA"), false),
|
||||||
TOP("TOP", "TOP", "Pa’anga", setOf("TONGA"), false),
|
Paanga("TOP", "TOP", "Pa’anga", setOf("TONGA"), false),
|
||||||
TRY("TRY", "TRY", "Turkish Lira", setOf("TURKEY"), false),
|
TurkishLira("TRY", "TRY", "Turkish Lira", setOf("TURKEY"), false),
|
||||||
TTD("TTD", "TTD", "Trinidad and Tobago Dollar", setOf("TRINIDAD AND TOBAGO"), false),
|
TrinidadAndTobagoDollar("TTD", "TTD", "Trinidad and Tobago Dollar", setOf("TRINIDAD AND TOBAGO"), false),
|
||||||
TWD("TWD", "NT$", "New Taiwan Dollar", setOf("TAIWAN (PROVINCE OF CHINA)"), false),
|
NewTaiwanDollar("TWD", "NT$", "New Taiwan Dollar", setOf("TAIWAN (PROVINCE OF CHINA)"), false),
|
||||||
TZS("TZS", "TZS", "Tanzanian Shilling", setOf("TANZANIA, UNITED REPUBLIC OF"), false),
|
TanzanianShilling("TZS", "TZS", "Tanzanian Shilling", setOf("TANZANIA, UNITED REPUBLIC OF"), false),
|
||||||
UAH("UAH", "UAH", "Hryvnia", setOf("UKRAINE"), false),
|
Hryvnia("UAH", "UAH", "Hryvnia", setOf("UKRAINE"), false),
|
||||||
UGX("UGX", "UGX", "Uganda Shilling", setOf("UGANDA"), false),
|
UgandaShilling("UGX", "UGX", "Uganda Shilling", setOf("UGANDA"), false),
|
||||||
USD("USD", "$", "US Dollar", setOf("AMERICAN SAMOA", "BONAIRE, SINT EUSTATIUS AND SABA", "BRITISH INDIAN OCEAN TERRITORY (THE)", "ECUADOR", "EL SALVADOR", "GUAM", "HAITI", "MARSHALL ISLANDS (THE)", "MICRONESIA (FEDERATED STATES OF)", "NORTHERN MARIANA ISLANDS (THE)", "PALAU", "PANAMA", "PUERTO RICO", "TIMOR-LESTE", "TURKS AND CAICOS ISLANDS (THE)", "UNITED STATES MINOR OUTLYING ISLANDS (THE)", "UNITED STATES OF AMERICA (THE)", "VIRGIN ISLANDS (BRITISH)", "VIRGIN ISLANDS (U.S.)"), true),
|
USDollar("USD", "$", "US Dollar", setOf("AMERICAN SAMOA", "BONAIRE, SINT EUSTATIUS AND SABA", "BRITISH INDIAN OCEAN TERRITORY (THE)", "ECUADOR", "EL SALVADOR", "GUAM", "HAITI", "MARSHALL ISLANDS (THE)", "MICRONESIA (FEDERATED STATES OF)", "NORTHERN MARIANA ISLANDS (THE)", "PALAU", "PANAMA", "PUERTO RICO", "TIMOR-LESTE", "TURKS AND CAICOS ISLANDS (THE)", "UNITED STATES MINOR OUTLYING ISLANDS (THE)", "UNITED STATES OF AMERICA (THE)", "VIRGIN ISLANDS (BRITISH)", "VIRGIN ISLANDS (U.S.)"), true),
|
||||||
USN("USN", "USN", "US Dollar (Next day)", setOf("UNITED STATES OF AMERICA (THE)"), false),
|
USDollarNextDay("USN", "USN", "US Dollar (Next day)", setOf("UNITED STATES OF AMERICA (THE)"), false),
|
||||||
UYI("UYI", "UYI", "Uruguay Peso en Unidades Indexadas (UI)", setOf("URUGUAY"), false),
|
UruguayPesoEnUnidadesIndexadasUI("UYI", "UYI", "Uruguay Peso en Unidades Indexadas (UI)", setOf("URUGUAY"), false),
|
||||||
UYU("UYU", "UYU", "Peso Uruguayo", setOf("URUGUAY"), false),
|
PesoUruguayo("UYU", "UYU", "Peso Uruguayo", setOf("URUGUAY"), false),
|
||||||
UYW("UYW", null, "Unidad Previsional", setOf("URUGUAY"), false),
|
UnidadPrevisional("UYW", null, "Unidad Previsional", setOf("URUGUAY"), false),
|
||||||
UZS("UZS", "UZS", "Uzbekistan Sum", setOf("UZBEKISTAN"), false),
|
UzbekistanSum("UZS", "UZS", "Uzbekistan Sum", setOf("UZBEKISTAN"), false),
|
||||||
VED("VED", "VED", "Bolívar Soberano, new valuation", emptySet(), false),
|
VED("VED", "VED", "Bolívar Soberano, new valuation", emptySet(), false),
|
||||||
VES("VES", "VES", "Bolívar Soberano", setOf("VENEZUELA (BOLIVARIAN REPUBLIC OF)"), false),
|
BolivarSoberano("VES", "VES", "Bolívar Soberano", setOf("VENEZUELA (BOLIVARIAN REPUBLIC OF)"), false),
|
||||||
VND("VND", "₫", "Dong", setOf("VIET NAM"), false),
|
Dong("VND", "₫", "Dong", setOf("VIET NAM"), false),
|
||||||
VUV("VUV", "VUV", "Vatu", setOf("VANUATU"), false),
|
Vatu("VUV", "VUV", "Vatu", setOf("VANUATU"), false),
|
||||||
WST("WST", "WST", "Tala", setOf("SAMOA"), false),
|
Tala("WST", "WST", "Tala", setOf("SAMOA"), false),
|
||||||
XAF("XAF", "FCFA", "CFA Franc BEAC", setOf("CAMEROON", "CENTRAL AFRICAN REPUBLIC (THE)", "CHAD", "CONGO (THE)", "EQUATORIAL GUINEA", "GABON"), false),
|
CFAFrancBEAC("XAF", "FCFA", "CFA Franc BEAC", setOf("CAMEROON", "CENTRAL AFRICAN REPUBLIC (THE)", "CHAD", "CONGO (THE)", "EQUATORIAL GUINEA", "GABON"), false),
|
||||||
XAG("XAG", "XAG", "Silver", setOf("ZZ11_Silver"), false),
|
Silver("XAG", "XAG", "Silver", setOf("ZZ11_Silver"), false),
|
||||||
XAU("XAU", "XAU", "Gold", setOf("ZZ08_Gold"), false),
|
Gold("XAU", "XAU", "Gold", setOf("ZZ08_Gold"), false),
|
||||||
XBA("XBA", "XBA", "Bond Markets Unit European Composite Unit (EURCO)", setOf("ZZ01_Bond Markets Unit European_EURCO"), false),
|
BondMarketsUnitEuropeanCompositeUnitEURCO("XBA", "XBA", "Bond Markets Unit European Composite Unit (EURCO)", setOf("ZZ01_Bond Markets Unit European_EURCO"), false),
|
||||||
XBB("XBB", "XBB", "Bond Markets Unit European Monetary Unit (E.M.U.-6)", setOf("ZZ02_Bond Markets Unit European_EMU-6"), false),
|
BondMarketsUnitEuropeanMonetaryUnitEMU6("XBB", "XBB", "Bond Markets Unit European Monetary Unit (E.M.U.-6)", setOf("ZZ02_Bond Markets Unit European_EMU-6"), false),
|
||||||
XBC("XBC", "XBC", "Bond Markets Unit European Unit of Account 9 (E.U.A.-9)", setOf("ZZ03_Bond Markets Unit European_EUA-9"), false),
|
BondMarketsUnitEuropeanUnitOfAccount9EUA9("XBC", "XBC", "Bond Markets Unit European Unit of Account 9 (E.U.A.-9)", setOf("ZZ03_Bond Markets Unit European_EUA-9"), false),
|
||||||
XBD("XBD", "XBD", "Bond Markets Unit European Unit of Account 17 (E.U.A.-17)", setOf("ZZ04_Bond Markets Unit European_EUA-17"), false),
|
BondMarketsUnitEuropeanUnitOfAccount17EUA17("XBD", "XBD", "Bond Markets Unit European Unit of Account 17 (E.U.A.-17)", setOf("ZZ04_Bond Markets Unit European_EUA-17"), false),
|
||||||
XCD("XCD", "EC$", "East Caribbean Dollar", setOf("ANGUILLA", "ANTIGUA AND BARBUDA", "DOMINICA", "GRENADA", "MONTSERRAT", "SAINT KITTS AND NEVIS", "SAINT LUCIA", "SAINT VINCENT AND THE GRENADINES"), false),
|
EastCaribbeanDollar("XCD", "EC$", "East Caribbean Dollar", setOf("ANGUILLA", "ANTIGUA AND BARBUDA", "DOMINICA", "GRENADA", "MONTSERRAT", "SAINT KITTS AND NEVIS", "SAINT LUCIA", "SAINT VINCENT AND THE GRENADINES"), false),
|
||||||
XDR("XDR", "XDR", "SDR (Special Drawing Right)", setOf("INTERNATIONAL MONETARY FUND (IMF)"), false),
|
SDRSpecialDrawingRight("XDR", "XDR", "SDR (Special Drawing Right)", setOf("INTERNATIONAL MONETARY FUND (IMF)"), false),
|
||||||
XOF("XOF", "F CFA", "CFA Franc BCEAO", setOf("BENIN", "BURKINA FASO", "CÔTE D'IVOIRE", "GUINEA-BISSAU", "MALI", "NIGER (THE)", "SENEGAL", "TOGO"), false),
|
CFAFrancBCEAO("XOF", "F CFA", "CFA Franc BCEAO", setOf("BENIN", "BURKINA FASO", "CÔTE D'IVOIRE", "GUINEA-BISSAU", "MALI", "NIGER (THE)", "SENEGAL", "TOGO"), false),
|
||||||
XPD("XPD", "XPD", "Palladium", setOf("ZZ09_Palladium"), false),
|
Palladium("XPD", "XPD", "Palladium", setOf("ZZ09_Palladium"), false),
|
||||||
XPF("XPF", "CFPF", "CFP Franc", setOf("FRENCH POLYNESIA", "NEW CALEDONIA", "WALLIS AND FUTUNA"), false),
|
CFPFranc("XPF", "CFPF", "CFP Franc", setOf("FRENCH POLYNESIA", "NEW CALEDONIA", "WALLIS AND FUTUNA"), false),
|
||||||
XPT("XPT", "XPT", "Platinum", setOf("ZZ10_Platinum"), false),
|
Platinum("XPT", "XPT", "Platinum", setOf("ZZ10_Platinum"), false),
|
||||||
XSU("XSU", "XSU", "Sucre", setOf("SISTEMA UNITARIO DE COMPENSACION REGIONAL DE PAGOS 'SUCRE'"), false),
|
Sucre("XSU", "XSU", "Sucre", setOf("SISTEMA UNITARIO DE COMPENSACION REGIONAL DE PAGOS 'SUCRE'"), false),
|
||||||
XTS("XTS", "XTS", "Codes specifically reserved for testing purposes", setOf("ZZ06_Testing_Code"), false),
|
CodesSpecificallyReservedForTestingPurposes("XTS", "XTS", "Codes specifically reserved for testing purposes", setOf("ZZ06_Testing_Code"), false),
|
||||||
XUA("XUA", "XUA", "ADB Unit of Account", setOf("MEMBER COUNTRIES OF THE AFRICAN DEVELOPMENT BANK GROUP"), false),
|
ADBUnitOfAccount("XUA", "XUA", "ADB Unit of Account", setOf("MEMBER COUNTRIES OF THE AFRICAN DEVELOPMENT BANK GROUP"), false),
|
||||||
XXX("XXX", "¤", "The codes assigned for transactions where no currency is involved", setOf("ZZ07_No_Currency"), false),
|
TheCodesAssignedForTransactionsWhereNoCurrencyIsInvolved("XXX", "¤", "The codes assigned for transactions where no currency is involved", setOf("ZZ07_No_Currency"), false),
|
||||||
YER("YER", "YER", "Yemeni Rial", setOf("YEMEN"), false),
|
YemeniRial("YER", "YER", "Yemeni Rial", setOf("YEMEN"), false),
|
||||||
ZAR("ZAR", "ZAR", "Rand", setOf("LESOTHO", "NAMIBIA", "SOUTH AFRICA"), false),
|
Rand("ZAR", "ZAR", "Rand", setOf("LESOTHO", "NAMIBIA", "SOUTH AFRICA"), false),
|
||||||
ZMW("ZMW", "ZMW", "Zambian Kwacha", setOf("ZAMBIA"), false),
|
ZambianKwacha("ZMW", "ZMW", "Zambian Kwacha", setOf("ZAMBIA"), false),
|
||||||
ZWG("ZWG", null, "Zimbabwe Gold", emptySet(), false),
|
ZimbabweGold("ZWG", null, "Zimbabwe Gold", emptySet(), false),
|
||||||
ZWL("ZWL", "ZWL", "Zimbabwe Dollar", setOf("ZIMBABWE"), false),
|
ZWL("ZWL", "ZWL", "Zimbabwe Dollar", setOf("ZIMBABWE"), false),
|
||||||
}
|
}
|
|
@ -10,6 +10,11 @@ import java.util.Currency
|
||||||
|
|
||||||
class CodeGenerator {
|
class CodeGenerator {
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private val i18nCurrenciesByCode = net.codinux.i18n.Currency.entries.associateBy { it.alpha3Code }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
fun generateCodeFiles(cefCodeLists: List<CodeList>, zugferdCodeLists: List<net.codinux.invoicing.parser.excel.CodeList>, outputDirectory: File) {
|
fun generateCodeFiles(cefCodeLists: List<CodeList>, zugferdCodeLists: List<net.codinux.invoicing.parser.excel.CodeList>, outputDirectory: File) {
|
||||||
val zugferdCodeListsByType = zugferdCodeLists.associateBy { it.type }
|
val zugferdCodeListsByType = zugferdCodeLists.associateBy { it.type }
|
||||||
val matchedCodeLists = cefCodeLists.associateBy { it.type }.mapValues { it.value to zugferdCodeListsByType[it.key] }
|
val matchedCodeLists = cefCodeLists.associateBy { it.type }.mapValues { it.value to zugferdCodeListsByType[it.key] }
|
||||||
|
@ -30,7 +35,7 @@ class CodeGenerator {
|
||||||
writer.appendLine("enum class ${type.className}(${columns.joinToString(", ") { "val ${getPropertyName(it)}: ${getDataType(it, columns, rows)}" } }) {")
|
writer.appendLine("enum class ${type.className}(${columns.joinToString(", ") { "val ${getPropertyName(it)}: ${getDataType(it, columns, rows)}" } }) {")
|
||||||
|
|
||||||
rows.forEach { row ->
|
rows.forEach { row ->
|
||||||
writer.appendLine("\t${getEnumName(columns, row.values)}(${row.values.joinToString(", ") { getPropertyValue(it) } }),")
|
writer.appendLine("\t${getEnumName(type, columns, row.values)}(${row.values.joinToString(", ") { getPropertyValue(it) } }),")
|
||||||
}
|
}
|
||||||
writer.append("}")
|
writer.append("}")
|
||||||
}
|
}
|
||||||
|
@ -179,7 +184,7 @@ class CodeGenerator {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getEnumName(columns: List<Column>, row: List<Any?>): String {
|
private fun getEnumName(type: CodeListType, columns: List<Column>, row: List<Any?>): String {
|
||||||
// Mime types
|
// Mime types
|
||||||
val firstColumn = row[0]
|
val firstColumn = row[0]
|
||||||
if (firstColumn == "application/pdf") return "PDF"
|
if (firstColumn == "application/pdf") return "PDF"
|
||||||
|
@ -189,9 +194,9 @@ class CodeGenerator {
|
||||||
else if (firstColumn == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") return "ExcelSpreadsheet"
|
else if (firstColumn == "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") return "ExcelSpreadsheet"
|
||||||
else if (firstColumn == "application/vnd.oasis.opendocument.spreadsheet") return "OpenDocumentSpreadsheet"
|
else if (firstColumn == "application/vnd.oasis.opendocument.spreadsheet") return "OpenDocumentSpreadsheet"
|
||||||
|
|
||||||
val column = if (columns.first().name == "Scheme ID") row[1] // ISO 6523 Scheme Identifier codes
|
val column = if (type == CodeListType.IsoCurrencyCodes) i18nCurrenciesByCode[firstColumn]?.name ?: row[2] // as fallback use currency's English name from Zugferd list
|
||||||
|
else if (columns.first().name == "Scheme ID") row[1] // ISO 6523 Scheme Identifier codes
|
||||||
else if (columns.first().name == "English Name") row[1] // Country codes
|
else if (columns.first().name == "English Name") row[1] // Country codes
|
||||||
else if (columns.first().name == "Country") row[2] // Currency codes, but does not work yet due to duplicate Keys / Alpha3-Codes
|
|
||||||
else row[0] // default case: the code is in the first column
|
else row[0] // default case: the code is in the first column
|
||||||
|
|
||||||
val name = (column?.toString() ?: "").replace(' ', '_').replace('/', '_').replace('.', '_').replace(',', '_')
|
val name = (column?.toString() ?: "").replace(' ', '_').replace('/', '_').replace('.', '_').replace(',', '_')
|
||||||
|
|
Loading…
Reference in New Issue