Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d2482a05

Von Hans Peter Schlaepfer vor mehr als 5 Jahren hinzugefügt

  • ID d2482a05eb12a3cc7b79c5436d3453d0bb670712
  • Vorgänger 5cdf5329
  • Nachfolger f7df215b

Neues kivitendo Design Aenderungen in bin/mozilla/..

Unterschiede anzeigen:

bin/mozilla/io.pl
165 165
  # column_index
166 166
  my @header_sort = qw(
167 167
    runningnumber partnumber type_and_classific description ship ship_missing qty price_factor
168
    unit weight price_source sellprice discount linetotal
168
  unit weight price_source sellprice discount linetotal
169 169
    bin stock_in_out
170 170
  );
171 171
  my @row2_sort   = qw(
172 172
    serialnr projectnr reqdate subtotal marge listprice lastcost onhand
173 173
  );
174 174
  my %column_def = (
175
    runningnumber => { width => 5,     value => $locale->text('No.'),                  display => 1, },
175
    runningnumber => { width => 2,     value => $locale->text('No.'),                  display => 1, },
176 176
    partnumber    => { width => 8,     value => $locale->text('Number'),               display => 1, },
177 177
    type_and_classific
178 178
                  => { width => 2,     value => $locale->text('Type'),                 display => 1, },
......
186 186
    serialnr      => { width => 10,    value => $locale->text('Serial No.'),           display => !$is_quotation },
187 187
    projectnr     => { width => 10,    value => $locale->text('Project'),              display => 1, },
188 188
    price_source  => { width => 5,     value => $locale->text('Price Source'),         display => !$is_delivery_order, },
189
    sellprice     => { width => 15,    value => $locale->text('Price'),                display => !$is_delivery_order, },
189
    sellprice     => { width => 10,    value => $locale->text('Price'),                display => !$is_delivery_order, },
190 190
    discount      => { width => 5,     value => $locale->text('Discount'),             display => !$is_delivery_order, },
191 191
    linetotal     => { width => 10,    value => $locale->text('Extended'),             display => !$is_delivery_order, },
192 192
    bin           => { width => 10,    value => $locale->text('Bin'),                  display => 0, },
......
218 218
  my $deliverydate  = $locale->text('Required by');
219 219

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

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

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

  
309 309

  
310 310
    $column_data{partnumber}    = $cgi->textfield(-name => "partnumber_$i",    -id => "partnumber_$i",    -size => 12, -value => $form->{"partnumber_$i"});
311 311
    $column_data{type_and_classific} = SL::Presenter::Part::type_abbreviation($form->{"part_type_$i"}).
312 312
                                       SL::Presenter::Part::classification_abbreviation($form->{"classification_id_$i"}) if $form->{"id_$i"};
313 313
    $column_data{description} = (($rows > 1) # if description is too large, use a textbox instead
314
                                ? $cgi->textarea( -name => "description_$i", -id => "description_$i", -default => $form->{"description_$i"}, -rows => $rows, -columns => 30)
315
                                : $cgi->textfield(-name => "description_$i", -id => "description_$i",   -value => $form->{"description_$i"}, -size => 30))
316
                                . $cgi->button(-value => $locale->text('L'), -onClick => "kivi.SalesPurchase.edit_longdescription($i)");
314
                                ? $cgi->textarea( -name => "description_$i", -id => "description_$i", -default => $form->{"description_$i"}, -rows => $rows, -class => "wi-lightwide")
315
                                : $cgi->textfield(-name => "description_$i", -id => "description_$i",   -value => $form->{"description_$i"}, -class => "wi-lightwide") )
316
#                               . $cgi->button(-value => $locale->text('L'), -onClick => "kivi.SalesPurchase.edit_longdescription($i)", -class => "wi-tiny neutral");
317
                                . q|<a href="javascript:kivi.SalesPurchase.edit_longdescription(| . $i . q|);" class="button-image edit" title="| . t8('Edit long description') . q|"><img src="image/pencil.png"></a>|;
317 318

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

  
320
    $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));
321 322
    $column_data{qty} .= $cgi->button(-onclick => "calculate_qty_selection_dialog('qty_$i', '', 'formel_$i', '')", -value => $locale->text('*/'))
322 323
                       . $cgi->hidden(-name => "formel_$i", -value => $form->{"formel_$i"})
323 324
      if $form->{"formel_$i"};
......
377 378
    my $edit_discounts  = $main::auth->assert('edit_prices', 1) && !$::form->{"active_discount_source_$i"};
378 379
    $column_data{sellprice}   = (!$edit_prices)
379 380
                                ? $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);
381
                                : $cgi->textfield(-name => "sellprice_$i", -id => "sellprice_$i", -size => 10, -class => "numeric wi-verysmall", -value => $sellprice_value);
381 382
    $column_data{discount}    = (!$edit_discounts)
382 383
                                  ? $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);
384
                                  : $cgi->textfield(-name => "discount_$i", -id => "discount_$i", -size => 3, -"data-validate" => "number", -class => "numeric wi-smallest", -value => $discount_value);
384 385

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

  
389
    $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">|;
390 391
    $column_data{projectnr} = NTI($cgi->popup_menu(
391 392
      '-name' => "project_id_$i",
392 393
      '-values' => \@projectnumber_values,
393 394
      '-labels' => \%projectnumber_labels,
394
      '-default' => $form->{"project_id_$i"}
395
      '-default' => $form->{"project_id_$i"},
396
      '-type' => "text",
397
      '-class' => "wi-normal"
395 398
    ));
396
    $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">|;
397 400
    $column_data{subtotal}  = sprintf qq|<input type="checkbox" name="subtotal_$i" value="1" %s>|, $form->{"subtotal_$i"} ? 'checked' : '';
398 401

  
399 402
# begin marge calculations
......
430 433

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

  
433
    $column_data{marge} = sprintf qq|<font %s>%s &nbsp;%s%%</font>|,
436
    $column_data{marge} = sprintf qq|<span class=\"data\" %s>%s &nbsp;%s%%</span>|,
434 437
      $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);
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);
437 440
# / marge calculations ending
438 441

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

  
453 456
    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;
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;
455 458

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

Auch abrufbar als: Unified diff