X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=45193ed877097e6c9d5161bc67a53925ab76ebc8;hb=de90e717775dfcf75d3a8ac4798e05d3f01b3d42;hp=88c0aefc9d394d8097180e0b345dee1be4f7b140;hpb=ebdc6e1374df06c55e623a8aa631d3c01bf082a1;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index 88c0aefc9..45193ed87 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -32,7 +32,7 @@ #====================================================================== use POSIX qw(strftime); -use List::Util qw(sum first); +use List::Util qw(sum first max); use SL::AR; use SL::FU; @@ -48,10 +48,6 @@ require "bin/mozilla/reportgenerator.pl"; use strict; #use warnings; -1; - -# end of main - # this is for our long dates # $locale->text('January') # $locale->text('February') @@ -80,8 +76,6 @@ use strict; # $locale->text('Nov') # $locale->text('Dec') -my $totalpaid; - sub add { $main::lxdebug->enter_sub(); @@ -95,13 +89,13 @@ sub add { # saving the history if(!exists $form->{addition} && ($form->{id} ne "")) { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; - $form->{addition} = "ADDED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->{addition} = "ADDED"; + $form->save_history; } # /saving the history $form->{title} = "Add"; - $form->{callback} = "ar.pl?action=add" unless $form->{callback}; + $form->{callback} = "ar.pl?action=add&DONT_LOAD_DRAFT=1" unless $form->{callback}; AR->get_transdate(\%myconfig, $form); $form->{initial_transdate} = $form->{transdate}; @@ -151,7 +145,7 @@ sub create_links { my $form = $main::form; my %myconfig = %main::myconfig; - my ($duedate, $taxincluded, @curr); + my ($duedate, $taxincluded); $form->create_links("AR", \%myconfig, "customer"); $duedate = $form->{duedate}; @@ -170,37 +164,35 @@ sub create_links { $form->{notes} = $form->{intnotes} unless $form->{notes}; # currencies - @curr = split(/:/, $form->{currencies}); - chomp $curr[0]; - $form->{defaultcurrency} = $curr[0]; + $form->{defaultcurrency} = $form->get_default_currency(\%myconfig); - map { $form->{selectcurrency} .= "