Bug 17140: Make rounding syspref controlled

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick 2019-10-03 11:06:47 +00:00 committed by Martin Renvoize
parent c2df905bfe
commit ae075fded2
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
4 changed files with 9 additions and 2 deletions

View File

@ -530,6 +530,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('ReturnpathDefault','',NULL,'Use this email address as return path or bounce address for undeliverable emails','Free'),
('reviewson','1','','If ON, enables patron reviews of bibliographic records in the OPAC','YesNo'),
('RisExportAdditionalFields', '', NULL , 'Define additional RIS tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.', 'textarea'),
('RoundFinesAtPayment','0', NULL,'If enabled any fines with fractions of a cent will be rounded to the nearest cent when payments are coll ected. e.g. 1.004 will be paid off by a 1.00 payment','YesNo'),
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
('RoutingListNote','To change this note edit <a href=\"/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped\">RoutingListNote</a> system preference.','70|10','Define a note to be shown on all routing lists','Textarea'),
('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'),

View File

@ -923,6 +923,12 @@ Circulation:
type: textarea
syntax: javascript
class: code
-
- pref: RoundFinesAtPayment
choices:
yes: Do
no: "Don't"
- round fines to the nearest cent when collecting payments. Enabling this preference allows paying fines of partial cents which may not be visible in the interface.
Self Checkout:
-
- "Include the following JavaScript on all pages in the web-based self checkout:"

View File

@ -99,7 +99,7 @@ elsif ( $input->param('confirm_writeoff') ) {
my $accountline = Koha::Account::Lines->find( $accountlines_id );
$amount = $accountline->amountoutstanding if (abs($amount - $accountline->amountoutstanding) < 0.01);
$amount = $accountline->amountoutstanding if (abs($amount - $accountline->amountoutstanding) < 0.01) && C4::Context->preference('RoundFinesAtPayment');
if ( $amount > $accountline->amountoutstanding ) {
print $input->redirect( "/cgi-bin/koha/members/paycollect.pl?"
. "borrowernumber=$borrowernumber"

View File

@ -137,7 +137,7 @@ if ( $pay_individual || $writeoff_individual ) {
}
if ( $total_paid and $total_paid ne '0.00' ) {
$total_paid = $total_due if (abs($total_paid - $total_due) < 0.01);
$total_paid = $total_due if (abs($total_paid - $total_due) < 0.01) && C4::Context->preference('RoundFinesAtPayment');
if ( $total_paid < 0 or $total_paid > $total_due ) {
$template->param(
error_over => 1,