X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/b5b366c932e2a8118cafa0d27432fa268099d419..b90ff6b18df92c98b1b875d14835d1fdf9ff339a:/SL/DB/Customer.pm diff --git a/SL/DB/Customer.pm b/SL/DB/Customer.pm index 2032a4179..d72d0c91a 100644 --- a/SL/DB/Customer.pm +++ b/SL/DB/Customer.pm @@ -2,6 +2,7 @@ package SL::DB::Customer; use strict; +use List::Util qw(first); use Rose::DB::Object::Helpers qw(as_tree); use SL::Locale::String qw(t8); @@ -114,4 +115,11 @@ sub create_zugferd_invoices_for_this_customer { return $self->create_zugferd_invoices; } +sub default_billing_address { + my $self = shift; + + die 'not an accessor' if @_ > 1; + return first { $_->default_address } @{ $self->additional_billing_addresses }; +} + 1;