Kreditorenbeleg: Kontenbeschreibung für Zahlungskonten anzeigen
authorJan Büren <jan@kivitendo.de>
Fri, 8 Mar 2019 11:58:13 +0000 (12:58 +0100)
committerJan Büren <jan@kivitendo.de>
Fri, 8 Mar 2019 11:58:13 +0000 (12:58 +0100)
Wie bei EK-Rechnung. Zur Sicherheit ein eigenes
Form-Feld generiert, anstatt die select box nur zu disablen.

bin/mozilla/ap.pl
templates/webpages/ap/form_header.html

index 039f5a9..5591548 100644 (file)
@@ -44,6 +44,7 @@ use SL::IR;
 use SL::IS;
 use SL::ReportGenerator;
 use SL::DB::BankTransactionAccTrans;
+use SL::DB::Chart;
 use SL::DB::Currency;
 use SL::DB::Default;
 use SL::DB::PurchaseInvoice;
@@ -553,6 +554,10 @@ sub form_header {
     $form->{'paidaccount_changeable_'. $i} = $changeable;
 
     $form->{'labelpaid_project_id_'. $i} = $project_labels{$form->{'paid_project_id_'. $i}};
+    # accno and description as info text
+    $form->{'AP_paid_readonly_desc_' . $i} =  $form->{'AP_paid_' . $i} ?
+       $form->{'AP_paid_' . $i} . " " . SL::DB::Manager::Chart->find_by(accno => $form->{'AP_paid_' . $i})->description
+     : '';
   }
 
   $form->{paid_missing} = $form->{invtotal_unformatted} - $form->{totalpaid};
index 45dcf33..fd8c91e 100644 (file)
               </td>
             [% END %]
 
-            [% temp = "AP_paid_"_ i %]
+            [% temp     = "AP_paid_"_ i %]
+            [% readonly = "AP_paid_readonly_desc_"_ i %]
             <td align="center">
               [% IF( changeable ) %]
                 [% L.select_tag(temp, ALL_CHARTS_AP_paid, value_title_sub = \AP_paid_value_title_sub, default = ($temp || accno_arap))  %]
               [% ELSE %]
-                [% $temp | html %]
+                [% $readonly | html %]
                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
               [% END %]
             </td>