X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=026cf6a01db7871ee155d2be441bf0c15a93752e;hb=14d71a6d1215e4fc67136c060fd21cd6c59602af;hp=78be01c3de78cb67f56a83cff7239470e850d73c;hpb=affafa23d66a18e409ac424f6e27f0f1b4008725;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 78be01c3d..026cf6a01 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -218,7 +218,7 @@ sub search { $::form->get_lists( projects => { key => "ALL_PROJECTS", all => 1 }, ); - $::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]); + $::form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]); $::form->header; print $::form->parse_html_template('gl/search', { @@ -306,9 +306,6 @@ sub generate_report { # add employee here, so that variable is still known and passed in url when choosing a different sort order in resulting table my @hidden_variables = qw(accno source reference department description notes project_id datefrom dateto employee_id datesort category l_subtotal); push @hidden_variables, map { "l_${_}" } @columns; - foreach ( @hidden_variables ) { - print URL "$_\n"; - }; my $employee = $form->{employee_id} ? SL::DB::Employee->new(id => $form->{employee_id})->load->name : ''; @@ -332,8 +329,6 @@ sub generate_report { my $callback = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables); - print URL $callback; - close URL; $form->{l_credit_accno} = 'Y'; $form->{l_debit_accno} = 'Y'; @@ -594,14 +589,9 @@ sub update { } else { $credittax = 1; } - if ($form->{taxincluded}) { - $form->{"tax_$i"} = $amount / ($rate + 1) * $rate; - } else { - $form->{"tax_$i"} = $amount * $rate; - } - } else { - $form->{"tax_$i"} = 0; - } + }; + my ($tmpnetamount,$tmpdiff); + ($tmpnetamount,$form->{"tax_$i"},$tmpdiff) = $form->calculate_tax($amount,$rate,$form->{taxincluded} *= 1,2); for (@flds) { $a[$j]->{$_} = $form->{"${_}_$i"} } $count++; @@ -743,11 +733,11 @@ sub display_rows { . qq||; my $tax_ddbox = qq|| . NTI($cgi->popup_menu('-name' => "taxchart_$i", - '-id' => "taxchart_$i", - '-style' => 'width:200px', - '-values' => \@taxchart_values, - '-labels' => \%taxchart_labels, - '-default' => $selected_taxchart)) + '-id' => "taxchart_$i", + '-style' => 'width:200px', + '-values' => \@taxchart_values, + '-labels' => \%taxchart_labels, + '-default' => $selected_taxchart)) . qq||; my ($fx_transaction, $checked); @@ -967,8 +957,9 @@ sub yes { if (GL->delete_transaction(\%myconfig, \%$form)){ # saving the history if(!exists $form->{addition} && $form->{id} ne "") { - $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; + $form->{snumbers} = qq|gltransaction_| . $form->{id}; $form->{addition} = "DELETED"; + $form->{what_done} = "gl_transaction"; $form->save_history; } # /saving the history @@ -1067,16 +1058,15 @@ sub post_transaction { } else { $credittax = 1; } - if ($form->{taxincluded}) { - $form->{"tax_$i"} = $amount / ($rate + 1) * $rate; - if ($debitcredit) { - $form->{"debit_$i"} = $form->{"debit_$i"} - $form->{"tax_$i"}; - } else { - $form->{"credit_$i"} = $form->{"credit_$i"} - $form->{"tax_$i"}; - } + + my ($tmpnetamount,$tmpdiff); + ($tmpnetamount,$form->{"tax_$i"},$tmpdiff) = $form->calculate_tax($amount,$rate,$form->{taxincluded} *= 1,2); + if ($debitcredit) { + $form->{"debit_$i"} = $tmpnetamount; } else { - $form->{"tax_$i"} = $amount * $rate; + $form->{"credit_$i"} = $tmpnetamount; } + } else { $form->{"tax_$i"} = 0; } @@ -1140,9 +1130,9 @@ sub post_transaction { undef($form->{callback}); # saving the history if(!exists $form->{addition} && $form->{id} ne "") { - $form->{snumbers} = qq|ordnumber_| . $form->{ordnumber}; - $form->{addition} = "SAVED"; - $form->{what_done} = $locale->text("Buchungsnummer") . " = " . $form->{id}; + $form->{snumbers} = qq|gltransaction_| . $form->{id}; + $form->{addition} = "POSTED"; + $form->{what_done} = "gl transaction"; $form->save_history; } # /saving the history @@ -1209,8 +1199,9 @@ sub storno { # saving the history if(!exists $form->{addition} && $form->{id} ne "") { - $form->{snumbers} = "ordnumber_$form->{ordnumber}"; + $form->{snumbers} = qq|gltransaction_| . $form->{id}; $form->{addition} = "STORNO"; + $form->{what_done} = "gl_transaction"; $form->save_history; } # /saving the history