From d6beac43fc50cbbe7a0655a56f60bd50726ccbf8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 1 Oct 2015 16:21:09 +0200 Subject: [PATCH] Debitorenbuchungen: In Kopf anzeigen, in welchen SEPA-Exporten der Beleg enthalten ist --- bin/mozilla/ar.pl | 10 +++++++++- templates/webpages/ar/form_header.html | 11 +++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 148ac0be9..a8bdc566e 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -140,6 +140,12 @@ sub display_form { $main::lxdebug->leave_sub(); } +sub _retrieve_invoice_object { + return undef if !$::form->{id}; + return $::form->{invoice_obj} if $::form->{invoice_obj} && $::form->{invoice_obj}->id == $::form->{id}; + return SL::DB::Invoice->new(id => $::form->{id})->load; +} + sub create_links { $main::lxdebug->enter_sub(); @@ -150,7 +156,7 @@ sub create_links { my %myconfig = %main::myconfig; $form->create_links("AR", \%myconfig, "customer"); - $form->{invoice_obj} = $form->{id} ? SL::DB::Invoice->new(id => $form->{id})->load : undef; + $form->{invoice_obj} = _retrieve_invoice_object(); my %saved; if (!$params{dont_save}) { @@ -218,6 +224,8 @@ sub form_header { my $locale = $main::locale; my $cgi = $::request->{cgi}; + $form->{invoice_obj} = _retrieve_invoice_object(); + my ($title, $readonly, $exchangerate, $rows); my ($notes, $department, $customer, $employee, $amount, $project); my ($ARselected); diff --git a/templates/webpages/ar/form_header.html b/templates/webpages/ar/form_header.html index cef1f62f9..b4cf07cc2 100644 --- a/templates/webpages/ar/form_header.html +++ b/templates/webpages/ar/form_header.html @@ -76,6 +76,17 @@ [% LxERP.format_amount(creditremaining, 0) %][% L.hidden_tag('creditremaining', LxERP.format_amount(creditremaining, 0)) %] +[%- IF invoice_obj.sepa_exports.as_list.size %] + + [% LxERP.t8("SEPA exports") %] + + [% FOREACH export = invoice_obj.sepa_exports.as_list %] + [% HTML.escape(export.id) %] + [% UNLESS loop.last %], [% END %] + [% END %] + + +[%- END %] [% 'Currency' | $T8 %] -- 2.20.1