Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 57ac7b3c

Von Moritz Bunkus vor fast 12 Jahren hinzugefügt

  • ID 57ac7b3c45f98e44a8bd8452da70ac7fba182ca4
  • Vorgänger f4b68a78
  • Nachfolger d638ae94

"Verkäufer/in" bei Wechsel Kunde/Lieferant auf aktuellen Benutzer setzen, falls K/L keinen gesetzt hat

Fixt #1949.

Unterschiede anzeigen:

bin/mozilla/arap.pl
78 78

  
79 79
      $form->{"${name}_id"} = $new_id;
80 80

  
81
      _reset_salesman_id();
81 82
      IS->get_customer(\%myconfig, \%$form) if ($name eq 'customer');
82 83
      IR->get_vendor(\%myconfig, \%$form) if ($name eq 'vendor');
83 84

  
......
119 120
        $form->{$name}        = $form->{name_list}[0]->{name};
120 121
        $form->{"old$name"}   = qq|$form->{$name}--$form->{"${name}_id"}|;
121 122

  
123
        _reset_salesman_id();
122 124
        IS->get_customer(\%myconfig, \%$form) if ($name eq 'customer');
123 125
        IR->get_vendor(\%myconfig, \%$form) if ($name eq 'vendor');
124 126

  
......
266 268
  # index for new item
267 269
  my $i = $form->{ndx};
268 270

  
271
  _reset_salesman_id();
272

  
269 273
  $form->{ $form->{vc} }    = $form->{"new_name_$i"};
270 274
  $form->{"$form->{vc}_id"} = $form->{"new_id_$i"};
271 275
  $form->{"old$form->{vc}"} =
......
286 290
  $main::lxdebug->leave_sub();
287 291
}
288 292

  
293
# Reset the $::form field 'salesman_id' to the ID of the currently
294
# logged in user. Useful when changing to a customer/vendor that has
295
# no salesman listed in their master data.
296
sub _reset_salesman_id {
297
  my $current_employee   = SL::DB::Manager::Employee->current;
298
  $::form->{salesman_id} = $current_employee->id if $current_employee && exists $::form->{salesman_id};
299
}
300

  
289 301
sub check_project {
290 302
  $main::lxdebug->enter_sub();
291 303

  

Auch abrufbar als: Unified diff