X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fgl.pl;h=731f525767357c38d45bc2bfd75dec6041c71dd6;hb=9035c75520b38a06de076b53689f82c228b3d22c;hp=faaad58280a10c687612e0da15401241730be696;hpb=d629acd82a27e980899a044ca8b0f4becc8e94bb;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index faaad5828..731f52576 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -31,15 +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 "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; +require "bin/mozilla/drafts.pl"; +require "bin/mozilla/reportgenerator.pl"; -1; - -# end of main +use strict; # this is for our long dates # $locale->text('January') @@ -69,16 +74,26 @@ require "bin/mozilla/common.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&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 { @@ -104,13 +119,20 @@ sub add { } (@{ $form->{all_departments} }); } + $form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details}; + &display_form(1); - $lxdebug->leave_sub(); + $main::lxdebug->leave_sub(); } -sub edit { - $lxdebug->enter_sub(); +sub prepare_transaction { + $main::lxdebug->enter_sub(); + + $main::auth->assert('general_ledger'); + + my $form = $main::form; + my %myconfig = %main::myconfig; GL->transaction(\%myconfig, \%$form); @@ -136,8 +158,8 @@ sub edit { my $i = 1; my $tax = 0; my $taxaccno = ""; - foreach $ref (@{ $form->{GL} }) { - $j = $i - 1; + foreach my $ref (@{ $form->{GL} }) { + my $j = $i - 1; if ($tax && ($ref->{accno} eq $taxaccno)) { $form->{"tax_$j"} = abs($ref->{amount}); $form->{"taxchart_$j"} = $ref->{id} . "--" . $ref->{taxrate}; @@ -178,19 +200,42 @@ sub edit { ($form->datetonum($form->{transdate}, \%myconfig) <= $form->datetonum($form->{closedto}, \%myconfig)); + $main::lxdebug->leave_sub(); +} + +sub edit { + $main::lxdebug->enter_sub(); + + $main::auth->assert('general_ledger'); + + my $form = $main::form; + my %myconfig = %main::myconfig; + + prepare_transaction(); + $form->{title} = "Edit"; - &form_header; - &display_rows; - &form_footer; - $lxdebug->leave_sub(); + $form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details}; + + form_header(); + display_rows(); + form_footer(); + $main::lxdebug->leave_sub(); } + sub search { - $lxdebug->enter_sub(); + $main::lxdebug->enter_sub(); + + $main::auth->assert('general_ledger'); - $form->{title} = $locale->text('Buchungsjournal'); + my $form = $main::form; + my %myconfig = %main::myconfig; + my $locale = $main::locale; + my $cgi = $main::cgi; + + $form->{title} = $locale->text('Journal'); $form->all_departments(\%myconfig); @@ -204,7 +249,7 @@ sub search { } (@{ $form->{all_departments} }); } - $department = qq| + my $department = qq|