Bug 21915: Add AccountAutoReconcile syspref
authorTomas Cohen Arazi <tomascohen@theke.io>
Thu, 29 Nov 2018 17:55:53 +0000 (14:55 -0300)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 10 Jan 2019 16:17:13 +0000 (16:17 +0000)
This syspref will be used to call the reconcile_balance routing as
needed.

Sponsored-by: ByWater Solutions
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 6d42f6e72c20bad116454b81ee512024179b7387)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

installer/data/mysql/atomicupdate/21915.perl [new file with mode: 0644]
installer/data/mysql/sysprefs.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref

diff --git a/installer/data/mysql/atomicupdate/21915.perl b/installer/data/mysql/atomicupdate/21915.perl
new file mode 100644 (file)
index 0000000..5389a65
--- /dev/null
@@ -0,0 +1,9 @@
+$DBversion = 'XXX';
+if( CheckVersion( $DBversion ) ) {
+    $dbh->do(q{
+        INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES
+        ('AccountAutoReconcile','0','If enabled, patron balances will get reconciled automatically on each transaction.',NULL,'YesNo');
+    });
+    SetVersion($DBversion);
+    print "Upgrade to $DBversion done (Bug 21915 - Add a way to automatically reconcile balance for patrons)\n";
+}
index 072ca5b..6298acd 100644 (file)
@@ -1,4 +1,5 @@
 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
+('AccountAutoReconcile','0',NULL,'If enabled, patron balances will get reconciled automatically on each transaction.','YesNo'),
 ('AcqCreateItem','ordering','ordering|receiving|cataloguing','Define when the item is created : when ordering, when receiving, or in cataloguing module','Choice'),
 ('AcqEnableFiles','0',NULL,'If enabled, allows librarians to upload and attach arbitrary files to invoice records.','YesNo'),
 ('AcqItemSetSubfieldsWhenReceiptIsCancelled','', '','Upon cancelling a receipt, update the items subfields if they were created when placing an order (e.g. o=5|a="bar foo")', 'Free'),
index e67fc81..322badd 100644 (file)
@@ -158,6 +158,14 @@ Circulation:
                   no: "Don't allow"
             - patrons to submit notes about checked out items.
 
+    Accounts:
+        -
+            - pref: AccountAutoReconcile
+              choices:
+                  yes: "Do"
+                  no: "Do not"
+            - reconcile patron balances automatically on each transaction adding debits or credits.
+
     Checkout Policy:
         -
             - pref: AllowTooManyOverride