X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FDB%2FOrder.pm;h=1be7b22bfefae0699521a3f1fe15a63c2f0a43dd;hb=c19b30d22f462a5913610d1f9005a34ed95e1119;hp=ebf0994423cdcd0cf1c30acbe6fe38b082cf6be5;hpb=42ea98b4883178877c2bd47a032cea5891998e5a;p=kivitendo-erp.git diff --git a/SL/DB/Order.pm b/SL/DB/Order.pm index ebf099442..1be7b22bf 100644 --- a/SL/DB/Order.pm +++ b/SL/DB/Order.pm @@ -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',