Funktion 'is_sales' in SL::DB::{Invoice,PurchaseInvoice}
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 21 Jan 2013 11:06:24 +0000 (12:06 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 21 Jan 2013 13:16:50 +0000 (14:16 +0100)
Gleiche Funktionen für ähnliche Objekttypen

SL/DB/DeliveryOrder.pm
SL/DB/Invoice.pm
SL/DB/PurchaseInvoice.pm

index a48dad7..fda171a 100644 (file)
@@ -2,6 +2,8 @@ package SL::DB::DeliveryOrder;
 
 use strict;
 
+use Carp;
+
 use SL::DB::MetaSetup::DeliveryOrder;
 use SL::DB::Manager::DeliveryOrder;
 use SL::DB::Helper::LinkedRecords;
index b3adee7..f75a6cd 100644 (file)
@@ -37,6 +37,12 @@ __PACKAGE__->meta->initialize;
 sub items        { goto &invoiceitems; }
 sub payment_term { goto &payment;      }
 
+sub is_sales {
+  # For compatibility with Order, DeliveryOrder
+  croak 'not an accessor' if @_ > 1;
+  return 1;
+}
+
 # it is assumed, that ordnumbers are unique here.
 sub first_order_by_ordnumber {
   my $self = shift;
index 9c6f54e..9ec6035 100644 (file)
@@ -2,6 +2,8 @@ package SL::DB::PurchaseInvoice;
 
 use strict;
 
+use Carp;
+
 use SL::DB::MetaSetup::PurchaseInvoice;
 use SL::DB::Manager::PurchaseInvoice;
 use SL::DB::Helper::LinkedRecords;
@@ -20,4 +22,10 @@ __PACKAGE__->meta->initialize;
 sub items        { goto &invoiceitems; }
 sub payment_term { goto &payment;      }
 
+sub is_sales {
+  # For compatibility with Order, DeliveryOrder
+  croak 'not an accessor' if @_ > 1;
+  return 0;
+}
+
 1;