Bug 18736: Add OrderPriceRounding syspref
authorNick Clemens <nick@bywatersolutions.com>
Thu, 28 Dec 2017 15:11:11 +0000 (15:11 +0000)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 21 Mar 2019 16:27:09 +0000 (16:27 +0000)
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

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

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

diff --git a/installer/data/mysql/atomicupdate/bug18736_add_rounding_syspref.perl b/installer/data/mysql/atomicupdate/bug18736_add_rounding_syspref.perl
new file mode 100644 (file)
index 0000000..0f3c77f
--- /dev/null
@@ -0,0 +1,7 @@
+$DBversion = 'XXX';  # will be replaced by the RM
+if( CheckVersion( $DBversion ) ) {
+    # $dbh->do( "INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OrderPriceRounding',NULL,'Local preference for rounding orders before calculations to ensure correct calculations','|nearest_cent','Choice')" );
+
+    SetVersion( $DBversion );
+    print "Upgrade to $DBversion done (Bug 18736 - Add syspref to control order rounding)\n";
+}
index ca5256d..0b1a9c1 100644 (file)
@@ -433,6 +433,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
 ('OpenLibraryCovers','0',NULL,'If ON Openlibrary book covers will be show','YesNo'),
 ('OpenLibrarySearch','0',NULL,'If Yes Open Library search results will show in OPAC','YesNo'),
 ('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'),
+('OrderPriceRounding','','|nearest_cent','Local preference for rounding orders before calculations to ensure correct calculations','Choice'),
 ('OverDriveCirculation','0','Enable client to see their OverDrive account','','YesNo'),
 ('OverDriveClientKey','','Client key for OverDrive integration','30','Free'),
 ('OverDriveClientSecret','','Client key for OverDrive integration','30','YesNo'),
index 81aaa50..8f9082a 100644 (file)
@@ -83,7 +83,14 @@ Acquisitions:
             - "days. Example: [30] Sets purgation of suggestions for those older than 30 days."
             - "<br><strong>WARNING:</strong> Leave this field empty if you don't want to activate this automatic feature."
             - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/purge_suggestions.pl</code> cronjob. Ask your system administrator to schedule it."
-
+        -
+            - pref: OrderPriceRounding
+              default: ''
+              choices:
+                '': Don't round
+                nearest_cent: Round
+            - to nearest cent.<br>
+            - Determines whether full precision values or rounded values should be used in price calculations
         -
             - pref: UseACQFrameworkForBiblioRecords
               default: no