Bugzilla – Attachment 124758 Details for
Bug 28985
Negative rental amounts can be saved but not enforced
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28985: Force positive numbers for itemtype charge fields
Bug-28985-Force-positive-numbers-for-itemtype-char.patch (text/plain), 4.69 KB, created by
Nick Clemens
on 2021-09-10 12:18:25 UTC
(
hide
)
Description:
Bug 28985: Force positive numbers for itemtype charge fields
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2021-09-10 12:18:25 UTC
Size:
4.69 KB
patch
obsolete
>From 1f838245012592daa11f41f8920c29be6a7ad1f5 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 10 Sep 2021 12:12:07 +0000 >Subject: [PATCH] Bug 28985: Force positive numbers for itemtype charge fields > >This patch adds a min attribute to the fields on this page and adds >other cost related fields to validator > >To test: >1 - Apply patch >2 - Browse to Administration->Item types >3 - Edit or create an item type >4 - Attempt to place a negative or non numeric value in: > Daily rental charge > Hourly rental charge > Default replacement cost > Processing fee >5 - You should not be able to >--- > .../prog/en/modules/admin/itemtypes.tt | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >index dbab84bdcb..f61e0602f0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >@@ -311,12 +311,12 @@ Item types › Administration › Koha > </li> > <li> > <label for="rentalcharge">Rental charge: </label> >- <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% itemtype.rentalcharge | $Price on_editing => 1 %]" /> >+ <input type="text" id="rentalcharge" name="rentalcharge" size="10" value="[% itemtype.rentalcharge | $Price on_editing => 1 %]" min="0" /> > <span class="hint">This fee is charged once per checkout/renewal per item</span> > </li> > <li> > <label for="rentalcharge_daily">Daily rental charge: </label> >- <input type="text" id="rentalcharge_daily" name="rentalcharge_daily" size="10" value="[% itemtype.rentalcharge_daily | $Price on_editing => 1 %]" /> >+ <input type="text" id="rentalcharge_daily" name="rentalcharge_daily" size="10" value="[% itemtype.rentalcharge_daily | $Price on_editing => 1 %]" min="0" /> > <span class="hint">This fee is charged at checkout/renewal time for each day between the checkout/renewal date and due date for loans specified in days.</span> > </li> > <li> >@@ -330,7 +330,7 @@ Item types › Administration › Koha > </li> > <li> > <label for="rentalcharge_hourly">Hourly rental charge: </label> >- <input type="text" id="rentalcharge_hourly" name="rentalcharge_hourly" size="10" value="[% itemtype.rentalcharge_hourly | $Price on_editing => 1 %]" /> >+ <input type="text" id="rentalcharge_hourly" name="rentalcharge_hourly" size="10" value="[% itemtype.rentalcharge_hourly | $Price on_editing => 1 %]" min="0" /> > <span class="hint">This fee is charged at checkout/renewal time for each hour between the checkout/renewal date and due date for loans specified in hours.</span> > </li> > <li> >@@ -344,11 +344,11 @@ Item types › Administration › Koha > </li> > <li> > <label for="defaultreplacecost">Default replacement cost: </label> >- <input type="text" id="defaultreplacecost" name="defaultreplacecost" size="10" value="[% itemtype.defaultreplacecost | $Price on_editing => 1 %]" /> >+ <input type="text" id="defaultreplacecost" name="defaultreplacecost" size="10" value="[% itemtype.defaultreplacecost | $Price on_editing => 1 %]" min="0" /> > </li> > <li> > <label for="processfee">Processing fee (when lost): </label> >- <input type="text" id="processfee" name="processfee" size="10" value="[% itemtype.processfee | $Price on_editing => 1 %]" /> >+ <input type="text" id="processfee" name="processfee" size="10" value="[% itemtype.processfee | $Price on_editing => 1 %]" min="0" /> > </li> > <li> > <label for="checkinmsg">Checkin message: </label> >@@ -601,7 +601,10 @@ Item types › Administration › Koha > rules: { > itemtype: { required: true }, > description: { required: true }, >- rentalcharge: { number: true } >+ rentalcharge: { number: true }, >+ rentalcharge_hourly: { number: true }, >+ defaultreplacecost: { number: true }, >+ processfee: { number: true } > } > }); > $("#itemtype").on("blur",function(){ >-- >2.20.1
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 28985
:
124758
|
124761
|
124798