From 50e62c5790434d450a11a01bbdebe293966c3c5a Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 27 Dec 2010 17:11:12 +0100 Subject: [PATCH] Lieferschein ein- und auslagern: sofort Mengenanzeige in entsprechender Zeile aktualisieren, wenn Popup mit Lagermengen geschlossen wird MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix für Bug 1400. --- bin/mozilla/do.pl | 18 +++++++++++++++++- templates/webpages/do/set_stock_in_out.html | 20 +++++++++++--------- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index cde1c602e..2b1bdd948 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -939,7 +939,7 @@ sub calculate_stock_in_out { 'amount_unit' => $all_units->{$form->{"partunit_$i"}}->{base_unit}, 'conv_units' => 'convertible_not_smaller', 'max_places' => 2); - $content .= qq| |; + $content = qq|${content} |; $main::lxdebug->leave_sub(); @@ -1061,6 +1061,18 @@ sub display_stock_in_form { $main::lxdebug->leave_sub(); } +sub _stock_in_out_set_qty_display { + my $stock_info = shift; + my $form = $::form; + my $all_units = AM->retrieve_all_units(); + my $sum = AM->sum_with_unit(map { $_->{qty}, $_->{unit} } @{ $stock_info }); + $form->{qty_display} = $form->format_amount_units(amount => $sum * 1, + part_unit => $form->{partunit}, + amount_unit => $all_units->{ $form->{partunit} }->{base_unit}, + conv_units => 'convertible_not_smaller', + max_places => 2); +} + sub set_stock_in { $main::lxdebug->enter_sub(); @@ -1079,6 +1091,8 @@ sub set_stock_in { $form->{stock} = YAML::Dump($stock_info); + _stock_in_out_set_qty_display($stock_info); + $form->header(); print $form->parse_html_template('do/set_stock_in_out'); @@ -1172,6 +1186,8 @@ sub set_stock_out { stock_in_out_form(); } else { + _stock_in_out_set_qty_display($stock_info); + $form->header(); print $form->parse_html_template('do/set_stock_in_out'); } diff --git a/templates/webpages/do/set_stock_in_out.html b/templates/webpages/do/set_stock_in_out.html index 36bbf7ff0..07e084d4d 100644 --- a/templates/webpages/do/set_stock_in_out.html +++ b/templates/webpages/do/set_stock_in_out.html @@ -1,13 +1,14 @@ -[% USE HTML %] +[% USE HTML %] +[% USE L %] +[% L.javascript_tag('jquery') %] +
- - - + + + +
-- 2.20.1