From f4dca613e8bead358d42df904b2b54b098ef0fcb Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 11 Nov 2010 17:29:46 +0100 Subject: [PATCH] Nur Verkaufsbelege in Rechnungen umwandeln --- SL/DB/Order.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SL/DB/Order.pm b/SL/DB/Order.pm index ebf099442..573e4f5c5 100644 --- a/SL/DB/Order.pm +++ b/SL/DB/Order.pm @@ -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', -- 2.20.1