{% extends "InvenTree/settings/settings.html" %} {% block tabs %} {% include "InvenTree/settings/tabs.html" with tab='currency' %} {% endblock %} {% block settings %}

Currencies

{% endblock %} {% block js_ready %} {{ block.super }} $("#currency-table").inventreeTable({ url: "{% url 'api-currency-list' %}", queryParams: { ordering: 'suffix' }, formatNoMatches: function() { return "No currencies found"; }, rowStyle: function(row, index) { if (row.base) { return {classes: 'basecurrency'}; } else { return {}; } }, columns: [ { field: 'pk', title: 'ID', visible: false, switchable: false, }, { field: 'symbol', title: 'Symbol', }, { field: 'suffix', title: 'Currency', sortable: true, }, { field: 'description', title: 'Description', sortable: true, }, { field: 'value', title: 'Value', sortable: true, formatter: function(value, row, index, field) { if (row.base) { return "Base Currency"; } else { return value; } } }, { formatter: function(value, row, index, field) { var bEdit = ""; var bDel = ""; var html = "
" + bEdit + bDel + "
"; return html; } } ] }); $("#currency-table").on('click', '.cur-edit', function() { var button = $(this); var url = "/common/currency/" + button.attr('pk') + "/edit/"; launchModalForm(url, { success: function() { $("#currency-table").bootstrapTable('refresh'); }, }); }); $("#currency-table").on('click', '.cur-delete', function() { var button = $(this); var url = "/common/currency/" + button.attr('pk') + "/delete/"; launchModalForm(url, { success: function() { $("#currency-table").bootstrapTable('refresh'); }, }); }); $("#new-currency").click(function() { launchModalForm("{% url 'currency-create' %}", { success: function() { $("#currency-table").bootstrapTable('refresh'); }, }); }); {% endblock %}