Skip to Content
Menú
This question has been flagged
1 Respondre
2109 Vistes

it is possible to make it mandatory to choose a customer before validating the payment in POS?

Avatar
Descartar
Best Answer

Hi 

Try this code:

    const PaymentScreen = require('point_of_sale.PaymentScreen');

    const Registries = require('point_of_sale.Registries');


    const PosDeResPaymentScreen = PaymentScreen => class extends PaymentScreen {

        //@Override

        async validateOrder(isForceValidate) {const currentPartner = this.currentOrder.get_client();

        if (currentPartner == null) {

                    await this.showPopup('ErrorPopup', {

   title: _t('Unknown'),

   body: _t("Choose Customer First."),

                });


        }

                await super.validateOrder(...arguments);

    }, Registries.Component.extend(PaymentScreen, PosDeResPaymentScreen);


    return PaymentScreen;

});


Hope it helps

Avatar
Descartar
Related Posts Respostes Vistes Activitat
0
d’oct. 24
1194
1
de nov. 22
5105
1
de març 15
4839
1
de febr. 22
2026
1
de gen. 22
2582