Revision a7ecfa38
Von Niclas Zimmermann vor mehr als 11 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
141 | 141 |
} |
142 | 142 |
|
143 | 143 |
# column_index |
144 |
my @header_sort = qw(runningnumber partnumber description ship qty unit sellprice_pg sellprice discount linetotal); |
|
144 |
my @header_sort = qw(runningnumber partnumber description ship qty unit weight sellprice_pg sellprice discount linetotal);
|
|
145 | 145 |
my @HEADER = ( |
146 | 146 |
{ id => 'runningnumber', width => 5, value => $locale->text('No.'), display => 1, }, |
147 | 147 |
{ id => 'partnumber', width => 8, value => $locale->text('Number'), display => 1, }, |
... | ... | |
150 | 150 |
{ id => 'qty', width => 5, value => $locale->text('Qty'), display => 1, }, |
151 | 151 |
{ id => 'price_factor', width => 5, value => $locale->text('Price Factor'), display => !$is_delivery_order, }, |
152 | 152 |
{ id => 'unit', width => 5, value => $locale->text('Unit'), display => 1, }, |
153 |
{ id => 'weight', width => 5, value => $locale->text('Weight'), display => 1, }, |
|
153 | 154 |
{ id => 'serialnr', width => 10, value => $locale->text('Serial No.'), display => 0, }, |
154 | 155 |
{ id => 'projectnr', width => 10, value => $locale->text('Project'), display => 0, }, |
155 | 156 |
{ id => 'sellprice', width => 15, value => $locale->text('Price'), display => !$is_delivery_order, }, |
... | ... | |
187 | 188 |
my $deliverydate = $locale->text('Required by'); |
188 | 189 |
|
189 | 190 |
# special alignings |
190 |
my %align = map { $_ => 'right' } qw(qty ship right sellprice_pg discount linetotal stock_in_out); |
|
191 |
my %align = map { $_ => 'right' } qw(qty ship right sellprice_pg discount linetotal stock_in_out weight);
|
|
191 | 192 |
my %nowrap = map { $_ => 1 } qw(description unit); |
192 | 193 |
|
193 | 194 |
$form->{marge_total} = 0; |
194 | 195 |
$form->{sellprice_total} = 0; |
195 | 196 |
$form->{lastcost_total} = 0; |
197 |
$form->{totalweight} = 0; |
|
196 | 198 |
my %projectnumber_labels = (); |
197 | 199 |
my @projectnumber_values = (""); |
198 | 200 |
|
... | ... | |
205 | 207 |
_update_ship() if ($is_s_p_order); |
206 | 208 |
_update_custom_variables(); |
207 | 209 |
|
210 |
my $totalweight = 0; |
|
211 |
my $defaults = AM->get_defaults(); |
|
208 | 212 |
# rows |
209 | 213 |
|
210 | 214 |
my @ROWS; |
... | ... | |
228 | 232 |
if ((!$form->{"prices_$i"}) || ($form->{"new_pricegroup_$i"} == $form->{"old_pricegroup_$i"})) { |
229 | 233 |
$form->{"sellprice_$i"} *= AM->convert_unit($form->{"selected_unit_$i"}, $form->{"unit_old_$i"}, $all_units) || 1; |
230 | 234 |
$form->{"lastcost_$i"} *= AM->convert_unit($form->{"selected_unit_$i"}, $form->{"unit_old_$i"}, $all_units) || 1; |
235 |
$form->{"weight_$i"} *= AM->convert_unit($form->{"selected_unit_$i"}, $form->{"unit_old_$i"}, $all_units) || 1; |
|
231 | 236 |
$form->{"unit_old_$i"} = $form->{"selected_unit_$i"}; |
232 | 237 |
} |
233 | 238 |
my $this_unit = $form->{"unit_$i"}; |
... | ... | |
325 | 330 |
$column_data{linetotal} = $form->format_amount(\%myconfig, $linetotal, 2); |
326 | 331 |
$column_data{bin} = $form->{"bin_$i"}; |
327 | 332 |
|
333 |
$column_data{weight} = $form->format_amount(\%myconfig, $form->{"qty_$i"} * $form->{"weight_$i"}, 3) . ' ' . $defaults->{weightunit}; |
|
334 |
|
|
328 | 335 |
if ($is_delivery_order) { |
329 | 336 |
$column_data{stock_in_out} = calculate_stock_in_out($i); |
330 | 337 |
} |
... | ... | |
389 | 396 |
if $form->{"id_$i"} && ($form->{type} =~ /^sales_/ || $form->{type} =~ /invoice/) ; |
390 | 397 |
# / marge calculations ending |
391 | 398 |
|
399 |
# Calculate total weight |
|
400 |
$totalweight += ($form->{"qty_$i"} * $form->{"weight_$i"}); |
|
401 |
|
|
392 | 402 |
# calculate onhand |
393 | 403 |
if ($form->{"id_$i"}) { |
394 | 404 |
my $part = IC->get_basic_part_info(id => $form->{"id_$i"}); |
... | ... | |
416 | 426 |
map { ($cgi->hidden("-name" => $_, "-value" => $form->{$_})); } map { $_."_$i" } |
417 | 427 |
(qw(orderitems_id bo pricegroup_old price_old id inventory_accno bin partsgroup partnotes |
418 | 428 |
income_accno expense_accno listprice assembly taxaccounts ordnumber transdate cusordnumber |
419 |
longdescription basefactor marge_absolut marge_percent marge_price_factor), @hidden_vars) |
|
429 |
longdescription basefactor marge_absolut marge_percent marge_price_factor weight), @hidden_vars)
|
|
420 | 430 |
); |
421 | 431 |
|
422 | 432 |
map { $form->{"${_}_base"} += $linetotal } (split(/ /, $form->{"taxaccounts_$i"})); |
... | ... | |
429 | 439 |
push @ROWS, { ROW1 => \@ROW1, ROW2 => \@ROW2, HIDDENS => \@HIDDENS, colspan => $colspan, error => $form->{"row_error_$i"}, }; |
430 | 440 |
} |
431 | 441 |
|
442 |
$form->{totalweight} = $totalweight; |
|
443 |
|
|
432 | 444 |
print $form->parse_html_template('oe/sales_order', { ROWS => \@ROWS, |
433 | 445 |
HEADER => \@HEADER, |
434 | 446 |
}); |
... | ... | |
1789 | 1801 |
|
1790 | 1802 |
my $info = $form->{PART_INFORMATION}->{$form->{"id_${i}"}} || { }; |
1791 | 1803 |
$form->{"partunit_${i}"} = $info->{unit}; |
1804 |
$form->{"weight_$i"} = $info->{weight}; |
|
1792 | 1805 |
} |
1793 | 1806 |
|
1794 | 1807 |
$main::lxdebug->leave_sub(); |
Auch abrufbar als: Unified diff
Grundstein für Gewicht in Auftrag/Lieferschein/Rechnung
In allen VK- und EK-Masken soll bald auch das Gewicht angezeigt
werden. Grundsätzlich ist das mit diesem Commit schon für alle
VK-Masken möglich, allerdings sind noch kleine Verbesserungen nötig.