Compare commits

...

3 Commits

Author SHA1 Message Date
Joachim Lusiardi bc7e1591bd fix sorting for regular costs 2021-06-23 08:29:35 +02:00
Joachim Lusiardi 673b671ab8 fix date of service 2021-06-22 21:49:32 +02:00
Joachim Lusiardi 578b2c15d8 bugfix: could not create service 2021-06-22 21:39:49 +02:00
3 changed files with 6 additions and 3 deletions

View File

@ -6,7 +6,7 @@ from .checks import *
class CreateServiceForm(FlaskForm):
date = DateField('Date of Pitstop')
date = DateField('Date of Service')
odometer = IntegerField('Odometer (km)', validators=[odometer_date_check])
costs = DecimalField('Costs (€, overall)', places=2, validators=[costs_check])
description = TextAreaField('Description', validators=[Length(1, 4096)])
@ -72,4 +72,4 @@ class EditServiceForm(FlaskForm):
'litres': 'Litres must be higher than 0.01 L.',
'costs': 'Costs must be higher than 0.01 €.'
}
return messages
return messages

View File

@ -14,6 +14,7 @@ from ..tools import (
db_log_delete,
get_event_line_for_vehicle,
get_latest_pitstop_for_vehicle,
get_users_active_vehicle,
)
from .. import app, db

View File

@ -204,7 +204,9 @@ def compute_lower_limits_for_new_pitstop(
def pitstop_service_key(x):
return x.date, x.odometer
# if the entry got no odometer (regular costs!) then we assume it's okay
# to have regular cost at a virtual odometer of 0 on that day.
return x.date, x.odometer or 0
def get_event_line_for_vehicle(vehicle):