<commit_before>odoo.define('pos_mercury.pos_mercury', function (require) {
"use strict";

var Class   = require('web.Class');
var Model   = require('web.Model');
var session = require('web.session');
var core    = require('web.core');
var screens = require('point_of_sale.screens');
var gui     = require('point_of_sale.gui');
var pos_model = require('point_of_sale.models');
var utils = require('web.utils');

var _t      = core._t;

var BarcodeParser = require('barcodes.BarcodeParser');
var PopupWidget = require('point_of_sale.popups');
var ScreenWidget = screens.ScreenWidget;
var PaymentScreenWidget = screens.PaymentScreenWidget;
var round_pr = utils.round_precision;

var _modelproto = pos_model.PosModel.prototype;
pos_model.PosModel = pos_model.PosModel.extend({
    getOnlinePaymentJournals: function () {
        var online_payment_journals = [];

        $.each(this.journals, function (i, val) {
            if (val.pos_mercury_config_id) {
                online_payment_journals.push({label:val.display_name, item:val.id});
            }
        });

        return online_payment_journals;
    },
    getCashRegisterByJournalID: function (journal_id) {
        var cashregister_return;

        $.each(this.cashregisters, function (index, cashregister) {
            if (cashregister.journal_id[0] === journal_id) {
                cashregister_return = cashregister;
            }
        });

        return cashregister_return;<commit_msg>[FIX] pos_mercury: load pos_mercury_config_id from account.journal<commit_after>odoo.define('pos_mercury.pos_mercury', function (require) {
"use strict";

var Class   = require('web.Class');
var Model   = require('web.Model');
var session = require('web.session');
var core    = require('web.core');
var screens = require('point_of_sale.screens');
var gui     = require('point_of_sale.gui');
var pos_model = require('point_of_sale.models');
var utils = require('web.utils');

var _t      = core._t;

var BarcodeParser = require('barcodes.BarcodeParser');
var PopupWidget = require('point_of_sale.popups');
var ScreenWidget = screens.ScreenWidget;
var PaymentScreenWidget = screens.PaymentScreenWidget;
var round_pr = utils.round_precision;

pos_model.load_fields("account.journal", "pos_mercury_config_id");

var _modelproto = pos_model.PosModel.prototype;
pos_model.PosModel = pos_model.PosModel.extend({
    getOnlinePaymentJournals: function () {
        var self = this;
        var online_payment_journals = [];

        $.each(this.journals, function (i, val) {
            if (val.pos_mercury_config_id) {
                online_payment_journals.push({label:self.getCashRegisterByJournalID(val.id).journal_id[1], item:val.id});
            }
        });

        return online_payment_journals;
    },
    getCashRegisterByJournalID: function (journal_id) {
        var cashregister_return;

        $.each(this.cashregisters, function (index, cashregister) {
            if (cashregister.journal_id[0] === journal_id) {
                cashregister_return = cashregister;
            }
        });

        return cashregister_return;
{'fraction_non_alphanumeric': 0.12060625604643663, 'fraction_numerical': 0.0009674298613350532, 'mean_word_length': 3.602373887240356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2551001', 'n_tokens_mistral': 957, 'n_tokens_neox': 936, 'n_words': 173}