diff options
Diffstat (limited to 'bin/send-reports')
-rwxr-xr-x | bin/send-reports | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/send-reports b/bin/send-reports index 648e83192..427d02ec8 100755 --- a/bin/send-reports +++ b/bin/send-reports @@ -92,7 +92,7 @@ while (my $row = $unsent->next) { } if ( $row->used_map ) { - $h{closest_address} = $cobrand->find_closest( $h{latitude}, $h{longitude} ); + $h{closest_address} = $cobrand->find_closest( $h{latitude}, $h{longitude}, $row ); } my (@to, @recips, $template, $areas_info, @open311_councils); @@ -273,8 +273,18 @@ while (my $row = $unsent->next) { $open311->endpoints( { services => 'Services', requests => 'Requests' } ); } + # required to get round issues with CRM constraints + if ( $row->council =~ /2218/ ) { + $row->user->name( $row->user->id . ' ' . $row->user->name ); + } + my $resp = $open311->send_service_request( $row, \%h, $contact->email ); + # make sure we don't save user changes from above + if ( $row->council =~ /2218/ ) { + $row->discard_changes(); + } + if ( $resp ) { $row->external_id( $resp ); $result *= 0; |