Rose-Fremdschlüssel richtig benennen: wiederkehrende Rechnungen fixen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 12 Apr 2013 14:46:44 +0000 (16:46 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 12 Apr 2013 15:07:27 +0000 (17:07 +0200)
SL/DB/Invoice.pm

index 77d6769..861c92a 100644 (file)
@@ -90,7 +90,7 @@ sub new_from {
   croak("Unsupported source object type '" . ref($source) . "'") unless ref($source) =~ m/^ SL::DB:: (?: Order | DeliveryOrder ) $/x;
   croak("Cannot create invoices for purchase records")           unless $source->customer_id;
 
-  my $terms = $source->can('payment_id') && $source->payment_id ? $source->payment_term->terms_netto : 0;
+  my $terms = $source->can('payment_id') && $source->payment_id ? $source->payment_terms->terms_netto : 0;
 
   my %args = ( map({ ( $_ => $source->$_ ) } qw(customer_id taxincluded shippingpoint shipvia notes intnotes curr salesman_id cusordnumber ordnumber quonumber
                                                 department_id cp_id language_id payment_id delivery_customer_id delivery_vendor_id taxzone_id shipto_id