X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fgl.pl;h=5069cefa7f89fd26cfbab3999b07fa99c7fd153b;hb=29d636435456494e8dc702ccc1015452a71275d9;hp=e0a5811d24525ad81de0b84c2d53761593acfffe;hpb=ee072e4f077213bf6f8792ca8f0a1afebbb6282f;p=kivitendo-erp.git
diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl
index e0a5811d2..5069cefa7 100644
--- a/bin/mozilla/gl.pl
+++ b/bin/mozilla/gl.pl
@@ -31,12 +31,16 @@
#
#======================================================================
+use POSIX qw(strftime);
+
use SL::GL;
+use SL::IS;
use SL::PE;
+use SL::ReportGenerator;
-use Data::Dumper;
-
-require "$form->{path}/arap.pl";
+require "bin/mozilla/arap.pl";
+require "bin/mozilla/common.pl";
+require "bin/mozilla/reportgenerator.pl";
1;
@@ -76,35 +80,24 @@ sub add {
$form->{title} = "Add";
$form->{callback} =
- "$form->{script}?action=add&path=$form->{path}&login=$form->{login}&password=$form->{password}"
+ "$form->{script}?action=add&login=$form->{login}&password=$form->{password}"
unless $form->{callback};
# we use this only to set a default date
GL->transaction(\%myconfig, \%$form);
- map {
- $chart .=
- ""
- } @{ $form->{chart} };
map {
$tax .=
- qq|"
- } @{ $form->{chart} };
- $form->{chart} = $chart;
- map {
- $tax .=
- qq|";
- $form->{debitchart} =
- "";
- } else {
- $form->{creditchart} = $form->{chart};
- $form->{creditchart} =~
- s/value=\"$form->{creditchartselected}\"/value=\"$form->{creditchartselected}\" selected/;
+ print qq|
+ $accno
+ $fx_transaction
+ |
+ |
+ |
+ $korrektur
+ $tax|;
- $form->{debitchart} = $form->{chart};
- $form->{debitchart} =~
- s/value=\"$form->{debitchartselected}\"/value=\"$form->{debitchartselected}\" selected/;
- }
- ($debitaccno, $debittaxkey) = split(/--/, $form->{debitchartselected});
- ($creditaccno, $credittaxkey) = split(/--/, $form->{creditchartselected});
- if ($debittaxkey > 0) {
- $form->{taxchart} = $form->unescape($form->{taxchart});
- $form->{taxchart} =~ s/selected//ig;
- $form->{taxchart} =~
- s/\"$debittaxkey--([^\"]*)\"/\"$debittaxkey--$1\" selected/;
-
- $rate = $1;
-
- if ($form->{taxincluded}) {
- $form->{debit} =
- $form->parse_amount(\%myconfig, $form->{amount}) / ($rate + 1);
- $form->{credit} = $form->parse_amount(\%myconfig, $form->{amount}) * 1;
- $form->{tax} =
- $form->parse_amount(\%myconfig, $form->{amount}) / ($rate + 1) * $rate;
- } else {
- $form->{debit} = $form->parse_amount(\%myconfig, $form->{amount}) * 1;
- $form->{credit} =
- $form->parse_amount(\%myconfig, $form->{amount}) * ($rate + 1);
- $form->{tax} = $form->parse_amount(\%myconfig, $form->{amount}) * $rate;
- }
- } else {
- $form->{taxchart} = $form->unescape($form->{taxchart});
- $form->{taxchart} =~ s/selected//ig;
- $form->{taxchart} =~
- s/\"$credittaxkey--([^\"]*)\"/\"$credittaxkey--$1\" selected/;
- $rate = $1;
-
- if ($form->{taxincluded}) {
- $form->{debit} = $form->parse_amount(\%myconfig, $form->{amount}) * 1;
- $form->{credit} =
- $form->parse_amount(\%myconfig, $form->{amount}) / ($rate + 1);
- $form->{tax} =
- $form->parse_amount(\%myconfig, $form->{amount}) / ($rate + 1) * $rate;
- } else {
- $form->{debit} =
- $form->parse_amount(\%myconfig, $form->{amount}) * ($rate + 1);
- $form->{credit} = $form->parse_amount(\%myconfig, $form->{amount}) * 1;
- $form->{tax} = $form->parse_amount(\%myconfig, $form->{amount}) * $rate;
+ if ($form->{show_details}) {
+ print qq|
+ $source
+ $memo
+ $projectnumber |
+|;
}
+ print qq|
+
+|;
}
- if ($form->{credit_splited}) {
- $form->{debit} = $form->parse_amount(\%myconfig, $form->{amount}) * 1;
- $form->{credit} = $credit_save;
- $form->{tax} = 0;
- } elsif ($form->{debit_splited}) {
- $form->{credit} = $form->parse_amount(\%myconfig, $form->{amount}) * 1;
- $form->{debit} = $debit_save;
- $form->{tax} = 0;
- }
- &check_project;
- &display_form;
+ $form->hide_form(qw(rowcount selectaccno));
$lxdebug->leave_sub();
-}
-sub display_form {
- $lxdebug->enter_sub();
-
- &form_header;
-
- # for $i (1 .. $form->{rowcount}) {
- # $form->{totaldebit} += $form->parse_amount(\%myconfig, $form->{"debit_$i"});
- # $form->{totalcredit} += $form->parse_amount(\%myconfig, $form->{"credit_$i"});
- #
- # &form_row($i);
- # }
-
- &form_footer;
-
- $lxdebug->leave_sub();
}
sub form_header {
+ my ($init) = @_;
$lxdebug->enter_sub();
-
$title = $form->{title};
$form->{title} = $locale->text("$title General Ledger Transaction");
$readonly = ($form->{id}) ? "readonly" : "";
- $form->{urldebit} =
- "$form->{script}?action=split_debit&path=$form->{path}&login=$form->{login}&password=$form->{password}";
- $form->{urlcredit} =
- "$form->{script}?action=split_credit&path=$form->{path}&login=$form->{login}&password=$form->{password}";
+ $show_details_checked = "checked" if $form->{show_details};
# $locale->text('Add General Ledger Transaction')
# $locale->text('Edit General Ledger Transaction')
- map { $form->{$_} =~ s/\"/"/g } qw(reference description chart);
+
+ map { $form->{$_} =~ s/\"/"/g }
+ qw(reference description chart taxchart);
+
+ $form->{javascript} = qq||;
+ $form->{javascript} .= qq||;
$form->{selectdepartment} =~ s/ selected//;
- $form->{taxchart} =~ s/ selected//;
$form->{selectdepartment} =~
s/option>\Q$form->{department}\E/option selected>$form->{department}/;
@@ -1023,18 +1003,15 @@ sub form_header {
qq||;
} else {
$description =
- qq||;
+ qq||;
}
$taxincluded = ($form->{taxincluded}) ? "checked" : "";
- if (!$form->{id}) {
+ if ($init) {
$taxincluded = "checked";
}
- $amount =
- qq||;
-
$department = qq|
| . $locale->text('Department') . qq| |
@@ -1042,51 +1019,49 @@ sub form_header {
| if $form->{selectdepartment};
-
- $form->{fokus} = "gl.reference";
- $form->{remote} = 1;
+ if ($init) {
+ $form->{fokus} = "gl.reference";
+ } else {
+ $form->{fokus} = qq|gl.accno_$form->{rowcount}|;
+ }
# use JavaScript Calendar or not
- $form->{jsscript} = $jscalendar;
+ $form->{jsscript} = 1;
$jsscript = "";
if ($form->{jsscript}) {
# with JavaScript Calendar
$button1 = qq|
- {transdate} tabindex="2" $readonly> |
- text('button')
- . qq|> |
+
+ text('button') . qq|> |
|;
#write Trigger
$jsscript =
- Form->write_trigger(\%myconfig, "1", "transdate", "BL", "trigger1", "",
- "", "");
+ Form->write_trigger(\%myconfig, "1", "transdate", "BL", "trigger1");
} else {
# without JavaScript Calendar
$button1 =
- qq|{transdate} tabindex="2" $readonly> | |;
+ qq| | |;
}
+ $form->{previous_id} ||= "--";
+ $form->{previous_gldate} ||= "--";
+
$form->header;
print qq|