From: G. Richardson Date: Mon, 17 Aug 2015 09:32:40 +0000 (+0200) Subject: invoice_type, displayable_type und displayable_name für ap X-Git-Tag: release-3.3.0~17 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=7203ed2f94d9ac63e93097e05b19db4c5e557d25;p=kivitendo-erp.git invoice_type, displayable_type und displayable_name für ap Bei Einkaufsrechnungen und Kreditorenbuchungen gibt es keine Stornos oder Gutschriften. --- 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;