Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8af9137d

Von Hans Peter Schlaepfer vor fast 4 Jahren hinzugefügt

  • ID 8af9137d3035e94ec64abddddaa2d18b14f4b76c
  • Vorgänger 99a5da44
  • Nachfolger b311d502

Design 4.0: b/m/io.pl: HTML im Quelltext: Anpassungen size/class/u.a.

Unterschiede anzeigen:

bin/mozilla/io.pl
217 217
  my $deliverydate  = $locale->text('Required by');
218 218

  
219 219
  # special alignings
220
  my %align  = map { $_ => 'right' } qw(qty ship right discount linetotal stock_in_out weight ship_missing);
220
  my %align  = map { $_ => 'right' } qw(right linetotal stock_in_out weight ship_missing);
221 221
  my %nowrap = map { $_ => 1 }       qw(description unit  price_source);
222 222

  
223 223
  $form->{marge_total}           = 0;
......
301 301
    my $rows            = $form->numtextrows($form->{"description_$i"}, 30, 6);
302 302

  
303 303
    # quick delete single row
304
    $column_data{runningnumber}  = q|<a onclick= "$('#partnumber_| . $i . q|').val(''); $('#update_button').click();">| .
305
                                   q|<img height="10px" width="10px" src="image/cross.png" alt="| . $locale->text('Remove') . q|"></a> |;
306
    $column_data{runningnumber} .= $cgi->textfield(-name => "runningnumber_$i", -id => "runningnumber_$i", -size => 5,  -value => $i);    # HuT
304
    $column_data{runningnumber}  = q|<a onclick="$('#partnumber_| . $i . q|').val(''); $('#update_button').click();" class="row-position">| .
305
                                   q|<img src="image/cross.png" alt="| . $locale->text('Remove') . q|"></a> |;
306
    $column_data{runningnumber} .= $cgi->textfield(-name => "runningnumber_$i", -id => "runningnumber_$i", -size => 2,  -value => $i, -class => "row-position wi-smallest");    # HuT
307 307

  
308 308

  
309 309
    $column_data{partnumber}    = $cgi->textfield(-name => "partnumber_$i",    -id => "partnumber_$i",    -size => 12, -value => $form->{"partnumber_$i"});
310 310
    $column_data{type_and_classific} = SL::Presenter::Part::type_abbreviation($form->{"part_type_$i"}).
311 311
                                       SL::Presenter::Part::classification_abbreviation($form->{"classification_id_$i"}) if $form->{"id_$i"};
312 312
    $column_data{description} = (($rows > 1) # if description is too large, use a textbox instead
313
                                ? $cgi->textarea( -name => "description_$i", -id => "description_$i", -default => $form->{"description_$i"}, -rows => $rows, -columns => 30)
314
                                : $cgi->textfield(-name => "description_$i", -id => "description_$i",   -value => $form->{"description_$i"}, -size => 30))
315
                                . $cgi->button(-value => $locale->text('L'), -onClick => "kivi.SalesPurchase.edit_longdescription($i)");
313
                                ? $cgi->textarea( -name => "description_$i", -id => "description_$i", -default => $form->{"description_$i"}, -rows => $rows, -class => "wi-lightwide")
314
                                : $cgi->textfield(-name => "description_$i", -id => "description_$i",   -value => $form->{"description_$i"}, -class => "wi-lightwide") )
315
                                . $cgi->button(-value => $locale->text('L'), -onClick => "kivi.SalesPurchase.edit_longdescription($i)", -class => "wi-tiny neutral");
316 316

  
317 317
    my $qty_dec = ($form->{"qty_$i"} =~ /\.(\d+)/) ? length $1 : 2;
318 318

  
319
    $column_data{qty}  = $cgi->textfield(-name => "qty_$i", -size => 5, -class => "numeric", -value => $form->format_amount(\%myconfig, $form->{"qty_$i"}, $qty_dec));
319
    $column_data{qty}  = $cgi->textfield(-name => "qty_$i", -class => "numeric wi-verysmall", -value => $form->format_amount(\%myconfig, $form->{"qty_$i"}, $qty_dec));
320 320
    $column_data{qty} .= $cgi->button(-onclick => "calculate_qty_selection_dialog('qty_$i', '', 'formel_$i', '')", -value => $locale->text('*/'))
321 321
                       . $cgi->hidden(-name => "formel_$i", -value => $form->{"formel_$i"})
322 322
      if $form->{"formel_$i"};
......
377 377
    my $edit_discounts        = $right_to_edit_prices && !$::form->{"active_discount_source_$i"};
378 378
    $column_data{sellprice}   = (!$edit_prices)
379 379
                                ? $cgi->hidden(   -name => "sellprice_$i", -id => "sellprice_$i", -value => $sellprice_value) . $sellprice_value
380
                                : $cgi->textfield(-name => "sellprice_$i", -id => "sellprice_$i", -size => 10, -class => "numeric", -value => $sellprice_value);
380
                                : $cgi->textfield(-name => "sellprice_$i", -id => "sellprice_$i", -size => 10, -class => "numeric wi-verysmall", -value => $sellprice_value);
381 381
    $column_data{discount}    = (!$edit_discounts)
382 382
                                  ? $cgi->hidden(   -name => "discount_$i", -id => "discount_$i", -value => $discount_value) . $discount_value . ' %'
383
                                  : $cgi->textfield(-name => "discount_$i", -id => "discount_$i", -size => 3, -"data-validate" => "number", -class => "numeric", -value => $discount_value);
383
                                  : $cgi->textfield(-name => "discount_$i", -id => "discount_$i", -size => 3, -"data-validate" => "number", -class => "numeric wi-smallest", -value => $discount_value);
384 384

  
385 385
    if ($is_delivery_order) {
386 386
      $column_data{stock_in_out} =  calculate_stock_in_out($i);
387 387
    }
388 388

  
389
    $column_data{serialnr}  = qq|<input name="serialnumber_$i" size="15" value="$form->{"serialnumber_$i"}">|;
389
    $column_data{serialnr}  = qq|<input name="serialnumber_$i" class="wi-normal" value="$form->{"serialnumber_$i"}" type="text">|;
390 390
    $column_data{projectnr} = NTI($cgi->popup_menu(
391 391
      '-name' => "project_id_$i",
392 392
      '-values' => \@projectnumber_values,
393 393
      '-labels' => \%projectnumber_labels,
394
      '-default' => $form->{"project_id_$i"}
394
      '-default' => $form->{"project_id_$i"},
395
      '-type' => "text",
396
      '-class' => "wi-normal"
395 397
    ));
396
    $column_data{reqdate}   = qq|<input name="reqdate_$i" size="11" data-validate="date" value="$form->{"reqdate_$i"}">|;
398
    $column_data{reqdate}   = qq|<input name="reqdate_$i" class="wi-normal" data-validate="date" value="$form->{"reqdate_$i"}" type="text">|;
397 399
    $column_data{subtotal}  = sprintf qq|<input type="checkbox" name="subtotal_$i" value="1" %s>|, $form->{"subtotal_$i"} ? 'checked' : '';
398 400

  
399 401
# begin marge calculations
......
430 432

  
431 433
    map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, 2) } qw(marge_absolut marge_percent);
432 434

  
433
    $column_data{marge} = sprintf qq|<font %s>%s &nbsp;%s%%</font>|,
435
    $column_data{marge} = sprintf qq|<span class=\"data\" %s>%s &nbsp;%s%%</span>|,
434 436
      $marge_color, $form->{"marge_absolut_$i"}, $form->{"marge_percent_$i"};
435
    $column_data{listprice} = $form->format_amount(\%myconfig, $form->{"listprice_$i"}, 2);
436
    $column_data{lastcost}  = sprintf qq|<input size="5" name="lastcost_$i" value="%s">|, $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, $decimalplaces);
437
    $column_data{listprice} = "<span class=\"data\">" . $form->format_amount(\%myconfig, $form->{"listprice_$i"}, 2) . "</span>";
438
    $column_data{lastcost}  = sprintf qq|<input class="wi-normal" name="lastcost_$i" value="%s" type="text">|, $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, $decimalplaces);
437 439
# / marge calculations ending
438 440

  
439 441
# Calculate total weight
......
443 445
    if ($form->{"id_$i"}) {
444 446
      my $part         = IC->get_basic_part_info(id => $form->{"id_$i"});
445 447
      my $onhand_color = $part->{onhand} < $part->{rop} ? 'color="#ff0000"' : '';
446
      $column_data{onhand} = sprintf "<font %s>%s %s</font>",
448
      $column_data{onhand} = sprintf "<span class=\"data\" %s>%s %s</span>",
447 449
                      $onhand_color,
448 450
                      $form->format_amount(\%myconfig, $part->{onhand}, 2),
449 451
                      $part->{unit};
......
451 453
# / calculate onhand
452 454

  
453 455
    my @ROW1 = map { { value => $column_data{$_}, align => $align{$_}, nowrap => $nowrap{$_} } } grep { $column_def{$_}{display} } @header_sort;
454
    my @ROW2 = map { { value => sprintf "<b>%s</b> %s", $column_def{$_}{value}, $column_data{$_} } } grep { $column_def{$_}{display} } @row2_sort;
456
    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;
455 457

  
456 458
    my @hidden_vars;
457 459
    # add hidden ids for persistent (item|invoice)_ids and previous (converted_from*) ids

Auch abrufbar als: Unified diff