Automatisches Setzes des Faelligkeitsdatums nach Zahlungsbedingung
authorPhilip Reetz <p.reetz@linet-services.de>
Wed, 27 Dec 2006 15:03:43 +0000 (15:03 +0000)
committerPhilip Reetz <p.reetz@linet-services.de>
Wed, 27 Dec 2006 15:03:43 +0000 (15:03 +0000)
SL/Form.pm
bin/mozilla/io.pl
bin/mozilla/is.pl
locale/de/all
locale/de/cn
locale/de/dn
locale/de/ic
locale/de/io
locale/de/ir
locale/de/is
locale/de/oe

index 0616e1e..c812b40 100644 (file)
@@ -1325,6 +1325,24 @@ sub get_employee {
   $main::lxdebug->leave_sub();
 }
 
+sub get_duedate {
+  $main::lxdebug->enter_sub();
+
+  my ($self, $myconfig) = @_;
+
+  my $dbh = $self->dbconnect($myconfig);
+  my $query = qq|SELECT current_date+terms_netto FROM payment_terms
+                 WHERE id = '$self->{payment_id}'|;
+  my $sth = $dbh->prepare($query);
+  $sth->execute || $self->dberror($query);
+
+  ($self->{duedate}) = $sth->fetchrow_array;
+
+  $sth->finish;
+
+  $main::lxdebug->leave_sub();
+}
+
 # get other contact for transaction and form - html/tex
 sub get_contact {
   $main::lxdebug->enter_sub();
index ad619b9..64a59f7 100644 (file)
@@ -34,6 +34,8 @@
 #######################################################################
 
 use SL::IC;
+use CGI::Ajax;
+use CGI;
 
 require "$form->{path}/common.pl";
 
@@ -2189,3 +2191,18 @@ sub relink_accounts {
 
   $lxdebug->leave_sub();
 }
+
+
+sub set_duedate {
+  $lxdebug->enter_sub();
+
+  $form->get_duedate(\%myconfig);
+
+  my $q = new CGI;
+  $result = "$form->{duedate}";
+  print $q->header();
+  print $result;
+  $lxdebug->leave_sub();
+
+}
+
index 52e6682..badf065 100644 (file)
@@ -324,6 +324,11 @@ sub form_header {
     }
   }
 
+  my $set_duedate_url =
+    "$form->{script}?login=$form->{login}&path=$form->{path}&password=$form->{password}&action=set_duedate";
+
+  my $pjx = new CGI::Ajax( 'set_duedate' => $set_duedate_url );
+  push(@ { $form->{AJAX} }, $pjx);
 
   if (@{ $form->{TAXZONE} }) {
     $form->{selecttaxzone} = "";
@@ -911,7 +916,7 @@ sub form_footer {
              <tr valign=top>
                <td>$notes</td>
                <td>$intnotes</td>
-                <td><select name=payment_id tabindex=24>$payment
+                <td><select name=payment_id onChange="set_duedate(['payment_id__' + this.value],['duedate'])">$payment
                 </select></td>
              </tr>
            </table>
index bd9fd60..f4d2b13 100644 (file)
@@ -958,6 +958,7 @@ gestartet',
   'The database update/creation did not succeed. The file <TMPL_VAR file ESCAPE=HTML> contained the following error:' => 'Die Datenbankaktualisierung/erstellung schlug fehl. Die Datei <TMPL_VAR file ESCAPE=HTML> enthielt den folgenden Fehler:',
   'The database upgrade for the introduction of Buchungsgruppen is now complete.' => 'Das Datenbankupgrade f&uuml;r die Einf&uuml;hrung von Buchungsgruppen ist jetzt beendet.',
   'The database upgrade for the introduction of units is now complete.' => 'Das Datenbankupgrade zwecks Einf&uuml;hrung von Einheiten ist nun beendet.',
+  'The dunning process is started' => '',
   'The dunning process started' => 'Der Mahnprozess ist gestartet.',
   'The factor is missing in row %d.' => 'Der Faktor fehlt in Zeile %d.',
   'The factor is missing.'      => 'Der Faktor fehlt.',
index bdfebfa..ba075a2 100644 (file)
@@ -260,6 +260,7 @@ $self->{subs} = {
   'select_part_internal'        => 'select_part_internal',
   'select_project'              => 'select_project',
   'send_email'                  => 'send_email',
+  'set_duedate'                 => 'set_duedate',
   'set_longdescription'         => 'set_longdescription',
   'set_pricegroup'              => 'set_pricegroup',
   'ship_to'                     => 'ship_to',
index cf47a4b..b0fc7a1 100644 (file)
@@ -247,6 +247,7 @@ $self->{subs} = {
   'select_part_internal'        => 'select_part_internal',
   'select_project'              => 'select_project',
   'send_email'                  => 'send_email',
+  'set_duedate'                 => 'set_duedate',
   'set_email'                   => 'set_email',
   'set_longdescription'         => 'set_longdescription',
   'set_pricegroup'              => 'set_pricegroup',
index ba3df55..e3de959 100644 (file)
@@ -300,6 +300,7 @@ $self->{subs} = {
   'select_part'                 => 'select_part',
   'select_part_internal'        => 'select_part_internal',
   'send_email'                  => 'send_email',
+  'set_duedate'                 => 'set_duedate',
   'set_longdescription'         => 'set_longdescription',
   'set_pricegroup'              => 'set_pricegroup',
   'ship_to'                     => 'ship_to',
index db3ea9e..dfd973f 100644 (file)
@@ -171,6 +171,7 @@ $self->{subs} = {
   'select_part'                 => 'select_part',
   'select_part_internal'        => 'select_part_internal',
   'send_email'                  => 'send_email',
+  'set_duedate'                 => 'set_duedate',
   'set_longdescription'         => 'set_longdescription',
   'set_pricegroup'              => 'set_pricegroup',
   'ship_to'                     => 'ship_to',
index e93d3d0..26d03d0 100644 (file)
@@ -250,6 +250,7 @@ $self->{subs} = {
   'select_part_internal'        => 'select_part_internal',
   'select_project'              => 'select_project',
   'send_email'                  => 'send_email',
+  'set_duedate'                 => 'set_duedate',
   'set_longdescription'         => 'set_longdescription',
   'set_pricegroup'              => 'set_pricegroup',
   'ship_to'                     => 'ship_to',
index ca262b9..ceecdd8 100644 (file)
@@ -278,6 +278,7 @@ $self->{subs} = {
   'select_part_internal'        => 'select_part_internal',
   'select_project'              => 'select_project',
   'send_email'                  => 'send_email',
+  'set_duedate'                 => 'set_duedate',
   'set_longdescription'         => 'set_longdescription',
   'set_pricegroup'              => 'set_pricegroup',
   'ship_to'                     => 'ship_to',
index 195be07..90ea100 100644 (file)
@@ -325,6 +325,7 @@ $self->{subs} = {
   'select_part_internal'        => 'select_part_internal',
   'select_project'              => 'select_project',
   'send_email'                  => 'send_email',
+  'set_duedate'                 => 'set_duedate',
   'set_headings'                => 'set_headings',
   'set_longdescription'         => 'set_longdescription',
   'set_pricegroup'              => 'set_pricegroup',