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

(-)a/Koha/Patron.pm (-5 / +9 lines)
Lines 295-305 Extending the subscription to the expiry date. Link Here
295
295
296
sub renew_account {
296
sub renew_account {
297
    my ($self) = @_;
297
    my ($self) = @_;
298
298
    my $date;
299
    my $date =
299
    if ( C4::Context->preference('BorrowerRenewalPeriodBase') eq 'combination' ) {
300
      C4::Context->preference('BorrowerRenewalPeriodBase') eq 'dateexpiry'
300
        $date = ( dt_from_string gt dt_from_string( $self->dateexpiry ) ) ? dt_from_string : dt_from_string( $self->dateexpiry );
301
      ? dt_from_string( $self->dateexpiry )
301
    } else {
302
      : dt_from_string;
302
        $date =
303
            C4::Context->preference('BorrowerRenewalPeriodBase') eq 'dateexpiry'
304
            ? dt_from_string( $self->dateexpiry )
305
            : dt_from_string;
306
    }
303
    my $patron_category = Koha::Patron::Categories->find( $self->categorycode );    # FIXME Should be $self->category
307
    my $patron_category = Koha::Patron::Categories->find( $self->categorycode );    # FIXME Should be $self->category
304
    my $expiry_date     = $patron_category->get_expiry_date($date);
308
    my $expiry_date     = $patron_category->get_expiry_date($date);
305
309
(-)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 77-83 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
77
('BlockReturnOfWithdrawnItems','1','0','If enabled, items that are marked as withdrawn cannot be returned.','YesNo'),
77
('BlockReturnOfWithdrawnItems','1','0','If enabled, items that are marked as withdrawn cannot be returned.','YesNo'),
78
('BorrowerMandatoryField','surname|cardnumber',NULL,'Choose the mandatory fields for a patron\'s account','free'),
78
('BorrowerMandatoryField','surname|cardnumber',NULL,'Choose the mandatory fields for a patron\'s account','free'),
79
('borrowerRelationship','father|mother','','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','free'),
79
('borrowerRelationship','father|mother','','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','free'),
80
('BorrowerRenewalPeriodBase','now','dateexpiry|now','Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','Choice'),
80
('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'),
81
('BorrowersLog','1',NULL,'If ON, log edit/create/delete actions on patron data','YesNo'),
81
('BorrowersLog','1',NULL,'If ON, log edit/create/delete actions on patron data','YesNo'),
82
('BorrowersTitles','Mr|Mrs|Miss|Ms',NULL,'Define appropriate Titles for patrons','free'),
82
('BorrowersTitles','Mr|Mrs|Miss|Ms',NULL,'Define appropriate Titles for patrons','free'),
83
('BorrowerUnwantedField','',NULL,'Name the fields you don\'t need to store for a patron\'s account','free'),
83
('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