docparse-save-bill

Save new a docparse bill in the database with given data

npm install docparse-save-bill
12 downloads in the last week
48 downloads in the last month

Docparse Save Bill

Save new a docparse bill in the database with given data

Build Status Dependency Status Dependency tracking by David

Usage

var saveBill = require('docparse-save-bill');
var moment = require('moment');
var mongoose = require('mongoose');
var ObjectId = mongoose.Types.ObjectId;
var data = {
  supplierID: new ObjectId(),
  customerID: new ObjectId(),
  loginID: new ObjectId(),
  hash: 'foo hash',
  supplierCode: 'FGS',
  billNumber: 'foo bill number',
  dataType: 'pdf',
  billDate: moment(),
  accountNumber: 'foo account number',
  textPages: ['foo page 1 text', 'bar page 2 text']
};

saveBill(queryParams, function(err, bill) {
  if (err) {
    inspect(err, 'error saveing bill')
    return;
  }
  if (!bill) {
    inspect('no bill found');
    return cb();
  }
  inspect(bill.toObject(), 'found bill');
});

Installation

npm install docparse-save-bill

Example Installation

npm install docparse-save-bill mongoose moment eyespect

npm loves you