diff options
author | Daniel Friesel <derf@finalrewind.org> | 2020-02-12 20:38:24 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2020-02-12 20:38:24 +0100 |
commit | a830acc69877e204e5136e0862959164691683ca (patch) | |
tree | e23d6b34ecd19529329323f36a0b0965aaa24c1c /lib/Travelynx/Command | |
parent | ee38d48a555e0c9a8ccb4ca06d69566198f42714 (diff) |
Handle cancelled arrival at checkout when departure at checkin is not cancelled
Diffstat (limited to 'lib/Travelynx/Command')
-rw-r--r-- | lib/Travelynx/Command/work.pm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Travelynx/Command/work.pm b/lib/Travelynx/Command/work.pm index 405716c..9658ff6 100644 --- a/lib/Travelynx/Command/work.pm +++ b/lib/Travelynx/Command/work.pm @@ -134,7 +134,15 @@ sub run { checkout_station_id => $arr } ); - $self->app->add_route_timestamps( $uid, $train, 0 ); + if ( $train->arrival_is_cancelled ) { + + # check out (adds a cancelled journey and resets journey state + # to destination selection) + $self->app->checkout( $arr, 0, $uid ); + } + else { + $self->app->add_route_timestamps( $uid, $train, 0 ); + } } elsif ( $entry->{real_arr_ts} ) { my ( undef, $error ) = $self->app->checkout( $arr, 1, $uid ); |