From: Jan Büren Date: Fri, 24 Mar 2017 14:20:30 +0000 (+0100) Subject: Kreditoren/Debitoren-Buchung zuletzt bebuchtes Konto laden X-Git-Tag: release-3.5.4~1165 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=4d041eefc1e68131a77c879dce745c0bde61336c;p=kivitendo-erp.git Kreditoren/Debitoren-Buchung zuletzt bebuchtes Konto laden 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 --- diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index aad1fcaee..802e52a33 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -634,6 +634,10 @@ sub update { 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); diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index ec9ea951d..0f020a3a0 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -611,6 +611,10 @@ sub update { 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} =