From 8a996479a2d9daea50b2ead5426a962145101896 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 11 Jan 2007 14:49:52 +0000 Subject: [PATCH] =?utf8?q?OE->save()=20parst=20verschiedene=20Zahlen.=20Da?= =?utf8?q?s=20ist=20beim=20Umwandeln=20in=20anderen=20Formulartypen=20sehr?= =?utf8?q?=20ung=C3=BCnstig.=20Beim=20Umwandeln=20von=20Angebot=20in=20Auf?= =?utf8?q?trag=20soll=20aber=20nur=20das=20Angebot=20geschlossen=20werden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/OE.pm | 16 ++++++++++++++++ bin/mozilla/oe.pl | 4 +--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/SL/OE.pm b/SL/OE.pm index c5e36654d..460e191a0 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -35,6 +35,7 @@ package OE; use SL::AM; +use SL::DBUtils; sub transactions { $main::lxdebug->enter_sub(); @@ -560,6 +561,21 @@ sub close_orders { $main::lxdebug->leave_sub(); } +sub close_order { + $main::lxdebug->enter_sub(); + + my ($self, $myconfig, $form) = @_; + + $main::lxdebug->leave_sub() unless ($form->{"id"}); + + my $dbh = $form->dbconnect($myconfig); + do_query($form, $dbh, qq|UPDATE oe SET closed = TRUE where ordnumber = ?|, + $form->{"id"}); + $dbh->disconnect; + + $main::lxdebug->leave_sub(); +} + sub delete { $main::lxdebug->enter_sub(); diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 72093443d..e281da720 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -2453,9 +2453,7 @@ sub sales_order { if ( $form->{type} eq 'sales_quotation' || $form->{type} eq 'request_quotation') { - $form->{closed} = 1; - relink_accounts(); - OE->save(\%myconfig, \%$form); + OE->close_order(\%myconfig, $form); } $form->{cp_id} *= 1; -- 2.20.1