Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
2417 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
4
sept. 25
201
0
oct. 24
1734
1
nov. 22
5638
1
mar. 15
5150
1
feb. 22
6214