X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=0e469d8d3f8dee1c56aff4eaef9bbf630516925d;hb=f9afaad9f88e5cc166bfabb9ec002930c931a6e5;hp=cd04c6b272928b3a6336f5ed3decd27478266f1e;hpb=b2945bf61775161f9ce9be9bdbd106ad44247a14;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index cd04c6b27..0e469d8d3 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -50,7 +50,6 @@ require "bin/mozilla/reportgenerator.pl"; use strict; -my $print_post; our %TMPL_VAR; 1; @@ -865,6 +864,7 @@ sub orders { 'attachment_basename' => $attachment_basename . strftime('_%Y%m%d', localtime time), ); $report->set_options_from_form(); + $locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv'; # add sort and escape callback, this one we use for the add sub $form->{callback} = $href .= "&sort=$form->{sort}"; @@ -1064,7 +1064,7 @@ sub save_and_close { if(!exists $form->{addition}) { $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history @@ -1172,7 +1172,7 @@ sub save { if(!exists $form->{addition}) { $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; $form->{addition} = "SAVED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history @@ -1260,7 +1260,7 @@ sub delete_order_quotation { if(!exists $form->{addition}) { $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; $form->{addition} = "DELETED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history $form->info($msg); @@ -1419,6 +1419,10 @@ sub invoice { } + # show pricegroup in newly loaded invoice when creating invoice from quotation/order + IS->get_pricegroups_for_parts(\%myconfig, \%$form); + set_pricegroup($_) for 1 .. $form->{rowcount}; + &display_form; $main::lxdebug->leave_sub(); @@ -1836,7 +1840,7 @@ sub delivery_order { map { $form->{"${_}_${i}"} = $form->parse_amount(\%myconfig, $form->{"${_}_${i}"}) if ($form->{"${_}_${i}"}) } qw(ship qty sellprice listprice lastcost basefactor discount); } - my %old_values = map { $_ => $form->{$_} } qw(customer_id oldcustomer customer vendor_id oldvendor vendor); + my %old_values = map { $_ => $form->{$_} } qw(customer_id oldcustomer customer vendor_id oldvendor vendor shipto_id); order_links(); @@ -1858,8 +1862,6 @@ sub e_mail { $form->{print_and_save} = 1; - $print_post = 1; - my $saved_form = save_form(); save(); @@ -1899,9 +1901,7 @@ sub display_form { } $form->{"taxaccounts"} = ""; - for my $i (1 .. $form->{"rowcount"}) { - IC->retrieve_accounts(\%myconfig, $form, $form->{"id_$i"}, $i, 1) if $form->{"id_$i"}; - } + IC->retrieve_accounts(\%myconfig, $form, map { $_ => $form->{"id_$_"} } 1 .. $form->{rowcount}); $form->{rowcount}++; $form->{"project_id_$form->{rowcount}"} = $form->{globalproject_id}; @@ -1940,3 +1940,17 @@ sub report_for_todo_list { return $content; } +sub dispatcher { + my $form = $main::form; + my $locale = $main::locale; + + foreach my $action (qw(delete delivery_order e_mail invoice print purchase_order purchase_order quotation + request_for_quotation sales_order sales_order save save_and_close save_as_new ship_to update)) { + if ($form->{"action_${action}"}) { + call_sub($action); + return; + } + } + + $form->error($locale->text('No action defined.')); +}