X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fdo.pl;h=cc04f5789336cf30678594d476e0ba46019ba3f2;hb=7b01d81091fcd5e005a313a51e3c496e9d7d779d;hp=b9cfc02ab6a804486ab5a84f0e0b492d74d6fe68;hpb=9f522077cdc739cbb17564f76e31e9b7ce7ab4f1;p=kivitendo-erp.git
diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl
index b9cfc02ab..cc04f5789 100644
--- a/bin/mozilla/do.pl
+++ b/bin/mozilla/do.pl
@@ -364,10 +364,13 @@ sub update_delivery_order {
} else {
+ my $mode;
if ($form->{type} eq 'purchase_delivery_order') {
IR->retrieve_item(\%myconfig, $form);
+ $mode = 'IR';
} else {
IS->retrieve_item(\%myconfig, $form);
+ $mode = 'IS';
}
my $rows = scalar @{ $form->{item_list} };
@@ -377,7 +380,7 @@ sub update_delivery_order {
if ($rows > 1) {
- select_item();
+ select_item(mode => $mode);
::end_of_request();
} else {
@@ -451,7 +454,7 @@ sub orders {
my $form = $main::form;
my %myconfig = %main::myconfig;
my $locale = $main::locale;
- my $cgi = $main::cgi;
+ my $cgi = $::request->{cgi};
($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) = split(/--/, $form->{ $form->{vc} });
@@ -883,7 +886,7 @@ sub invoice_multi {
$vc_discount = $form->{vendor_discount};
} else {
IS->get_customer(\%myconfig, \%$form);
- $vc_discount = $form->parse_amount(\%myconfig, $form->{customer_discount});
+ $vc_discount = $form->{customer_discount};
}
restore_form($saved_form);
@@ -981,14 +984,16 @@ sub calculate_stock_in_out {
my $in_out = $form->{type} =~ /^sales/ ? 'out' : 'in';
my $sinfo = DO->unpack_stock_information('packed' => $form->{"stock_${in_out}_${i}"});
+ my $do_qty = AM->sum_with_unit($::form->{"qty_$i"}, $::form->{"unit_$i"});
my $sum = AM->sum_with_unit(map { $_->{qty}, $_->{unit} } @{ $sinfo });
+ my $matches = $do_qty == $sum;
my $content = $form->format_amount_units('amount' => $sum * 1,
'part_unit' => $form->{"partunit_$i"},
'amount_unit' => $all_units->{$form->{"partunit_$i"}}->{base_unit},
'conv_units' => 'convertible_not_smaller',
'max_places' => 2);
- $content = qq|${content} |;
+ $content = qq|${content} |;
$main::lxdebug->leave_sub();
@@ -1143,8 +1148,13 @@ sub set_stock_in {
_stock_in_out_set_qty_display($stock_info);
+ my $do_qty = AM->sum_with_unit($::form->parse_amount(\%::myconfig, $::form->{do_qty}), $::form->{do_unit});
+ my $transfer_qty = AM->sum_with_unit(map { $_->{qty}, $_->{unit} } @{ $stock_info });
+
$form->header();
- print $form->parse_html_template('do/set_stock_in_out');
+ print $form->parse_html_template('do/set_stock_in_out', {
+ qty_matches => $do_qty == $transfer_qty,
+ });
$main::lxdebug->leave_sub();
}
@@ -1238,8 +1248,13 @@ sub set_stock_out {
} else {
_stock_in_out_set_qty_display($stock_info);
+ my $do_qty = AM->sum_with_unit($::form->parse_amount(\%::myconfig, $::form->{do_qty}), $::form->{do_unit});
+ my $transfer_qty = AM->sum_with_unit(map { $_->{qty}, $_->{unit} } @{ $stock_info });
+
$form->header();
- print $form->parse_html_template('do/set_stock_in_out');
+ print $form->parse_html_template('do/set_stock_in_out', {
+ qty_matches => $do_qty == $transfer_qty,
+ });
}
$main::lxdebug->leave_sub();