Sha256: fe8acc172d1c7b5ec72c54600d852847db9ebd26aa6bdb9cf6cbc0316ec2958b

Contents?: true

Size: 1.06 KB

Versions: 2

Compression:

Stored size: 1.06 KB

Contents

class Skr.Models.Sku extends Skr.Models.Base


    props:
        id:                  {type:"integer"}
        default_vendor_id:   {type:"integer"}
        gl_asset_account_id: {type:"integer", default: ->
            Skr.Models.GlAccount.default_ids?.asset
        }
        default_uom_code:    {type:"string"}
        code:                {type:"code",   required:true}
        description:         {type:"string", required:true}
        is_other_charge:     {type:"boolean", default:false}
        does_track_inventory:{type:"boolean", default:false}
        can_backorder:       {type:"boolean", default:false}

    mixins: ['HasCodeField']

    associations:
        default_vendor:   { model: "Vendor", required: true}
        gl_asset_account: { model: "GlAccount", required: true, default: ->
            Skr.Models.GlAccount.all.get(this.gl_asset_account_id)
        }
        sku_locs:         { collection: "SkuLoc", required: true}
        sku_vendors:      { collection: "SkuVendor", required: true }
        uoms:             { collection: "Uom", inverse: 'sku' }

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stockor-0.5.0 client/skr/models/Sku.coffee
stockor-0.4.0 client/skr/models/Sku.coffee