From 7203ed2f94d9ac63e93097e05b19db4c5e557d25 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Mon, 17 Aug 2015 11:32:40 +0200 Subject: [PATCH] =?utf8?q?invoice=5Ftype,=20displayable=5Ftype=20und=20dis?= =?utf8?q?playable=5Fname=20f=C3=BCr=20ap?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bei Einkaufsrechnungen und Kreditorenbuchungen gibt es keine Stornos oder Gutschriften. --- SL/DB/PurchaseInvoice.pm | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/SL/DB/PurchaseInvoice.pm b/SL/DB/PurchaseInvoice.pm index ab1bd4957..d1eaded8f 100644 --- a/SL/DB/PurchaseInvoice.pm +++ b/SL/DB/PurchaseInvoice.pm @@ -50,6 +50,7 @@ __PACKAGE__->attr_sorted('items'); sub items { goto &invoiceitems; } sub add_items { goto &add_invoiceitems; } +sub record_number { goto &invnumber; }; sub is_sales { # For compatibility with Order, DeliveryOrder @@ -89,4 +90,22 @@ sub link { return $html; } +sub invoice_type { + my ($self) = @_; + + return 'ap_transaction' if !$self->invoice; + return 'purchase_invoice'; +} + +sub displayable_type { + my ($self) = @_; + + return t8('AP Transaction') if $self->invoice_type eq 'ap_transaction'; + return t8('Purchase Invoice'); +} + +sub displayable_name { + join ' ', grep $_, map $_[0]->$_, qw(displayable_type record_number); +}; + 1; -- 2.20.1