X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fis.pl;h=81ba52141c6994b70ead13dbb1d7bf0a3bcbda8c;hb=b5157f97d47413e5f33cced1d0de527979ff3d61;hp=e94bb386e11dc1f8fd65baf04aeb870b6910a8ab;hpb=c63316e626c2b6723f796edeb69f508cced8aae9;p=kivitendo-erp.git
diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl
index e94bb386e..81ba52141 100644
--- a/bin/mozilla/is.pl
+++ b/bin/mozilla/is.pl
@@ -371,8 +371,8 @@ sub form_header {
my $customers = qq|
| . $locale->text('Customer') . qq| |
| .
- (($myconfig{vclimit} == 1 )
- ? qq||
+ (($myconfig{vclimit} <= scalar(@values))
+ ? qq||
: (NTI($cgi->popup_menu('-name' => 'customer', '-default' => $form->{oldcustomer},
'-onChange' => 'document.getElementById(\'update_button\').click();',
'-values' => \@values, '-labels' => \%labels)))) . qq|
@@ -1412,6 +1412,9 @@ sub post {
$form->isblank("invdate", $locale->text('Invoice Date missing!'));
$form->isblank("customer", $locale->text('Customer missing!'));
+ $form->{invnumber} =~ s/^\s*//g;
+ $form->{invnumber} =~ s/\s*$//g;
+
# if oldcustomer ne customer redo form
if (&check_name(customer)) {
&update;
@@ -1522,21 +1525,25 @@ sub storno {
}
map({ my $key = $_; delete($form->{$key})
- unless (grep({ $key eq $_ } qw(login password id type))); }
+ unless (grep({ $key eq $_ } qw(login password id stylesheet type))); }
keys(%{ $form }));
- &invoice_links;
- &prepare_invoice;
+ invoice_links();
+ prepare_invoice();
relink_accounts();
+ # Payments must not be recorded for the new storno invoice.
+ $form->{paidaccounts} = 0;
+ map { my $key = $_; delete $form->{$key} if grep { $key =~ /^$_/ } qw(datepaid_ source_ memo_ paid_ exchangerate_ AR_paid_) } keys %{ $form };
+
$form->{storno_id} = $form->{id};
$form->{storno} = 1;
$form->{id} = "";
$form->{invnumber} = "Storno zu " . $form->{invnumber};
+ $form->{rowcount}++;
- &post();
+ post();
$lxdebug->leave_sub();
-
}
sub preview {
|