X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fgl.pl;h=6d4cb661efeb8f9310a782c2be8b314e8da12b3c;hb=264b38c7465f95066b47588c2fbe85f102bd022c;hp=734e9c4a64bb098e244bf6932caabcb5cf2e3f35;hpb=9feb246dea491959ab77055a5a1985ae64c9776f;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 734e9c4a6..6d4cb661e 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -177,6 +177,7 @@ sub edit { $form->{totalcredit} += $ref->{amount}; $form->{"credit_$i"} = $ref->{amount}; } + $form->{"taxchart_$i"} = "0--"; $i++; } if ($ref->{taxaccno} && !$tax) { @@ -304,12 +305,8 @@ sub search { . $locale->text('All') . qq|  | . $locale->text('Asset') . qq| -  | - . $locale->text('Contra') . qq|  | . $locale->text('Liability') . qq| -  | - . $locale->text('Equity') . qq|  | . $locale->text('Revenue') . qq|  | @@ -696,14 +693,14 @@ sub generate_report { foreach $key (sort keys(%{ $ref->{debit_accno} })) { if ($key == 0) { $debitaccno = - "{accno}&callback=$callback>$ref->{debit_accno}{$key}"; + "{debit_accno}{$key}&callback=$callback>$ref->{debit_accno}{$key}"; } else { $debitaccno .= - "
{accno}&callback=$callback>$ref->{debit_accno}{$key}"; - } - if ($ref->{debit_taxkey}{$key} eq $debittaxkey) { - $ref->{debit_tax_accno}{$key} = $taxaccno; + "
{debit_accno}{$key}&callback=$callback>$ref->{debit_accno}{$key}"; } +# if ($ref->{debit_taxkey}{$key} eq $debittaxkey) { +# $ref->{debit_tax_accno}{$key} = $taxaccno; +# } $taxaccno = $ref->{debit_tax_accno}{$key}; $debittaxkey = $ref->{debit_taxkey}{$key}; } @@ -714,14 +711,14 @@ sub generate_report { foreach $key (sort keys(%{ $ref->{credit_accno} })) { if ($key == 0) { $creditaccno = - "{accno}&callback=$callback>$ref->{credit_accno}{$key}"; + "{credit_accno}{$key}&callback=$callback>$ref->{credit_accno}{$key}"; } else { $creditaccno .= - "
{accno}&callback=$callback>$ref->{credit_accno}{$key}"; - } - if ($ref->{credit_taxkey}{$key} eq $credittaxkey) { - $ref->{credit_tax_accno}{$key} = $taxaccno; + "
{credit_accno}{$key}&callback=$callback>$ref->{credit_accno}{$key}"; } +# if ($ref->{credit_taxkey}{$key} eq $credittaxkey) { +# $ref->{credit_tax_accno}{$key} = $taxaccno; +# } $taxaccno = $ref->{credit_tax_accno}{$key}; $credittaxkey = $ref->{credit_taxkey}{$key}; } @@ -730,10 +727,10 @@ sub generate_report { foreach $key (sort keys(%{ $ref->{debit_tax_accno} })) { if ($key == 0) { $debittaxaccno = - "{accno}&callback=$callback>$ref->{debit_tax_accno}{$key}"; + "{debit_tax_accno}{$key}&callback=$callback>$ref->{debit_tax_accno}{$key}"; } else { $debittaxaccno .= - "
{accno}&callback=$callback>$ref->{debit_tax_accno}{$key}"; + "
{debit_tax_accno}{$key}&callback=$callback>$ref->{debit_tax_accno}{$key}"; } } @@ -741,10 +738,10 @@ sub generate_report { foreach $key (sort keys(%{ $ref->{credit_tax_accno} })) { if ($key == 0) { $credittaxaccno = - "{accno}&callback=$callback>$ref->{credit_tax_accno}{$key}"; + "{credit_tax_accno}{$key}&callback=$callback>$ref->{credit_tax_accno}{$key}"; } else { $credittaxaccno .= - "
{accno}&callback=$callback>$ref->{credit_tax_accno}{$key}"; + "
{credit_tax_accno}{$key}&callback=$callback>$ref->{credit_tax_accno}{$key}"; } } @@ -1044,24 +1041,24 @@ sub display_rows { for $i (1 .. $form->{rowcount}) { $source = qq| - |; $memo = qq| - |; if ($init) { $accno = qq| - $form->{chartinit}|; $tax = - qq|$form->{taxchart}|; - if ($form->{selectprojectnumber}) { - $project = qq| - |; - } +# if ($form->{selectprojectnumber}) { +# $project = qq| +# |; +# } $korrektur = qq|$accno|; $tax = $taxchart; @@ -1110,14 +1107,14 @@ sub display_rows { . ($i + 10 + (($i - 1) * 8)) . qq|>$tax|; - if ($form->{selectprojectnumber}) { - $form->{"projectnumber_$i"} = "" - if $form->{selectprojectnumber} !~ /$form->{"projectnumber_$i"}/; - - $project = $form->{"projectnumber_$i"}; - $project =~ s/--.*//; - $project = qq|$project|; - } +# if ($form->{selectprojectnumber}) { +# $form->{"projectnumber_$i"} = "" +# if $form->{selectprojectnumber} !~ /$form->{"projectnumber_$i"}/; +# +# $project = $form->{"projectnumber_$i"}; +# $project =~ s/--.*//; +# $project = qq|$project|; +# } if ($form->{transfer}) { $checked = ($form->{"fx_transaction_$i"}) ? "1" : ""; @@ -1131,7 +1128,7 @@ sub display_rows { qq||; - $form->hide_form("accno_$i", "projectnumber_$i"); + $form->hide_form("accno_$i"); } else { @@ -1141,10 +1138,10 @@ sub display_rows { $tax = qq| |; - if ($form->{selectprojectnumber}) { - $project = qq| - |; - } +# if ($form->{selectprojectnumber}) { +# $project = qq| +# |; +# } $korrektur = qq| $accno $fx_transaction - - - $korrektur $tax $source $memo - $project |; } $form->hide_form(qw(rowcount selectaccno)); - print qq| -|; +# print qq| +# |; $lxdebug->leave_sub(); } @@ -1263,7 +1259,7 @@ sub form_header { # with JavaScript Calendar $button1 = qq| - {transdate} tabindex="2" $readonly> + text('button') . qq|> |; @@ -1276,7 +1272,7 @@ sub form_header { # without JavaScript Calendar $button1 = - qq|{transdate} tabindex="2" $readonly>|; + qq||; } $form->header; @@ -1546,6 +1542,19 @@ sub post { my @flds = qw(accno debit credit projectnumber fx_transaction source memo tax taxchart); + if ($form->{storno}) { + for my $i (1 .. $form->{rowcount}) { + unless (($form->{"debit_$i"} eq "") && ($form->{"credit_$i"} eq "")) { + if ($form->{"debit_$i"} ne "") { + $form->{"credit_$i"} = $form->{"debit_$i"}; + $form->{"debit_$i"} = ""; + } elsif ($form->{"credit_$i"} ne "") { + $form->{"debit_$i"} = $form->{"credit_$i"}; + $form->{"credit_$i"} = ""; + } + } + } + } for my $i (1 .. $form->{rowcount}) { @@ -1618,6 +1627,12 @@ sub post { } else { $form->{"tax_$i"} = 0; } + } elsif ($form->{taxincluded}) { + if ($debitcredit) { + $form->{"debit_$i"} = $form->{"debit_$i"} - $form->{"tax_$i"}; + } else { + $form->{"credit_$i"} = $form->{"credit_$i"} - $form->{"tax_$i"}; + } } for (@flds) { $a[$j]->{$_} = $form->{"${_}_$i"} }