[Koha-bugs] [Bug 30755] too_soon should not be counted as an error in autorenewals

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri May 13 18:04:07 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30755

--- Comment #1 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
I noticed this whilst working on an improved notice that only display renewals
(or failures) that actually took place on that run.

Notice included below for reference (the errors count comes out incorrect)..
it's helpful to have bug 30751 to test this.

----
[%- USE String -%]
[%- now = String.new(today).truncate(10) -%]
<p>Dear [% borrower.firstname %] [% borrower.surname %],</p>

    [%- IF success -%]<p>You have [% success %] renewed item(s).</p>[%- END %]
    <ul>
    [%- FOREACH checkout IN checkouts -%]
        [%- renewaldate = String.new(checkout.lastreneweddate).truncate(10) -%]
        [%- IF !checkout.auto_renew_error && ( renewaldate == now ) %]
        <li><b>[% checkout.item.biblio.title %] : [% checkout.item.barcode
%]</b> was renewed until [% checkout.date_due | $KohaDates as_due_date => 1
%]</li>
        [%- END -%]
    [%- END -%]
    </ul>

    [%- IF error -%]<p>Item(s) that failed to renew today:</p>[%- END %]
    <ul>
    [%- FOREACH checkout IN checkouts -%]
        [%- IF checkout.auto_renew_error && checkout.auto_renew_error !=
'auto_too_soon' %]
        <li><b>[% checkout.item.biblio.title %] : [% checkout.item.barcode
-%]</b>
            [%- IF checkout.auto_renew_error == 'too_many' -%]<span
style="color:red;">has reached the maximum number of renewals
possible</span></li>
            [%- ELSIF checkout.auto_renew_error == 'on_reserve' -%]<span
style="color:red;"> is on hold for another reader.</span></li>
            [%- ELSIF checkout.auto_renew_error == 'restriction' -%]<span
style="color:red;"> won't renew because your account is currently
restricted.</span></li>
            [%- ELSIF checkout.auto_renew_error == 'overdue' -%]<span
style="color:red;"> won't renew because you have overdue items.</span></li>
            [%- ELSIF checkout.auto_renew_error == 'auto_too_late' -%]<span
style="color:red;"> won't renew because it's too late to renew this
item.</span></li>
            [%- ELSIF checkout.auto_renew_error == 'auto_too_much_oweing'
-%]<span style="color:red;"> won't renew because you have outstanding charges
on your account.</span></li>
            [%- ELSIF checkout.auto_renew_error == 'too_unseen' -%]<span
style="color:red;"> won't renew because this item must be renewed at the
library.</span></li>
            [%- END -%]
        [%- END -%]
    [%- END -%]        

<p>Thank you</p>

[% patron.homebranch.branchname %]
[% patron.homebranch.branchaddress1 %]
[% patron.homebranch.branchaddress2 %]
[% patron.homebranch.branchcity %]
[% patron.homebranch.branchzip %]

[% checkout.library.branchurl %]

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list