From 5f89bdcb1aea0ddc6865cd215fbe4f8fb68fdba7 Mon Sep 17 00:00:00 2001 From: "L. Bradley LaBoon" Date: Tue, 14 May 2024 16:46:39 -0400 Subject: [PATCH] Show tax details on invoices --- account/invoice/index.shtml | 2 +- account/invoice/invoice.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/account/invoice/index.shtml b/account/invoice/index.shtml index 1b0e74e..277b0b4 100644 --- a/account/invoice/index.shtml +++ b/account/invoice/index.shtml @@ -54,7 +54,7 @@ along with Linode Manager Classic. If not, see . - Tax: + Tax Subtotal: diff --git a/account/invoice/invoice.js b/account/invoice/invoice.js index 762b1bd..0eb0ec7 100644 --- a/account/invoice/invoice.js +++ b/account/invoice/invoice.js @@ -91,6 +91,16 @@ import { settings, elements, apiGet, parseParams, setupHeader } from "/global.js var displayInvoice = function(response) { 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.total.innerHTML = "$" + response.total.toFixed(2); };