From bfb31bebd1bc46ab9ffab3955165c94fa17b08f1 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Tue, 24 Jan 2017 12:34:54 +0100 Subject: [PATCH] Record presenter - Dialogbuchungen ebenfalls anzeigen, z.B. bei Projekten --- SL/DB/GLTransaction.pm | 6 +++++- SL/Presenter/Record.pm | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/SL/DB/GLTransaction.pm b/SL/DB/GLTransaction.pm index 3b9612e9e..c9f436056 100644 --- a/SL/DB/GLTransaction.pm +++ b/SL/DB/GLTransaction.pm @@ -3,7 +3,7 @@ package SL::DB::GLTransaction; use strict; use SL::DB::MetaSetup::GLTransaction; - +use SL::Locale::String qw(t8); # Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. __PACKAGE__->meta->make_manager_class; @@ -30,6 +30,10 @@ sub abbreviation { return $abbreviation; } +sub displayable_type { + return t8('GL Transaction'); +} + sub oneline_summary { my ($self) = @_; return sprintf("%s: %s %s (%s)", $self->abbreviation, $self->description, $self->reference, $_->transdate->to_kivitendo); diff --git a/SL/Presenter/Record.pm b/SL/Presenter/Record.pm index 40f220454..d8d11fc98 100644 --- a/SL/Presenter/Record.pm +++ b/SL/Presenter/Record.pm @@ -55,6 +55,8 @@ sub grouped_record_list { $output .= _purchase_invoice_list( $self, $groups{purchase_invoices}, %params) if $groups{purchase_invoices}; $output .= _ap_transaction_list( $self, $groups{ap_transactions}, %params) if $groups{ap_transactions}; + $output .= _gl_transaction_list( $self, $groups{gl_transactions}, %params) if $groups{gl_transactions}; + $output .= _bank_transactions( $self, $groups{bank_transactions}, %params) if $groups{bank_transactions}; $output .= _sepa_collection_list( $self, $groups{sepa_collections}, %params) if $groups{sepa_collections}; @@ -435,6 +437,22 @@ sub _ap_transaction_list { ); } +sub _gl_transaction_list { + my ($self, $list, %params) = @_; + + return $self->record_list( + $list, + title => $::locale->text('GL Transactions'), + type => 'gl_transaction', + columns => [ + [ $::locale->text('Date'), 'transdate' ], + [ $::locale->text('Reference'), 'reference' ], + [ $::locale->text('Description'), sub { $self->gl_transaction($_[0 ], display => 'table-cell') } ], + ], + %params, + ); +} + sub _bank_transactions { my ($self, $list, %params) = @_; @@ -593,6 +611,8 @@ The order in which the records are grouped is: =item * AP transactions +=item * GL transactions + =item * SEPA collections =item * SEPA transfers -- 2.20.1