USTVA: Winston export ueberarbeitet. Kz vor die pos_ustva gesetzt, 'Kennzahl Nr'...
[kivitendo-erp.git] / bin / mozilla / ir.pl
index 39b4b88..e5b698d 100644 (file)
@@ -1017,6 +1017,10 @@ sub storno {
   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 };
   
   # saving the history
   if(!exists $form->{addition} && $form->{id} ne "") {
@@ -1095,6 +1099,9 @@ sub post {
   $form->isblank("invdate", $locale->text('Invoice Date missing!'));
   $form->isblank("vendor",  $locale->text('Vendor missing!'));
 
+  $form->{invnumber} =~ s/^\s*//g;
+  $form->{invnumber} =~ s/\s*$//g;
+
   # if the vendor changed get new values
   if (&check_name(vendor)) {
     &update;