Skip to Content
मेन्यू
This question has been flagged
1 Reply
2251 Views

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

Avatar
Discard
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
Discard
Related Posts Replies Views Activity
0
अक्तू॰ 24
1474
1
नव॰ 22
5337
1
मार्च 15
4954
1
फ़र॰ 22
3216
1
जन॰ 22
2681