Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
1 Responder
2466 Visualizações

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

Avatar
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
3
set. 25
358
0
out. 24
1776
1
nov. 22
5687
1
mar. 15
5207
1
fev. 22
6642