currency per column in table definition

This commit is contained in:
Priec
2026-08-03 15:48:21 +02:00
parent 023f8c9dcb
commit 050f93e1fd
16 changed files with 87 additions and 105 deletions

View File

@@ -48,15 +48,6 @@
hx-target="#builder" hx-swap="innerHTML" hx-vals='{"action": "refresh"}'>
</label>
{% if page.draft.show_base_currency() %}
<label>Base currency
<input name="base_currency" value="{{ page.draft.base_currency }}" list="currency-codes"
maxlength="3" placeholder="EUR">
<small>Required while the table has a MONEY or ACCOUNTING column.</small>
</label>
{% else %}
<input type="hidden" name="base_currency" value="{{ page.draft.base_currency }}">
{% endif %}
</div>
</section>
@@ -100,6 +91,10 @@
{% endif %}
{% if page.draft.show_rounding() %}
<label>Currency
<input name="column_currency_input" value="{{ page.draft.column_currency_input }}" list="currency-codes"
maxlength="3" placeholder="EUR">
</label>
<label>Rounding
<select name="column_rounding_input">
<option value="none" {% if page.draft.column_rounding_input != "half-up" %}selected{% endif %}>none</option>
@@ -167,6 +162,7 @@
<input type="hidden" name="column_indexed" value="{% if column.indexed %}yes{% else %}no{% endif %}">
<input type="hidden" name="column_quantity_ledger" value="{% if column.quantity_ledger %}yes{% else %}no{% endif %}">
<input type="hidden" name="column_rounding" value="{{ column.money_mode.label() }}">
<input type="hidden" name="column_currencies" value="{{ column.currency }}">
{% endfor %}
</section>

View File

@@ -8,7 +8,6 @@
<details class="catalog-table">
<summary>
<code>{{ table.name }}</code>
{%- if !table.base_currency.is_empty() %}<span class="currency">{{ table.base_currency }}</span>{% endif -%}
</summary>
<button type="button" class="starter-query" data-sql="{{ table.starter_query }}"
x-on:click="sql = $el.dataset.sql; $refs.sql.focus()">Use starter query</button>