X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=1fc3fe3d653fd939046486a0930875c7e7903392;hb=4f63ea874f629459e1a73643595ab5e23e38e7f0;hp=eb0916fc4690b1fbb5f9689684017e01bab5ce8e;hpb=96d3ef850a6170a3cbada36eb7f375ef99efe373;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index eb0916fc4..1fc3fe3d6 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -248,9 +248,12 @@ sub prepare_order { $form->{formname} ||= $form->{type}; + # format discounts if values come from db. either as single id, or as a collective order + my $format_discounts = $form->{id} || $form->{convert_from_oe_ids}; + for my $i (1 .. $form->{rowcount}) { $form->{"reqdate_$i"} ||= $form->{"deliverydate_$i"}; - $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"discount_$i"} * ($form->{id} ? 100 : 1)); + $form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"discount_$i"} * ($format_discounts ? 100 : 1)); $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}); $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); }