X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Far.pl;h=969d73d2afab50506cea37cf9b333080f2a391d3;hb=ee56f1b20ab915671ded297f593c0e2e245bad70;hp=3b94d818f0cbe8ed88681b1acb0ba5efda350596;hpb=46aa98a931708ad5ee5003437af92f0358e582b3;p=kivitendo-erp.git
diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl
index 3b94d818f..969d73d2a 100644
--- a/bin/mozilla/ar.pl
+++ b/bin/mozilla/ar.pl
@@ -38,12 +38,15 @@ use List::UtilsBy qw(sort_by);
use SL::AR;
use SL::FU;
+use SL::GL;
use SL::IS;
+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";
@@ -101,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();
}
@@ -165,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} .= "