Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
3 Risposte
5935 Visualizzazioni

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
Abbandona
Autore Risposta migliore


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
Abbandona
Risposta migliore

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
Abbandona
Autore

Could you share the codes how to limit it to 5000

Post correlati Risposte Visualizzazioni Attività
1
mar 17
5270
2
apr 16
3800
4
gen 16
5940
1
giu 17
6088
1
ago 24
8003