Changed the way the pointed sold is displayed.

This commit is contained in:
Alexis Lahouze 2013-01-26 13:50:11 +01:00
parent 8ca742c2e2
commit ef399c82fc
3 changed files with 1 additions and 10 deletions

View File

@ -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()])

View File

@ -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

View File

@ -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>&nbsp;(<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>&nbsp;(<span data-bind="text: current, css: {'text-warning': $data.current < 0 && $data.current >= $data.authorized_overdraft, 'text-error': $data.current < $data.authorized_overdraft }"></span>&nbsp;/&nbsp;<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&eacute; de l'op&eacute;ration</th> <th>Libell&eacute; de l'op&eacute;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&eacute;gorie</th> <th style="width: 100px">Cat&eacute;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>