mirror of
https://github.com/bringout/oca-ocb-pos.git
synced 2026-04-22 20:42:01 +02:00
Initial commit: Pos packages
This commit is contained in:
commit
95dfb9edb0
1301 changed files with 264148 additions and 0 deletions
|
|
@ -0,0 +1,24 @@
|
|||
odoo.define('pos_restaurant_stripe.payment', function (require) {
|
||||
"use strict";
|
||||
|
||||
var PaymentStripe = require('pos_stripe.payment');
|
||||
|
||||
PaymentStripe.include({
|
||||
captureAfterPayment: async function (processPayment, line) {
|
||||
// Don't capture if the customer can tip, in that case we
|
||||
// will capture later.
|
||||
if (! this.canBeAdjusted(line.cid)) {
|
||||
return this._super(...arguments);
|
||||
}
|
||||
},
|
||||
|
||||
canBeAdjusted: function (cid) {
|
||||
var order = this.pos.get_order();
|
||||
var line = order.get_paymentline(cid);
|
||||
return this.pos.config.set_tip_after_payment &&
|
||||
line.payment_method.use_payment_terminal === "stripe" &&
|
||||
line.card_type !== 'interac' &&
|
||||
! line.card_type.includes('eftpos');
|
||||
}
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue