İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
2230 Görünümler

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

Avatar
Vazgeç
En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Eki 24
1437
1
Kas 22
5313
1
Mar 15
4936
1
Şub 22
3081
1
Oca 22
2675