Bugzilla – Attachment 13693 Details for
Bug 7243
Do not take rentals as fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bug_7243: Rewording and renaming
bug7243-Rewording-and-renaming.patch (text/plain), 11.69 KB, created by
Srdjan Jankovic
on 2012-11-26 23:26:43 UTC
(
hide
)
Description:
bug_7243: Rewording and renaming
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2012-11-26 23:26:43 UTC
Size:
11.69 KB
patch
obsolete
>From fc41edc121de7866d4575384f03be34f9adc2118 Mon Sep 17 00:00:00 2001 >From: Srdjan <srdjan@catalyst.net.nz> >Date: Tue, 6 Nov 2012 14:12:14 +1300 >Subject: [PATCH] bug_7243: Rewording and renaming > >--- > C4/Circulation.pm | 30 ++++++++++---------- > C4/Members.pm | 22 +++++++------- > installer/data/mysql/sysprefs.sql | 4 +-- > installer/data/mysql/updatedatabase.pl | 6 ++-- > .../en/modules/admin/preferences/circulation.pref | 8 +++--- > t/db_dependent/lib/KohaTest/Members.pm | 2 +- > 6 files changed, 36 insertions(+), 36 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index ae56bbe..ed19b85 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -771,30 +771,30 @@ sub CanBookBeIssued { > # > > # DEBTS >- my ($ballance, $non_issue_ballance, $other_charges) = >- C4::Members::GetMemberAccountBallance( $borrower->{'borrowernumber'} ); >+ my ($balance, $non_issue_charges, $other_charges) = >+ C4::Members::GetMemberAccountBalance( $borrower->{'borrowernumber'} ); > my $amountlimit = C4::Context->preference("noissuescharge"); > my $allowfineoverride = C4::Context->preference("AllowFineOverride"); > my $allfinesneedoverride = C4::Context->preference("AllFinesNeedOverride"); > if ( C4::Context->preference("IssuingInProcess") ) { >- if ( $non_issue_ballance > $amountlimit && !$inprocess && !$allowfineoverride) { >- $issuingimpossible{DEBT} = sprintf( "%.2f", $non_issue_ballance ); >- } elsif ( $non_issue_ballance > $amountlimit && !$inprocess && $allowfineoverride) { >- $needsconfirmation{DEBT} = sprintf( "%.2f", $non_issue_ballance ); >- } elsif ( $allfinesneedoverride && $non_issue_ballance > 0 && $non_issue_ballance <= $amountlimit && !$inprocess ) { >- $needsconfirmation{DEBT} = sprintf( "%.2f", $non_issue_ballance ); >+ if ( $non_issue_charges > $amountlimit && !$inprocess && !$allowfineoverride) { >+ $issuingimpossible{DEBT} = sprintf( "%.2f", $non_issue_charges ); >+ } elsif ( $non_issue_charges > $amountlimit && !$inprocess && $allowfineoverride) { >+ $needsconfirmation{DEBT} = sprintf( "%.2f", $non_issue_charges ); >+ } elsif ( $allfinesneedoverride && $non_issue_charges > 0 && $non_issue_charges <= $amountlimit && !$inprocess ) { >+ $needsconfirmation{DEBT} = sprintf( "%.2f", $non_issue_charges ); > } > } > else { >- if ( $non_issue_ballance > $amountlimit && $allowfineoverride ) { >- $needsconfirmation{DEBT} = sprintf( "%.2f", $non_issue_ballance ); >- } elsif ( $non_issue_ballance > $amountlimit && !$allowfineoverride) { >- $issuingimpossible{DEBT} = sprintf( "%.2f", $non_issue_ballance ); >- } elsif ( $non_issue_ballance > 0 && $allfinesneedoverride ) { >- $needsconfirmation{DEBT} = sprintf( "%.2f", $non_issue_ballance ); >+ if ( $non_issue_charges > $amountlimit && $allowfineoverride ) { >+ $needsconfirmation{DEBT} = sprintf( "%.2f", $non_issue_charges ); >+ } elsif ( $non_issue_charges > $amountlimit && !$allowfineoverride) { >+ $issuingimpossible{DEBT} = sprintf( "%.2f", $non_issue_charges ); >+ } elsif ( $non_issue_charges > 0 && $allfinesneedoverride ) { >+ $needsconfirmation{DEBT} = sprintf( "%.2f", $non_issue_charges ); > } > } >- if ($ballance > 0 && $other_charges > 0) { >+ if ($balance > 0 && $other_charges > 0) { > $alerts{OTHER_CHARGES} = sprintf( "%.2f", $other_charges ); > } > >diff --git a/C4/Members.pm b/C4/Members.pm >index 856d55a..a6b5c6c 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -430,7 +430,7 @@ sub patronflags { > my %flags; > my ( $patroninformation) = @_; > my $dbh=C4::Context->dbh; >- my ($ballance, $owing) = GetMemberAccountBallance( $patroninformation->{'borrowernumber'}); >+ my ($balance, $owing) = GetMemberAccountBalance( $patroninformation->{'borrowernumber'}); > if ( $owing > 0 ) { > my %flaginfo; > my $noissuescharge = C4::Context->preference("noissuescharge") || 5; >@@ -441,10 +441,10 @@ sub patronflags { > } > $flags{'CHARGES'} = \%flaginfo; > } >- elsif ( $ballance < 0 ) { >+ elsif ( $balance < 0 ) { > my %flaginfo; >- $flaginfo{'message'} = sprintf "Patron has credit of \$%.02f", -$ballance; >- $flaginfo{'amount'} = sprintf "%.02f", $ballance; >+ $flaginfo{'message'} = sprintf "Patron has credit of \$%.02f", -$balance; >+ $flaginfo{'amount'} = sprintf "%.02f", $balance; > $flags{'CREDITS'} = \%flaginfo; > } > if ( $patroninformation->{'gonenoaddress'} >@@ -1140,31 +1140,31 @@ sub GetMemberAccountRecords { > return ( $total, \@acctlines,$numlines); > } > >-=head2 GetMemberAccountBallance >+=head2 GetMemberAccountBalance > >- ($total_ballance, $non_issue_ballance, $other_charges) = &GetMemberAccountBallance($borrowernumber); >+ ($total_balance, $non_issue_balance, $other_charges) = &GetMemberAccountBalance($borrowernumber); > > Calculates amount immediately owing by the patron - non-issue charges. > Based on GetMemberAccountRecords. > Charges exempt from non-issue are: > * Res (reserves) >-* Rent (rental) if RentalsInNoissueCharges syspref is set to false >-* Manual invoices if ManInvInNoissueCharges syspref is set to false >+* Rent (rental) if RentalsInNoissuesCharge syspref is set to false >+* Manual invoices if ManInvInNoissuesCharge syspref is set to false > > =cut > > my $ACCOUNT_TYPE_LENGTH = 5; # this is plain ridiculous... > > my @not_fines = ('Res'); >-push @not_fines, 'Rent' unless C4::Context->preference('RentalsInNoissueCharges'); >-unless ( C4::Context->preference('ManInvInNoissueCharges') ) { >+push @not_fines, 'Rent' unless C4::Context->preference('RentalsInNoissuesCharge'); >+unless ( C4::Context->preference('ManInvInNoissuesCharge') ) { > my $dbh = C4::Context->dbh; > my $man_inv_types = $dbh->selectcol_arrayref(qq{SELECT authorised_value FROM authorised_values WHERE category = 'MANUAL_INV'}); > push @not_fines, map substr($_, 0, $ACCOUNT_TYPE_LENGTH), @$man_inv_types; > } > my %not_fine = map {$_ => 1} @not_fines; > >-sub GetMemberAccountBallance { >+sub GetMemberAccountBalance { > my ($borrowernumber) = @_; > > my ($total, $acctlines) = GetMemberAccountRecords($borrowernumber); >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 8556cf0..dc14f5c 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -327,8 +327,8 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CircAutoPrintQuickSlip', '1', 'Choose what should happen when an empty barcode field is submitted in circulation: Display a print quick slip window or Clear the screen.',NULL,'YesNo'); >-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('RentalsInNoissueCharges', '1', 'Include rental charges when summing up charges for NoissueCharge.',NULL,'YesNo'); >-INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ManInvInNoissueCharges', '1', 'Include MAN_INV charges when summing up charges for NoissueCharge.',NULL,'YesNo'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('RentalsInNoissuesCharge', '1', 'Rental charges block checkouts (added to noissuescharge).',NULL,'YesNo'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ManInvInNoissuesCharge', '1', 'MAN_INV charges block checkouts (added to noissuescharge).',NULL,'YesNo'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('NoticeCSS','','Notices CSS url.',NULL,'free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SlipCSS','','Slips CSS url.',NULL,'free'); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('TransferWhenCancelAllWaitingHolds','0','Transfer items when cancelling all waiting holds',NULL,'YesNo'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 6f014d4..5d28561 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6024,9 +6024,9 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { > > $DBversion = "3.09.00.XXX"; > if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >- $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('RentalsInNoissueCharges', '1', 'Include rental charges when summing up charges for NoissueCharge.',NULL,'YesNo');"); >- $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ManInvInNoissueCharges', '1', 'Include MAN_INV charges when summing up charges for NoissueCharge.',NULL,'YesNo');"); >- print "Upgrade to $DBversion done (Add sysprefs RentalsInNoissueCharges and ManInvInNoissueCharges.)\n"; >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('RentalsInNoissuesCharge', '1', 'Rental charges block checkouts (added to noissuescharge).',NULL,'YesNo');"); >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('ManInvInNoissuesCharge', '1', 'MAN_INV charges block checkouts (added to noissuescharge).',NULL,'YesNo');"); >+ print "Upgrade to $DBversion done (Add sysprefs RentalsInNoissuesCharge and ManInvInNoissuesCharge.)\n"; > SetVersion($DBversion); > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index 248313c..8ca4533 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -259,17 +259,17 @@ Circulation: > class: integer > - '[% local_currency %] in fines.' > - >- - pref: RentalsInNoissueCharges >+ - pref: RentalsInNoissuesCharge > choices: > yes: Include > no: "Don't include" >- - rental charges when summing up charges for NoissueCharge. >+ - rental charges when summing up charges for noissuescharge. > - >- - pref: ManInvInNoissueCharges >+ - pref: ManInvInNoissuesCharge > choices: > yes: Include > no: "Don't include" >- - MAN_INV charges when summing up charges for NoissueCharge. >+ - MAN_INV charges when summing up charges for noissuescharge. > - > - pref: ReturnBeforeExpiry > choices: >diff --git a/t/db_dependent/lib/KohaTest/Members.pm b/t/db_dependent/lib/KohaTest/Members.pm >index 3a2d4e8..5363049 100644 >--- a/t/db_dependent/lib/KohaTest/Members.pm >+++ b/t/db_dependent/lib/KohaTest/Members.pm >@@ -27,7 +27,7 @@ sub methods : Test( 1 ) { > GetPendingIssues > GetAllIssues > GetMemberAccountRecords >- GetMemberAccountBallance >+ GetMemberAccountBalance > GetBorNotifyAcctRecord > checkuniquemember > checkcardnumber >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7243
:
6335
|
6709
|
7127
|
11943
|
12452
|
12454
|
12781
|
13261
|
13664
|
13666
|
13693
|
13917
|
14741
|
14742