From: Philip Reetz Date: Wed, 27 Dec 2006 15:03:43 +0000 (+0000) Subject: Automatisches Setzes des Faelligkeitsdatums nach Zahlungsbedingung X-Git-Tag: release-2.4.1~1^2~113 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=85e36de2a319d0dbaa2e1572c16c9537d0d5f3ce;p=kivitendo-erp.git Automatisches Setzes des Faelligkeitsdatums nach Zahlungsbedingung --- diff --git a/SL/Form.pm b/SL/Form.pm index 0616e1e79..c812b404d 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -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(); diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index ad619b92d..64a59f7b0 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -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(); + +} + diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 52e668233..badf0655b 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -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 { $notes $intnotes - $payment diff --git a/locale/de/all b/locale/de/all index bd9fd60f3..f4d2b13aa 100644 --- a/locale/de/all +++ b/locale/de/all @@ -958,6 +958,7 @@ gestartet', 'The database update/creation did not succeed. The file contained the following error:' => 'Die Datenbankaktualisierung/erstellung schlug fehl. Die Datei enthielt den folgenden Fehler:', 'The database upgrade for the introduction of Buchungsgruppen is now complete.' => 'Das Datenbankupgrade für die Einführung von Buchungsgruppen ist jetzt beendet.', 'The database upgrade for the introduction of units is now complete.' => 'Das Datenbankupgrade zwecks Einfü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.', diff --git a/locale/de/cn b/locale/de/cn index bdfebfa64..ba075a202 100644 --- a/locale/de/cn +++ b/locale/de/cn @@ -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', diff --git a/locale/de/dn b/locale/de/dn index cf47a4b91..b0fc7a1e3 100644 --- a/locale/de/dn +++ b/locale/de/dn @@ -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', diff --git a/locale/de/ic b/locale/de/ic index ba3df55f2..e3de95949 100644 --- a/locale/de/ic +++ b/locale/de/ic @@ -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', diff --git a/locale/de/io b/locale/de/io index db3ea9ece..dfd973f4c 100644 --- a/locale/de/io +++ b/locale/de/io @@ -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', diff --git a/locale/de/ir b/locale/de/ir index e93d3d06f..26d03d023 100644 --- a/locale/de/ir +++ b/locale/de/ir @@ -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', diff --git a/locale/de/is b/locale/de/is index ca262b9dd..ceecdd825 100644 --- a/locale/de/is +++ b/locale/de/is @@ -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', diff --git a/locale/de/oe b/locale/de/oe index 195be07d3..90ea1009c 100644 --- a/locale/de/oe +++ b/locale/de/oe @@ -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',