From 2f23933db5d24e9da91fd079a1d0c362dad344f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 25 May 2007 12:58:59 +0000 Subject: [PATCH] Storno nur anzeigen wenn keine Zahlungen vorhanden sind. Ausserdem Code aufgeraeumt. --- bin/mozilla/ar.pl | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index d6f91e99f..a098ca9f9 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -869,9 +869,9 @@ sub form_footer { $transdate = $form->datetonum($form->{transdate}, \%myconfig); $closedto = $form->datetonum($form->{closedto}, \%myconfig); - # ToDO: insert a global check for stornos, so that a storno is only possible a limited time after saving it + # ToDO: - insert a global check for stornos, so that a storno is only possible a limited time after saving it print qq|| - if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ar') && !IS->is_storno(\%myconfig, $form, 'ar')); + if ($form->{id} && !IS->has_storno(\%myconfig, $form, 'ar') && !IS->is_storno(\%myconfig, $form, 'ar') && !$form->{paid_1}); print qq|\n|; if ($form->{id}) { @@ -1650,7 +1650,7 @@ sub ar_transactions { $column_data{invnumber} = "{id}&login=$form->{login}&password=$form->{password}&callback=$callback>$ar->{invnumber}"; - my $is_storno = $ar->{storno} && IS->is_storno(\%myconfig, $form, 'ar'); #($ar->{invnumber} =~ /^Storno zu/); # ToDO: fix this + my $is_storno = $ar->{storno} && IS->is_storno(\%myconfig, $form, 'ar'); my $has_storno = $ar->{storno} && !$is_storno; $column_data{type} = "" . @@ -1794,16 +1794,6 @@ sub storno { $form->error($locale->text("Transaction has already been cancelled!")); } - # ToDO: - # - nicht anzeigen wenn neue rechnung - # - nicht anzeigen wenn schons toniert - # - nicht anziegen wenn zahlungen da - - -# my %keep_keys = map { $_, 1 } qw(login password id stylesheet); -# map { delete $form->{$_} unless $keep_keys{$_} } keys %{ $form }; -# prepare_transaction(); - # negate amount/taxes for my $i (1 .. $form->{rowcount}) { $form->{"amount_$i"} *= -1; -- 2.20.1