X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fap.pl;h=a297bc601479a0ed5715d6e884b06fec4ce7b2a4;hb=ee56f1b20ab915671ded297f593c0e2e245bad70;hp=4ceb1281925c1897bf94d56c3f40ca2b8ad8d1dd;hpb=359506e56c71e419ac82c2adf0de22cfd6d59cfa;p=kivitendo-erp.git
diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl
index 4ceb12819..a297bc601 100644
--- a/bin/mozilla/ap.pl
+++ b/bin/mozilla/ap.pl
@@ -38,15 +38,16 @@ use List::UtilsBy qw(sort_by);
use SL::AP;
use SL::FU;
+use SL::GL;
use SL::IR;
use SL::IS;
use SL::ReportGenerator;
+use SL::DB::Currency;
use SL::DB::Default;
use SL::DB::PurchaseInvoice;
use SL::Webdav;
use SL::Locale::String qw(t8);
-require "bin/mozilla/arap.pl";
require "bin/mozilla/common.pl";
require "bin/mozilla/reportgenerator.pl";
@@ -100,6 +101,12 @@ sub add {
$form->{initial_transdate} = $form->{transdate};
create_links(dont_save => 1);
$form->{transdate} = $form->{initial_transdate};
+
+ if ($form->{vendor_id}) {
+ 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;
+ }
+
&display_form;
$main::lxdebug->leave_sub();
@@ -168,8 +175,8 @@ sub create_links {
IR->get_vendor(\%myconfig, \%$form);
$form->{$_} = $saved{$_} for keys %saved;
- $form->{oldvendor} = "$form->{vendor}--$form->{vendor_id}";
$form->{rowcount} = 1;
+ $form->{AP_chart_id} = $form->{acc_trans} && $form->{acc_trans}->{AP} ? $form->{acc_trans}->{AP}->[0]->{chart_id} : $form->{AP_links}->{AP}->[0]->{chart_id};
# build the popup menus
$form->{taxincluded} = ($form->{id}) ? $form->{taxincluded} : "checked";
@@ -177,21 +184,7 @@ sub create_links {
# currencies
$form->{defaultcurrency} = $form->get_default_currency(\%myconfig);
- $form->{selectcurrency} = "";
- map { my $quoted = H($_); $form->{selectcurrency} .= "