Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 51502881

Von Moritz Bunkus vor fast 8 Jahren hinzugefügt

  • ID 515028812cc3764b1f5c44a01739e07658041028
  • Vorgänger 6e594d28
  • Nachfolger ca0df4c4

Debitorenbuchungen: Währungs-/Verkäufer-Drop-Downs nicht als Hidden mitschleifen

Unterschiede anzeigen:

SL/AR.pm
99 99
  }
100 100
  $form->{paid}   = $form->round_amount($form->{paid} * ($form->{exchangerate} || 1), 2);
101 101

  
102
  ($null, $form->{employee_id}) = split /--/, $form->{employee};
103

  
104 102
  $form->get_employee($dbh) unless $form->{employee_id};
105 103

  
106 104
  # if we have an id delete old records else make one
bin/mozilla/ar.pl
40 40
use SL::FU;
41 41
use SL::GL;
42 42
use SL::IS;
43
use SL::DB::Currency;
43 44
use SL::DB::Default;
45
use SL::DB::Employee;
44 46
use SL::DB::Invoice;
45 47
use SL::ReportGenerator;
46 48

  
......
179 181
  # currencies
180 182
  $form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
181 183

  
182
  $form->{selectcurrency} = "";
183
  map { $form->{selectcurrency} .= "<option>$_\n" } $form->get_all_currencies(\%myconfig);
184

  
185 184
  # customers
186 185
  if (@{ $form->{all_customer} || [] }) {
187 186
    $form->{customer} = "$form->{customer}--$form->{customer_id}";
......
191 190

  
192 191
  $form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
193 192

  
194
  $form->{employee} = "$form->{employee}--$form->{employee_id}";
195

  
196
  # sales staff
197
  if (@{ $form->{all_employees} || [] }) {
198
    $form->{selectemployee} = "";
199
    map { $form->{selectemployee} .= "<option>$_->{name}--$_->{id}\n" }
200
      (@{ $form->{all_employees} || [] });
201
  }
202

  
203 193
  # build the popup menus
204 194
  $form->{taxincluded} = ($form->{id}) ? $form->{taxincluded} : "checked";
205 195

  
......
225 215
  $form->{invoice_obj} = _retrieve_invoice_object();
226 216

  
227 217
  my ($title, $readonly, $exchangerate, $rows);
228
  my ($notes, $customer, $employee, $amount, $project);
218
  my ($notes, $customer, $amount, $project);
229 219

  
230 220
  $form->{initial_focus} = !($form->{amount_1} * 1) ? 'customer' : 'row_' . $form->{rowcount};
231 221

  
......
242 232
  $readonly = ($form->{radier}) ? "" : $readonly;
243 233

  
244 234
  # set option selected
245
  foreach my $item (qw(customer currency employee)) {
235
  foreach my $item (qw(customer)) {
246 236
    $form->{"select$item"} =~ s/ selected//;
247 237
    $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
248 238
  }
......
388 378

  
389 379
  $form->{totalpaid} = sum map { $_->{paid} } @payments;
390 380

  
381
  my $employees = SL::DB::Manager::Employee->get_all_sorted(
382
    where => [
383
      or => [
384
        (id     => $::form->{employee_id}) x !!$::form->{employee_id},
385
        deleted => undef,
386
        deleted => 0,
387
      ],
388
    ],
389
  );
390

  
391 391
  $form->header;
392 392
  print $::form->parse_html_template('ar/form_header', {
393 393
    paid_missing         => $::form->{invtotal} - $::form->{totalpaid},
......
400 400
    title_str            => $title,
401 401
    follow_up_trans_info => $follow_up_trans_info,
402 402
    today                => DateTime->today,
403
    currencies           => scalar(SL::DB::Manager::Currency->get_all_sorted),
404
    employees            => $employees,
403 405
  });
404 406

  
405 407
  $main::lxdebug->leave_sub();
templates/webpages/ar/form_header.html
92 92
[%- END %]
93 93
              <tr>
94 94
                <th align=right>[% 'Currency' | $T8 %]</th>
95
                <td><select name=currency>[% selectcurrency %]</select></td>
96
                [% L.hidden_tag('selectcurrency', selectcurrency) %]
95
                <td>[% L.select_tag("currency", currencies, default=currency, value_key="name", title_key="name") %]</td>
97 96
                [% L.hidden_tag('defaultcurrency', defaultcurrency) %]
98 97
                [% L.hidden_tag('fxgain_accno', fxgain_accno) %]
99 98
                [% L.hidden_tag('fxloss_accno', fxloss_accno) %]
......
122 121
          </td>
123 122
          <td align=right>
124 123
            <table>
125
[%- IF selectemployee %]
126 124
              <tr>
127 125
                <th align=right nowrap>[% 'Salesperson' | $T8 %]</th>
128
                <td  colspan=2><select name=employee>[% selectemployee %]</select>[% L.hidden_tag('selectemployee', selectemployee) %]</td>
126
                <td  colspan=2>[% P.select_tag("employee_id", employees, default=employee_id, title_key='safe_name') %]</td>
129 127
              </tr>
130
[%- ELSE %]
131
                [% L.hidden_tag('employee', employee) %]
132
[%- END %]
133 128
              <tr>
134 129
                <th align=right nowrap>[% 'Invoice Number' | $T8 %]</th>
135 130
                <td><input name=invnumber size=11 value="[% invnumber | html %]"></td>

Auch abrufbar als: Unified diff