Changed the way the pointed sold is displayed.
This commit is contained in:
parent
8ca742c2e2
commit
ef399c82fc
@ -39,7 +39,6 @@ def get_entries(account_id, year, month):
|
|||||||
"value": str(i.value),
|
"value": str(i.value),
|
||||||
"category": i.category,
|
"category": i.category,
|
||||||
"sold": str(i.sold),
|
"sold": str(i.sold),
|
||||||
"pointedsold": str(i.pointedsold),
|
|
||||||
"account_id": i.account_id
|
"account_id": i.account_id
|
||||||
} for i in query.all()])
|
} for i in query.all()])
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ class Entry(db.Model):
|
|||||||
|
|
||||||
category = db.Column(db.String(100), nullable = True)
|
category = db.Column(db.String(100), nullable = True)
|
||||||
sold = column_property(func.sum(value).over(order_by="operation_date, value desc, label desc"))
|
sold = column_property(func.sum(value).over(order_by="operation_date, value desc, label desc"))
|
||||||
pointedsold = column_property(func.sum(value).over(partition_by="pointed", order_by="operation_date, value desc, label desc"))
|
|
||||||
|
|
||||||
def __init__(self, pointed, label, value, account_id, operation_date = None, category = None):
|
def __init__(self, pointed, label, value, account_id, operation_date = None, category = None):
|
||||||
self.pointed = pointed
|
self.pointed = pointed
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
<div class="nav" data-bind="foreach: accounts, value: account">
|
<div class="nav" data-bind="foreach: accounts, value: account">
|
||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<!-- Account button -->
|
<!-- Account button -->
|
||||||
<button class="btn btn-nav" data-bind="css: { active: $data === $root.account() }, click: $parent.selectAccount"><span data-bind="text: name"></span> (<span data-bind="text: current, css: {'text-error': $data.current < 0 }"></span>)</button>
|
<button class="btn btn-nav" data-bind="css: { active: $data === $root.account() }, click: $parent.selectAccount"><span data-bind="text: name"></span> (<span data-bind="text: current, css: {'text-warning': $data.current < 0 && $data.current >= $data.authorized_overdraft, 'text-error': $data.current < $data.authorized_overdraft }"></span> / <span data-bind="text: pointed"></span>)</button>
|
||||||
<!-- Dropdown button -->
|
<!-- Dropdown button -->
|
||||||
<button class="btn btn-nav dropdown-toggle" data-toggle="dropdown"><b class="caret"></b></button>
|
<button class="btn btn-nav dropdown-toggle" data-toggle="dropdown"><b class="caret"></b></button>
|
||||||
|
|
||||||
@ -88,7 +88,6 @@
|
|||||||
<th>Libellé de l'opération</th>
|
<th>Libellé de l'opération</th>
|
||||||
<th style="width: 50px">Montant</th>
|
<th style="width: 50px">Montant</th>
|
||||||
<th style="width: 50px">Solde</th>
|
<th style="width: 50px">Solde</th>
|
||||||
<th style="width: 60px">Solde p.</th>
|
|
||||||
<th style="width: 100px">Catégorie</th>
|
<th style="width: 100px">Catégorie</th>
|
||||||
<th style="width: 60px">Actions</th>
|
<th style="width: 60px">Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -187,8 +186,6 @@
|
|||||||
|
|
||||||
<td data-bind="text: sold, css: {'text-warning': sold() < 0 && sold() >= $root.account().authorized_overdraft(), 'text-error': sold() < $root.account().authorized_overdraft() }"></td>
|
<td data-bind="text: sold, css: {'text-warning': sold() < 0 && sold() >= $root.account().authorized_overdraft(), 'text-error': sold() < $root.account().authorized_overdraft() }"></td>
|
||||||
|
|
||||||
<td data-bind="text: pointed() ? pointedsold : '', css: {'text-warning': pointedsold() < 0 && pointedsold() >= $root.account().authorized_overdraft(), 'text-error': pointedsold() < $root.account().authorized_overdraft() }"></td>
|
|
||||||
|
|
||||||
<td data-bind="text: category"></td>
|
<td data-bind="text: category"></td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
@ -212,8 +209,6 @@
|
|||||||
|
|
||||||
<td></td>
|
<td></td>
|
||||||
|
|
||||||
<td></td>
|
|
||||||
|
|
||||||
<td><input type="text" class="input-small" data-bind="value: category, typeahead: {source: $root.categories }"/></td>
|
<td><input type="text" class="input-small" data-bind="value: category, typeahead: {source: $root.categories }"/></td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
@ -237,8 +232,6 @@
|
|||||||
|
|
||||||
<td data-bind="text: sold, css: {'text-warning': sold() < 0 && sold() >= $root.account().authorized_overdraft(), 'text-error': sold() < $root.account().authorized_overdraft() }"></td>
|
<td data-bind="text: sold, css: {'text-warning': sold() < 0 && sold() >= $root.account().authorized_overdraft(), 'text-error': sold() < $root.account().authorized_overdraft() }"></td>
|
||||||
|
|
||||||
<td data-bind="text: operation_date() ? pointedsold : '', css: {'text-warning': pointedsold() < 0 && pointedsold() >= $root.account().authorized_overdraft(), 'text-error': pointedsold() < $root.account().authorized_overdraft() }"></td>
|
|
||||||
|
|
||||||
<td><input type="text" class="input-small" data-bind="value: category, typeahead: {source: $root.categories }" /></td>
|
<td><input type="text" class="input-small" data-bind="value: category, typeahead: {source: $root.categories }" /></td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
|
Loading…
Reference in New Issue
Block a user