/** @odoo-module **/ import { PaymentScreen } from "@point_of_sale/app/screens/payment_screen/payment_screen"; import { registry } from "@web/core/registry"; import { onMounted, useState, mount } from "@odoo/owl"; import { patch } from "@web/core/utils/patch"; import { useService } from "@web/core/utils/hooks"; import { usePos } from "@point_of_sale/app/store/pos_hook"; var current_currency,currency_id patch(PaymentScreen.prototype, { setup(){ super.setup(); this.current_currency = useState({ rate: 1, display_name: '', symbol: '', }); this.multi_currency = useState({ currencies: [], usd_val: '', name: '', total: '', symbol: '', rate: '' }); // useListener('multi-payment-line', this.multi_currency_payment_line); this.env.bus.addEventListener('multi-payment-line', this.multi_currency_payment_line.bind(this)); var currency=[] onMounted(() => { this.multi_currency.currencies = currency; this.enable_multi_currency(); }); currency.push(this.pos.currency.currency_params) }, enable_multi_currency(){ if(this.pos.config.enable_multicurrency == false){ $('.pos_multicurrency').css('display','none') } }, show_options(){ if($('.multicurrency_container')[0].style.display == 'none'){ $('.multicurrency_container').css({'display':'flex','flex-direction':'column','align-items': 'center'}) for (let i = 0, len = this.multi_currency.currencies[0].length; i < len; i++){ $('.currecy_list').append("