X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Foe.pl;h=5df518fc7da8df88bc932166cc4e479211bb86fb;hb=59d76a094e83bec189313ca712d945a9594aeb55;hp=3908f74351be408abf9a150aa6ff47d954bfef82;hpb=6669edf8fb3d3e7e917aca49fa9b1e8387b0943a;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 3908f7435..5df518fc7 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1735,13 +1735,14 @@ sub purchase_order { $form->{cp_id} *= 1; + my $source_type = $form->{type}; $form->{title} = $locale->text('Add Purchase Order'); $form->{vc} = "vendor"; $form->{type} = "purchase_order"; $form->get_employee(); - &poso; + poso(source_type => $form->{type}); delete $form->{sales_order_to_purchase_order}; @@ -1763,13 +1764,14 @@ sub sales_order { $form->{cp_id} *= 1; + my $source_type = $form->{type}; $form->{title} = $locale->text('Add Sales Order'); $form->{vc} = "customer"; $form->{type} = "sales_order"; $form->get_employee(); - &poso; + poso(source_type => $source_type); $main::lxdebug->leave_sub(); } @@ -1777,6 +1779,7 @@ sub sales_order { sub poso { $main::lxdebug->enter_sub(); + my %param = @_; my $form = $main::form; my %myconfig = %main::myconfig; @@ -1786,6 +1789,11 @@ sub poso { $form->{transdate} = $form->current_date(\%myconfig); delete $form->{duedate}; + # "reqdate" is the validity date for a quotation and the delivery + # date for an order. Therefore it makes no sense to keep the value + # when converting from one into the other. + delete $form->{reqdate} if ($param{source_type} =~ /_quotation$/) == ($form->{type} =~ /_quotation$/); + $form->{convert_from_oe_ids} = $form->{id}; $form->{closed} = 0;