Show tax details on invoices

This commit is contained in:
L. Bradley LaBoon 2024-05-14 16:46:39 -04:00
parent c4864dd6c0
commit 5f89bdcb1a
Signed by: brad
GPG Key ID: 3D21FA839D9A229F
2 changed files with 11 additions and 1 deletions

View File

@ -54,7 +54,7 @@ along with Linode Manager Classic. If not, see <https://www.gnu.org/licenses/>.
<td id="subtotal"></td> <td id="subtotal"></td>
</tr> </tr>
<tr> <tr>
<td>Tax:</td> <td>Tax Subtotal:</td>
<td id="tax"></td> <td id="tax"></td>
</tr> </tr>
<tr> <tr>

View File

@ -91,6 +91,16 @@ import { settings, elements, apiGet, parseParams, setupHeader } from "/global.js
var displayInvoice = function(response) var displayInvoice = function(response)
{ {
ui.subtotal.innerHTML = "$" + response.subtotal.toFixed(2); ui.subtotal.innerHTML = "$" + response.subtotal.toFixed(2);
for (var i = 0; i < response.tax_summary.length; i++) {
var taxRow = document.createElement("tr");
var taxText = document.createElement("td");
taxText.innerHTML = response.tax_summary[i].name + ":";
var tax = document.createElement("td");
tax.innerHTML = "$" + response.tax_summary[i].tax.toFixed(2);
taxRow.appendChild(taxText);
taxRow.appendChild(tax);
ui.tax.parentNode.parentNode.insertBefore(taxRow, ui.tax.parentNode);
}
ui.tax.innerHTML = "$" + response.tax.toFixed(2); ui.tax.innerHTML = "$" + response.tax.toFixed(2);
ui.total.innerHTML = "$" + response.total.toFixed(2); ui.total.innerHTML = "$" + response.total.toFixed(2);
}; };