From a93f1e395694983593c65b35427a13d68e46d380 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 21 Jan 2013 12:06:24 +0100 Subject: [PATCH] Funktion 'is_sales' in SL::DB::{Invoice,PurchaseInvoice} MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Gleiche Funktionen für ähnliche Objekttypen --- SL/DB/DeliveryOrder.pm | 2 ++ SL/DB/Invoice.pm | 6 ++++++ SL/DB/PurchaseInvoice.pm | 8 ++++++++ 3 files changed, 16 insertions(+) diff --git a/SL/DB/DeliveryOrder.pm b/SL/DB/DeliveryOrder.pm index a48dad74c..fda171a20 100644 --- a/SL/DB/DeliveryOrder.pm +++ b/SL/DB/DeliveryOrder.pm @@ -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; diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index b3adee734..f75a6cd65 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -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; diff --git a/SL/DB/PurchaseInvoice.pm b/SL/DB/PurchaseInvoice.pm index 9c6f54e86..9ec6035b8 100644 --- a/SL/DB/PurchaseInvoice.pm +++ b/SL/DB/PurchaseInvoice.pm @@ -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; -- 2.20.1