wave-custom-invoice

0.3.0 • Public • Published

wave-custom-invoice

Takes Wave API data and outputs custom HTML and PDF.

Usage

First, install in your project:

npm install --save wave-custom-invoice

Next, you need to create an application in Wave, and generate a token.

You will also need a Mustache template. An example is provided in template.mustache.

In your project, require wave-custom-invoice and pass it a config object.

const wave = require('wave-custom-invoice');

const waveConfig = {
  token: 'your_wave_application_token',
  template: 'template.mustache',
  
  htmlDirectory: "./output/html",
  pdfDirectory: "./output/pdf",

  generateHTML: true,
  generatePDF: true,

  pdfConfig: {
    base: 'http://localhost:5000', // You need to serve the HTML using a web server; I suggest PHP's built-in web server
    format: "Letter",
  },
  
  locale: 'fr-ca',
  currencyFormat: '0,0.00 $', // Uses Numeral.js
  dateFormat: 'YYYY.MM.DD', // Uses Moment.js
};

wave(waveConfig);

Dependents (0)

Package Sidebar

Install

npm i wave-custom-invoice

Weekly Downloads

0

Version

0.3.0

License

none

Unpacked Size

10.1 kB

Total Files

4

Last publish

Collaborators

  • etiennedespres