Revision 9439c4f2
Von Hans Peter Schlaepfer vor mehr als 6 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
166 | 166 |
# column_index |
167 | 167 |
my @header_sort = qw( |
168 | 168 |
runningnumber partnumber type_and_classific description ship ship_missing qty price_factor |
169 |
unit weight price_source sellprice discount linetotal
|
|
169 |
unit weight price_source sellprice discount linetotal |
|
170 | 170 |
bin stock_in_out |
171 | 171 |
); |
172 | 172 |
my @row2_sort = qw( |
... | ... | |
187 | 187 |
serialnr => { width => 10, value => $locale->text('Serial No.'), display => !$is_quotation }, |
188 | 188 |
projectnr => { width => 10, value => $locale->text('Project'), display => 1, }, |
189 | 189 |
price_source => { width => 5, value => $locale->text('Price Source'), display => !$is_delivery_order, }, |
190 |
sellprice => { width => 15, value => $locale->text('Price'), display => !$is_delivery_order, },
|
|
190 |
sellprice => { width => 10, value => $locale->text('Price'), display => !$is_delivery_order, },
|
|
191 | 191 |
discount => { width => 5, value => $locale->text('Discount'), display => !$is_delivery_order, }, |
192 | 192 |
linetotal => { width => 10, value => $locale->text('Extended'), display => !$is_delivery_order, }, |
193 | 193 |
bin => { width => 10, value => $locale->text('Bin'), display => 0, }, |
... | ... | |
219 | 219 |
my $deliverydate = $locale->text('Required by'); |
220 | 220 |
|
221 | 221 |
# special alignings |
222 |
my %align = map { $_ => 'right' } qw(qty ship right discount linetotal stock_in_out weight ship_missing);
|
|
222 |
my %align = map { $_ => 'right' } qw(right linetotal stock_in_out weight ship_missing);
|
|
223 | 223 |
my %nowrap = map { $_ => 1 } qw(description unit price_source); |
224 | 224 |
|
225 | 225 |
$form->{marge_total} = 0; |
... | ... | |
303 | 303 |
my $rows = $form->numtextrows($form->{"description_$i"}, 30, 6); |
304 | 304 |
|
305 | 305 |
# quick delete single row |
306 |
$column_data{runningnumber} = q|<a onclick= "$('#partnumber_| . $i . q|').val(''); $('#update_button').click();">| . |
|
306 |
$column_data{runningnumber} = q|<a onclick= "$('#partnumber_| . $i . q|').val(''); $('#update_button').click();" class="row-position">| .
|
|
307 | 307 |
q|<img height="10px" width="10px" src="image/cross.png" alt="| . $locale->text('Remove') . q|"></a> |; |
308 |
$column_data{runningnumber} .= $cgi->textfield(-name => "runningnumber_$i", -id => "runningnumber_$i", -size => 2, -value => $i); # HuT |
|
308 |
$column_data{runningnumber} .= $cgi->textfield(-name => "runningnumber_$i", -id => "runningnumber_$i", -size => 2, -value => $i, -class => "row-position wi-smallest"); # HuT
|
|
309 | 309 |
|
310 | 310 |
|
311 | 311 |
$column_data{partnumber} = $cgi->textfield(-name => "partnumber_$i", -id => "partnumber_$i", -size => 12, -value => $form->{"partnumber_$i"}); |
312 | 312 |
$column_data{type_and_classific} = SL::Presenter::Part::type_abbreviation($form->{"part_type_$i"}). |
313 | 313 |
SL::Presenter::Part::classification_abbreviation($form->{"classification_id_$i"}) if $form->{"id_$i"}; |
314 | 314 |
$column_data{description} = (($rows > 1) # if description is too large, use a textbox instead |
315 |
? $cgi->textarea( -name => "description_$i", -id => "description_$i", -default => $form->{"description_$i"}, -rows => $rows, -columns => 30)
|
|
316 |
: $cgi->textfield(-name => "description_$i", -id => "description_$i", -value => $form->{"description_$i"}, -size => 30))
|
|
317 |
. $cgi->button(-value => $locale->text('L'), -onClick => "kivi.SalesPurchase.edit_longdescription($i)"); |
|
315 |
? $cgi->textarea( -name => "description_$i", -id => "description_$i", -default => $form->{"description_$i"}, -rows => $rows, -class => "wi-lightwide")
|
|
316 |
: $cgi->textfield(-name => "description_$i", -id => "description_$i", -value => $form->{"description_$i"}, -class => "wi-lightwide"))
|
|
317 |
. $cgi->button(-value => $locale->text('L'), -onClick => "kivi.SalesPurchase.edit_longdescription($i)", -class => "wi-tiny");
|
|
318 | 318 |
|
319 | 319 |
my $qty_dec = ($form->{"qty_$i"} =~ /\.(\d+)/) ? length $1 : 2; |
320 | 320 |
|
321 |
$column_data{qty} = $cgi->textfield(-name => "qty_$i", -size => 5, -class => "numeric", -value => $form->format_amount(\%myconfig, $form->{"qty_$i"}, $qty_dec));
|
|
321 |
$column_data{qty} = $cgi->textfield(-name => "qty_$i", -class => "numeric wi-verysmall", -value => $form->format_amount(\%myconfig, $form->{"qty_$i"}, $qty_dec));
|
|
322 | 322 |
$column_data{qty} .= $cgi->button(-onclick => "calculate_qty_selection_dialog('qty_$i', '', 'formel_$i', '')", -value => $locale->text('*/')) |
323 | 323 |
. $cgi->hidden(-name => "formel_$i", -value => $form->{"formel_$i"}) |
324 | 324 |
if $form->{"formel_$i"}; |
... | ... | |
378 | 378 |
my $edit_discounts = $main::auth->assert('edit_prices', 1) && !$::form->{"active_discount_source_$i"}; |
379 | 379 |
$column_data{sellprice} = (!$edit_prices) |
380 | 380 |
? $cgi->hidden( -name => "sellprice_$i", -id => "sellprice_$i", -value => $sellprice_value) . $sellprice_value |
381 |
: $cgi->textfield(-name => "sellprice_$i", -id => "sellprice_$i", -size => 10, -class => "numeric", -value => $sellprice_value); |
|
381 |
: $cgi->textfield(-name => "sellprice_$i", -id => "sellprice_$i", -size => 10, -class => "numeric wi-verysmall", -value => $sellprice_value);
|
|
382 | 382 |
$column_data{discount} = (!$edit_discounts) |
383 | 383 |
? $cgi->hidden( -name => "discount_$i", -id => "discount_$i", -value => $discount_value) . $discount_value . ' %' |
384 |
: $cgi->textfield(-name => "discount_$i", -id => "discount_$i", -size => 3, -"data-validate" => "number", -class => "numeric", -value => $discount_value); |
|
384 |
: $cgi->textfield(-name => "discount_$i", -id => "discount_$i", -size => 3, -"data-validate" => "number", -class => "numeric wi-smallest", -value => $discount_value);
|
|
385 | 385 |
|
386 | 386 |
if ($is_delivery_order) { |
387 | 387 |
$column_data{stock_in_out} = calculate_stock_in_out($i); |
388 | 388 |
} |
389 | 389 |
|
390 |
$column_data{serialnr} = qq|<input name="serialnumber_$i" size="15" value="$form->{"serialnumber_$i"}">|;
|
|
390 |
$column_data{serialnr} = qq|<input name="serialnumber_$i" class="wi-normal" value="$form->{"serialnumber_$i"}" type="text">|;
|
|
391 | 391 |
$column_data{projectnr} = NTI($cgi->popup_menu( |
392 | 392 |
'-name' => "project_id_$i", |
393 | 393 |
'-values' => \@projectnumber_values, |
394 | 394 |
'-labels' => \%projectnumber_labels, |
395 |
'-default' => $form->{"project_id_$i"} |
|
395 |
'-default' => $form->{"project_id_$i"}, |
|
396 |
'-type' => "text", |
|
397 |
'-class' => "wi-normal" |
|
396 | 398 |
)); |
397 |
$column_data{reqdate} = qq|<input name="reqdate_$i" size="11" data-validate="date" value="$form->{"reqdate_$i"}">|;
|
|
399 |
$column_data{reqdate} = qq|<input name="reqdate_$i" class="wi-normal" data-validate="date" value="$form->{"reqdate_$i"}" type="text">|;
|
|
398 | 400 |
$column_data{subtotal} = sprintf qq|<input type="checkbox" name="subtotal_$i" value="1" %s>|, $form->{"subtotal_$i"} ? 'checked' : ''; |
399 | 401 |
|
400 | 402 |
# begin marge calculations |
... | ... | |
431 | 433 |
|
432 | 434 |
map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) } qw(marge_absolut marge_percent); |
433 | 435 |
|
434 |
$column_data{marge} = sprintf qq|<font %s>%s %s%%</font>|,
|
|
436 |
$column_data{marge} = sprintf qq|<span class=\"data\" %s>%s %s%%</data>|,
|
|
435 | 437 |
$marge_color, $form->{"marge_absolut_$i"}, $form->{"marge_percent_$i"}; |
436 |
$column_data{listprice} = $form->format_amount(\%myconfig, $form->{"listprice_$i"}, 2);
|
|
437 |
$column_data{lastcost} = sprintf qq|<input size="5" name="lastcost_$i" value="%s">|, $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, $decimalplaces);
|
|
438 |
$column_data{listprice} = "<span class=\"data\">" . $form->format_amount(\%myconfig, $form->{"listprice_$i"}, 2) . "</span>";
|
|
439 |
$column_data{lastcost} = sprintf qq|<input class="wi-normal" name="lastcost_$i" value="%s" type="text">|, $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, $decimalplaces);
|
|
438 | 440 |
# / marge calculations ending |
439 | 441 |
|
440 | 442 |
# Calculate total weight |
... | ... | |
444 | 446 |
if ($form->{"id_$i"}) { |
445 | 447 |
my $part = IC->get_basic_part_info(id => $form->{"id_$i"}); |
446 | 448 |
my $onhand_color = $part->{onhand} < $part->{rop} ? 'color="#ff0000"' : ''; |
447 |
$column_data{onhand} = sprintf "<font %s>%s %s</font>",
|
|
449 |
$column_data{onhand} = sprintf "<span class=\"data\" %s>%s %s</span>",
|
|
448 | 450 |
$onhand_color, |
449 | 451 |
$form->format_amount(\%myconfig, $part->{onhand}, 2), |
450 | 452 |
$part->{unit}; |
... | ... | |
452 | 454 |
# / calculate onhand |
453 | 455 |
|
454 | 456 |
my @ROW1 = map { { value => $column_data{$_}, align => $align{$_}, nowrap => $nowrap{$_} } } grep { $column_def{$_}{display} } @header_sort; |
455 |
my @ROW2 = map { { value => sprintf "<b>%s</b> %s", $column_def{$_}{value}, $column_data{$_} } } grep { $column_def{$_}{display} } @row2_sort;
|
|
457 |
my @ROW2 = map { { value => sprintf "<span class=\"label horizontal\">%s</span> %s", $column_def{$_}{value}, "<span class=\"value\">$column_data{$_}</span>" } } grep { $column_def{$_}{display} } @row2_sort;
|
|
456 | 458 |
|
457 | 459 |
my @hidden_vars; |
458 | 460 |
# add hidden ids for persistent (item|invoice)_ids and previous (converted_from*) ids |
Auch abrufbar als: Unified diff
Diverse weitere Anpassungen zum Design 4.0