X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=a56557d41e6ee30f5dd0a750011ebd639ca0b548;hb=00738f6f4e43355ae9e70cd5350d7c75c1533f5f;hp=a70ab237e7a5a3d19c952295bfb46c71b6fb514c;hpb=a53233e56a9d4001b47bcf412b4bfe46910d3117;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index a70ab237e..a56557d41 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -33,6 +33,7 @@ use POSIX qw(strftime); +use SL::DO; use SL::FU; use SL::OE; use SL::IR; @@ -171,11 +172,20 @@ sub edit { set_headings("edit"); &order_links; + + $form->{rowcount} = 0; + foreach $ref (@{ $form->{form_details} }) { + $form->{rowcount}++; + map { $form->{"${_}_$form->{rowcount}"} = $ref->{$_} } keys %{$ref}; + } + &prepare_order; + if ($form->{print_and_save}) { $form->{language_id} = $language_id; $form->{printer_id} = $printer_id; } + &display_form; $lxdebug->leave_sub(); @@ -220,8 +230,11 @@ sub order_links { $form->{employee} = "$form->{employee}--$form->{employee_id}"; # build vendor/customer drop down comatibility... don't ask - $form->{"old$form->{vc}"} = $form->{vc}; - $form->{"select$form->{vc}"} = 1; + if (@{ $form->{"all_$form->{vc}"} }) { + $form->{"select$form->{vc}"} = 1; + $form->{$form->{vc}} = qq|$form->{$form->{vc}}--$form->{"$form->{vc}_id"}|; + } + $form->{"old$form->{vc}"} = $form->{$form->{vc}}; $lxdebug->leave_sub(); } @@ -233,11 +246,6 @@ sub prepare_order { $form->{formname} ||= $form->{type}; - $form->{rowcount} = 0; - foreach $ref (@{ $form->{form_details} }) { - $form->{rowcount}++; - map { $form->{"${_}_$form->{rowcount}"} = $ref->{$_} } keys %{$ref}; - } 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)); @@ -388,7 +396,7 @@ sub form_header { max_dunning_level dunning_amount shiptoname shiptostreet shiptozipcode shiptocity shiptocountry shiptocontact shiptophone shiptofax shiptodepartment_1 shiptodepartment_2 shiptoemail - message email subject cc bcc taxpart taxservice taxaccounts), + message email subject cc bcc taxpart taxservice taxaccounts cursor_fokus), @custom_hiddens, map { $_.'_rate', $_.'_description' } split / /, $form->{taxaccounts} ]; # deleted: discount @@ -1806,11 +1814,12 @@ sub sales_order { delete($form->{ordnumber}); } - $form->{cp_id} *= 1; + $form->{cp_id} *= 1; + $form->{convert_from_oe_ids} = $form->{id}; - $form->{title} = $locale->text('Add Sales Order'); - $form->{vc} = "customer"; - $form->{type} = "sales_order"; + $form->{title} = $locale->text('Add Sales Order'); + $form->{vc} = "customer"; + $form->{type} = "sales_order"; &poso; @@ -1826,30 +1835,29 @@ sub poso { $form->{transdate} = $form->current_date(\%myconfig); delete $form->{duedate}; - $form->{closed} = 0; + $form->{closed} = 0; $form->{old_employee_id} = $form->{employee_id}; $form->{old_salesman_id} = $form->{salesman_id}; # reset - map { delete $form->{$_} } - qw(id subject message cc bcc printed emailed queued customer vendor creditlimit creditremaining discount tradediscount oldinvtotal); + map { delete $form->{$_} } qw(id subject message cc bcc printed emailed queued customer vendor creditlimit creditremaining discount tradediscount oldinvtotal); for $i (1 .. $form->{rowcount}) { - map({ $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, - $form->{"${_}_${i}"}) - if ($form->{"${_}_${i}"}) } - qw(ship qty sellprice listprice basefactor)); + map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if ($form->{"${_}_${i}"}) } qw(ship qty sellprice listprice basefactor); } + my %saved_vars = map { $_ => $form->{$_} } grep { $form->{$_} } qw(currency); + &order_links; + map { $form->{$_} = $saved_vars{$_} } keys %saved_vars; + &prepare_order; # format amounts for $i (1 .. $form->{rowcount} - 1) { - map { $form->{"${_}_$i"} =~ s/\"/"/g } - qw(partnumber description unit); + map { $form->{"${_}_$i"} =~ s/\"/"/g } qw(partnumber description unit); } &update; @@ -1875,17 +1883,16 @@ sub delivery_order { require "bin/mozilla/do.pl"; - $form->{cp_id} *= 1; - $form->{transdate} = $form->current_date(\%myconfig); + $form->{cp_id} *= 1; + $form->{convert_from_oe_ids} = $form->{id}; + $form->{transdate} = $form->current_date(\%myconfig); delete $form->{duedate}; - $form->{closed} = 0; - $form->{old_employee_id} = $form->{employee_id}; $form->{old_salesman_id} = $form->{salesman_id}; # reset - map { delete $form->{$_} } qw(id subject message cc bcc printed emailed queued creditlimit creditremaining discount tradediscount oldinvtotal); + delete @{$form}{qw(id subject message cc bcc printed emailed queued creditlimit creditremaining discount tradediscount oldinvtotal closed delivered)}; for $i (1 .. $form->{rowcount}) { map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if ($form->{"${_}_${i}"}) } qw(ship qty sellprice listprice basefactor);