Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
Joachim Lusiardi | bc7e1591bd | |
Joachim Lusiardi | 673b671ab8 | |
Joachim Lusiardi | 578b2c15d8 |
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue