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

--- Comment #30 from Jonathan Druart <[email protected]> ---
Created attachment 202638
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=202638&action=edit
Bug 42279: (follow-up) Restore numeric compare of quantityrec

The port quoted [% quantityrec | html %] into a string const, but
the value is used as `$(this).val() < quantityrec` where both sides
are now strings and JS does a lexicographic compare ("10" < "5" is
true), giving the wrong branch when the user enters a multi-digit
quantity.

Render quantityrec as a JS number (with a 0 fallback) so the
comparison stays numeric, matching the original template output.

To test:
- Modify an existing order with quantityrec, e.g. 5 items received.
- Change quantity to 10 (higher than received): "can't add new item"
  alert fires, value reverts.
- Change quantity to 2 (lower): "don't forget to delete" alert fires.

Signed-off-by: Paul Derscheid <[email protected]>
Signed-off-by: Jan Kissig <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to