X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fio.pl;h=cdf43d3392afd4db84f34f5bb4c0794a0fc5a6e0;hb=fdf5b8ae58b69b3a96a2255128e0524323d18cd7;hp=f77a5f76e6d45d3be09a101c2da9a2c33d2aac67;hpb=32421f9a8030b57a5713b992e55e9cba609493a9;p=kivitendo-erp.git diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index f77a5f76e..cdf43d339 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -57,7 +57,7 @@ use SL::DB::Language; use SL::DB::Printer; use SL::DB::Vendor; use SL::Helper::CreatePDF; -use SL::Helper::Flash; +use SL::Helper::Flash qw(flash); require "bin/mozilla/common.pl"; @@ -319,7 +319,8 @@ sub display_row { $ship_qty *= $all_units->{$form->{"partunit_$i"}}->{factor}; $ship_qty /= ( $all_units->{$form->{"unit_$i"}}->{factor} || 1 ); - $column_data{ship} = $form->format_amount(\%myconfig, $form->round_amount($ship_qty, 2) * 1) . ' ' . $form->{"unit_$i"}; + $column_data{ship} = $form->format_amount(\%myconfig, $form->round_amount($ship_qty, 2) * 1) . ' ' . $form->{"unit_$i"} + . $cgi->hidden(-name => "ship_$i", -value => $form->format_amount(\%myconfig, $form->{"ship_$i"}, $qty_dec)); my $ship_missing_qty = $form->{"qty_$i"} - $ship_qty; my $ship_missing_amount = $form->round_amount($ship_missing_qty * $form->{"sellprice_$i"} * (100 - $form->{"discount_$i"}) / 100 / $price_factor, 2); @@ -1058,6 +1059,7 @@ sub edit_e_mail { a_filename => $attachment_filename, subject => $subject, print_options => print_options('inline' => 1), + action => 'send_email', HIDDEN => [ map +{ name => $_, value => $form->{$_} }, @hidden_keys ], SHOW_BCC => $::auth->assert('email_bcc', 'may fail') }); @@ -1770,36 +1772,21 @@ sub _update_ship { my $all_units = AM->retrieve_all_units(); - my %ship = DO->get_shipped_qty('type' => ($form->{type} eq 'purchase_order') ? 'purchase' : 'sales', - 'oe_id' => $form->{id},); + my %ship = DO->get_shipped_qty('oe_id' => $form->{id}); foreach my $i (1..$form->{rowcount}) { next unless ($form->{"id_${i}"}); $form->{"ship_$i"} = 0; - my $ship_entry = $ship{$form->{"id_$i"}}; + my $ship_entry = $ship{$i}; - next if (!$ship_entry || ($ship_entry->{qty} <= 0)); + next if (!$ship_entry || ($ship_entry->{qty_ordered} <= 0)); - my $rowqty = - ($form->{simple_save} ? $form->{"qty_$i"} : $form->parse_amount(\%myconfig, $form->{"qty_$i"})) - * $all_units->{$form->{"unit_$i"}}->{factor} - / $all_units->{$form->{"partunit_$i"}}->{factor}; - - $form->{"ship_$i"} = min($rowqty, $ship_entry->{qty}); - $ship_entry->{qty} -= $form->{"ship_$i"}; - } - - foreach my $i (1..$form->{rowcount}) { - next unless ($form->{"id_${i}"}); - - my $ship_entry = $ship{$form->{"id_$i"}}; - - next if (!$ship_entry || ($ship_entry->{qty} <= 0.01)); - - $form->{"ship_$i"} += $ship_entry->{qty}; - $ship_entry->{qty} = 0; + my $rowqty = $ship_entry->{qty_ordered} - $ship_entry->{qty_notdelivered}; + $rowqty *= $all_units->{$form->{"unit_$i"}}->{factor} / + $all_units->{$form->{"partunit_$i"}}->{factor} if !$form->{simple_save}; + $form->{"ship_$i"} = $rowqty; } $main::lxdebug->leave_sub();