X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Far.pl;h=834e1b18e405f0f2d7a46b4cc2cc712207f39ef9;hb=4ac2976f86e7747ecf69a4e7b64f155343e984ae;hp=a8937506f6356b0626e3ad20e142f39ee57b9aff;hpb=57bf9c89a037036fcf433de39643778854defe51;p=kivitendo-erp.git diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index a8937506f..834e1b18e 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -32,12 +32,13 @@ #====================================================================== use POSIX qw(strftime); -use List::Util qw(sum first); +use List::Util qw(sum first max); use SL::AR; use SL::FU; use SL::IS; use SL::PE; +use SL::DB::Default; use SL::ReportGenerator; require "bin/mozilla/arap.pl"; @@ -76,8 +77,6 @@ use strict; # $locale->text('Nov') # $locale->text('Dec') -my $totalpaid; - sub add { $main::lxdebug->enter_sub(); @@ -91,13 +90,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}; @@ -147,7 +146,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}; @@ -166,37 +165,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} .= "