218 |
218 |
|
219 |
219 |
# special alignings
|
220 |
220 |
my %align = map { $_ => 'right' } qw(qty ship right discount linetotal stock_in_out weight ship_missing);
|
221 |
|
my %nowrap = map { $_ => 1 } qw(description unit);
|
|
221 |
my %nowrap = map { $_ => 1 } qw(description unit price_source);
|
222 |
222 |
|
223 |
223 |
$form->{marge_total} = 0;
|
224 |
224 |
$form->{sellprice_total} = 0;
|
... | ... | |
336 |
336 |
$column_data{ship_missing} = $form->format_amount(\%myconfig, $ship_missing_qty) . ' ' . $form->{"unit_$i"} . '; ' . $form->format_amount(\%myconfig, $ship_missing_amount, $decimalplaces);
|
337 |
337 |
}
|
338 |
338 |
|
339 |
|
my $sellprice_value = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
|
340 |
|
my $discount_value = $form->format_amount(\%myconfig, $form->{"discount_$i"});
|
341 |
|
my $edit_prices = $main::auth->assert('edit_prices', 1) && !$::form->{"active_price_source_$i"};
|
342 |
|
my $edit_discounts = $main::auth->assert('edit_prices', 1) && !$::form->{"active_discount_source_$i"};
|
343 |
|
$column_data{sellprice} = (!$edit_prices)
|
344 |
|
? $cgi->hidden( -name => "sellprice_$i", -id => "sellprice_$i", -value => $sellprice_value) . $sellprice_value
|
345 |
|
: $cgi->textfield(-name => "sellprice_$i", -id => "sellprice_$i", -size => 10, -onBlur => "check_right_number_format(this)", -value => $sellprice_value);
|
346 |
|
$column_data{discount} = (!$edit_discounts)
|
347 |
|
? $cgi->hidden( -name => "discount_$i", -id => "discount_$i", -value => $discount_value) . $discount_value . ' %'
|
348 |
|
: $cgi->textfield(-name => "discount_$i", -id => "discount_$i", -size => 3, -value => $discount_value);
|
349 |
339 |
$column_data{linetotal} = $form->format_amount(\%myconfig, $linetotal, 2);
|
350 |
340 |
$column_data{bin} = $form->{"bin_$i"};
|
351 |
341 |
|
352 |
342 |
$column_data{weight} = $form->format_amount(\%myconfig, $form->{"qty_$i"} * $form->{"weight_$i"}, 3) . ' ' . $defaults->{weightunit} if $defaults->{show_weight};
|
353 |
343 |
|
|
344 |
my $sellprice_value = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
|
|
345 |
my $discount_value = $form->format_amount(\%myconfig, $form->{"discount_$i"});
|
|
346 |
|
|
347 |
my $price;
|
354 |
348 |
if ($form->{"id_${i}"} && !$is_delivery_order) {
|
355 |
349 |
my $price_source = SL::PriceSource->new(record_item => $record_item, record => $record);
|
356 |
|
my $price = $price_source->price_from_source($::form->{"active_price_source_$i"});
|
|
350 |
$price = $price_source->price_from_source($::form->{"active_price_source_$i"});
|
357 |
351 |
my $discount = $price_source->discount_from_source($::form->{"active_discount_source_$i"});
|
358 |
352 |
my $best_price = $price_source->best_price;
|
359 |
353 |
my $best_discount = $price_source->best_discount;
|
... | ... | |
378 |
372 |
}
|
379 |
373 |
}
|
380 |
374 |
|
|
375 |
my $edit_prices = $main::auth->assert('edit_prices', 1) && (!$::form->{"active_price_source_$i"} || !$price || $price->editable);
|
|
376 |
my $edit_discounts = $main::auth->assert('edit_prices', 1) && !$::form->{"active_discount_source_$i"};
|
|
377 |
$column_data{sellprice} = (!$edit_prices)
|
|
378 |
? $cgi->hidden( -name => "sellprice_$i", -id => "sellprice_$i", -value => $sellprice_value) . $sellprice_value
|
|
379 |
: $cgi->textfield(-name => "sellprice_$i", -id => "sellprice_$i", -size => 10, -onBlur => "check_right_number_format(this)", -value => $sellprice_value);
|
|
380 |
$column_data{discount} = (!$edit_discounts)
|
|
381 |
? $cgi->hidden( -name => "discount_$i", -id => "discount_$i", -value => $discount_value) . $discount_value . ' %'
|
|
382 |
: $cgi->textfield(-name => "discount_$i", -id => "discount_$i", -size => 3, -value => $discount_value);
|
|
383 |
|
381 |
384 |
if ($is_delivery_order) {
|
382 |
385 |
$column_data{stock_in_out} = calculate_stock_in_out($i);
|
383 |
386 |
}
|
Preisquellen: Support für editierbare Preisquellen