From 2652ea6bab56e40169334800f4b9c5a11c3ef601 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 18 Feb 2020 17:38:53 +0100 Subject: auto-checkout for cancelled departure: guard against destination changes --- lib/Travelynx/Command/work.pm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/Travelynx/Command/work.pm b/lib/Travelynx/Command/work.pm index 04dbd2d..727a694 100644 --- a/lib/Travelynx/Command/work.pm +++ b/lib/Travelynx/Command/work.pm @@ -81,9 +81,10 @@ sub run { 'in_transit', 'count(*) as count', { - user_id => $uid, - train_no => $train->train_no, - checkin_station_id => $dep + user_id => $uid, + train_no => $train->train_no, + checkin_station_id => $dep, + checkout_station_id => $arr, } )->hash->{count} ) @@ -94,9 +95,10 @@ sub run { cancelled => 1, }, { - user_id => $uid, - train_no => $train->train_no, - checkin_station_id => $dep + user_id => $uid, + train_no => $train->train_no, + checkin_station_id => $dep, + checkout_station_id => $arr, } ); -- cgit v1.2.3