-
Notifications
You must be signed in to change notification settings - Fork 0
/
ic-in.js
20 lines (16 loc) · 956 Bytes
/
ic-in.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function getAY() {
d = new Date();
if (d.getMonth() >= 7) { /* check if month is Aug (index 7) or higher (start of financial year) */
ay = d.getFullYear().toString().slice(-2) + '-' + (d.getFullYear()+1).toString().slice(-2);
} else {
ay = (d.getFullYear()-1).toString().slice(-2) + '-' + d.getFullYear().toString().slice(-2);
}
return ay;
}
var centre = '406'; /* set the eActivities centre code */
var centreName = 'AEE Dramatic Society';
var docID = window.prompt('Enter incoming IC number to view in FY ' + getAY(),'XXXXX');
var oldURL = location.href.split('#')[0];
var newURL = 'https://eactivities.union.ic.ac.uk/finance/documents/' + centre + '#' + getAY() + '/Transfers/Internal%20Charges/' + encodeURI(centreName + ' (' + centre + ') Receiving') + '/Details/' + docID;
location.href = newURL;
if (newURL.split('#')[0] == oldURL) { location.reload(); } /* since eA doesn't listen for window.onhashchange */