Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Fix incorrect appended elem position on propinas
Browse files Browse the repository at this point in the history
  • Loading branch information
DCruzDev committed Jan 4, 2020
1 parent 6a2794f commit b7dfdb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions js/moneySpent.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ writeStats(stats);

// Write stats on table at the end of page
function writeStats(stats){
tableToWrite = document.querySelector("tr.table_line:nth-child(33) > td:nth-child(1)");

tableToWrite = document.querySelector("#template_main > p:nth-child(12) > table:nth-child(1) > tbody").children;
tableToWrite = tableToWrite[tableToWrite.length-3];
tableToWrite = tableToWrite.firstElementChild;
//Create Element to add
var newNode1 = document.createElement("p");
var newB = document.createElement("b");
Expand All @@ -14,15 +15,15 @@ function writeStats(stats){
newNode1.appendChild(newB);

//Add elements
tableToWrite.insertBefore(newNode1, tableToWrite.childNodes[0]);
tableToWrite.append(newNode1);
}

function parseMainTable (table){
sum = 0;
// Go Through each row
for(i=2;i<table.length-3;i++){
row = table[i].children;
console.log(row);
//console.log(row);
text = row[1].innerHTML;
value = text.split(" ")[0].replace(",",".");
sum = sum + parseFloat(value);
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "PACO UA Extension",
"version": "0.27",
"version": "0.28",

"description": "Adiciona funcionalidade ao antigo PACO da Universidade de Aveiro",

Expand Down

2 comments on commit b7dfdb7

@jtsimoes
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DCruzDev Being this the amount spent on tuition fees, shouldn't it just show the amount that has already been paid (not counting with what still remains to be paid)? The student may not necessarily pay all tuition fees if he cancels the course.

This can be done by simply adding if (row[6].innerHTML == "Regular") on line 27!
0db8619

@DCruzDev
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I legit thought I had that check. Pretty sure I had it when I was creating/testing the script. Don't know what happened. Thanks for pointing it out. I'll fix it.

Please sign in to comment.