it is possible to make it mandatory to choose a customer before validating the payment in POS?
This question has been flagged
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
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
|
3
Sep 25
|
1202 | ||
|
|
0
Oct 24
|
2687 | ||
|
|
1
Nov 22
|
6792 | ||
|
|
1
Mar 15
|
5975 | ||
|
|
1
Feb 22
|
9343 |