Bug 2542: Validate the amount of a manual invoice/create

If a manual invoice/credit amount is not correctly set, it should not be
accepted.

Test plan:
Try to create a manual invoice and a manual credit with an amount containing
something else than numbers.
It should not be possible.

Followed test plan. Patch behaves OK, including that negative values are not allowed.
Signed-off-by: Marc Véron <veron@veron.ch>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Jonathan Druart 2015-03-18 16:49:52 +01:00 committed by Tomas Cohen Arazi
parent c4a4575923
commit 0e279fb2e0
2 changed files with 2 additions and 2 deletions

View file

@ -45,7 +45,7 @@ $(document).ready(function(){
<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
<li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
<li><label for="amount">Amount: </label><input type="text" name="amount" id="amount" /> Example: 5.00</li>
<li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="0" step="any" min="0" /> Example: 5.00</li>
</ol></fieldset>
<fieldset class="action"><input type="submit" name="add" value="Add credit" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset>

View file

@ -69,7 +69,7 @@ type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.li
<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
<li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
<li><label for="amount">Amount: </label><input type="text" name="amount" id="amount" /> Example: 5.00</li>
<li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="0" step="any" min="0" /> Example: 5.00</li>
</ol></fieldset>
<fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset>
</form>