Sha256: ae07f7b10d136b35080fa6aa88b7832464d91d077fa64891edcf4e3f419d1f9d

Contents?: true

Size: 951 Bytes

Versions: 4

Compression:

Stored size: 951 Bytes

Contents

SHARED_DATA = null
SHARED_COLLECTION = null

class Skr.Models.GlAccount extends Skr.Models.Base

    props:
        id:          {type:"integer"}
        number:      {type:"string",  required:true}
        name:        {type:"string",  required:true}
        description: {type: 'string', default: ''  }
        is_active:   {type:"boolean", default: true}

    # optional attributes from trial balance view
    session:
        balance:       {type:"bigdec"}
        branch_number: {type:"string"}

    derived:
        combined_name:
            deps: ['number', 'name'], fn: ->
                if @number and @name then "#{@number}: #{@name}" else ''

    @initialize: (data) ->
        this.default_ids = data.default_ids
        SHARED_DATA = data.accounts


Object.defineProperty Skr.Models.GlAccount, 'all',
    get: ->
        SHARED_COLLECTION ||= new Skr.Models.GlAccount.Collection(
            SHARED_DATA, comparator: 'number'
        )

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
stockor-0.5.0 client/skr/models/GlAccount.coffee
stockor-0.4.0 client/skr/models/GlAccount.coffee
stockor-0.3.0 client/skr/models/GlAccount.coffee
stockor-0.2 client/skr/models/GlAccount.coffee