X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Far.pl;h=caf48362feb16f359d1d0fd09cedf9018b13472e;hb=21e3b9697fa7e9481b79d0f16ef8cc5d0892f299;hp=0498e117dfd05bc9f68e88b2ff103c29612c0ca0;hpb=9e06d0e40cb328336d6e7604ec06387a0e3b1ea7;p=kivitendo-erp.git
diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl
index 0498e117d..caf48362f 100644
--- a/bin/mozilla/ar.pl
+++ b/bin/mozilla/ar.pl
@@ -214,7 +214,7 @@ sub form_header {
my ($title, $readonly, $exchangerate, $rows);
my ($taxincluded, $notes, $department, $customer, $employee, $amount, $project);
my ($jsscript, $button1, $button2, $onload);
- my ($selectAR_amount, $selectAR_paid, $korrektur_checked, $ARselected, $tax);
+ my ($selectAR_amount, $selectAR_paid, $ARselected, $tax);
my (@column_index, %column_data);
@@ -340,12 +340,13 @@ sub form_header {
map({ push(@old_project_ids, $form->{"project_id_$_"})
if ($form->{"project_id_$_"}); } (1..$form->{"rowcount"}));
- $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
- "all" => 0,
- "old_id" => \@old_project_ids },
- "charts" => { "key" => "ALL_CHARTS",
- "transdate" => $form->{transdate} },
- "taxcharts" => "ALL_TAXCHARTS");
+ $form->get_lists("projects" => { "key" => "ALL_PROJECTS",
+ "all" => 0,
+ "old_id" => \@old_project_ids },
+ "charts" => { "key" => "ALL_CHARTS",
+ "transdate" => $form->{transdate} },
+ "taxcharts" => { "key" => "ALL_TAXCHARTS",
+ "module" => "AR" },);
map({ $_->{link_split} = [ split(/:/, $_->{link}) ]; }
@{ $form->{ALL_CHARTS} });
@@ -544,8 +545,6 @@ $jsscript
|
. $locale->text('Tax') . qq| |
|
- . $locale->text('Korrektur') . qq| |
- |
. $locale->text('Taxkey') . qq| |
|
. $locale->text('Project') . qq| |
@@ -600,8 +599,6 @@ $jsscript
'-default' => $selected_taxchart))
. qq||;
- $korrektur_checked = ($form->{"korrektur_$i"} ? 'checked' : '');
-
my $projectnumber =
NTI($cgi->popup_menu('-name' => "project_id_$i",
'-values' => \@project_values,
@@ -612,8 +609,7 @@ $jsscript
$selectAR_amount |
{"amount_$i"}> |
- {"tax_$i"}> |
- |
+ $form->{"tax_$i"} |
$tax
$projectnumber |
@@ -932,17 +928,15 @@ sub update {
if ($form->{"amount_$i"}) {
push @a, {};
my $j = $#a;
- if (!$form->{"korrektur_$i"}) {
- my ($taxkey, $rate) = split(/--/, $form->{"taxchart_$i"});
- if ($taxkey > 1) {
- if ($form->{taxincluded}) {
- $form->{"tax_$i"} = $form->{"amount_$i"} / ($rate + 1) * $rate;
- } else {
- $form->{"tax_$i"} = $form->{"amount_$i"} * $rate;
- }
+ my ($taxkey, $rate) = split(/--/, $form->{"taxchart_$i"});
+ if ($taxkey > 1) {
+ if ($form->{taxincluded}) {
+ $form->{"tax_$i"} = $form->{"amount_$i"} / ($rate + 1) * $rate;
} else {
- $form->{"tax_$i"} = 0;
+ $form->{"tax_$i"} = $form->{"amount_$i"} * $rate;
}
+ } else {
+ $form->{"tax_$i"} = 0;
}
$form->{"tax_$i"} = $form->round_amount($form->{"tax_$i"}, 2);
@@ -1457,7 +1451,7 @@ sub ar_transactions {
$form->{customer} = $form->unescape($form->{customer});
($form->{customer}, $form->{customer_id}) = split(/--/, $form->{customer});
- $form->{sort} ||= 'transdate';
+ report_generator_set_default_sort('transdate', 1);
AR->ar_transactions(\%myconfig, \%$form);
@@ -1500,9 +1494,9 @@ sub ar_transactions {
'marge_percent' => { 'text' => $locale->text('Ertrag prozentual'), },
);
- foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid
- employee shippingpoint shipvia)) {
- $column_defs{$name}->{link} = $href . "&sort=$name";
+ foreach my $name (qw(id transdate duedate invnumber ordnumber name datepaid employee shippingpoint shipvia transaction_description)) {
+ my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
+ $column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
}
my %column_alignment = map { $_ => 'right' } qw(netamount tax amount paid due);
@@ -1515,7 +1509,7 @@ sub ar_transactions {
$report->set_export_options('ar_transactions', @hidden_variables);
- $report->set_sort_indicator($form->{sort}, 1);
+ $report->set_sort_indicator($form->{sort}, $form->{sortdir});
my @options;
if ($form->{customer}) {
@@ -1538,10 +1532,10 @@ sub ar_transactions {
push @options, $locale->text('Transaction description') . " : $form->{transaction_description}";
}
if ($form->{transdatefrom}) {
- push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1);
+ push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1);
}
if ($form->{transdateto}) {
- push @options, $locale->text('Bis') . " " . $locale->date(\%myconfig, $form->{transdateto}, 1);
+ push @options, $locale->text('Bis') . " " . $locale->date(\%myconfig, $form->{transdateto}, 1);
}
if ($form->{open}) {
push @options, $locale->text('Open');
@@ -1583,8 +1577,8 @@ sub ar_transactions {
map { $ar->{$_} = $form->format_amount(\%myconfig, $ar->{$_}, 2) } qw(netamount tax amount paid due marge_total marge_percent);
- my $is_storno = $ar->{storno} && !$ar->{storno_id};
- my $has_storno = $ar->{storno} && $ar->{storno_id};
+ my $is_storno = $ar->{storno} && $ar->{storno_id};
+ my $has_storno = $ar->{storno} && !$ar->{storno_id};
$ar->{type} =
$has_storno ? $locale->text("Invoice with Storno (abbreviation)") :