From ab3fab978c9e8368a828acc1b9caa6968b02dfd3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 11 May 2022 12:11:52 +0200 Subject: [PATCH] BankTransaction: Vorlagen: Verwendungszweck als Bemerkung in Kreditorenbuchung MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Mit der Möglichkeit, projektbezogenen Code für eine Konvertierung der Verwendungszwecks einzubauen. --- SL/Controller/BankTransaction.pm | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index e38f8a997..9d432d556 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -983,6 +983,7 @@ sub load_ap_record_template_url { 'form_defaults.paid_1_suggestion' => $::form->format_amount(\%::myconfig, -1 * $self->transaction->amount, 2), 'form_defaults.AP_paid_1_suggestion' => $self->transaction->local_bank_account->chart->accno, 'form_defaults.callback' => $self->callback, + 'form_defaults.notes' => $self->convert_purpose_for_template($template, $self->transaction->purpose), ); } @@ -998,10 +999,18 @@ sub load_gl_record_template_url { 'form_defaults.callback' => $self->callback, 'form_defaults.bt_id' => $self->transaction->id, 'form_defaults.bt_chart_id' => $self->transaction->local_bank_account->chart->id, - 'form_defaults.description' => $self->transaction->purpose, + 'form_defaults.description' => $self->convert_purpose_for_template($template, $self->transaction->purpose), ); } +sub convert_purpose_for_template { + my ($self, $template, $purpose) = @_; + + # enter custom code here + + return $purpose; +} + sub setup_search_action_bar { my ($self, %params) = @_; @@ -1119,6 +1128,13 @@ GL-records will be deleted completely if a bank transaction was the source. TODO: we still rely on linked_records for the check boxes +=item C + +This method can be used to parse, filter and convert the bank transaction's +purpose string before it will be assigned to the description field of a +gl transaction or to the notes field of an ap transaction. +You have to write your own custom code. + =back =head1 AUTHOR -- 2.20.1