Show tax details on invoices
This commit is contained in:
parent
c4864dd6c0
commit
5f89bdcb1a
@ -54,7 +54,7 @@ along with Linode Manager Classic. If not, see <https://www.gnu.org/licenses/>.
|
||||
<td id="subtotal"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Tax:</td>
|
||||
<td>Tax Subtotal:</td>
|
||||
<td id="tax"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -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);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user