Order->number dispacher methode, die je nach typ ordnumber oder quonumber aufruft.
authorSven Schöling <s.schoeling@linet-services.de>
Wed, 18 Apr 2012 13:17:06 +0000 (15:17 +0200)
committerSven Schöling <s.schoeling@linet-services.de>
Wed, 18 Apr 2012 13:17:06 +0000 (15:17 +0200)
SL/DB/Order.pm

index e28a87c..8212a64 100644 (file)
@@ -149,6 +149,19 @@ sub convert_to_invoice {
   return $invoice;
 }
 
+sub number {
+  my $self = shift;
+
+  my %number_method = (
+    sales_order       => 'ordnumber',
+    sales_quotation   => 'quonumber',
+    puchase_order     => 'ordnumber',
+    request_quotation => 'quonumber',
+  );
+
+  return $self->${ \ $number_method{$self->type} }(@_);
+}
+
 1;
 
 __END__