Bug 22511: Update void method to use status
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 15 Mar 2019 14:07:24 +0000 (14:07 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 25 Apr 2019 11:02:14 +0000 (11:02 +0000)
We added a 'status' field to 'accountlines' in bug 22512 to allow for
more fined grained control over 'types' and 'states'.

This patch updates the void method to utilise this new field so we may
keep the original credit type for later auditing should it be required.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Koha/Account/Line.pm

index d2ac161..aba3183 100644 (file)
@@ -71,7 +71,11 @@ sub checkout {
 
 =head3 void
 
-$payment_accountline->void();
+  $payment_accountline->void();
+
+Used to 'void' (or reverse) a payment/credit. It will role back any offsets
+created by the application of this credit upon any debits and mark the credit
+as 'void' by updating it's status to "VOID".
 
 =cut
 
@@ -133,7 +137,7 @@ sub void {
 
             $self->set(
                 {
-                    accounttype       => 'VOID',
+                    status            => 'VOID',
                     amountoutstanding => 0,
                     amount            => 0,
                 }