Verknüpfung Tax -> Chart
[kivitendo-erp.git] / SL / DB / Order.pm
index ebf0994..1be7b22 100644 (file)
@@ -86,21 +86,11 @@ sub end_invoice {
   return shift()->invoices(query => [ abschlag => 0 ]);
 }
 
-sub convert_to {
-  my ($self, %params) = @_;
-
-  my $destination_type = lc(delete $params{destination_type});
-
-  if ($destination_type eq 'invoice') {
-    $self->convert_to_invoice(%params);
-  } else {
-    croak("Unsupported destination type `$destination_type'");
-  }
-}
-
 sub convert_to_invoice {
   my ($self, %params) = @_;
 
+  croak("Conversion to invoices is only supported for sales records") unless $self->customer_id;
+
   if (!$params{ar_id}) {
     my $chart = SL::DB::Manager::Chart->get_all(query   => [ SL::DB::Manager::Chart->link_filter('AR') ],
                                                 sort_by => 'id ASC',