X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Far.pl;h=969d73d2afab50506cea37cf9b333080f2a391d3;hb=ee56f1b20ab915671ded297f593c0e2e245bad70;hp=e6265e02067e0232cc98ad200efb3898fa6fb8b0;hpb=f7b15d4334848fad1bcd0b569eff5139f9a6ba4d;p=kivitendo-erp.git
diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl
index e6265e020..969d73d2a 100644
--- a/bin/mozilla/ar.pl
+++ b/bin/mozilla/ar.pl
@@ -38,13 +38,15 @@ use List::UtilsBy qw(sort_by);
use SL::AR;
use SL::FU;
+use SL::GL;
use SL::IS;
-use SL::PE;
+use SL::DB::Business;
+use SL::DB::Currency;
use SL::DB::Default;
+use SL::DB::Employee;
use SL::DB::Invoice;
use SL::ReportGenerator;
-require "bin/mozilla/arap.pl";
require "bin/mozilla/common.pl";
require "bin/mozilla/reportgenerator.pl";
@@ -102,6 +104,12 @@ sub add {
$form->{initial_transdate} = $form->{transdate};
create_links(dont_save => 1);
$form->{transdate} = $form->{initial_transdate};
+
+ if ($form->{customer_id}) {
+ 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;
+ }
+
&display_form;
$main::lxdebug->leave_sub();
}
@@ -166,41 +174,13 @@ sub create_links {
IS->get_customer(\%myconfig, \%$form);
$form->{$_} = $saved{$_} for keys %saved;
- $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
$form->{rowcount} = 1;
+ $form->{AR_chart_id} = $form->{acc_trans} && $form->{acc_trans}->{AR} ? $form->{acc_trans}->{AR}->[0]->{chart_id} : $form->{AR_links}->{AR}->[0]->{chart_id};
# currencies
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
- $form->{selectcurrency} = "";
- map { $form->{selectcurrency} .= "