From 5cbbffe250f165212c31f4dbfad8ca9fd7300a4a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Stephan=20K=C3=B6hler?= Date: Mon, 12 Dec 2005 16:04:55 +0000 Subject: [PATCH] Merge von 684, 686-689 aus unstable: Sammelauftraege r684 - Umwandeln eines Sammelauftrags in eine Rechnung ignoriert Nachkommastellen r686 - Sammelbestellungen koennen nur aus Auftraegen generiert werden r687 - Noch ein paar Formatierungsfehler bei Umwandlung von Sammelbestellung in Rechnung r688 - Bereitstellen der Variablen transdate_$i und ordnumber_$i von Sammelbestellungen fuer die Druckausgabe r689 - Variablen fuer Druck bei Sammelrechnungen umbenannt von ordnumber und transdate nach ordnumber_oe und transdate_oe wg. Namenskollision --- SL/IS.pm | 2 ++ SL/OE.pm | 19 +++++++++++++++++++ bin/mozilla/io.pl | 3 ++- bin/mozilla/oe.pl | 4 ++-- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/SL/IS.pm b/SL/IS.pm index 8643eaef2..6043323e1 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -110,6 +110,8 @@ sub invoice_details { push(@{ $form->{deliverydate} }, qq|$form->{"deliverydate_$i"}|); push(@{ $form->{sellprice} }, $form->{"sellprice_$i"}); + push(@{ $form->{ordnumber_oe} }, qq|$form->{"ordnumber_$i"}|); + push(@{ $form->{transdate_oe} }, qq|$form->{"transdate_$i"}|); if ($form->{lizenzen}) { if ($form->{"licensenumber_$i"}) { diff --git a/SL/OE.pm b/SL/OE.pm index 4c65c0545..4abdac0f9 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -467,6 +467,25 @@ sub close_orders { my ($self, $myconfig ,$form) = @_; + for my $i (1 .. $form->{rowcount}) { + + map { + $form->{"${_}_$i"} = $form->parse_amount($myconfig, $form->{"${_}_$i"}) + } qw(qty ship); + if ($delete_oe_id) { + $form->{"orderitems_id_$i"} = ""; + } + + if ($form->{"qty_$i"}) { + + # set values to 0 if nothing entered + $form->{"discount_$i"} = + $form->parse_amount($myconfig, $form->{"discount_$i"}); + + $form->{"sellprice_$i"} = + $form->parse_amount($myconfig, $form->{"sellprice_$i"}); + } + } # get ids from $form map { push @ids, $form->{"ordnumber_$_"} if $form->{"ordnumber_$_"} } (1 .. $form->{rowcount}); diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index d4eabdf79..1a2a9c335 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1546,7 +1546,8 @@ sub print_form { push @a, ("partnumber_$i", "description_$i", "partsgroup_$i", "serialnumber_$i", - "bin_$i", "unit_$i"); + "bin_$i", "unit_$i", + "transdate_$i", "ordnumber_$i"); } map { push @a, "${_}_description" } split / /, $form->{taxaccounts}; diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index dbb74a9f9..b4760b284 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1833,10 +1833,10 @@ sub invoice { # close orders/quotations $form->{closed} = 1; - # save order iff one ordnumber has been given + # save order if one ordnumber has been given # if not it's most likely a collective order, which can't be saved back # so they just have to be closed - if ($form->{ordnumber} ne '') { + if (($form->{ordnumber} ne '') || ($form->{quonumber} ne '')) { OE->save(\%myconfig, \%$form); } else { OE->close_orders(\%myconfig, \%$form); -- 2.20.1