X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FPresenter%2FRecord.pm;h=d8d11fc98f8c968016bf3c54185b6c801f8454d8;hb=a8628c6af6ab8303fe67d874adbee0211bd86c1e;hp=b46896d471805202ef9ad3d221cae95a15a1714f;hpb=3bd0186152b02a358563ff441172c23f1fc8fadc;p=kivitendo-erp.git diff --git a/SL/Presenter/Record.pm b/SL/Presenter/Record.pm index b46896d47..d8d11fc98 100644 --- a/SL/Presenter/Record.pm +++ b/SL/Presenter/Record.pm @@ -55,9 +55,15 @@ 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}; $output .= _sepa_transfer_list( $self, $groups{sepa_transfers}, %params) if $groups{sepa_transfers}; + $output .= _letter_list( $self, $groups{letters}, %params) if $groups{letters}; + $output = $self->render('presenter/record/grouped_record_list', %params, output => $output); return $output; @@ -177,6 +183,8 @@ sub _group_records { sepa_collections => sub { (ref($_[0]) eq 'SL::DB::SepaExportItem') && $_[0]->ar_id }, sepa_transfers => sub { (ref($_[0]) eq 'SL::DB::SepaExportItem') && $_[0]->ap_id }, gl_transactions => sub { (ref($_[0]) eq 'SL::DB::GLTransaction') }, + bank_transactions => sub { (ref($_[0]) eq 'SL::DB::BankTransaction') && $_[0]->id }, + letters => sub { (ref($_[0]) eq 'SL::DB::Letter') && $_[0]->id }, ); my %groups; @@ -429,6 +437,45 @@ 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) = @_; + + return $self->record_list( + $list, + title => $::locale->text('Bank transactions'), + type => 'bank_transactions', + columns => [ + [ $::locale->text('Transdate'), 'transdate' ], + [ $::locale->text('Local Bank Code'), sub { $self->bank_code($_[0]->local_bank_account) } ], + [ $::locale->text('Local account number'), sub { $self->account_number($_[0]->local_bank_account) } ], + [ $::locale->text('Remote Bank Code'), 'remote_bank_code' ], + [ $::locale->text('Remote account number'),'remote_account_number' ], + [ $::locale->text('Valutadate'), 'valutadate' ], + [ $::locale->text('Amount'), 'amount' ], + [ $::locale->text('Currency'), sub { $_[0]->currency->name } ], + [ $::locale->text('Remote name'), 'remote_name' ], + [ $::locale->text('Purpose'), 'purpose' ], + ], + %params, + ); +} + sub _sepa_export_list { my ($self, $list, %params) = @_; @@ -464,6 +511,24 @@ sub _sepa_collection_list { _sepa_export_list($self, $list, %params, type => 'sepa_collection'); } +sub _letter_list { + my ($self, $list, %params) = @_; + + return $self->record_list( + $list, + title => $::locale->text('Letters'), + type => 'letter', + columns => [ + [ $::locale->text('Date'), 'date' ], + [ $::locale->text('Letternumber'), sub { $self->letter($_[0], display => 'table-cell') } ], + [ $::locale->text('Customer'), 'customer' ], + [ $::locale->text('Reference'), 'reference' ], + [ $::locale->text('Subject'), 'subject' ], + ], + %params, + ); +} + 1; __END__ @@ -546,6 +611,8 @@ The order in which the records are grouped is: =item * AP transactions +=item * GL transactions + =item * SEPA collections =item * SEPA transfers