]> wagnertech.de Git - mfinanz.git/blobdiff - SL/DB/PurchaseInvoice.pm
CSV Import Defaults in die Worker ausgelagert
[mfinanz.git] / SL / DB / PurchaseInvoice.pm
index d5955c57cd8a758dc6b519a1a1ebf0b87182625f..ed0523bb42afaf9870714325c0ecdaf6cc03e52a 100644 (file)
@@ -6,7 +6,9 @@ use Carp;
 
 use SL::DB::MetaSetup::PurchaseInvoice;
 use SL::DB::Manager::PurchaseInvoice;
+use SL::DB::Helper::AttrHTML;
 use SL::DB::Helper::LinkedRecords;
+use SL::DB::Helper::Payment qw(:ALL);
 use SL::Locale::String qw(t8);
 
 # The calculator hasn't been adjusted for purchase invoices yet.
@@ -42,6 +44,8 @@ __PACKAGE__->meta->add_relationship(
 
 __PACKAGE__->meta->initialize;
 
+__PACKAGE__->attr_html('notes');
+
 sub items { goto &invoiceitems; }
 sub add_items { goto &add_invoiceitems; }
 
@@ -77,6 +81,16 @@ sub abbreviation {
   return t8('Invoice (one letter abbreviation)'). '(' . t8('Storno (one letter abbreviation)') . ')' if $self->storno;
   return t8('Invoice (one letter abbreviation)');
 
+};
+
+sub link {
+  my ($self) = @_;
+
+  my $html;
+  $html   = SL::Presenter->get->purchase_invoice($self, display => 'inline') if $self->invoice;
+  $html   = SL::Presenter->get->ap_transaction($self, display => 'inline') if !$self->invoice;
+
+  return $html;
 }
 
 1;