X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fgl.pl;h=7516cf8d11e5d42e995ff0c53766396127f2f713;hb=588772c3c02c44d67cb8672749bac5f2689c2c3c;hp=1307a27969de23fb67a5ad6b94726a728a1c8b6d;hpb=3d728d80f0cb455b9cece7f2820954e79552f888;p=kivitendo-erp.git diff --git a/bin/mozilla/gl.pl b/bin/mozilla/gl.pl index 1307a2796..7516cf8d1 100644 --- a/bin/mozilla/gl.pl +++ b/bin/mozilla/gl.pl @@ -41,6 +41,7 @@ use SL::PE; use SL::ReportGenerator; require "bin/mozilla/common.pl"; +require "bin/mozilla/drafts.pl"; require "bin/mozilla/reportgenerator.pl"; 1; @@ -80,6 +81,8 @@ sub add { $auth->assert('general_ledger'); + return $lxdebug->leave_sub() if (load_draft_maybe()); + $form->{title} = "Add"; $form->{callback} = "gl.pl?action=add" unless $form->{callback}; @@ -508,7 +511,8 @@ sub generate_report { my %column_alignment; map { $column_alignment{$_} = 'right' } qw(balance id debit credit debit_tax credit_tax balance); - map { $column_alignment{$_} = 'center' } qw(transdate reference description source notes debit_accno credit_accno debit_tax_accno credit_tax_accno); + map { $column_alignment{$_} = 'center' } qw(reference debit_accno credit_accno debit_tax_accno credit_tax_accno); + map { $column_alignment{$_} = 'left' } qw(description source notes); map { $column_defs{$_}->{align} = $column_alignment{$_} } keys %column_alignment; my $report = SL::ReportGenerator->new(\%myconfig, $form); @@ -793,7 +797,7 @@ sub display_rows { my $taxchart_init; foreach my $item (@{ $form->{ALL_CHARTS} }) { my $key = $item->{accno} . "--" . $item->{tax_id}; - $taxchart_init = $item->{taxkey_id} unless (@chart_values); + $taxchart_init = $item->{tax_id} unless (@chart_values); push(@chart_values, $key); $chart_labels{$key} = $item->{accno} . "--" . $item->{description}; $charts{$item->{accno}} = $item; @@ -804,7 +808,7 @@ sub display_rows { my %taxcharts = (); foreach my $item (@{ $form->{ALL_TAXCHARTS} }) { my $key = $item->{id} . "--" . $item->{rate}; - $taxchart_init = $key if ($taxchart_init eq $item->{taxkey}); + $taxchart_init = $key if ($taxchart_init == $item->{id}); push(@taxchart_values, $key); $taxchart_labels{$key} = $item->{taxdescription} . " " . $item->{rate} * 100 . ' %'; $taxcharts{$item->{id}} = $item; @@ -839,8 +843,8 @@ sub display_rows { $selected_taxchart = "$item->{id}--$item->{rate}"; } - $selected_accno = '' if ($init); - $selected_taxchart = $taxchart_init unless ($selected_taxchart ne ""); + $selected_accno = '' if ($init); + $selected_taxchart ||= $taxchart_init; $accno = qq|| . NTI($cgi->popup_menu('-name' => "accno_$i", @@ -1292,10 +1296,20 @@ $follow_ups_block . qq|"> |; } else { + if ($form->{draft_id}) { + my $remove_draft_checked = 'checked' if ($form->{remove_draft}); + print qq|

\n| + . qq| | + . qq| \n| + . qq|

\n|; + } + print qq| - |; - print $form->parse_html_template('gl/form_footer_initial_taxkey_selection'); + | + . NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), '-class' => 'submit')) + . $cgi->hidden('-name' => 'draft_id', '-default' => [$form->{draft_id}]) + . $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}]); } print " @@ -1520,6 +1534,8 @@ sub post { post_transaction(); + remove_draft() if $form->{remove_draft}; + $form->{callback} = build_std_url("action=add", "show_details"); $form->redirect($form->{callback});