Bugzilla – Attachment 90280 Details for
Bug 18930
Move 'refund lost item fee rules' into the `circulation_rules` table
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18930: (follow-up) Amend Koha::RefundLostItemFeeRules->find
Bug-18930-follow-up-Amend-KohaRefundLostItemFeeRul.patch (text/plain), 2.05 KB, created by
Agustín Moyano
on 2019-06-03 23:59:02 UTC
(
hide
)
Description:
Bug 18930: (follow-up) Amend Koha::RefundLostItemFeeRules->find
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2019-06-03 23:59:02 UTC
Size:
2.05 KB
patch
obsolete
>From f7b10db10cb8dc2bec9cb68dac89ca4f1ea0a328 Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Mon, 6 May 2019 23:11:09 -0300 >Subject: [PATCH] Bug 18930: (follow-up) Amend > Koha::RefundLostItemFeeRules->find > >--- > Koha/RefundLostItemFeeRules.pm | 17 +++++++++++++++++ > admin/smart-rules.pl | 5 +++-- > 2 files changed, 20 insertions(+), 2 deletions(-) > >diff --git a/Koha/RefundLostItemFeeRules.pm b/Koha/RefundLostItemFeeRules.pm >index b08ac1179d..56166e60b0 100644 >--- a/Koha/RefundLostItemFeeRules.pm >+++ b/Koha/RefundLostItemFeeRules.pm >@@ -136,6 +136,23 @@ sub _choose_branch { > return $branch; > } > >+=head3 Koha::RefundLostItemFeeRules->find(); >+ >+Inherit from Koha::Objects->find(), but forces rule_name => 'refund' >+my $object = Koha::Objects->find( { col1 => $val1, col2 => $val2 } ); >+my $object = Koha::Objects->find( $id ); >+my $object = Koha::Objects->find( $idpart1, $idpart2, $attrs ); # composite PK >+ >+=cut >+ >+sub find { >+ my ( $self, @pars ) = @_; >+ >+ $pars[0]->{rule_name} = 'refund'; >+ >+ return $self->SUPER::find(@pars); >+} >+ > =head3 _default_rule (internal) > > This function returns the default rule defined for refunding lost >diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl >index 1b03aed187..653f12cebb 100755 >--- a/admin/smart-rules.pl >+++ b/admin/smart-rules.pl >@@ -526,7 +526,7 @@ elsif ( $op eq 'mod-refund-lost-item-fee-rule' ) { > ); > } > } else { >- Koha::CirculationRules->set_rules( >+ my $rule = Koha::CirculationRules->set_rules( > { > categorycode => undef, > itemtype => undef, >@@ -539,7 +539,8 @@ elsif ( $op eq 'mod-refund-lost-item-fee-rule' ) { > } > } > >-my $refundLostItemFeeRule = Koha::RefundLostItemFeeRules->find({ branchcode => $branch }); >+my $refundLostItemFeeRule = Koha::RefundLostItemFeeRules->find({ branchcode => ($branch eq '*') ? undef:$branch }); >+ > $template->param( > refundLostItemFeeRule => $refundLostItemFeeRule, > defaultRefundRule => Koha::RefundLostItemFeeRules->_default_rule >-- >2.11.0
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 18930
:
65243
|
71007
|
81101
|
81148
|
82937
|
82938
|
85492
|
85493
|
86169
|
86170
|
86171
|
89404
|
89405
|
89406
|
90280
|
90281
|
90282
|
90283
|
90284
|
90285
|
90541
|
90542
|
90543
|
90544
|
90545
|
90546
|
90547
|
90548
|
90549
|
91254
|
91255
|
91256
|
91257
|
91258
|
91259
|
91260