Nur Verkaufsbelege in Rechnungen umwandeln
authorMoritz Bunkus <moritz@bunkus.org>
Thu, 11 Nov 2010 16:29:46 +0000 (17:29 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Wed, 12 Jan 2011 15:24:16 +0000 (16:24 +0100)
SL/DB/Order.pm

index ebf0994..573e4f5 100644 (file)
@@ -101,6 +101,8 @@ sub convert_to {
 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',