Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
3 Antwoorden
5902 Weergaven

Is there a way to do a validation at POS when accepting a payment, Let say to limit it to an amount less than 5000?

Avatar
Annuleer
Auteur Beste antwoord


Added the following at validate_order function 

if (plines[i].get_type() === 'cash' && plines[i].get_amount() > 10000) {

                    this.pos_widget.screen_selector.show_popup('error',{

                        'message': _t('Invalid Payment'),

                        'comment': _t(plines[i].get_amount()),

                    });

                    return;

                }

Avatar
Annuleer
Beste antwoord

Hi JC,

To change the working of the Validate button and to add a validation as said above , you have to make necessary changes in the function validate_order in the screen.js in the point_of_sale module, either you can done inside the code or you can do it by custom module. custom module will be better.

Inside the function you can add the code to check the payment amount and validate it

Thank You

Avatar
Annuleer
Auteur

Could you share the codes how to limit it to 5000

Gerelateerde posts Antwoorden Weergaven Activiteit
1
mrt. 17
5259
2
apr. 16
3775
4
jan. 16
5904
1
jun. 17
6085
1
aug. 24
8000