From: Moritz Bunkus Date: Wed, 4 Apr 2007 14:07:43 +0000 (+0000) Subject: Beim Verschicken von Einkaufs- und Verkaufsbelegen per Email nur dann speichern,... X-Git-Tag: release-2.4.3^2~521 X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/commitdiff_plain/ffea1346a870187033520ea5be4a121574802e7f?ds=inline Beim Verschicken von Einkaufs- und Verkaufsbelegen per Email nur dann speichern, wenn der Beleg noch gar nicht gespeichert war. Dann auch auf geparste/nicht geparste Zahlen achten. Fix für Bug 619. --- diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index e91c47b29..191277636 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1430,12 +1430,14 @@ sub edit_e_mail { sub send_email { $lxdebug->enter_sub(); - $old_form = new Form; + my $callback = $form->{script} . "?action=edit"; + map({ $callback .= "\&${_}=" . E($form->{$_}); } + qw(login password path type id)); - map { $old_form->{$_} = $form->{$_} } keys %$form; - $old_form->{media} = $form->{oldmedia}; + print_form("return"); - &print_form($old_form); + $form->{callback} = $callback; + $form->redirect(); $lxdebug->leave_sub(); } @@ -1944,6 +1946,8 @@ sub print_form { $form->update_status(\%myconfig) if ($form->{media} eq 'queue' && $form->{id}); + return $lxdebug->leave_sub() if ($old_form eq "return"); + if ($old_form) { $old_form->{"${inv}number"} = $form->{"${inv}number"}; diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index ce9e76081..627a51dc4 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -1621,11 +1621,20 @@ sub yes { sub e_mail { $lxdebug->enter_sub(); - $print_post = 1; + if (!$form->{id}) { + $print_post = 1; - &post; + my $saved_form = save_form(); - &edit_e_mail; + post(); + + my %saved_vars; + map({ $saved_vars{$_} = $form->{$_}; } qw(id invnumber)); + restore_form($saved_form); + map({ $form->{$_} = $saved_vars{$_}; } qw(id invnumber)); + } + + edit_e_mail(); $lxdebug->leave_sub(); } diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index a89c06aac..bab0734d6 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -2545,9 +2545,20 @@ sub e_mail { $form->{print_and_save} = 1; - &save; + if (!$form->{id}) { + $print_post = 1; + + my $saved_form = save_form(); + + save(); + + my %saved_vars; + map({ $saved_vars{$_} = $form->{$_}; } qw(id ordnumber quonumber)); + restore_form($saved_form); + map({ $form->{$_} = $saved_vars{$_}; } qw(id ordnumber quonumber)); + } - &edit_e_mail; + edit_e_mail(); $lxdebug->leave_sub(); }