set_duedate ajax auf jquery umgestellt
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 18 Nov 2011 14:39:56 +0000 (15:39 +0100)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 18 Nov 2011 14:39:56 +0000 (15:39 +0100)
templates/webpages/is/form_header.html

index 3ebc298..77133a8 100644 (file)
         </tr>
         <tr>
           <th align="right">[% 'Credit Note Date' | $T8 %]</th>
-          <td>[% L.date_tag('invdate', invdate, onBlur='check_right_date_format(this)', cal_align='BL') %]</td>
+          <td>[% L.date_tag('invdate', invdate, onBlur='check_right_date_format(this)', cal_align='BL', onChange='set_duedate()') %]</td>
         </tr>
 [%- ELSE %]
         <tr>
         </tr>
         <tr>
           <th align="right">[% 'Invoice Date' | $T8 %]</th>
-          <td>[% L.date_tag('invdate', invdate, onBlur='check_right_date_format(this)', cal_align='BL') %]</td>
+          <td>[% L.date_tag('invdate', invdate, onBlur='check_right_date_format(this)', cal_align='BL', onChange='set_duedate()') %]</td>
         </tr>
         <tr>
           <th align="right">[% 'Due Date' | $T8 %]</th>
        setupDateFormat('[% dateformat %]', '[% 'Falsches Datumsformat!' | $T8 %]');
        setupPoints('[% numberformat %]', '[% 'wrongformat' | $T8 %]');
      });
+     function set_duedate() {
+       $.ajax({
+         url: 'is.pl?action=set_duedate',
+         data: {
+           invdate: $('#invdate').val(),
+           payment_id: $('#payment_id').val(),
+         },
+         dataType: 'text',
+         success: function (data) { $('#duedate').val(data); }
+       })
+     }
    //-->
   </script>