Commit be8a2162 authored by Floréal Cabanettes's avatar Floréal Cabanettes

Add total in addition + get css from mobile app

parent dd89cbf7
......@@ -29,7 +29,7 @@ h1 {
}
h2 {
font-size: 20pt;
font-size: 16pt;
}
form {
......@@ -75,6 +75,7 @@ form input.addition {
form label {
margin-top: 20px;
padding-right: 4px;
}
form label.first {
......@@ -87,9 +88,9 @@ form select {
form button {
margin-top: 30px;
font-size: 15pt;
margin-right: 7px;
padding: 5px 10px;
font-size: 13pt;
margin-right: 6px;
padding: 5px 6px;
}
form button.last {
......@@ -101,17 +102,17 @@ form button#show-addition {
}
button#send {
width: 100px;
width: 90px;
}
button#add-subtr, button#del-subtr {
width: 80px;
width: 75px;
text-align: center;
}
form .newline button {
margin-top: 15px;
margin-left: 114px;
margin-top: 10px;
margin-left: 98px;
}
#login {
......@@ -204,6 +205,12 @@ button#goback {
font-size: 14pt;
}
p.total-addition {
color: #fff;
font-size: 14pt;
font-weight: bold;
}
/* Loading */
div.loading {
......@@ -249,4 +256,4 @@ div.loading {
top: 12px;
height: 26px;
}
}
\ No newline at end of file
}
......@@ -114,13 +114,16 @@ trackmybank.show_addition = function() {
let addition = $("#addition");
addition.html("");
let empty = true;
let full_total = 0;
$(".transaction").each(function(t, transaction) {
let s_desc = $(transaction).find(".description").val();
let s_cat = $(transaction).find(".category option:selected").text();
if (trackmybank.amounts[t].length > 0 && s_cat !== "" && s_desc !== "") {
empty = false;
let t_total = trackmybank.getTotal(t);
full_total += parseFloat(t_total);
addition.append($("<h2>").html(s_desc + " (" +
s_cat + ") - " + trackmybank.getTotal(t) + ""));
s_cat + ") - " + t_total + ""));
let table = $("<table>").attr("class", "table-striped addition");
for (let i=0; i<trackmybank.amounts[t].length; i++) {
let row = $("<tr>");
......@@ -132,6 +135,8 @@ trackmybank.show_addition = function() {
}
});
if (!empty) {
addition.append($("<h2>").html("Total"));
addition.append($("<p>").attr("class", "total-addition").html(trackmybank.getStringAmount(full_total) + ""));
addition.append($("<button>").attr("id", "goback").attr("type", "button").html("Retour"));
$("#logged").hide();
addition.show();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment