Sha256: f42937fffb45e59c76e597a1886bcd1db3bc9750310f1784c8b59403b08b4209

Contents?: true

Size: 694 Bytes

Versions: 1

Compression:

Stored size: 694 Bytes

Contents

require 'lanes/access/extension'

module Skr

    class Extension < Lanes::Extensions::Definition

        identifier "skr"

        root_path Pathname.new(__FILE__).dirname.join("..","..").expand_path

        components 'record-finder', 'select-field'

        def client_bootstrap_data(view)
            gl_accounts = Skr::GlAccount.all.as_json
            {
                default_gl_account_ids: Hash[ Skr.config.default_gl_accounts.map{ |code,number|
                    account = gl_accounts.detect{|gla|gla['number'] == number}
                    [code, account ? account['id'] : 0]
                }],
                gl_accounts: gl_accounts
            }
        end

    end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
stockor-0.1.9 lib/skr/extension.rb