Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision ddbe3ea5

Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt

  • ID ddbe3ea5ec297a58acc9ee3afc17156fb97be7f2
  • Vorgänger 13787dab
  • Nachfolger 36c54ad2

In allen Einkaufs- und Verkaufsmasken die Drop-Down-Box für die Steuerzone bei jedem Formularaufbau neu generieren. Dadurch bleibt auch der bisher selektierte Eintrag selektiert, was er vorher nicht tat (sprang immer auf "Inland" zurück).

Unterschiede anzeigen:

SL/CT.pm
101 101
  $query = qq|SELECT id, description FROM business ORDER BY id|;
102 102
  $form->{all_business} = selectall_hashref_query($form, $dbh, $query);
103 103

  
104
  # get tax zones
105
  $query = qq|SELECT id, description FROM tax_zones|;
106
  $form->{TAXZONE} = selectall_hashref_query($form, $dbh, $query);
107

  
108 104
  # get shipto address
109 105
  $query =
110 106
    qq|SELECT shipto_id, shiptoname, shiptodepartment_1 | .
SL/Form.pm
1517 1517
  $main::lxdebug->leave_sub();
1518 1518
}
1519 1519

  
1520
sub _get_taxzones {
1521
  $main::lxdebug->enter_sub();
1522

  
1523
  my ($self, $dbh, $key) = @_;
1524

  
1525
  $key = "all_taxzones" unless ($key);
1526

  
1527
  my $query = qq|SELECT * FROM tax_zones ORDER BY id|;
1528

  
1529
  $self->{$key} = selectall_hashref_query($self, $dbh, $query);
1530

  
1531
  $main::lxdebug->leave_sub();
1532
}
1533

  
1520 1534
sub _get_employees {
1521 1535
  $main::lxdebug->enter_sub();
1522 1536

  
......
1597 1611
    $self->_get_taxcharts($dbh, $params{"taxcharts"});
1598 1612
  }
1599 1613

  
1614
  if ($params{"taxzones"}) {
1615
    $self->_get_taxzones($dbh, $params{"taxzones"});
1616
  }
1617

  
1600 1618
  if ($params{"employees"}) {
1601 1619
    $self->_get_employees($dbh, $params{"employees"});
1602 1620
  }
......
1870 1888
  $query = qq|SELECT id, taxkey, taxdescription FROM tax|;
1871 1889
  $self->{TAXKEY} = selectall_hashref_query($self, $dbh, $query);
1872 1890

  
1873
  # get tax zones
1874
  $query = qq|SELECT id, description FROM tax_zones|;
1875
  $self->{TAXZONE} = selectall_hashref_query($self, $dbh, $query);
1876

  
1877 1891
  if (($module eq "AP") || ($module eq "AR")) {
1878 1892
    # get tax rates and description
1879 1893
    $query = qq|SELECT * FROM tax|;
SL/OE.pm
870 870

  
871 871
  Common::webdav_folder($form) if ($main::webdav);
872 872

  
873
  # get tax zones
874
  $query = qq|SELECT id, description FROM tax_zones|;
875
  $form->{TAXZONE} = selectall_hashref_query($form, $dbh, $query);
876

  
877 873
  my $rc = $dbh->commit;
878 874
  $dbh->disconnect;
879 875

  
bin/mozilla/ct.pl
601 601
sub form_header {
602 602
  $lxdebug->enter_sub();
603 603

  
604
  $form->get_lists("employees" => "ALL_SALESMEN");
604
  $form->get_lists("employees" => "ALL_SALESMEN",
605
                   "taxzones" => "ALL_TAXZONES");
605 606

  
606 607
  $form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
607 608
  $form->{creditlimit} =
......
644 645
    }
645 646
  }
646 647

  
647
  if (@{ $form->{TAXZONE} }) {
648
    foreach $item (@{ $form->{TAXZONE} }) {
649
      if ($item->{id} == $form->{taxzone_id}) {
650
        $form->{selecttaxzone} .=
651
          "<option value=$item->{id} selected>$item->{description}\n";
652
      } else {
653
        $form->{selecttaxzone} .=
654
          "<option value=$item->{id}>$item->{description}\n";
655
      }
656

  
657
    }
648
  %labels = ();
649
  @values = ();
650
  foreach my $item (@{ $form->{"ALL_TAXZONES"} }) {
651
    push(@values, $item->{"id"});
652
    $labels{$item->{"id"}} = $item->{"description"};
658 653
  }
659 654

  
660 655
  $taxzone = qq|
661 656
		<th align=right>| . $locale->text('Steuersatz') . qq|</th>
662
		<td><select name=taxzone_id>$form->{selecttaxzone}</select></td>
663
		<input type=hidden name=selecttaxzone value="$form->{selecttaxzone}">
657
      <td>| .
658
        NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
659
                             '-values' => \@values, '-labels' => \%labels)) . qq|
660
      </td>
664 661
|;
665 662

  
666 663
  $get_contact_url =
bin/mozilla/ir.pl
278 278
  $form->get_lists("contacts" => "ALL_CONTACTS",
279 279
                   "projects" => { "key" => "ALL_PROJECTS",
280 280
                                   "all" => 0,
281
                                   "old_id" => \@old_project_ids });
281
                                   "old_id" => \@old_project_ids },
282
                   "taxzones" => "ALL_TAXZONES");
282 283

  
283 284
  my %labels;
284 285
  my @values = (undef);
......
302 303
                         '-labels' => \%labels,
303 304
                         '-default' => $form->{"globalproject_id"}));
304 305

  
305
  if (@{ $form->{TAXZONE} }) {
306
    $form->{selecttaxzone} = "";
307
    foreach $item (@{ $form->{TAXZONE} }) {
308
      if ($item->{id} == $form->{taxzone_id}) {
309
        $form->{selecttaxzone} .=
310
          "<option value=$item->{id} selected>" . H($item->{description}) .
311
          "</option>";
312
      } else {
313
        $form->{selecttaxzone} .=
314
          "<option value=$item->{id}>" . H($item->{description}) . "</option>";
315
      }
316

  
317
    }
318
  } else {
319
    $form->{selecttaxzone} =~ s/ selected//g;
320
    if ($form->{taxzone_id} ne "") {
321
      $form->{selecttaxzone} =~ s/value=$form->{taxzone_id}/value=$form->{taxzone_id} selected/;
322
    }
306
  %labels = ();
307
  @values = ();
308
  foreach my $item (@{ $form->{"ALL_TAXZONES"} }) {
309
    push(@values, $item->{"id"});
310
    $labels{$item->{"id"}} = $item->{"description"};
323 311
  }
324 312

  
325
  $taxzone = qq|
326
	      <tr>
327
		<th align=right>| . $locale->text('Steuersatz') . qq|</th>
328
		<td><select name=taxzone_id>$form->{selecttaxzone}</select></td>
329
		<input type=hidden name=selecttaxzone value="$form->{selecttaxzone}">
330
	      </tr>|;
331

  
313
  if (!$form->{"id"}) {
314
    $taxzone = qq|
315
    <tr>
316
      <th align="right">| . $locale->text('Steuersatz') . qq|</th>
317
      <td>| .
318
        NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
319
                             '-values' => \@values, '-labels' => \%labels)) . qq|
320
      </td>
321
    </tr>|;
332 322

  
323
  } else {
324
    $taxzone = qq|
325
    <tr>
326
      <th align="right">| . $locale->text('Steuersatz') . qq|</th>
327
      <td>
328
        <input type="hidden" name="taxzone_id" value="| . H($form->{"taxzone_id"}) . qq|">
329
        | . H($labels{$form->{"taxzone_id"}}) . qq|
330
      </td>
331
    </tr>|;
332
  }
333 333

  
334 334
  $vendor =
335 335
    ($form->{selectvendor})
bin/mozilla/is.pl
334 334
  my $pjx = new CGI::Ajax( 'set_duedate' => $set_duedate_url );
335 335
  push(@ { $form->{AJAX} }, $pjx);
336 336

  
337
  if (@{ $form->{TAXZONE} }) {
338
    $form->{selecttaxzone} = "";
339
    foreach $item (@{ $form->{TAXZONE} }) {
340
      if ($item->{id} == $form->{taxzone_id}) {
341
        $form->{selecttaxzone} .=
342
          "<option value=$item->{id} selected>" . H($item->{description}) .
343
          "</option>";
344
      } else {
345
        $form->{selecttaxzone} .=
346
          "<option value=$item->{id}>" . H($item->{description}) . "</option>";
347
      }
348

  
349
    }
350
  } else {
351
    $form->{selecttaxzone} =~ s/ selected//g;
352
    if ($form->{taxzone_id} ne "") {
353
      $form->{selecttaxzone} =~ s/value=\"$form->{taxzone_id}\"/value=\"$form->{taxzone_id}\" selected/;
354
    }
355
  }
356

  
357
  $taxzone = qq|
358
	      <tr>
359
		<th align="right">| . $locale->text('Steuersatz') . qq|</th>
360
		<td><select name="taxzone_id">$form->{selecttaxzone}</select></td>
361
		<input type="hidden" name="selecttaxzone" value="$form->{selecttaxzone}">
362
	      </tr>|;
363

  
364 337
  my @old_project_ids = ($form->{"globalproject_id"});
365 338
  map({ push(@old_project_ids, $form->{"project_id_$_"})
366 339
          if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
......
370 343
                   "projects" => { "key" => "ALL_PROJECTS",
371 344
                                   "all" => 0,
372 345
                                   "old_id" => \@old_project_ids },
373
                   "employees" => "ALL_SALESMEN");
346
                   "employees" => "ALL_SALESMEN",
347
                   "taxzones" => "ALL_TAXZONES");
374 348

  
375 349
  my %labels;
376 350
  my @values = (undef);
......
425 399
     . qq|</td>
426 400
         </tr>|;
427 401

  
402
  %labels = ();
403
  @values = ();
404
  foreach my $item (@{ $form->{"ALL_TAXZONES"} }) {
405
    push(@values, $item->{"id"});
406
    $labels{$item->{"id"}} = $item->{"description"};
407
  }
408

  
409
  if (!$form->{"id"}) {
410
    $taxzone = qq|
411
    <tr>
412
      <th align="right">| . $locale->text('Steuersatz') . qq|</th>
413
      <td>| .
414
        NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
415
                             '-values' => \@values, '-labels' => \%labels)) . qq|
416
      </td>
417
    </tr>|;
418

  
419
  } else {
420
    $taxzone = qq|
421
    <tr>
422
      <th align="right">| . $locale->text('Steuersatz') . qq|</th>
423
      <td>
424
        <input type="hidden" name="taxzone_id" value="| . H($form->{"taxzone_id"}) . qq|">
425
        | . H($labels{$form->{"taxzone_id"}}) . qq|
426
      </td>
427
    </tr>|;
428
  }
429

  
428 430
  # set option selected
429 431
  foreach $item (qw(AR customer currency department employee)) {
430 432
    $form->{"select$item"} =~ s/ selected//;
bin/mozilla/oe.pl
431 431
                   "projects" => { "key" => "ALL_PROJECTS",
432 432
                                   "all" => 0,
433 433
                                   "old_id" => \@old_project_ids },
434
                   "employees" => "ALL_SALESMEN");
434
                   "employees" => "ALL_SALESMEN",
435
                   "taxzones" => "ALL_TAXZONES");
435 436

  
436 437
  my %labels;
437 438
  my @values = (undef);
......
489 490
         </tr>|;
490 491
  }
491 492

  
493

  
494
  %labels = ();
495
  @values = ();
496
  foreach my $item (@{ $form->{"ALL_TAXZONES"} }) {
497
    push(@values, $item->{"id"});
498
    $labels{$item->{"id"}} = $item->{"description"};
499
  }
500

  
501
  $taxzone = qq|
502
    <tr>
503
      <th align="right">| . $locale->text('Steuersatz') . qq|</th>
504
      <td>| .
505
        NTI($cgi->popup_menu('-name' => 'taxzone_id', '-default' => $form->{"taxzone_id"},
506
                             '-values' => \@values, '-labels' => \%labels)) . qq|
507
      </td>
508
    </tr>|;
509

  
492 510
  $form->{exchangerate} =
493 511
    $form->format_amount(\%myconfig, $form->{exchangerate});
494 512

  
......
560 578
|;
561 579
  }
562 580

  
563
  if (@{ $form->{TAXZONE} }) {
564
    $form->{selecttaxzone} = "";
565
    foreach $item (@{ $form->{TAXZONE} }) {
566
      if ($item->{id} == $form->{taxzone_id}) {
567
        $form->{selecttaxzone} .=
568
          "<option value=$item->{id} selected>" . H($item->{description}) .
569
          "</option>";
570
      } else {
571
        $form->{selecttaxzone} .=
572
          "<option value=$item->{id}>" . H($item->{description}) . "</option>";
573
      }
574

  
575
    }
576
  } else {
577
    $form->{selecttaxzone} =~ s/ selected//g;
578
    if ($form->{taxzone_id} ne "") {
579
      $form->{selecttaxzone} =~ s/value=$form->{taxzone_id}>/value=$form->{taxzone_id} selected>/;
580
    }
581
  }
582

  
583
  $taxzone = qq|
584
	      <tr>
585
		<th align=right>| . $locale->text('Steuersatz') . qq|</th>
586
		<td><select name=taxzone_id>$form->{selecttaxzone}</select></td>
587
		<input type=hidden name=selecttaxzone value="$form->{selecttaxzone}">
588
	      </tr>|;
589

  
590

  
591 581
  if ($form->{type} !~ /_quotation$/) {
592 582
    $ordnumber = qq|
593 583
	      <tr>

Auch abrufbar als: Unified diff