X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=9ec9becb8e71def539b85108f0a299c83dc727b1;hb=b2a7bb87ffbc75c753d106c0e6c62b9b2d0654a8;hp=a506512dd2b95898575292529353eac318d1c160;hpb=662ded382ad646d46d1e2613df42ed35ee2f6265;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index a506512dd..9ec9becb8 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -144,6 +144,8 @@ sub invoice_links { } } + my $editing = $form->{id}; + $form->backup_vars(qw(payment_id language_id taxzone_id salesman_id taxincluded cp_id intnotes id shipto_id)); IS->get_customer(\%myconfig, \%$form); @@ -166,7 +168,7 @@ sub invoice_links { IS->retrieve_invoice(\%myconfig, \%$form); $form->restore_vars(qw(payment_id language_id taxzone_id intnotes cp_id shipto_id)); $form->restore_vars(qw(taxincluded)) if $form->{id}; - $form->restore_vars(qw(salesman_id)) if $main::editing; + $form->restore_vars(qw(salesman_id)) if $editing; # build vendor/customer drop down comatibility... don't ask @@ -331,7 +333,7 @@ sub form_header { my %labels = map { $_ => $_ } @{ $form->{ALL_CURRENCIES} }; $form->{currency} = $form->{defaultcurrency} unless $form->{currency}; $TMPL_VAR{show_exchangerate} = $form->{currency} ne $form->{defaultcurrency}; - $TMPL_VAR{currencies} = NTI($cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"}, + $TMPL_VAR{currencies} = NTI($::cgi->popup_menu('-name' => 'currency', '-default' => $form->{"currency"}, '-values' => \@values, '-labels' => \%labels)) if scalar @values; push @custom_hiddens, "forex"; push @custom_hiddens, "exchangerate" if $form->{forex}; @@ -605,8 +607,6 @@ sub post_payment { $form->isblank("datepaid_$i", $locale->text('Payment date missing!')); - $form->error($locale->text('Cannot post payment for a closed period!')) - if ($form->date_closed($form->{"datepaid_$i"}, \%myconfig)); if ($form->{currency} ne $form->{defaultcurrency}) { $form->{"exchangerate_$i"} = $form->{exchangerate} @@ -616,6 +616,18 @@ sub post_payment { } } } + # Abgeschlossene Zeiträume nur für den letzten (aktuellen) Zahlungseingang prüfen + # Details s.a. Bug 1502 + # Das Problem ist jetzt, dass man Zahlungseingänge nachträglich ändern kann + # Wobei dies für Installationen die sowieso nicht mit Bücherkontrolle arbeiten keinen + # keinen Unterschied macht. + # Optimal wäre, wenn gegen einen Zeitstempel des Zahlungsfelds geprüft würde ... + # Das Problem hierbei ist, dass in IS.pm post_invoice IMMER alle Zahlungseingänge aus $form + # erneut gespeichert werden. Prinzipiell wäre es besser NUR die Änderungen des Rechnungs- + # belegs (neue Zahlung aber nichts anderes) zu speichern ... + # Vielleicht könnte man ähnlich wie bei Rechnung löschen verfahren + $form->error($locale->text('Cannot post payment for a closed period!')) + if ($form->date_closed($form->{"datepaid_$form->{paidaccounts}"}, \%myconfig)); ($form->{AR}) = split /--/, $form->{AR}; ($form->{AR_paid}) = split /--/, $form->{AR_paid}; @@ -719,10 +731,9 @@ sub post { $form->{addition} = $form->{print_and_post} ? "PRINTED AND POSTED" : $form->{storno} ? "STORNO" : "POSTED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } - # macnetix: after invoice->Post, redirect to edit. if (!$form->{no_redirect_after_post}) { $form->{action} = 'edit'; $form->{script} = 'is.pl'; @@ -941,7 +952,7 @@ sub yes { if(!exists $form->{addition}) { $form->{snumbers} = qq|invnumber_| . $form->{invnumber}; $form->{addition} = "DELETED"; - $form->save_history($form->dbconnect(\%myconfig)); + $form->save_history; } # /saving the history $form->redirect($locale->text('Invoice deleted!'));