From: Bernd Bleßmann Date: Wed, 11 May 2022 10:11:52 +0000 (+0200) Subject: BankTransaction: Vorlagen: Verwendungszweck als Bemerkung in Kreditorenbuchung X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~31 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ab3fab978c9e8368a828acc1b9caa6968b02dfd3;p=kivitendo-erp.git BankTransaction: Vorlagen: Verwendungszweck als Bemerkung in Kreditorenbuchung Mit der Möglichkeit, projektbezogenen Code für eine Konvertierung der Verwendungszwecks einzubauen. --- 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