Wenn nur ein Konto ohne Wert vorhanden ist, gehen wir davon aus,
dass der Anwender einen anderen Kunden/Lieferanten buchen möchten und
hier das zuletzt bebuchte Konto als Default möchte
if (($form->{previous_vendor_id} || $form->{vendor_id}) != $form->{vendor_id}) {
IR->get_vendor(\%::myconfig, $form);
+ if (($form->{rowcount} == 1) && ($form->{amount_1} == 0)) {
+ my $last_used_ap_chart = SL::DB::Vendor->load_cached($form->{vendor_id})->last_used_ap_chart;
+ $form->{"AP_amount_chart_id_1"} = $last_used_ap_chart->id if $last_used_ap_chart;
+ }
}
$form->{rowcount} = $count + ($params{dont_add_new_row} ? 0 : 1);
if (($form->{previous_customer_id} || $form->{customer_id}) != $form->{customer_id}) {
IS->get_customer(\%myconfig, $form);
+ if (($form->{rowcount} == 1) && ($form->{amount_1} == 0)) {
+ my $last_used_ar_chart = SL::DB::Customer->load_cached($form->{customer_id})->last_used_ar_chart;
+ $form->{"AR_amount_chart_id_1"} = $last_used_ar_chart->id if $last_used_ar_chart;
+ }
}
$form->{invtotal} =