diff options
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bromley.pm | 16 | ||||
-rw-r--r-- | perllib/Integrations/Echo.pm | 1 |
2 files changed, 15 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm index 93dd35539..f80bdaa12 100644 --- a/perllib/FixMyStreet/Cobrand/Bromley.pm +++ b/perllib/FixMyStreet/Cobrand/Bromley.pm @@ -612,9 +612,21 @@ sub bin_services_for_address { $row->{last}{completed} = $completed; $row->{last}{resolution} = $resolution; $row->{report_allowed} = within_working_days($row->{last}{date}, 2); - if (!$completed && $row->{last}{date}->ymd eq $now->ymd) { - $row->{report_allowed} = 0; + + # Special handling if last instance is today + if ($row->{last}{date}->ymd eq $now->ymd) { + # If it's before 5pm and outstanding, show it as in progress + if ($state eq 'Outstanding' && $now->hour < 17) { + $row->{next} = $row->{last}; + $row->{next}{state} = 'In progress'; + delete $row->{last}; + } + if (!$completed && $now->hour < 17) { + $row->{report_allowed} = 0; + } } + + # If the task is ended and could not be done, do not allow reporting if ($state eq 'Not Completed' || ($state eq 'Completed' && $_->{Resolution}{Name} eq 'Excess Waste')) { $row->{report_allowed} = 0; $row->{report_locked_out} = 1; diff --git a/perllib/Integrations/Echo.pm b/perllib/Integrations/Echo.pm index 0216240da..28dd1e9bc 100644 --- a/perllib/Integrations/Echo.pm +++ b/perllib/Integrations/Echo.pm @@ -99,6 +99,7 @@ sub GetTasks { }, { Ref => { Value => { anyType => [ 234, 567 ] } }, + State => { Name => 'Outstanding' }, CompletedDate => undef }, { |