X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fgl.pl;h=faaad58280a10c687612e0da15401241730be696;hb=a200453a04fc89fdf02dbe39e1d951cb1b55191c;hp=2668083bb3422b45a948640f0ad72be01747883a;hpb=a14a3ff56b00e22c39a2cfb0e465f8c7764a4cd4;p=kivitendo-erp.git
diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl
index 2668083bb..faaad5828 100644
--- a/bin/mozilla/gl.pl
+++ b/bin/mozilla/gl.pl
@@ -34,7 +34,8 @@
use SL::GL;
use SL::PE;
-require "$form->{path}/arap.pl";
+require "bin/mozilla/arap.pl";
+require "bin/mozilla/common.pl";
1;
@@ -74,30 +75,20 @@ 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} };
map {
$tax .=
@@ -133,10 +120,6 @@ sub edit {
. ($_->{rate} * 100) . qq| %|
} @{ $form->{TAX} };
- $form->{chart} = $chart;
-
- $form->{taxchart} = $tax;
-
$form->{amount} = $form->format_amount(\%myconfig, $form->{amount}, 2);
# departments
@@ -154,8 +137,6 @@ sub edit {
my $tax = 0;
my $taxaccno = "";
foreach $ref (@{ $form->{GL} }) {
- $form->{"projectnumber_$i"} = "$ref->{projectnumber}--$ref->{project_id}";
-
$j = $i - 1;
if ($tax && ($ref->{accno} eq $taxaccno)) {
$form->{"tax_$j"} = abs($ref->{amount});
@@ -167,6 +148,8 @@ sub edit {
$form->{"credit_$j"} += $form->{"tax_$j"};
}
}
+ $form->{"project_id_$j"} = $ref->{project_id};
+
} else {
$form->{"accno_$i"} = "$ref->{accno}--$ref->{tax_id}";
for (qw(fx_transaction source memo)) { $form->{"${_}_$i"} = $ref->{$_} }
@@ -178,6 +161,7 @@ sub edit {
$form->{"credit_$i"} = $ref->{amount};
}
$form->{"taxchart_$i"} = "0--0.00";
+ $form->{"project_id_$i"} = $ref->{project_id};
$i++;
}
if ($ref->{taxaccno} && !$tax) {
@@ -187,7 +171,6 @@ sub edit {
$taxaccno = "";
$tax = 0;
}
-
}
$form->{rowcount} = $i;
@@ -228,6 +211,21 @@ sub search {
| 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} = $jscalendar;
$jsscript = "";
@@ -235,12 +233,12 @@ sub search {
# with JavaScript Calendar
$button1 = qq|
-
+ |
text('button') . qq|> |
|;
$button2 = qq|
-
+ |
text('button') . qq|> |
|;
@@ -253,15 +251,17 @@ sub search {
# without JavaScript Calendar
$button1 =
- qq| | |;
+ qq| | |;
$button2 =
- qq| | |;
+ 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|
-
+
@@ -895,21 +921,7 @@ sub gl_subtotal {
sub update {
$lxdebug->enter_sub();
- if ($form->{transdate} ne $form->{oldtransdate}) {
- if ($form->{selectprojectnumber}) {
- $form->all_projects(\%myconfig, undef, $form->{transdate});
- if (@{ $form->{all_project} }) {
- $form->{selectprojectnumber} = "