2024-12-16 17:24:37 +03:00

240 lines
9.7 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { translate as t } from '@nextcloud/l10n'
var format_List = {
"en-EN": "en-EN",
"fr-FR": "fr-FR"
}
var currency_list = {
"AED": t('gestion', 'United Arab Emirates Dirham'),
"AFN": t('gestion', 'Afghan Afghani'),
"ALL": t('gestion', 'Albanian Lek'),
"AMD": t('gestion', 'Armenian Dram'),
"ANG": t('gestion', 'Netherlands Antillean Guilder'),
"AOA": t('gestion', 'Angolan Kwanza'),
"ARS": t('gestion', 'Argentine Peso'),
"AUD": t('gestion', 'Australian Dollar'),
"AWG": t('gestion', 'Aruban Florin'),
"AZN": t('gestion', 'Azerbaijani Manat'),
"BAM": t('gestion', 'Bosnia and Herzegovina Convertible Mark'),
"BBD": t('gestion', 'Barbados Dollar'),
"BDT": t('gestion', 'Bangladeshi Taka'),
"BBD": t('gestion', 'Barbadian Dollar'),
"BYR": t('gestion', 'Belarusian Ruble'),
"BZD": t('gestion', 'Belize Dollar'),
"BMD": t('gestion', 'Bermudan Dollar'),
"BTN": t('gestion', 'Bhutanese Ngultrum'),
"BTC": t('gestion', 'Bitcoin'),
"BOB": t('gestion', 'Bolivian Boliviano'),
"BAM": t('gestion', 'Bosnia-Herzegovina Convertible Mark'),
"BWP": t('gestion', 'Botswanan Pula'),
"BRL": t('gestion', 'Brazilian Real'),
"BND": t('gestion', 'Brunei Dollar'),
"BGN": t('gestion', 'Bulgarian Lev'),
"BHD": t('gestion', 'Bahraini Dinar'),
"BIF": t('gestion', 'Burundian Franc'),
"BMD": t('gestion', 'Bermudian Dollar'),
"BND": t('gestion', 'Brunei Dollar'),
"BOB": t('gestion', 'Boliviano'),
"BOV": t('gestion', 'Bolivian Mvdol'),
"BRL": t('gestion', 'Brazilian Real'),
"BSD": t('gestion', 'Bahamian Dollar'),
"BTN": t('gestion', 'Bhutanese Ngultrum'),
"BWP": t('gestion', 'Botswana Pula'),
"BYN": t('gestion', 'Belarusian Ruble'),
"BZD": t('gestion', 'Belize Dollar'),
"CAD": t('gestion', 'Canadian Dollar'),
"CDF": t('gestion', 'Congolese Franc'),
"CHE": t('gestion', 'WIR Euro'),
"CHF": t('gestion', 'Swiss Franc'),
"CHW": t('gestion', 'WIR Franc'),
"CLF": t('gestion', 'Unidad de Fomento'),
"CLP": t('gestion', 'Chilean Peso'),
"CNY": t('gestion', 'Chinese Yuan'),
"COP": t('gestion', 'Colombian Peso'),
"COU": t('gestion', 'Unidad de Valor Real'),
"CRC": t('gestion', 'Costa Rican Colon'),
"CUP": t('gestion', 'Cuban Peso'),
"CVE": t('gestion', 'Cape Verdean Escudo'),
"CZK": t('gestion', 'Czech Koruna'),
"DJF": t('gestion', 'Djiboutian Franc'),
"DKK": t('gestion', 'Danish Krone'),
"DOP": t('gestion', 'Dominican Peso'),
"DZD": t('gestion', 'Algerian Dinar'),
"EGP": t('gestion', 'Egyptian Pound'),
"ERN": t('gestion', 'Eritrean Nakfa'),
"ETB": t('gestion', 'Ethiopian Birr'),
"EUR": t('gestion', 'Euro'),
"FJD": t('gestion', 'Fiji Dollar'),
"FKP": t('gestion', 'Falkland Islands Pound'),
"GBP": t('gestion', 'Pound Sterling'),
"GEL": t('gestion', 'Georgian Lari'),
"GHS": t('gestion', 'Ghanaian Cedi'),
"GIP": t('gestion', 'Gibraltar Pound'),
"GMD": t('gestion', 'Gambian Dalasi'),
"GNF": t('gestion', 'Guinean Franc'),
"GTQ": t('gestion', 'Guatemalan Quetzal'),
"GYD": t('gestion', 'Guyanese Dollar'),
"HKD": t('gestion', 'Hong Kong Dollar'),
"HNL": t('gestion', 'Honduran Lempira'),
"HRK": t('gestion', 'Croatian Kuna'),
"HTG": t('gestion', 'Haitian Gourde'),
"HUF": t('gestion', 'Hungarian Forint'),
"IDR": t('gestion', 'Indonesian Rupiah'),
"ILS": t('gestion', 'Israeli New Shekel'),
"INR": t('gestion', 'Indian Rupee'),
"IQD": t('gestion', 'Iraqi Dinar'),
"IRR": t('gestion', 'Iranian Rial'),
"ISK": t('gestion', 'Icelandic Króna'),
"JMD": t('gestion', 'Jamaican Dollar'),
"JOD": t('gestion', 'Jordanian Dinar'),
"JPY": t('gestion', 'Japanese Yen'),
"KES": t('gestion', 'Kenyan Shilling'),
"KGS": t('gestion', 'Kyrgyzstani Som'),
"KHR": t('gestion', 'Cambodian Riel'),
"KMF": t('gestion', 'Comoro Franc'),
"KPW": t('gestion', 'North Korean Won'),
"KRW": t('gestion', 'South Korean Won'),
"KWD": t('gestion', 'Kuwaiti Dinar'),
"KYD": t('gestion', 'Cayman Islands Dollar'),
"KZT": t('gestion', 'Kazakhstani Tenge'),
"LAK": t('gestion', 'Lao Kip'),
"LBP": t('gestion', 'Lebanese Pound'),
"LKR": t('gestion', 'Sri Lankan Rupee'),
"LRD": t('gestion', 'Liberian Dollar'),
"LSL": t('gestion', 'Lesotho Loti'),
"LYD": t('gestion', 'Libyan Dinar'),
"MAD": t('gestion', 'Moroccan Dirham'),
"MDL": t('gestion', 'Moldovan Leu'),
"MGA": t('gestion', 'Malagasy Ariary'),
"MKD": t('gestion', 'Macedonian Denar'),
"MMK": t('gestion', 'Myanmar Kyat'),
"MNT": t('gestion', 'Mongolian Tögrög'),
"MOP": t('gestion', 'Macanese Pataca'),
"MRU": t('gestion', 'Mauritanian Ouguiya'),
"MUR": t('gestion', 'Mauritian Rupee'),
"MVR": t('gestion', 'Maldivian Rufiyaa'),
"MWK": t('gestion', 'Malawian Kwacha'),
"MXN": t('gestion', 'Mexican Peso'),
"MXV": t('gestion', 'Mexican Unidad de Inversion'),
"MYR": t('gestion', 'Malaysian Ringgit'),
"MZN": t('gestion', 'Mozambican Metical'),
"NAD": t('gestion', 'Namibian Dollar'),
"NGN": t('gestion', 'Nigerian Naira'),
"NIO": t('gestion', 'Nicaraguan Córdoba'),
"NOK": t('gestion', 'Norwegian Krone'),
"NPR": t('gestion', 'Nepalese Rupee'),
"NZD": t('gestion', 'New Zealand Dollar'),
"OMR": t('gestion', 'Omani Rial'),
"PAB": t('gestion', 'Panamanian Balboa'),
"PEN": t('gestion', 'Peruvian Sol'),
"PGK": t('gestion', 'Papua New Guinean Kina'),
"PHP": t('gestion', 'Philippine Peso'),
"PKR": t('gestion', 'Pakistani Rupee'),
"PLN": t('gestion', 'Polish Złoty'),
"PYG": t('gestion', 'Paraguayan Guarani'),
"QAR": t('gestion', 'Qatari Riyal'),
"RON": t('gestion', 'Romanian Leu'),
"RSD": t('gestion', 'Serbian Dinar'),
"RUB": t('gestion', 'Russian Ruble'),
"RWF": t('gestion', 'Rwandan Franc'),
"SAR": t('gestion', 'Saudi Riyal'),
"SKK": t('gestion', 'Slovak Koruna'),
"SBD": t('gestion', 'Solomon Islands Dollar'),
"SCR": t('gestion', 'Seychelles Rupee'),
"SDG": t('gestion', 'Sudanese Pound'),
"SEK": t('gestion', 'Swedish Krona'),
"SGD": t('gestion', 'Singapore Dollar'),
"SHP": t('gestion', 'Saint Helena Pound'),
"SLL": t('gestion', 'Sierra Leonean Leone'),
"SOS": t('gestion', 'Somali Shilling'),
"SRD": t('gestion', 'Surinamese Dollar'),
"SSP": t('gestion', 'South Sudanese Pound'),
"STN": t('gestion', 'São Tomé and Príncipe Dobra'),
"SVC": t('gestion', 'Salvadoran Colon'),
"SYP": t('gestion', 'Syrian Pound'),
"SZL": t('gestion', 'Swazi Lilangeni'),
"THB": t('gestion', 'Thai Baht'),
"TJS": t('gestion', 'Tajikistani Somoni'),
"TMT": t('gestion', 'Turkmenistan Manat'),
"TND": t('gestion', 'Tunisian Dinar'),
"TOP": t('gestion', 'Tongan Paʻanga'),
"TRY": t('gestion', 'Turkish Lira'),
"TTD": t('gestion', 'Trinidad and Tobago Dollar'),
"TWD": t('gestion', 'New Taiwan Dollar'),
"TZS": t('gestion', 'Tanzanian Shilling'),
"UAH": t('gestion', 'Ukrainian Hryvnia'),
"UGX": t('gestion', 'Ugandan Shilling'),
"USD": t('gestion', 'United States Dollar'),
"USN": t('gestion', 'United States Dollar'),
"UYI": t('gestion', 'Uruguay Peso en Unidades Indexadas'),
"UYU": t('gestion', 'Uruguayan Peso'),
"UYW": t('gestion', 'Unidad Previsional'),
"UZS": t('gestion', 'Uzbekistan Som'),
"VED": t('gestion', 'Venezuelan Bolívar Digital'),
"VES": t('gestion', 'Venezuelan Bolívar Soberano'),
"VND": t('gestion', 'Vietnamese Dồng'),
"VUV": t('gestion', 'Vanuatu Vatu'),
"WST": t('gestion', 'Samoan Tala'),
"XAF": t('gestion', 'CFA Franc BEAC'),
"XAG": t('gestion', 'Silver'),
"XAU": t('gestion', 'Gold'),
"XBA": t('gestion', 'European Composite Unit'),
"XBB": t('gestion', 'European Monetary Unit'),
"XBC": t('gestion', 'European Unit of Account 9'),
"XBD": t('gestion', 'European Unit of Account 17'),
"XCD": t('gestion', 'East Caribbean Dollar'),
"XDR": t('gestion', 'Special Drawing Rights'),
"XOF": t('gestion', 'CFA Franc BCEAO'),
"XPD": t('gestion', 'Palladium'),
"XPF": t('gestion', 'CFP Franc'),
"XPT": t('gestion', 'Platinum'),
"XSU": t('gestion', 'SUCRE'),
"XUA": t('gestion', 'ADB Unit of Account'),
"YER": t('gestion', 'Yemeni Rial'),
"ZAR": t('gestion', 'South African Rand'),
"ZMW": t('gestion', 'Zambian Kwacha'),
"ZWL": t('gestion', 'Zimbabwean Dollar'),
};
export function getFormatList(currentFormat) {
var list = "";
var oEntries = Object.entries(format_List);
var oEntriesSort = oEntries.sort((a,b) => a[1].localeCompare(b[1]));
for (const [key, value] of oEntriesSort) {
if (currentFormat === key) {
list += "<option selected value='" + key + "'>" + value + "</option>";
} else {
list += "<option value='" + key + "'>" + value + "</option>";
}
}
return list;
}
export function getCurrencyList(currentDevise) {
var list = "";
var oEntries = Object.entries(currency_list);
var oEntriesSort = oEntries.sort((a,b) => a[1].localeCompare(b[1]));
for (const [key, value] of oEntriesSort) {
if (currentDevise === key) {
list += "<option selected value='" + key + "'>" + value + "</option>";
} else {
list += "<option value='" + key + "'>" + value + "</option>";
}
}
return list;
}
export function getAutoIncrement(activate){
if(activate == 0){
return "<option selected value='0'>" + t('gestion', 'Disable') + "</option><option value='1'>" + t('gestion', 'Enable') + "</option>"
}else{
return "<option value='0'>" + t('gestion', 'Disable') + "</option><option selected value='1'>" + t('gestion', 'Enable') + "</option>"
}
}
export function getFormatNumber(format){
}