summaryrefslogtreecommitdiff
path: root/addons/pos_six/static/src/js/BalanceButton.js
blob: a792aa3333da7c834169651b6bb65495dcc7f777 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
odoo.define('pos_six.BalanceButton', function(require) {
    'use strict';

    const PosComponent = require('point_of_sale.PosComponent');
    const Registries = require('point_of_sale.Registries');

    class BalanceButton extends PosComponent {
        sendBalance() {
            this.env.pos.payment_methods.map(pm => {
                if (pm.use_payment_terminal === 'six') {
                    pm.payment_terminal.send_balance();
                }
            });
        }
    }
    BalanceButton.template = 'BalanceButton';

    Registries.Component.add(BalanceButton);

    return BalanceButton;
});