Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 40cfb5ee

Von Kivitendo Admin vor mehr als 7 Jahren hinzugefügt

  • ID 40cfb5eee3162b7e25b20f7e0f52c3def98313bc
  • Vorgänger f0747a2f
  • Nachfolger 0e60202e

Kreditorenbuchung - Abteilung nutzt immer L.select_tag als Dropdown

Unterschiede anzeigen:

SL/AP.pm
66 66
  $form->{defaultcurrency} = $form->get_default_currency($myconfig);
67 67
  $form->{taxincluded} = 0 unless $form->{taxincluded};
68 68

  
69
  ($null, $form->{department_id}) = split(/--/, $form->{department});
70

  
71 69
  if ($form->{currency} eq $form->{defaultcurrency}) {
72 70
    $form->{exchangerate} = 1;
73 71
  } else {
......
463 461
    $where .= " AND (cp.cp_name ILIKE ? OR cp.cp_givenname ILIKE ?)";
464 462
    push(@values, (like($form->{"cp_name"}))x2);
465 463
  }
466
  if ($form->{department}) {
467
    # ähnlich wie commit 0bbfb33b6aa8e38bb6c81d1684ab7d08e5b5c5af abteilung
468
    # wird so nicht mehr als zeichenkette zusammengebaut
469
    # hätte zu ee9f9f9aa4c3b9d5d20ab10a45c12bcaa6aa78d0 auffallen können ;-) jan
470
    #my ($null, $department_id) = split /--/, $form->{department};
464
  if ($form->{department_id}) {
471 465
    $where .= " AND a.department_id = ?";
472
    push(@values, $form->{department});
466
    push(@values, $form->{department_id});
473 467
  }
474 468
  if ($form->{invnumber}) {
475 469
    $where .= " AND a.invnumber ILIKE ?";
bin/mozilla/ap.pl
100 100
  $form->{initial_transdate} = $form->{transdate};
101 101
  create_links(dont_save => 1);
102 102
  $form->{transdate} = $form->{initial_transdate};
103

  
103 104
  &display_form;
104 105

  
105 106
  $main::lxdebug->leave_sub();
......
187 188
      (@{ $form->{all_vendor} });
188 189
  }
189 190

  
190
  # departments
191
  if (@{ $form->{all_departments} || [] }) {
192
    $form->{department}       = "$form->{department}--$form->{department_id}";
193
    $form->{selectdepartment} = "<option>\n" . join('', map { my $quoted = H("$_->{description}--$_->{id}"); "<option value=\"${quoted}\">${quoted}\n"} @{ $form->{all_departments} || [] });
194
  }
191
  $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
195 192

  
196 193
  $form->{employee} = "$form->{employee}--$form->{employee_id}";
197 194

  
......
242 239
  # type=submit $locale->text('Edit Accounts Payables Transaction')
243 240

  
244 241
  # set option selected
245
  foreach my $item (qw(vendor currency department)) {
242
  foreach my $item (qw(vendor currency)) {
246 243
    my $to_replace         =  H($form->{$item});
247 244
    $form->{"select$item"} =~ s/ selected//;
248 245
    $form->{"select$item"} =~ s/>\Q${to_replace}\E/ selected>${to_replace}/;
......
297 294
    @{ $form->{ALL_CHARTS} }
298 295
  );
299 296

  
297
  $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
298

  
300 299
  my %project_labels = ();
301 300
  foreach my $item (@{ $form->{"ALL_PROJECTS"} }) {
302 301
    $project_labels{$item->{id}} = $item->{projectnumber};
......
675 674
  $form->isblank("vendor",    $locale->text('Vendor missing!'));
676 675
  $form->isblank("invnumber", $locale->text('Invoice Number missing!'));
677 676

  
678
  if ($myconfig{mandatory_departments} && !$form->{department}) {
677
  if ($myconfig{mandatory_departments} && !$form->{department_id}) {
679 678
    $form->{saved_message} = $::locale->text('You have to specify a department.');
680 679
    update();
681 680
    exit;
......
887 886
  $form->{title}    = $locale->text('AP Transactions');
888 887

  
889 888
  $form->get_lists("projects"     => { "key" => "ALL_PROJECTS", "all" => 1 },
890
                   "departments"  => "ALL_DEPARTMENTS",
891 889
                   "vendors"      => "ALL_VC");
892 890

  
891
  $::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
893 892
  # constants and subs for template
894 893
  $form->{vc_keys}   = sub { "$_[0]->{name}--$_[0]->{id}" };
895 894

  
......
945 944
       vendornumber country ustid taxzone payment_terms charts direct_debit);
946 945

  
947 946
  my @hidden_variables = map { "l_${_}" } @columns;
948
  push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id transdatefrom transdateto department
947
  push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id transdatefrom transdateto
949 948
                                           parts_partnumber parts_description);
950 949

  
951 950
  my $href = build_std_url('action=ap_transactions', grep { $form->{$_} } @hidden_variables);
......
997 996
  my @options;
998 997
  push @options, $locale->text('Vendor')                  . " : $form->{vendor}"                         if ($form->{vendor});
999 998
  push @options, $locale->text('Contact Person')          . " : $form->{cp_name}"                        if ($form->{cp_name});
1000
  push @options, $locale->text('Department')              . " : " . (split /--/, $form->{department})[0] if ($form->{department});
999
  push @options, $locale->text('Department')              . " : $form->{department}"                     if ($form->{department});
1001 1000
  push @options, $locale->text('Invoice Number')          . " : $form->{invnumber}"                      if ($form->{invnumber});
1002 1001
  push @options, $locale->text('Order Number')            . " : $form->{ordnumber}"                      if ($form->{ordnumber});
1003 1002
  push @options, $locale->text('Notes')                   . " : $form->{notes}"                          if ($form->{notes});
templates/webpages/ap/form_header.html
28 28
<form method="post" action="[% script | html %]">
29 29

  
30 30
<input type="hidden" name="selectvendor" value="[% selectvendor | html %]">
31
<input type="hidden" name="selectdepartment" value="[% selectdepartment | html %]">
32 31
<input type="hidden" name="selectcurrency" value="[% selectcurrency | html %]">
33 32

  
34 33
<input type="hidden" name="oldvendor" value="[% oldvendor | html %]">
......
149 148

  
150 149
              </tr>
151 150

  
152
              [% IF ( selectdepartment ) %]
151
              [% IF ALL_DEPARTMENTS %]
153 152
                <tr>
154 153
                  <th align="right" nowrap>[% 'Department' | $T8 %]</th>
155
                  <td colspan="3">
156
                    <select name="department">[% selectdepartment %]</select>
157
                  </td>
154
                  <td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, default = department_id, title_key = 'description', with_empty = 1) %]</td>
158 155
                </tr>
159 156
              [% END %]
160 157

  
templates/webpages/ap/search.html
33 33
    </tr>
34 34
     <tr>
35 35
      <th align=right nowrap>[% 'Department' | $T8 %]</th>
36
      <td>
37
            [%- INCLUDE 'generic/multibox.html'
38
                 name          = 'department',
39
                 style         = 'width: 250px',
40
                 DATA          = ALL_DEPARTMENTS,
41
                 id_key        = 'id',
42
                 label_key     = 'description',
43
                 show_empty    = 1,
44
                 allow_textbox = 0,
45
            -%]
46
      </td>
36
      <td colspan=3>[% L.select_tag('department_id', ALL_DEPARTMENTS, title_key = 'description', with_empty = 1, style="width: 200px") %]</td>
47 37
     </tr>
48 38
     <tr>
49 39
      <th align=right nowrap>[% 'Invoice Number' | $T8 %]</th>

Auch abrufbar als: Unified diff