node package manager
Stop wasting time. Easily manage code sharing in your team. Create a free org »


Generate a bill number by sha1 hashing the account number and bill date for invoices which do not have bill number printed


npm install -S docparse-bill-number


Pass in an account number and a bill date.

var getBillNumber = require('docparse-bill-number')
var accountNumber = 'foo account number'
billDate = '2012-01-05 00:00:00 +00:00'
var billNumber = getBillNumber(accountNumber, billDate)
console.log('billNumber', billNumber)

Date Format

The bill date should be a utc start of day iso-8061 formatted date string.

Format String YYYY-MM-DD HH:mm Z Sample String 2012-01-05 00:00:00 +00:00