       quantity: "quantityOnStock"
       channel: "supplyChannel"
 
-    rows = _.map stocks.body.results, (stock) =>
-      @_mapStocks(stock)
+    rows = _.chain(stocks.body.results)
+    .map (stock) => @_mapStocks(stock)
+    .filter (stock) -> not _.isNull(stock)
+    .value()
 
-    console.log "Export #{@i} stock entries."
+    console.log "Export #{_.size(rows)} stock entries."
     header = _.map mappings, (value, key) =>
       key
 

    if @excludeEmptyStocks && values[1] == 0
      return null
    else
      @i++
      return values

  _getValue: (stock, mapping) ->


  constructor: (excludeEmptyStocks) ->
    @excludeEmptyStocks = excludeEmptyStocks

  mapStocks: (stocks) ->
    mappings =
