diff --git a/perllib/FixMyStreet/Cobrand/Brent.pm b/perllib/FixMyStreet/Cobrand/Brent.pm index 1a078fc9a8b..3419f4fd429 100644 --- a/perllib/FixMyStreet/Cobrand/Brent.pm +++ b/perllib/FixMyStreet/Cobrand/Brent.pm @@ -739,10 +739,9 @@ sub bin_services_for_address { my $calendar_save = {}; foreach (@$result) { my $servicetask = $self->_get_current_service_task($_) or next; - my $desc_to_use = 'schedule'; + my $schedules = _parse_schedules($servicetask); # Brent has two overlapping schedules for food - $desc_to_use = 'task' if $_->{ServiceId} == 316; - my $schedules = _parse_schedules($servicetask, $desc_to_use); + $schedules->{description} =~ s/other\s*// if $_->{ServiceId} == 316; $expired{$_->{Id}} = $schedules if $self->waste_sub_overdue( $schedules->{end_date}, weeks => 4 ); next unless $schedules->{next} or $schedules->{last}; diff --git a/t/cobrand/brent.t b/t/cobrand/brent.t index 950f952babf..5939ebee1b8 100644 --- a/t/cobrand/brent.t +++ b/t/cobrand/brent.t @@ -833,7 +833,7 @@ FixMyStreet::override_config { ServiceName => 'Domestic Food Waste Collection', ServiceTasks => { ServiceTask => { Id => 403, - ScheduleDescription => 'every Thursday', + ScheduleDescription => 'every Thursday fortnightly', ServiceTaskSchedules => { ServiceTaskSchedule => { ScheduleDescription => 'every other Thursday', StartDate => { DateTime => '2020-01-01T00:00:00Z' },