跳至內容
選單
此問題已被標幟
1 回覆
2456 瀏覽次數

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
3
9月 25
349
0
10月 24
1770
1
11月 22
5683
1
3月 15
5206
1
2月 22
6609