176 |
176 |
IR->get_vendor(\%myconfig, \%$form);
|
177 |
177 |
|
178 |
178 |
$form->{$_} = $saved{$_} for keys %saved;
|
179 |
|
$form->{oldvendor} = "$form->{vendor}--$form->{vendor_id}";
|
180 |
179 |
$form->{rowcount} = 1;
|
181 |
180 |
$form->{AP_chart_id} = $form->{acc_trans} && $form->{acc_trans}->{AP} ? $form->{acc_trans}->{AP}->[0]->{chart_id} : $form->{AP_links}->{AP}->[0]->{chart_id};
|
182 |
181 |
|
... | ... | |
186 |
185 |
# currencies
|
187 |
186 |
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
|
188 |
187 |
|
189 |
|
# vendors
|
190 |
|
if (@{ $form->{all_vendor} || [] }) {
|
191 |
|
$form->{vendor} = qq|$form->{vendor}--$form->{vendor_id}|;
|
192 |
|
map { my $quoted = H($_->{name} . "--" . $_->{id}); $form->{selectvendor} .= "<option value=\"${quoted}\">${quoted}\n" }
|
193 |
|
(@{ $form->{all_vendor} });
|
194 |
|
}
|
195 |
|
|
196 |
|
$::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all;
|
|
188 |
$::form->{ALL_DEPARTMENTS} = SL::DB::Manager::Department->get_all_sorted;
|
197 |
189 |
|
198 |
190 |
$form->{employee} = "$form->{employee}--$form->{employee_id}";
|
199 |
191 |
|
... | ... | |
237 |
229 |
|
238 |
230 |
$::form->{invoice_obj} = SL::DB::PurchaseInvoice->new(id => $::form->{id})->load if $::form->{id};
|
239 |
231 |
|
240 |
|
$form->{initial_focus} = !($form->{amount_1} * 1) ? 'vendor' : 'row_' . $form->{rowcount};
|
|
232 |
$form->{initial_focus} = !($form->{amount_1} * 1) ? 'vendor_id' : 'row_' . $form->{rowcount};
|
241 |
233 |
|
242 |
234 |
$form->{title_} = $form->{title};
|
243 |
235 |
$form->{title} = $form->{title} eq 'Add' ? $locale->text('Add Accounts Payables Transaction') : $locale->text('Edit Accounts Payables Transaction');
|
... | ... | |
245 |
237 |
# type=submit $locale->text('Add Accounts Payables Transaction')
|
246 |
238 |
# type=submit $locale->text('Edit Accounts Payables Transaction')
|
247 |
239 |
|
248 |
|
# set option selected
|
249 |
|
foreach my $item (qw(vendor)) {
|
250 |
|
my $to_replace = H($form->{$item});
|
251 |
|
$form->{"select$item"} =~ s/ selected//;
|
252 |
|
$form->{"select$item"} =~ s/>\Q${to_replace}\E/ selected>${to_replace}/;
|
253 |
|
}
|
254 |
240 |
my $readonly = $form->{id} ? "readonly" : "";
|
255 |
241 |
|
256 |
242 |
$form->{radier} = ($::instance_conf->get_ap_changeable == 2)
|
... | ... | |
322 |
308 |
$charts{$item->{accno}} = $item;
|
323 |
309 |
}
|
324 |
310 |
|
325 |
|
my $follow_up_vc = $form->{vendor};
|
326 |
|
$follow_up_vc =~ s/--.*?//;
|
|
311 |
my $follow_up_vc = $form->{vendor_id} ? SL::DB::Vendor->load_cached($form->{vendor_id})->name : '';
|
327 |
312 |
my $follow_up_trans_info = "$form->{invnumber} ($follow_up_vc)";
|
328 |
313 |
|
329 |
|
$::request->layout->add_javascripts("autocomplete_chart.js", "show_vc_details.js", "show_history.js", "follow_up.js", "kivi.Draft.js", "kivi.GL.js");
|
|
314 |
$::request->layout->add_javascripts("autocomplete_chart.js", "autocomplete_customer.js", "show_vc_details.js", "show_history.js", "follow_up.js", "kivi.Draft.js", "kivi.GL.js");
|
330 |
315 |
my $transdate = $::form->{transdate} ? DateTime->from_kivitendo($::form->{transdate}) : DateTime->today_local;
|
331 |
316 |
my $first_taxchart;
|
332 |
317 |
|
... | ... | |
524 |
509 |
|
525 |
510 |
$form->{invdate} = $form->{transdate};
|
526 |
511 |
|
527 |
|
my $vendor_changed = &check_name("vendor");
|
|
512 |
if (($form->{previous_vendor_id} || $form->{vendor_id}) != $form->{vendor_id}) {
|
|
513 |
IR->get_vendor(\%::myconfig, $form);
|
|
514 |
}
|
528 |
515 |
|
529 |
516 |
$form->{rowcount} = $count + 1;
|
530 |
517 |
|
... | ... | |
627 |
614 |
# check if there is a vendor, invoice, due date and invnumber
|
628 |
615 |
$form->isblank("transdate", $locale->text("Invoice Date missing!"));
|
629 |
616 |
$form->isblank("duedate", $locale->text("Due Date missing!"));
|
630 |
|
$form->isblank("vendor", $locale->text('Vendor missing!'));
|
|
617 |
$form->isblank("vendor_id", $locale->text('Vendor missing!'));
|
631 |
618 |
$form->isblank("invnumber", $locale->text('Invoice Number missing!'));
|
632 |
619 |
|
633 |
620 |
if ($myconfig{mandatory_departments} && !$form->{department_id}) {
|
... | ... | |
682 |
669 |
}
|
683 |
670 |
|
684 |
671 |
# if old vendor ne vendor redo form
|
685 |
|
my ($vendor) = split /--/, $form->{vendor};
|
686 |
|
if ($form->{oldvendor} ne "$vendor--$form->{vendor_id}") {
|
|
672 |
if (($form->{previous_customer_id} || $form->{customer_id}) != $form->{customer_id}) {
|
687 |
673 |
&update;
|
688 |
674 |
$::dispatcher->end_request;
|
689 |
675 |
}
|
Kreditorenbuchungen: Kundenauswahl über Picker