From 6253364050628b600aa84c3c47df15afa2a4e7cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Wed, 14 Nov 2018 09:09:36 +0100 Subject: [PATCH] Implementiert #357 Auftrag schliessen, falls einmalig wiederkehrende Rechnung inaktiv Die Generierung einer periodische Rechnung mit der Periode einmalig sollte auch den Quell-Auftrag schliessen. --- SL/DB/PeriodicInvoicesConfig.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SL/DB/PeriodicInvoicesConfig.pm b/SL/DB/PeriodicInvoicesConfig.pm index 081be3577..dd70206e2 100644 --- a/SL/DB/PeriodicInvoicesConfig.pm +++ b/SL/DB/PeriodicInvoicesConfig.pm @@ -141,6 +141,7 @@ sub disable_one_time_config { 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; } @@ -256,7 +257,9 @@ the last invoice in that particular order value cycle. =item C Sets the state of the periodic_invoices_configs to inactive -(active => false) if the periodicity is (one time). +(active => false) and closes the source order (closed => true) +if the periodicity is (one time). + Returns undef if the periodicity is not 'one time' otherwise the order number of the deactivated periodic order. -- 2.20.1