diff --git a/static/app.js b/static/app.js index 7407dc6..ab89128 100644 --- a/static/app.js +++ b/static/app.js @@ -176,19 +176,27 @@ return row; } - /* A TOT row: the physical count of one account plus the accounts it holds for. */ - function totRow(reconciliation) { + /* A row that carries the account name and the sats only: the non-taxable + accounts of docs/spec.md section 7.2 and the TOT rows. */ + function satsOnlyRow(name, sats, className) { var row = document.createElement("tr"); - row.className = "tot-row"; - cell(row, "TOT " + reconciliation.name, ""); + if (className) { + row.className = className; + } + cell(row, name, ""); cell(row, "", "numeric"); - cell(row, formatSats(reconciliation.sats), "numeric"); + cell(row, formatSats(sats), "numeric"); for (var i = 0; i < 5; i += 1) { cell(row, "", "numeric"); } return row; } + /* A TOT row: the physical count of one account plus the accounts it holds for. */ + function totRow(reconciliation) { + return satsOnlyRow("TOT " + reconciliation.name, reconciliation.sats, "tot-row"); + } + function field(name) { return document.querySelector('[name="' + name + '"]'); }