X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=b14fb6f3a1f387850b5d828503fc4a00a81630a2;hb=0b280f98054da74f79cbc9fdb3e9f4c23326be53;hp=aebcd82bb11188de0e9da62f0cc354870297c187;hpb=744cfc2096349710e763d5103eef3250c52a32db;p=kivitendo-erp.git
diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl
index aebcd82bb..b14fb6f3a 100644
--- a/bin/mozilla/gl.pl
+++ b/bin/mozilla/gl.pl
@@ -32,9 +32,11 @@
#======================================================================
use SL::GL;
+use SL::IS;
use SL::PE;
-require "$form->{path}/arap.pl";
+require "bin/mozilla/arap.pl";
+require "bin/mozilla/common.pl";
1;
@@ -74,30 +76,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 +123,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 +140,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,8 +151,10 @@ sub edit {
$form->{"credit_$j"} += $form->{"tax_$j"};
}
}
+ $form->{"project_id_$j"} = $ref->{project_id};
+
} else {
- $form->{"accno_$i"} = "$ref->{accno}--$ref->{accnotaxkey}";
+ $form->{"accno_$i"} = "$ref->{accno}--$ref->{tax_id}";
for (qw(fx_transaction source memo)) { $form->{"${_}_$i"} = $ref->{$_} }
if ($ref->{amount} < 0) {
$form->{totaldebit} -= $ref->{amount};
@@ -177,7 +163,8 @@ sub edit {
$form->{totalcredit} += $ref->{amount};
$form->{"credit_$i"} = $ref->{amount};
}
- $form->{"taxchart_$i"} = "0--";
+ $form->{"taxchart_$i"} = "0--0.00";
+ $form->{"project_id_$i"} = $ref->{project_id};
$i++;
}
if ($ref->{taxaccno} && !$tax) {
@@ -187,7 +174,6 @@ sub edit {
$taxaccno = "";
$tax = 0;
}
-
}
$form->{rowcount} = $i;
@@ -195,15 +181,26 @@ sub edit {
($form->datetonum($form->{transdate}, \%myconfig) <=
$form->datetonum($form->{closedto}, \%myconfig));
+ $lxdebug->leave_sub();
+}
+
+sub edit {
+ $lxdebug->enter_sub();
+
+ 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();
+ $lxdebug->leave_sub();
}
+
sub search {
$lxdebug->enter_sub();
@@ -228,19 +225,34 @@ 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;
+ $form->{jsscript} = 1;
$jsscript = "";
if ($form->{jsscript}) {
# with JavaScript Calendar
$button1 = qq|
-
+ |
text('button') . qq|> |
|;
$button2 = qq|
-
+ |
text('button') . qq|> |
|;
@@ -253,15 +265,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|
-
+
@@ -894,21 +935,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} = "