View | Details | Raw Unified | Return to bug 17443
Collapse All | Expand All

(-)a/Koha/Patron.pm (-5 / +9 lines)
Lines 218-228 Extending the subscription to the expiry date. Link Here
218
218
219
sub renew_account {
219
sub renew_account {
220
    my ($self) = @_;
220
    my ($self) = @_;
221
221
    my $date;
222
    my $date =
222
    if ( C4::Context->preference('BorrowerRenewalPeriodBase') eq 'combination' ) {
223
      C4::Context->preference('BorrowerRenewalPeriodBase') eq 'dateexpiry'
223
        $date = ( dt_from_string gt dt_from_string( $self->dateexpiry ) ) ? dt_from_string : dt_from_string( $self->dateexpiry );
224
      ? dt_from_string( $self->dateexpiry )
224
    } else {
225
      : dt_from_string;
225
        $date =
226
            C4::Context->preference('BorrowerRenewalPeriodBase') eq 'dateexpiry'
227
            ? dt_from_string( $self->dateexpiry )
228
            : dt_from_string;
229
    }
226
    my $patron_category = Koha::Patron::Categories->find( $self->categorycode );    # FIXME Should be $self->category
230
    my $patron_category = Koha::Patron::Categories->find( $self->categorycode );    # FIXME Should be $self->category
227
    my $expiry_date     = $patron_category->get_expiry_date($date);
231
    my $expiry_date     = $patron_category->get_expiry_date($date);
228
232
(-)a/installer/data/mysql/atomicupdate/bug_17443.sql (+1 lines)
Line 0 Link Here
1
UPDATE systempreferences SET options = "now|dateexpiry|combination", explanation = "Set whether the borrower renewal date should be counted from the dateexpiry, from the current date or by combination: if the dateexpiry is in future use dateexpiry, else use current date " WHERE variable = "BorrowerRenewalPeriodBase";
(-)a/installer/data/mysql/sysprefs.sql (-1 / +1 lines)
Lines 76-82 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
76
('BlockReturnOfWithdrawnItems','1','0','If enabled, items that are marked as withdrawn cannot be returned.','YesNo'),
76
('BlockReturnOfWithdrawnItems','1','0','If enabled, items that are marked as withdrawn cannot be returned.','YesNo'),
77
('BorrowerMandatoryField','surname|cardnumber',NULL,'Choose the mandatory fields for a patron\'s account','free'),
77
('BorrowerMandatoryField','surname|cardnumber',NULL,'Choose the mandatory fields for a patron\'s account','free'),
78
('borrowerRelationship','father|mother','','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','free'),
78
('borrowerRelationship','father|mother','','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','free'),
79
('BorrowerRenewalPeriodBase','now','dateexpiry|now','Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','Choice'),
79
('BorrowerRenewalPeriodBase','now','dateexpiry|now|combination','Set whether the borrower renewal date should be counted from the dateexpiry, from the current date or by combination: if the dateexpiry is in future use dateexpiry, else use current date ','Choice'),
80
('BorrowersLog','1',NULL,'If ON, log edit/create/delete actions on patron data','YesNo'),
80
('BorrowersLog','1',NULL,'If ON, log edit/create/delete actions on patron data','YesNo'),
81
('BorrowersTitles','Mr|Mrs|Miss|Ms',NULL,'Define appropriate Titles for patrons','free'),
81
('BorrowersTitles','Mr|Mrs|Miss|Ms',NULL,'Define appropriate Titles for patrons','free'),
82
('BorrowerUnwantedField','',NULL,'Name the fields you don\'t need to store for a patron\'s account','free'),
82
('BorrowerUnwantedField','',NULL,'Name the fields you don\'t need to store for a patron\'s account','free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-1 / +1 lines)
Lines 133-138 Patrons: Link Here
133
           choices:
133
           choices:
134
               now: current date.
134
               now: current date.
135
               dateexpiry: current membership expiry date.
135
               dateexpiry: current membership expiry date.
136
               combination: the later one of current and expiry date.
136
     -
137
     -
137
         - pref: TalkingTechItivaPhoneNotification
138
         - pref: TalkingTechItivaPhoneNotification
138
           choices:
139
           choices:
139
- 

Return to bug 17443