Skip to content

Commit 443a173

Browse files
committed
Added recognition for event "Allg. Korrektur"
1 parent 8f0047f commit 443a173

2 files changed

Lines changed: 17 additions & 7 deletions

File tree

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Verfügbare Plugins / Available plugins
22

3-
For website ariva.de: [Download](https://raw.githubusercontent.com/faiteanu/JavaStockQuotes/master/js/ariva.js) (updated 18.09.2022)
3+
For website ariva.de: [Download](https://raw.githubusercontent.com/faiteanu/JavaStockQuotes/master/js/ariva.js) (updated 5.10.2022)
44

55
# Installation to Hibiscus Depot-Viewer
66

js/ariva.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Script for Hibiscus Depot Viewer
2-
// Updated 18.09.2022 by @faiteanu
2+
// Updated 05.10.2022 by @faiteanu
33
// Original version by @mikekorb
44

55
try {
@@ -24,7 +24,7 @@ function getAPIVersion() {
2424
};
2525

2626
function getVersion() {
27-
return "2022-09-18";
27+
return "2022-10-05";
2828
};
2929

3030
function getName() {
@@ -143,7 +143,7 @@ function process(config) {
143143
}
144144
if (boerse_id){
145145
var histUrl= getURL() + "/quote/historic/historic.csv?secu=" + Packages.jsq.tools.HtmlUnitTools.getFirstElementByXpath(page, "//input[@name='secu']").getValueAttribute()
146-
+ "&boerse_id=" + boerse_id + "&clean_split=1&clean_payout=1&clean_bezug=1&currency=" + currency_id + "&min_time=" + d1 + "." + m1 + "." + y1
146+
+ "&boerse_id=" + boerse_id + "&clean_split=0&clean_payout=0&clean_bezug=0&currency=" + currency_id + "&min_time=" + d1 + "." + m1 + "." + y1
147147
+"&max_time=" + d2 + "." + m2 + "." + y2 + "&trenner=%3B&go=Download";
148148
print(histUrl);
149149
text = webClient.getPage(histUrl);
@@ -162,11 +162,16 @@ function extractEvents(page, handelsplatz) {
162162
dict["Dividende"] = Packages.jsq.datastructes.Const.CASHDIVIDEND;
163163
dict["Ausschüttung"] = Packages.jsq.datastructes.Const.CASHDIVIDEND;
164164
dict["Split"] = Packages.jsq.datastructes.Const.STOCKSPLIT;
165+
dict["Allg. Korrektur"] = Packages.jsq.datastructes.Const.STOCKSPLIT;
165166
dict["Reverse Split"] = Packages.jsq.datastructes.Const.STOCKREVERSESPLIT;
166167
dict["Bezugsrecht"] = Packages.jsq.datastructes.Const.SUBSCRIPTIONRIGHTS;
167168

168-
169-
eventUrl = url + "/dividende-split/?clean_split=0";
169+
if(kursUrl.indexOf("secu=") > 0){
170+
// fonds use a different URL from shares
171+
eventUrl = getURL() + "/quote/kapitalmassnahmen.m?clean_split=0&" + kursUrl.substring(kursUrl.indexOf("secu="));
172+
}else{
173+
eventUrl = url + "/dividende-split/?clean_split=0";
174+
}
170175

171176
print(eventUrl);
172177
page = webClient.getPage(eventUrl);
@@ -196,7 +201,12 @@ function extractEvents(page, handelsplatz) {
196201
}
197202
}
198203
dc.put("date", d);
199-
dc.put("ratio", hashmap.get("Verhältnis"));
204+
var ratio = hashmap.get("Verhältnis");
205+
if(ratio !== undefined && ratio.trim() !== "" && ratio.indexOf(":") < 0){
206+
// convert float to ratio with colon
207+
ratio = Packages.jsq.tools.VarTools.stringToBigDecimalGermanFormat(ratio).toString() + ":1";
208+
}
209+
dc.put("ratio", ratio);
200210
action = dict[hashmap.get("Ereignis")];
201211
if (typeof action === "undefined") {
202212
print("Undef für " + hashmap);

0 commit comments

Comments
 (0)