X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fcp.pl;h=d54137e72cc84125ae5ff798fb7024b7c87347f5;hb=7f683e50d6d550b307a1c97d071e894889039ff0;hp=9348b4d30dfa4c0813bd16b8cbdffd0341a56ff5;hpb=ce498a747292baeaf103118b5073061196d981e4;p=kivitendo-erp.git diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl index 9348b4d30..d54137e72 100644 --- a/bin/mozilla/cp.pl +++ b/bin/mozilla/cp.pl @@ -58,6 +58,8 @@ sub payment { # setup customer/vendor selection for open invoices if ($form->{all_vc}) { + # Dieser Zweig funktioniert derzeit NIE. Ggf. ganz raus oder + # alle offenen Zahlungen wieder korrekt anzeigen. jb 12.10.2010 $form->all_vc(\%myconfig, $form->{vc}, $form->{ARAP}); } else { CP->get_openvc(\%myconfig, \%$form); @@ -66,22 +68,12 @@ sub payment { $form->{"select$form->{vc}"} = ""; if ($form->{"all_$form->{vc}"}) { + # s.o. jb 12.10.2010 $form->{"$form->{vc}_id"} = $form->{"all_$form->{vc}"}->[0]->{id}; map { $form->{"select$form->{vc}"} .= "$_->{name}--$_->{id}\n" } @{ $form->{"all_$form->{vc}"} }; } - # departments - if (@{ $form->{all_departments} || [] }) { - $form->{selectdepartment} = "\n"; - $form->{department} = "$form->{department}--$form->{department_id}"; - - map { - $form->{selectdepartment} .= - "$_->{description}--$_->{id}\n" - } (@{ $form->{all_departments} || [] }); - } - CP->paymentaccounts(\%myconfig, \%$form); $form->{selectaccount} = ""; @@ -95,6 +87,13 @@ sub payment { } @{ $form->{PR}{ $form->{ARAP} } }; # currencies + # oldcurrency ist zwar noch hier als fragment enthalten, wird aber bei + # der aktualisierung der form auch nicht mitübernommen. das konzept + # old_$FOO habe ich auch noch nicht verstanden ... + # Ok. Wenn currency übernommen werden, dann in callback-string über- + # geben und hier reinparsen, oder besser multibox oder html auslagern? + # Antwort: form->currency wird mit oldcurrency oder curr[0] überschrieben + # Wofür macht das Sinn? @curr = split(/:/, $form->{currencies}); chomp $curr[0]; $form->{defaultcurrency} = $form->{currency} = $form->{oldcurrency} = @@ -115,7 +114,7 @@ sub form_header { $auth->assert('cash'); - my ($vc, $vclabel, $allvc, $arap, $department, $exchangerate); + my ($vc, $vclabel, $allvc, $arap, $exchangerate); my ($jsscript, $button1, $button2, $onload); $vclabel = ucfirst $form->{vc}; @@ -156,8 +155,7 @@ sub form_header { |; } } - - foreach my $item ($form->{vc}, "account", "currency", $form->{ARAP}, "department") { + foreach my $item ($form->{vc}, "account", "currency", $form->{ARAP}) { $form->{"select$item"} =~ s/ selected//; $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/; @@ -272,7 +270,6 @@ sub form_header { - $department | . $locale->text('Account') . qq| $form->{selectaccount} @@ -487,6 +484,7 @@ sub update { } # if we switched to all_vc + # funktioniert derzeit nicht 12.10.2010 jb if ($form->{all_vc} ne $form->{oldall_vc}) { $form->{openinvoices} = ($form->{all_vc}) ? 0 : 1; @@ -502,7 +500,7 @@ sub update { "$_->{name}--$_->{id}\n" } @{ $form->{"all_$form->{vc}"} }; } - } else { + } else { # ab hier wieder ausgeführter code (s.o.): CP->get_openvc(\%myconfig, \%$form); if ($form->{"all_$form->{vc}"}) { @@ -627,7 +625,8 @@ sub post { unless $form->{exchangerate}; } - $form->{callback} = "cp.pl?action=payment&vc=$form->{vc}&muh=kuh&account=$form->{account}"; + # Beim Aktualisieren wird das Konto übernommen + $form->{callback} = "cp.pl?action=payment&vc=$form->{vc}&type=$form->{type}&account=$form->{account}&$form->{currency}"; my $msg1 = "$form->{origtitle} posted!"; my $msg2 = "Cannot post $form->{origtitle}!"; @@ -636,7 +635,8 @@ sub post { # $locale->text('Receipt posted!') # $locale->text('Cannot post Payment!') # $locale->text('Cannot post Receipt!') - + # Die Nachrichten (Receipt posted!) werden nicht angezeigt. + # Entweder wieder aktivieren oder komplett rausnehmen $form->redirect($locale->text($msg1)) if (CP->process_payment(\%myconfig, \%$form)); $form->error($locale->text($msg2)); @@ -662,7 +662,7 @@ sub check_form { 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)); + $form->error($locale->text('Amount has to be greater then zero! Wrong row number: ') . $i); } undef($selected_check); # last; # ich muss doch über alle buchungen laufen, da ich noch