From 061105807cbfb5b86b804e71db9509c996c93912 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 9 Jan 2012 18:31:56 +0100 Subject: [PATCH] =?utf8?q?Lieferscheine=20einlagern/auslagern=20fragt=20je?= =?utf8?q?tzt=20nach,=20wenn=20die=20Menge=20nicht=20mit=20der=20angegeben?= =?utf8?q?=20=C3=BCbereinstimmt.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Zu Bug 1717. --- bin/mozilla/do.pl | 18 ++++++++++++++--- locale/de/all | 1 + templates/webpages/do/form_footer.html | 22 ++++++++++++++++++--- templates/webpages/do/set_stock_in_out.html | 1 + 4 files changed, 36 insertions(+), 6 deletions(-) diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 7924b05a2..cc04f5789 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -984,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(); @@ -1146,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(); } @@ -1241,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(); diff --git a/locale/de/all b/locale/de/all index 971c2ac4c..db410c758 100644 --- a/locale/de/all +++ b/locale/de/all @@ -1878,6 +1878,7 @@ $self->{texts} = { 'There are no items in stock.' => 'Dieser Artikel ist nicht eingelagert.', 'There are no items on your TODO list at the moment.' => 'Ihre Aufgabenliste enthält momentan keine Einträge.', 'There are still entries in the database for which no unit has been assigned.' => 'Es gibt noch Einträge in der Datenbank, für die keine Einheit zugeordnet ist.', + 'There are still transfers not matching the qty of the delivery order. Stock operations can not be changed later. Do you really want to proceed?' => 'Einige der Lagerbewegungen sind nicht vollständig und Lagerbewegungen können nachträglich nicht mehr verändert werden. Wollen Sie wirklich fortfahren?', 'There are usually three ways to install Perl modules.' => 'Es gibt normalerweise drei Arten, ein Perlmodul zu installieren.', 'There is at least one sales or purchase invoice for which Lx-Office recorded an inventory transaction with taxkeys even though no tax was recorded.' => 'Es gibt mindestens eine Einkaufs- oder Verkaufsrechnung, für die Lx-Office einen Steuerschlüssel ungleich 0 verzeichnet hat, obwohl für Warenbestandsbuchugen bei Rechnungen nie Steuern gebucht werden.', 'There is at least one transaction for which the user has chosen a logically wrong taxkey.' => 'Es gibt mindestens eine Buchung, bei der ein logisch nicht passender Steuerschlüssel ausgewählt wurde.', diff --git a/templates/webpages/do/form_footer.html b/templates/webpages/do/form_footer.html index b81ce8cfe..a6a51299e 100644 --- a/templates/webpages/do/form_footer.html +++ b/templates/webpages/do/form_footer.html @@ -68,9 +68,9 @@ [%- UNLESS delivered %] [%- IF vc == 'customer' %] - + [%- ELSE %] - + [%- END %] [%- END %] [%- IF id %] @@ -96,6 +96,22 @@ - + diff --git a/templates/webpages/do/set_stock_in_out.html b/templates/webpages/do/set_stock_in_out.html index 07e084d4d..811059444 100644 --- a/templates/webpages/do/set_stock_in_out.html +++ b/templates/webpages/do/set_stock_in_out.html @@ -9,6 +9,7 @@ var row = $('#row').attr('value'); window.opener.document.getElementsByName("stock_" + $('#in_out').attr('value') + "_" + row)[0].value = $('#stock').attr('value'); $(window.opener.document.getElementById("stock_in_out_qty_display_" + row)).html($('#qty_display').attr('value')); + $(window.opener.document.getElementById("stock_in_out_qty_matches_" + row)).val([% qty_matches %]); window.close(); } -- 2.20.1