]> wagnertech.de Git - mfinanz.git/commitdiff
Implementiert #357 Auftrag schliessen, falls einmalig wiederkehrende Rechnung inaktiv
authorJan Büren <jan@kivitendo.de>
Wed, 14 Nov 2018 08:09:36 +0000 (09:09 +0100)
committerJan Büren <jan@kivitendo.de>
Wed, 14 Nov 2018 08:09:36 +0000 (09:09 +0100)
Die Generierung einer periodische Rechnung mit der Periode einmalig
sollte auch den Quell-Auftrag schliessen.

SL/DB/PeriodicInvoicesConfig.pm

index 081be3577924f9e103a30c9ed8a158c7dc332031..dd70206e2c6bc3f51a765047007536135e7c18b9 100644 (file)
@@ -141,6 +141,7 @@ sub disable_one_time_config {
   if ($self->periodicity eq 'o') {
     _log_msg("setting inactive\n");
     $self->active(0);
   if ($self->periodicity eq 'o') {
     _log_msg("setting inactive\n");
     $self->active(0);
+    $self->order->update_attributes(closed => 1);
     $self->save;
     return $self->order->ordnumber;
   }
     $self->save;
     return $self->order->ordnumber;
   }
@@ -256,7 +257,9 @@ the last invoice in that particular order value cycle.
 =item C<sub disable_one_time_config>
 
 Sets the state of the periodic_invoices_configs to inactive
 =item C<sub disable_one_time_config>
 
 Sets the state of the periodic_invoices_configs to inactive
-(active => false) if the periodicity is <Co> (one time).
+(active => false) and closes the source order (closed => true)
+if the periodicity is <Co> (one time).
+
 Returns undef if the periodicity is not 'one time' otherwise the
 order number of the deactivated periodic order.
 
 Returns undef if the periodicity is not 'one time' otherwise the
 order number of the deactivated periodic order.