X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Foe.pl;h=7aa3f2eb28a1da3334ba1ffb9aa6fe15bd872072;hb=bbc9fa5eef6ad9cfadb370029cab8429fb82de88;hp=b16352fd6f66f74345c2c6fad4c8d61a888c7d8d;hpb=8c99664a860b4aeef74c2311121134e8f01a69e2;p=kivitendo-erp.git
diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl
index b16352fd6..7aa3f2eb2 100644
--- a/bin/mozilla/oe.pl
+++ b/bin/mozilla/oe.pl
@@ -30,6 +30,7 @@
# Order entry module
# Quotation module
#======================================================================
+use Data::Dumper;
use SL::OE;
use SL::IR;
@@ -79,8 +80,9 @@ sub edit {
# editing without stuff to edit? try adding it first
if ($form->{rowcount}) {
- map {$id++ if $form->{"id_$_"}} (1 .. $form->{rowcount});
+ map { $id++ if $form->{"id_$_"} } (1 .. $form->{rowcount});
if (!$id) {
+
# reset rowcount
undef $form->{rowcount};
&add;
@@ -131,18 +133,24 @@ sub order_links {
# retrieve order/quotation
$form->{webdav} = $webdav;
-
# set jscalendar
$form->{jscalendar} = $jscalendar;
OE->retrieve(\%myconfig, \%$form);
# if multiple rowcounts (== collective order) then check if the
- # there were more than one customer (in that case OE::retrieve removes
+ # there were more than one customer (in that case OE::retrieve removes
# the content from the field)
- if ($form->{rowcount} && $form->{type} eq 'sales_order' && defined $form->{customer} && $form->{customer} eq '') {
-# $main::lxdebug->message(0, "Detected Edit order with concurrent customers");
- $form->error($locale->text('Collective Orders only work for orders from one customer!'));
+ if ( $form->{rowcount}
+ && $form->{type} eq 'sales_order'
+ && defined $form->{customer}
+ && $form->{customer} eq '') {
+
+ # $main::lxdebug->message(0, "Detected Edit order with concurrent customers");
+ $form->error(
+ $locale->text(
+ 'Collective Orders only work for orders from one customer!')
+ );
}
$taxincluded = $form->{taxincluded};
@@ -160,9 +168,21 @@ sub order_links {
# get customer / vendor
if ($form->{type} =~ /(purchase_order|request_quotation|receive_order)/) {
IR->get_vendor(\%myconfig, \%$form);
+
+ #quote all_vendor Bug 133
+ foreach $ref (@{ $form->{all_vendor} }) {
+ $ref->{name} = $form->quote($ref->{name});
+ }
+
}
if ($form->{type} =~ /(sales|ship)_(order|quotation)/) {
IS->get_customer(\%myconfig, \%$form);
+
+ #quote all_vendor Bug 133
+ foreach $ref (@{ $form->{all_customer} }) {
+ $ref->{name} = $form->quote($ref->{name});
+ }
+
}
$form->{cp_id} = $cp_id;
@@ -221,38 +241,42 @@ sub prepare_order {
$form->{media} = "screen";
$form->{formname} = $form->{type};
- map { $form->{$_} =~ s/\"/"/g }
- qw(ordnumber quonumber shippingpoint shipvia notes intnotes shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact);
+ map { $form->{$_} =~ s/\"/"/g }
+ qw(ordnumber quonumber shippingpoint shipvia notes intnotes shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact);
- foreach $ref (@{ $form->{form_details} }) {
- $form->{rowcount} = ++$i;
+ foreach $ref (@{ $form->{form_details} }) {
+ $form->{rowcount} = ++$i;
- map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
- }
-
- for my $i (1 .. $form->{rowcount}) {
- if ($form->{id}) {
- $form->{"discount_$i"} =
- $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
- }
- ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
- $dec = length $dec;
- $decimalplaces = ($dec > 2) ? $dec : 2;
-
- # copy reqdate from deliverydate for invoice -> order conversion
- $form->{"reqdate_$i"} = $form->{"deliverydate_$i"} unless $form->{"reqdate_$i"};
-
- $form->{"sellprice_$i"} =
- $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
- $decimalplaces);
-
- (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/);
- $dec_qty = length $dec_qty;
- $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
-
- map { $form->{"${_}_$i"} =~ s/\"/"/g }
- qw(partnumber description unit);
+ map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
+ }
+ for my $i (1 .. $form->{rowcount}) {
+ if ($form->{id}) {
+ $form->{"discount_$i"} =
+ $form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
+ } else {
+ $form->{"discount_$i"} =
+ $form->format_amount(\%myconfig, $form->{"discount_$i"});
}
+ ($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
+ $dec = length $dec;
+ $decimalplaces = ($dec > 2) ? $dec : 2;
+
+ # copy reqdate from deliverydate for invoice -> order conversion
+ $form->{"reqdate_$i"} = $form->{"deliverydate_$i"}
+ unless $form->{"reqdate_$i"};
+
+ $form->{"sellprice_$i"} =
+ $form->format_amount(\%myconfig, $form->{"sellprice_$i"},
+ $decimalplaces);
+
+ (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/);
+ $dec_qty = length $dec_qty;
+ $form->{"qty_$i"} =
+ $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
+
+ map { $form->{"${_}_$i"} =~ s/\"/"/g }
+ qw(partnumber description unit);
+ }
$lxdebug->leave_sub();
}
@@ -319,6 +343,9 @@ sub form_header {
s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
}
+ #quote select[customer|vendor] Bug 133
+ $form->{"select$form->{vc}"} = $form->quote($form->{"select$form->{vc}"});
+
#build contacts
if ($form->{all_contacts}) {
@@ -832,10 +859,15 @@ Bearbeiten des $form->{heading}
. $locale->text('Save as new') . qq|">
|;
- if ($form->{type} =~ /quotation$/) {
+ if ($form->{type} =~ /sales_quotation$/) {
print qq|
|;
+ . $locale->text('Sales Order') . qq|">|;
+ }
+ if ($form->{type} =~ /request_quotation$/) {
+ print qq|
+|;
}
print qq|
|;
}
-
if ($form->{menubar}) {
require "$form->{path}/menu.pl";
@@ -976,6 +1007,7 @@ sub update {
} else {
$form->{"sellprice_$i"} *= (1 - $form->{tradediscount});
+
# if there is an exchange rate adjust sellprice
$form->{"sellprice_$i"} /= $exchangerate;
}
@@ -1029,7 +1061,6 @@ sub update {
}
}
-
$lxdebug->leave_sub();
}
@@ -1508,7 +1539,8 @@ sub orders {
$subtotalnetamount += $oe->{netamount};
$subtotalamount += $oe->{amount};
- $column_data{ids} = qq|