X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ad73be9c179367f2e85c2297297581ca092738f1..545d8542873ac7cb75ed71771a1bd384fe57bfe2:/bin/mozilla/cp.pl diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl index f4a9efb20..1fa5d34c6 100644 --- a/bin/mozilla/cp.pl +++ b/bin/mozilla/cp.pl @@ -34,7 +34,6 @@ use SL::CP; use SL::IS; use SL::IR; - use strict ("vars", "subs"); #use warnings; @@ -49,7 +48,6 @@ our ($form, %myconfig, $lxdebug, $locale, $auth); sub payment { $lxdebug->enter_sub(); - $auth->assert('cash'); my (@curr); @@ -84,7 +82,6 @@ sub payment { } CP->paymentaccounts(\%myconfig, \%$form); - $form->{selectaccount} = ""; $form->{"select$form->{ARAP}"} = ""; @@ -236,12 +233,6 @@ sub form_header { - - - - @@ -295,7 +286,6 @@ sub form_header { - {oldcurrency}> $exchangerate @@ -304,8 +294,7 @@ sub form_header { - +
- - | . $locale->text('All') . qq|
$vclabel $vc| . $locale->text('Currency') . qq|
| . $locale->text('Amount') . qq|| . $form->format_amount(\%myconfig, $form->{amount}, 2) . qq|
@@ -669,6 +658,8 @@ sub post { unless $form->{exchangerate}; } + $form->{callback} = "cp.pl?action=payment&vc=$form->{vc}&muh=kuh&account=$form->{account}"; + my $msg1 = "$form->{origtitle} posted!"; my $msg2 = "Cannot post $form->{origtitle}!"; @@ -686,7 +677,7 @@ sub post { sub print { $lxdebug->enter_sub(); - + exit; # Niemand braucht mich mehr! LöschMich endlich! jb 8.10.2010 $auth->assert('cash'); my ($whole, $check, %queued, $spool, $filename, $userspath); @@ -771,11 +762,21 @@ sub check_form { if ($form->{currency} ne $form->{oldcurrency}) { &update; - exit; + ::end_of_request(); } - - $form->error($locale->text('Zero amount posting!')) if !$form->parse_amount(\%myconfig, $form->{amount}); $form->error($locale->text('Date missing!')) unless $form->{datepaid}; + my $selected_check = 1; + for my $i (1 .. $form->{rowcount}) { + if ($form->{"checked_$i"}) { + if ($form->parse_amount(\%myconfig, $form->{"paid_$i"}, 2) <= 0) { # negativen Betrag eingegeben + $form->error($locale->text('No zero or negative values, please! Correct row number:' . $i)); + } + undef($selected_check); + # last; # ich muss doch über alle buchungen laufen, da ich noch + # die freitext-eingabe der werte prüfen will + } + } + $form->error($locale->text('No transaction selected!')) if $selected_check; $closedto = $form->datetonum($form->{closedto}, \%myconfig); $datepaid = $form->datetonum($form->{datepaid}, \%myconfig);