- my $db = $self->{config}->db;
- $db->do_transaction(sub {
- my $taxzone_charts = SL::DB::Manager::TaxzoneChart->get_all(where => [ buchungsgruppen_id => $self->config->id ]);
- foreach my $taxzonechart ( @{$taxzone_charts} ) { $taxzonechart->delete };
- $self->config->delete();
- flash_later('info', $::locale->text('The buchungsgruppe has been deleted.'));
- }) || flash_later('error', $::locale->text('The buchungsgruppe is in use and cannot be deleted.'));
+ $self->{config}->db->with_transaction(sub {
+ my $taxzone_charts = SL::DB::Manager::TaxzoneChart->get_all(where => [ buchungsgruppen_id => $self->config->id ]);
+ foreach my $taxzonechart ( @{$taxzone_charts} ) { $taxzonechart->delete };
+ $self->config->delete();
+ flash_later('info', $::locale->text('The booking group has been deleted.'));
+
+ 1;
+ }) || flash_later('error', $::locale->text('The booking group is in use and cannot be deleted.'));