Revision 50e62c57
Von Moritz Bunkus vor fast 14 Jahren hinzugefügt
bin/mozilla/do.pl | ||
---|---|---|
939 | 939 |
'amount_unit' => $all_units->{$form->{"partunit_$i"}}->{base_unit}, |
940 | 940 |
'conv_units' => 'convertible_not_smaller', |
941 | 941 |
'max_places' => 2); |
942 |
$content .= qq| <input type="button" onclick="open_stock_in_out_window('${in_out}', $i);" value="?">|;
|
|
942 |
$content = qq|<span id="stock_in_out_qty_display_${i}">${content}</span> <input type="button" onclick="open_stock_in_out_window('${in_out}', $i);" value="?">|;
|
|
943 | 943 |
|
944 | 944 |
$main::lxdebug->leave_sub(); |
945 | 945 |
|
... | ... | |
1061 | 1061 |
$main::lxdebug->leave_sub(); |
1062 | 1062 |
} |
1063 | 1063 |
|
1064 |
sub _stock_in_out_set_qty_display { |
|
1065 |
my $stock_info = shift; |
|
1066 |
my $form = $::form; |
|
1067 |
my $all_units = AM->retrieve_all_units(); |
|
1068 |
my $sum = AM->sum_with_unit(map { $_->{qty}, $_->{unit} } @{ $stock_info }); |
|
1069 |
$form->{qty_display} = $form->format_amount_units(amount => $sum * 1, |
|
1070 |
part_unit => $form->{partunit}, |
|
1071 |
amount_unit => $all_units->{ $form->{partunit} }->{base_unit}, |
|
1072 |
conv_units => 'convertible_not_smaller', |
|
1073 |
max_places => 2); |
|
1074 |
} |
|
1075 |
|
|
1064 | 1076 |
sub set_stock_in { |
1065 | 1077 |
$main::lxdebug->enter_sub(); |
1066 | 1078 |
|
... | ... | |
1079 | 1091 |
|
1080 | 1092 |
$form->{stock} = YAML::Dump($stock_info); |
1081 | 1093 |
|
1094 |
_stock_in_out_set_qty_display($stock_info); |
|
1095 |
|
|
1082 | 1096 |
$form->header(); |
1083 | 1097 |
print $form->parse_html_template('do/set_stock_in_out'); |
1084 | 1098 |
|
... | ... | |
1172 | 1186 |
stock_in_out_form(); |
1173 | 1187 |
|
1174 | 1188 |
} else { |
1189 |
_stock_in_out_set_qty_display($stock_info); |
|
1190 |
|
|
1175 | 1191 |
$form->header(); |
1176 | 1192 |
print $form->parse_html_template('do/set_stock_in_out'); |
1177 | 1193 |
} |
templates/webpages/do/set_stock_in_out.html | ||
---|---|---|
1 |
[% USE HTML %]<body onload="on_load();"> |
|
1 |
[% USE HTML %] |
|
2 |
[% USE L %] |
|
3 |
[% L.javascript_tag('jquery') %] |
|
4 |
<body onload="on_load();"> |
|
2 | 5 |
|
3 | 6 |
<script type="text/javascript"> |
4 | 7 |
<!-- |
5 | 8 |
function on_load() { |
6 |
var row = document.getElementsByName("row")[0].value; |
|
7 |
var stock = document.getElementsByName("stock")[0].value; |
|
8 |
var in_out = document.getElementsByName("in_out")[0].value; |
|
9 |
|
|
10 |
window.opener.document.getElementsByName("stock_" + in_out + "_" + row)[0].value = stock; |
|
9 |
var row = $('#row').attr('value'); |
|
10 |
window.opener.document.getElementsByName("stock_" + $('#in_out').attr('value') + "_" + row)[0].value = $('#stock').attr('value'); |
|
11 |
$(window.opener.document.getElementById("stock_in_out_qty_display_" + row)).html($('#qty_display').attr('value')); |
|
11 | 12 |
|
12 | 13 |
window.close(); |
13 | 14 |
} |
... | ... | |
15 | 16 |
</script> |
16 | 17 |
|
17 | 18 |
<form name="data"> |
18 |
<input type="hidden" name="row" value="[% HTML.escape(row) %]"> |
|
19 |
<input type="hidden" name="stock" value="[% HTML.escape(stock) %]"> |
|
20 |
<input type="hidden" name="in_out" value="[% HTML.escape(in_out) %]"> |
|
19 |
<input type="hidden" name="row" id="row" value="[% HTML.escape(row) %]"> |
|
20 |
<input type="hidden" name="stock" id="stock" value="[% HTML.escape(stock) %]"> |
|
21 |
<input type="hidden" name="in_out" id="in_out" value="[% HTML.escape(in_out) %]"> |
|
22 |
<input type="hidden" name="qty_display" id="qty_display" value="[% HTML.escape(qty_display) %]"> |
|
21 | 23 |
</form> |
22 | 24 |
|
23 | 25 |
</body> |
Auch abrufbar als: Unified diff
Lieferschein ein- und auslagern: sofort Mengenanzeige in entsprechender Zeile aktualisieren, wenn Popup mit Lagermengen geschlossen wird
Fix für Bug 1400.