Rechnungen: In Kopf anzeigen, in welchen SEPA-Exporten der Beleg enthalten ist
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 1 Oct 2015 14:10:18 +0000 (16:10 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 1 Oct 2015 14:31:51 +0000 (16:31 +0200)
SL/DB/Invoice.pm
bin/mozilla/is.pl
locale/de/all
templates/webpages/is/form_header.html

index 76531e9..54da8fa 100644 (file)
@@ -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',
index 41d7e31..7700fc2 100644 (file)
@@ -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};
 
index c897d96..59c92b9 100755 (executable)
@@ -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',
index 7b6712d..dd711fc 100644 (file)
           </td>
         </tr>
 [%- END %]
+[%- IF invoice_obj.sepa_exports.as_list.size %]
+        <tr>
+          <th align="right">[% LxERP.t8("SEPA exports") %]</th>
+          <td>
+           [% FOREACH export = invoice_obj.sepa_exports.as_list %]
+            <a href="sepa.pl?action=bank_transfer_edit&vc=customer&id=[% HTML.url(export.id) %]">[% HTML.escape(export.id) %]</a>
+            [% UNLESS loop.last %], [% END %]
+           [% END %]
+          </td>
+        </tr>
+[%- END %]
 [%- IF business %]
         <tr>
           <th align="right">[% 'Customer type' | $T8 %]</th>