X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=f5f846037b1a6054844d1ec739fc886f9c74cf70;hb=9d60642b51924a3fc44a0108777f0611ae19fb30;hp=2ffccd39be5db60682571704dd1b43c5df7faf4d;hpb=5ca651f0b08f68c1f977868204b3629217785157;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 2ffccd39b..f5f846037 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -31,14 +31,20 @@ # #====================================================================== +use POSIX qw(strftime); +use List::Util qw(sum); + +use SL::FU; use SL::GL; +use SL::IS; use SL::PE; +use SL::ReportGenerator; -require "$form->{path}/arap.pl"; - -1; +require "bin/mozilla/common.pl"; +require "bin/mozilla/drafts.pl"; +require "bin/mozilla/reportgenerator.pl"; -# end of main +use strict; # this is for our long dates # $locale->text('January') @@ -68,64 +74,67 @@ require "$form->{path}/arap.pl"; # $locale->text('Nov') # $locale->text('Dec') +my $tax; +my $debitlock = 0; +my $creditlock = 0; + sub add { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + $main::auth->assert('general_ledger'); + + my $form = $main::form; + my %myconfig = %main::myconfig; + + return $main::lxdebug->leave_sub() if (load_draft_maybe()); $form->{title} = "Add"; - $form->{callback} = - "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}" - unless $form->{callback}; + $form->{callback} = "gl.pl?action=add" unless $form->{callback}; # we use this only to set a default date + # yep. aber er holt hier auch schon ALL_CHARTS. Aufwand / Nutzen? jb GL->transaction(\%myconfig, \%$form); - map { - $chart .= - "" - } @{ $form->{chart} }; map { $tax .= qq|" - } @{ $form->{chart} }; map { $tax .= @@ -133,30 +142,24 @@ sub edit { . ($_->{rate} * 100) . qq| %| } @{ $form->{TAX} }; - $form->{chart} = $chart; - - $form->{taxchart} = $tax; - $form->{amount} = $form->format_amount(\%myconfig, $form->{amount}, 2); # departments $form->all_departments(\%myconfig); - if (@{ $form->{all_departments} }) { + if (@{ $form->{all_departments} || [] }) { $form->{selectdepartment} = "