Debitoren-/Kreditorenbuchungen: Zahlungsdatum mit aktuellem Datum vorbelegen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 29 Sep 2015 13:27:20 +0000 (15:27 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 29 Sep 2015 14:43:53 +0000 (16:43 +0200)
bin/mozilla/ap.pl
bin/mozilla/ar.pl
templates/webpages/ap/form_header.html
templates/webpages/ar/form_header.html

index 7e7fbde..b2e5819 100644 (file)
@@ -410,7 +410,9 @@ sub form_header {
 
   $form->{paid_missing} = $form->{invtotal_unformatted} - $form->{totalpaid};
 
-  print $form->parse_html_template('ap/form_header');
+  print $form->parse_html_template('ap/form_header', {
+    today => DateTime->today,
+  });
 
   $main::lxdebug->leave_sub();
 }
index e43361f..38a667e 100644 (file)
@@ -442,6 +442,7 @@ sub form_header {
     ARselected           => $ARselected,
     title_str            => $title,
     follow_up_trans_info => $follow_up_trans_info,
+    today                => DateTime->today,
   });
 
   $main::lxdebug->leave_sub();
index 59457ee..4d81f9d 100644 (file)
             [% temp = "datepaid_"_ i %]
             <td align="center">
               [% IF( changeable ) %]
-                [% L.date_tag(temp, $temp) %]
+                [% L.date_tag(temp, $temp ? $temp : today) %]
               [% ELSE %]
                 [% $temp | html %]
                 <input type="hidden" name="[% temp %]" value="[% $temp | html %]">
index 6bce66a..0f58867 100644 (file)
         <tr>
          <td align=center>
   [%- IF row.changeable %]
-          [% L.date_tag('datepaid_' _ loop.count, row.datepaid) %]
+          [% L.date_tag('datepaid_' _ loop.count, row.datepaid ? row.datepaid : today) %]
   [%- ELSE %]
          [% row.datepaid | html %][% L.hidden_tag('datepaid_' _ loop.count, row.datepaid) %]
   [%- END %]