Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2496 Widoki

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
wrz 25
416
0
paź 24
1816
1
lis 22
5757
1
mar 15
5235
1
lut 22
6992