Sha256: 6bf79ddc387ef19264620c1e850dc225ba2f3bbcac7820cced335d9a56c6929e

Contents?: true

Size: 1.27 KB

Versions: 4

Compression:

Stored size: 1.27 KB

Contents

class Skr.Models.InvLine extends Skr.Models.Base

    mixins: [ Skr.Models.Mixins.SkuLine ]

    props:
        id:         {type:"integer"}
        invoice_id: {type:"integer"}
        sku_loc_id: {type:"integer"}
        pt_line_id: "integer"
        so_line_id: "integer"
        price:      {type:"bigdec"}
        sku_code:   {type:"string"}
        description:{type:"string"}
        uom_code:   {type:"string",  default: 'EA'}
        uom_size:   {type:"integer", default: 1}
        position:   {type:"integer"}
        qty:        {type:"bigdec",  default:"0"}
        is_revised: {type:"boolean", default:false}

    associations:
        invoice:  { model: "Invoice" }
        so_line:  { model: "SoLine" }
        pt_line:  { model: "PtLine" }
        sku_loc:  { model: "SkuLoc" }
        sku:      { model: "Sku" }
        location: { model: "Location" }
        sku_tran: { model: "SkuTran" }

    derived:
        location_id:
            deps: ['invoice'], fn: ->
                @invoice.location_id

    modelForAccess: ->
        @invoice || this

    dataForSave: ->
        # lines should never send associations
        super(excludeAssociations: true)


    @fromSoLine: (l) ->
        invl = new Skr.Models.InvLine( l.serialize() )
        invl.unset('id')
        invl

Version data entries

4 entries across 4 versions & 1 rubygems

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