X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=0f34f1b94ff387f1d891996915acaf4b37561182;hb=e74c2ab4728dfdc932cd290db005ce2250e9d61b;hp=b90f29c14358c5920d3a6a762d1b26665c5827a0;hpb=27bdd44b8c9c45f438138076938935df43977f86;p=kivitendo-erp.git
diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl
index b90f29c14..0f34f1b94 100644
--- a/bin/mozilla/gl.pl
+++ b/bin/mozilla/gl.pl
@@ -32,15 +32,16 @@
#======================================================================
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/report_generator.pl";
+require "bin/mozilla/reportgenerator.pl";
1;
@@ -77,11 +78,11 @@ require "bin/mozilla/report_generator.pl";
sub add {
$lxdebug->enter_sub();
+ $auth->assert('general_ledger');
+
$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
GL->transaction(\%myconfig, \%$form);
@@ -119,6 +120,8 @@ sub add {
sub prepare_transaction {
$lxdebug->enter_sub();
+ $auth->assert('general_ledger');
+
GL->transaction(\%myconfig, \%$form);
map {
@@ -191,6 +194,8 @@ sub prepare_transaction {
sub edit {
$lxdebug->enter_sub();
+ $auth->assert('general_ledger');
+
prepare_transaction();
$form->{title} = "Edit";
@@ -208,6 +213,8 @@ sub edit {
sub search {
$lxdebug->enter_sub();
+ $auth->assert('general_ledger');
+
$form->{title} = $locale->text('Journal');
$form->all_departments(\%myconfig);
@@ -253,7 +260,7 @@ sub search {
$button1 = qq|
text('button') . qq|> |
+ . $locale->text('button') . qq|>
|;
$button2 = qq|
@@ -281,7 +288,7 @@ sub search {
print qq|
- | |;
if ($init) {
- $korrektur =
- qq| | |;
if ($form->{transfer}) {
$fx_transaction = qq|
|
@@ -892,14 +897,9 @@ sub display_rows {
$x |
|;
}
- $checked = ($form->{"korrektur_$i"}) ? "checked" : "";
- $korrektur =
- qq| | |;
$form->hide_form("accno_$i");
} else {
- $korrektur =
- qq| | |;
if ($form->{transfer}) {
$fx_transaction = qq|
|
@@ -927,11 +927,11 @@ sub display_rows {
print qq|
$accno
+ |
$fx_transaction
|
|
- |
- $korrektur
+ $form->{"tax_$i"} |
$tax|;
if ($form->{show_details}) {
@@ -942,6 +942,8 @@ sub display_rows {
|;
}
print qq|
+ $source_hidden
+ $memo_hidden
|;
}
@@ -955,12 +957,31 @@ sub display_rows {
sub form_header {
my ($init) = @_;
$lxdebug->enter_sub();
+
+ $auth->assert('general_ledger');
+
+ my @old_project_ids = ();
+ map({ push(@old_project_ids, $form->{"project_id_$_"})
+ if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
+
+ $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
+ "all" => 0,
+ "old_id" => \@old_project_ids },
+ "charts" => { "key" => "ALL_CHARTS",
+ "transdate" => $form->{transdate} },
+ "taxcharts" => "ALL_TAXCHARTS");
+
+ GL->get_chart_balances('charts' => $form->{ALL_CHARTS});
+
$title = $form->{title};
$form->{title} = $locale->text("$title General Ledger Transaction");
$readonly = ($form->{id}) ? "readonly" : "";
$show_details_checked = "checked" if $form->{show_details};
+ $ob_transaction_checked = "checked" if $form->{ob_transaction};
+ $cb_transaction_checked = "checked" if $form->{cb_transaction};
+
# $locale->text('Add General Ledger Transaction')
# $locale->text('Edit General Ledger Transaction')
@@ -989,10 +1010,11 @@ sub form_header {
var txt = document.getElementsByName('debit_1')[0].value;
document.getElementsByName('credit_2')[0].value = txt;
};
-
//-->
- |;
- $form->{javascript} .= qq||;
+
+
+
+|;
$form->{selectdepartment} =~ s/ selected//;
$form->{selectdepartment} =~
@@ -1034,7 +1056,7 @@ sub form_header {
$button1 = qq|
text('button') . qq|> |
+ . $locale->text('button') . qq|>
|;
#write Trigger
@@ -1050,12 +1072,16 @@ sub form_header {
$form->{previous_id} ||= "--";
$form->{previous_gldate} ||= "--";
+ $jsscript .= $form->parse_html_template('gl/form_header_chart_balances_js');
+
$form->header;
print qq|
-
+
+
+
-