Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision d2482a05

Von Hans Peter Schlaepfer vor fast 6 Jahren hinzugefügt

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

Neues kivitendo Design Aenderungen in bin/mozilla/..

Unterschiede anzeigen:

bin/mozilla/do.pl
473 473

  
474 474
  setup_do_action_bar();
475 475

  
476
  $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted(); # aus sub form_footer
477

  
476 478
  $form->header();
479

  
477 480
  # Fix für Bug 1082 Erwartet wird: 'abteilungsNAME--abteilungsID'
478 481
  # und Erweiterung für Bug 1760:
479 482
  # Das war leider nur ein Teil-Fix, da das Verhalten den 'Erneuern'-Knopf
......
499 502
  my $form     = $main::form;
500 503

  
501 504
  $form->{PRINT_OPTIONS}      = setup_sales_purchase_print_options();
502
  $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
505
  # $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted(); # verlagert in sub form_header
503 506

  
504 507
  print $form->parse_html_template('do/form_footer',
505 508
    {transfer_default         => ($::instance_conf->get_transfer_default)});
bin/mozilla/gl.pl
806 806
  for my $i (1 .. $form->{rowcount}) {
807 807
    if ($form->{show_details}) {
808 808
      $source = qq|
809
      <td><input name="source_$i" value="$form->{"source_$i"}" size="16"></td>|;
809
      <td><input name="source_$i" value="$form->{"source_$i"}" class="wi-verysmall" type="text"></td>|;
810 810
      $memo = qq|
811
      <td><input name="memo_$i" value="$form->{"memo_$i"}" size="16"></td>|;
811
      <td><input name="memo_$i" value="$form->{"memo_$i"}" class="wi-small" type="text"></td>|;
812 812
    } else {
813 813
      $source_hidden = qq|
814
      <input type="hidden" name="source_$i" value="$form->{"source_$i"}" size="16">|;
814
      <input type="hidden" name="source_$i" value="$form->{"source_$i"}">|;
815 815
      $memo_hidden = qq|
816
      <input type="hidden" name="memo_$i" value="$form->{"memo_$i"}" size="16">|;
816
      <input type="hidden" name="memo_$i" value="$form->{"memo_$i"}">|;
817 817
    }
818 818

  
819 819
    my %taxchart_labels = ();
......
854 854
    if ($init) {
855 855
      if ($form->{transfer}) {
856 856
        $fx_transaction = qq|
857
        <td><input name="fx_transaction_$i" class=checkbox type=checkbox value=1></td>
857
        <td><input name="fx_transaction_$i" type="checkbox" value="1"></td>
858 858
    |;
859 859
      }
860 860

  
......
883 883
          $checked = ($form->{"fx_transaction_$i"}) ? "1" : "";
884 884
          my $x = ($checked) ? "x" : "";
885 885
          $fx_transaction = qq|
886
      <td><input type=hidden name="fx_transaction_$i" value="$checked">$x</td>
886
      <td><input type="hidden" name="fx_transaction_$i" value="$checked">$x</td>
887 887
    |;
888 888
        }
889 889
        $form->hide_form("accno_$i");
......
891 891
      } else {
892 892
        if ($form->{transfer}) {
893 893
          $fx_transaction = qq|
894
      <td><input name="fx_transaction_$i" class=checkbox type=checkbox value=1></td>
894
      <td><input name="fx_transaction_$i" type="checkbox" value="1"></td>
895 895
    |;
896 896
        }
897 897
      }
......
925 925

  
926 926
    print qq|<tr valign=top>
927 927
    $accno
928
    <td id="chart_balance_$i" align="right">${balance}</td>
928
    <td id="chart_balance_$i" class="right">${balance}</td>
929 929
    $fx_transaction
930
    <td><input name="debit_$i" size="8" value="$form->{"debit_$i"}" accesskey=$i $copy2credit $debitreadonly></td>
931
    <td><input name="credit_$i" size=8 value="$form->{"credit_$i"}" $creditreadonly></td>
932
    <td><input type="hidden" name="tax_$i" value="$form->{"tax_$i"}">$form->{"tax_$i"}</td>
930
    <td class="right"><input name="debit_$i" type="text" class="wi-small numeric" value="$form->{"debit_$i"}" accesskey=$i $copy2credit $debitreadonly></td>
931
    <td class="right"><input name="credit_$i" type="text" class="wi-small numeric" value="$form->{"credit_$i"}" $creditreadonly></td>
932
    <td class="right"><input name="tax_$i" type="hidden" value="$form->{"tax_$i"}">$form->{"tax_$i"}</td>
933 933
    $tax_ddbox|;
934 934

  
935 935
    if ($form->{show_details}) {
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
bin/mozilla/ir.pl
417 417

  
418 418
  setup_ir_action_bar();
419 419

  
420
  $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted(); # moved to here from sub form_footer
421

  
420 422
  $form->header();
421 423

  
422 424
  print $form->parse_html_template("ir/form_header", \%TMPL_VAR);
......
468 470
  foreach my $item (@{ $form->{taxaccounts_array} }) {
469 471
    if ($form->{"${item}_base"}) {
470 472
      if ($form->{taxincluded}) {
471
        $form->{"${item}_total"} = $form->round_amount( ($form->{"${item}_base"} * $form->{"${item}_rate"}
472
                                                                                 / (1 + $form->{"${item}_rate"})), 2);
473
        $form->{"${item}_total"} = $form->round_amount( ($form->{"${item}_base"} * $form->{"${item}_rate"} / (1 + $form->{"${item}_rate"})), 2);
473 474
        $form->{"${item}_netto"} = $form->round_amount( ($form->{"${item}_base"} - $form->{"${item}_total"}), 2);
474
      } else {
475
      } 
476
      else {
475 477
        $form->{"${item}_total"} = $form->round_amount( $form->{"${item}_base"} * $form->{"${item}_rate"}, 2);
476 478
        $form->{invtotal} += $form->{"${item}_total"};
477 479
      }
......
523 525
    $totalpaid += $form->{"paid_$i"};
524 526
  }
525 527

  
526
  $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted();
528
  # $form->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted(); # moved to sub form_header
527 529

  
528 530
  print $form->parse_html_template('ir/form_footer', {
529 531
    totalpaid           => $totalpaid,
bin/mozilla/oe.pl
330 330
        t8('Update'),
331 331
        submit    => [ '#form', { action => "update" } ],
332 332
        id        => 'update_button',
333
        checks   => [ 'kivi.validate_form' ],
333
        class     => 'inline',
334
        checks    => [ 'kivi.validate_form' ],
334 335
        accesskey => 'enter',
335 336
      ],
336 337

  
......
515 516
                        $form->{"delivered"} ? "checked" : "",  $locale->text('Delivery Order(s) for full qty created') if $form->{"type"} =~ /_order$/;
516 517
  push @tmp, sprintf qq|<input name="closed" id="closed" type="checkbox" class="checkbox" value="1" %s><label for="closed">%s</label>|,
517 518
                        $form->{"closed"}    ? "checked" : "",  $locale->text('Closed')    if $form->{id};
518
  $TMPL_VAR->{openclosed} = sprintf qq|<tr><td colspan=%d align=center>%s</td></tr>\n|, 2 * scalar @tmp, join "\n", @tmp if @tmp;
519
  $TMPL_VAR->{openclosed} = sprintf qq|<tr><th colspan=%d><div class="list">%s</div></th></tr>\n|, 2 * scalar @tmp, join "\n", @tmp if @tmp;
519 520

  
520 521
  my $vc = $form->{vc} eq "customer" ? "customers" : "vendors";
521 522

  
......
661 662
    $TMPL_VAR->{transport_cost_reminder_article} = SL::DB::Part->new(id => $::instance_conf->get_transport_cost_reminder_article_number_id)->load;
662 663
  }
663 664

  
665
  # following 4 lines came from form_footer, comments/notes are now in upper part of the page
666
  my $introws = max 5, $form->numtextrows($form->{intnotes}, 35, 8);
667

  
668
  my $TMPL_VAR = $::request->cache('tmpl_var', {});
669

  
670
  $TMPL_VAR->{notes}    = qq|<textarea name="notes" class="texteditor" wrap="soft" style="width: 300px; height: 150px">| . H($form->{notes}) . qq|</textarea>|;
671
  $TMPL_VAR->{intnotes} = qq|<textarea name=intnotes rows="$introws" cols="35">| . H($form->{intnotes}) . qq|</textarea>|;
672

  
673
  $TMPL_VAR->{ALL_DELIVERY_TERMS} = SL::DB::Manager::DeliveryTerm->get_all_sorted(); # moved from sub form_footer
674

  
675

  
676

  
664 677
  print $form->parse_html_template("oe/form_header", {
665 678
    %$TMPL_VAR,
666 679
    %type_check_vars,
......
680 693

  
681 694
  $form->{invtotal} = $form->{invsubtotal};
682 695

  
683
  my $introws = max 5, $form->numtextrows($form->{intnotes}, 35, 8);
696
  #my $introws = max 5, $form->numtextrows($form->{intnotes}, 35, 8);
684 697

  
685 698
  my $TMPL_VAR = $::request->cache('tmpl_var', {});
686 699

  
687
  $TMPL_VAR->{notes}    = qq|<textarea name="notes" class="texteditor" wrap="soft" style="width: 350px; height: 150px">| . H($form->{notes}) . qq|</textarea>|;
688
  $TMPL_VAR->{intnotes} = qq|<textarea name=intnotes rows="$introws" cols="35">| . H($form->{intnotes}) . qq|</textarea>|;
700
  #$TMPL_VAR->{notes}    = qq|<textarea name="notes" class="texteditor" wrap="soft" style="width: 350px; height: 150px">| . H($form->{notes}) . qq|</textarea>|;
701
  #$TMPL_VAR->{intnotes} = qq|<textarea name=intnotes rows="$introws" cols="35">| . H($form->{intnotes}) . qq|</textarea>|;
689 702

  
690 703
  if( $form->{customer_id} && !$form->{taxincluded_changed_by_user} ) {
691 704
    my $customer = SL::DB::Customer->new(id => $form->{customer_id})->load();
......
1187 1200
  };
1188 1201
  push @options, $locale->text('Open')                                                                    if $form->{open};
1189 1202
  push @options, $locale->text('Closed')                                                                  if $form->{closed};
1190
  push @options, $locale->text('Delivery Order created')                                                               if $form->{delivered};
1203
  push @options, $locale->text('Delivery Order created')                                                  if $form->{delivered};
1191 1204
  push @options, $locale->text('Not delivered')                                                           if $form->{notdelivered};
1192 1205
  push @options, $locale->text('Periodic invoices active')                                                if $form->{periodic_invoices_active};
1193 1206
  push @options, $locale->text('Reqdate not set or before current month')                                 if $form->{reqdate_unset_or_old};
bin/mozilla/rp.pl
153 153
  $::form->all_departments(\%::myconfig);
154 154
  if (@{ $::form->{all_departments} || [] }) {
155 155
    $::form->{selectdepartment} = "<option>\n";
156
    map { $::form->{selectdepartment} .= "<option>$_->{description}--$_->{id}\n" } @{ $::form->{all_departments} || [] };
156
    map { $::form->{selectdepartment} .= "<option>$_->{id} &nbsp; $_->{description} \n" } @{ $::form->{all_departments} || [] };
157 157
  }
158 158

  
159 159
  $::form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 });

Auch abrufbar als: Unified diff