Skip to Content
Menu
This question has been flagged
1 Atsakyti
2486 Rodiniai

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

Portretas
Atmesti
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

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
3
rugs. 25
389
0
spal. 24
1804
1
lapkr. 22
5738
1
kov. 15
5223
1
vas. 22
6844