From 4d041eefc1e68131a77c879dce745c0bde61336c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Fri, 24 Mar 2017 15:20:30 +0100 Subject: [PATCH] Kreditoren/Debitoren-Buchung zuletzt bebuchtes Konto laden MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- bin/mozilla/ap.pl | 4 ++++ bin/mozilla/ar.pl | 4 ++++ 2 files changed, 8 insertions(+) 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} = -- 2.20.1