From a64b214d855ee7c1077323dbc8d2e19a89703085 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 1 Oct 2015 16:10:18 +0200 Subject: [PATCH] Rechnungen: In Kopf anzeigen, in welchen SEPA-Exporten der Beleg enthalten ist --- SL/DB/Invoice.pm | 6 ++++++ bin/mozilla/is.pl | 1 + locale/de/all | 1 + templates/webpages/is/form_header.html | 11 +++++++++++ 4 files changed, 19 insertions(+) diff --git a/SL/DB/Invoice.pm b/SL/DB/Invoice.pm index 76531e919..54da8fa7f 100644 --- a/SL/DB/Invoice.pm +++ b/SL/DB/Invoice.pm @@ -39,6 +39,12 @@ __PACKAGE__->meta->add_relationship( column_map => { id => 'ar_id' }, manager_args => { with_objects => [ 'sepa_export' ] } }, + sepa_exports => { + type => 'many to many', + map_class => 'SL::DB::SepaExportItem', + map_from => 'ar', + map_to => 'sepa_export', + }, custom_shipto => { type => 'one to one', class => 'SL::DB::Shipto', diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 41d7e3157..7700fc271 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -292,6 +292,7 @@ sub form_header { my %TMPL_VAR = (); my @custom_hiddens; + $TMPL_VAR{invoice_obj} = SL::DB::Invoice->new(id => $form->{id})->load if $form->{id}; $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id}; $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id}; diff --git a/locale/de/all b/locale/de/all index c897d962b..59c92b9bd 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2253,6 +2253,7 @@ $self->{texts} = { 'SCREENED' => 'Angezeigt', 'SEPA XML download' => 'SEPA-XML-Download', 'SEPA creditor ID' => 'SEPA-Kreditoren-Identifikation', + 'SEPA exports' => 'SEPA-Exporte', 'SEPA exports:' => 'SEPA-Exporte:', 'SEPA message ID' => 'SEPA-Nachrichten-ID', 'SEPA message IDs' => 'SEPA-Nachrichten-IDs', diff --git a/templates/webpages/is/form_header.html b/templates/webpages/is/form_header.html index 7b6712d45..dd711fc19 100644 --- a/templates/webpages/is/form_header.html +++ b/templates/webpages/is/form_header.html @@ -108,6 +108,17 @@ [%- END %] +[%- 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 %] [%- IF business %] [% 'Customer type' | $T8 %] -- 2.20.1