Bug 27290: Clean up validation
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 21 Dec 2020 16:25:47 +0000 (16:25 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 8 Feb 2021 13:56:00 +0000 (14:56 +0100)
commit01fc41ca593ee030a77c2462acda0dc59dfe7ec0
tree4c8ae2fc14f6246e405131d68270c5819cfa628d
parent4904abf1c323c6d1c4d41108e3e2eb283f008676
Bug 27290: Clean up validation

It seems we had the validator instantiated twice and we used a mix of
validation of required at form element level and in JS instantiator.

This patch moves the rules to consistently apply at the instantiation
and removes the duplicate lines.

To test:
1 - Enable 'useCashRegisters' and 'EnablePointofSale'
2 - Add a cash register
3 - Add a debit type that can be sold
4 - Go to point of sale and sell the item multiple times
5 - Enter 'Amount tendered' less than amount being paid
6 - Click confirm
7 - Transaction is processed as if full funds received
8 - Try with a negative number - goes through again

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/pos/pay.tt