X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=fb0de34e94e94bc2a96e789b74129e53b69de362;hb=fbbbc3408edb8fee7e8afaf9c51fcebd8497d6eb;hp=731f525767357c38d45bc2bfd75dec6041c71dd6;hpb=2dacd2790bb5e0990ec5fe89a9d59370b018c25c;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 731f52576..fb0de34e9 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -31,6 +31,9 @@ # #====================================================================== +use utf8; +use strict; + use POSIX qw(strftime); use List::Util qw(sum); @@ -44,8 +47,6 @@ require "bin/mozilla/common.pl"; require "bin/mozilla/drafts.pl"; require "bin/mozilla/reportgenerator.pl"; -use strict; - # this is for our long dates # $locale->text('January') # $locale->text('February') @@ -74,10 +75,6 @@ use strict; # $locale->text('Nov') # $locale->text('Dec') -my $tax; -my $debitlock = 0; -my $creditlock = 0; - sub add { $main::lxdebug->enter_sub(); @@ -96,12 +93,6 @@ sub add { # yep. aber er holt hier auch schon ALL_CHARTS. Aufwand / Nutzen? jb GL->transaction(\%myconfig, \%$form); - map { - $tax .= - qq|$_->{taxdescription} | - . ($_->{rate} * 100) . qq| %| - } @{ $form->{TAX} }; - $form->{rowcount} = 2; $form->{debit} = 0; @@ -110,13 +101,13 @@ sub add { # departments $form->all_departments(\%myconfig); - if (@{ $form->{all_departments} }) { + if (@{ $form->{all_departments} || [] }) { $form->{selectdepartment} = "\n"; map { $form->{selectdepartment} .= "$_->{description}--$_->{id}\n" - } (@{ $form->{all_departments} }); + } (@{ $form->{all_departments} || [] }); } $form->{show_details} = $myconfig{show_form_details} unless defined $form->{show_details}; @@ -136,23 +127,17 @@ sub prepare_transaction { GL->transaction(\%myconfig, \%$form); - map { - $tax .= - qq|$_->{taxdescription} | - . ($_->{rate} * 100) . qq| %| - } @{ $form->{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} = "\n"; map { $form->{selectdepartment} .= "$_->{description}--$_->{id}\n" - } (@{ $form->{all_departments} }); + } (@{ $form->{all_departments} || [] }); } my $i = 1; @@ -226,199 +211,22 @@ sub edit { sub search { - $main::lxdebug->enter_sub(); - - $main::auth->assert('general_ledger'); - - 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); - - # departments - if (@{ $form->{all_departments} }) { - $form->{selectdepartment} = "\n"; - - map { - $form->{selectdepartment} .= - "$_->{description}--$_->{id}\n" - } (@{ $form->{all_departments} }); - } - - my $department = qq| - - | . $locale->text('Department') . qq| - $form->{selectdepartment} - -| if $form->{selectdepartment}; - - $form->get_lists("projects" => { "key" => "ALL_PROJECTS", - "all" => 1 }); - - my %project_labels = (); - my @project_values = (""); - foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { - push(@project_values, $item->{"id"}); - $project_labels{$item->{"id"}} = $item->{"projectnumber"}; - } - - my $projectnumber = - NTI($cgi->popup_menu('-name' => "project_id", - '-values' => \@project_values, - '-labels' => \%project_labels)); - - # use JavaScript Calendar or not - $form->{jsscript} = 1; - my $jsscript = ""; - my ($button1, $button2, $onload); - if ($form->{jsscript}) { - - # with JavaScript Calendar - $button1 = qq| - - text('button') . qq|> - |; - $button2 = qq| - - text('button') . qq|> - |; - - #write Trigger - $jsscript = - Form->write_trigger(\%myconfig, "2", "datefrom", "BR", "trigger1", - "dateto", "BL", "trigger2"); - } else { - - # without JavaScript Calendar - $button1 = - qq||; - $button2 = - qq||; - } - $form->{javascript} .= qq||; - $form->header; - $onload = qq|focus()|; - $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|; - $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|; - print qq| - - - - - - - - - $form->{title} - - - - - - - | . $locale->text('Reference') . qq| - - | . $locale->text('Source') . qq| - - - $department - - | . $locale->text('Description') . qq| - - - - | . $locale->text('Notes') . qq| - - - - | . $locale->text('Project Number') . qq| - $projectnumber - - - | . $locale->text('From') . qq| - $button1 - | . $locale->text('To (time)') . qq| - $button2 - - - | . $locale->text('Include in Report') . qq| - - - - - | - . $locale->text('All') . qq| - | - . $locale->text('Asset') . qq| - | - . $locale->text('Liability') . qq| - | - . $locale->text('Revenue') . qq| - | - . $locale->text('Expense') . qq| - - - - - - - | . $locale->text('ID') . qq| - - | . $locale->text('Date') . qq| - - | . $locale->text('Reference') . qq| - - | . $locale->text('Description') . qq| - - | . $locale->text('Notes') . qq| - - - - | . $locale->text('Debit') . qq| - - | . $locale->text('Credit') . qq| - - | . $locale->text('Source') . qq| - - | . $locale->text('Account') . qq| - - - - | . $locale->text('Subtotal') . qq| - - | . $locale->text('Project Number') . qq| - - - - - - - - - - - - - -$jsscript + $::lxdebug->enter_sub; + $::auth->assert('general_ledger'); - + $::form->all_departments(\%::myconfig); + $::form->get_lists( + projects => { key => "ALL_PROJECTS", all => 1 }, + ); + $::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]); - - - + $::form->header; + print $::form->parse_html_template('gl/search', { + department_label => sub { ("$_[0]{description}--$_[0]{id}")x2 }, + employee_label => sub { "$_[0]{id}--$_[0]{name}" }, + }); - -