summaryrefslogtreecommitdiff
path: root/addons/pos_restaurant/static/src/js/Screens/ReceiptScreen/ReceiptScreen.js
blob: 689c3bf40ca8b930a065e684ed633bde80eae8c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
odoo.define('pos_restaurant.ReceiptScreen', function(require) {
    'use strict';

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

    const PosResReceiptScreen = ReceiptScreen =>
        class extends ReceiptScreen {
            /**
             * @override
             */
            get nextScreen() {
                if (
                    this.env.pos.config.module_pos_restaurant &&
                    this.env.pos.config.iface_floorplan
                ) {
                    const table = this.env.pos.table;
                    return { name: 'FloorScreen', props: { floor: table ? table.floor : null } };
                } else {
                    return super.nextScreen;
                }
            }
        };

    Registries.Component.extend(ReceiptScreen, PosResReceiptScreen);

    return ReceiptScreen;
});