action =>
[ t8('Update'),
submit => [ '#form', { action => "update" } ],
+ id => 'update_button',
accesskey => 'enter',
],
],
action => [
t8('Transfer in'),
- submit => [ '#form', { action => "transfer_in"> 1 } ],
+ submit => [ '#form', { action => "transfer_in" } ],
checks => [ @req_trans_desc, @transfer_qty ],
disabled => $::form->{delivered} ? t8('This record has already been delivered.') : undef,
only_if => !$is_customer,
my $class = "SL::DB::" . ($form->{vc} eq 'customer' ? 'Customer' : 'Vendor');
$form->{VC_OBJ} = $class->load_cached($form->{ $form->{vc} . '_id' });
- $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id};
- $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id};
+ $form->{CONTACT_OBJ} = $form->{cp_id} ? SL::DB::Contact->load_cached($form->{cp_id}) : undef;
+ my $current_employee = SL::DB::Manager::Employee->current;
+ $form->{employee_id} = $form->{old_employee_id} if $form->{old_employee_id};
+ $form->{salesman_id} = $form->{old_salesman_id} if $form->{old_salesman_id};
+ $form->{employee_id} ||= $current_employee->id;
+ $form->{salesman_id} ||= $current_employee->id;
my $vc = $form->{vc} eq "customer" ? "customers" : "vendors";
$form->get_lists("price_factors" => "ALL_PRICE_FACTORS",