Make period start/begin date, etc. interchangeable in home page input sync
This commit is contained in:
parent
c5a34d8559
commit
74313108ed
@ -24,47 +24,47 @@
|
|||||||
<ul>
|
<ul>
|
||||||
<li><form action="{{ url_for('trial') }}">
|
<li><form action="{{ url_for('trial') }}">
|
||||||
<button type="submit">Trial balance</button>
|
<button type="submit">Trial balance</button>
|
||||||
<label>Date: <input name="date" value="{{ date.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
<label>Date: <input name="date" data-inputgroup="date" value="{{ date.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
||||||
<label>Period start: <input name="pstart" value="{{ pstart.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
<label>Period start: <input name="pstart" data-inputgroup="pstart" value="{{ pstart.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
||||||
<label>Compare <input name="compare" value="0" style="width: 2em;" oninput="txtc(this)"> periods</label>
|
<label>Compare <input name="compare" data-inputgroup="compare" value="0" style="width: 2em;" oninput="txtc(this)"> periods</label>
|
||||||
<label><input name="cash" type="checkbox" oninput="chbc(this)"> Cash basis</label>
|
<label><input name="cash" data-inputgroup="cash" type="checkbox" oninput="chbc(this)"> Cash basis</label>
|
||||||
</form></li>
|
</form></li>
|
||||||
|
|
||||||
<li><form action="{{ url_for('balance') }}">
|
<li><form action="{{ url_for('balance') }}">
|
||||||
<button type="submit">Balance sheet</button>
|
<button type="submit">Balance sheet</button>
|
||||||
<label>Date: <input name="date" value="{{ date.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
<label>Date: <input name="date" data-inputgroup="date" value="{{ date.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
||||||
<label>Period start: <input name="pstart" value="{{ pstart.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
<label>Period start: <input name="pstart" data-inputgroup="pstart" value="{{ pstart.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
||||||
<label>Compare <input name="compare" value="0" style="width: 2em;" oninput="txtc(this)"> periods</label>
|
<label>Compare <input name="compare" data-inputgroup="compare" value="0" style="width: 2em;" oninput="txtc(this)"> periods</label>
|
||||||
<label><input name="cash" type="checkbox" oninput="chbc(this)"> Cash basis</label>
|
<label><input name="cash" data-inputgroup="cash" type="checkbox" oninput="chbc(this)"> Cash basis</label>
|
||||||
</form></li>
|
</form></li>
|
||||||
|
|
||||||
<li><form action="{{ url_for('pandl') }}">
|
<li><form action="{{ url_for('pandl') }}">
|
||||||
<button type="submit">Income statement</button>
|
<button type="submit">Income statement</button>
|
||||||
<label>Begin date: <input name="date_beg" value="{{ pstart.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
<label>Begin date: <input name="date_beg" data-inputgroup="pstart" value="{{ pstart.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
||||||
<label>End date: <input name="date_end" value="{{ date.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
<label>End date: <input name="date_end" data-inputgroup="date" value="{{ date.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
||||||
<label>Compare <input name="compare" value="0" style="width: 2em;" oninput="txtc(this)"> periods</label>
|
<label>Compare <input name="compare" data-inputgroup="compare" value="0" style="width: 2em;" oninput="txtc(this)"> periods</label>
|
||||||
<label><input name="cash" type="checkbox" oninput="chbc(this)"> Cash basis</label>
|
<label><input name="cash" data-inputgroup="cash" type="checkbox" oninput="chbc(this)"> Cash basis</label>
|
||||||
</form></li>
|
</form></li>
|
||||||
|
|
||||||
<li><form action="{{ url_for('transactions') }}">
|
<li><form action="{{ url_for('transactions') }}">
|
||||||
<button type="submit">General ledger</button>
|
<button type="submit">General ledger</button>
|
||||||
<label>Date: <input name="date" value="{{ date.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
<label>Date: <input name="date" data-inputgroup="date" value="{{ date.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
||||||
<label>Period start: <input name="pstart" value="{{ pstart.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
<label>Period start: <input name="pstart" value="{{ pstart.strftime('%Y-%m-%d') }}" style="width: 6em;" oninput="txtc(this)"></label>
|
||||||
<label><input name="cash" type="checkbox" oninput="chbc(this)"> Cash basis</label>
|
<label><input name="cash" data-inputgroup="cash" type="checkbox" oninput="chbc(this)"> Cash basis</label>
|
||||||
</form></li>
|
</form></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
// Called whenever a text input changes - update others to match
|
// Called whenever a text input changes - update others to match
|
||||||
function txtc(el) {
|
function txtc(el) {
|
||||||
for (var e2 of document.querySelectorAll('input[name="' + el.name + '"]')) {
|
for (var e2 of document.querySelectorAll('input[data-inputgroup="' + el.dataset['inputgroup'] + '"]')) {
|
||||||
e2.value = el.value;
|
e2.value = el.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ditto for checkboxes
|
// Ditto for checkboxes
|
||||||
function chbc(el) {
|
function chbc(el) {
|
||||||
for (var e2 of document.querySelectorAll('input[name="' + el.name + '"]')) {
|
for (var e2 of document.querySelectorAll('input[data-inputgroup="' + el.dataset['inputgroup'] + '"]')) {
|
||||||
e2.checked = el.checked;
|
e2.checked = el.checked;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user