Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
2345 Представления

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

Аватар
Отменить
Лучший ответ

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

Аватар
Отменить
Related Posts Ответы Просмотры Активность
0
окт. 24
1628
1
нояб. 22
5514
1
мар. 15
5058
1
февр. 22
5538
1
янв. 22
2824